bnx2fc version 1.0.8
PATCH 1/4 bnx2fc: call ctlr_link_up only when the interface is enabled
In reply to Bhanu Prakash GollapudiLink may not be up when the driver receives ulp_start event, and hence fcoe_ctlr_link_up is not called. Call fcoe_ctlr_link_up during indicate_netevent only when the interface is enabled. (It has to be called when enabled because that is an indication that the vlan discovery is completed).
--- drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/scsi/bnx2fc/bnx2fc_fcoe.c +2 -0
@@ -870,6 +870,8 @@ static void bnx2fc_indicate_netevent(void *context, unsigned long event,* enable to avoid sending discovery solicitation * on a stale vlan */ +if (interface->enabled) +fcoe_ctlr_link_up (&interface->ctlr); }else if (fcoe_ctlr_link_down (&interface->ctlr)) {mutex_lock (&lport->lp_mutex);list_for_each_entry (vport, &lport->vports, list)
Signature · 1 line
1.7.0.6
PATCH 2/4 fcoe/libfcoe: Move common code for fcoe_get_lesb to fcoe_transport
In reply to Bhanu Prakash GollapudiExcept for obtaining the netdev from lport, fcoe_get_lesb is the common code for the LLDs.
--- drivers/scsi/fcoe/fcoe.c | 21 +-------------------- drivers/scsi/fcoe/fcoe_transport.c | 29 +++++++++++++++++++++++++++++ include/scsi/libfcoe.h | 2 ++ 3 files changed, 32 insertions(+), 20 deletions(-)
drivers/scsi/fcoe/fcoe.c +1 -20
@@ -2533,28 +2533,9 @@ static void fcoe_set_vport_symbolic_name(struct fc_vport *vport)static void fcoe_get_lesb (struct fc_lport *lport,struct fc_els_lesb *fc_lesb) { -unsigned int cpu; -u32 lfc, vlfc, mdac; -struct fcoe_dev_stats *devst; -struct fcoe_fc_els_lesb *lesb; -struct rtnl_link_stats64 temp;struct net_device *netdev =fcoe_netdev (lport); - lfc =0 ; - vlfc =0 ; - mdac =0 ; - lesb = (struct fcoe_fc_els_lesb *)fc_lesb; -memset (lesb,0 ,sizeof (*lesb)); -for_each_possible_cpu (cpu) { - devst =per_cpu_ptr (lport->dev_stats, cpu); - lfc += devst->LinkFailureCount; - vlfc += devst->VLinkFailureCount; - mdac += devst->MissDiscAdvCount; - } - lesb->lesb_link_fail =htonl (lfc); - lesb->lesb_vlink_fail =htonl (vlfc); - lesb->lesb_miss_fka =htonl (mdac); - lesb->lesb_fcs_error =htonl (dev_get_stats (netdev, &temp)->rx_crc_errors); +__fcoe_get_lesb (lport, fc_lesb, netdev); }/**
drivers/scsi/fcoe/fcoe_transport.c +29 -0
@@ -83,6 +83,35 @@ static struct notifier_block libfcoe_notifier = { .notifier_call = libfcoe_device_notification, }; +void __fcoe_get_lesb (struct fc_lport *lport, +struct fc_els_lesb *fc_lesb, +struct net_device *netdev) +{ +unsigned int cpu; +u32 lfc, vlfc, mdac; +struct fcoe_dev_stats *devst; +struct fcoe_fc_els_lesb *lesb; +struct rtnl_link_stats64 temp; + + lfc =0 ; + vlfc =0 ; + mdac =0 ; + lesb = (struct fcoe_fc_els_lesb *)fc_lesb; +memset (lesb,0 ,sizeof (*lesb)); +for_each_possible_cpu (cpu) { + devst =per_cpu_ptr (lport->dev_stats, cpu); + lfc += devst->LinkFailureCount; + vlfc += devst->VLinkFailureCount; + mdac += devst->MissDiscAdvCount; + } + lesb->lesb_link_fail =htonl (lfc); + lesb->lesb_vlink_fail =htonl (vlfc); + lesb->lesb_miss_fka =htonl (mdac); + lesb->lesb_fcs_error = +htonl (dev_get_stats (netdev, &temp)->rx_crc_errors); +} +EXPORT_SYMBOL_GPL (__fcoe_get_lesb); +void fcoe_wwn_to_str (u64 wwn,char *buf,int len) {u8 wwpn[8 ];
include/scsi/libfcoe.h +2 -0
@@ -230,6 +230,8 @@ int fcoe_libfc_config(struct fc_lport *, struct fcoe_ctlr *,u32 fcoe_fc_crc (struct fc_frame *fp);int fcoe_start_io (struct sk_buff *skb);int fcoe_get_wwn (struct net_device *netdev,u64 *wwn,int type); +void __fcoe_get_lesb (struct fc_lport *lport,struct fc_els_lesb *fc_lesb, +struct net_device *netdev);void fcoe_wwn_to_str (u64 wwn,char *buf,int len);int fcoe_validate_vport_create (struct fc_vport *vport);
Signature · 1 line
1.7.0.6
PATCH 3/4 bnx2fc: Return error statistics of remote peer
In reply to Bhanu Prakash GollapudiAdd support for get_lesb so that the valid statistics are returned by the remote peer when RLS command is issued.
--- drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-)
drivers/scsi/bnx2fc/bnx2fc_fcoe.c +20 -0
@@ -99,6 +99,25 @@ static struct notifier_block bnx2fc_cpu_notifier = { .notifier_call = bnx2fc_cpu_callback, }; +static inline struct net_device *bnx2fc_netdev (const struct fc_lport *lport) +{ +return ((struct bnx2fc_interface *) + ((struct fcoe_port *)lport_priv (lport))->priv)->netdev; +} + +/** +* bnx2fc_get_lesb() - Fill the FCoE Link Error Status Block +* @lport: the local port +* @fc_lesb: the link error status block +*/ +static void bnx2fc_get_lesb (struct fc_lport *lport, +struct fc_els_lesb *fc_lesb) +{ +struct net_device *netdev =bnx2fc_netdev (lport); + +__fcoe_get_lesb (lport, fc_lesb, netdev); +} +static void bnx2fc_clean_rx_queue (struct fc_lport *lp) {struct fcoe_percpu_s *bg;
@@ -2512,6 +2531,7 @@ static struct libfc_function_template bnx2fc_libfc_fcn_templ = { .elsct_send = bnx2fc_elsct_send, .fcp_abort_io = bnx2fc_abort_io, .fcp_cleanup = bnx2fc_cleanup, + .get_lesb = bnx2fc_get_lesb, .rport_event_callback = bnx2fc_rport_event_handler, };
Signature · 1 line
1.7.0.6
cover bnx2fc version 1.0.8
James,
Can you please apply these patches to scsi-misc tree targetting 3.2?
Please note that patch 3 (bnx2fc: Return error statistics of remote peer) depends on patch 2 (fcoe/libfcoe: Move common code for fcoe_get_lesb to fcoe_transport).
Thanks,
Bhanu
Bhanu Prakash Gollapudi (4):
bnx2fc: call ctlr_link_up only when the interface is enabled fcoe/libfcoe: Move common code for fcoe_get_lesb to fcoe_transport
bnx2fc: Return error statistics of remote peer
bnx2fc: Bumped version to 1.0.8
drivers/scsi/bnx2fc/bnx2fc.h | 2 +- drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 24 +++++++++++++++++++++++- drivers/scsi/fcoe/fcoe.c | 21 +-------------------- drivers/scsi/fcoe/fcoe_transport.c | 29 +++++++++++++++++++++++++++++ include/scsi/libfcoe.h | 2 ++ 5 files changed, 56 insertions(+), 22 deletions(-)
PATCH 4/4 bnx2fc: Bumped version to 1.0.8
--- drivers/scsi/bnx2fc/bnx2fc.h | 2 +- drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/bnx2fc/bnx2fc.h +1 -1
@@ -62,7 +62,7 @@#include "bnx2fc_constants.h" #define BNX2FC_NAME "bnx2fc" -#define BNX2FC_VERSION "1.0.7" +#define BNX2FC_VERSION "1.0.8"#define PFX "bnx2fc: "
drivers/scsi/bnx2fc/bnx2fc_fcoe.c +1 -1
@@ -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 "Sep 19, 2011" +#define DRV_MODULE_RELDATE "Oct 02, 2011" static char version[] __devinitdata =
Signature · 1 line
1.7.0.6
RE: [PATCH 2/4] fcoe/libfcoe: Move common code for fcoe_get_lesb to fcoe_transport
In reply to Bhanu Prakash GollapudiQuoted 6 lines
Except for obtaining the netdev from lport,
fcoe_get_lesbis the common code
for the LLDs.Signed-off-by Bhanu Prakash Gollapudi <[email protected]>
Looks good to me.
Quoted 105 lines
--- drivers/scsi/fcoe/fcoe.c | 21 +-------------------- drivers/scsi/fcoe/fcoe_transport.c | 29 +++++++++++++++++++++++++++++ include/scsi/libfcoe.h | 2 ++ 3 files changed, 32 insertions(+), 20 deletions(-)drivers/scsi/fcoe/fcoe.c +1
-20@@ -2533,28 +2533,9 @@ static void fcoe_set_vport_symbolic_name(struct fc_vport *vport)static void fcoe_get_lesb (struct fc_lport *lport,struct fc_els_lesb *fc_lesb) { -unsigned int cpu; -u32 lfc, vlfc, mdac; -struct fcoe_dev_stats *devst; -struct fcoe_fc_els_lesb *lesb; -struct rtnl_link_stats64 temp;struct net_device *netdev =fcoe_netdev (lport); - lfc =0 ; - vlfc =0 ; - mdac =0 ; - lesb = (struct fcoe_fc_els_lesb *)fc_lesb; -memset (lesb,0 ,sizeof (*lesb)); -for_each_possible_cpu (cpu) { - devst =per_cpu_ptr (lport->dev_stats, cpu); - lfc += devst->LinkFailureCount; - vlfc += devst->VLinkFailureCount; - mdac += devst->MissDiscAdvCount; - } - lesb->lesb_link_fail =htonl (lfc); - lesb->lesb_vlink_fail =htonl (vlfc); - lesb->lesb_miss_fka =htonl (mdac); - lesb->lesb_fcs_error =htonl (dev_get_stats (netdev, &temp)- >rx_crc_errors); +__fcoe_get_lesb (lport, fc_lesb, netdev); }/**
drivers/scsi/fcoe/fcoe_transport.c +29
-0@@ -83,6 +83,35 @@ static struct notifier_block libfcoe_notifier = { .notifier_call = libfcoe_device_notification, }; +void __fcoe_get_lesb (struct fc_lport *lport, +struct fc_els_lesb *fc_lesb, +struct net_device *netdev) +{ +unsigned int cpu; +u32 lfc, vlfc, mdac; +struct fcoe_dev_stats *devst; +struct fcoe_fc_els_lesb *lesb; +struct rtnl_link_stats64 temp; + + lfc =0 ; + vlfc =0 ; + mdac =0 ; + lesb = (struct fcoe_fc_els_lesb *)fc_lesb; +memset (lesb,0 ,sizeof (*lesb)); +for_each_possible_cpu (cpu) { + devst =per_cpu_ptr (lport->dev_stats, cpu); + lfc += devst->LinkFailureCount; + vlfc += devst->VLinkFailureCount; + mdac += devst->MissDiscAdvCount; + } + lesb->lesb_link_fail =htonl (lfc); + lesb->lesb_vlink_fail =htonl (vlfc); + lesb->lesb_miss_fka =htonl (mdac); + lesb->lesb_fcs_error = +htonl (dev_get_stats (netdev, &temp)->rx_crc_errors); +} +EXPORT_SYMBOL_GPL (__fcoe_get_lesb); +void fcoe_wwn_to_str (u64 wwn,char *buf,int len) {u8 wwpn[8 ];include/scsi/libfcoe.h +2
-1@@ -230,6 +230,8 @@ int fcoe_libfc_config(struct fc_lport *, struct fcoe_ctlr *, u32 fcoe_fc_crc(struct fc_frame *fp);int fcoe_start_io (struct sk_buff *skb);int fcoe_get_wwn (struct net_device *netdev,u64 *wwn,int type); +void __fcoe_get_lesb (struct fc_lport *lport,struct fc_els_lesb *fc_lesb, +struct net_device *netdev);void fcoe_wwn_to_str (u64 wwn,char *buf,int len);int fcoe_validate_vport_create (struct fc_vport *vport); --1.7.0.6
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html