Skip to contentSkip to conversation

qla2xxx: Add NVMe FC Fabric support in driver

PATCH New Madhani, Himanshu 5 participants 22 messages Jun 21, 2017 – Jun 28, 2017 1 message not in the archive

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

v2 cover qla2xxx: Add NVMe FC Fabric support in driver

From: Himanshu Madhani <[email protected]>

Hi Martin,

This patch series adds NVMe FC fabric support for qla2xxx initiator mode driver.

This series depends on the target multiqueue series that was sent out on June 13,2017. (https://www.spinics.net/lists/linux-scsi/msg109827.html)

There are couple of new files qla_nvme.c and qla_nvme.h created to add the changes needed for registration to NVMe FC transport template as well as error handling logic.

Patch 1 adds NVMe bits to various driver resources to help with NVMe remote port discovery and PRLI handling in the driver.

Patch 2 addes NVMe command handling in driver.

Patch 3 has bulk of NVMe changes which handles NVMe support based on a module paramter which is used for firmware initialization and NVMe transport registration. All the logic to handle NVMe command and error handling is also included in qla_nvme.c file.

Patch 4 and 5 are trivial changes to FDMI registration to allow NVMe FC-4 type to switch management server.

Please apply this series to for-next for inclusion in 4.13 merge window.

Note: Patch 2 does not compile due to change which are part of patch 3 needed
for sucessful compilation. Please apply patch 1-6 to be able to get commpilable driver.

Changes from v1 --> v2

o Addressed review comments by Johannes and James Smart.
o Added Reviewed-by tags wherever applicable.
o Added Commit log for patches where applicable.
o Removed qla_nvme_hba_scan() as it turns out to be dead code until auto discovery mechanism is implemeted in FC-NVMe.
o Remove un-needed while loop in qla_nvme_delete().

Thanks,
Himanshu

Duane Grigsby (5):
qla2xxx: Add FC-NVMe port discovery and PRLI handling
qla2xxx: Add FC-NVMe command handling
qla2xxx: Add FC-NVMe F/W initialization and transport registration
qla2xxx: Send FC4 type NVMe to the management server
qla2xxx: Use FC-NMVe FC4 type for FDMI registration

Himanshu Madhani (1):
qla2xxx: Update Driver version to 10.00.00.00-k

 drivers/scsi/qla2xxx/Makefile      |   2 +-
 drivers/scsi/qla2xxx/qla_dbg.c     |   9 +-
 drivers/scsi/qla2xxx/qla_def.h     |  54 ++-
 drivers/scsi/qla2xxx/qla_fw.h      |  35 +-
 drivers/scsi/qla2xxx/qla_gbl.h     |  18 +-
 drivers/scsi/qla2xxx/qla_gs.c      | 134 ++++++-
 drivers/scsi/qla2xxx/qla_init.c    | 187 ++++++++-
 drivers/scsi/qla2xxx/qla_iocb.c    |  57 +++
 drivers/scsi/qla2xxx/qla_isr.c     |  98 +++++
 drivers/scsi/qla2xxx/qla_mbx.c     |  54 ++-
 drivers/scsi/qla2xxx/qla_nvme.c    | 756 +++++++++++++++++++++++++++++++++++++
 drivers/scsi/qla2xxx/qla_nvme.h    | 132 +++++++
 drivers/scsi/qla2xxx/qla_os.c      |  60 ++-
 drivers/scsi/qla2xxx/qla_target.c  |   4 +-
 drivers/scsi/qla2xxx/qla_version.h |   6 +-
 15 files changed, 1559 insertions(+), 47 deletions(-)
 create mode 100644 drivers/scsi/qla2xxx/qla_nvme.c
 create mode 100644 drivers/scsi/qla2xxx/qla_nvme.h
Signature · 1 line
2.12.0
#1 lore raw

PATCH v2 1/6 qla2xxx: Add FC-NVMe port discovery and PRLI handling

From: Duane Grigsby <[email protected]>

Added logic to change the login process into an optional PRIL step for FC-NVMe ports as a separate operation, such that we can change type to 0x28 (NVMe).

Currently, the driver performs the PLOGI/PRLI together as one operation, but if the discovered port is an NVMe port then we first issue the PLOGI and then we issue the PRLI. Also, the fabric discovery logic was changed to mark each discovered FC NVMe port, so that we can register them with the FC-NVMe transport later.

Signed-off-by Darren Trapp <darren.trapp at cavium.com>
Signed-off-by Duane Grigsby <duane.grigsby at cavium.com>
Signed-off-by Anil Gurumurthy <anil.gurumurhty at cavium.com>
Signed-off-by Giridhar Malavali <giridhar.malavali at cavium.com>
Signed-off-by Himanshu Madhani <himanshu.madhani at cavium.com>
Reviewed-by Johannes Thumshirn <jthumshirn at suse.de>
---
 drivers/scsi/qla2xxx/qla_dbg.c    |   9 +-
 drivers/scsi/qla2xxx/qla_def.h    |  30 ++++++-
 drivers/scsi/qla2xxx/qla_fw.h     |  13 ++-
 drivers/scsi/qla2xxx/qla_gbl.h    |   1 +
 drivers/scsi/qla2xxx/qla_init.c   | 168 ++++++++++++++++++++++++++++++++++++--
 drivers/scsi/qla2xxx/qla_iocb.c   |  21 +++++
 drivers/scsi/qla2xxx/qla_mbx.c    |  33 +++++---
 drivers/scsi/qla2xxx/qla_os.c     |   4 +
 drivers/scsi/qla2xxx/qla_target.c |   4 +-
 9 files changed, 256 insertions(+), 27 deletions(-)
drivers/scsi/qla2xxx/qla_dbg.c +5 -4
index c0c90dcc7c7b..cf4f47603a91 100644
@@ -15,9 +15,10 @@
  * |                              |                    | 0x015b-0x0160	|
  * |                              |                    | 0x016e		|
  * | Mailbox commands             |       0x1199       | 0x1193		|
- * | Device Discovery             |       0x2004       | 0x2016		|
- * |                              |                    | 0x2011-0x2012, |
- * |                              |                    | 0x2099-0x20a4  |
+ * | Device Discovery             |       0x2131       | 0x210e-0x2116  |
+ * |				  | 		       | 0x211a         |
+ * |                              |                    | 0x211c-0x2128  |
+ * |                              |                    | 0x212a-0x2130  |
  * | Queue Command and IO tracing |       0x3074       | 0x300b         |
  * |                              |                    | 0x3027-0x3028  |
  * |                              |                    | 0x303d-0x3041  |
@@ -59,7 +60,7 @@
  * |                              |                    | 0xb13c-0xb140  |
  * |                              |                    | 0xb149		|
  * | MultiQ                       |       0xc010       |		|
- * | Misc                         |       0xd301       | 0xd031-0xd0ff	|
+ * | Misc                         |       0xd302       | 0xd031-0xd0ff	|
  * |                              |                    | 0xd101-0xd1fe	|
  * |                              |                    | 0xd214-0xd2fe	|
  * | Target Mode		  |	  0xe081       |		|
drivers/scsi/qla2xxx/qla_def.h +28 -2
index e1af9db3691d..6f8df9cea8ff 100644
@@ -343,6 +343,7 @@ struct srb_iocb {
 #define SRB_LOGIN_RETRIED	BIT_0
 #define SRB_LOGIN_COND_PLOGI	BIT_1
 #define SRB_LOGIN_SKIP_PRLI	BIT_2
+#define SRB_LOGIN_NVME_PRLI	BIT_3
 			uint16_t data[2];
 			u32 iop[2];
 		} logio;
@@ -436,6 +437,7 @@ struct srb_iocb {
 #define SRB_NACK_PLOGI	16
 #define SRB_NACK_PRLI	17
 #define SRB_NACK_LOGO	18
+#define SRB_PRLI_CMD	21
 
 enum {
 	TYPE_SRB,
@@ -1088,6 +1090,7 @@ struct mbx_cmd_32 {
 #define	MBX_1		BIT_1
 #define	MBX_0		BIT_0
 
+#define RNID_TYPE_PORT_LOGIN	0x7
 #define RNID_TYPE_SET_VERSION	0x9
 #define RNID_TYPE_ASIC_TEMP	0xC
 
@@ -2152,6 +2155,7 @@ typedef struct {
 	uint8_t fabric_port_name[WWN_SIZE];
 	uint16_t fp_speed;
 	uint8_t fc4_type;
+	uint8_t fc4f_nvme;	/* nvme fc4 feature bits */
 } sw_info_t;
 
 /* FCP-4 types */
@@ -2180,7 +2184,8 @@ typedef enum {
 	FCT_SWITCH,
 	FCT_BROADCAST,
 	FCT_INITIATOR,
-	FCT_TARGET
+	FCT_TARGET,
+	FCT_NVME
 } fc_port_type_t;
 
 enum qla_sess_deletion {
@@ -2237,10 +2242,12 @@ enum fcport_mgt_event {
 	FCME_RSCN,
 	FCME_GIDPN_DONE,
 	FCME_PLOGI_DONE,	/* Initiator side sent LLIOCB */
+	FCME_PRLI_DONE,
 	FCME_GNL_DONE,
 	FCME_GPSC_DONE,
 	FCME_GPDB_DONE,
 	FCME_GPNID_DONE,
+	FCME_GFFID_DONE,
 	FCME_DELETE_DONE,
 };
 
@@ -2274,6 +2281,16 @@ typedef struct fc_port {
 	unsigned int login_pause:1;
 	unsigned int login_succ:1;
 
+	struct work_struct nvme_del_work;
+	atomic_t nvme_ref_count;
+	uint32_t nvme_prli_service_param;
+#define NVME_PRLI_SP_CONF       BIT_7
+#define NVME_PRLI_SP_INITIATOR  BIT_5
+#define NVME_PRLI_SP_TARGET     BIT_4
+#define NVME_PRLI_SP_DISCOVERY  BIT_3
+	uint8_t nvme_flag;
+#define NVME_FLAG_REGISTERED 4
+
 	struct fc_port *conflict;
 	unsigned char logout_completed;
 	int generation;
@@ -2306,6 +2323,7 @@ typedef struct fc_port {
 	u32 supported_classes;
 
 	uint8_t fc4_type;
+	uint8_t	fc4f_nvme;
 	uint8_t scan_state;
 
 	unsigned long last_queue_full;
@@ -2313,6 +2331,8 @@ typedef struct fc_port {
 
 	uint16_t port_id;
 
+	struct nvme_fc_remote_port *nvme_remote_port;
+
 	unsigned long retry_delay_timestamp;
 	struct qla_tgt_sess *tgt_session;
 	struct ct_sns_desc ct_desc;
@@ -2745,7 +2765,7 @@ struct ct_sns_req {
 
 		struct {
 			uint8_t reserved;
-			uint8_t port_name[3];
+			uint8_t port_id[3];
 		} gff_id;
 
 		struct {
@@ -3052,6 +3072,7 @@ enum qla_work_type {
 	QLA_EVT_GPNID_DONE,
 	QLA_EVT_NEW_SESS,
 	QLA_EVT_GPDB,
+	QLA_EVT_PRLI,
 	QLA_EVT_GPSC,
 	QLA_EVT_UPD_FCPORT,
 	QLA_EVT_GNL,
@@ -4007,6 +4028,7 @@ typedef struct scsi_qla_host {
 		uint32_t	qpairs_available:1;
 		uint32_t	qpairs_req_created:1;
 		uint32_t	qpairs_rsp_created:1;
+		uint32_t	nvme_enabled:1;
 	} flags;
 
 	atomic_t	loop_state;
@@ -4085,6 +4107,10 @@ typedef struct scsi_qla_host {
 	uint8_t		port_name[WWN_SIZE];
 	uint8_t		fabric_node_name[WWN_SIZE];
 
+	struct		nvme_fc_local_port *nvme_local_port;
+	atomic_t	nvme_ref_count;
+	struct list_head nvme_rport_list;
+
 	uint16_t	fcoe_vlan_id;
 	uint16_t	fcoe_fcf_idx;
 	uint8_t		fcoe_vn_port_mac[6];
drivers/scsi/qla2xxx/qla_fw.h +12 -1
index 1f808928763b..dcae62d4cbeb 100644
@@ -37,6 +37,12 @@ struct port_database_24xx {
 #define PDF_CLASS_2		BIT_4
 #define PDF_HARD_ADDR		BIT_1
 
+	/*
+	 * for NVMe, the login_state field has been
+	 * split into nibbles.
+	 * The lower nibble is for FCP.
+	 * The upper nibble is for NVMe.
+	 */
 	uint8_t current_login_state;
 	uint8_t last_login_state;
 #define PDS_PLOGI_PENDING	0x03
@@ -69,7 +75,11 @@ struct port_database_24xx {
 	uint8_t port_name[WWN_SIZE];
 	uint8_t node_name[WWN_SIZE];
 
-	uint8_t reserved_3[24];
+	uint8_t reserved_3[4];
+	uint16_t prli_nvme_svc_param_word_0;	/* Bits 15-0 of word 0 */
+	uint16_t prli_nvme_svc_param_word_3;	/* Bits 15-0 of word 3 */
+	uint16_t nvme_first_burst_size;
+	uint8_t reserved_4[14];
 };
 
 /*
@@ -819,6 +829,7 @@ struct logio_entry_24xx {
 #define LCF_CLASS_2		BIT_8	/* Enable class 2 during PLOGI. */
 #define LCF_FREE_NPORT		BIT_7	/* Release NPORT handle after LOGO. */
 #define LCF_EXPL_LOGO		BIT_6	/* Perform an explicit LOGO. */
+#define LCF_NVME_PRLI		BIT_6   /* Perform NVME FC4 PRLI */
 #define LCF_SKIP_PRLI		BIT_5	/* Skip PRLI after PLOGI. */
 #define LCF_IMPL_LOGO_ALL	BIT_5	/* Implicit LOGO to all ports. */
 #define LCF_COND_PLOGI		BIT_4	/* PLOGI only if not logged-in. */
drivers/scsi/qla2xxx/qla_gbl.h +1 -0
index beebf96c23d4..6fbee11c1a18 100644
@@ -99,6 +99,7 @@ extern struct qla_qpair *qla2xxx_create_qpair(struct scsi_qla_host *,
 extern int qla2xxx_delete_qpair(struct scsi_qla_host *, struct qla_qpair *);
 void qla2x00_fcport_event_handler(scsi_qla_host_t *, struct event_arg *);
 int qla24xx_async_gpdb(struct scsi_qla_host *, fc_port_t *, u8);
+int qla24xx_async_prli(struct scsi_qla_host *, fc_port_t *);
 int qla24xx_async_notify_ack(scsi_qla_host_t *, fc_port_t *,
 	struct imm_ntfy_from_isp *, int);
 int qla24xx_post_newsess_work(struct scsi_qla_host *, port_id_t *, u8 *,
drivers/scsi/qla2xxx/qla_init.c +159 -9

230 lines not on this page · raw message

drivers/scsi/qla2xxx/qla_iocb.c +21 -0
index ac49febbac76..daa53235a28a 100644
@@ -2211,12 +2211,30 @@ qla2x00_alloc_iocbs(struct scsi_qla_host *vha, srb_t *sp)
 }
 
 static void
+qla24xx_prli_iocb(srb_t *sp, struct logio_entry_24xx *logio)
+{
+	struct srb_iocb *lio = &sp->u.iocb_cmd;
+
+	logio->entry_type = LOGINOUT_PORT_IOCB_TYPE;
+	logio->control_flags = cpu_to_le16(LCF_COMMAND_PRLI);
+	if (lio->u.logio.flags & SRB_LOGIN_NVME_PRLI)
+		logio->control_flags |= LCF_NVME_PRLI;
+
+	logio->nport_handle = cpu_to_le16(sp->fcport->loop_id);
+	logio->port_id[0] = sp->fcport->d_id.b.al_pa;
+	logio->port_id[1] = sp->fcport->d_id.b.area;
+	logio->port_id[2] = sp->fcport->d_id.b.domain;
+	logio->vp_index = sp->vha->vp_idx;
+}
+
+static void
 qla24xx_login_iocb(srb_t *sp, struct logio_entry_24xx *logio)
 {
 	struct srb_iocb *lio = &sp->u.iocb_cmd;
 
 	logio->entry_type = LOGINOUT_PORT_IOCB_TYPE;
 	logio->control_flags = cpu_to_le16(LCF_COMMAND_PLOGI);
+
 	if (lio->u.logio.flags & SRB_LOGIN_COND_PLOGI)
 		logio->control_flags |= cpu_to_le16(LCF_COND_PLOGI);
 	if (lio->u.logio.flags & SRB_LOGIN_SKIP_PRLI)
@@ -3162,6 +3180,9 @@ qla2x00_start_sp(srb_t *sp)
 		    qla24xx_login_iocb(sp, pkt) :
 		    qla2x00_login_iocb(sp, pkt);
 		break;
+	case SRB_PRLI_CMD:
+		qla24xx_prli_iocb(sp, pkt);
+		break;
 	case SRB_LOGOUT_CMD:
 		IS_FWI2_CAPABLE(ha) ?
 		    qla24xx_logout_iocb(sp, pkt) :
drivers/scsi/qla2xxx/qla_mbx.c +23 -10
index f02a2baffb5b..1eac67e8fdfd 100644
@@ -5968,14 +5968,22 @@ int __qla24xx_parse_gpdb(struct scsi_qla_host *vha, fc_port_t *fcport,
 {
 	int rval = QLA_SUCCESS;
 	uint64_t zero = 0;
+	u8 current_login_state, last_login_state;
+
+	if (fcport->fc4f_nvme) {
+		current_login_state = pd->current_login_state >> 4;
+		last_login_state = pd->last_login_state >> 4;
+	} else {
+		current_login_state = pd->current_login_state & 0xf;
+		last_login_state = pd->last_login_state & 0xf;
+	}
 
 	/* Check for logged in state. */
-	if (pd->current_login_state != PDS_PRLI_COMPLETE &&
-		pd->last_login_state != PDS_PRLI_COMPLETE) {
+	if (current_login_state != PDS_PRLI_COMPLETE &&
+	    last_login_state != PDS_PRLI_COMPLETE) {
 		ql_dbg(ql_dbg_mbx, vha, 0x119a,
 		    "Unable to verify login-state (%x/%x) for loop_id %x.\n",
-		    pd->current_login_state, pd->last_login_state,
-		    fcport->loop_id);
+		    current_login_state, last_login_state, fcport->loop_id);
 		rval = QLA_FUNCTION_FAILED;
 		goto gpd_error_out;
 	}
@@ -5998,12 +6006,17 @@ int __qla24xx_parse_gpdb(struct scsi_qla_host *vha, fc_port_t *fcport,
 	fcport->d_id.b.al_pa = pd->port_id[2];
 	fcport->d_id.b.rsvd_1 = 0;
 
-	/* If not target must be initiator or unknown type. */
-	if ((pd->prli_svc_param_word_3[0] & BIT_4) == 0)
-		fcport->port_type = FCT_INITIATOR;
-	else
-		fcport->port_type = FCT_TARGET;
-
+	if (fcport->fc4f_nvme) {
+		fcport->nvme_prli_service_param =
+		    pd->prli_nvme_svc_param_word_3;
+		fcport->port_type = FCT_NVME;
+	} else {
+		/* If not target must be initiator or unknown type. */
+		if ((pd->prli_svc_param_word_3[0] & BIT_4) == 0)
+			fcport->port_type = FCT_INITIATOR;
+		else
+			fcport->port_type = FCT_TARGET;
+	}
 	/* Passback COS information. */
 	fcport->supported_classes = (pd->flags & PDF_CLASS_2) ?
 		FC_COS_CLASS2 : FC_COS_CLASS3;
drivers/scsi/qla2xxx/qla_os.c +4 -0
index 88e115fcea60..b2474952f858 100644
@@ -4431,6 +4431,7 @@ struct scsi_qla_host *qla2x00_create_host(struct scsi_host_template *sht,
 	INIT_LIST_HEAD(&vha->plogi_ack_list);
 	INIT_LIST_HEAD(&vha->qp_list);
 	INIT_LIST_HEAD(&vha->gnl.fcports);
+	INIT_LIST_HEAD(&vha->nvme_rport_list);
 
 	spin_lock_init(&vha->work_lock);
 	spin_lock_init(&vha->cmd_list_lock);
@@ -4720,6 +4721,9 @@ qla2x00_do_work(struct scsi_qla_host *vha)
 			qla24xx_async_gpdb(vha, e->u.fcport.fcport,
 			    e->u.fcport.opt);
 			break;
+		case QLA_EVT_PRLI:
+			qla24xx_async_prli(vha, e->u.fcport.fcport);
+			break;
 		case QLA_EVT_GPSC:
 			qla24xx_async_gpsc(vha, e->u.fcport.fcport);
 			break;
drivers/scsi/qla2xxx/qla_target.c +3 -1
index 8f75d27daae2..a2b310de429b 100644
@@ -963,7 +963,6 @@ static void qlt_free_session_done(struct work_struct *work)
 		sess->logout_on_delete, sess->keep_nport_handle,
 		sess->send_els_logo);
 
-
 	if (!IS_SW_RESV_ADDR(sess->d_id)) {
 		if (sess->send_els_logo) {
 			qlt_port_logo_t logo;
@@ -1118,6 +1117,9 @@ void qlt_unreg_sess(struct fc_port *sess)
 	sess->last_rscn_gen = sess->rscn_gen;
 	sess->last_login_gen = sess->login_gen;
 
+	if (sess->nvme_flag & NVME_FLAG_REGISTERED)
+		schedule_work(&sess->nvme_del_work);
+
 	INIT_WORK(&sess->free_work, qlt_free_session_done);
 	schedule_work(&sess->free_work);
 }
Signature · 1 line
2.12.0
#2 lore raw

PATCH v2 1/6 qla2xxx: Add FC-NVMe port discovery and PRLI handling

Quoted 19 lines · Himanshu

From: Duane Grigsby <duane.grigsby at cavium.com>

Added logic to change the login process into an optional PRIL step for FC-NVMe ports as a separate operation, such that we can change type to 0x28 (NVMe).

Currently, the driver performs the PLOGI/PRLI together as one operation, but if the discovered port is an NVMe port then we first issue the PLOGI and then we issue the PRLI. Also, the fabric discovery logic was changed to mark each discovered FC NVMe port, so that we can register them with the FC-NVMe transport later.

Signed-off-by Darren Trapp <darren.trapp at cavium.com>
Signed-off-by Duane Grigsby <duane.grigsby at cavium.com>
Signed-off-by Anil Gurumurthy <anil.gurumurhty at cavium.com>
Signed-off-by Giridhar Malavali <giridhar.malavali at cavium.com>
Signed-off-by Himanshu Madhani <himanshu.madhani at cavium.com>
Reviewed-by Johannes Thumshirn <jthumshirn at suse.de>
Quoted 12 lines
---
 drivers/scsi/qla2xxx/qla_dbg.c    |   9 +-
 drivers/scsi/qla2xxx/qla_def.h    |  30 ++++++-
 drivers/scsi/qla2xxx/qla_fw.h     |  13 ++-
 drivers/scsi/qla2xxx/qla_gbl.h    |   1 +
 drivers/scsi/qla2xxx/qla_init.c   | 168 ++++++++++++++++++++++++++++++++++++--
 drivers/scsi/qla2xxx/qla_iocb.c   |  21 +++++
 drivers/scsi/qla2xxx/qla_mbx.c    |  33 +++++---
 drivers/scsi/qla2xxx/qla_os.c     |   4 +
 drivers/scsi/qla2xxx/qla_target.c |   4 +-
 9 files changed, 256 insertions(+), 27 deletions(-)
Reviewed-by Hannes Reinecke <hare at suse.com>

Cheers,

Hannes

Signature · 5 lines
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare at suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: F. Imend?rffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG N?rnberg)
maintainer
#3 lore raw

PATCH v2 1/6 qla2xxx: Add FC-NVMe port discovery and PRLI handling

In reply to Madhani, Himanshu
Quoted 13 lines · Himanshu

From: Duane Grigsby <duane.grigsby at cavium.com>

Added logic to change the login process into an optional PRIL step for FC-NVMe ports as a separate operation, such that we can change type to 0x28 (NVMe).

Currently, the driver performs the PLOGI/PRLI together as one operation, but if the discovered port is an NVMe port then we first issue the PLOGI and then we issue the PRLI. Also, the fabric discovery logic was changed to mark each discovered FC NVMe port, so that we can register them with the FC-NVMe transport later.

Quoted 3 lines
Signed-off-by Darren Trapp <darren.trapp at cavium.com>
Signed-off-by Duane Grigsby <duane.grigsby at cavium.com>
Signed-off-by Anil Gurumurthy <anil.gurumurhty at cavium.com>

I just got a whole load of bounces from this: you've misspelled Anil's email address (h and t transposed). ?It looks like a generic cut and paste, so could you fix it for next time?

Thanks,

James

#4 lore raw

PATCH v2 1/6 qla2xxx: Add FC-NVMe port discovery and PRLI handling

Hi James,

Quoted 20 lines · James Bottomley
Quoted 13 lines · Himanshu

From: Duane Grigsby <duane.grigsby at cavium.com>

Added logic to change the login process into an optional PRIL step for FC-NVMe ports as a separate operation, such that we can change type to 0x28 (NVMe).

Currently, the driver performs the PLOGI/PRLI together as one operation, but if the discovered port is an NVMe port then we first issue the PLOGI and then we issue the PRLI. Also, the fabric discovery logic was changed to mark each discovered FC NVMe port, so that we can register them with the FC-NVMe transport later.

Quoted 3 lines
Signed-off-by Darren Trapp <darren.trapp at cavium.com>
Signed-off-by Duane Grigsby <duane.grigsby at cavium.com>
Signed-off-by Anil Gurumurthy <anil.gurumurhty at cavium.com>
Quoted 8 lines

I just got a whole load of bounces from this: you've misspelled Anil's email address (h and t transposed). It looks like a generic cut and paste, so could you fix it for next time?

Thanks,

James

Sorry about that. Will fix this up for next time.

Thanks,
- Himanshu

#5 lore raw

PATCH v2 2/6 qla2xxx: Add FC-NVMe command handling

In reply to Madhani, Himanshu

From: Duane Grigsby <[email protected]>

This patch adds logic to handle the completion of FC-NVMe commands and creates a sub-command in the SRB command structure to manage NVMe commands.

Signed-off-by Darren Trapp <darren.trapp at cavium.com>
Signed-off-by Duane Grigsby <duane.grigsby at cavium.com>
Signed-off-by Anil Gurumurthy <anil.gurumurhty at cavium.com>
Signed-off-by Giridhar Malavali <giridhar.malavali at cavium.com>
Signed-off-by Himanshu Madhani <himanshu.madhani at cavium.com>
Reviewed-by Johannes Thumshirn <jthumshirn at suse.de>
---
 drivers/scsi/qla2xxx/qla_def.h | 17 +++++++++
 drivers/scsi/qla2xxx/qla_fw.h  | 22 ++++++++++--
 drivers/scsi/qla2xxx/qla_isr.c | 79 ++++++++++++++++++++++++++++++++++++++++++
 drivers/scsi/qla2xxx/qla_os.c  | 18 ++++++++--
 4 files changed, 131 insertions(+), 5 deletions(-)
drivers/scsi/qla2xxx/qla_def.h +17 -0
index 6f8df9cea8ff..4d889eb2993e 100644
@@ -412,6 +412,20 @@ struct srb_iocb {
 		struct {
 			struct imm_ntfy_from_isp *ntfy;
 		} nack;
+		struct {
+			__le16 comp_status;
+			uint16_t rsp_pyld_len;
+			uint8_t	aen_op;
+			void *desc;
+
+			/* These are only used with ls4 requests */
+			int cmd_len;
+			int rsp_len;
+			dma_addr_t cmd_dma;
+			dma_addr_t rsp_dma;
+			uint32_t dl;
+			uint32_t timeout_sec;
+		} nvme;
 	} u;
 
 	struct timer_list timer;
@@ -437,6 +451,7 @@ struct srb_iocb {
 #define SRB_NACK_PLOGI	16
 #define SRB_NACK_PRLI	17
 #define SRB_NACK_LOGO	18
+#define SRB_NVME_CMD	19
 #define SRB_PRLI_CMD	21
 
 enum {
@@ -4110,6 +4125,8 @@ typedef struct scsi_qla_host {
 	struct		nvme_fc_local_port *nvme_local_port;
 	atomic_t	nvme_ref_count;
 	struct list_head nvme_rport_list;
+	atomic_t 	nvme_active_aen_cnt;
+	uint16_t	nvme_last_rptd_aen;
 
 	uint16_t	fcoe_vlan_id;
 	uint16_t	fcoe_fcf_idx;
drivers/scsi/qla2xxx/qla_fw.h +19 -3
index dcae62d4cbeb..b9c9886e8b1d 100644
@@ -7,6 +7,9 @@
 #ifndef __QLA_FW_H
 #define __QLA_FW_H
 
+#include <linux/nvme.h>
+#include <linux/nvme-fc.h>
+
 #define MBS_CHECKSUM_ERROR	0x4010
 #define MBS_INVALID_PRODUCT_KEY	0x4020
 
@@ -603,9 +606,14 @@ struct sts_entry_24xx {
 
 	uint32_t residual_len;		/* FW calc residual transfer length. */
 
-	uint16_t reserved_1;
+	union {
+		uint16_t reserved_1;
+		uint16_t nvme_rsp_pyld_len;
+	};
+
 	uint16_t state_flags;		/* State flags. */
 #define SF_TRANSFERRED_DATA	BIT_11
+#define SF_NVME_ERSP            BIT_6
 #define SF_FCP_RSP_DMA		BIT_0
 
 	uint16_t retry_delay;
@@ -615,8 +623,16 @@ struct sts_entry_24xx {
 	uint32_t rsp_residual_count;	/* FCP RSP residual count. */
 
 	uint32_t sense_len;		/* FCP SENSE length. */
-	uint32_t rsp_data_len;		/* FCP response data length. */
-	uint8_t data[28];		/* FCP response/sense information. */
+
+	union {
+		struct {
+			uint32_t rsp_data_len;	/* FCP response data length  */
+			uint8_t data[28];	/* FCP rsp/sense information */
+		};
+		struct nvme_fc_ersp_iu nvme_ersp;
+		uint8_t nvme_ersp_data[32];
+	};
+
 	/*
 	 * If DIF Error is set in comp_status, these additional fields are
 	 * defined:
drivers/scsi/qla2xxx/qla_isr.c +79 -0

91 lines not on this page · raw message

drivers/scsi/qla2xxx/qla_os.c +16 -2
index b2474952f858..ef5211fd2154 100644
@@ -695,8 +695,10 @@ qla2x00_sp_free_dma(void *ptr)
 	}
 
 end:
-	CMD_SP(cmd) = NULL;
-	qla2x00_rel_sp(sp);
+	if (sp->type != SRB_NVME_CMD) {
+		CMD_SP(cmd) = NULL;
+		qla2x00_rel_sp(sp);
+	}
 }
 
 void
@@ -5996,6 +5998,18 @@ qla2x00_timer(scsi_qla_host_t *vha)
 	if (!list_empty(&vha->work_list))
 		start_dpc++;
 
+	/*
+	 * FC-NVME
+	 * see if the active AEN count has changed from what was last reported.
+	 */
+	if (atomic_read(&vha->nvme_active_aen_cnt) != vha->nvme_last_rptd_aen) {
+		vha->nvme_last_rptd_aen =
+		    atomic_read(&vha->nvme_active_aen_cnt);
+		ql_log(ql_log_info, vha, 0x3002,
+		    "reporting new aen count of %d to the fw\n",
+		    vha->nvme_last_rptd_aen);
+	}
+
 	/* Schedule the DPC routine if needed */
 	if ((test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) ||
 	    test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags) ||
Signature · 1 line
2.12.0
#6 lore raw

PATCH v2 2/6 qla2xxx: Add FC-NVMe command handling

Quoted 12 lines · Himanshu

From: Duane Grigsby <duane.grigsby at cavium.com>

This patch adds logic to handle the completion of FC-NVMe commands and creates a sub-command in the SRB command structure to manage NVMe commands.

Signed-off-by Darren Trapp <darren.trapp at cavium.com>
Signed-off-by Duane Grigsby <duane.grigsby at cavium.com>
Signed-off-by Anil Gurumurthy <anil.gurumurhty at cavium.com>
Signed-off-by Giridhar Malavali <giridhar.malavali at cavium.com>
Signed-off-by Himanshu Madhani <himanshu.madhani at cavium.com>
Reviewed-by Johannes Thumshirn <jthumshirn at suse.de>
Quoted 7 lines
---
 drivers/scsi/qla2xxx/qla_def.h | 17 +++++++++
 drivers/scsi/qla2xxx/qla_fw.h  | 22 ++++++++++--
 drivers/scsi/qla2xxx/qla_isr.c | 79 ++++++++++++++++++++++++++++++++++++++++++
 drivers/scsi/qla2xxx/qla_os.c  | 18 ++++++++--
 4 files changed, 131 insertions(+), 5 deletions(-)
Reviewed-by Hannes Reinecke <hare at suse.com>

Cheers,

Hannes

Signature · 5 lines
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare at suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: F. Imend?rffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG N?rnberg)
#7 lore raw

PATCH v2 3/6 qla2xxx: Add FC-NVMe F/W initialization and transport registration

In reply to Madhani, Himanshu

From: Duane Grigsby <[email protected]>

This code provides the interfaces to register remote and local ports of FC4 type 0x28 with the FC-NVMe transport and transports the requests (FC-NVMe FC link services and FC-NVMe commands IUs) to the fabric. It also provides the support for allocating h/w queues and aborting FC-NVMe FC requests.

Signed-off-by Darren Trapp <darren.trapp at cavium.com>
Signed-off-by Duane Grigsby <duane.grigsby at cavium.com>
Signed-off-by Anil Gurumurthy <anil.gurumurhty at cavium.com>
Signed-off-by Giridhar Malavali <giridhar.malavali at cavium.com>
Signed-off-by Himanshu Madhani <himanshu.madhani at cavium.com>
---
 drivers/scsi/qla2xxx/Makefile   |   2 +-
 drivers/scsi/qla2xxx/qla_dbg.c  |   2 +-
 drivers/scsi/qla2xxx/qla_def.h  |   6 +
 drivers/scsi/qla2xxx/qla_gbl.h  |  11 +
 drivers/scsi/qla2xxx/qla_init.c |   8 +
 drivers/scsi/qla2xxx/qla_iocb.c |  36 ++
 drivers/scsi/qla2xxx/qla_isr.c  |  19 +
 drivers/scsi/qla2xxx/qla_mbx.c  |  21 ++
 drivers/scsi/qla2xxx/qla_nvme.c | 756 ++++++++++++++++++++++++++++++++++++++++
 drivers/scsi/qla2xxx/qla_nvme.h | 132 +++++++
 drivers/scsi/qla2xxx/qla_os.c   |  40 ++-
 11 files changed, 1024 insertions(+), 9 deletions(-)
 create mode 100644 drivers/scsi/qla2xxx/qla_nvme.c
 create mode 100644 drivers/scsi/qla2xxx/qla_nvme.h
drivers/scsi/qla2xxx/Makefile +1 -1
index 44def6bb4bb0..0b767a0bb308 100644
@@ -1,6 +1,6 @@
 qla2xxx-y := qla_os.o qla_init.o qla_mbx.o qla_iocb.o qla_isr.o qla_gs.o \
 		qla_dbg.o qla_sup.o qla_attr.o qla_mid.o qla_dfs.o qla_bsg.o \
-		qla_nx.o qla_mr.o qla_nx2.o qla_target.o qla_tmpl.o
+		qla_nx.o qla_mr.o qla_nx2.o qla_target.o qla_tmpl.o qla_nvme.o
 
 obj-$(CONFIG_SCSI_QLA_FC) += qla2xxx.o
 obj-$(CONFIG_TCM_QLA2XXX) += tcm_qla2xxx.o
drivers/scsi/qla2xxx/qla_dbg.c +1 -1
index cf4f47603a91..d840529fc023 100644
@@ -15,7 +15,7 @@
  * |                              |                    | 0x015b-0x0160	|
  * |                              |                    | 0x016e		|
  * | Mailbox commands             |       0x1199       | 0x1193		|
- * | Device Discovery             |       0x2131       | 0x210e-0x2116  |
+ * | Device Discovery             |       0x2134       | 0x210e-0x2116  |
  * |				  | 		       | 0x211a         |
  * |                              |                    | 0x211c-0x2128  |
  * |                              |                    | 0x212a-0x2130  |
drivers/scsi/qla2xxx/qla_def.h +6 -0
index 4d889eb2993e..0dbcb84011b0 100644
@@ -37,6 +37,7 @@
 #include "qla_bsg.h"
 #include "qla_nx.h"
 #include "qla_nx2.h"
+#include "qla_nvme.h"
 #define QLA2XXX_DRIVER_NAME	"qla2xxx"
 #define QLA2XXX_APIDEV		"ql2xapidev"
 #define QLA2XXX_MANUFACTURER	"QLogic Corporation"
@@ -423,6 +424,7 @@ struct srb_iocb {
 			int rsp_len;
 			dma_addr_t cmd_dma;
 			dma_addr_t rsp_dma;
+			enum nvmefc_fcp_datadir dir;
 			uint32_t dl;
 			uint32_t timeout_sec;
 		} nvme;
@@ -452,6 +454,7 @@ struct srb_iocb {
 #define SRB_NACK_PRLI	17
 #define SRB_NACK_LOGO	18
 #define SRB_NVME_CMD	19
+#define SRB_NVME_LS	20
 #define SRB_PRLI_CMD	21
 
 enum {
@@ -467,6 +470,7 @@ typedef struct srb {
 	uint8_t cmd_type;
 	uint8_t pad[3];
 	atomic_t ref_count;
+	wait_queue_head_t nvme_ls_waitQ;
 	struct fc_port *fcport;
 	struct scsi_qla_host *vha;
 	uint32_t handle;
@@ -2298,6 +2302,7 @@ typedef struct fc_port {
 
 	struct work_struct nvme_del_work;
 	atomic_t nvme_ref_count;
+	wait_queue_head_t nvme_waitQ;
 	uint32_t nvme_prli_service_param;
 #define NVME_PRLI_SP_CONF       BIT_7
 #define NVME_PRLI_SP_INITIATOR  BIT_5
@@ -4124,6 +4129,7 @@ typedef struct scsi_qla_host {
 
 	struct		nvme_fc_local_port *nvme_local_port;
 	atomic_t	nvme_ref_count;
+	wait_queue_head_t nvme_waitQ;
 	struct list_head nvme_rport_list;
 	atomic_t 	nvme_active_aen_cnt;
 	uint16_t	nvme_last_rptd_aen;
drivers/scsi/qla2xxx/qla_gbl.h +11 -0
index 6fbee11c1a18..c6af45f7d5d6 100644
@@ -10,6 +10,16 @@
 #include <linux/interrupt.h>
 
 /*
+ * Global functions prototype in qla_nvme.c source file.
+ */
+extern void qla_nvme_register_hba(scsi_qla_host_t *);
+extern int  qla_nvme_register_remote(scsi_qla_host_t *, fc_port_t *);
+extern void qla_nvme_delete(scsi_qla_host_t *);
+extern void qla_nvme_abort(struct qla_hw_data *, srb_t *sp);
+extern void qla24xx_nvme_ls4_iocb(scsi_qla_host_t *, struct pt_ls4_request *,
+    struct req_que *);
+
+/*
  * Global Function Prototypes in qla_init.c source file.
  */
 extern int qla2x00_initialize_adapter(scsi_qla_host_t *);
@@ -141,6 +151,7 @@ extern int ql2xiniexchg;
 extern int ql2xfwholdabts;
 extern int ql2xmvasynctoatio;
 extern int ql2xuctrlirq;
+extern int ql2xnvmeenable;
 
 extern int qla2x00_loop_reset(scsi_qla_host_t *);
 extern void qla2x00_abort_all_cmds(scsi_qla_host_t *, int);
drivers/scsi/qla2xxx/qla_init.c +8 -0
index 8a2586a04961..7286a80f796c 100644
@@ -4513,6 +4513,11 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport)
 	fcport->deleted = 0;
 	fcport->logout_on_delete = 1;
 
+	if (fcport->fc4f_nvme) {
+		qla_nvme_register_remote(vha, fcport);
+		return;
+	}
+
 	qla2x00_set_fcport_state(fcport, FCS_ONLINE);
 	qla2x00_iidma_fcport(vha, fcport);
 	qla24xx_update_fcport_fcp_prio(vha, fcport);
@@ -4662,6 +4667,9 @@ qla2x00_configure_fabric(scsi_qla_host_t *vha)
 			break;
 	} while (0);
 
+	if (!vha->nvme_local_port && vha->flags.nvme_enabled)
+		qla_nvme_register_hba(vha);
+
 	if (rval)
 		ql_dbg(ql_dbg_disc, vha, 0x2068,
 		    "Configure fabric error exit rval=%d.\n", rval);
drivers/scsi/qla2xxx/qla_iocb.c +36 -0
index daa53235a28a..d40fa000615c 100644
@@ -3155,6 +3155,39 @@ static void qla2x00_send_notify_ack_iocb(srb_t *sp,
 	nack->u.isp24.vp_index = ntfy->u.isp24.vp_index;
 }
 
+/*
+ * Build NVME LS request
+ */
+static int
+qla_nvme_ls(srb_t *sp, struct pt_ls4_request *cmd_pkt)
+{
+	struct srb_iocb *nvme;
+	int     rval = QLA_SUCCESS;
+
+	nvme = &sp->u.iocb_cmd;
+	cmd_pkt->entry_type = PT_LS4_REQUEST;
+	cmd_pkt->entry_count = 1;
+	cmd_pkt->control_flags = CF_LS4_ORIGINATOR << CF_LS4_SHIFT;
+
+	cmd_pkt->timeout = cpu_to_le16(nvme->u.nvme.timeout_sec);
+	cmd_pkt->nport_handle = cpu_to_le16(sp->fcport->loop_id);
+	cmd_pkt->vp_index = sp->fcport->vha->vp_idx;
+
+	cmd_pkt->tx_dseg_count = 1;
+	cmd_pkt->tx_byte_count = nvme->u.nvme.cmd_len;
+	cmd_pkt->dseg0_len = nvme->u.nvme.cmd_len;
+	cmd_pkt->dseg0_address[0] = cpu_to_le32(LSD(nvme->u.nvme.cmd_dma));
+	cmd_pkt->dseg0_address[1] = cpu_to_le32(MSD(nvme->u.nvme.cmd_dma));
+
+	cmd_pkt->rx_dseg_count = 1;
+	cmd_pkt->rx_byte_count = nvme->u.nvme.rsp_len;
+	cmd_pkt->dseg1_len  = nvme->u.nvme.rsp_len;
+	cmd_pkt->dseg1_address[0] =  cpu_to_le32(LSD(nvme->u.nvme.rsp_dma));
+	cmd_pkt->dseg1_address[1] =  cpu_to_le32(MSD(nvme->u.nvme.rsp_dma));
+
+	return rval;
+}
+
 int
 qla2x00_start_sp(srb_t *sp)
 {
@@ -3211,6 +3244,9 @@ qla2x00_start_sp(srb_t *sp)
 	case SRB_FXIOCB_BCMD:
 		qlafx00_fxdisc_iocb(sp, pkt);
 		break;
+	case SRB_NVME_LS:
+		qla_nvme_ls(sp, pkt);
+		break;
 	case SRB_ABT_CMD:
 		IS_QLAFX00(ha) ?
 			qlafx00_abort_iocb(sp, pkt) :
drivers/scsi/qla2xxx/qla_isr.c +19 -0
index 477aea7c9a88..011faa1dc618 100644
@@ -2828,6 +2828,21 @@ qla24xx_abort_iocb_entry(scsi_qla_host_t *vha, struct req_que *req,
 	sp->done(sp, 0);
 }
 
+void qla24xx_nvme_ls4_iocb(scsi_qla_host_t *vha, struct pt_ls4_request *pkt,
+    struct req_que *req)
+{
+	srb_t *sp;
+	const char func[] = "LS4_IOCB";
+	uint16_t comp_status;
+
+	sp = qla2x00_get_sp_from_handle(vha, func, req, pkt);
+	if (!sp)
+		return;
+
+	comp_status = le16_to_cpu(pkt->status);
+	sp->done(sp, comp_status);
+}
+
 /**
  * qla24xx_process_response_queue() - Process response queue entries.
  * @ha: SCSI driver HA context
@@ -2901,6 +2916,10 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha,
 		case CTIO_CRC2:
 			qlt_response_pkt_all_vps(vha, rsp, (response_t *)pkt);
 			break;
+		case PT_LS4_REQUEST:
+			qla24xx_nvme_ls4_iocb(vha, (struct pt_ls4_request *)pkt,
+			    rsp->req);
+			break;
 		case NOTIFY_ACK_TYPE:
 			if (pkt->handle == QLA_TGT_SKIP_HANDLE)
 				qlt_response_pkt_all_vps(vha, rsp,
drivers/scsi/qla2xxx/qla_mbx.c +21 -0
index 1eac67e8fdfd..0764b6172ed1 100644
@@ -560,6 +560,8 @@ qla2x00_load_ram(scsi_qla_host_t *vha, dma_addr_t req_dma, uint32_t risc_addr,
 }
 
 #define	EXTENDED_BB_CREDITS	BIT_0
+#define	NVME_ENABLE_FLAG	BIT_3
+
 /*
  * qla2x00_execute_fw
  *     Start adapter firmware.
@@ -601,6 +603,9 @@ qla2x00_execute_fw(scsi_qla_host_t *vha, uint32_t risc_addr)
 		} else
 			mcp->mb[4] = 0;
 
+		if (ql2xnvmeenable && IS_QLA27XX(ha))
+			mcp->mb[4] |= NVME_ENABLE_FLAG;
+
 		if (ha->flags.exlogins_enabled)
 			mcp->mb[4] |= ENABLE_EXTENDED_LOGIN;
 
@@ -941,6 +946,22 @@ qla2x00_get_fw_version(scsi_qla_host_t *vha)
 			ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x1191,
 			    "%s: Firmware supports Exchange Offload 0x%x\n",
 			    __func__, ha->fw_attributes_h);
+
+		/* bit 26 of fw_attributes */
+		if ((ha->fw_attributes_h & 0x400) && ql2xnvmeenable) {
+			struct init_cb_24xx *icb;
+
+			icb = (struct init_cb_24xx *)ha->init_cb;
+			/*
+			 * fw supports nvme and driver load
+			 * parameter requested nvme
+			 */
+			vha->flags.nvme_enabled = 1;
+			icb->firmware_options_2 &= cpu_to_le32(~0xf);
+			ha->zio_mode = 0;
+			ha->zio_timer = 0;
+		}
+
 	}
 
 	if (IS_QLA27XX(ha)) {
drivers/scsi/qla2xxx/qla_nvme.c new file +756 -0

756 lines not on this page · raw message

drivers/scsi/qla2xxx/qla_nvme.h new file +132 -0

132 lines not on this page · raw message

drivers/scsi/qla2xxx/qla_os.c +33 -7
index ef5211fd2154..3b75d760b99e 100644
@@ -120,7 +120,11 @@ MODULE_PARM_DESC(ql2xmaxqdepth,
 		"Maximum queue depth to set for each LUN. "
 		"Default is 32.");
 
+#if (IS_ENABLED(CONFIG_NVME_FC))
+int ql2xenabledif;
+#else
 int ql2xenabledif = 2;
+#endif
 module_param(ql2xenabledif, int, S_IRUGO);
 MODULE_PARM_DESC(ql2xenabledif,
 		" Enable T10-CRC-DIF:\n"
@@ -129,6 +133,16 @@ MODULE_PARM_DESC(ql2xenabledif,
 		"  1 -- Enable DIF for all types\n"
 		"  2 -- Enable DIF for all types, except Type 0.\n");
 
+#if (IS_ENABLED(CONFIG_NVME_FC))
+int ql2xnvmeenable = 1;
+#else
+int ql2xnvmeenable;
+#endif
+module_param(ql2xnvmeenable, int, 0644);
+MODULE_PARM_DESC(ql2xnvmeenable,
+    "Enables NVME support. "
+    "0 - no NVMe.  Default is Y");
+
 int ql2xenablehba_err_chk = 2;
 module_param(ql2xenablehba_err_chk, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(ql2xenablehba_err_chk,
@@ -267,6 +281,7 @@ static void qla2x00_clear_drv_active(struct qla_hw_data *);
 static void qla2x00_free_device(scsi_qla_host_t *);
 static void qla83xx_disable_laser(scsi_qla_host_t *vha);
 static int qla2xxx_map_queues(struct Scsi_Host *shost);
+static void qla2x00_destroy_deferred_work(struct qla_hw_data *);
 
 struct scsi_host_template qla2xxx_driver_template = {
 	.module			= THIS_MODULE,
@@ -695,7 +710,7 @@ qla2x00_sp_free_dma(void *ptr)
 	}
 
 end:
-	if (sp->type != SRB_NVME_CMD) {
+	if ((sp->type != SRB_NVME_CMD) && (sp->type != SRB_NVME_LS)) {
 		CMD_SP(cmd) = NULL;
 		qla2x00_rel_sp(sp);
 	}
@@ -1700,15 +1715,23 @@ qla2x00_abort_all_cmds(scsi_qla_host_t *vha, int res)
 			if (sp) {
 				req->outstanding_cmds[cnt] = NULL;
 				if (sp->cmd_type == TYPE_SRB) {
-					/*
-					 * Don't abort commands in adapter
-					 * during EEH recovery as it's not
-					 * accessible/responding.
-					 */
-					if (GET_CMD_SP(sp) &&
+					if ((sp->type == SRB_NVME_CMD) ||
+					    (sp->type == SRB_NVME_LS)) {
+						sp_get(sp);
+						spin_unlock_irqrestore(
+						    &ha->hardware_lock, flags);
+						qla_nvme_abort(ha, sp);
+						spin_lock_irqsave(
+						    &ha->hardware_lock, flags);
+					} else if (GET_CMD_SP(sp) &&
 					    !ha->flags.eeh_busy &&
 					    (sp->type == SRB_SCSI_CMD)) {
 						/*
+						 * Don't abort commands in
+						 * adapter during EEH
+						 * recovery as it's not
+						 * accessible/responding.
+						 *
 						 * Get a reference to the sp
 						 * and drop the lock. The
 						 * reference ensures this
@@ -3534,6 +3557,9 @@ qla2x00_remove_one(struct pci_dev *pdev)
 		return;
 
 	set_bit(UNLOADING, &base_vha->dpc_flags);
+
+	qla_nvme_delete(base_vha);
+
 	dma_free_coherent(&ha->pdev->dev,
 		base_vha->gnl.size, base_vha->gnl.l, base_vha->gnl.ldma);
 
Signature · 1 line
2.12.0
#8 lore raw

PATCH v2 3/6 qla2xxx: Add FC-NVMe F/W initialization and transport registration

Quoted 13 lines · Himanshu

From: Duane Grigsby <duane.grigsby at cavium.com>

This code provides the interfaces to register remote and local ports of FC4 type 0x28 with the FC-NVMe transport and transports the requests (FC-NVMe FC link services and FC-NVMe commands IUs) to the fabric. It also provides the support for allocating h/w queues and aborting FC-NVMe FC requests.

Signed-off-by Darren Trapp <darren.trapp at cavium.com>
Signed-off-by Duane Grigsby <duane.grigsby at cavium.com>
Signed-off-by Anil Gurumurthy <anil.gurumurhty at cavium.com>
Signed-off-by Giridhar Malavali <giridhar.malavali at cavium.com>
Signed-off-by Himanshu Madhani <himanshu.madhani at cavium.com>
Quoted 16 lines
---
 drivers/scsi/qla2xxx/Makefile   |   2 +-
 drivers/scsi/qla2xxx/qla_dbg.c  |   2 +-
 drivers/scsi/qla2xxx/qla_def.h  |   6 +
 drivers/scsi/qla2xxx/qla_gbl.h  |  11 +
 drivers/scsi/qla2xxx/qla_init.c |   8 +
 drivers/scsi/qla2xxx/qla_iocb.c |  36 ++
 drivers/scsi/qla2xxx/qla_isr.c  |  19 +
 drivers/scsi/qla2xxx/qla_mbx.c  |  21 ++
 drivers/scsi/qla2xxx/qla_nvme.c | 756 ++++++++++++++++++++++++++++++++++++++++
 drivers/scsi/qla2xxx/qla_nvme.h | 132 +++++++
 drivers/scsi/qla2xxx/qla_os.c   |  40 ++-
 11 files changed, 1024 insertions(+), 9 deletions(-)
 create mode 100644 drivers/scsi/qla2xxx/qla_nvme.c
 create mode 100644 drivers/scsi/qla2xxx/qla_nvme.h
Reviewed-by Hannes Reinecke <hare at suse.com>

Cheers,

Hannes

Signature · 5 lines
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare at suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: F. Imend?rffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG N?rnberg)
#9 lore raw

PATCH v2 3/6 qla2xxx: Add FC-NVMe F/W initialization and transport registration

In reply to Madhani, Himanshu

On Wed, Jun 21, 2017@01:48:43PM -0700, Madhani, Himanshu wrote:
[...]

drivers/scsi/qla2xxx/qla_def.h typedef struct srb { · line 473

Quoted 1 line
drivers/scsi/qla2xxx/qla_def.h +1 -0
+	wait_queue_head_t nvme_ls_waitQ;

Can you please lower-case the 'Q' in waitQ IFF you have to re-send the series?

[...]

Review

Quoted 1 line
(quoted diff) +1 -0
+	wait_queue_head_t nvme_waitQ;

Ditto

[...]

Review

Quoted 1 line
(quoted diff) +1 -0
+	wait_queue_head_t nvme_waitQ;

And here as well.

Quoted 6 lines
drivers/scsi/qla2xxx/qla_gbl.h +0 -0
index 6fbee11c1a18..c6af45f7d5d6 100644
@@ -10,6 +10,16 @@
 #include <linux/interrupt.h>

drivers/scsi/qla2xxx/qla_gbl.h line 20

Quoted 10 lines
drivers/scsi/qla2xxx/qla_gbl.h +8 -0
 
 /*
+ * Global functions prototype in qla_nvme.c source file.
+ */
+extern void qla_nvme_register_hba(scsi_qla_host_t *);
+extern int  qla_nvme_register_remote(scsi_qla_host_t *, fc_port_t *);
+extern void qla_nvme_delete(scsi_qla_host_t *);
+extern void qla_nvme_abort(struct qla_hw_data *, srb_t *sp);
+extern void qla24xx_nvme_ls4_iocb(scsi_qla_host_t *, struct pt_ls4_request *,
+    struct req_que *);

You're still not convinced of the idea of headers, heh ;-) Especially as you have a qla_nvme.h.

[...]

drivers/scsi/qla2xxx/qla_gbl.h line 25

Quoted 5 lines
drivers/scsi/qla2xxx/qla_gbl.h +5 -0
+	INIT_WORK(&fcport->nvme_del_work, qla_nvme_unregister_remote_port);
+	rport = kzalloc(sizeof(*rport), GFP_KERNEL);
+	if (!rport) {
+		ql_log(ql_log_warn, vha, 0x2101,
+		    "%s: unable to alloc memory\n", __func__);

kzalloc() will warn you about a failed allocation, no need to double it. See also:
http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf

[...]

drivers/scsi/qla2xxx/qla_gbl.h

Quoted 10 lines
drivers/scsi/qla2xxx/qla_gbl.h +10 -0
+	ret = nvme_fc_register_remoteport(vha->nvme_local_port, &rport->req,
+	    &fcport->nvme_remote_port);
+	if (ret) {
+		ql_log(ql_log_warn, vha, 0x212e,
+		    "Failed to register remote port. Transport returned %d\n",
+		    ret);
+		return ret;
+	}
+
+	fcport->nvme_remote_port->private = fcport;

I think I already said that in the last review, but can you please move the fcport->nvme_remote_port->private = fcport;
assingment _above_ the nvme_fc_register_remoteport() call.

[...]

drivers/scsi/qla2xxx/qla_gbl.h

Quoted 1 line
drivers/scsi/qla2xxx/qla_gbl.h +1 -0
+	vha = (struct scsi_qla_host *)lport->private;

No need to cast from void *

drivers/scsi/qla2xxx/qla_gbl.h

Quoted 3 lines
drivers/scsi/qla2xxx/qla_gbl.h +3 -0
+	ql_log(ql_log_info, vha, 0x2104,
+	    "%s: handle %p, idx =%d, qsize %d\n",
+	    __func__, handle, qidx, qsize);

Btw, sometime in the future you could change your ql_log() thingies to the kernel's dyndebug facility.

[...]

drivers/scsi/qla2xxx/qla_gbl.h

Quoted 8 lines
drivers/scsi/qla2xxx/qla_gbl.h +8 -0
+	rval = ha->isp_ops->abort_command(sp);
+	if (rval != QLA_SUCCESS)
+		ql_log(ql_log_warn, fcport->vha, 0x2125,
+		    "%s: failed to abort LS command for SP:%p rval=%x\n",
+		    __func__, sp, rval);
+
+	ql_dbg(ql_dbg_io, fcport->vha, 0x212b,
+	    "%s: aborted sp:%p on fcport:%p\n", __func__, sp, fcport);

If you insinst in having these two messages ("failed to abort" and "aborted") can you at least fold it into one print statement.

drivers/scsi/qla2xxx/qla_gbl.h

Quoted 8 lines
drivers/scsi/qla2xxx/qla_gbl.h +8 -0
+	rval = ha->isp_ops->abort_command(sp);
+	if (!rval)
+		ql_log(ql_log_warn, fcport->vha, 0x2127,
+		    "%s: failed to abort command for SP:%p rval=%x\n",
+		    __func__, sp, rval);
+
+	ql_dbg(ql_dbg_io, fcport->vha, 0x2126,
+	    "%s: aborted sp:%p on fcport:%p\n", __func__, sp, fcport);

Ditto.

[...]

drivers/scsi/qla2xxx/qla_gbl.h

Quoted 9 lines
drivers/scsi/qla2xxx/qla_gbl.h +9 -0
+	/* Setup qpair pointers */
+	req = qpair->req;
+	tot_dsds = fd->sg_cnt;
+
+	/* Acquire qpair specific lock */
+	spin_lock_irqsave(&qpair->qp_lock, flags);
+
+	/* Check for room in outstanding command list. */
+	handle = req->current_outstanding_cmd;

I've just seen this in qla2xxx_start_scsi_mq() and qla2xxx_dif_start_scsi_mq() and was about to send you an RFC patch. But here it is for completeness in the nvme version as well:

You save a pointer to the req_que from you qpair and _afterwards_ you grab the qp_lock. What prevents someone from changing the request internals underneath you?

Like this:

CPU0 CPU1

req = qpair->req;
                                 qla2xxx_delete_qpair(vha, qpair);
                                 `-> ret = qla25xx_delete_req_que(vha, qpair->req);

spin_lock_irqsave(&qpair->qp_lock, flags);
handle = req->current_outstanding_cmd;

Oh and btw, neither qla2xxx_delete_qpair() nor qla25xx_delete_req_que() grab the qp_lock.

I think this is something work re-thinking. Maybe you can identify the blocks accessing struct members which need to be touched under a lock and extract them into a helper function wich calls lockdep_assert_held(). No must just and idea.

[...]

drivers/scsi/qla2xxx/qla_gbl.h

Quoted 3 lines
drivers/scsi/qla2xxx/qla_gbl.h +3 -0
+
+	/* Load data segments */
+	for_each_sg(sgl, sg, tot_dsds, i) {

Do you really need the whole loop under a spin_lock_irqsave()? If the sglist has a lot of entries (i.e. becasue we couldn't cluster it) we're in risk to trigger a NMI watchdog soft-lockup WARN_ON(). You need to grab the lock when accessing req's members but the rest of the loop? This applies to qla24xx_build_scsi_iocbs() for SCSI as well.

[...]

drivers/scsi/qla2xxx/qla_gbl.h

Quoted 1 line
drivers/scsi/qla2xxx/qla_gbl.h +1 -0
+	struct qla_qpair *qpair = (struct qla_qpair *)hw_queue_handle;

Void pointer cast. Someone really should write a coccinelle script to get rid of 'em.

[...]

drivers/scsi/qla2xxx/qla_gbl.h

Quoted 4 lines
drivers/scsi/qla2xxx/qla_gbl.h +4 -0
+	/* Alloc SRB structure */
+	sp = qla2xxx_get_qpair_sp(qpair, fcport, GFP_ATOMIC);
+	if (!sp)
+		return -EIO;

__blk_mq_run_hw_queue()
`-> blk_mq_sched_dispatch_requests()

    `-> blk_mq_dispatch_rq_list()
        `-> nvme_fc_queue_rq()
            `-> nvme_fc_start_fcp_op() 
                `-> qla_nvme_post_cmd()

isn't called from an IRQ context and qla2xxx_get_qpair_sp() internally uses mempool_alloc(). From mempool_alloc()'s documentation:

"Note that due to preallocation, this function *never* fails when called from process contexts. (it might fail if called from an IRQ context.)" mm/mempool.c:306

[...]

drivers/scsi/qla2xxx/qla_gbl.h

Quoted 1 line
drivers/scsi/qla2xxx/qla_gbl.h +1 -0
+	fcport = (fc_port_t *)rport->private;

Void cast.

[...]

drivers/scsi/qla2xxx/qla_gbl.h

Quoted 3 lines
drivers/scsi/qla2xxx/qla_gbl.h +3 -0
+	rval = ha->isp_ops->abort_command(sp);
+	if (!rval) {
+		if (!qla_nvme_wait_on_command(sp))
        if (!rval && !qla_nvme_wait_on_command(sp))

[...]

drivers/scsi/qla2xxx/qla_gbl.h

Quoted 3 lines
drivers/scsi/qla2xxx/qla_gbl.h +3 -0
+		for (cnt = 1; cnt < req->num_outstanding_cmds; cnt++) {
+			sp = req->outstanding_cmds[cnt];
+			if ((sp) && ((sp->type == SRB_NVME_CMD) ||

^ parenthesis

drivers/scsi/qla2xxx/qla_gbl.h

Quoted 2 lines
drivers/scsi/qla2xxx/qla_gbl.h +2 -0
+			    (sp->type == SRB_NVME_LS)) &&
+				(sp->fcport == fcport)) {

^ parenthesis

[...]

drivers/scsi/qla2xxx/qla_nvme.h

Quoted 1 line
drivers/scsi/qla2xxx/qla_nvme.h +0 -0

[...]

void qla_nvme_register_hba(scsi_qla_host_t *);
int qla_nvme_register_remote(scsi_qla_host_t *, fc_port_t *);
void qla_nvme_delete(scsi_qla_host_t *);
void qla_nvme_abort(struct qla_hw_data *, srb_t *sp);
void qla24xx_nvme_ls4_iocb(scsi_qla_host_t *, struct pt_ls4_request *, struct req_que *);

[...]

drivers/scsi/qla2xxx/qla_nvme.h

Quoted 9 lines
drivers/scsi/qla2xxx/qla_nvme.h +9 -0
+#if (IS_ENABLED(CONFIG_NVME_FC))
+int ql2xnvmeenable = 1;
+#else
+int ql2xnvmeenable;
+#endif
+module_param(ql2xnvmeenable, int, 0644);
+MODULE_PARM_DESC(ql2xnvmeenable,
+    "Enables NVME support. "
+    "0 - no NVMe.  Default is Y");

Default is Y IFF CONFIG_NVME_FC is enabled. Is it possible to guard the whole module paraneter with IS_ENABLED(CONFIG_NVME_FC)? Not sure if this would break if CONFIG_NVME_FC=n and someone does qla2xxx.ql2xnvmeenable=N.

[...]

drivers/scsi/qla2xxx/qla_nvme.h

Quoted 2 lines
drivers/scsi/qla2xxx/qla_nvme.h +1 -1
-	if (sp->type != SRB_NVME_CMD) {
+	if ((sp->type != SRB_NVME_CMD) && (sp->type != SRB_NVME_LS)) {

http://en.cppreference.com/w/c/language/operator_precedence

drivers/scsi/qla2xxx/qla_nvme.h

Quoted 2 lines
drivers/scsi/qla2xxx/qla_nvme.h +2 -0
+					if ((sp->type == SRB_NVME_CMD) ||
+					    (sp->type == SRB_NVME_LS)) {

^^

Thanks,
Johannes

Signature · 6 lines
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

A message that is not in the archive (sent off-list or not yet received): [email protected]

#11 lore raw

PATCH v2 3/6 qla2xxx: Add FC-NVMe F/W initialization and transport registration

Quoted 2 lines · James Smart

He can't move it. the fcport->nvme_remote_port pointer is set by the nvme_fc_register_remoteport() routine (if return status is 0).

Gah, that's kind of wired. Literly _all_ of the Kernel's register_xxx() funtions have a semantic that after the registration is done the object can be used and thus assigning private pointer afterwards is an error. Damn I didn't realize this in the nmve-fc review.

Signature · 6 lines
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
#12 lore raw

PATCH v2 3/6 qla2xxx: Add FC-NVMe F/W initialization and transport registration

In reply to Johannes Thumshirn

Hi Johannes,

Quoted 7 lines · Johannes Thumshirn

On Wed, Jun 21, 2017@01:48:43PM -0700, Madhani, Himanshu wrote:
[...]

drivers/scsi/qla2xxx/qla_def.h typedef struct srb { · line 473

Quoted 1 line
drivers/scsi/qla2xxx/qla_def.h +1 -0
+	wait_queue_head_t nvme_ls_waitQ;

Can you please lower-case the 'Q' in waitQ IFF you have to re-send the series?

sure.

Quoted 6 lines

[...]

Review

Quoted 1 line
(quoted diff) +1 -0
+	wait_queue_head_t nvme_waitQ;

Ditto

Ack

Quoted 4 lines

[...]

Review

Quoted 1 line
(quoted diff) +1 -0
+	wait_queue_head_t nvme_waitQ;

And here as well.

Ack

Quoted 21 lines
Quoted 7 lines
drivers/scsi/qla2xxx/qla_gbl.h +0 -0
index 6fbee11c1a18..c6af45f7d5d6 100644
@@ -10,6 +10,16 @@
 #include <linux/interrupt.h>

drivers/scsi/qla2xxx/qla_gbl.h line 20

Quoted 10 lines
drivers/scsi/qla2xxx/qla_gbl.h +8 -0
 
 /*
+ * Global functions prototype in qla_nvme.c source file.
+ */
+extern void qla_nvme_register_hba(scsi_qla_host_t *);
+extern int  qla_nvme_register_remote(scsi_qla_host_t *, fc_port_t *);
+extern void qla_nvme_delete(scsi_qla_host_t *);
+extern void qla_nvme_abort(struct qla_hw_data *, srb_t *sp);
+extern void qla24xx_nvme_ls4_iocb(scsi_qla_host_t *, struct pt_ls4_request *,
+    struct req_que *);

You're still not convinced of the idea of headers, heh ;-) Especially as you have a qla_nvme.h.

Quoted 2 lines

[?]

if this is not *must* i?ll like to post patch for this with other patches that I am going to queue up during rc1 phase.

Quoted 11 lines

drivers/scsi/qla2xxx/qla_gbl.h line 25

Quoted 5 lines
drivers/scsi/qla2xxx/qla_gbl.h +5 -0
+	INIT_WORK(&fcport->nvme_del_work, qla_nvme_unregister_remote_port);
+	rport = kzalloc(sizeof(*rport), GFP_KERNEL);
+	if (!rport) {
+		ql_log(ql_log_warn, vha, 0x2101,
+		    "%s: unable to alloc memory\n", __func__);

kzalloc() will warn you about a failed allocation, no need to double it. See also:
http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf

[?]

Ack.

Quoted 6 lines
Quoted 6 lines
drivers/scsi/qla2xxx/qla_gbl.h +6 -0
+	ret = nvme_fc_register_remoteport(vha->nvme_local_port, &rport->req,
+	    &fcport->nvme_remote_port);
+	if (ret) {
+		ql_log(ql_log_warn, vha, 0x212e,
+		    "Failed to register remote port. Transport returned %d\n",
+		    ret);
Quoted 9 lines

drivers/scsi/qla2xxx/qla_gbl.h

Quoted 4 lines
drivers/scsi/qla2xxx/qla_gbl.h +4 -0
+		return ret;
+	}
+
+	fcport->nvme_remote_port->private = fcport;

I think I already said that in the last review, but can you please move the fcport->nvme_remote_port->private = fcport;
assingment _above_ the nvme_fc_register_remoteport() call.

I saw your response to James that this is okay for FC NVMe code.

Quoted 5 lines

[...]

drivers/scsi/qla2xxx/qla_gbl.h

Quoted 1 line
drivers/scsi/qla2xxx/qla_gbl.h +1 -0
+	vha = (struct scsi_qla_host *)lport->private;

No need to cast from void *

Quoted 8 lines

drivers/scsi/qla2xxx/qla_gbl.h

Quoted 3 lines
drivers/scsi/qla2xxx/qla_gbl.h +3 -0
+	ql_log(ql_log_info, vha, 0x2104,
+	    "%s: handle %p, idx =%d, qsize %d\n",
+	    __func__, handle, qidx, qsize);

Btw, sometime in the future you could change your ql_log() thingies to the kernel's dyndebug facility.

[?]

Thanks for the suggestions. I?ll bring it up to team and we can slowly convert these to kernel?s dynamic debugging facility.

Quoted 12 lines

drivers/scsi/qla2xxx/qla_gbl.h

Quoted 8 lines
drivers/scsi/qla2xxx/qla_gbl.h +8 -0
+	rval = ha->isp_ops->abort_command(sp);
+	if (rval != QLA_SUCCESS)
+		ql_log(ql_log_warn, fcport->vha, 0x2125,
+		    "%s: failed to abort LS command for SP:%p rval=%x\n",
+		    __func__, sp, rval);
+
+	ql_dbg(ql_dbg_io, fcport->vha, 0x212b,
+	    "%s: aborted sp:%p on fcport:%p\n", __func__, sp, fcport);

If you insinst in having these two messages ("failed to abort" and "aborted") can you at least fold it into one print statement.

I?ll send follow up patch for this cleanup, if its okay with you?

Quoted 11 lines

drivers/scsi/qla2xxx/qla_gbl.h

Quoted 8 lines
drivers/scsi/qla2xxx/qla_gbl.h +8 -0
+	rval = ha->isp_ops->abort_command(sp);
+	if (!rval)
+		ql_log(ql_log_warn, fcport->vha, 0x2127,
+		    "%s: failed to abort command for SP:%p rval=%x\n",
+		    __func__, sp, rval);
+
+	ql_dbg(ql_dbg_io, fcport->vha, 0x2126,
+	    "%s: aborted sp:%p on fcport:%p\n", __func__, sp, fcport);

Ditto.

Agree. Will fold this into cleanup patch.

Quoted 30 lines

[...]

drivers/scsi/qla2xxx/qla_gbl.h

Quoted 9 lines
drivers/scsi/qla2xxx/qla_gbl.h +9 -0
+	/* Setup qpair pointers */
+	req = qpair->req;
+	tot_dsds = fd->sg_cnt;
+
+	/* Acquire qpair specific lock */
+	spin_lock_irqsave(&qpair->qp_lock, flags);
+
+	/* Check for room in outstanding command list. */
+	handle = req->current_outstanding_cmd;

I've just seen this in qla2xxx_start_scsi_mq() and qla2xxx_dif_start_scsi_mq() and was about to send you an RFC patch. But here it is for completeness in the nvme version as well:

You save a pointer to the req_que from you qpair and _afterwards_ you grab the qp_lock. What prevents someone from changing the request internals underneath you?

Like this:

CPU0 CPU1

req = qpair->req;
                                qla2xxx_delete_qpair(vha, qpair);
                                `-> ret = qla25xx_delete_req_que(vha, qpair->req);

spin_lock_irqsave(&qpair->qp_lock, flags);
handle = req->current_outstanding_cmd;

Quoted 8 lines

Oh and btw, neither qla2xxx_delete_qpair() nor qla25xx_delete_req_que() grab the qp_lock.

I think this is something work re-thinking. Maybe you can identify the blocks accessing struct members which need to be touched under a lock and extract them into a helper function wich calls lockdep_assert_held(). No must just and idea.

This is very valid point you brought up and thanks for the detail review comment. from your patch submitted this morning, I?ll like to have our test team run through regression testing with these changes and we can incorporate that into NVMe as well and send a follow up patch to correct this. Would you be okay with that?

Quoted 11 lines

[...]

drivers/scsi/qla2xxx/qla_gbl.h

Quoted 3 lines
drivers/scsi/qla2xxx/qla_gbl.h +3 -0
+
+	/* Load data segments */
+	for_each_sg(sgl, sg, tot_dsds, i) {

Do you really need the whole loop under a spin_lock_irqsave()? If the sglist has a lot of entries (i.e. becasue we couldn't cluster it) we're in risk to trigger a NMI watchdog soft-lockup WARN_ON(). You need to grab the lock when accessing req's members but the rest of the loop? This applies to qla24xx_build_scsi_iocbs() for SCSI as well.

Since these changes would need us to do regression testing, I would like to send a follow up patch to correct them as a separate patch.

Quoted 7 lines

[...]

drivers/scsi/qla2xxx/qla_gbl.h

Quoted 1 line
drivers/scsi/qla2xxx/qla_gbl.h +1 -0
+	struct qla_qpair *qpair = (struct qla_qpair *)hw_queue_handle;

Void pointer cast. Someone really should write a coccinelle script to get rid of em.

Will send a follow up patch for cleanup

Quoted 13 lines

[...]

drivers/scsi/qla2xxx/qla_gbl.h

Quoted 4 lines
drivers/scsi/qla2xxx/qla_gbl.h +4 -0
+	/* Alloc SRB structure */
+	sp = qla2xxx_get_qpair_sp(qpair, fcport, GFP_ATOMIC);
+	if (!sp)
+		return -EIO;

__blk_mq_run_hw_queue()
`-> blk_mq_sched_dispatch_requests()
`-> blk_mq_dispatch_rq_list()

       `-> nvme_fc_queue_rq()
           `-> nvme_fc_start_fcp_op() 
               `-> qla_nvme_post_cmd()
Quoted 7 lines

isn't called from an IRQ context and qla2xxx_get_qpair_sp() internally uses mempool_alloc(). From mempool_alloc()'s documentation:

"Note that due to preallocation, this function *never* fails when called from process contexts. (it might fail if called from an IRQ context.)" mm/mempool.c:306

Will investigate and work on fixing this.

Quoted 5 lines

[...]

drivers/scsi/qla2xxx/qla_gbl.h

Quoted 1 line
drivers/scsi/qla2xxx/qla_gbl.h +1 -0
+	fcport = (fc_port_t *)rport->private;

Void cast.

Quoted 7 lines

[...]

drivers/scsi/qla2xxx/qla_gbl.h

Quoted 3 lines
drivers/scsi/qla2xxx/qla_gbl.h +3 -0
+	rval = ha->isp_ops->abort_command(sp);
+	if (!rval) {
+		if (!qla_nvme_wait_on_command(sp))
       if (!rval && !qla_nvme_wait_on_command(sp))

Ack. Will fold it into cleanup patch if you are okay?

Quoted 12 lines

[...]

drivers/scsi/qla2xxx/qla_gbl.h

Quoted 3 lines
drivers/scsi/qla2xxx/qla_gbl.h +3 -0
+		for (cnt = 1; cnt < req->num_outstanding_cmds; cnt++) {
+			sp = req->outstanding_cmds[cnt];
+			if ((sp) && ((sp->type == SRB_NVME_CMD) ||

^ parenthesis

drivers/scsi/qla2xxx/qla_gbl.h

Quoted 2 lines
drivers/scsi/qla2xxx/qla_gbl.h +2 -0
+			    (sp->type == SRB_NVME_LS)) &&
+				(sp->fcport == fcport)) {

^ parenthesis

[...]

Quoted 9 lines

drivers/scsi/qla2xxx/qla_nvme.h

Quoted 1 line
drivers/scsi/qla2xxx/qla_nvme.h +0 -0

[...]

void qla_nvme_register_hba(scsi_qla_host_t *);
int qla_nvme_register_remote(scsi_qla_host_t *, fc_port_t *);
void qla_nvme_delete(scsi_qla_host_t *);
void qla_nvme_abort(struct qla_hw_data *, srb_t *sp);
void qla24xx_nvme_ls4_iocb(scsi_qla_host_t *, struct pt_ls4_request *, struct req_que *);

I?ll have this as a follow up patch.

Quoted 16 lines

[...]

drivers/scsi/qla2xxx/qla_nvme.h

Quoted 9 lines
drivers/scsi/qla2xxx/qla_nvme.h +9 -0
+#if (IS_ENABLED(CONFIG_NVME_FC))
+int ql2xnvmeenable = 1;
+#else
+int ql2xnvmeenable;
+#endif
+module_param(ql2xnvmeenable, int, 0644);
+MODULE_PARM_DESC(ql2xnvmeenable,
+    "Enables NVME support. "
+    "0 - no NVMe.  Default is Y");

Default is Y IFF CONFIG_NVME_FC is enabled. Is it possible to guard the whole module paraneter with IS_ENABLED(CONFIG_NVME_FC)? Not sure if this would break if CONFIG_NVME_FC=n and someone does qla2xxx.ql2xnvmeenable=N.

Quoted 7 lines

[...]

drivers/scsi/qla2xxx/qla_nvme.h

Quoted 2 lines
drivers/scsi/qla2xxx/qla_nvme.h +1 -1
-	if (sp->type != SRB_NVME_CMD) {
+	if ((sp->type != SRB_NVME_CMD) && (sp->type != SRB_NVME_LS)) {

http://en.cppreference.com/w/c/language/operator_precedence

If you agree i?ll like to take these comments for cleanup series that i?ll submit as a follow up series.

Quoted 5 lines

drivers/scsi/qla2xxx/qla_nvme.h

Quoted 2 lines
drivers/scsi/qla2xxx/qla_nvme.h +2 -0
+					if ((sp->type == SRB_NVME_CMD) ||
+					    (sp->type == SRB_NVME_LS)) {

^^

Quoted 10 lines

Thanks,
Johannes

Signature · 6 lines
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

Thanks for these details review of this series and valuable input.

I?ll send follow up series shortly. Let me know if this series is okay as is and a follow up patches to address concerns by you are okay.

Thanks,
-Himanshu

#13 lore raw

PATCH v2 3/6 qla2xxx: Add FC-NVMe F/W initialization and transport registration

Quoted 1 line · Himanshu

if this is not *must* i?ll like to post patch for this with other patches that I am going to queue up during rc1 phase.

Ok.

[...]

Quoted 14 lines

I saw your response to James that this is okay for FC NVMe code.

Quoted 12 lines

[...]

drivers/scsi/qla2xxx/qla_nvme.c line 96

Quoted 1 line
drivers/scsi/qla2xxx/qla_nvme.c new file +1 -0
+	vha = (struct scsi_qla_host *)lport->private;

No need to cast from void *

drivers/scsi/qla2xxx/qla_nvme.c line 101

Quoted 3 lines
drivers/scsi/qla2xxx/qla_nvme.c new file +3 -0
+	ql_log(ql_log_info, vha, 0x2104,
+	    "%s: handle %p, idx =%d, qsize %d\n",
+	    __func__, handle, qidx, qsize);

Btw, sometime in the future you could change your ql_log() thingies to the kernel's dyndebug facility.

Quoted 4 lines
Quoted 1 line

[?]

Thanks for the suggestions. I?ll bring it up to team and we can slowly convert these to kernel?s dynamic debugging facility.

Thanks a lot.

Quoted 15 lines
Quoted 14 lines

drivers/scsi/qla2xxx/qla_nvme.c line 201

Quoted 10 lines
drivers/scsi/qla2xxx/qla_nvme.c new file +8 -0
+	rval = ha->isp_ops->abort_command(sp);
+	if (rval != QLA_SUCCESS)
+		ql_log(ql_log_warn, fcport->vha, 0x2125,
+		    "%s: failed to abort LS command for SP:%p rval=%x\n",
+		    __func__, sp, rval);
+
+	ql_dbg(ql_dbg_io, fcport->vha, 0x212b,
+	    "%s: aborted sp:%p on fcport:%p\n", __func__, sp, fcport);

If you insinst in having these two messages ("failed to abort" and "aborted") can you at least fold it into one print statement.

Quoted 1 line

I?ll send follow up patch for this cleanup, if its okay with you?

OK

[...]

Quoted 26 lines
Quoted 17 lines

I've just seen this in qla2xxx_start_scsi_mq() and qla2xxx_dif_start_scsi_mq() and was about to send you an RFC patch. But here it is for completeness in the nvme version as well:

You save a pointer to the req_que from you qpair and _afterwards_ you grab the qp_lock. What prevents someone from changing the request internals underneath you?

Like this:

CPU0 CPU1

req = qpair->req;
                                qla2xxx_delete_qpair(vha, qpair);
                                `-> ret = qla25xx_delete_req_que(vha, qpair->req);

spin_lock_irqsave(&qpair->qp_lock, flags);
handle = req->current_outstanding_cmd;

Quoted 8 lines

Oh and btw, neither qla2xxx_delete_qpair() nor qla25xx_delete_req_que() grab the qp_lock.

I think this is something work re-thinking. Maybe you can identify the blocks accessing struct members which need to be touched under a lock and extract them into a helper function wich calls lockdep_assert_held(). No must just and idea.

Quoted 4 lines

This is very valid point you brought up and thanks for the detail review comment. from your patch submitted this morning, I?ll like to have our test team run through regression testing with these changes and we can incorporate that into NVMe as well and send a follow up patch to correct this. Would you be okay with that?

That patch has a bug and I'll need to respin it, but I'll be sending you a v2 today.

Quoted 13 lines
Quoted 12 lines

[...]

drivers/scsi/qla2xxx/qla_nvme.c line 424

Quoted 3 lines
drivers/scsi/qla2xxx/qla_nvme.c new file +3 -0
+
+	/* Load data segments */
+	for_each_sg(sgl, sg, tot_dsds, i) {

Do you really need the whole loop under a spin_lock_irqsave()? If the sglist has a lot of entries (i.e. becasue we couldn't cluster it) we're in risk to trigger a NMI watchdog soft-lockup WARN_ON(). You need to grab the lock when accessing req's members but the rest of the loop? This applies to qla24xx_build_scsi_iocbs() for SCSI as well.

Quoted 2 lines

Since these changes would need us to do regression testing, I would like to send a follow up patch to correct them as a separate patch.

Sure.

Quoted 27 lines
Quoted 8 lines

[...]

Review

Quoted 1 line
(quoted diff) +1 -0
+	struct qla_qpair *qpair = (struct qla_qpair *)hw_queue_handle;

Void pointer cast. Someone really should write a coccinelle script to get rid of em.

Will send a follow up patch for cleanup

Quoted 16 lines

[...]

drivers/scsi/qla2xxx/qla_nvme.c line 510

Quoted 4 lines
drivers/scsi/qla2xxx/qla_nvme.c new file +4 -0
+	/* Alloc SRB structure */
+	sp = qla2xxx_get_qpair_sp(qpair, fcport, GFP_ATOMIC);
+	if (!sp)
+		return -EIO;

__blk_mq_run_hw_queue()
`-> blk_mq_sched_dispatch_requests()
`-> blk_mq_dispatch_rq_list()

       `-> nvme_fc_queue_rq()
           `-> nvme_fc_start_fcp_op() 
               `-> qla_nvme_post_cmd()

isn't called from an IRQ context and qla2xxx_get_qpair_sp() internally uses mempool_alloc(). From mempool_alloc()'s documentation:

Quoted 7 lines
Quoted 4 lines

"Note that due to preallocation, this function *never* fails when called from process contexts. (it might fail if called from an IRQ context.)" mm/mempool.c:306

Will investigate and work on fixing this.

I think I did a mistake here, qla2xxx_get_qpair_sp() can fail for other reasons than OOM. My bad, sorry.

Quoted 4 lines

Thanks for these details review of this series and valuable input.

I?ll send follow up series shortly. Let me know if this series is okay as is and a follow up patches to address concerns by you are okay.

Thanks a lot,
Johannes

Signature · 6 lines
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
#14 lore raw

PATCH v2 4/6 qla2xxx: Send FC4 type NVMe to the management server

In reply to Madhani, Himanshu

From: Duane Grigsby <[email protected]>

This patch adds switch command support for FC-4 type of FC-NVMe (0x28) for resgistering HBA port to the management server. RFT_ID command is used to register FC-4 type of 0x28 and RFF_ID is used to register FC-4 features bits for FC-NVMe port.

Signed-off-by Darren Trapp <darren.trapp at cavium.com>
Signed-off-by Duane Grigsby <duane.grigsby at cavium.com>
Signed-off-by Anil Gurumurthy <anil.gurumurhty at cavium.com>
Signed-off-by Giridhar Malavali <giridhar.malavali at cavium.com>
Signed-off-by Himanshu Madhani <himanshu.madhani at cavium.com>
Reviewed-by James Smart <james.smart at broadcom.com>
---
 drivers/scsi/qla2xxx/qla_def.h  |   1 +
 drivers/scsi/qla2xxx/qla_gbl.h  |   6 +-
 drivers/scsi/qla2xxx/qla_gs.c   | 118 +++++++++++++++++++++++++++++++++++++++-
 drivers/scsi/qla2xxx/qla_init.c |  11 +++-
 4 files changed, 131 insertions(+), 5 deletions(-)
drivers/scsi/qla2xxx/qla_def.h +1 -0
index 0dbcb84011b0..0730b10b4280 100644
@@ -2867,6 +2867,7 @@ struct ct_sns_rsp {
 		} gpsc;
 
 #define GFF_FCP_SCSI_OFFSET	7
+#define GFF_NVME_OFFSET		23 /* type = 28h */
 		struct {
 			uint8_t fc4_features[128];
 		} gff_id;
drivers/scsi/qla2xxx/qla_gbl.h +4 -2
index c6af45f7d5d6..cadb6e3baacc 100644
@@ -18,6 +18,7 @@ extern void qla_nvme_delete(scsi_qla_host_t *);
 extern void qla_nvme_abort(struct qla_hw_data *, srb_t *sp);
 extern void qla24xx_nvme_ls4_iocb(scsi_qla_host_t *, struct pt_ls4_request *,
     struct req_que *);
+extern void qla24xx_async_gffid_sp_done(void *, int);
 
 /*
  * Global Function Prototypes in qla_init.c source file.
@@ -618,7 +619,7 @@ extern int qla2x00_gpn_id(scsi_qla_host_t *, sw_info_t *);
 extern int qla2x00_gnn_id(scsi_qla_host_t *, sw_info_t *);
 extern void qla2x00_gff_id(scsi_qla_host_t *, sw_info_t *);
 extern int qla2x00_rft_id(scsi_qla_host_t *);
-extern int qla2x00_rff_id(scsi_qla_host_t *);
+extern int qla2x00_rff_id(scsi_qla_host_t *, u8);
 extern int qla2x00_rnn_id(scsi_qla_host_t *);
 extern int qla2x00_rsnn_nn(scsi_qla_host_t *);
 extern void *qla2x00_prep_ms_fdmi_iocb(scsi_qla_host_t *, uint32_t, uint32_t);
@@ -644,7 +645,8 @@ void qla24xx_handle_gpnid_event(scsi_qla_host_t *, struct event_arg *);
 int qla24xx_post_gpsc_work(struct scsi_qla_host *, fc_port_t *);
 int qla24xx_async_gpsc(scsi_qla_host_t *, fc_port_t *);
 int qla2x00_mgmt_svr_login(scsi_qla_host_t *);
-
+void qla24xx_handle_gffid_event(scsi_qla_host_t *vha, struct event_arg *ea);
+int qla24xx_async_gffid(scsi_qla_host_t *vha, fc_port_t *fcport);
 /*
  * Global Function Prototypes in qla_attr.c source file.
  */
drivers/scsi/qla2xxx/qla_gs.c +116 -2

145 lines not on this page · raw message

drivers/scsi/qla2xxx/qla_init.c +10 -1
index 7286a80f796c..227c18426c6d 100644
@@ -1244,6 +1244,9 @@ void qla2x00_fcport_event_handler(scsi_qla_host_t *vha, struct event_arg *ea)
 	case FCME_GPNID_DONE:
 		qla24xx_handle_gpnid_event(vha, ea);
 		break;
+	case FCME_GFFID_DONE:
+		qla24xx_handle_gffid_event(vha, ea);
+		break;
 	case FCME_DELETE_DONE:
 		qla24xx_handle_delete_done_event(vha, ea);
 		break;
@@ -4626,7 +4629,7 @@ qla2x00_configure_fabric(scsi_qla_host_t *vha)
 				    &vha->dpc_flags))
 					break;
 			}
-			if (qla2x00_rff_id(vha)) {
+			if (qla2x00_rff_id(vha, FC4_TYPE_FCP_SCSI)) {
 				/* EMPTY */
 				ql_dbg(ql_dbg_disc, vha, 0x209a,
 				    "Register FC-4 Features failed.\n");
@@ -4634,6 +4637,12 @@ qla2x00_configure_fabric(scsi_qla_host_t *vha)
 				    &vha->dpc_flags))
 					break;
 			}
+			if (vha->flags.nvme_enabled) {
+				if (qla2x00_rff_id(vha, FC_TYPE_NVME)) {
+					ql_dbg(ql_dbg_disc, vha, 0x2049,
+					    "Register NVME FC Type Features failed.\n");
+				}
+			}
 			if (qla2x00_rnn_id(vha)) {
 				/* EMPTY */
 				ql_dbg(ql_dbg_disc, vha, 0x2104,
Signature · 1 line
2.12.0
#15 lore raw

PATCH v2 4/6 qla2xxx: Send FC4 type NVMe to the management server

Quoted 13 lines · Himanshu

From: Duane Grigsby <duane.grigsby at cavium.com>

This patch adds switch command support for FC-4 type of FC-NVMe (0x28) for resgistering HBA port to the management server. RFT_ID command is used to register FC-4 type of 0x28 and RFF_ID is used to register FC-4 features bits for FC-NVMe port.

Signed-off-by Darren Trapp <darren.trapp at cavium.com>
Signed-off-by Duane Grigsby <duane.grigsby at cavium.com>
Signed-off-by Anil Gurumurthy <anil.gurumurhty at cavium.com>
Signed-off-by Giridhar Malavali <giridhar.malavali at cavium.com>
Signed-off-by Himanshu Madhani <himanshu.madhani at cavium.com>
Reviewed-by James Smart <james.smart at broadcom.com>
Quoted 7 lines
---
 drivers/scsi/qla2xxx/qla_def.h  |   1 +
 drivers/scsi/qla2xxx/qla_gbl.h  |   6 +-
 drivers/scsi/qla2xxx/qla_gs.c   | 118 +++++++++++++++++++++++++++++++++++++++-
 drivers/scsi/qla2xxx/qla_init.c |  11 +++-
 4 files changed, 131 insertions(+), 5 deletions(-)
Reviewed-by Hannes Reinecke <hare at suse.com>

Cheers,

Hannes

Signature · 5 lines
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare at suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: F. Imend?rffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG N?rnberg)
#16 lore raw

PATCH v2 4/6 qla2xxx: Send FC4 type NVMe to the management server

In reply to Madhani, Himanshu

On Wed, Jun 21, 2017@01:48:44PM -0700, Madhani, Himanshu wrote:

Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>

Signature · 6 lines
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
#17 lore raw

PATCH v2 5/6 qla2xxx: Use FC-NMVe FC4 type for FDMI registration

In reply to Madhani, Himanshu

From: Duane Grigsby <[email protected]>

Signed-off-by Duane Grigsby <duane.grigsby at cavium.com>
Signed-off-by Darren Trapp <darren.trapp at cavium.com>
Signed-off-by Anil Gurumurthy <anil.gurumurhty at cavium.com>
Signed-off-by Giridhar Malavali <giridhar.malavali at cavium.com>
Signed-off-by Himanshu Madhani <himanshu.madhani at cavium.com>
Reviewed-by Johannes Thumshirn <jthumshirn at suse.de>
Reviewed-by James Smart <james.smart at broadcom.com>
---
 drivers/scsi/qla2xxx/qla_gs.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/scsi/qla2xxx/qla_gs.c +16 -0
index c91478529b51..b323a7c71eda 100644
@@ -2166,6 +2166,13 @@ qla2x00_fdmiv2_rpa(scsi_qla_host_t *vha)
 	    eiter->a.fc4_types[2],
 	    eiter->a.fc4_types[1]);
 
+	if (vha->flags.nvme_enabled) {
+		eiter->a.fc4_types[6] = 1;	/* NVMe type 28h */
+		ql_dbg(ql_dbg_disc, vha, 0x211f,
+		    "NVME FC4 Type = %02x 0x0 0x0 0x0 0x0 0x0.\n",
+		    eiter->a.fc4_types[6]);
+	}
+
 	/* Supported speed. */
 	eiter = entries + size;
 	eiter->type = cpu_to_be16(FDMI_PORT_SUPPORT_SPEED);
@@ -2363,6 +2370,15 @@ qla2x00_fdmiv2_rpa(scsi_qla_host_t *vha)
 	    "Port Active FC4 Type = %02x %02x.\n",
 	    eiter->a.port_fc4_type[2], eiter->a.port_fc4_type[1]);
 
+	if (vha->flags.nvme_enabled) {
+		eiter->a.port_fc4_type[4] = 0;
+		eiter->a.port_fc4_type[5] = 0;
+		eiter->a.port_fc4_type[6] = 1;	/* NVMe type 28h */
+		ql_dbg(ql_dbg_disc, vha, 0x2120,
+		    "NVME Port Active FC4 Type = %02x 0x0 0x0 0x0 0x0 0x0.\n",
+		    eiter->a.port_fc4_type[6]);
+	}
+
 	/* Port State */
 	eiter = entries + size;
 	eiter->type = cpu_to_be16(FDMI_PORT_STATE);
Signature · 1 line
2.12.0
#18 lore raw

PATCH v2 5/6 qla2xxx: Use FC-NMVe FC4 type for FDMI registration

Quoted 9 lines · Himanshu

From: Duane Grigsby <duane.grigsby at cavium.com>

Signed-off-by Duane Grigsby <duane.grigsby at cavium.com>
Signed-off-by Darren Trapp <darren.trapp at cavium.com>
Signed-off-by Anil Gurumurthy <anil.gurumurhty at cavium.com>
Signed-off-by Giridhar Malavali <giridhar.malavali at cavium.com>
Signed-off-by Himanshu Madhani <himanshu.madhani at cavium.com>
Reviewed-by Johannes Thumshirn <jthumshirn at suse.de>
Reviewed-by James Smart <james.smart at broadcom.com>
Quoted 3 lines
---
 drivers/scsi/qla2xxx/qla_gs.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
Reviewed-by Hannes Reinecke <hare at suse.com>

Cheers,

Hannes

Signature · 5 lines
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare at suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: F. Imend?rffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG N?rnberg)
#19 lore raw

PATCH v2 5/6 qla2xxx: Use FC-NMVe FC4 type for FDMI registration

In reply to Madhani, Himanshu
Reviewed-by Johannes Thumshirn <jthumshirn at suse.de>
Signature · 6 lines
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
#20 lore raw

PATCH v2 6/6 qla2xxx: Update Driver version to 10.00.00.00-k

In reply to Madhani, Himanshu

From: Himanshu Madhani <[email protected]>

Signed-off-by Himanshu Madhani <himanshu.madhani at cavium.com>
Reviewed-by Johannes Thumshirn <jthumshirn at suse.de>
Reviewed-by James Smart <james.smart at broadcom.com>
---
 drivers/scsi/qla2xxx/qla_version.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/qla2xxx/qla_version.h +3 -3
index dcbb9bb05e99..005a378f7fab 100644
@@ -7,9 +7,9 @@
 /*
  * Driver version
  */
-#define QLA2XXX_VERSION      "9.01.00.00-k"
+#define QLA2XXX_VERSION      "10.00.00.00-k"
 
-#define QLA_DRIVER_MAJOR_VER	9
-#define QLA_DRIVER_MINOR_VER	1
+#define QLA_DRIVER_MAJOR_VER	10
+#define QLA_DRIVER_MINOR_VER	0
 #define QLA_DRIVER_PATCH_VER	0
 #define QLA_DRIVER_BETA_VER	0
Signature · 1 line
2.12.0
#21 lore raw

PATCH v2 6/6 qla2xxx: Update Driver version to 10.00.00.00-k

Quoted 17 lines · Himanshu

From: Himanshu Madhani <himanshu.madhani at cavium.com>

Signed-off-by Himanshu Madhani <himanshu.madhani at cavium.com>
Reviewed-by Johannes Thumshirn <jthumshirn at suse.de>
Reviewed-by James Smart <james.smart at broadcom.com>
---
 drivers/scsi/qla2xxx/qla_version.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/qla2xxx/qla_version.h +0 -0
index dcbb9bb05e99..005a378f7fab 100644
@@ -7,9 +7,9 @@
 /*
  * Driver version

drivers/scsi/qla2xxx/qla_version.h line 15

Quoted 10 lines
drivers/scsi/qla2xxx/qla_version.h +3 -3
  */
-#define QLA2XXX_VERSION      "9.01.00.00-k"
+#define QLA2XXX_VERSION      "10.00.00.00-k"
 
-#define QLA_DRIVER_MAJOR_VER	9
-#define QLA_DRIVER_MINOR_VER	1
+#define QLA_DRIVER_MAJOR_VER	10
+#define QLA_DRIVER_MINOR_VER	0
 #define QLA_DRIVER_PATCH_VER	0
 #define QLA_DRIVER_BETA_VER	0
Reviewed-by Hannes Reinecke <hare at suse.com>

Cheers,

Hannes

Signature · 5 lines
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare at suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: F. Imend?rffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG N?rnberg)
#22 lore raw

v2 cover qla2xxx: Add NVMe FC Fabric support in driver

In reply to Madhani, Himanshu

Himanshu,

Quoted 2 lines

This patch series adds NVMe FC fabric support for qla2xxx initiator mode driver.

Applied to 4.13/scsi-queue, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering