All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESUBMIT PATCH 0/4] Resubmitting bnx2fc 1.0.2 with merge conflicts resolved
@ 2011-05-27 18:47 Bhanu Prakash Gollapudi
  2011-05-27 18:47 ` [RESUBMIT PATCH 1/4] bnx2fc: host stats show the link speed 'unknown' on NIC partitioned interfaces Bhanu Prakash Gollapudi
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Bhanu Prakash Gollapudi @ 2011-05-27 18:47 UTC (permalink / raw)
  To: JBottomley, linux-scsi; +Cc: Bhanu Prakash Gollapudi

Bhanu Prakash Gollapudi (4):
  bnx2fc: host stats show the link speed 'unknown' on NIC partitioned
    interfaces
  bnx2fc: scsi_dma_unmap() not invoked on IO completions
  bnx2fc: Fix kernel panic when deleting NPIV ports
  bnx2fc: Bumped version to 1.0.2

 drivers/scsi/bnx2fc/bnx2fc.h      |   10 ++++++++--
 drivers/scsi/bnx2fc/bnx2fc_fcoe.c |   33 +++++++++++++++++++++++++++++++--
 drivers/scsi/bnx2fc/bnx2fc_hwi.c  |   24 +++++++++++++++++++++++-
 drivers/scsi/bnx2fc/bnx2fc_io.c   |    2 +-
 4 files changed, 69 insertions(+), 6 deletions(-)



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RESUBMIT PATCH 1/4] bnx2fc: host stats show the link speed 'unknown' on NIC partitioned interfaces
  2011-05-27 18:47 [RESUBMIT PATCH 0/4] Resubmitting bnx2fc 1.0.2 with merge conflicts resolved Bhanu Prakash Gollapudi
@ 2011-05-27 18:47 ` Bhanu Prakash Gollapudi
  2011-05-27 18:47 ` [RESUBMIT PATCH 2/4] bnx2fc: scsi_dma_unmap() not invoked on IO completions Bhanu Prakash Gollapudi
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Bhanu Prakash Gollapudi @ 2011-05-27 18:47 UTC (permalink / raw)
  To: JBottomley, linux-scsi; +Cc: Bhanu Prakash Gollapudi

NIC partitioned interfaces reports the speed of 2500 which was not handled by
the driver.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
---
 drivers/scsi/bnx2fc/bnx2fc_fcoe.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index ab255fb..8f894e4 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -679,6 +679,9 @@ static void bnx2fc_link_speed_update(struct fc_lport *lport)
 		case SPEED_1000:
 			lport->link_speed = FC_PORTSPEED_1GBIT;
 			break;
+		case SPEED_2500:
+			lport->link_speed = FC_PORTSPEED_2GBIT;
+			break;
 		case SPEED_10000:
 			lport->link_speed = FC_PORTSPEED_10GBIT;
 			break;
-- 
1.7.0.6



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [RESUBMIT PATCH 2/4] bnx2fc: scsi_dma_unmap() not invoked on IO completions
  2011-05-27 18:47 [RESUBMIT PATCH 0/4] Resubmitting bnx2fc 1.0.2 with merge conflicts resolved Bhanu Prakash Gollapudi
  2011-05-27 18:47 ` [RESUBMIT PATCH 1/4] bnx2fc: host stats show the link speed 'unknown' on NIC partitioned interfaces Bhanu Prakash Gollapudi
@ 2011-05-27 18:47 ` Bhanu Prakash Gollapudi
  2011-05-27 18:47 ` [RESUBMIT PATCH 3/4] bnx2fc: Fix kernel panic when deleting NPIV ports Bhanu Prakash Gollapudi
  2011-05-27 18:47 ` [RESUBMIT PATCH 4/4] bnx2fc: Bumped version to 1.0.2 Bhanu Prakash Gollapudi
  3 siblings, 0 replies; 5+ messages in thread
From: Bhanu Prakash Gollapudi @ 2011-05-27 18:47 UTC (permalink / raw)
  To: JBottomley, linux-scsi; +Cc: Bhanu Prakash Gollapudi

Do not set io_req->sc_cmd to NULL until bnx2fc_unmap_sg_list() is called to
enable it to unmap the DMA mappings.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
---
 drivers/scsi/bnx2fc/bnx2fc_io.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c
index b5b5c34..454c72c 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_io.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_io.c
@@ -1734,7 +1734,6 @@ void bnx2fc_process_scsi_cmd_compl(struct bnx2fc_cmd *io_req,
 		printk(KERN_ERR PFX "SCp.ptr is NULL\n");
 		return;
 	}
-	io_req->sc_cmd = NULL;
 
 	if (io_req->on_active_queue) {
 		list_del_init(&io_req->link);
@@ -1754,6 +1753,7 @@ void bnx2fc_process_scsi_cmd_compl(struct bnx2fc_cmd *io_req,
 	}
 
 	bnx2fc_unmap_sg_list(io_req);
+	io_req->sc_cmd = NULL;
 
 	switch (io_req->fcp_status) {
 	case FC_GOOD:
-- 
1.7.0.6



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [RESUBMIT PATCH 3/4] bnx2fc: Fix kernel panic when deleting NPIV ports
  2011-05-27 18:47 [RESUBMIT PATCH 0/4] Resubmitting bnx2fc 1.0.2 with merge conflicts resolved Bhanu Prakash Gollapudi
  2011-05-27 18:47 ` [RESUBMIT PATCH 1/4] bnx2fc: host stats show the link speed 'unknown' on NIC partitioned interfaces Bhanu Prakash Gollapudi
  2011-05-27 18:47 ` [RESUBMIT PATCH 2/4] bnx2fc: scsi_dma_unmap() not invoked on IO completions Bhanu Prakash Gollapudi
@ 2011-05-27 18:47 ` Bhanu Prakash Gollapudi
  2011-05-27 18:47 ` [RESUBMIT PATCH 4/4] bnx2fc: Bumped version to 1.0.2 Bhanu Prakash Gollapudi
  3 siblings, 0 replies; 5+ messages in thread
From: Bhanu Prakash Gollapudi @ 2011-05-27 18:47 UTC (permalink / raw)
  To: JBottomley, linux-scsi; +Cc: Bhanu Prakash Gollapudi

Deleting NPIV port causes a kernel panic when the NPIV port is in the same zone
as the physical port and shares the same LUN. This happens due to the fact that
vport destroy and unsolicited ELS are scheduled to run on the same workqueue,
and vport destroy destroys the lport and the unsolicited ELS tries to access
the invalid lport.  This patch fixes this issue by maintaining a list of valid
lports and verifying if the lport is valid or not before accessing it.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
---
 drivers/scsi/bnx2fc/bnx2fc.h      |    8 +++++++-
 drivers/scsi/bnx2fc/bnx2fc_fcoe.c |   28 +++++++++++++++++++++++++++-
 drivers/scsi/bnx2fc/bnx2fc_hwi.c  |   24 +++++++++++++++++++++++-
 3 files changed, 57 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/bnx2fc/bnx2fc.h b/drivers/scsi/bnx2fc/bnx2fc.h
index 0a404bf..856fcbf 100644
--- a/drivers/scsi/bnx2fc/bnx2fc.h
+++ b/drivers/scsi/bnx2fc/bnx2fc.h
@@ -152,7 +152,6 @@ struct bnx2fc_percpu_s {
 	spinlock_t fp_work_lock;
 };
 
-
 struct bnx2fc_hba {
 	struct list_head link;
 	struct cnic_dev *cnic;
@@ -179,6 +178,7 @@ struct bnx2fc_hba {
 		#define BNX2FC_CTLR_INIT_DONE		1
 		#define BNX2FC_CREATE_DONE		2
 	struct fcoe_ctlr ctlr;
+	struct list_head vports;
 	u8 vlan_enabled;
 	int vlan_id;
 	u32 next_conn_id;
@@ -232,6 +232,11 @@ struct bnx2fc_hba {
 
 #define bnx2fc_from_ctlr(fip) container_of(fip, struct bnx2fc_hba, ctlr)
 
+struct bnx2fc_lport {
+	struct list_head list;
+	struct fc_lport *lport;
+};
+
 struct bnx2fc_cmd_mgr {
 	struct bnx2fc_hba *hba;
 	u16 next_idx;
@@ -423,6 +428,7 @@ struct bnx2fc_work {
 struct bnx2fc_unsol_els {
 	struct fc_lport *lport;
 	struct fc_frame *fp;
+	struct bnx2fc_hba *hba;
 	struct work_struct unsol_els_work;
 };
 
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index 8f894e4..5c8c59e 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -1228,6 +1228,7 @@ static int bnx2fc_interface_setup(struct bnx2fc_hba *hba,
 	hba->ctlr.get_src_addr = bnx2fc_get_src_mac;
 	set_bit(BNX2FC_CTLR_INIT_DONE, &hba->init_done);
 
+	INIT_LIST_HEAD(&hba->vports);
 	rc = bnx2fc_netdev_setup(hba);
 	if (rc)
 		goto setup_err;
@@ -1264,8 +1265,15 @@ static struct fc_lport *bnx2fc_if_create(struct bnx2fc_hba *hba,
 	struct fcoe_port	*port;
 	struct Scsi_Host	*shost;
 	struct fc_vport		*vport = dev_to_vport(parent);
+	struct bnx2fc_lport	*blport;
 	int			rc = 0;
 
+	blport = kzalloc(sizeof(struct bnx2fc_lport), GFP_KERNEL);
+	if (!blport) {
+		BNX2FC_HBA_DBG(hba->ctlr.lp, "Unable to alloc bnx2fc_lport\n");
+		return NULL;
+	}
+
 	/* Allocate Scsi_Host structure */
 	if (!npiv)
 		lport = libfc_host_alloc(&bnx2fc_shost_template, sizeof(*port));
@@ -1274,7 +1282,7 @@ static struct fc_lport *bnx2fc_if_create(struct bnx2fc_hba *hba,
 
 	if (!lport) {
 		printk(KERN_ERR PFX "could not allocate scsi host structure\n");
-		return NULL;
+		goto free_blport;
 	}
 	shost = lport->host;
 	port = lport_priv(lport);
@@ -1330,12 +1338,20 @@ static struct fc_lport *bnx2fc_if_create(struct bnx2fc_hba *hba,
 	}
 
 	bnx2fc_interface_get(hba);
+
+	spin_lock_bh(&hba->hba_lock);
+	blport->lport = lport;
+	list_add_tail(&blport->list, &hba->vports);
+	spin_unlock_bh(&hba->hba_lock);
+
 	return lport;
 
 shost_err:
 	scsi_remove_host(shost);
 lp_config_err:
 	scsi_host_put(lport->host);
+free_blport:
+	kfree(blport);
 	return NULL;
 }
 
@@ -1351,6 +1367,7 @@ static void bnx2fc_if_destroy(struct fc_lport *lport)
 {
 	struct fcoe_port *port = lport_priv(lport);
 	struct bnx2fc_hba *hba = port->priv;
+	struct bnx2fc_lport *blport, *tmp;
 
 	BNX2FC_HBA_DBG(hba->ctlr.lp, "ENTERED bnx2fc_if_destroy\n");
 	/* Stop the transmit retry timer */
@@ -1375,6 +1392,15 @@ static void bnx2fc_if_destroy(struct fc_lport *lport)
 	/* Free memory used by statistical counters */
 	fc_lport_free_stats(lport);
 
+	spin_lock_bh(&hba->hba_lock);
+	list_for_each_entry_safe(blport, tmp, &hba->vports, list) {
+		if (blport->lport == lport) {
+			list_del(&blport->list);
+			kfree(blport);
+		}
+	}
+	spin_unlock_bh(&hba->hba_lock);
+
 	/* Release Scsi_Host */
 	scsi_host_put(lport->host);
 
diff --git a/drivers/scsi/bnx2fc/bnx2fc_hwi.c b/drivers/scsi/bnx2fc/bnx2fc_hwi.c
index f756d5f..78baa46 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_hwi.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_hwi.c
@@ -480,16 +480,36 @@ int bnx2fc_send_session_destroy_req(struct bnx2fc_hba *hba,
 	return rc;
 }
 
+static bool is_valid_lport(struct bnx2fc_hba *hba, struct fc_lport *lport)
+{
+	struct bnx2fc_lport *blport;
+
+	spin_lock_bh(&hba->hba_lock);
+	list_for_each_entry(blport, &hba->vports, list) {
+		if (blport->lport == lport) {
+			spin_unlock_bh(&hba->hba_lock);
+			return true;
+		}
+	}
+	spin_unlock_bh(&hba->hba_lock);
+	return false;
+
+}
+
+
 static void bnx2fc_unsol_els_work(struct work_struct *work)
 {
 	struct bnx2fc_unsol_els *unsol_els;
 	struct fc_lport *lport;
+	struct bnx2fc_hba *hba;
 	struct fc_frame *fp;
 
 	unsol_els = container_of(work, struct bnx2fc_unsol_els, unsol_els_work);
 	lport = unsol_els->lport;
 	fp = unsol_els->fp;
-	fc_exch_recv(lport, fp);
+	hba = unsol_els->hba;
+	if (is_valid_lport(hba, lport))
+		fc_exch_recv(lport, fp);
 	kfree(unsol_els);
 }
 
@@ -499,6 +519,7 @@ void bnx2fc_process_l2_frame_compl(struct bnx2fc_rport *tgt,
 {
 	struct fcoe_port *port = tgt->port;
 	struct fc_lport *lport = port->lport;
+	struct bnx2fc_hba *hba = port->priv;
 	struct bnx2fc_unsol_els *unsol_els;
 	struct fc_frame_header *fh;
 	struct fc_frame *fp;
@@ -559,6 +580,7 @@ void bnx2fc_process_l2_frame_compl(struct bnx2fc_rport *tgt,
 		fr_eof(fp) = FC_EOF_T;
 		fr_crc(fp) = cpu_to_le32(~crc);
 		unsol_els->lport = lport;
+		unsol_els->hba = hba;
 		unsol_els->fp = fp;
 		INIT_WORK(&unsol_els->unsol_els_work, bnx2fc_unsol_els_work);
 		queue_work(bnx2fc_wq, &unsol_els->unsol_els_work);
-- 
1.7.0.6



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [RESUBMIT PATCH 4/4] bnx2fc: Bumped version to 1.0.2
  2011-05-27 18:47 [RESUBMIT PATCH 0/4] Resubmitting bnx2fc 1.0.2 with merge conflicts resolved Bhanu Prakash Gollapudi
                   ` (2 preceding siblings ...)
  2011-05-27 18:47 ` [RESUBMIT PATCH 3/4] bnx2fc: Fix kernel panic when deleting NPIV ports Bhanu Prakash Gollapudi
@ 2011-05-27 18:47 ` Bhanu Prakash Gollapudi
  3 siblings, 0 replies; 5+ messages in thread
From: Bhanu Prakash Gollapudi @ 2011-05-27 18:47 UTC (permalink / raw)
  To: JBottomley, linux-scsi; +Cc: Bhanu Prakash Gollapudi

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
---
 drivers/scsi/bnx2fc/bnx2fc.h      |    2 +-
 drivers/scsi/bnx2fc/bnx2fc_fcoe.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/bnx2fc/bnx2fc.h b/drivers/scsi/bnx2fc/bnx2fc.h
index 856fcbf..e3caa50 100644
--- a/drivers/scsi/bnx2fc/bnx2fc.h
+++ b/drivers/scsi/bnx2fc/bnx2fc.h
@@ -62,7 +62,7 @@
 #include "bnx2fc_constants.h"
 
 #define BNX2FC_NAME		"bnx2fc"
-#define BNX2FC_VERSION		"1.0.1"
+#define BNX2FC_VERSION		"1.0.2"
 
 #define PFX			"bnx2fc: "
 
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index 5c8c59e..7e2b7bc 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -21,7 +21,7 @@ DEFINE_PER_CPU(struct bnx2fc_percpu_s, bnx2fc_percpu);
 
 #define DRV_MODULE_NAME		"bnx2fc"
 #define DRV_MODULE_VERSION	BNX2FC_VERSION
-#define DRV_MODULE_RELDATE	"Mar 17, 2011"
+#define DRV_MODULE_RELDATE	"May 27, 2011"
 
 
 static char version[] __devinitdata =
-- 
1.7.0.6



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-05-27 18:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-27 18:47 [RESUBMIT PATCH 0/4] Resubmitting bnx2fc 1.0.2 with merge conflicts resolved Bhanu Prakash Gollapudi
2011-05-27 18:47 ` [RESUBMIT PATCH 1/4] bnx2fc: host stats show the link speed 'unknown' on NIC partitioned interfaces Bhanu Prakash Gollapudi
2011-05-27 18:47 ` [RESUBMIT PATCH 2/4] bnx2fc: scsi_dma_unmap() not invoked on IO completions Bhanu Prakash Gollapudi
2011-05-27 18:47 ` [RESUBMIT PATCH 3/4] bnx2fc: Fix kernel panic when deleting NPIV ports Bhanu Prakash Gollapudi
2011-05-27 18:47 ` [RESUBMIT PATCH 4/4] bnx2fc: Bumped version to 1.0.2 Bhanu Prakash Gollapudi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.