bnx2x feature patch series
cover bnx2x feature patch series
Hello Dave,
This patch series contains several small features to the bnx2x driver, as well as small changes which are mostly semantic, but make the driver's various flows more uniform.
Please consider applying it to 'net-next'.
Thanks,
Yuval
PATCH 1/8 bnx2x: move LLH_CAM to header, apply naming conventions
These definitions are united into the header.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 13 ++++--------- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h | 7 +++++++ 2 files changed, 11 insertions(+), 9 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +4 -9
@@ -611,12 +611,6 @@ static inline u8 bnx2x_vlan_mac_get_rx_tx_flag(struct bnx2x_vlan_mac_obj *o)return rx_tx_flag; } -/* LLH CAM line allocations */ -enum { -LLH_CAM_ISCSI_ETH_LINE =0 , -LLH_CAM_ETH_LINE , -LLH_CAM_MAX_PF_LINE =NIG_REG_LLH1_FUNC_MEM_SIZE /2 -};static inline void bnx2x_set_mac_in_nig (struct bnx2x *bp,bool add,unsigned char *dev_addr,int index)
@@ -625,7 +619,7 @@ static inline void bnx2x_set_mac_in_nig(struct bnx2x *bp,u32 reg_offset =BP_PORT (bp) ?NIG_REG_LLH1_FUNC_MEM :NIG_REG_LLH0_FUNC_MEM ; -if (!IS_MF_SI (bp) || index >LLH_CAM_MAX_PF_LINE ) +if (!IS_MF_SI (bp) || index >BNX2X_LLH_CAM_MAX_PF_LINE )return ; DP(BNX2X_MSG_SP, "Going to %s LLH configuration at entry %d\n",
@@ -731,9 +725,10 @@ static void bnx2x_set_one_mac_e2(struct bnx2x *bp,if (cmd !=BNX2X_VLAN_MAC_MOVE ) {if (test_bit (BNX2X_ISCSI_ETH_MAC , vlan_mac_flags))bnx2x_set_mac_in_nig (bp, add, mac, -LLH_CAM_ISCSI_ETH_LINE ); +BNX2X_LLH_CAM_ISCSI_ETH_LINE );else if (test_bit (BNX2X_ETH_MAC , vlan_mac_flags)) -bnx2x_set_mac_in_nig (bp, add, mac,LLH_CAM_ETH_LINE ); +bnx2x_set_mac_in_nig (bp, add, mac, +BNX2X_LLH_CAM_ETH_LINE ); }/* Reset the ramrod data buffer for the first rule */
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h +7 -0
@@ -423,6 +423,13 @@ struct bnx2x_vlan_mac_obj {int (*wait)(struct bnx2x *bp,struct bnx2x_vlan_mac_obj *o); }; +enum { +BNX2X_LLH_CAM_ISCSI_ETH_LINE =0 , +BNX2X_LLH_CAM_ETH_LINE , +BNX2X_LLH_CAM_MAX_PF_LINE =NIG_REG_LLH1_FUNC_MEM_SIZE /2 +}; + +/** RX_MODE verbs:DROP_ALL/ACCEPT_ALL/ACCEPT_ALL_MULTI/ACCEPT_ALL_VLAN/NORMAL */ /* RX_MODE ramrod spesial flags: set in rx_mode_flags field in
Signature · 1 line
1.7.9.rc2
PATCH 2/8 bnx2x: removed unused function bnx2x_queue_set_cos_cid
In reply to Yuval Mintz--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 7 ------- 1 files changed, 0 insertions(+), 7 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +0 -7
@@ -5181,13 +5181,6 @@ void bnx2x_init_queue_obj(struct bnx2x *bp, obj->set_pending = bnx2x_queue_set_pending; } -void bnx2x_queue_set_cos_cid (struct bnx2x *bp, -struct bnx2x_queue_sp_obj *obj, -u32 cid,u8 index) -{ - obj->cids[index] = cid; -} -/********************** Function state object *********************************/ enum bnx2x_func_state bnx2x_func_get_state (struct bnx2x *bp,struct bnx2x_func_sp_obj *o)
Signature · 1 line
1.7.9.rc2
PATCH 3/8 bnx2x: set_one_mac_e1x uses raw's state as input
In reply to Yuval MintzPreviously, we used a hard-coded value as paramater, instead of using the input's value. This is now remedied, as in other flows.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +1 -1
@@ -864,7 +864,7 @@ static void bnx2x_set_one_mac_e1x(struct bnx2x *bp,/* Reset the ramrod data buffer */ memset (config,0 ,sizeof (*config)); -bnx2x_vlan_mac_set_rdata_e1x (bp, o,BNX2X_FILTER_MAC_PENDING , +bnx2x_vlan_mac_set_rdata_e1x (bp, o, raw->state, cam_offset, add, elem->cmd_data.vlan_mac.u.mac.mac,0 ,ETH_VLAN_FILTER_ANY_VLAN , config);
Signature · 1 line
1.7.9.rc2
PATCH 4/8 bnx2x: use param's id instead of sp_obj's id
In reply to Yuval MintzPreviously, we've used the object's function id instead of using the input's value. This is remedied, as in other flows.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 1 + drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 2 +- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h | 3 +++ 3 files changed, 5 insertions(+), 1 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +1 -0
@@ -2800,6 +2800,7 @@ static void bnx2x_pf_rx_q_prep(struct bnx2x *bp, rxq_init->sge_buf_sz = sge_sz; rxq_init->max_sges_pkt = max_sge; rxq_init->rss_engine_id =BP_FUNC (bp); + rxq_init->mcast_engine_id =BP_FUNC (bp);/* Maximum number or simultaneous TPA aggregation for this Queue. *
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +1 -1
@@ -4473,7 +4473,7 @@ static void bnx2x_q_fill_init_rx_data(struct bnx2x_queue_sp_obj *o, rx_data->is_leading_rss =test_bit (BNX2X_Q_FLG_LEADING_RSS , flags);if (test_bit (BNX2X_Q_FLG_MCAST , flags)) { - rx_data->approx_mcast_engine_id = o->func_id; + rx_data->approx_mcast_engine_id = params->mcast_engine_id; rx_data->is_approx_mcast =1 ; }
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h +3 -0
@@ -897,6 +897,9 @@ struct bnx2x_rxq_setup_params {u8 max_tpa_queues;u8 rss_engine_id; +/* valid iff BNX2X_Q_FLG_MCAST */ +u8 mcast_engine_id; +u8 cache_line_log;u8 sb_cq_index;
Signature · 1 line
1.7.9.rc2
PATCH 5/8 bnx2x: mark functions as loaded on shared memory
In reply to Yuval MintzThis change enables the FW to make more accurate decisions regarding the active functions.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +17 -0
@@ -2007,6 +2007,15 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)bnx2x_cnic_notify (bp,CNIC_CTL_START_CMD );#endif +/* mark driver is loaded in shmem2 */ +if (SHMEM2_HAS (bp, drv_capabilities_flag)) { +u32 val; + val =SHMEM2_RD (bp, drv_capabilities_flag[BP_FW_MB_IDX (bp)]); +SHMEM2_WR (bp, drv_capabilities_flag[BP_FW_MB_IDX (bp)], + val |DRV_FLAGS_CAPABILITIES_LOADED_SUPPORTED | +DRV_FLAGS_CAPABILITIES_LOADED_L2 ); + } +/* Wait for all pending SP commands to complete */ if (!bnx2x_wait_sp_comp (bp, ~0x0UL )) {BNX2X_ERR ("Timeout waiting for SP elements to complete\n" );
@@ -2060,6 +2069,14 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode)int i;bool global = false; +/* mark driver is unloaded in shmem2 */ +if (SHMEM2_HAS (bp, drv_capabilities_flag)) { +u32 val; + val =SHMEM2_RD (bp, drv_capabilities_flag[BP_FW_MB_IDX (bp)]); +SHMEM2_WR (bp, drv_capabilities_flag[BP_FW_MB_IDX (bp)], + val & ~DRV_FLAGS_CAPABILITIES_LOADED_L2 ); + } +if ((bp->state ==BNX2X_STATE_CLOSED ) || (bp->state ==BNX2X_STATE_ERROR )) {/* We can get here if the driver has been unloaded
Signature · 1 line
1.7.9.rc2
PATCH 6/8 bnx2x: ethtool now returns unknown speed/duplex
In reply to Yuval MintzPreviously, unless both interface and link were up, ethtool returned the requested speed/duplex when asked for the interface's settings. This change will now enable the driver to answer correctly (i.e., return unknown as its answer).
--- .../net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 29 ++++++++++++------- 1 files changed, 18 insertions(+), 11 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +18 -11
@@ -222,20 +222,23 @@ static int bnx2x_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) (SUPPORTED_TP | SUPPORTED_FIBRE)); cmd->advertising = bp->port.advertising[cfg_idx]; -if ((bp->state ==BNX2X_STATE_OPEN ) && - !(bp->flags &MF_FUNC_DIS ) && - (bp->link_vars.link_up)) { -ethtool_cmd_speed_set (cmd, bp->link_vars.line_speed); - cmd->duplex = bp->link_vars.duplex; +if ((bp->state ==BNX2X_STATE_OPEN ) && (bp->link_vars.link_up)) { +if (!(bp->flags &MF_FUNC_DIS )) { +ethtool_cmd_speed_set (cmd, bp->link_vars.line_speed); + cmd->duplex = bp->link_vars.duplex; + }else { +ethtool_cmd_speed_set ( + cmd, bp->link_params.req_line_speed[cfg_idx]); + cmd->duplex = bp->link_params.req_duplex[cfg_idx]; + } + +if (IS_MF (bp) && !BP_NOMCP (bp)) +ethtool_cmd_speed_set (cmd,bnx2x_get_mf_speed (bp)); }else { -ethtool_cmd_speed_set ( - cmd, bp->link_params.req_line_speed[cfg_idx]); - cmd->duplex = bp->link_params.req_duplex[cfg_idx]; + cmd->duplex =DUPLEX_UNKNOWN ; +ethtool_cmd_speed_set (cmd,SPEED_UNKNOWN ); } -if (IS_MF (bp)) -ethtool_cmd_speed_set (cmd,bnx2x_get_mf_speed (bp)); - cmd->port =bnx2x_get_port_type (bp); cmd->phy_address = bp->mdio.prtad;
@@ -309,6 +312,10 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) speed =ethtool_cmd_speed (cmd); +/* If recieved a request for an unknown duplex, assume full*/ +if (cmd->duplex ==DUPLEX_UNKNOWN ) + cmd->duplex =DUPLEX_FULL ; +if (IS_MF_SI (bp)) {u32 part;u32 line_speed = bp->link_vars.line_speed;
Signature · 1 line
1.7.9.rc2
PATCH 7/8 bnx2x: ethtool returns req. AN even when AN fails
In reply to Yuval MintzPreviously, if autoneg failed, ethtool would return the achieved autoneg. This patch corrects this, causing ethtool to return the requested autoneg capabilities even if autoneg fails.
--- .../net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +1 -1
@@ -1450,7 +1450,7 @@ static void bnx2x_get_pauseparam(struct net_device *dev, BNX2X_FLOW_CTRL_AUTO);if (!epause->autoneg) - cfg_reg = bp->link_vars.flow_ctrl; + cfg_reg = bp->link_params.req_flow_ctrl[cfg_idx];else cfg_reg = bp->link_params.req_fc_auto_adv;
Signature · 1 line
1.7.9.rc2
PATCH 8/8 bnx2x: code doesn't use stats for allocating Rx BDs
In reply to Yuval MintzFrom: Dmitry Kravkov <[email protected]>
Previously, allocation used queue statistics directly in its calcualtion. This change causes these calculations to be summed into the statistics, without being affected by them.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 17 +++++++++-------- 1 files changed, 9 insertions(+), 8 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +9 -8
@@ -1143,7 +1143,7 @@ static inline int bnx2x_alloc_rx_bds(struct bnx2x_fastpath *fp, {struct bnx2x *bp = fp->bp;u16 ring_prod, cqe_ring_prod; -int i; +int i, failure_cnt =0 ; fp->rx_comp_cons =0 ; cqe_ring_prod = ring_prod =0 ;
@@ -1153,18 +1153,17 @@ static inline int bnx2x_alloc_rx_bds(struct bnx2x_fastpath *fp,*/ for (i =0 ; i < rx_ring_size; i++) {if (bnx2x_alloc_rx_data (bp, fp, ring_prod) <0 ) { - fp->eth_q_stats.rx_skb_alloc_failed++; + failure_cnt++;continue ; } ring_prod =NEXT_RX_IDX (ring_prod); cqe_ring_prod =NEXT_RCQ_IDX (cqe_ring_prod); -WARN_ON (ring_prod <= (i - fp->eth_q_stats.rx_skb_alloc_failed)); +WARN_ON (ring_prod <= (i - failure_cnt)); } -if (fp->eth_q_stats.rx_skb_alloc_failed) -BNX2X_ERR ("was only able to allocate " -"%d rx skbs on queue[%d]\n" , - (i - fp->eth_q_stats.rx_skb_alloc_failed), fp->index); +if (failure_cnt) +BNX2X_ERR ("was only able to allocate %d rx skbs on queue[%d]\n" , + i - failure_cnt, fp->index); fp->rx_bd_prod = ring_prod;/* Limit the CQE producer by the CQE ring size */
@@ -1172,7 +1171,9 @@ static inline int bnx2x_alloc_rx_bds(struct bnx2x_fastpath *fp, cqe_ring_prod); fp->rx_pkt = fp->rx_calls =0 ; -return i - fp->eth_q_stats.rx_skb_alloc_failed; + fp->eth_q_stats.rx_skb_alloc_failed += failure_cnt; + +return i - failure_cnt; }/* Statistics ID are global per chip/path, while Client IDs for E1x are per
Signature · 1 line
1.7.9.rc2
David Miller
maintainerFrom: "Yuval Mintz" <[email protected]>
Date: Mon, 12 Mar 2012 14:53:06 -0400
Quoted 5 lines
This patch series contains several small features to the bnx2x driver, as well as small changes which are mostly semantic, but make the driver's various flows more uniform.
Please consider applying it to 'net-next'.
All applied, thanks.