All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Smart <jsmart2021@gmail.com>
To: linux-scsi@vger.kernel.org
Cc: James Smart <jsmart2021@gmail.com>,
	Dick Kennedy <dick.kennedy@broadcom.com>
Subject: [PATCH 01/12] lpfc: Fix RQ buffer leakage when no IOCBs available
Date: Mon, 27 Jan 2020 16:23:01 -0800	[thread overview]
Message-ID: <20200128002312.16346-2-jsmart2021@gmail.com> (raw)
In-Reply-To: <20200128002312.16346-1-jsmart2021@gmail.com>

The driver is occasionally see the following SLI Port error, requiring
reset and reinit:
 Port Status Event: ... error 1=0x52004a01, error 2=0x218

The failure means an RQ timeout. That is, the adapter had received
asynchronous receive frames, ran out of buffer slots to place the frames,
and the driver did not replenish the buffer slots before a timeout
occurred. The driver should not be so slow in replenishing buffers that
a timeout can occur.

When the driver received all the frames of a sequence, it allocates an IOCB
to put the frames in. In a situation where there was no IOCB available
for the frame of a sequence, the RQ buffer corresponding to the first frame
of the sequence was not returned to the FW. Eventually, with enough traffic
encountering the situation, the timeout occurred.

Fix by releasing the buffer back to firmware whenever there is no IOCB
for the first frame.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
---
 drivers/scsi/lpfc/lpfc_sli.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 64002b0cb02d..ab6f58bc80a4 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -17950,6 +17950,10 @@ lpfc_prep_seq(struct lpfc_vport *vport, struct hbq_dmabuf *seq_dmabuf)
 			list_add_tail(&iocbq->list, &first_iocbq->list);
 		}
 	}
+	/* Free the sequence's header buffer */
+	if (!first_iocbq)
+		lpfc_in_buf_free(vport->phba, &seq_dmabuf->dbuf);
+
 	return first_iocbq;
 }
 
-- 
2.13.7


  reply	other threads:[~2020-01-28  0:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-28  0:23 [PATCH 00/12] lpfc: Update lpfc to revision 12.6.0.4 James Smart
2020-01-28  0:23 ` James Smart [this message]
2020-01-28  0:23 ` [PATCH 02/12] lpfc: Fix lpfc_io_buf resource leak in lpfc_get_scsi_buf_s4 error path James Smart
2020-01-28  0:23 ` [PATCH 03/12] lpfc: Fix broken Credit Recovery after driver load James Smart
2020-05-12 21:28   ` Chris Hofstaedtler
2020-05-12 23:59     ` James Smart
2020-05-13  7:47       ` Chris Hofstaedtler | Deduktiva
2020-05-13 10:25       ` Chris Hofstaedtler | Deduktiva
2020-01-28  0:23 ` [PATCH 04/12] lpfc: Fix registration of ELS type support in fdmi James Smart
2020-01-28  0:23 ` [PATCH 05/12] lpfc: Fix release of hwq to clear the eq relationship James Smart
2020-01-28  0:23 ` [PATCH 06/12] lpfc: Fix compiler warning on frame size James Smart
2020-01-28  0:23 ` [PATCH 07/12] lpfc: Fix coverity errors in fmdi attribute handling James Smart
2020-01-28  0:23 ` [PATCH 08/12] lpfc: Remove handler for obsolete ELS - Read Port Status (RPS) James Smart
2020-01-28  0:23 ` [PATCH 09/12] lpfc: Clean up hba max_lun_queue_depth checks James Smart
2020-01-28  0:23 ` [PATCH 10/12] lpfc: Change lpfc_lun_queue_depth attribute to writable James Smart
2020-01-28  0:23 ` [PATCH 11/12] lpfc: Update lpfc version to 12.6.0.4 James Smart
2020-01-28  0:23 ` [PATCH 12/12] lpfc: Copyright updates for 12.6.0.4 patches James Smart
2020-02-05  3:00 ` [PATCH 00/12] lpfc: Update lpfc to revision 12.6.0.4 Martin K. Petersen
2020-02-05 19:01   ` James Smart

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=20200128002312.16346-2-jsmart2021@gmail.com \
    --to=jsmart2021@gmail.com \
    --cc=dick.kennedy@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.