Skip to contentSkip to conversation

qla2xxx: NPIV target mode fixes for v3.14-rc

PATCH In review Nicholas A. Bellinger 3 participants 8 messages Feb 20, 2014 – Feb 26, 2014

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

cover qla2xxx: NPIV target mode fixes for v3.14-rc

From: Nicholas Bellinger <[email protected]>

Hi Sawan, Quinn, & Co.

The following series addresses a number of NPIV related bugs specific to v3.14-rc code, mostly involving the underlying configfs dependency of base_vha / base_tpg to not be removed while there are active NPIV ports.

Patch #1 fixes a race between the qlt_lport_register() callback and subsequent shutdown operations.

Patch #2 ensures that shutdown of a base_vha port fails when there are active npiv_ports_inuse.

Patch #3 adds seperate enable/disable attribute logic that is specific to NPIV operation, and patch #4 adds the configfs_[un]depend_item() calls in ensure that base_vha / base_tpg cannot be removed from the configfs hierarchy until all associated NPIV ports have been shutdown.

And patch #5 fixes a seperate issue with NAA formatting of EVPD=0x83 device identifier for NPIV WWPNs.

Please review.

Thanks!

--nab

Nicholas Bellinger (5):
qla2xxx: Fix qlt_lport_register base_vha callback race
qla2xxx: Check + fail when npiv_vports_inuse exists in shutdown
tcm_qla2xxx: Add NPIV specific enable/disable attribute logic
tcm_qla2xxx: Perform configfs depend/undepend for base_tpg
tcm_qla2xxx: Fix NAA formatted name for NPIV WWPNs

 drivers/scsi/qla2xxx/qla_target.c  |   39 +++++++--
 drivers/scsi/qla2xxx/qla_target.h  |    2 +-
 drivers/scsi/qla2xxx/tcm_qla2xxx.c |  158 ++++++++++++++++++++++++++----------
 drivers/scsi/qla2xxx/tcm_qla2xxx.h |    7 +-
 4 files changed, 153 insertions(+), 53 deletions(-)
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/5 qla2xxx: Fix qlt_lport_register base_vha callback race

From: Nicholas Bellinger <[email protected]>

This patch closes a race between qlt_lport_register() and tcm_qla2xxx callback logic by holding qla_tgt_mutex before making the callback.

In order for this to work, the qlt_add_target() and qlt_remove_target() code has been changed to avoid the accessing qla_tgt_mutex + list_[add,del] for NPIV enabled ports.

This bug introduced in v3.14-rc1 code with commit 49a47f2.

Cc Sawan Chandak <[email protected]>
Cc Quinn Tran <[email protected]>
Cc Saurav Kashyap <[email protected]>
Cc Giridhar Malavali <[email protected]>
---
 drivers/scsi/qla2xxx/qla_target.c |   16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
drivers/scsi/qla2xxx/qla_target.c +14 -2
index 2eb97d7..ea3eaef 100644
@@ -4181,6 +4181,9 @@ int qlt_add_target(struct qla_hw_data *ha, struct scsi_qla_host *base_vha)
 	tgt->datasegs_per_cmd = QLA_TGT_DATASEGS_PER_CMD_24XX;
 	tgt->datasegs_per_cont = QLA_TGT_DATASEGS_PER_CONT_24XX;
 
+	if (base_vha->fc_vport)
+		return 0;
+
 	mutex_lock(&qla_tgt_mutex);
 	list_add_tail(&tgt->tgt_list_entry, &qla_tgt_glist);
 	mutex_unlock(&qla_tgt_mutex);
@@ -4194,6 +4197,10 @@ int qlt_remove_target(struct qla_hw_data *ha, struct scsi_qla_host *vha)
 	if (!vha->vha_tgt.qla_tgt)
 		return 0;
 
+	if (vha->fc_vport) {
+		qlt_release(vha->vha_tgt.qla_tgt);
+		return 0;
+	}
 	mutex_lock(&qla_tgt_mutex);
 	list_del(&vha->vha_tgt.qla_tgt->tgt_list_entry);
 	mutex_unlock(&qla_tgt_mutex);
@@ -4265,6 +4272,12 @@ int qlt_lport_register(void *target_lport_ptr, u64 phys_wwpn,
 			spin_unlock_irqrestore(&ha->hardware_lock, flags);
 			continue;
 		}
+		if (tgt->tgt_stop) {
+			pr_debug("MODE_TARGET in shutdown on qla2xxx(%d)\n",
+				 host->host_no);
+			spin_unlock_irqrestore(&ha->hardware_lock, flags);
+			continue;
+		}
 		spin_unlock_irqrestore(&ha->hardware_lock, flags);
 
 		if (!scsi_host_get(host)) {
@@ -4279,12 +4292,11 @@ int qlt_lport_register(void *target_lport_ptr, u64 phys_wwpn,
 			scsi_host_put(host);
 			continue;
 		}
-		mutex_unlock(&qla_tgt_mutex);
-
 		rc = (*callback)(vha, target_lport_ptr, npiv_wwpn, npiv_wwnn);
 		if (rc != 0)
 			scsi_host_put(host);
 
+		mutex_unlock(&qla_tgt_mutex);
 		return rc;
 	}
 	mutex_unlock(&qla_tgt_mutex);
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 2/5 qla2xxx: Check + fail when npiv_vports_inuse exists in shutdown

In reply to Nicholas A. Bellinger

From: Nicholas Bellinger <[email protected]>

This patch adds an check to qlt_stop_phase1() to avoid shutdown when the base_vha contains a non-zero fc_host->npiv_vports_inuse count.

This includes holding qla_tgt_mutex in qlt_stop_phase1() between the fc_host->npiv_vports_inuse check + setting of tgt->tgt_stop to avoid a possible race between qlt_lport_register() -> tcm_qla2xxx -> tcm_qla2xxx_lport_register_npiv_cb() calling fc_vport_create().

Cc Sawan Chandak <[email protected]>
Cc Quinn Tran <[email protected]>
Cc Saurav Kashyap <[email protected]>
Cc Giridhar Malavali <[email protected]>
---
 drivers/scsi/qla2xxx/qla_target.c |   23 ++++++++++++++++++++---
 drivers/scsi/qla2xxx/qla_target.h |    2 +-
 2 files changed, 21 insertions(+), 4 deletions(-)
drivers/scsi/qla2xxx/qla_target.c +20 -3
index ea3eaef..f2e1c5a 100644
@@ -790,17 +790,32 @@ static inline int test_tgt_sess_count(struct qla_tgt *tgt)
 }
 
 /* Called by tcm_qla2xxx configfs code */
-void qlt_stop_phase1(struct qla_tgt *tgt)
+int qlt_stop_phase1(struct qla_tgt *tgt)
 {
 	struct scsi_qla_host *vha = tgt->vha;
 	struct qla_hw_data *ha = tgt->ha;
 	unsigned long flags;
 
+	mutex_lock(&qla_tgt_mutex);
+	if (!vha->fc_vport) {
+		struct Scsi_Host *sh = vha->host;
+		struct fc_host_attrs *fc_host = shost_to_fc_host(sh);
+		bool npiv_vports;
+
+		spin_lock_irqsave(sh->host_lock, flags);
+		npiv_vports = (fc_host->npiv_vports_inuse);
+		spin_unlock_irqrestore(sh->host_lock, flags);
+
+		if (npiv_vports) {
+			mutex_unlock(&qla_tgt_mutex);
+			return -EPERM;
+		}
+	}
 	if (tgt->tgt_stop || tgt->tgt_stopped) {
 		ql_dbg(ql_dbg_tgt_mgt, vha, 0xf04e,
 		    "Already in tgt->tgt_stop or tgt_stopped state\n");
-		dump_stack();
-		return;
+		mutex_unlock(&qla_tgt_mutex);
+		return -EPERM;
 	}
 
 	ql_dbg(ql_dbg_tgt, vha, 0xe003, "Stopping target for host %ld(%p)\n",
@@ -815,6 +830,7 @@ void qlt_stop_phase1(struct qla_tgt *tgt)
 	qlt_clear_tgt_db(tgt, true);
 	spin_unlock_irqrestore(&ha->hardware_lock, flags);
 	mutex_unlock(&vha->vha_tgt.tgt_mutex);
+	mutex_unlock(&qla_tgt_mutex);
 
 	flush_delayed_work(&tgt->sess_del_work);
 
@@ -841,6 +857,7 @@ void qlt_stop_phase1(struct qla_tgt *tgt)
 
 	/* Wait for sessions to clear out (just in case) */
 	wait_event(tgt->waitQ, test_tgt_sess_count(tgt));
+	return 0;
 }
 EXPORT_SYMBOL(qlt_stop_phase1);
 
drivers/scsi/qla2xxx/qla_target.h +1 -1
index 66e755c..ce33d8c 100644
@@ -1001,7 +1001,7 @@ extern void qlt_modify_vp_config(struct scsi_qla_host *,
 extern void qlt_probe_one_stage1(struct scsi_qla_host *, struct qla_hw_data *);
 extern int qlt_mem_alloc(struct qla_hw_data *);
 extern void qlt_mem_free(struct qla_hw_data *);
-extern void qlt_stop_phase1(struct qla_tgt *);
+extern int qlt_stop_phase1(struct qla_tgt *);
 extern void qlt_stop_phase2(struct qla_tgt *);
 extern irqreturn_t qla83xx_msix_atio_q(int, void *);
 extern void qlt_83xx_iospace_config(struct qla_hw_data *);
Signature · 1 line
1.7.10.4
#3 lore raw

PATCH 3/5 tcm_qla2xxx: Add NPIV specific enable/disable attribute logic

In reply to Nicholas A. Bellinger

From: Nicholas Bellinger <[email protected]>

This patch adds seperate logic for NPIV specific enable/disable attribute logic, as NPIV vs. non-NPIV enable/disable ends up being different enough to warrent seperate logic for setting configfs tpg_group dependencies in the non-NPIV case.

Cc Sawan Chandak <[email protected]>
Cc Quinn Tran <[email protected]>
Cc Saurav Kashyap <[email protected]>
Cc Giridhar Malavali <[email protected]>
---
 drivers/scsi/qla2xxx/tcm_qla2xxx.c |   59 ++++++++++++++++++++++++++++++++++--
 1 file changed, 56 insertions(+), 3 deletions(-)
drivers/scsi/qla2xxx/tcm_qla2xxx.c +56 -3
index 75a141b..db43b289 100644
@@ -1053,11 +1053,64 @@ static void tcm_qla2xxx_drop_tpg(struct se_portal_group *se_tpg)
 	/*
 	 * Clear local TPG=1 pointer for non NPIV mode.
 	 */
-		lport->tpg_1 = NULL;
-
+	lport->tpg_1 = NULL;
 	kfree(tpg);
 }
 
+static ssize_t tcm_qla2xxx_npiv_tpg_show_enable(
+	struct se_portal_group *se_tpg,
+	char *page)
+{
+	return tcm_qla2xxx_tpg_show_enable(se_tpg, page);
+}
+
+static ssize_t tcm_qla2xxx_npiv_tpg_store_enable(
+	struct se_portal_group *se_tpg,
+	const char *page,
+	size_t count)
+{
+	struct se_wwn *se_wwn = se_tpg->se_tpg_wwn;
+	struct tcm_qla2xxx_lport *lport = container_of(se_wwn,
+			struct tcm_qla2xxx_lport, lport_wwn);
+	struct scsi_qla_host *vha = lport->qla_vha;
+	struct tcm_qla2xxx_tpg *tpg = container_of(se_tpg,
+			struct tcm_qla2xxx_tpg, se_tpg);
+	unsigned long op;
+	int rc;
+
+	rc = kstrtoul(page, 0, &op);
+	if (rc < 0) {
+		pr_err("kstrtoul() returned %d\n", rc);
+		return -EINVAL;
+	}
+	if ((op != 1) && (op != 0)) {
+		pr_err("Illegal value for tpg_enable: %lu\n", op);
+		return -EINVAL;
+	}
+	if (op) {
+		if (atomic_read(&tpg->lport_tpg_enabled))
+			return -EEXIST;
+
+		atomic_set(&tpg->lport_tpg_enabled, 1);
+		qlt_enable_vha(vha);
+	} else {
+		if (!atomic_read(&tpg->lport_tpg_enabled))
+			return count;
+
+		atomic_set(&tpg->lport_tpg_enabled, 0);
+		qlt_stop_phase1(vha->vha_tgt.qla_tgt);
+	}
+
+	return count;
+}
+
+TF_TPG_BASE_ATTR(tcm_qla2xxx_npiv, enable, S_IRUGO | S_IWUSR);
+
+static struct configfs_attribute *tcm_qla2xxx_npiv_tpg_attrs[] = {
+        &tcm_qla2xxx_npiv_tpg_enable.attr,
+        NULL,
+};
+
 static struct se_portal_group *tcm_qla2xxx_npiv_make_tpg(
 	struct se_wwn *wwn,
 	struct config_group *group,
@@ -1935,7 +1988,7 @@ static int tcm_qla2xxx_register_configfs(void)
 	 */
 	npiv_fabric->tf_cit_tmpl.tfc_wwn_cit.ct_attrs = tcm_qla2xxx_wwn_attrs;
 	npiv_fabric->tf_cit_tmpl.tfc_tpg_base_cit.ct_attrs =
-	    tcm_qla2xxx_tpg_attrs;
+	    tcm_qla2xxx_npiv_tpg_attrs;
 	npiv_fabric->tf_cit_tmpl.tfc_tpg_attrib_cit.ct_attrs = NULL;
 	npiv_fabric->tf_cit_tmpl.tfc_tpg_param_cit.ct_attrs = NULL;
 	npiv_fabric->tf_cit_tmpl.tfc_tpg_np_base_cit.ct_attrs = NULL;
Signature · 1 line
1.7.10.4
#4 lore raw

PATCH 4/5 tcm_qla2xxx: Perform configfs depend/undepend for base_tpg

In reply to Nicholas A. Bellinger

From: Nicholas Bellinger <[email protected]>

This patch performs configfs_depend_item() during TPG enable for base_tpg (eg: non-NPIV) ports, and configfs_undepend_item() during TPG disable for base_tpg.

This is done to ensure that any attempt to configfs rmdir a base_tpg with active NPIV ports will fail with -EBUSY, until all associated NPIV ports have been explicitly shutdown and base_tpg disabled.

Note that the actual configfs_[un]depend_item() is done from seperate process context, as these are not intended to be called directly from configfs callbacks.

Cc Sawan Chandak <[email protected]>
Cc Quinn Tran <[email protected]>
Cc Saurav Kashyap <[email protected]>
Cc Giridhar Malavali <[email protected]>
---
 drivers/scsi/qla2xxx/tcm_qla2xxx.c |   72 +++++++++++++++++++++++++++++-------
 drivers/scsi/qla2xxx/tcm_qla2xxx.h |    3 ++
 2 files changed, 61 insertions(+), 14 deletions(-)
drivers/scsi/qla2xxx/tcm_qla2xxx.c +58 -14
index db43b289..5bdc440 100644
@@ -941,15 +941,41 @@ static ssize_t tcm_qla2xxx_tpg_show_enable(
 			atomic_read(&tpg->lport_tpg_enabled));
 }
 
+static void tcm_qla2xxx_depend_tpg(struct work_struct *work)
+{
+	struct tcm_qla2xxx_tpg *base_tpg = container_of(work,
+				struct tcm_qla2xxx_tpg, tpg_base_work);
+	struct se_portal_group *se_tpg = &base_tpg->se_tpg;
+	struct scsi_qla_host *base_vha = base_tpg->lport->qla_vha;
+
+	if (!configfs_depend_item(se_tpg->se_tpg_tfo->tf_subsys,
+				  &se_tpg->tpg_group.cg_item)) {
+		atomic_set(&base_tpg->lport_tpg_enabled, 1);
+		qlt_enable_vha(base_vha);
+	}
+	complete(&base_tpg->tpg_base_comp);
+}
+
+static void tcm_qla2xxx_undepend_tpg(struct work_struct *work)
+{
+	struct tcm_qla2xxx_tpg *base_tpg = container_of(work,
+				struct tcm_qla2xxx_tpg, tpg_base_work);
+	struct se_portal_group *se_tpg = &base_tpg->se_tpg;
+	struct scsi_qla_host *base_vha = base_tpg->lport->qla_vha;
+
+	if (!qlt_stop_phase1(base_vha->vha_tgt.qla_tgt)) {
+		atomic_set(&base_tpg->lport_tpg_enabled, 0);
+		configfs_undepend_item(se_tpg->se_tpg_tfo->tf_subsys,
+				       &se_tpg->tpg_group.cg_item);
+	}
+	complete(&base_tpg->tpg_base_comp);
+}
+
 static ssize_t tcm_qla2xxx_tpg_store_enable(
 	struct se_portal_group *se_tpg,
 	const char *page,
 	size_t count)
 {
-	struct se_wwn *se_wwn = se_tpg->se_tpg_wwn;
-	struct tcm_qla2xxx_lport *lport = container_of(se_wwn,
-			struct tcm_qla2xxx_lport, lport_wwn);
-	struct scsi_qla_host *vha = lport->qla_vha;
 	struct tcm_qla2xxx_tpg *tpg = container_of(se_tpg,
 			struct tcm_qla2xxx_tpg, se_tpg);
 	unsigned long op;
@@ -964,19 +990,28 @@ static ssize_t tcm_qla2xxx_tpg_store_enable(
 		pr_err("Illegal value for tpg_enable: %lu\n", op);
 		return -EINVAL;
 	}
-
 	if (op) {
-		atomic_set(&tpg->lport_tpg_enabled, 1);
-		qlt_enable_vha(vha);
+		if (atomic_read(&tpg->lport_tpg_enabled))
+			return -EEXIST;
+
+		INIT_WORK(&tpg->tpg_base_work, tcm_qla2xxx_depend_tpg);
 	} else {
-		if (!vha->vha_tgt.qla_tgt) {
-			pr_err("struct qla_hw_data *vha->vha_tgt.qla_tgt is NULL\n");
-			return -ENODEV;
-		}
-		atomic_set(&tpg->lport_tpg_enabled, 0);
-		qlt_stop_phase1(vha->vha_tgt.qla_tgt);
+		if (!atomic_read(&tpg->lport_tpg_enabled))
+			return count;
+
+		INIT_WORK(&tpg->tpg_base_work, tcm_qla2xxx_undepend_tpg);
 	}
+	init_completion(&tpg->tpg_base_comp);
+	schedule_work(&tpg->tpg_base_work);
+	wait_for_completion(&tpg->tpg_base_comp);
 
+	if (op) {
+		if (!atomic_read(&tpg->lport_tpg_enabled))
+			return -ENODEV;
+	} else {
+		if (atomic_read(&tpg->lport_tpg_enabled))
+			return -EPERM;
+	}
 	return count;
 }
 
@@ -1703,6 +1738,9 @@ static int tcm_qla2xxx_lport_register_npiv_cb(struct scsi_qla_host *base_vha,
 	struct scsi_qla_host *npiv_vha;
 	struct tcm_qla2xxx_lport *lport =
 			(struct tcm_qla2xxx_lport *)target_lport_ptr;
+	struct tcm_qla2xxx_lport *base_lport =
+			(struct tcm_qla2xxx_lport *)base_vha->vha_tgt.target_lport_ptr;
+	struct tcm_qla2xxx_tpg *base_tpg;
 	struct fc_vport_identifiers vport_id;
 
 	if (!qla_tgt_mode_enabled(base_vha)) {
@@ -1710,6 +1748,13 @@ static int tcm_qla2xxx_lport_register_npiv_cb(struct scsi_qla_host *base_vha,
 		return -EPERM;
 	}
 
+	if (!base_lport || !base_lport->tpg_1 ||
+	    !atomic_read(&base_lport->tpg_1->lport_tpg_enabled)) {
+		pr_err("qla2xxx base_lport or tpg_1 not available\n");
+		return -EPERM;
+	}
+	base_tpg = base_lport->tpg_1;
+
 	memset(&vport_id, 0, sizeof(vport_id));
 	vport_id.port_name = npiv_wwpn;
 	vport_id.node_name = npiv_wwnn;
@@ -1728,7 +1773,6 @@ static int tcm_qla2xxx_lport_register_npiv_cb(struct scsi_qla_host *base_vha,
 	npiv_vha = (struct scsi_qla_host *)vport->dd_data;
 	npiv_vha->vha_tgt.target_lport_ptr = target_lport_ptr;
 	lport->qla_vha = npiv_vha;
-
 	scsi_host_get(npiv_vha->host);
 	return 0;
 }
drivers/scsi/qla2xxx/tcm_qla2xxx.h +3 -0
index 275d8b9..a90966d 100644
@@ -43,6 +43,9 @@ struct tcm_qla2xxx_tpg {
 	struct tcm_qla2xxx_tpg_attrib tpg_attrib;
 	/* Returned by tcm_qla2xxx_make_tpg() */
 	struct se_portal_group se_tpg;
+	/* Items for dealing with configfs_depend_item */
+	struct completion tpg_base_comp;
+	struct work_struct tpg_base_work;
 };
 
 struct tcm_qla2xxx_fc_loopid {
Signature · 1 line
1.7.10.4
#5 lore raw

PATCH 5/5 tcm_qla2xxx: Fix NAA formatted name for NPIV WWPNs

In reply to Nicholas A. Bellinger

From: Nicholas Bellinger <[email protected]>

This patch fixes the NAA formatted name used by EVPD=0x83 device identifer to reflect the proper NPIV enabled WWPN.

Cc Sawan Chandak <[email protected]>
Cc Quinn Tran <[email protected]>
Cc Saurav Kashyap <[email protected]>
Cc Giridhar Malavali <[email protected]>
---
 drivers/scsi/qla2xxx/tcm_qla2xxx.c |   27 +--------------------------
 drivers/scsi/qla2xxx/tcm_qla2xxx.h |    4 ----
 2 files changed, 1 insertion(+), 30 deletions(-)
drivers/scsi/qla2xxx/tcm_qla2xxx.c +1 -26
index 5bdc440..788c4fe 100644
@@ -182,20 +182,6 @@ static int tcm_qla2xxx_npiv_parse_wwn(
 	return 0;
 }
 
-static ssize_t tcm_qla2xxx_npiv_format_wwn(char *buf, size_t len,
-					u64 wwpn, u64 wwnn)
-{
-	u8 b[8], b2[8];
-
-	put_unaligned_be64(wwpn, b);
-	put_unaligned_be64(wwnn, b2);
-	return snprintf(buf, len,
-		"%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x,"
-		"%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x",
-		b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7],
-		b2[0], b2[1], b2[2], b2[3], b2[4], b2[5], b2[6], b2[7]);
-}
-
 static char *tcm_qla2xxx_npiv_get_fabric_name(void)
 {
 	return "qla2xxx_npiv";
@@ -227,15 +213,6 @@ static char *tcm_qla2xxx_get_fabric_wwn(struct se_portal_group *se_tpg)
 	return lport->lport_naa_name;
 }
 
-static char *tcm_qla2xxx_npiv_get_fabric_wwn(struct se_portal_group *se_tpg)
-{
-	struct tcm_qla2xxx_tpg *tpg = container_of(se_tpg,
-				struct tcm_qla2xxx_tpg, se_tpg);
-	struct tcm_qla2xxx_lport *lport = tpg->lport;
-
-	return &lport->lport_npiv_name[0];
-}
-
 static u16 tcm_qla2xxx_get_tag(struct se_portal_group *se_tpg)
 {
 	struct tcm_qla2xxx_tpg *tpg = container_of(se_tpg,
@@ -1811,8 +1788,6 @@ static struct se_wwn *tcm_qla2xxx_npiv_make_lport(
 	}
 	lport->lport_npiv_wwpn = npiv_wwpn;
 	lport->lport_npiv_wwnn = npiv_wwnn;
-	tcm_qla2xxx_npiv_format_wwn(&lport->lport_npiv_name[0],
-			TCM_QLA2XXX_NAMELEN, npiv_wwpn, npiv_wwnn);
 	sprintf(lport->lport_naa_name, "naa.%016llx", (unsigned long long) npiv_wwpn);
 
 	ret = tcm_qla2xxx_init_lport(lport);
@@ -1921,7 +1896,7 @@ static struct target_core_fabric_ops tcm_qla2xxx_ops = {
 static struct target_core_fabric_ops tcm_qla2xxx_npiv_ops = {
 	.get_fabric_name		= tcm_qla2xxx_npiv_get_fabric_name,
 	.get_fabric_proto_ident		= tcm_qla2xxx_get_fabric_proto_ident,
-	.tpg_get_wwn			= tcm_qla2xxx_npiv_get_fabric_wwn,
+	.tpg_get_wwn			= tcm_qla2xxx_get_fabric_wwn,
 	.tpg_get_tag			= tcm_qla2xxx_get_tag,
 	.tpg_get_default_depth		= tcm_qla2xxx_get_default_depth,
 	.tpg_get_pr_transport_id	= tcm_qla2xxx_get_pr_transport_id,
drivers/scsi/qla2xxx/tcm_qla2xxx.h +0 -4
index a90966d..33aaac8 100644
@@ -4,8 +4,6 @@
 #define TCM_QLA2XXX_VERSION	"v0.1"
 /* length of ASCII WWPNs including pad */
 #define TCM_QLA2XXX_NAMELEN	32
-/* lenth of ASCII NPIV 'WWPN+WWNN' including pad */
-#define TCM_QLA2XXX_NPIV_NAMELEN 66
 
 #include "qla_target.h"
 
@@ -65,8 +63,6 @@ struct tcm_qla2xxx_lport {
 	char lport_name[TCM_QLA2XXX_NAMELEN];
 	/* ASCII formatted naa WWPN for VPD page 83 etc */
 	char lport_naa_name[TCM_QLA2XXX_NAMELEN];
-	/* ASCII formatted WWPN+WWNN for NPIV FC Target Lport */
-	char lport_npiv_name[TCM_QLA2XXX_NPIV_NAMELEN];
 	/* map for fc_port pointers in 24-bit FC Port ID space */
 	struct btree_head32 lport_fcport_map;
 	/* vmalloc-ed memory for fc_port pointers for 16-bit FC loop ID */
Signature · 1 line
1.7.10.4
#6 lore raw
In reply to Nicholas A. Bellinger

Nicholas,

Will do. Thanks.

Regards,
Quinn Tran

Quoted 43 lines · Nicholas A. Bellinger

From: Nicholas Bellinger <[email protected]>

Hi Sawan, Quinn, & Co.

The following series addresses a number of NPIV related bugs specific to v3.14-rc code, mostly involving the underlying configfs dependency of base_vha / base_tpg to not be removed while there are active NPIV ports.

Patch #1 fixes a race between the qlt_lport_register() callback and subsequent shutdown operations.

Patch #2 ensures that shutdown of a base_vha port fails when there are active npiv_ports_inuse.

Patch #3 adds seperate enable/disable attribute logic that is specific to NPIV operation, and patch #4 adds the configfs_[un]depend_item() calls in ensure that base_vha / base_tpg cannot be removed from the configfs hierarchy until all associated NPIV ports have been shutdown.

And patch #5 fixes a seperate issue with NAA formatting of EVPD=0x83 device identifier for NPIV WWPNs.

Please review.

Thanks!

--nab

Nicholas Bellinger (5):
qla2xxx: Fix qlt_lport_register base_vha callback race
qla2xxx: Check + fail when npiv_vports_inuse exists in shutdown
tcm_qla2xxx: Add NPIV specific enable/disable attribute logic
tcm_qla2xxx: Perform configfs depend/undepend for base_tpg
tcm_qla2xxx: Fix NAA formatted name for NPIV WWPNs

drivers/scsi/qla2xxx/qla_target.c  |   39 +++++++--
drivers/scsi/qla2xxx/qla_target.h  |    2 +-
drivers/scsi/qla2xxx/tcm_qla2xxx.c |  158
++++++++++++++++++++++++++----------
drivers/scsi/qla2xxx/tcm_qla2xxx.h |    7 +-
4 files changed, 153 insertions(+), 53 deletions(-)
Quoted 3 lines

--
1.7.10.4

________________________________

This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.

Acked-by on the v1 series
#7 lore raw
In reply to Nicholas A. Bellinger

Hi Nicholas,

The patches looks good.

Thanks,
~Saurav

Quoted 46 lines

From: Nicholas Bellinger <[email protected]>

Hi Sawan, Quinn, & Co.

The following series addresses a number of NPIV related bugs specific to v3.14-rc code, mostly involving the underlying configfs dependency of base_vha / base_tpg to not be removed while there are active NPIV ports.

Patch #1 fixes a race between the qlt_lport_register() callback and subsequent shutdown operations.

Patch #2 ensures that shutdown of a base_vha port fails when there are active npiv_ports_inuse.

Patch #3 adds seperate enable/disable attribute logic that is specific to NPIV operation, and patch #4 adds the configfs_[un]depend_item() calls in ensure that base_vha / base_tpg cannot be removed from the configfs hierarchy until all associated NPIV ports have been shutdown.

And patch #5 fixes a seperate issue with NAA formatting of EVPD=0x83 device identifier for NPIV WWPNs.

Please review.

Thanks!

--nab

Nicholas Bellinger (5):
qla2xxx: Fix qlt_lport_register base_vha callback race
qla2xxx: Check + fail when npiv_vports_inuse exists in shutdown
tcm_qla2xxx: Add NPIV specific enable/disable attribute logic
tcm_qla2xxx: Perform configfs depend/undepend for base_tpg
tcm_qla2xxx: Fix NAA formatted name for NPIV WWPNs

drivers/scsi/qla2xxx/qla_target.c  |   39 +++++++--
drivers/scsi/qla2xxx/qla_target.h  |    2 +-
drivers/scsi/qla2xxx/tcm_qla2xxx.c |  158
++++++++++++++++++++++++++----------
drivers/scsi/qla2xxx/tcm_qla2xxx.h |    7 +-
4 files changed, 153 insertions(+), 53 deletions(-)
Signature · 1 line
1.7.10.4