Commit 619c5cb6 authored by Vlad Zolotarov's avatar Vlad Zolotarov Committed by David S. Miller

New 7.0 FW: bnx2x, cnic, bnx2i, bnx2fc

New FW/HSI (7.0):
 - Added support to 578xx chips
 - Improved HSI - much less driver's direct access to the FW internal
   memory needed.

New implementation of the HSI handling layer in the bnx2x (bnx2x_sp.c):
 - Introduced chip dependent objects that have chip independent interfaces
   for configuration of MACs, multicast addresses, Rx mode, indirection table,
   fast path queues and function initialization/cleanup.
 - Objects functionality is based on the private function pointers, which
   allows not only a per-chip but also PF/VF differentiation while still
   preserving the same interface towards the driver.
 - Objects interface is not influenced by the HSI changes which do not require
   providing new parameters keeping the code outside the bnx2x_sp.c invariant
   with regard to such HSI chnages.

Changes in a CNIC, bnx2fc and bnx2i modules due to the new HSI.
Signed-off-by: default avatarVladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: default avatarMichael Chan <mchan@broadcom.com>
Signed-off-by: default avatarBhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: default avatarEilon Greenstein <eilong@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@conan.davemloft.net>
parent 042181f5
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -55,15 +55,14 @@ static void bnx2x_pfc_set(struct bnx2x *bp) ...@@ -55,15 +55,14 @@ static void bnx2x_pfc_set(struct bnx2x *bp)
struct bnx2x_nig_brb_pfc_port_params pfc_params = {0}; struct bnx2x_nig_brb_pfc_port_params pfc_params = {0};
u32 pri_bit, val = 0; u32 pri_bit, val = 0;
u8 pri; u8 pri;
int i;
/* Tx COS configuration */ /* Tx COS configuration */
if (bp->dcbx_port_params.ets.cos_params[0].pauseable) for (i = 0; i < bp->dcbx_port_params.ets.num_of_cos; i++)
pfc_params.rx_cos0_priority_mask = if (bp->dcbx_port_params.ets.cos_params[i].pauseable)
bp->dcbx_port_params.ets.cos_params[0].pri_bitmask; pfc_params.rx_cos_priority_mask[i] =
if (bp->dcbx_port_params.ets.cos_params[1].pauseable) bp->dcbx_port_params.ets.
pfc_params.rx_cos1_priority_mask = cos_params[i].pri_bitmask;
bp->dcbx_port_params.ets.cos_params[1].pri_bitmask;
/** /**
* Rx COS configuration * Rx COS configuration
...@@ -378,7 +377,7 @@ static int bnx2x_dcbx_read_mib(struct bnx2x *bp, ...@@ -378,7 +377,7 @@ static int bnx2x_dcbx_read_mib(struct bnx2x *bp,
static void bnx2x_pfc_set_pfc(struct bnx2x *bp) static void bnx2x_pfc_set_pfc(struct bnx2x *bp)
{ {
if (CHIP_IS_E2(bp)) { if (!CHIP_IS_E1x(bp)) {
if (BP_PORT(bp)) { if (BP_PORT(bp)) {
BNX2X_ERR("4 port mode is not supported"); BNX2X_ERR("4 port mode is not supported");
return; return;
...@@ -406,7 +405,7 @@ static void bnx2x_dcbx_stop_hw_tx(struct bnx2x *bp) ...@@ -406,7 +405,7 @@ static void bnx2x_dcbx_stop_hw_tx(struct bnx2x *bp)
0 /* connectionless */, 0 /* connectionless */,
0 /* dataHi is zero */, 0 /* dataHi is zero */,
0 /* dataLo is zero */, 0 /* dataLo is zero */,
1 /* common */); NONE_CONNECTION_TYPE);
} }
static void bnx2x_dcbx_resume_hw_tx(struct bnx2x *bp) static void bnx2x_dcbx_resume_hw_tx(struct bnx2x *bp)
...@@ -417,7 +416,7 @@ static void bnx2x_dcbx_resume_hw_tx(struct bnx2x *bp) ...@@ -417,7 +416,7 @@ static void bnx2x_dcbx_resume_hw_tx(struct bnx2x *bp)
0, /* connectionless */ 0, /* connectionless */
U64_HI(bnx2x_sp_mapping(bp, pfc_config)), U64_HI(bnx2x_sp_mapping(bp, pfc_config)),
U64_LO(bnx2x_sp_mapping(bp, pfc_config)), U64_LO(bnx2x_sp_mapping(bp, pfc_config)),
1 /* commmon */); NONE_CONNECTION_TYPE);
} }
static void bnx2x_dcbx_update_ets_params(struct bnx2x *bp) static void bnx2x_dcbx_update_ets_params(struct bnx2x *bp)
...@@ -425,7 +424,7 @@ static void bnx2x_dcbx_update_ets_params(struct bnx2x *bp) ...@@ -425,7 +424,7 @@ static void bnx2x_dcbx_update_ets_params(struct bnx2x *bp)
struct bnx2x_dcbx_pg_params *ets = &(bp->dcbx_port_params.ets); struct bnx2x_dcbx_pg_params *ets = &(bp->dcbx_port_params.ets);
u8 status = 0; u8 status = 0;
bnx2x_ets_disabled(&bp->link_params); bnx2x_ets_disabled(&bp->link_params/*, &bp->link_vars*/);
if (!ets->enabled) if (!ets->enabled)
return; return;
...@@ -527,6 +526,7 @@ static int bnx2x_dcbx_read_shmem_neg_results(struct bnx2x *bp) ...@@ -527,6 +526,7 @@ static int bnx2x_dcbx_read_shmem_neg_results(struct bnx2x *bp)
BNX2X_ERR("FW doesn't support dcbx_neg_res_offset\n"); BNX2X_ERR("FW doesn't support dcbx_neg_res_offset\n");
return -EINVAL; return -EINVAL;
} }
rc = bnx2x_dcbx_read_mib(bp, (u32 *)&local_mib, dcbx_neg_res_offset, rc = bnx2x_dcbx_read_mib(bp, (u32 *)&local_mib, dcbx_neg_res_offset,
DCBX_READ_LOCAL_MIB); DCBX_READ_LOCAL_MIB);
...@@ -563,15 +563,6 @@ u8 bnx2x_dcbx_dcbnl_app_idtype(struct dcbx_app_priority_entry *ent) ...@@ -563,15 +563,6 @@ u8 bnx2x_dcbx_dcbnl_app_idtype(struct dcbx_app_priority_entry *ent)
DCB_APP_IDTYPE_ETHTYPE; DCB_APP_IDTYPE_ETHTYPE;
} }
static inline
void bnx2x_dcbx_invalidate_local_apps(struct bnx2x *bp)
{
int i;
for (i = 0; i < DCBX_MAX_APP_PROTOCOL; i++)
bp->dcbx_local_feat.app.app_pri_tbl[i].appBitfield &=
~DCBX_APP_ENTRY_VALID;
}
int bnx2x_dcbnl_update_applist(struct bnx2x *bp, bool delall) int bnx2x_dcbnl_update_applist(struct bnx2x *bp, bool delall)
{ {
int i, err = 0; int i, err = 0;
...@@ -597,32 +588,28 @@ int bnx2x_dcbnl_update_applist(struct bnx2x *bp, bool delall) ...@@ -597,32 +588,28 @@ int bnx2x_dcbnl_update_applist(struct bnx2x *bp, bool delall)
} }
#endif #endif
static inline void bnx2x_update_drv_flags(struct bnx2x *bp, u32 flags, u32 set)
{
if (SHMEM2_HAS(bp, drv_flags)) {
u32 drv_flags;
bnx2x_acquire_hw_lock(bp, HW_LOCK_DRV_FLAGS);
drv_flags = SHMEM2_RD(bp, drv_flags);
if (set)
SET_FLAGS(drv_flags, flags);
else
RESET_FLAGS(drv_flags, flags);
SHMEM2_WR(bp, drv_flags, drv_flags);
DP(NETIF_MSG_HW, "drv_flags 0x%08x\n", drv_flags);
bnx2x_release_hw_lock(bp, HW_LOCK_DRV_FLAGS);
}
}
void bnx2x_dcbx_set_params(struct bnx2x *bp, u32 state) void bnx2x_dcbx_set_params(struct bnx2x *bp, u32 state)
{ {
switch (state) { switch (state) {
case BNX2X_DCBX_STATE_NEG_RECEIVED: case BNX2X_DCBX_STATE_NEG_RECEIVED:
#ifdef BCM_CNIC
if (bp->state != BNX2X_STATE_OPENING_WAIT4_LOAD) {
struct cnic_ops *c_ops;
struct cnic_eth_dev *cp = &bp->cnic_eth_dev;
bp->flags |= NO_ISCSI_OOO_FLAG | NO_ISCSI_FLAG;
cp->drv_state |= CNIC_DRV_STATE_NO_ISCSI_OOO;
cp->drv_state |= CNIC_DRV_STATE_NO_ISCSI;
rcu_read_lock();
c_ops = rcu_dereference(bp->cnic_ops);
if (c_ops) {
bnx2x_cnic_notify(bp, CNIC_CTL_STOP_ISCSI_CMD);
rcu_read_unlock();
return;
}
rcu_read_unlock();
}
/* fall through if no CNIC initialized */
case BNX2X_DCBX_STATE_ISCSI_STOPPED:
#endif
{ {
DP(NETIF_MSG_LINK, "BNX2X_DCBX_STATE_NEG_RECEIVED\n"); DP(NETIF_MSG_LINK, "BNX2X_DCBX_STATE_NEG_RECEIVED\n");
#ifdef BCM_DCBNL #ifdef BCM_DCBNL
...@@ -646,7 +633,8 @@ void bnx2x_dcbx_set_params(struct bnx2x *bp, u32 state) ...@@ -646,7 +633,8 @@ void bnx2x_dcbx_set_params(struct bnx2x *bp, u32 state)
bnx2x_get_dcbx_drv_param(bp, &bp->dcbx_local_feat, bnx2x_get_dcbx_drv_param(bp, &bp->dcbx_local_feat,
bp->dcbx_error); bp->dcbx_error);
if (bp->state != BNX2X_STATE_OPENING_WAIT4_LOAD) { /* mark DCBX result for PMF migration */
bnx2x_update_drv_flags(bp, DRV_FLAGS_DCB_CONFIGURED, 1);
#ifdef BCM_DCBNL #ifdef BCM_DCBNL
/** /**
* Add new app tlvs to dcbnl * Add new app tlvs to dcbnl
...@@ -654,33 +642,19 @@ void bnx2x_dcbx_set_params(struct bnx2x *bp, u32 state) ...@@ -654,33 +642,19 @@ void bnx2x_dcbx_set_params(struct bnx2x *bp, u32 state)
bnx2x_dcbnl_update_applist(bp, false); bnx2x_dcbnl_update_applist(bp, false);
#endif #endif
bnx2x_dcbx_stop_hw_tx(bp); bnx2x_dcbx_stop_hw_tx(bp);
return; return;
} }
/* fall through */
#ifdef BCM_DCBNL
/**
* Invalidate the local app tlvs if they are not added
* to the dcbnl app list to avoid deleting them from
* the list later on
*/
bnx2x_dcbx_invalidate_local_apps(bp);
#endif
}
case BNX2X_DCBX_STATE_TX_PAUSED: case BNX2X_DCBX_STATE_TX_PAUSED:
DP(NETIF_MSG_LINK, "BNX2X_DCBX_STATE_TX_PAUSED\n"); DP(NETIF_MSG_LINK, "BNX2X_DCBX_STATE_TX_PAUSED\n");
bnx2x_pfc_set_pfc(bp); bnx2x_pfc_set_pfc(bp);
bnx2x_dcbx_update_ets_params(bp); bnx2x_dcbx_update_ets_params(bp);
if (bp->state != BNX2X_STATE_OPENING_WAIT4_LOAD) {
bnx2x_dcbx_resume_hw_tx(bp); bnx2x_dcbx_resume_hw_tx(bp);
return; return;
}
/* fall through */
case BNX2X_DCBX_STATE_TX_RELEASED: case BNX2X_DCBX_STATE_TX_RELEASED:
DP(NETIF_MSG_LINK, "BNX2X_DCBX_STATE_TX_RELEASED\n"); DP(NETIF_MSG_LINK, "BNX2X_DCBX_STATE_TX_RELEASED\n");
if (bp->state != BNX2X_STATE_OPENING_WAIT4_LOAD)
bnx2x_fw_command(bp, DRV_MSG_CODE_DCBX_PMF_DRV_OK, 0); bnx2x_fw_command(bp, DRV_MSG_CODE_DCBX_PMF_DRV_OK, 0);
return; return;
default: default:
BNX2X_ERR("Unknown DCBX_STATE\n"); BNX2X_ERR("Unknown DCBX_STATE\n");
...@@ -868,7 +842,7 @@ static void bnx2x_dcbx_admin_mib_updated_params(struct bnx2x *bp, ...@@ -868,7 +842,7 @@ static void bnx2x_dcbx_admin_mib_updated_params(struct bnx2x *bp,
void bnx2x_dcbx_set_state(struct bnx2x *bp, bool dcb_on, u32 dcbx_enabled) void bnx2x_dcbx_set_state(struct bnx2x *bp, bool dcb_on, u32 dcbx_enabled)
{ {
if (CHIP_IS_E2(bp) && !CHIP_MODE_IS_4_PORT(bp)) { if (!CHIP_IS_E1x(bp) && !CHIP_MODE_IS_4_PORT(bp)) {
bp->dcb_state = dcb_on; bp->dcb_state = dcb_on;
bp->dcbx_enabled = dcbx_enabled; bp->dcbx_enabled = dcbx_enabled;
} else { } else {
...@@ -974,6 +948,8 @@ void bnx2x_dcbx_init(struct bnx2x *bp) ...@@ -974,6 +948,8 @@ void bnx2x_dcbx_init(struct bnx2x *bp)
DP(NETIF_MSG_LINK, "dcbx_lldp_params_offset 0x%x\n", DP(NETIF_MSG_LINK, "dcbx_lldp_params_offset 0x%x\n",
dcbx_lldp_params_offset); dcbx_lldp_params_offset);
bnx2x_update_drv_flags(bp, DRV_FLAGS_DCB_CONFIGURED, 0);
if (SHMEM_LLDP_DCBX_PARAMS_NONE != dcbx_lldp_params_offset) { if (SHMEM_LLDP_DCBX_PARAMS_NONE != dcbx_lldp_params_offset) {
bnx2x_dcbx_lldp_updated_params(bp, bnx2x_dcbx_lldp_updated_params(bp,
dcbx_lldp_params_offset); dcbx_lldp_params_offset);
...@@ -981,46 +957,12 @@ void bnx2x_dcbx_init(struct bnx2x *bp) ...@@ -981,46 +957,12 @@ void bnx2x_dcbx_init(struct bnx2x *bp)
bnx2x_dcbx_admin_mib_updated_params(bp, bnx2x_dcbx_admin_mib_updated_params(bp,
dcbx_lldp_params_offset); dcbx_lldp_params_offset);
/* set default configuration BC has */ /* Let HW start negotiation */
bnx2x_dcbx_set_params(bp,
BNX2X_DCBX_STATE_NEG_RECEIVED);
bnx2x_fw_command(bp, bnx2x_fw_command(bp,
DRV_MSG_CODE_DCBX_ADMIN_PMF_MSG, 0); DRV_MSG_CODE_DCBX_ADMIN_PMF_MSG, 0);
} }
} }
} }
void bnx2x_dcb_init_intmem_pfc(struct bnx2x *bp)
{
struct priority_cos pricos[MAX_PFC_TRAFFIC_TYPES];
u32 i = 0, addr;
memset(pricos, 0, sizeof(pricos));
/* Default initialization */
for (i = 0; i < MAX_PFC_TRAFFIC_TYPES; i++)
pricos[i].priority = LLFC_TRAFFIC_TYPE_TO_PRIORITY_UNMAPPED;
/* Store per port struct to internal memory */
addr = BAR_XSTRORM_INTMEM +
XSTORM_CMNG_PER_PORT_VARS_OFFSET(BP_PORT(bp)) +
offsetof(struct cmng_struct_per_port,
traffic_type_to_priority_cos);
__storm_memset_struct(bp, addr, sizeof(pricos), (u32 *)pricos);
/* LLFC disabled.*/
REG_WR8(bp , BAR_XSTRORM_INTMEM +
XSTORM_CMNG_PER_PORT_VARS_OFFSET(BP_PORT(bp)) +
offsetof(struct cmng_struct_per_port, llfc_mode),
LLFC_MODE_NONE);
/* DCBX disabled.*/
REG_WR8(bp , BAR_XSTRORM_INTMEM +
XSTORM_CMNG_PER_PORT_VARS_OFFSET(BP_PORT(bp)) +
offsetof(struct cmng_struct_per_port, dcb_enabled),
DCB_DISABLED);
}
static void static void
bnx2x_dcbx_print_cos_params(struct bnx2x *bp, bnx2x_dcbx_print_cos_params(struct bnx2x *bp,
struct flow_control_configuration *pfc_fw_cfg) struct flow_control_configuration *pfc_fw_cfg)
...@@ -1591,13 +1533,7 @@ static void bnx2x_pfc_fw_struct_e2(struct bnx2x *bp) ...@@ -1591,13 +1533,7 @@ static void bnx2x_pfc_fw_struct_e2(struct bnx2x *bp)
/* Fw version should be incremented each update */ /* Fw version should be incremented each update */
pfc_fw_cfg->dcb_version = ++bp->dcb_version; pfc_fw_cfg->dcb_version = ++bp->dcb_version;
pfc_fw_cfg->dcb_enabled = DCB_ENABLED; pfc_fw_cfg->dcb_enabled = 1;
/* Default initialization */
for (pri = 0; pri < MAX_PFC_TRAFFIC_TYPES ; pri++) {
tt2cos[pri].priority = LLFC_TRAFFIC_TYPE_TO_PRIORITY_UNMAPPED;
tt2cos[pri].cos = 0;
}
/* Fill priority parameters */ /* Fill priority parameters */
for (pri = 0; pri < LLFC_DRIVER_TRAFFIC_TYPE_MAX; pri++) { for (pri = 0; pri < LLFC_DRIVER_TRAFFIC_TYPE_MAX; pri++) {
...@@ -1605,14 +1541,37 @@ static void bnx2x_pfc_fw_struct_e2(struct bnx2x *bp) ...@@ -1605,14 +1541,37 @@ static void bnx2x_pfc_fw_struct_e2(struct bnx2x *bp)
pri_bit = 1 << tt2cos[pri].priority; pri_bit = 1 << tt2cos[pri].priority;
/* Fill COS parameters based on COS calculated to /* Fill COS parameters based on COS calculated to
* make it more generally for future use */ * make it more general for future use */
for (cos = 0; cos < bp->dcbx_port_params.ets.num_of_cos; cos++) for (cos = 0; cos < bp->dcbx_port_params.ets.num_of_cos; cos++)
if (bp->dcbx_port_params.ets.cos_params[cos]. if (bp->dcbx_port_params.ets.cos_params[cos].
pri_bitmask & pri_bit) pri_bitmask & pri_bit)
tt2cos[pri].cos = cos; tt2cos[pri].cos = cos;
} }
/* we never want the FW to add a 0 vlan tag */
pfc_fw_cfg->dont_add_pri_0_en = 1;
bnx2x_dcbx_print_cos_params(bp, pfc_fw_cfg); bnx2x_dcbx_print_cos_params(bp, pfc_fw_cfg);
} }
void bnx2x_dcbx_pmf_update(struct bnx2x *bp)
{
/* if we need to syncronize DCBX result from prev PMF
* read it from shmem and update bp accordingly
*/
if (SHMEM2_HAS(bp, drv_flags) &&
GET_FLAGS(SHMEM2_RD(bp, drv_flags), DRV_FLAGS_DCB_CONFIGURED)) {
/* Read neg results if dcbx is in the FW */
if (bnx2x_dcbx_read_shmem_neg_results(bp))
return;
bnx2x_dump_dcbx_drv_param(bp, &bp->dcbx_local_feat,
bp->dcbx_error);
bnx2x_get_dcbx_drv_param(bp, &bp->dcbx_local_feat,
bp->dcbx_error);
}
}
/* DCB netlink */ /* DCB netlink */
#ifdef BCM_DCBNL #ifdef BCM_DCBNL
......
...@@ -179,9 +179,6 @@ void bnx2x_dcbx_set_state(struct bnx2x *bp, bool dcb_on, u32 dcbx_enabled); ...@@ -179,9 +179,6 @@ void bnx2x_dcbx_set_state(struct bnx2x *bp, bool dcb_on, u32 dcbx_enabled);
enum { enum {
BNX2X_DCBX_STATE_NEG_RECEIVED = 0x1, BNX2X_DCBX_STATE_NEG_RECEIVED = 0x1,
#ifdef BCM_CNIC
BNX2X_DCBX_STATE_ISCSI_STOPPED,
#endif
BNX2X_DCBX_STATE_TX_PAUSED, BNX2X_DCBX_STATE_TX_PAUSED,
BNX2X_DCBX_STATE_TX_RELEASED BNX2X_DCBX_STATE_TX_RELEASED
}; };
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
#include <linux/mutex.h> #include <linux/mutex.h>
#include "bnx2x.h" #include "bnx2x.h"
#include "bnx2x_cmn.h"
/********************************************************/ /********************************************************/
#define ETH_HLEN 14 #define ETH_HLEN 14
...@@ -874,6 +876,54 @@ static void bnx2x_update_pfc_brb(struct link_params *params, ...@@ -874,6 +876,54 @@ static void bnx2x_update_pfc_brb(struct link_params *params,
} }
} }
/******************************************************************************
* Description:
* This function is needed because NIG ARB_CREDIT_WEIGHT_X are
* not continues and ARB_CREDIT_WEIGHT_0 + offset is suitable.
******************************************************************************/
int bnx2x_pfc_nig_rx_priority_mask(struct bnx2x *bp,
u8 cos_entry,
u32 priority_mask, u8 port)
{
u32 nig_reg_rx_priority_mask_add = 0;
switch (cos_entry) {
case 0:
nig_reg_rx_priority_mask_add = (port) ?
NIG_REG_P1_RX_COS0_PRIORITY_MASK :
NIG_REG_P0_RX_COS0_PRIORITY_MASK;
break;
case 1:
nig_reg_rx_priority_mask_add = (port) ?
NIG_REG_P1_RX_COS1_PRIORITY_MASK :
NIG_REG_P0_RX_COS1_PRIORITY_MASK;
break;
case 2:
nig_reg_rx_priority_mask_add = (port) ?
NIG_REG_P1_RX_COS2_PRIORITY_MASK :
NIG_REG_P0_RX_COS2_PRIORITY_MASK;
break;
case 3:
if (port)
return -EINVAL;
nig_reg_rx_priority_mask_add = NIG_REG_P0_RX_COS3_PRIORITY_MASK;
break;
case 4:
if (port)
return -EINVAL;
nig_reg_rx_priority_mask_add = NIG_REG_P0_RX_COS4_PRIORITY_MASK;
break;
case 5:
if (port)
return -EINVAL;
nig_reg_rx_priority_mask_add = NIG_REG_P0_RX_COS5_PRIORITY_MASK;
break;
}
REG_WR(bp, nig_reg_rx_priority_mask_add, priority_mask);
return 0;
}
static void bnx2x_update_pfc_nig(struct link_params *params, static void bnx2x_update_pfc_nig(struct link_params *params,
struct link_vars *vars, struct link_vars *vars,
struct bnx2x_nig_brb_pfc_port_params *nig_params) struct bnx2x_nig_brb_pfc_port_params *nig_params)
...@@ -958,15 +1008,12 @@ static void bnx2x_update_pfc_nig(struct link_params *params, ...@@ -958,15 +1008,12 @@ static void bnx2x_update_pfc_nig(struct link_params *params,
REG_WR(bp, NIG_REG_EGRESS_EMAC0_PORT, val); REG_WR(bp, NIG_REG_EGRESS_EMAC0_PORT, val);
if (nig_params) { if (nig_params) {
u8 i = 0;
pkt_priority_to_cos = nig_params->pkt_priority_to_cos; pkt_priority_to_cos = nig_params->pkt_priority_to_cos;
REG_WR(bp, port ? NIG_REG_P1_RX_COS0_PRIORITY_MASK : for (i = 0; i < nig_params->num_of_rx_cos_priority_mask; i++)
NIG_REG_P0_RX_COS0_PRIORITY_MASK, bnx2x_pfc_nig_rx_priority_mask(bp, i,
nig_params->rx_cos0_priority_mask); nig_params->rx_cos_priority_mask[i], port);
REG_WR(bp, port ? NIG_REG_P1_RX_COS1_PRIORITY_MASK :
NIG_REG_P0_RX_COS1_PRIORITY_MASK,
nig_params->rx_cos1_priority_mask);
REG_WR(bp, port ? NIG_REG_LLFC_HIGH_PRIORITY_CLASSES_1 : REG_WR(bp, port ? NIG_REG_LLFC_HIGH_PRIORITY_CLASSES_1 :
NIG_REG_LLFC_HIGH_PRIORITY_CLASSES_0, NIG_REG_LLFC_HIGH_PRIORITY_CLASSES_0,
...@@ -1824,26 +1871,6 @@ void bnx2x_link_status_update(struct link_params *params, ...@@ -1824,26 +1871,6 @@ void bnx2x_link_status_update(struct link_params *params,
vars->line_speed = SPEED_10000; vars->line_speed = SPEED_10000;
break; break;
case LINK_12GTFD:
vars->line_speed = SPEED_12000;
break;
case LINK_12_5GTFD:
vars->line_speed = SPEED_12500;
break;
case LINK_13GTFD:
vars->line_speed = SPEED_13000;
break;
case LINK_15GTFD:
vars->line_speed = SPEED_15000;
break;
case LINK_16GTFD:
vars->line_speed = SPEED_16000;
break;
default: default:
break; break;
} }
...@@ -2667,31 +2694,6 @@ static int bnx2x_link_settings_status(struct bnx2x_phy *phy, ...@@ -2667,31 +2694,6 @@ static int bnx2x_link_settings_status(struct bnx2x_phy *phy,
vars->link_status |= LINK_10GTFD; vars->link_status |= LINK_10GTFD;
break; break;
case GP_STATUS_12G_HIG:
new_line_speed = SPEED_12000;
vars->link_status |= LINK_12GTFD;
break;
case GP_STATUS_12_5G:
new_line_speed = SPEED_12500;
vars->link_status |= LINK_12_5GTFD;
break;
case GP_STATUS_13G:
new_line_speed = SPEED_13000;
vars->link_status |= LINK_13GTFD;
break;
case GP_STATUS_15G:
new_line_speed = SPEED_15000;
vars->link_status |= LINK_15GTFD;
break;
case GP_STATUS_16G:
new_line_speed = SPEED_16000;
vars->link_status |= LINK_16GTFD;
break;
default: default:
DP(NETIF_MSG_LINK, DP(NETIF_MSG_LINK,
"link speed unsupported gp_status 0x%x\n", "link speed unsupported gp_status 0x%x\n",
......
...@@ -81,6 +81,7 @@ ...@@ -81,6 +81,7 @@
#define PFC_BRB_FULL_LB_XOFF_THRESHOLD 170 #define PFC_BRB_FULL_LB_XOFF_THRESHOLD 170
#define PFC_BRB_FULL_LB_XON_THRESHOLD 250 #define PFC_BRB_FULL_LB_XON_THRESHOLD 250
#define MAXVAL(a, b) (((a) > (b)) ? (a) : (b))
/***********************************************************/ /***********************************************************/
/* Structs */ /* Structs */
/***********************************************************/ /***********************************************************/
...@@ -262,6 +263,8 @@ struct link_vars { ...@@ -262,6 +263,8 @@ struct link_vars {
#define MAC_TYPE_NONE 0 #define MAC_TYPE_NONE 0
#define MAC_TYPE_EMAC 1 #define MAC_TYPE_EMAC 1
#define MAC_TYPE_BMAC 2 #define MAC_TYPE_BMAC 2
#define MAC_TYPE_UMAC 3
#define MAC_TYPE_XMAC 4
u8 phy_link_up; /* internal phy link indication */ u8 phy_link_up; /* internal phy link indication */
u8 link_up; u8 link_up;
...@@ -363,6 +366,20 @@ int bnx2x_phy_probe(struct link_params *params); ...@@ -363,6 +366,20 @@ int bnx2x_phy_probe(struct link_params *params);
u8 bnx2x_fan_failure_det_req(struct bnx2x *bp, u32 shmem_base, u8 bnx2x_fan_failure_det_req(struct bnx2x *bp, u32 shmem_base,
u32 shmem2_base, u8 port); u32 shmem2_base, u8 port);
/* DCBX structs */
/* Number of maximum COS per chip */
#define DCBX_E2E3_MAX_NUM_COS (2)
#define DCBX_E3B0_MAX_NUM_COS_PORT0 (6)
#define DCBX_E3B0_MAX_NUM_COS_PORT1 (3)
#define DCBX_E3B0_MAX_NUM_COS ( \
MAXVAL(DCBX_E3B0_MAX_NUM_COS_PORT0, \
DCBX_E3B0_MAX_NUM_COS_PORT1))
#define DCBX_MAX_NUM_COS ( \
MAXVAL(DCBX_E3B0_MAX_NUM_COS, \
DCBX_E2E3_MAX_NUM_COS))
/* PFC port configuration params */ /* PFC port configuration params */
struct bnx2x_nig_brb_pfc_port_params { struct bnx2x_nig_brb_pfc_port_params {
/* NIG */ /* NIG */
...@@ -370,8 +387,8 @@ struct bnx2x_nig_brb_pfc_port_params { ...@@ -370,8 +387,8 @@ struct bnx2x_nig_brb_pfc_port_params {
u32 llfc_out_en; u32 llfc_out_en;
u32 llfc_enable; u32 llfc_enable;
u32 pkt_priority_to_cos; u32 pkt_priority_to_cos;
u32 rx_cos0_priority_mask; u8 num_of_rx_cos_priority_mask;
u32 rx_cos1_priority_mask; u32 rx_cos_priority_mask[DCBX_MAX_NUM_COS];
u32 llfc_high_priority_classes; u32 llfc_high_priority_classes;
u32 llfc_low_priority_classes; u32 llfc_low_priority_classes;
/* BRB */ /* BRB */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
#ifndef CNIC_IF_H #ifndef CNIC_IF_H
#define CNIC_IF_H #define CNIC_IF_H
#define CNIC_MODULE_VERSION "2.2.14" #define CNIC_MODULE_VERSION "2.5.3"
#define CNIC_MODULE_RELDATE "Mar 30, 2011" #define CNIC_MODULE_RELDATE "June 6, 2011"
#define CNIC_ULP_RDMA 0 #define CNIC_ULP_RDMA 0
#define CNIC_ULP_ISCSI 1 #define CNIC_ULP_ISCSI 1
...@@ -99,6 +99,8 @@ struct kcqe { ...@@ -99,6 +99,8 @@ struct kcqe {
struct cnic_ctl_completion { struct cnic_ctl_completion {
u32 cid; u32 cid;
u8 opcode;
u8 error;
}; };
struct cnic_ctl_info { struct cnic_ctl_info {
...@@ -169,7 +171,7 @@ struct cnic_eth_dev { ...@@ -169,7 +171,7 @@ struct cnic_eth_dev {
struct pci_dev *pdev; struct pci_dev *pdev;
void __iomem *io_base; void __iomem *io_base;
void __iomem *io_base2; void __iomem *io_base2;
void *iro_arr; const void *iro_arr;
u32 ctx_tbl_offset; u32 ctx_tbl_offset;
u32 ctx_tbl_len; u32 ctx_tbl_len;
......
This diff is collapsed.
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
#include "bnx2fc_constants.h" #include "bnx2fc_constants.h"
#define BNX2FC_NAME "bnx2fc" #define BNX2FC_NAME "bnx2fc"
#define BNX2FC_VERSION "1.0.1" #define BNX2FC_VERSION "1.0.3"
#define PFX "bnx2fc: " #define PFX "bnx2fc: "
...@@ -262,9 +262,14 @@ struct bnx2fc_rport { ...@@ -262,9 +262,14 @@ struct bnx2fc_rport {
#define BNX2FC_FLAG_UPLD_REQ_COMPL 0x8 #define BNX2FC_FLAG_UPLD_REQ_COMPL 0x8
#define BNX2FC_FLAG_EXPL_LOGO 0x9 #define BNX2FC_FLAG_EXPL_LOGO 0x9
u8 src_addr[ETH_ALEN];
u32 max_sqes; u32 max_sqes;
u32 max_rqes; u32 max_rqes;
u32 max_cqes; u32 max_cqes;
atomic_t free_sqes;
struct b577xx_doorbell_set_prod sq_db;
struct b577xx_fcoe_rx_doorbell rx_db;
struct fcoe_sqe *sq; struct fcoe_sqe *sq;
dma_addr_t sq_dma; dma_addr_t sq_dma;
...@@ -274,7 +279,7 @@ struct bnx2fc_rport { ...@@ -274,7 +279,7 @@ struct bnx2fc_rport {
struct fcoe_cqe *cq; struct fcoe_cqe *cq;
dma_addr_t cq_dma; dma_addr_t cq_dma;
u32 cq_cons_idx; u16 cq_cons_idx;
u8 cq_curr_toggle_bit; u8 cq_curr_toggle_bit;
u32 cq_mem_size; u32 cq_mem_size;
...@@ -505,6 +510,7 @@ struct fc_seq *bnx2fc_elsct_send(struct fc_lport *lport, u32 did, ...@@ -505,6 +510,7 @@ struct fc_seq *bnx2fc_elsct_send(struct fc_lport *lport, u32 did,
struct fc_frame *, struct fc_frame *,
void *), void *),
void *arg, u32 timeout); void *arg, u32 timeout);
void bnx2fc_arm_cq(struct bnx2fc_rport *tgt);
int bnx2fc_process_new_cqes(struct bnx2fc_rport *tgt); int bnx2fc_process_new_cqes(struct bnx2fc_rport *tgt);
void bnx2fc_process_cq_compl(struct bnx2fc_rport *tgt, u16 wqe); void bnx2fc_process_cq_compl(struct bnx2fc_rport *tgt, u16 wqe);
struct bnx2fc_rport *bnx2fc_tgt_lookup(struct fcoe_port *port, struct bnx2fc_rport *bnx2fc_tgt_lookup(struct fcoe_port *port,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment