Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Thumshirn <jthumshirn@suse.de>2018-07-03 12:53:48 +0200
committerJohannes Thumshirn <jthumshirn@suse.de>2018-07-03 12:53:51 +0200
commit365a14c9a0ab82aa578d12e745021dcc92ce244b (patch)
treedd3a6f6512bf2cb82f9aa53be6bbea3e2bb055b4
parent3a2345854bd9abad7ebb7df82352c5086f07b63c (diff)
scsi: lpfc: correct oversubscription of nvme io requests for
an adapter (bsc#1095453).
-rw-r--r--patches.drivers/scsi-lpfc-correct-oversubscription-of-nvme-io-requests-for-an-adapter.patch100
-rw-r--r--series.conf3
2 files changed, 103 insertions, 0 deletions
diff --git a/patches.drivers/scsi-lpfc-correct-oversubscription-of-nvme-io-requests-for-an-adapter.patch b/patches.drivers/scsi-lpfc-correct-oversubscription-of-nvme-io-requests-for-an-adapter.patch
new file mode 100644
index 0000000000..fa889ab674
--- /dev/null
+++ b/patches.drivers/scsi-lpfc-correct-oversubscription-of-nvme-io-requests-for-an-adapter.patch
@@ -0,0 +1,100 @@
+From: James Smart <jsmart2021@gmail.com>
+Date: Thu, 24 May 2018 21:08:58 -0700
+Subject: scsi: lpfc: correct oversubscription of nvme io requests for an
+ adapter
+Git-commit: 4d5e789a2eb111d7f9e032d0ebaecb465a2eca8f
+Patch-mainline: v4.18-rc1
+References: bsc#1095453
+
+Under large configurations, the driver would start to log message 6065 -
+NVME out of buffers (exchanges).
+
+The driver is using the ndlp cmd_qdepth value when determining the max
+outstanding ios for an adapter. This value, by default, is set to 65536,
+which exceeds the maximum exchange counts supported on an adapter. The ndlp
+cmd_qdepth has no relevance and outstanding io count should be capped at
+the max exchange count with IO requests beyond that level getting bounced
+back with an EBUSY status so that they are retried by the block layer.
+
+Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
+Signed-off-by: James Smart <james.smart@broadcom.com>
+Reviewed-by: Hannes Reinecke <hare@suse.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Acked-by: Johannes Thumshirn <jthumshirn@suse.de>
+---
+ drivers/scsi/lpfc/lpfc_attr.c | 7 +++++++
+ drivers/scsi/lpfc/lpfc_nportdisc.c | 6 ++++++
+ drivers/scsi/lpfc/lpfc_nvme.c | 23 +++++++++++++++++++----
+ 3 files changed, 32 insertions(+), 4 deletions(-)
+
+--- a/drivers/scsi/lpfc/lpfc_attr.c
++++ b/drivers/scsi/lpfc/lpfc_attr.c
+@@ -297,6 +297,13 @@ lpfc_nvme_info_show(struct device *dev,
+ len = snprintf(buf, PAGE_SIZE, "NVME Initiator Enabled\n");
+
+ spin_lock_irq(shost->host_lock);
++ len += snprintf(buf + len, PAGE_SIZE - len,
++ "XRI Dist lpfc%d Total %d NVME %d SCSI %d ELS %d\n",
++ phba->brd_no,
++ phba->sli4_hba.max_cfg_param.max_xri,
++ phba->sli4_hba.nvme_xri_max,
++ phba->sli4_hba.scsi_xri_max,
++ lpfc_sli4_get_els_iocb_cnt(phba));
+
+ /* Port state is only one of two values for now. */
+ if (localport->port_id)
+--- a/drivers/scsi/lpfc/lpfc_nportdisc.c
++++ b/drivers/scsi/lpfc/lpfc_nportdisc.c
+@@ -1982,6 +1982,12 @@ lpfc_cmpl_prli_prli_issue(struct lpfc_vp
+ if (bf_get_be32(prli_disc, nvpr))
+ ndlp->nlp_type |= NLP_NVME_DISCOVERY;
+
++ /* This node is an NVME target. Adjust the command
++ * queue depth on this node to not exceed the available
++ * xris.
++ */
++ ndlp->cmd_qdepth = phba->sli4_hba.nvme_xri_max;
++
+ /*
+ * If prli_fba is set, the Target supports FirstBurst.
+ * If prli_fb_sz is 0, the FirstBurst size is unlimited,
+--- a/drivers/scsi/lpfc/lpfc_nvme.c
++++ b/drivers/scsi/lpfc/lpfc_nvme.c
+@@ -839,9 +839,22 @@ lpfc_nvme_io_cmd_wqe_cmpl(struct lpfc_hb
+
+ /* Sanity check on return of outstanding command */
+ if (!lpfc_ncmd || !lpfc_ncmd->nvmeCmd || !lpfc_ncmd->nrport) {
++ if (!lpfc_ncmd) {
++ lpfc_printf_vlog(vport, KERN_ERR,
++ LOG_NODE | LOG_NVME_IOERR,
++ "6071 Null lpfc_ncmd pointer. No "
++ "release, skip completion\n");
++ return;
++ }
++
+ lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE | LOG_NVME_IOERR,
+- "6071 Completion pointers bad on wqe %p.\n",
+- wcqe);
++ "6066 Missing cmpl ptrs: lpfc_ncmd %p, "
++ "nvmeCmd %p nrport %p\n",
++ lpfc_ncmd, lpfc_ncmd->nvmeCmd,
++ lpfc_ncmd->nrport);
++
++ /* Release the lpfc_ncmd regardless of the missing elements. */
++ lpfc_release_nvme_buf(phba, lpfc_ncmd);
+ return;
+ }
+ nCmd = lpfc_ncmd->nvmeCmd;
+@@ -1421,8 +1434,10 @@ lpfc_nvme_fcp_io_submit(struct nvme_fc_l
+ atomic_inc(&lport->xmt_fcp_noxri);
+ lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME_IOERR,
+ "6065 Fail IO, driver buffer pool is empty: "
+- "idx %d DID %x\n",
+- lpfc_queue_info->index, ndlp->nlp_DID);
++ "idx %d DID %x pend %d qdepth %d\n",
++ lpfc_queue_info->index, ndlp->nlp_DID,
++ atomic_read(&ndlp->cmd_pending),
++ ndlp->cmd_qdepth);
+ ret = -EBUSY;
+ lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME_IOERR,
+ "6174 Fail IO, ndlp qdepth exceeded: "
diff --git a/series.conf b/series.conf
index ae77f50b80..2a378ed01b 100644
--- a/series.conf
+++ b/series.conf
@@ -18755,6 +18755,9 @@
patches.drivers/scsi-lpfc-handle-new-link-fault-code-returned-by-adapter-firmware.patch
patches.suse/scsi-lpfc-update-driver-version-to-11-4-0-7-3.patch
+ # bsc#1095453
+ patches.drivers/scsi-lpfc-correct-oversubscription-of-nvme-io-requests-for-an-adapter.patch
+
patches.drivers/nvme-remove-nvme_revalidate_ns.patch
patches.drivers/nvme-Fix-setting-logical-block-format-when-revalidat.patch
patches.drivers/nvme-rdma-fix-concurrent-reset-and-reconnect.patch