Skip to contentSkip to conversation

qla2xxx: support for multi- queue adapter

PATCH In review Anirban Chakraborty 2 participants 3 messages Dec 10, 2008 – Dec 17, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qla2xxx: support for multi- queue adapter

Following changes have been made.
1. qla_hw_data structure holds an array for request queue pointers, and an array for response queue pointers.
2. The base request and response queues are created by default.
3. Additional request and response queues are created at the time of vport creation. If queue resources are exhausted during vport creation, newly created vports use the default queue.
4. Requests are sent to the request queue that the vport was assigned in the beginning.
5. Responses are completed on the response queue with which the request queue is associated with.

The patch is generated against the scsi-misc-2.6 tree. Please apply.

Thanks,
Anirban

---
 drivers/scsi/qla2xxx/qla_attr.c    |   30 +++-
 drivers/scsi/qla2xxx/qla_dbg.c     |   67 +++++--
 drivers/scsi/qla2xxx/qla_dbg.h     |   15 ++-
 drivers/scsi/qla2xxx/qla_def.h     |   64 +++++-
 drivers/scsi/qla2xxx/qla_fw.h      |   14 +-
 drivers/scsi/qla2xxx/qla_gbl.h     |   41 +++-
 drivers/scsi/qla2xxx/qla_gs.c      |    6 -
 drivers/scsi/qla2xxx/qla_init.c    |  192 ++++++++++++-----
 drivers/scsi/qla2xxx/qla_inline.h  |   26 ---
 drivers/scsi/qla2xxx/qla_iocb.c    |  158 +++++++++-----
 drivers/scsi/qla2xxx/qla_isr.c     |  335 ++++++++++++++++++++--------
 drivers/scsi/qla2xxx/qla_mbx.c     |  147 +++++++++++--
 drivers/scsi/qla2xxx/qla_mid.c     |  349 +++++++++++++++++++++++++++++-
 drivers/scsi/qla2xxx/qla_os.c      |  423 +++++++++++++++++++++++-------------
 drivers/scsi/qla2xxx/qla_sup.c     |   33 ++-
 drivers/scsi/qla2xxx/qla_version.h |    4 +-
 16 files changed, 1443 insertions(+), 461 deletions(-)
drivers/scsi/qla2xxx/qla_attr.c +29 -1
index b223842..cd53627 100644
@@ -1143,8 +1143,11 @@ static int
 qla24xx_vport_create(struct fc_vport *fc_vport, bool disable)
 {
 	int	ret = 0;
+	int	cnt = 0;
+	uint8_t	qos = QLA_DEFAULT_QUE_QOS;
 	scsi_qla_host_t *base_vha = shost_priv(fc_vport->shost);
 	scsi_qla_host_t *vha = NULL;
+	struct qla_hw_data *ha = base_vha->hw;
 
 	ret = qla24xx_vport_create_req_sanity_check(fc_vport);
 	if (ret) {
@@ -1200,6 +1203,22 @@ qla24xx_vport_create(struct fc_vport *fc_vport, bool disable)
 
 	qla24xx_vport_disable(fc_vport, disable);
 
+	/* Create a queue pair for the vport */
+	if (ha->mqenable) {
+		if (ha->npiv_info) {
+			for (; cnt < ha->nvram_npiv_size; cnt++) {
+				if (ha->npiv_info[cnt].port_name ==
+					vha->port_name &&
+					ha->npiv_info[cnt].node_name ==
+					vha->node_name) {
+					qos = ha->npiv_info[cnt].q_qos;
+					break;
+				}
+			}
+		}
+		qla25xx_create_queues(vha, qos);
+	}
+
 	return 0;
 vport_create_failed_2:
 	qla24xx_disable_vp(vha);
@@ -1213,11 +1232,20 @@ qla24xx_vport_delete(struct fc_vport *fc_vport)
 {
 	scsi_qla_host_t *vha = fc_vport->dd_data;
 	fc_port_t *fcport, *tfcport;
+	struct qla_hw_data *ha = vha->hw;
+	uint16_t id = vha->vp_idx;
 
 	while (test_bit(LOOP_RESYNC_ACTIVE, &vha->dpc_flags) ||
 	    test_bit(FCPORT_UPDATE_NEEDED, &vha->dpc_flags))
 		msleep(1000);
 
+	if (ha->mqenable) {
+		if (qla25xx_delete_queues(vha, 0) != QLA_SUCCESS)
+			qla_printk(KERN_WARNING, ha,
+				"Queue delete failed.\n");
+		vha->req_ques[0] = ha->req_q_map[0]->id;
+	}
+
 	qla24xx_disable_vp(vha);
 
 	fc_remove_host(vha->host);
@@ -1240,7 +1268,7 @@ qla24xx_vport_delete(struct fc_vport *fc_vport)
         }
 
 	scsi_host_put(vha->host);
-
+	qla_printk(KERN_INFO, ha, "vport %d deleted\n", id);
 	return 0;
 }
 
drivers/scsi/qla2xxx/qla_dbg.c +53 -14

173 lines not on this page · raw message

drivers/scsi/qla2xxx/qla_dbg.h +14 -1
index 2e9c0c0..c1794a7 100644
@@ -4,6 +4,9 @@
  *
  * See LICENSE.qla2xxx for copyright and licensing details.
  */
+
+#include "qla_def.h"
+
 /*
  * Driver debug definitions.
  */
@@ -23,6 +26,7 @@
 /* #define QL_DEBUG_LEVEL_14 */ /* Output RSCN trace msgs */
 /* #define QL_DEBUG_LEVEL_15 */ /* Output NPIV trace msgs */
 /* #define QL_DEBUG_LEVEL_16 */ /* Output ISP84XX trace msgs */
+/* #define QL_DEBUG_LEVEL_17 */ /* Output MULTI-Q trace messages */
 
 /*
 * Macros use for debugging the driver.
@@ -43,6 +47,7 @@
 #define DEBUG2_11(x)	do { if (ql2xextended_error_logging) { x; } } while (0)
 #define DEBUG2_13(x)	do { if (ql2xextended_error_logging) { x; } } while (0)
 #define DEBUG2_16(x)	do { if (ql2xextended_error_logging) { x; } } while (0)
+#define DEBUG2_17(x) 	do { if (ql2xextended_error_logging) { x; } } while (0)
 
 #if defined(QL_DEBUG_LEVEL_3)
 #define DEBUG3(x)	do {x;} while (0)
@@ -127,7 +132,6 @@
 #else
 #define DEBUG16(x)	do {} while (0)
 #endif
-
 /*
  * Firmware Dump structure definition
  */
@@ -266,8 +270,17 @@ struct qla2xxx_fce_chain {
 	uint32_t eregs[8];
 };
 
+struct qla2xxx_mq_chain {
+	uint32_t type;
+	uint32_t chain_size;
+
+	uint32_t count;
+	uint32_t qregs[4 * QLA_MQ_SIZE];
+};
+
 #define DUMP_CHAIN_VARIANT	0x80000000
 #define DUMP_CHAIN_FCE		0x7FFFFAF0
+#define DUMP_CHAIN_MQ		0x7FFFFAF1
 #define DUMP_CHAIN_LAST		0x80000000
 
 struct qla2xxx_fw_dump {
drivers/scsi/qla2xxx/qla_def.h +52 -12

146 lines not on this page · raw message

drivers/scsi/qla2xxx/qla_fw.h +9 -5
index d1d1420..ee1f1e7 100644
@@ -299,7 +299,8 @@ struct init_cb_24xx {
 	uint32_t response_q_address[2];
 	uint32_t prio_request_q_address[2];
 
-	uint8_t reserved_2[8];
+	uint16_t msix;
+	uint8_t reserved_2[6];
 
 	uint16_t atio_q_inpointer;
 	uint16_t atio_q_length;
@@ -372,8 +373,9 @@ struct init_cb_24xx {
 	 * BIT 17-31 = Reserved
 	 */
 	uint32_t firmware_options_3;
-
-	uint8_t  reserved_3[24];
+	uint16_t qos;
+	uint16_t rid;
+	uint8_t  reserved_3[20];
 };
 
 /*
@@ -754,7 +756,8 @@ struct abort_entry_24xx {
 
 	uint32_t handle_to_abort;	/* System handle to abort. */
 
-	uint8_t reserved_1[32];
+	uint16_t req_que_no;
+	uint8_t reserved_1[30];
 
 	uint8_t port_id[3];		/* PortID of destination port. */
 	uint8_t vp_index;
@@ -1258,7 +1261,8 @@ struct qla_npiv_header {
 struct qla_npiv_entry {
 	uint16_t flags;
 	uint16_t vf_id;
-	uint16_t qos;
+	uint8_t q_qos;
+	uint8_t f_qos;
 	uint16_t unused1;
 	uint8_t port_name[WWN_SIZE];
 	uint8_t node_name[WWN_SIZE];
drivers/scsi/qla2xxx/qla_gbl.h +31 -10

88 lines not on this page · raw message

drivers/scsi/qla2xxx/qla_gs.c +0 -6
index db8de06..0a6f729 100644
@@ -1668,12 +1668,6 @@ qla2x00_fdmi_register(scsi_qla_host_t *vha)
 {
 	int rval;
 
-	if (IS_QLA2100(vha->hw) || IS_QLA2200(vha->hw)) {
-		DEBUG2(printk("scsi(%ld): FDMI unsupported on "
-		    "ISP2100/ISP2200.\n", vha->host_no));
-		return QLA_SUCCESS;
-	}
-
 	rval = qla2x00_mgmt_svr_login(vha);
 	if (rval)
 		return rval;
drivers/scsi/qla2xxx/qla_init.c +142 -50

476 lines not on this page · raw message

drivers/scsi/qla2xxx/qla_inline.h +0 -26
index 8ce3547..507a6e9 100644
@@ -41,32 +41,6 @@ qla2x00_poll(struct rsp_que *rsp)
 	local_irq_restore(flags);
 }
 
-/**
- * qla2x00_issue_marker() - Issue a Marker IOCB if necessary.
- * @ha: HA context
- * @ha_locked: is function called with the hardware lock
- *
- * Returns non-zero if a failure occurred, else zero.
- */
-static inline int
-qla2x00_issue_marker(scsi_qla_host_t *vha, int ha_locked)
-{
-	/* Send marker if required */
-	if (vha->marker_needed != 0) {
-		if (ha_locked) {
-			if (__qla2x00_marker(vha, 0, 0, MK_SYNC_ALL) !=
-			    QLA_SUCCESS)
-				return (QLA_FUNCTION_FAILED);
-		} else {
-			if (qla2x00_marker(vha, 0, 0, MK_SYNC_ALL) !=
-			    QLA_SUCCESS)
-				return (QLA_FUNCTION_FAILED);
-		}
-		vha->marker_needed = 0;
-	}
-	return (QLA_SUCCESS);
-}
-
 static inline uint8_t *
 host_to_fcp_swap(uint8_t *fcp, uint32_t bsize)
 {
drivers/scsi/qla2xxx/qla_iocb.c +100 -58

360 lines not on this page · raw message

drivers/scsi/qla2xxx/qla_isr.c +240 -95

641 lines not on this page · raw message

drivers/scsi/qla2xxx/qla_mbx.c +133 -14

262 lines not on this page · raw message

drivers/scsi/qla2xxx/qla_mid.c +343 -6

390 lines not on this page · raw message

drivers/scsi/qla2xxx/qla_os.c +275 -148

274 lines not on this page · raw message

drivers/scsi/qla2xxx/qla_sup.c +20 -13
index 6d6c021..c538ee1 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/qla2xxx/qla_version.h +2 -2
index 54b1100..be22f3a 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.5.5

Part of the diff is not shown here. View the raw message.

#1 lore raw

drivers/scsi/qla2xxx/qla_mid.c qla24xx_create_vhost(struct fc_vport *fc_vport) · line 399

Quoted 1 line · Anirban Chakraborty
drivers/scsi/qla2xxx/qla_mid.c +1 -0
+	memset(vha->req_ques, sizeof(vha->req_ques) * QLA_MAX_HOST_QUES, 0);

ITYM

+ memset(vha->req_ques, 0, sizeof(vha->req_ques) * QLA_MAX_HOST_QUES);

Dave

Signature · 1 line
http://www.codemonkey.org.uk
#2 lore raw
Quoted 8 lines · Dave Jones

Review

Quoted 1 line · Anirban Chakraborty
(quoted diff) +1 -0
+	memset(vha->req_ques, sizeof(vha->req_ques) * QLA_MAX_HOST_QUES, 0);

ITYM

+ memset(vha->req_ques, 0, sizeof(vha->req_ques) * QLA_MAX_HOST_QUES);

Dave

Sorry about that. Thanks for pointing it out.
Please apply,

Anirban

---
 drivers/scsi/qla2xxx/qla_mid.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/qla2xxx/qla_mid.c +1 -1
index 55730f4..386ffea 100644
@@ -396,7 +396,7 @@ qla24xx_create_vhost(struct fc_vport *fc_vport)
 
 	qla2x00_start_timer(vha, qla2x00_timer, WATCH_INTERVAL);
 
-	memset(vha->req_ques, sizeof(vha->req_ques) * QLA_MAX_HOST_QUES, 0);
+	memset(vha->req_ques, 0, sizeof(vha->req_ques) * QLA_MAX_HOST_QUES);
 	vha->req_ques[0] = ha->req_q_map[0]->id;
 	host->can_queue = ha->req_q_map[0]->length + 128;
 	host->this_id = 255;