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

Commit 93bcc5f

Browse files
Justin Teemartinkpetersen
authored andcommitted
scsi: lpfc: Add ELS_RSP cmd to the list of WQEs to flush in lpfc_els_flush_cmd()
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]>
1 parent 5b247f0 commit 93bcc5f

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
@@ -9658,11 +9658,12 @@ lpfc_els_flush_cmd(struct lpfc_vport *vport)
96589658
if (piocb->cmd_flag & LPFC_DRIVER_ABORTED && !mbx_tmo_err)
96599659
continue;
96609660

9661-
/* On the ELS ring we can have ELS_REQUESTs or
9662-
* GEN_REQUESTs waiting for a response.
9661+
/* On the ELS ring we can have ELS_REQUESTs, ELS_RSPs,
9662+
* or GEN_REQUESTs waiting for a CQE response.
96639663
*/
96649664
ulp_command = get_job_cmnd(phba, piocb);
9665-
if (ulp_command == CMD_ELS_REQUEST64_CR) {
9665+
if (ulp_command == CMD_ELS_REQUEST64_WQE ||
9666+
ulp_command == CMD_XMIT_ELS_RSP64_WQE) {
96669667
list_add_tail(&piocb->dlist, &abort_list);
96679668

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

0 commit comments

Comments
 (0)