]> git.baikalelectronics.ru Git - kernel.git/commitdiff
scsi: qla2xxx: Increase max limit of ql2xnvme_queues
authorShreyas Deodhar <sdeodhar@marvell.com>
Thu, 10 Mar 2022 09:26:03 +0000 (01:26 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 15 Mar 2022 04:29:15 +0000 (00:29 -0400)
Increase max limit of ql2xnvme_queues to (max_qpair - 1).

Link: https://lore.kernel.org/r/20220310092604.22950-13-njavali@marvell.com
Fixes: 1476e9e64589 ("scsi: qla2xxx: Add ql2xnvme_queues module param to configure number of NVMe queues")
Cc: stable@vger.kernel.org
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Shreyas Deodhar <sdeodhar@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_nvme.c
drivers/scsi/qla2xxx/qla_nvme.h
drivers/scsi/qla2xxx/qla_os.c

index 794a95b2e3b4650bdfe675fb56d79dd7320dc563..87c9404aa40187029ea064f79ef97e1982c08d76 100644 (file)
@@ -799,17 +799,22 @@ int qla_nvme_register_hba(struct scsi_qla_host *vha)
        ha = vha->hw;
        tmpl = &qla_nvme_fc_transport;
 
-       if (ql2xnvme_queues < MIN_NVME_HW_QUEUES || ql2xnvme_queues > MAX_NVME_HW_QUEUES) {
+       if (ql2xnvme_queues < MIN_NVME_HW_QUEUES) {
                ql_log(ql_log_warn, vha, 0xfffd,
-                   "ql2xnvme_queues=%d is out of range(MIN:%d - MAX:%d). Resetting ql2xnvme_queues to:%d\n",
-                   ql2xnvme_queues, MIN_NVME_HW_QUEUES, MAX_NVME_HW_QUEUES,
-                   DEF_NVME_HW_QUEUES);
+                   "ql2xnvme_queues=%d is lower than minimum queues: %d. Resetting ql2xnvme_queues to:%d\n",
+                   ql2xnvme_queues, MIN_NVME_HW_QUEUES, DEF_NVME_HW_QUEUES);
                ql2xnvme_queues = DEF_NVME_HW_QUEUES;
+       } else if (ql2xnvme_queues > (ha->max_qpairs - 1)) {
+               ql_log(ql_log_warn, vha, 0xfffd,
+                      "ql2xnvme_queues=%d is greater than available IRQs: %d. Resetting ql2xnvme_queues to: %d\n",
+                      ql2xnvme_queues, (ha->max_qpairs - 1),
+                      (ha->max_qpairs - 1));
+               ql2xnvme_queues = ((ha->max_qpairs - 1));
        }
 
        qla_nvme_fc_transport.max_hw_queues =
            min((uint8_t)(ql2xnvme_queues),
-               (uint8_t)(ha->max_qpairs ? ha->max_qpairs : 1));
+               (uint8_t)((ha->max_qpairs - 1) ? (ha->max_qpairs - 1) : 1));
 
        ql_log(ql_log_info, vha, 0xfffb,
               "Number of NVME queues used for this port: %d\n",
index d0e3c0e07baacd3abb2e4251cd2cfc283a2beae1..d299478371b21b3c3f11f2a23fb3494a3d697cec 100644 (file)
@@ -14,7 +14,6 @@
 #include "qla_dsd.h"
 
 #define MIN_NVME_HW_QUEUES 1
-#define MAX_NVME_HW_QUEUES 128
 #define DEF_NVME_HW_QUEUES 8
 
 #define NVME_ATIO_CMD_OFF 32
index 81451c11eef4d7e823cf0860b9162c120eb2dcc6..762229d495a8c85848e4b23951cfb47391882c4e 100644 (file)
@@ -344,7 +344,6 @@ MODULE_PARM_DESC(ql2xnvme_queues,
        "Number of NVMe Queues that can be configured.\n"
        "Final value will be min(ql2xnvme_queues, num_cpus,num_chip_queues)\n"
        "1 - Minimum number of queues supported\n"
-       "128 - Maximum number of queues supported\n"
        "8 - Default value");
 
 static struct scsi_transport_template *qla2xxx_transport_template = NULL;