From: James Smart <jsmart2021@gmail.com>
To: linux-scsi@vger.kernel.org
Cc: James Smart <jsmart2021@gmail.com>,
Dick Kennedy <dick.kennedy@broadcom.com>,
James Smart <james.smart@broadcom.com>
Subject: [PATCH 08/11] Fix crash doing IO with resets
Date: Thu, 15 Jun 2017 22:56:48 -0700 [thread overview]
Message-ID: <20170616055651.9674-9-jsmart2021@gmail.com> (raw)
In-Reply-To: <20170616055651.9674-1-jsmart2021@gmail.com>
During every reset, IOCBs are allocated. So, at one point, number of
allocated IOCBs reaches maximum limit and lpfc_sli_next_iotag fails.
Allocate IOCBs only during initialization. Reuse them after every reset
instead of allocating new set of IOCBs.
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
---
drivers/scsi/lpfc/lpfc_sli.c | 22 ++++++++--------------
1 file changed, 8 insertions(+), 14 deletions(-)
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 8de70b9d79dd..e948ea05fd33 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -6927,18 +6927,6 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba)
cnt = phba->cfg_iocb_cnt * 1024;
/* We need 1 iocbq for every SGL, for IO processing */
cnt += phba->sli4_hba.nvmet_xri_cnt;
- /* Initialize and populate the iocb list per host */
- lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
- "2821 initialize iocb list %d total %d\n",
- phba->cfg_iocb_cnt, cnt);
- rc = lpfc_init_iocb_list(phba, cnt);
- if (rc) {
- lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
- "1413 Failed to init iocb list.\n");
- goto out_destroy_queue;
- }
-
- lpfc_nvmet_create_targetport(phba);
} else {
/* update host scsi xri-sgl sizes and mappings */
rc = lpfc_sli4_scsi_sgl_update(phba);
@@ -6959,18 +6947,24 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba)
}
cnt = phba->cfg_iocb_cnt * 1024;
+ }
+
+ if (!phba->sli.iocbq_lookup) {
/* Initialize and populate the iocb list per host */
lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
- "2820 initialize iocb list %d total %d\n",
+ "2821 initialize iocb list %d total %d\n",
phba->cfg_iocb_cnt, cnt);
rc = lpfc_init_iocb_list(phba, cnt);
if (rc) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
- "6301 Failed to init iocb list.\n");
+ "1413 Failed to init iocb list.\n");
goto out_destroy_queue;
}
}
+ if (phba->nvmet_support)
+ lpfc_nvmet_create_targetport(phba);
+
if (phba->nvmet_support && phba->cfg_nvmet_mrq) {
/* Post initial buffers to all RQs created */
for (i = 0; i < phba->cfg_nvmet_mrq; i++) {
--
2.11.0
next prev parent reply other threads:[~2017-06-16 5:57 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-16 5:56 [PATCH 00/11] lpfc updates for 11.4.0.1 James Smart
2017-06-16 5:56 ` [PATCH 01/11] Fix system panic when express lane enabled James Smart
2017-06-16 7:50 ` Hannes Reinecke
2017-06-16 5:56 ` [PATCH 02/11] Fix nvme_info sysfs output to be consistent James Smart
2017-06-16 7:51 ` Hannes Reinecke
2017-06-16 5:56 ` [PATCH 03/11] Vport creation is failing with "Link Down" error James Smart
2017-06-16 7:51 ` Hannes Reinecke
2017-06-16 5:56 ` [PATCH 04/11] Reduce time spent in IRQ for received NVME commands James Smart
2017-06-16 7:52 ` Hannes Reinecke
2017-06-16 5:56 ` [PATCH 05/11] Break up IO ctx list into a separate get and put list James Smart
2017-06-16 7:59 ` Hannes Reinecke
2017-06-16 5:56 ` [PATCH 06/11] Fix SLI3 drivers attempting NVME ELS commands James Smart
2017-06-16 8:00 ` Hannes Reinecke
2017-06-16 5:56 ` [PATCH 07/11] Fix crash after firmware flash when IO is running James Smart
2017-06-16 8:01 ` Hannes Reinecke
2017-06-16 5:56 ` James Smart [this message]
2017-06-16 8:02 ` [PATCH 08/11] Fix crash doing IO with resets Hannes Reinecke
2017-06-16 5:56 ` [PATCH 09/11] Fix crash in lpfc_sli_ringtxcmpl_put when nvmet gets an abort request James Smart
2017-06-16 8:02 ` Hannes Reinecke
2017-06-16 5:56 ` [PATCH 10/11] Driver responds LS_RJT to Beacon Off ELS - Linux James Smart
2017-06-16 8:03 ` Hannes Reinecke
2017-06-16 5:56 ` [PATCH 11/11] lpfc: update to revision to 11.4.0.1 James Smart
2017-06-16 8:03 ` Hannes Reinecke
2017-06-20 1:42 ` [PATCH 00/11] lpfc updates for 11.4.0.1 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=20170616055651.9674-9-jsmart2021@gmail.com \
--to=jsmart2021@gmail.com \
--cc=dick.kennedy@broadcom.com \
--cc=james.smart@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;
as well as URLs for NNTP newsgroup(s).