bnx2x, cnic: Consolidate iSCSI/FCoE shared mem logic in bnx2x
Subsystems (2)
PATCH 1/1 bnx2x, cnic: Consolidate iSCSI/FCoE shared mem logic in bnx2x
From: Vladislav Zolotarov <[email protected]>
Move all shared mem code to bnx2x to avoid code duplication. bnx2x now performs:
- Read the FCoE and iSCSI max connection information.
- Read the iSCSI and FCoE MACs from NPAR configuration in shmem.
- Block the CNIC for the current function if there is neither FCoE nor iSCSI valid configuration by returning NULL from bnx2x_cnic_probe().
--- drivers/net/bnx2.h | 2 + drivers/net/bnx2x/bnx2x.h | 5 +- drivers/net/bnx2x/bnx2x_hsi.h | 25 +++++--- drivers/net/bnx2x/bnx2x_main.c | 112 ++++++++++++++++++++++++++++---- drivers/net/cnic.c | 143 +++++----------------------------------- drivers/net/cnic_if.h | 8 ++- 6 files changed, 146 insertions(+), 149 deletions(-)
drivers/net/bnx2.h +2 -0
@@ -6207,6 +6207,8 @@ struct l2_fhdr {#define BNX2_CP_SCRATCH 0x001a0000 +#define BNX2_FW_MAX_ISCSI_CONN 0x001a0080 +/* * mcp_reg definition
drivers/net/bnx2x/bnx2x.h +4 -1
@@ -976,8 +976,12 @@ struct bnx2x {#define MF_FUNC_DIS 0x1000#define FCOE_MACS_SET 0x2000#define NO_FCOE_FLAG 0x4000 +#define NO_ISCSI_OOO_FLAG 0x8000 +#define NO_ISCSI_FLAG 0x10000#define NO_FCOE (bp) ((bp)->flags & NO_FCOE_FLAG) +#define NO_ISCSI (bp) ((bp)->flags & NO_ISCSI_FLAG) +#define NO_ISCSI_OOO (bp) ((bp)->flags & NO_ISCSI_OOO_FLAG)int pf_num;/* absolute PF number */ int pfid;/* per-path PF number */
@@ -1125,7 +1129,6 @@ struct bnx2x {u16 cnic_kwq_pending;u16 cnic_spq_pending;struct mutex cnic_mutex; -u8 iscsi_mac[ETH_ALEN ];u8 fip_mac[ETH_ALEN ];#endif
drivers/net/bnx2x/bnx2x_hsi.h +16 -9
@@ -11,20 +11,27 @@#include "bnx2x_fw_defs.h" +#define FW_ENCODE_32BIT_PATTERN 0x1e1e1e1e +struct license_key {u32 reserved[6 ]; -#if defined(__BIG_ENDIAN) -u16 max_iscsi_init_conn; -u16 max_iscsi_trgt_conn; -#elif defined(__LITTLE_ENDIAN) -u16 max_iscsi_trgt_conn; -u16 max_iscsi_init_conn; -#endif +u32 max_iscsi_conn; +#define BNX2X_MAX_ISCSI_TRGT_CONN_MASK 0xFFFF +#define BNX2X_MAX_ISCSI_TRGT_CONN_SHIFT 0 +#define BNX2X_MAX_ISCSI_INIT_CONN_MASK 0xFFFF0000 +#define BNX2X_MAX_ISCSI_INIT_CONN_SHIFT 16 -u32 reserved_a[6 ]; -}; +u32 reserved_a; + +u32 max_fcoe_conn; +#define BNX2X_MAX_FCOE_TRGT_CONN_MASK 0xFFFF +#define BNX2X_MAX_FCOE_TRGT_CONN_SHIFT 0 +#define BNX2X_MAX_FCOE_INIT_CONN_MASK 0xFFFF0000 +#define BNX2X_MAX_FCOE_INIT_CONN_SHIFT 16 +u32 reserved_b[4 ]; +};#define PORT_0 0#define PORT_1 1
drivers/net/bnx2x/bnx2x_main.c +100 -12
177 lines not on this page · raw message
drivers/net/cnic.c +18 -125
173 lines not on this page · raw message
drivers/net/cnic_if.h +6 -2
@@ -12,8 +12,8 @@#ifndef CNIC_IF_H #define CNIC_IF_H -#define CNIC_MODULE_VERSION "2.2.12" -#define CNIC_MODULE_RELDATE "Jan 03, 2011" +#define CNIC_MODULE_VERSION "2.2.13" +#define CNIC_MODULE_RELDATE "Jan 31, 2011"#define CNIC_ULP_RDMA 0#define CNIC_ULP_ISCSI 1
@@ -159,6 +159,9 @@ struct cnic_eth_dev {u32 drv_state;#define CNIC_DRV_STATE_REGD 0x00000001#define CNIC_DRV_STATE_USING_MSIX 0x00000002 +#define CNIC_DRV_STATE_NO_ISCSI_OOO 0x00000004 +#define CNIC_DRV_STATE_NO_ISCSI 0x00000008 +#define CNIC_DRV_STATE_NO_FCOE 0x00000010u32 chip_id;u32 max_kwqe_pending;struct pci_dev *pdev;
@@ -176,6 +179,7 @@ struct cnic_eth_dev {u32 fcoe_init_cid;u16 iscsi_l2_client_id;u16 iscsi_l2_cid; +u8 iscsi_mac[ETH_ALEN ];int num_irq;struct cnic_irq irq_arr[MAX_CNIC_VEC ];
Signature · 1 line
1.6.4.GIT
From: "Michael Chan" <[email protected]>
Date: Mon, 31 Jan 2011 16:39:17 -0800
Quoted 5 lines
From: Vladislav Zolotarov <[email protected]>
Move all shared mem code to bnx2x to avoid code duplication. bnx2x now performs:
Quoted 8 lines
- Read the FCoE and iSCSI max connection information.
- Read the iSCSI and FCoE MACs from NPAR configuration in shmem.
- Block the CNIC for the current function if there is neither FCoE nor iSCSI valid configuration by returning NULL frombnx2x_cnic_probe().Signed-off-by Vladislav Zolotarov <[email protected]>Signed-off-by Eilon Greenstein <[email protected]>Signed-off-by Michael Chan <[email protected]>
Applied, thanks.