public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Justin Tee <justintee8345@gmail.com>
To: linux-scsi@vger.kernel.org
Cc: jsmart2021@gmail.com, justin.tee@broadcom.com,
	Justin Tee <justintee8345@gmail.com>
Subject: [PATCH 1/8] lpfc: Add ELS_RSP cmd to the list of WQEs to flush in lpfc_els_flush_cmd
Date: Thu, 12 Sep 2024 16:24:40 -0700	[thread overview]
Message-ID: <20240912232447.45607-2-justintee8345@gmail.com> (raw)
In-Reply-To: <20240912232447.45607-1-justintee8345@gmail.com>

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 <justin.tee@broadcom.com>
---
 drivers/scsi/lpfc/lpfc_els.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index de0ec945d2f1..7219b1ada1ea 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -9658,11 +9658,12 @@ lpfc_els_flush_cmd(struct lpfc_vport *vport)
 		if (piocb->cmd_flag & LPFC_DRIVER_ABORTED && !mbx_tmo_err)
 			continue;
 
-		/* On the ELS ring we can have ELS_REQUESTs or
-		 * GEN_REQUESTs waiting for a response.
+		/* On the ELS ring we can have ELS_REQUESTs, ELS_RSPs,
+		 * or GEN_REQUESTs waiting for a CQE response.
 		 */
 		ulp_command = get_job_cmnd(phba, piocb);
-		if (ulp_command == CMD_ELS_REQUEST64_CR) {
+		if (ulp_command == CMD_ELS_REQUEST64_WQE ||
+		    ulp_command == CMD_XMIT_ELS_RSP64_WQE) {
 			list_add_tail(&piocb->dlist, &abort_list);
 
 			/* If the link is down when flushing ELS commands
-- 
2.38.0


  reply	other threads:[~2024-09-12 23:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-12 23:24 [PATCH 0/8] Update lpfc to revision 14.4.0.5 Justin Tee
2024-09-12 23:24 ` Justin Tee [this message]
2024-09-12 23:24 ` [PATCH 2/8] lpfc: Update phba link state conditional before sending CMF_SYNC_WQE Justin Tee
2024-09-12 23:24 ` [PATCH 3/8] lpfc: Restrict support for 32 byte CDBs to specific HBAs Justin Tee
2024-09-12 23:24 ` [PATCH 4/8] lpfc: Fix kref imbalance on fabric ndlps from dev_loss_tmo handler Justin Tee
2024-09-12 23:24 ` [PATCH 5/8] lpfc: Ensure DA_ID handling completion before deleting an NPIV instance Justin Tee
2024-09-12 23:24 ` [PATCH 6/8] lpfc: Revise TRACE_EVENT log flag severities from KERN_ERR to KERN_WARNING Justin Tee
2024-09-12 23:24 ` [PATCH 7/8] lpfc: Support loopback tests with VMID enabled Justin Tee
2024-09-12 23:24 ` [PATCH 8/8] lpfc: Update lpfc version to 14.4.0.5 Justin Tee
2024-09-13  1:22 ` [PATCH 0/8] Update lpfc to revision 14.4.0.5 Martin K. Petersen
2024-09-19 15:52 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240912232447.45607-2-justintee8345@gmail.com \
    --to=justintee8345@gmail.com \
    --cc=jsmart2021@gmail.com \
    --cc=justin.tee@broadcom.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox