[PATCH 2/2] qla2xxx: Add map_queues support to nvme.

Nilesh Javali njavali at marvell.com
Mon Aug 23 05:56:49 PDT 2021


From: Saurav Kashyap <skashyap at marvell.com>

Add callback for map queues and use block layer
blk_mq_pci_map_queues for mapping. With this mapping
minimum 10% increase in performance is noticed.

Signed-off-by: Saurav Kashyap <skashyap at marvell.com>
Signed-off-by: Nilesh Javali <njavali at marvell.com>
---
 drivers/scsi/qla2xxx/qla_nvme.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c
index 05cad06ff165..7f9a7abc615b 100644
--- a/drivers/scsi/qla2xxx/qla_nvme.c
+++ b/drivers/scsi/qla2xxx/qla_nvme.c
@@ -8,6 +8,8 @@
 #include <linux/delay.h>
 #include <linux/nvme.h>
 #include <linux/nvme-fc.h>
+#include <linux/blk-mq-pci.h>
+#include <linux/blk-mq.h>
 
 static struct nvme_fc_port_template qla_nvme_fc_transport;
 
@@ -634,6 +636,17 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport,
 	return rval;
 }
 
+static void qla_nvme_map_queues(struct nvme_fc_local_port *lport, struct blk_mq_queue_map *map)
+{
+	int rc;
+	struct scsi_qla_host *vha = lport->private;
+
+	rc = blk_mq_pci_map_queues(map, vha->hw->pdev, vha->irq_offset);
+	if (rc)
+		ql_log(ql_log_warn, vha, 0x21de,
+		       "pci map queue failed 0x%x", rc);
+}
+
 static void qla_nvme_localport_delete(struct nvme_fc_local_port *lport)
 {
 	struct scsi_qla_host *vha = lport->private;
@@ -668,6 +681,7 @@ static struct nvme_fc_port_template qla_nvme_fc_transport = {
 	.ls_abort	= qla_nvme_ls_abort,
 	.fcp_io		= qla_nvme_post_cmd,
 	.fcp_abort	= qla_nvme_fcp_abort,
+	.map_queues	= qla_nvme_map_queues,
 	.max_hw_queues  = 8,
 	.max_sgl_segments = 1024,
 	.max_dif_sgl_segments = 64,
-- 
2.23.1




More information about the Linux-nvme mailing list