* [PATCH 1/6] bnx2fc: use kthread_create_on_node
2012-06-04 23:15 [PATCH 0/6] bnx2fc version 1.0.12 Bhanu Prakash Gollapudi
@ 2012-06-04 23:15 ` Bhanu Prakash Gollapudi
2012-06-04 23:15 ` [PATCH 2/6] bnx2fc: Reduce object size by consolidating formats Bhanu Prakash Gollapudi
` (4 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Bhanu Prakash Gollapudi @ 2012-06-04 23:15 UTC (permalink / raw)
To: JBottomley, linux-scsi
Cc: michaelc, Eric Dumazet, James E.J. Bottomley,
Bhanu Prakash Gollapudi
From: Eric Dumazet <eric.dumazet@gmail.com>
Since bnx2fc_percpu_thread_create() creates percpu kthread, it makes
sense to use kthread_create_on_node() to get proper NUMA affinity for
kthread stack.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: "James E.J. Bottomley" <JBottomley@parallels.com>
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
---
drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index f52f668..dd28af7 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -2290,9 +2290,9 @@ static void bnx2fc_percpu_thread_create(unsigned int cpu)
p = &per_cpu(bnx2fc_percpu, cpu);
- thread = kthread_create(bnx2fc_percpu_io_thread,
- (void *)p,
- "bnx2fc_thread/%d", cpu);
+ thread = kthread_create_on_node(bnx2fc_percpu_io_thread,
+ (void *)p, cpu_to_node(cpu),
+ "bnx2fc_thread/%d", cpu);
/* bind thread to the cpu */
if (likely(!IS_ERR(thread))) {
kthread_bind(thread, cpu);
--
1.7.0.6
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 2/6] bnx2fc: Reduce object size by consolidating formats
2012-06-04 23:15 [PATCH 0/6] bnx2fc version 1.0.12 Bhanu Prakash Gollapudi
2012-06-04 23:15 ` [PATCH 1/6] bnx2fc: use kthread_create_on_node Bhanu Prakash Gollapudi
@ 2012-06-04 23:15 ` Bhanu Prakash Gollapudi
2012-06-04 23:15 ` [PATCH 3/6] bnx2fc: Support interface creation on non-VLAN interface also Bhanu Prakash Gollapudi
` (3 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Bhanu Prakash Gollapudi @ 2012-06-04 23:15 UTC (permalink / raw)
To: JBottomley, linux-scsi; +Cc: michaelc, Joe Perches, Bhanu Prakash Gollapudi
From: Joe Perches <joe@perches.com>
Deduplication of formats and consolidating tests
makes the object much smaller.
Add bnx2fc_debug.c, add functions for a few logging
functions (BNX2FC_IO_DBG, BNX2FC_TGT_DBG, BNX2FC_HBA_DBG).
Use printf extension %pV.
Add and use pr_fmt and pr_<level>.
Move the debug #include below structure definitions.
$ size drivers/scsi/bnx2fc/built-in.o*
text data bss dec hex filename
101563 1165 24976 127704 1f2d8 drivers/scsi/bnx2fc/built-in.o.new
138473 1109 33400 172982 2a3b6 drivers/scsi/bnx2fc/built-in.o.old
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
---
drivers/scsi/bnx2fc/Makefile | 3 +-
drivers/scsi/bnx2fc/bnx2fc.h | 6 ++-
drivers/scsi/bnx2fc/bnx2fc_debug.c | 70 ++++++++++++++++++++++++++++++++++
drivers/scsi/bnx2fc/bnx2fc_debug.h | 73 +++++++++---------------------------
4 files changed, 95 insertions(+), 57 deletions(-)
create mode 100644 drivers/scsi/bnx2fc/bnx2fc_debug.c
diff --git a/drivers/scsi/bnx2fc/Makefile b/drivers/scsi/bnx2fc/Makefile
index a92695a..141149e 100644
--- a/drivers/scsi/bnx2fc/Makefile
+++ b/drivers/scsi/bnx2fc/Makefile
@@ -1,3 +1,4 @@
obj-$(CONFIG_SCSI_BNX2X_FCOE) += bnx2fc.o
-bnx2fc-y := bnx2fc_els.o bnx2fc_fcoe.o bnx2fc_hwi.o bnx2fc_io.o bnx2fc_tgt.o
+bnx2fc-y := bnx2fc_els.o bnx2fc_fcoe.o bnx2fc_hwi.o bnx2fc_io.o bnx2fc_tgt.o \
+ bnx2fc_debug.o
diff --git a/drivers/scsi/bnx2fc/bnx2fc.h b/drivers/scsi/bnx2fc/bnx2fc.h
index 0578fa0..2f1bea4 100644
--- a/drivers/scsi/bnx2fc/bnx2fc.h
+++ b/drivers/scsi/bnx2fc/bnx2fc.h
@@ -11,6 +11,8 @@
* Written by: Bhanu Prakash Gollapudi (bprakash@broadcom.com)
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
@@ -57,7 +59,6 @@
#include <scsi/fc/fc_fcp.h>
#include "57xx_hsi_bnx2fc.h"
-#include "bnx2fc_debug.h"
#include "../../net/ethernet/broadcom/cnic_if.h"
#include "bnx2fc_constants.h"
@@ -554,4 +555,7 @@ void bnx2fc_process_seq_cleanup_compl(struct bnx2fc_cmd *seq_clnup_req,
int bnx2fc_initiate_seq_cleanup(struct bnx2fc_cmd *orig_io_req, u32 offset,
enum fc_rctl r_ctl);
+
+#include "bnx2fc_debug.h"
+
#endif
diff --git a/drivers/scsi/bnx2fc/bnx2fc_debug.c b/drivers/scsi/bnx2fc/bnx2fc_debug.c
new file mode 100644
index 0000000..0cbee1b
--- /dev/null
+++ b/drivers/scsi/bnx2fc/bnx2fc_debug.c
@@ -0,0 +1,70 @@
+#include "bnx2fc.h"
+
+void BNX2FC_IO_DBG(const struct bnx2fc_cmd *io_req, const char *fmt, ...)
+{
+ struct va_format vaf;
+ va_list args;
+
+ if (likely(!(bnx2fc_debug_level & LOG_IO)))
+ return;
+
+ va_start(args, fmt);
+
+ vaf.fmt = fmt;
+ vaf.va = &args;
+
+ if (io_req && io_req->port && io_req->port->lport &&
+ io_req->port->lport->host)
+ shost_printk(KERN_INFO, io_req->port->lport->host,
+ PFX "xid:0x%x %pV",
+ io_req->xid, &vaf);
+ else
+ pr_info("NULL %pV", &vaf);
+
+ va_end(args);
+}
+
+void BNX2FC_TGT_DBG(const struct bnx2fc_rport *tgt, const char *fmt, ...)
+{
+ struct va_format vaf;
+ va_list args;
+
+ if (likely(!(bnx2fc_debug_level & LOG_TGT)))
+ return;
+
+ va_start(args, fmt);
+
+ vaf.fmt = fmt;
+ vaf.va = &args;
+
+ if (tgt && tgt->port && tgt->port->lport && tgt->port->lport->host &&
+ tgt->rport)
+ shost_printk(KERN_INFO, tgt->port->lport->host,
+ PFX "port:%x %pV",
+ tgt->rport->port_id, &vaf);
+ else
+ pr_info("NULL %pV", &vaf);
+
+ va_end(args);
+}
+
+void BNX2FC_HBA_DBG(const struct fc_lport *lport, const char *fmt, ...)
+{
+ struct va_format vaf;
+ va_list args;
+
+ if (likely(!(bnx2fc_debug_level & LOG_HBA)))
+ return;
+
+ va_start(args, fmt);
+
+ vaf.fmt = fmt;
+ vaf.va = &args;
+
+ if (lport && lport->host)
+ shost_printk(KERN_INFO, lport->host, PFX "%pV", &vaf);
+ else
+ pr_info("NULL %pV", &vaf);
+
+ va_end(args);
+}
diff --git a/drivers/scsi/bnx2fc/bnx2fc_debug.h b/drivers/scsi/bnx2fc/bnx2fc_debug.h
index 3416d9a..4808ff9 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_debug.h
+++ b/drivers/scsi/bnx2fc/bnx2fc_debug.h
@@ -11,60 +11,23 @@
extern unsigned int bnx2fc_debug_level;
-#define BNX2FC_CHK_LOGGING(LEVEL, CMD) \
- do { \
- if (unlikely(bnx2fc_debug_level & LEVEL)) \
- do { \
- CMD; \
- } while (0); \
- } while (0)
-
-#define BNX2FC_ELS_DBG(fmt, arg...) \
- BNX2FC_CHK_LOGGING(LOG_ELS, \
- printk(KERN_INFO PFX fmt, ##arg))
-
-#define BNX2FC_MISC_DBG(fmt, arg...) \
- BNX2FC_CHK_LOGGING(LOG_MISC, \
- printk(KERN_INFO PFX fmt, ##arg))
-
-#define BNX2FC_IO_DBG(io_req, fmt, arg...) \
- do { \
- if (!io_req || !io_req->port || !io_req->port->lport || \
- !io_req->port->lport->host) \
- BNX2FC_CHK_LOGGING(LOG_IO, \
- printk(KERN_INFO PFX "NULL " fmt, ##arg)); \
- else \
- BNX2FC_CHK_LOGGING(LOG_IO, \
- shost_printk(KERN_INFO, \
- (io_req)->port->lport->host, \
- PFX "xid:0x%x " fmt, \
- (io_req)->xid, ##arg)); \
- } while (0)
-
-#define BNX2FC_TGT_DBG(tgt, fmt, arg...) \
- do { \
- if (!tgt || !tgt->port || !tgt->port->lport || \
- !tgt->port->lport->host || !tgt->rport) \
- BNX2FC_CHK_LOGGING(LOG_TGT, \
- printk(KERN_INFO PFX "NULL " fmt, ##arg)); \
- else \
- BNX2FC_CHK_LOGGING(LOG_TGT, \
- shost_printk(KERN_INFO, \
- (tgt)->port->lport->host, \
- PFX "port:%x " fmt, \
- (tgt)->rport->port_id, ##arg)); \
- } while (0)
-
-
-#define BNX2FC_HBA_DBG(lport, fmt, arg...) \
- do { \
- if (!lport || !lport->host) \
- BNX2FC_CHK_LOGGING(LOG_HBA, \
- printk(KERN_INFO PFX "NULL " fmt, ##arg)); \
- else \
- BNX2FC_CHK_LOGGING(LOG_HBA, \
- shost_printk(KERN_INFO, lport->host, \
- PFX fmt, ##arg)); \
- } while (0)
+#define BNX2FC_ELS_DBG(fmt, ...) \
+do { \
+ if (unlikely(bnx2fc_debug_level & LOG_ELS)) \
+ pr_info(fmt, ##__VA_ARGS__); \
+} while (0)
+
+#define BNX2FC_MISC_DBG(fmt, ...) \
+do { \
+ if (unlikely(bnx2fc_debug_level & LOG_MISC)) \
+ pr_info(fmt, ##__VA_ARGS__); \
+} while (0)
+
+__printf(2, 3)
+void BNX2FC_IO_DBG(const struct bnx2fc_cmd *io_req, const char *fmt, ...);
+__printf(2, 3)
+void BNX2FC_TGT_DBG(const struct bnx2fc_rport *tgt, const char *fmt, ...);
+__printf(2, 3)
+void BNX2FC_HBA_DBG(const struct fc_lport *lport, const char *fmt, ...);
#endif
--
1.7.0.6
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 3/6] bnx2fc: Support interface creation on non-VLAN interface also.
2012-06-04 23:15 [PATCH 0/6] bnx2fc version 1.0.12 Bhanu Prakash Gollapudi
2012-06-04 23:15 ` [PATCH 1/6] bnx2fc: use kthread_create_on_node Bhanu Prakash Gollapudi
2012-06-04 23:15 ` [PATCH 2/6] bnx2fc: Reduce object size by consolidating formats Bhanu Prakash Gollapudi
@ 2012-06-04 23:15 ` Bhanu Prakash Gollapudi
2012-06-04 23:15 ` [PATCH 4/6] bnx2fc: Improve error recovery by handling parity errors Bhanu Prakash Gollapudi
` (2 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Bhanu Prakash Gollapudi @ 2012-06-04 23:15 UTC (permalink / raw)
To: JBottomley, linux-scsi; +Cc: michaelc, Bhanu Prakash Gollapudi
bnx2fc had an assumption that the fcoe interface will always start on the vlan
dev. However, some switch implementations (Eg., HP virtual connect FlexFabric)
expects the fcoe interface to be started on physical interface. Do not error
out if the netdev is not a vlan dev.
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
---
drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 33 +++++++++++++++++----------------
1 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index dd28af7..f75308c 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -2019,11 +2019,11 @@ static int bnx2fc_create(struct net_device *netdev, enum fip_state fip_mode)
struct fcoe_ctlr *ctlr;
struct bnx2fc_interface *interface;
struct bnx2fc_hba *hba;
- struct net_device *phys_dev;
+ struct net_device *phys_dev = netdev;
struct fc_lport *lport;
struct ethtool_drvinfo drvinfo;
int rc = 0;
- int vlan_id;
+ int vlan_id = 0;
BNX2FC_MISC_DBG("Entered bnx2fc_create\n");
if (fip_mode != FIP_MODE_FABRIC) {
@@ -2041,14 +2041,9 @@ static int bnx2fc_create(struct net_device *netdev, enum fip_state fip_mode)
}
/* obtain physical netdev */
- if (netdev->priv_flags & IFF_802_1Q_VLAN) {
+ if (netdev->priv_flags & IFF_802_1Q_VLAN)
phys_dev = vlan_dev_real_dev(netdev);
- vlan_id = vlan_dev_vlan_id(netdev);
- } else {
- printk(KERN_ERR PFX "Not a vlan device\n");
- rc = -EINVAL;
- goto netdev_err;
- }
+
/* verify if the physical device is a netxtreme2 device */
if (phys_dev->ethtool_ops && phys_dev->ethtool_ops->get_drvinfo) {
memset(&drvinfo, 0, sizeof(drvinfo));
@@ -2083,9 +2078,13 @@ static int bnx2fc_create(struct net_device *netdev, enum fip_state fip_mode)
goto ifput_err;
}
+ if (netdev->priv_flags & IFF_802_1Q_VLAN) {
+ vlan_id = vlan_dev_vlan_id(netdev);
+ interface->vlan_enabled = 1;
+ }
+
ctlr = bnx2fc_to_ctlr(interface);
interface->vlan_id = vlan_id;
- interface->vlan_enabled = 1;
interface->timer_work_queue =
create_singlethread_workqueue("bnx2fc_timer_wq");
@@ -2252,15 +2251,17 @@ static int bnx2fc_fcoe_reset(struct Scsi_Host *shost)
static bool bnx2fc_match(struct net_device *netdev)
{
+ struct net_device *phys_dev = netdev;
+
mutex_lock(&bnx2fc_dev_lock);
- if (netdev->priv_flags & IFF_802_1Q_VLAN) {
- struct net_device *phys_dev = vlan_dev_real_dev(netdev);
+ if (netdev->priv_flags & IFF_802_1Q_VLAN)
+ phys_dev = vlan_dev_real_dev(netdev);
- if (bnx2fc_hba_lookup(phys_dev)) {
- mutex_unlock(&bnx2fc_dev_lock);
- return true;
- }
+ if (bnx2fc_hba_lookup(phys_dev)) {
+ mutex_unlock(&bnx2fc_dev_lock);
+ return true;
}
+
mutex_unlock(&bnx2fc_dev_lock);
return false;
}
--
1.7.0.6
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 4/6] bnx2fc: Improve error recovery by handling parity errors
2012-06-04 23:15 [PATCH 0/6] bnx2fc version 1.0.12 Bhanu Prakash Gollapudi
` (2 preceding siblings ...)
2012-06-04 23:15 ` [PATCH 3/6] bnx2fc: Support interface creation on non-VLAN interface also Bhanu Prakash Gollapudi
@ 2012-06-04 23:15 ` Bhanu Prakash Gollapudi
2012-06-07 3:03 ` James Bottomley
2012-06-04 23:15 ` [PATCH 5/6] bnx2fc: use list_entry instead of explicit cast Bhanu Prakash Gollapudi
2012-06-04 23:15 ` [PATCH 6/6] bnx2fc: Bumped version to 1.0.12 Bhanu Prakash Gollapudi
5 siblings, 1 reply; 9+ messages in thread
From: Bhanu Prakash Gollapudi @ 2012-06-04 23:15 UTC (permalink / raw)
To: JBottomley, linux-scsi; +Cc: michaelc, Bhanu Prakash Gollapudi
During parity errors, the ramrods are not issued to FW. bnx2fc waits for the
timeout value, and proceeds with cleaning up the IOs. Since we are already
out-of-sync with FW, cleanup commands timeout too, and do not get the
completion. This operation takes 36 secs for each session to upload causing
huge delays. To fix this, bnx2fc now gets a PARITY_ERROR from cnic driver, and
upon failure, the driver does not issue any commands to the FW and finishes the
upload process sooner.
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
---
drivers/scsi/bnx2fc/bnx2fc.h | 1 +
drivers/scsi/bnx2fc/bnx2fc_hwi.c | 4 +++-
drivers/scsi/bnx2fc/bnx2fc_tgt.c | 22 ++++++++++++++++++----
3 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/drivers/scsi/bnx2fc/bnx2fc.h b/drivers/scsi/bnx2fc/bnx2fc.h
index 2f1bea4..baac6e9 100644
--- a/drivers/scsi/bnx2fc/bnx2fc.h
+++ b/drivers/scsi/bnx2fc/bnx2fc.h
@@ -275,6 +275,7 @@ struct bnx2fc_rport {
#define BNX2FC_FLAG_CTX_ALLOC_FAILURE 0x6
#define BNX2FC_FLAG_UPLD_REQ_COMPL 0x7
#define BNX2FC_FLAG_EXPL_LOGO 0x8
+#define BNX2FC_FLAG_DISABLE_FAILED 0x9
u8 src_addr[ETH_ALEN];
u32 max_sqes;
diff --git a/drivers/scsi/bnx2fc/bnx2fc_hwi.c b/drivers/scsi/bnx2fc/bnx2fc_hwi.c
index 2ca6bfe..6d6eee4 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_hwi.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_hwi.c
@@ -1244,7 +1244,9 @@ static void bnx2fc_process_conn_disable_cmpl(struct bnx2fc_hba *hba,
if (disable_kcqe->completion_status) {
printk(KERN_ERR PFX "Disable failed with cmpl status %d\n",
disable_kcqe->completion_status);
- return;
+ set_bit(BNX2FC_FLAG_DISABLE_FAILED, &tgt->flags);
+ set_bit(BNX2FC_FLAG_UPLD_REQ_COMPL, &tgt->flags);
+ wake_up_interruptible(&tgt->upld_wait);
} else {
/* disable successful */
BNX2FC_TGT_DBG(tgt, "disable successful\n");
diff --git a/drivers/scsi/bnx2fc/bnx2fc_tgt.c b/drivers/scsi/bnx2fc/bnx2fc_tgt.c
index 082a25c..e71c254 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_tgt.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_tgt.c
@@ -181,8 +181,14 @@ void bnx2fc_flush_active_ios(struct bnx2fc_rport *tgt)
set_bit(BNX2FC_FLAG_IO_COMPL, &io_req->req_flags);
set_bit(BNX2FC_FLAG_IO_CLEANUP, &io_req->req_flags);
- rc = bnx2fc_initiate_cleanup(io_req);
- BUG_ON(rc);
+
+ /* Do not issue cleanup when disable request failed */
+ if (test_bit(BNX2FC_FLAG_DISABLE_FAILED, &tgt->flags))
+ bnx2fc_process_cleanup_compl(io_req, io_req->task, 0);
+ else {
+ rc = bnx2fc_initiate_cleanup(io_req);
+ BUG_ON(rc);
+ }
}
list_for_each_safe(list, tmp, &tgt->active_tm_queue) {
@@ -212,8 +218,13 @@ void bnx2fc_flush_active_ios(struct bnx2fc_rport *tgt)
io_req->cb_arg = NULL;
}
- rc = bnx2fc_initiate_cleanup(io_req);
- BUG_ON(rc);
+ /* Do not issue cleanup when disable request failed */
+ if (test_bit(BNX2FC_FLAG_DISABLE_FAILED, &tgt->flags))
+ bnx2fc_process_cleanup_compl(io_req, io_req->task, 0);
+ else {
+ rc = bnx2fc_initiate_cleanup(io_req);
+ BUG_ON(rc);
+ }
}
list_for_each_safe(list, tmp, &tgt->io_retire_queue) {
@@ -321,6 +332,9 @@ static void bnx2fc_upload_session(struct fcoe_port *port,
del_timer_sync(&tgt->upld_timer);
+ } else if (test_bit(BNX2FC_FLAG_DISABLE_FAILED, &tgt->flags))
+ printk(KERN_ERR PFX "ERROR!! DISABLE req failed, destroy"
+ " not sent to FW\n");
} else
printk(KERN_ERR PFX "ERROR!! DISABLE req timed out, destroy"
" not sent to FW\n");
--
1.7.0.6
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH 4/6] bnx2fc: Improve error recovery by handling parity errors
2012-06-04 23:15 ` [PATCH 4/6] bnx2fc: Improve error recovery by handling parity errors Bhanu Prakash Gollapudi
@ 2012-06-07 3:03 ` James Bottomley
2012-06-07 8:39 ` Bhanu Prakash Gollapudi
0 siblings, 1 reply; 9+ messages in thread
From: James Bottomley @ 2012-06-07 3:03 UTC (permalink / raw)
To: Bhanu Prakash Gollapudi; +Cc: linux-scsi@vger.kernel.org, michaelc@cs.wisc.edu
On Mon, 2012-06-04 at 16:15 -0700, Bhanu Prakash Gollapudi wrote:
> @@ -321,6 +332,9 @@ static void bnx2fc_upload_session(struct fcoe_port *port,
>
> del_timer_sync(&tgt->upld_timer);
>
> + } else if (test_bit(BNX2FC_FLAG_DISABLE_FAILED, &tgt->flags))
> + printk(KERN_ERR PFX "ERROR!! DISABLE req failed, destroy"
> + " not sent to FW\n");
> } else
> printk(KERN_ERR PFX "ERROR!! DISABLE req timed out, destroy"
> " not sent to FW\n");
You didn't actually compile this did you? That else if has to have an
opening brace to match the closing one on the next else ...
James
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 4/6] bnx2fc: Improve error recovery by handling parity errors
2012-06-07 3:03 ` James Bottomley
@ 2012-06-07 8:39 ` Bhanu Prakash Gollapudi
0 siblings, 0 replies; 9+ messages in thread
From: Bhanu Prakash Gollapudi @ 2012-06-07 8:39 UTC (permalink / raw)
To: James Bottomley; +Cc: linux-scsi@vger.kernel.org, michaelc@cs.wisc.edu
On 6/6/2012 8:03 PM, James Bottomley wrote:
> On Mon, 2012-06-04 at 16:15 -0700, Bhanu Prakash Gollapudi wrote:
>> @@ -321,6 +332,9 @@ static void bnx2fc_upload_session(struct fcoe_port *port,
>>
>> del_timer_sync(&tgt->upld_timer);
>>
>> + } else if (test_bit(BNX2FC_FLAG_DISABLE_FAILED,&tgt->flags))
>> + printk(KERN_ERR PFX "ERROR!! DISABLE req failed, destroy"
>> + " not sent to FW\n");
>> } else
>> printk(KERN_ERR PFX "ERROR!! DISABLE req timed out, destroy"
>> " not sent to FW\n");
>
> You didn't actually compile this did you? That else if has to have an
> opening brace to match the closing one on the next else ...
My bad. I fixed this compilation error, but by mistake I applied that
change to next patch. I'll correct it and submit the last three patches
shortly, as you've already picked up the first three.
Thanks,
Bhanu
>
> James
>
> \x13��칻\x1c�&�~�&�\x18��+-��ݶ\x17��w��˛���m�b��lrȢ��^n�r���z�\x1a��h����&��\x1e�G���h�\x03(�階�ݢj"��\x1a�^[m�����z�ޖ���f���h���~�m�
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 5/6] bnx2fc: use list_entry instead of explicit cast
2012-06-04 23:15 [PATCH 0/6] bnx2fc version 1.0.12 Bhanu Prakash Gollapudi
` (3 preceding siblings ...)
2012-06-04 23:15 ` [PATCH 4/6] bnx2fc: Improve error recovery by handling parity errors Bhanu Prakash Gollapudi
@ 2012-06-04 23:15 ` Bhanu Prakash Gollapudi
2012-06-04 23:15 ` [PATCH 6/6] bnx2fc: Bumped version to 1.0.12 Bhanu Prakash Gollapudi
5 siblings, 0 replies; 9+ messages in thread
From: Bhanu Prakash Gollapudi @ 2012-06-04 23:15 UTC (permalink / raw)
To: JBottomley, linux-scsi; +Cc: michaelc, Bhanu Prakash Gollapudi
Use list_for_each_entry_safe() instead of explicit cast to avoid relying on
struct layout
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
---
drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 5 +----
drivers/scsi/bnx2fc/bnx2fc_io.c | 21 +++++++--------------
drivers/scsi/bnx2fc/bnx2fc_tgt.c | 17 ++++++-----------
3 files changed, 14 insertions(+), 29 deletions(-)
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index f75308c..2fd7c26 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -2151,13 +2151,10 @@ mod_err:
**/
static struct bnx2fc_hba *bnx2fc_find_hba_for_cnic(struct cnic_dev *cnic)
{
- struct list_head *list;
- struct list_head *temp;
struct bnx2fc_hba *hba;
/* Called with bnx2fc_dev_lock held */
- list_for_each_safe(list, temp, &adapter_list) {
- hba = (struct bnx2fc_hba *)list;
+ list_for_each_entry(hba, &adapter_list, list) {
if (hba->cnic == cnic)
return hba;
}
diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c
index 4f7453b..1dfe5ee 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_io.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_io.c
@@ -405,11 +405,10 @@ free_cmd_pool:
goto free_cmgr;
for (i = 0; i < num_possible_cpus() + 1; i++) {
- struct list_head *list;
- struct list_head *tmp;
+ struct bnx2fc_cmd *tmp, *io_req;
- list_for_each_safe(list, tmp, &cmgr->free_list[i]) {
- struct bnx2fc_cmd *io_req = (struct bnx2fc_cmd *)list;
+ list_for_each_entry_safe(io_req, tmp,
+ &cmgr->free_list[i], link) {
list_del(&io_req->link);
kfree(io_req);
}
@@ -1436,9 +1435,7 @@ static void bnx2fc_lun_reset_cmpl(struct bnx2fc_cmd *io_req)
{
struct scsi_cmnd *sc_cmd = io_req->sc_cmd;
struct bnx2fc_rport *tgt = io_req->tgt;
- struct list_head *list;
- struct list_head *tmp;
- struct bnx2fc_cmd *cmd;
+ struct bnx2fc_cmd *cmd, *tmp;
int tm_lun = sc_cmd->device->lun;
int rc = 0;
int lun;
@@ -1449,9 +1446,8 @@ static void bnx2fc_lun_reset_cmpl(struct bnx2fc_cmd *io_req)
* Walk thru the active_ios queue and ABORT the IO
* that matches with the LUN that was reset
*/
- list_for_each_safe(list, tmp, &tgt->active_cmd_queue) {
+ list_for_each_entry_safe(cmd, tmp, &tgt->active_cmd_queue, link) {
BNX2FC_TGT_DBG(tgt, "LUN RST cmpl: scan for pending IOs\n");
- cmd = (struct bnx2fc_cmd *)list;
lun = cmd->sc_cmd->device->lun;
if (lun == tm_lun) {
/* Initiate ABTS on this cmd */
@@ -1476,9 +1472,7 @@ static void bnx2fc_lun_reset_cmpl(struct bnx2fc_cmd *io_req)
static void bnx2fc_tgt_reset_cmpl(struct bnx2fc_cmd *io_req)
{
struct bnx2fc_rport *tgt = io_req->tgt;
- struct list_head *list;
- struct list_head *tmp;
- struct bnx2fc_cmd *cmd;
+ struct bnx2fc_cmd *cmd, *tmp;
int rc = 0;
/* called with tgt_lock held */
@@ -1487,9 +1481,8 @@ static void bnx2fc_tgt_reset_cmpl(struct bnx2fc_cmd *io_req)
* Walk thru the active_ios queue and ABORT the IO
* that matches with the LUN that was reset
*/
- list_for_each_safe(list, tmp, &tgt->active_cmd_queue) {
+ list_for_each_entry_safe(cmd, tmp, &tgt->active_cmd_queue, link) {
BNX2FC_TGT_DBG(tgt, "TGT RST cmpl: scan for pending IOs\n");
- cmd = (struct bnx2fc_cmd *)list;
/* Initiate ABTS */
if (!test_and_set_bit(BNX2FC_FLAG_ISSUE_ABTS,
&cmd->req_flags)) {
diff --git a/drivers/scsi/bnx2fc/bnx2fc_tgt.c b/drivers/scsi/bnx2fc/bnx2fc_tgt.c
index e71c254..43f8e42 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_tgt.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_tgt.c
@@ -150,8 +150,7 @@ tgt_init_err:
void bnx2fc_flush_active_ios(struct bnx2fc_rport *tgt)
{
struct bnx2fc_cmd *io_req;
- struct list_head *list;
- struct list_head *tmp;
+ struct bnx2fc_cmd *tmp;
int rc;
int i = 0;
BNX2FC_TGT_DBG(tgt, "Entered flush_active_ios - %d\n",
@@ -160,9 +159,8 @@ void bnx2fc_flush_active_ios(struct bnx2fc_rport *tgt)
spin_lock_bh(&tgt->tgt_lock);
tgt->flush_in_prog = 1;
- list_for_each_safe(list, tmp, &tgt->active_cmd_queue) {
+ list_for_each_entry_safe(io_req, tmp, &tgt->active_cmd_queue, link) {
i++;
- io_req = (struct bnx2fc_cmd *)list;
list_del_init(&io_req->link);
io_req->on_active_queue = 0;
BNX2FC_IO_DBG(io_req, "cmd_queue cleanup\n");
@@ -191,9 +189,8 @@ void bnx2fc_flush_active_ios(struct bnx2fc_rport *tgt)
}
}
- list_for_each_safe(list, tmp, &tgt->active_tm_queue) {
+ list_for_each_entry_safe(io_req, tmp, &tgt->active_tm_queue, link) {
i++;
- io_req = (struct bnx2fc_cmd *)list;
list_del_init(&io_req->link);
io_req->on_tmf_queue = 0;
BNX2FC_IO_DBG(io_req, "tm_queue cleanup\n");
@@ -201,9 +198,8 @@ void bnx2fc_flush_active_ios(struct bnx2fc_rport *tgt)
complete(&io_req->tm_done);
}
- list_for_each_safe(list, tmp, &tgt->els_queue) {
+ list_for_each_entry_safe(io_req, tmp, &tgt->els_queue, link) {
i++;
- io_req = (struct bnx2fc_cmd *)list;
list_del_init(&io_req->link);
io_req->on_active_queue = 0;
@@ -227,9 +223,8 @@ void bnx2fc_flush_active_ios(struct bnx2fc_rport *tgt)
}
}
- list_for_each_safe(list, tmp, &tgt->io_retire_queue) {
+ list_for_each_entry_safe(io_req, tmp, &tgt->io_retire_queue, link) {
i++;
- io_req = (struct bnx2fc_cmd *)list;
list_del_init(&io_req->link);
BNX2FC_IO_DBG(io_req, "retire_queue flush\n");
@@ -335,7 +330,7 @@ static void bnx2fc_upload_session(struct fcoe_port *port,
} else if (test_bit(BNX2FC_FLAG_DISABLE_FAILED, &tgt->flags))
printk(KERN_ERR PFX "ERROR!! DISABLE req failed, destroy"
" not sent to FW\n");
- } else
+ else
printk(KERN_ERR PFX "ERROR!! DISABLE req timed out, destroy"
" not sent to FW\n");
--
1.7.0.6
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 6/6] bnx2fc: Bumped version to 1.0.12
2012-06-04 23:15 [PATCH 0/6] bnx2fc version 1.0.12 Bhanu Prakash Gollapudi
` (4 preceding siblings ...)
2012-06-04 23:15 ` [PATCH 5/6] bnx2fc: use list_entry instead of explicit cast Bhanu Prakash Gollapudi
@ 2012-06-04 23:15 ` Bhanu Prakash Gollapudi
5 siblings, 0 replies; 9+ messages in thread
From: Bhanu Prakash Gollapudi @ 2012-06-04 23:15 UTC (permalink / raw)
To: JBottomley, linux-scsi; +Cc: michaelc, 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 baac6e9..5147475 100644
--- a/drivers/scsi/bnx2fc/bnx2fc.h
+++ b/drivers/scsi/bnx2fc/bnx2fc.h
@@ -63,7 +63,7 @@
#include "bnx2fc_constants.h"
#define BNX2FC_NAME "bnx2fc"
-#define BNX2FC_VERSION "1.0.11"
+#define BNX2FC_VERSION "1.0.12"
#define PFX "bnx2fc: "
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index 2fd7c26..6edd8f6 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -22,7 +22,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 "Apr 24, 2012"
+#define DRV_MODULE_RELDATE "Jun 04, 2012"
static char version[] __devinitdata =
--
1.7.0.6
^ permalink raw reply related [flat|nested] 9+ messages in thread