Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit ab88c77

Browse files
Justin Teegregkh
authored andcommitted
scsi: lpfc: Add ELS_RSP cmd to the list of WQEs to flush in lpfc_els_flush_cmd()
[ Upstream commit 93bcc5f ] During HBA stress testing, a spam of received PLOGIs exposes a resource recovery bug causing leakage of lpfc_sqlq entries from the global phba->sli4_hba.lpfc_els_sgl_list. The issue is in lpfc_els_flush_cmd(), where the driver attempts to recover outstanding ELS sgls when walking the txcmplq. Only CMD_ELS_REQUEST64_CRs and CMD_GEN_REQUEST64_CRs are added to the abort and cancel lists. A check for CMD_XMIT_ELS_RSP64_WQE is missing in order to recover LS_ACC usages of the phba->sli4_hba.lpfc_els_sgl_list too. Fix by adding CMD_XMIT_ELS_RSP64_WQE as part of the txcmplq walk when adding WQEs to the abort and cancel list in lpfc_els_flush_cmd(). Also, update naming convention from CRs to WQEs. Signed-off-by: Justin Tee <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 5da9855 commit ab88c77

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/scsi/lpfc/lpfc_els.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9649,11 +9649,12 @@ lpfc_els_flush_cmd(struct lpfc_vport *vport)
96499649
if (piocb->cmd_flag & LPFC_DRIVER_ABORTED && !mbx_tmo_err)
96509650
continue;
96519651

9652-
/* On the ELS ring we can have ELS_REQUESTs or
9653-
* GEN_REQUESTs waiting for a response.
9652+
/* On the ELS ring we can have ELS_REQUESTs, ELS_RSPs,
9653+
* or GEN_REQUESTs waiting for a CQE response.
96549654
*/
96559655
ulp_command = get_job_cmnd(phba, piocb);
9656-
if (ulp_command == CMD_ELS_REQUEST64_CR) {
9656+
if (ulp_command == CMD_ELS_REQUEST64_WQE ||
9657+
ulp_command == CMD_XMIT_ELS_RSP64_WQE) {
96579658
list_add_tail(&piocb->dlist, &abort_list);
96589659

96599660
/* If the link is down when flushing ELS commands

0 commit comments

Comments
 (0)