bnx2x: Enhancements & semantic changes series
cover bnx2x: Enhancements & semantic changes series
Hi Dave,
This patch series contains several semantic (or mostly semantic) patches, as well as adding support for packet aggregations on the receive path of windows VMs and updating bnx2x to the new FW recently accepted upstream.
Please consider applying these patches to `net-next'.
Thanks,
Yuval Mintz
PATCH 1/9 bnx2x: [Debug] change verbosity of some prints
There are some debug prints (mostly iov/statistics related) which clobber system logs whenever their verbosity level is set for an interface. This patch puts harsher verbosity requirements for such debug prints to be printed.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 17 +++++++++++++---- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 6 +++--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 17 +++++++++-------- 3 files changed, 25 insertions(+), 15 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +13 -4
@@ -75,13 +75,22 @@ enum bnx2x_int_mode {#define BNX2X_MSG_DCB 0x8000000/* regular debug print */ +#define DP_INNER (fmt, ...) \ + pr_notice("[%s:%d(%s)]" fmt, \ + __func__, __LINE__, \ + bp->dev ? (bp->dev->name) : "?", \ + ##__VA_ARGS__); +#define DP (__mask, fmt, ...) \ do { \ if (unlikely(bp->msg_enable & (__mask))) \ - pr_notice("[%s:%d(%s)]" fmt, \ - __func__, __LINE__, \ - bp->dev ? (bp->dev->name) : "?", \ - ##__VA_ARGS__); \ + DP_INNER(fmt, ##__VA_ARGS__); \ +} while (0) + +#define DP_AND (__mask, fmt, ...) \ +do { \ + if (unlikely((bp->msg_enable & (__mask)) == __mask)) \ + DP_INNER(fmt, ##__VA_ARGS__); \ } while (0)#define DP_CONT (__mask, fmt, ...) \
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +3 -3
@@ -5221,9 +5221,9 @@ static void bnx2x_eq_int(struct bnx2x *bp)continue ;case EVENT_RING_OPCODE_STAT_QUERY : -DP (BNX2X_MSG_SP |BNX2X_MSG_STATS , -"got statistics comp event %d\n" , - bp->stats_comp++); +DP_AND ((BNX2X_MSG_SP |BNX2X_MSG_STATS ), +"got statistics comp event %d\n" , + bp->stats_comp++);/* nothing to do with stats comp */ goto next_spqe;
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +9 -8
@@ -2527,10 +2527,10 @@ void bnx2x_iov_adjust_stats_req(struct bnx2x *bp) first_queue_query_index =BNX2X_FIRST_QUEUE_QUERY_IDX - (is_fcoe ?0 :1 ); -DP (BNX2X_MSG_IOV , -"BNX2X_NUM_ETH_QUEUES %d, is_fcoe %d, first_queue_query_index %d => determined the last non virtual statistics query index is %d. Will add queries on top of that\n" , -BNX2X_NUM_ETH_QUEUES (bp), is_fcoe, first_queue_query_index, - first_queue_query_index + num_queues_req); +DP_AND ((BNX2X_MSG_IOV |BNX2X_MSG_STATS ), +"BNX2X_NUM_ETH_QUEUES %d, is_fcoe %d, first_queue_query_index %d => determined the last non virtual statistics query index is %d. Will add queries on top of that\n" , +BNX2X_NUM_ETH_QUEUES (bp), is_fcoe, first_queue_query_index, + first_queue_query_index + num_queues_req); cur_data_offset = bp->fw_stats_data_mapping + offsetof(struct bnx2x_fw_stats_data, queue_stats) +
@@ -2544,9 +2544,9 @@ void bnx2x_iov_adjust_stats_req(struct bnx2x *bp)struct bnx2x_virtf *vf =BP_VF (bp, i);if (vf->state !=VF_ENABLED ) { -DP (BNX2X_MSG_IOV , -"vf %d not enabled so no stats for it\n" , - vf->abs_vfid); +DP_AND ((BNX2X_MSG_IOV |BNX2X_MSG_STATS ), +"vf %d not enabled so no stats for it\n" , + vf->abs_vfid);continue ; }
@@ -2597,7 +2597,8 @@ void bnx2x_iov_sp_task(struct bnx2x *bp)/* Iterate over all VFs and invoke state transition for VFs with * 'in-progress' slow-path operations */ -DP (BNX2X_MSG_IOV ,"searching for pending vf operations\n" ); +DP_AND ((BNX2X_MSG_IOV |BNX2X_MSG_SP ), +"searching for pending vf operations\n" );for_each_vf (bp, i) {struct bnx2x_virtf *vf =BP_VF (bp, i);
Signature · 1 line
1.8.1.227.g44fe835
PATCH 2/9 bnx2x: Remove unused iov code
In reply to Yuval Mintz--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 10 ---------- 1 file changed, 10 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +0 -10
@@ -3075,16 +3075,6 @@ static inline void bnx2x_vf_get_sbdf(struct bnx2x *bp, *sbdf = vf->devfn | (vf->bus <<8 ); } -static inline void bnx2x_vf_get_bars (struct bnx2x *bp,struct bnx2x_virtf *vf, -struct bnx2x_vf_bar_info *bar_info) -{ -int n; - - bar_info->nr_bars = bp->vfdb->sriov.nres; -for (n =0 ; n < bar_info->nr_bars; n++) - bar_info->bars[n] = vf->bars[n]; -} -void bnx2x_lock_vf_pf_channel (struct bnx2x *bp,struct bnx2x_virtf *vf,enum channel_tlvs tlv) {
Signature · 1 line
1.8.1.227.g44fe835
PATCH 3/9 bnx2x: Remove unnecessary internal mem config
In reply to Yuval MintzFrom: Ariel Elior <[email protected]>
Latest FW performs this autonomously, makes this code surplus.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h | 1 - drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 12 ------------ 2 files changed, 13 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h +0 -1
@@ -87,7 +87,6 @@ (IRO[156].base + ((vfId) * IRO[156].m1))#define CSTORM_VF_TO_PF_OFFSET (funcId) \ (IRO[150].base + ((funcId) * IRO[150].m1)) -#define TSTORM_ACCEPT_CLASSIFY_FAILED_OFFSET (IRO[204].base)#define TSTORM_APPROXIMATE_MATCH_MULTICAST_FILTERING_OFFSET (pfId) \ (IRO[203].base + ((pfId) * IRO[203].m1))#define TSTORM_ASSERT_LIST_INDEX_OFFSET (IRO[102].base)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +0 -12
@@ -6005,18 +6005,6 @@ static void bnx2x_init_internal_common(struct bnx2x *bp) {int i; -if (IS_MF_SI (bp)) -/* -* In switch independent mode, the TSTORM needs to accept -* packets that failed classification, since approximate match -* mac addresses aren't written to NIG LLH -*/ -REG_WR8 (bp,BAR_TSTRORM_INTMEM + -TSTORM_ACCEPT_CLASSIFY_FAILED_OFFSET ,2 ); -else if (!CHIP_IS_E1 (bp))/* 57710 doesn't support MF */ -REG_WR8 (bp,BAR_TSTRORM_INTMEM + -TSTORM_ACCEPT_CLASSIFY_FAILED_OFFSET ,0 ); -/* Zero this manually as its initialization is currently missing in the initTool */ for (i =0 ; i < (USTORM_AGG_DATA_SIZE >>2 ); i++)
Signature · 1 line
1.8.1.227.g44fe835
PATCH 4/9 bnx2x: Semantic Validate vlan/mac changes
In reply to Yuval MintzThis is purely semantic - break the flow in which PF validates the VF classification filtering requirement is valid into several sub-functions for better readable code.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c | 51 +++++++++++++++++++----- 1 file changed, 42 insertions(+), 9 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c +42 -9
@@ -1694,16 +1694,12 @@ static int bnx2x_vfop_mbx_qfilters_cmd(struct bnx2x *bp,return -ENOMEM ; } -static void bnx2x_vf_mbx_set_q_filters (struct bnx2x *bp, -struct bnx2x_virtf *vf, -struct bnx2x_vf_mbx *mbx) +static int bnx2x_filters_validate_mac (struct bnx2x *bp, +struct bnx2x_virtf *vf, +struct vfpf_set_q_filters_tlv *filters) { -struct vfpf_set_q_filters_tlv *filters = &mbx->msg->req.set_q_filters;struct pf_vf_bulletin_content *bulletin =BP_VF_BULLETIN (bp, vf->index); -struct bnx2x_vfop_cmd cmd = { - .done = bnx2x_vf_mbx_resp, - .block = false, - }; +int rc =0 ;/* if a mac was already set for this VF via the set vf mac ndo, we only * accept mac configurations of that mac. Why accept them at all?
@@ -1716,6 +1712,7 @@ static void bnx2x_vf_mbx_set_q_filters(struct bnx2x *bp,BNX2X_ERR ("VF[%d] requested the addition of multiple macs after set_vf_mac ndo was called\n" , vf->abs_vfid); vf->op_rc = -EPERM ; + rc = -EPERM ; goto response; }
@@ -1726,9 +1723,22 @@ static void bnx2x_vf_mbx_set_q_filters(struct bnx2x *bp, vf->abs_vfid); vf->op_rc = -EPERM ; + rc = -EPERM ; goto response; } } + +response: +return rc; +} + +static int bnx2x_filters_validate_vlan (struct bnx2x *bp, +struct bnx2x_virtf *vf, +struct vfpf_set_q_filters_tlv *filters) +{ +struct pf_vf_bulletin_content *bulletin =BP_VF_BULLETIN (bp, vf->index); +int rc =0 ; +/* if vlan was set by hypervisor we don't allow guest to config vlan */ if (bulletin->valid_bitmap &1 <<VLAN_VALID ) {int i;
@@ -1740,13 +1750,36 @@ static void bnx2x_vf_mbx_set_q_filters(struct bnx2x *bp,BNX2X_ERR ("VF[%d] attempted to configure vlan but one was already set by Hypervisor. Aborting request\n" , vf->abs_vfid); vf->op_rc = -EPERM ; + rc = -EPERM ; goto response; } } }/* verify vf_qid */ -if (filters->vf_qid >vf_rxq_count (vf)) +if (filters->vf_qid >vf_rxq_count (vf)) { + rc = -EPERM ; + goto response; + } + +response: +return rc; +} + +static void bnx2x_vf_mbx_set_q_filters (struct bnx2x *bp, +struct bnx2x_virtf *vf, +struct bnx2x_vf_mbx *mbx) +{ +struct vfpf_set_q_filters_tlv *filters = &mbx->msg->req.set_q_filters; +struct bnx2x_vfop_cmd cmd = { + .done = bnx2x_vf_mbx_resp, + .block = false, + }; + +if (bnx2x_filters_validate_mac (bp, vf, filters)) + goto response; + +if (bnx2x_filters_validate_vlan (bp, vf, filters)) goto response; DP(BNX2X_MSG_IOV, "VF[%d] Q_FILTERS: queue[%d]\n",
Signature · 1 line
1.8.1.227.g44fe835
PATCH 5/9 bnx2x: Add support in PF driver for RSC
In reply to Yuval MintzFrom: Michal Kalderon <[email protected]>
This provides PF-side support for VFs assigned to a VM running windows 2012 with the RSC feature enabled.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 1 + drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 21 +++- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 145 +++++++++++++++------- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h | 19 +++ drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 82 ++++++++++++ drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h | 12 ++ drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c | 75 ++++++++++- drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.h | 22 ++++ 8 files changed, 329 insertions(+), 48 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +1 -0
@@ -1270,6 +1270,7 @@ struct bnx2x_slowpath {union {struct client_init_ramrod_data init_data;struct client_update_ramrod_data update_data; +struct tpa_update_ramrod_data tpa_data; } q_rdata;union {
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +17 -4
@@ -1814,6 +1814,11 @@ void bnx2x_sp_event(struct bnx2x_fastpath *fp, union eth_rx_cqe *rr_cqe) drv_cmd =BNX2X_Q_CMD_EMPTY ;break ; +case (RAMROD_CMD_ID_ETH_TPA_UPDATE ): +DP (BNX2X_MSG_SP ,"got tpa update ramrod CID=%d\n" , cid); + drv_cmd =BNX2X_Q_CMD_UPDATE_TPA ; +break ; +default :BNX2X_ERR ("unexpected MC reply (%d) on fp[%d]\n" , command, fp->index);
@@ -3644,10 +3649,18 @@ int bnx2x_sp_post(struct bnx2x *bp, int command, int cid,cpu_to_le32 ((command <<SPE_HDR_CMD_ID_SHIFT ) |HW_CID (bp, cid)); - type = (cmd_type <<SPE_HDR_CONN_TYPE_SHIFT ) &SPE_HDR_CONN_TYPE ; - - type |= ((BP_FUNC (bp) <<SPE_HDR_FUNCTION_ID_SHIFT ) & -SPE_HDR_FUNCTION_ID ); +/* In some cases, type may already contain the func-id +* mainly in SRIOV related use cases, so we add it here only +* if it's not already set. +*/ +if (!(cmd_type &SPE_HDR_FUNCTION_ID )) { + type = (cmd_type <<SPE_HDR_CONN_TYPE_SHIFT ) & +SPE_HDR_CONN_TYPE ; + type |= ((BP_FUNC (bp) <<SPE_HDR_FUNCTION_ID_SHIFT ) & +SPE_HDR_FUNCTION_ID ); + }else { + type = cmd_type; + } spe->hdr.type =cpu_to_le16 (type);
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +102 -43
232 lines not on this page · raw message
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h +19 -0
@@ -893,6 +893,24 @@ struct bnx2x_queue_update_params {u8 cid_index; }; +struct bnx2x_queue_update_tpa_params { +dma_addr_t sge_map; +u8 update_ipv4; +u8 update_ipv6; +u8 max_tpa_queues; +u8 max_sges_pkt; +u8 complete_on_both_clients; +u8 dont_verify_thr; +u8 tpa_mode; +u8 _pad; + +u16 sge_buff_sz; +u16 max_agg_sz; + +u16 sge_pause_thr_low; +u16 sge_pause_thr_high; +}; +struct rxq_pause_params {u16 bd_th_lo;u16 bd_th_hi;
@@ -987,6 +1005,7 @@ struct bnx2x_queue_state_params {/* Params according to the current command */ union {struct bnx2x_queue_update_params update; +struct bnx2x_queue_update_tpa_params update_tpa;struct bnx2x_queue_setup_params setup;struct bnx2x_queue_init_params init;struct bnx2x_queue_setup_tx_only_params tx_only;
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +82 -0
94 lines not on this page · raw message
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h +12 -0
@@ -100,6 +100,7 @@ union bnx2x_vfop_params {struct bnx2x_mcast_ramrod_params mcast;struct bnx2x_config_rss_params rss;struct bnx2x_vfop_qctor_params qctor; +struct bnx2x_queue_state_params qstate; };/* forward */
@@ -166,6 +167,11 @@ struct bnx2x_vfop_args_filters {atomic_t *credit;/* non NULL means 'don't consume credit' */ }; +struct bnx2x_vfop_args_tpa { +int qid; +dma_addr_t sge_map[PFVF_MAX_QUEUES_PER_VF ]; +}; +union bnx2x_vfop_args {struct bnx2x_vfop_args_mcast mc_list;struct bnx2x_vfop_args_qctor qctor;
@@ -173,6 +179,7 @@ union bnx2x_vfop_args {struct bnx2x_vfop_args_defvlan defvlan;struct bnx2x_vfop_args_qx qx;struct bnx2x_vfop_args_filters filters; +struct bnx2x_vfop_args_tpa tpa; };struct bnx2x_vfop {
@@ -704,6 +711,11 @@ int bnx2x_vfop_rss_cmd(struct bnx2x *bp,struct bnx2x_virtf *vf, struct bnx2x_vfop_cmd *cmd); +int bnx2x_vfop_tpa_cmd (struct bnx2x *bp, +struct bnx2x_virtf *vf, +struct bnx2x_vfop_cmd *cmd, +struct vfpf_tpa_tlv *tpa_tlv); +/* VF release ~ VF close + VF release-resources * * Release is the ultimate SW shutdown and is called whenever an
drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c +74 -1
93 lines not on this page · raw message
drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.h +22 -0
@@ -162,6 +162,7 @@ struct pfvf_acquire_resp_tlv {#define PFVF_CAP_RSS 0x00000001#define PFVF_CAP_DHC 0x00000002#define PFVF_CAP_TPA 0x00000004 +#define PFVF_CAP_TPA_UPDATE 0x00000008char fw_ver[32 ];u16 db_size;u8 indices_per_sb;
@@ -303,6 +304,25 @@ struct vfpf_set_q_filters_tlv {u32 rx_mask;/* see mask constants at the top of the file */ }; +struct vfpf_tpa_tlv { +struct vfpf_first_tlv first_tlv; + +struct vf_pf_tpa_client_info { +aligned_u64 sge_addr[PFVF_MAX_QUEUES_PER_VF ]; +u8 update_ipv4; +u8 update_ipv6; +u8 max_tpa_queues; +u8 max_sges_for_packet; +u8 complete_on_both_clients; +u8 dont_verify_thr; +u8 tpa_mode; +u16 sge_buff_size; +u16 max_agg_size; +u16 sge_pause_thr_low; +u16 sge_pause_thr_high; + } tpa_client_info; +}; +/* close VF (disable VF) */ struct vfpf_close_tlv {struct vfpf_first_tlv first_tlv;
@@ -331,6 +351,7 @@ union vfpf_tlvs {struct vfpf_set_q_filters_tlv set_q_filters;struct vfpf_release_tlv release;struct vfpf_rss_tlv update_rss; +struct vfpf_tpa_tlv update_tpa;struct channel_list_end_tlv list_end;struct tlv_buffer_size tlv_buf_size; };
@@ -405,6 +426,7 @@ enum channel_tlvs {CHANNEL_TLV_PF_SET_VLAN ,CHANNEL_TLV_UPDATE_RSS ,CHANNEL_TLV_PHYS_PORT_ID , +CHANNEL_TLV_UPDATE_TPA , CHANNEL_TLV_MAX };
Signature · 1 line
1.8.1.227.g44fe835
PATCH 6/9 bnx2x: Revise IOV vlan/mac validation
In reply to Yuval MintzThere are several places in IOV related flows where PF needs to determine whether a VF slowpath elements have already been configured (i.e., this affect its ability to configure/remove classifications for the VF).
This patch changes the conditions for the validation and performs a cleaner validation (e.g., by replacing several validations with a single one).
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 10 -- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h | 2 - drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 127 +++++++++++----------- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h | 1 + drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c | 1 + 5 files changed, 67 insertions(+), 74 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +0 -10
@@ -4158,16 +4158,6 @@ void bnx2x_init_rss_config_obj(struct bnx2x *bp, rss_obj->config_rss = bnx2x_setup_rss; } -int validate_vlan_mac (struct bnx2x *bp, -struct bnx2x_vlan_mac_obj *vlan_mac) -{ -if (!vlan_mac->get_n_elements) { -BNX2X_ERR ("vlan mac object was not intialized\n" ); -return -EINVAL ; - } -return 0 ; -} -/********************** Queue state object ***********************************/ /**
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h +0 -2
@@ -1422,6 +1422,4 @@ int bnx2x_config_rss(struct bnx2x *bp,void bnx2x_get_rss_ind_table (struct bnx2x_rss_config_obj *rss_obj,u8 *ind_table); -int validate_vlan_mac (struct bnx2x *bp, -struct bnx2x_vlan_mac_obj *vlan_mac);#endif /* BNX2X_SP_VERBS */
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +65 -62
259 lines not on this page · raw message
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h +1 -0
@@ -83,6 +83,7 @@ struct bnx2x_vf_queue {u16 index;u16 sb_idx;bool is_leading; +bool sp_initialized; };/* struct bnx2x_vfop_qctor_params - prepare queue construction parameters:
drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c +1 -0
@@ -548,6 +548,7 @@ static void bnx2x_leading_vfq_init(struct bnx2x *bp, struct bnx2x_virtf *vf, vf->leading_rss = cl_id; q->is_leading = true; + q->sp_initialized = true; }/* ask the pf to open a queue for the vf */
Signature · 1 line
1.8.1.227.g44fe835
PATCH 7/9 bnx2x: Fix bnx2x_panic_dump for VFs
In reply to Yuval Mintzbnx2x_panic_dump() prints all kind of driver information, including slowpath information. Since VFs don't initialize slowpath information, a VF reaching this flow will likely cause a panic in the system as it will access NULL pointers.
---
Notice although this is a bug fix it's intended to net-next; The reason is that practically all of the bnx2x_panic() calls are made either as a result of bad FW/HW access, or due to some flow if driver was compiled with BNX2X_STOP_ON_ERROR. As the former is impossible for a VF, this in practice only fixes issues when BNX2X_STOP_ON_ERROR is used, which isn't mainstream. Also, it doesn't pass checkpatch (as it doesn't change print format).
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 97 ++++++++++++++---------- 1 file changed, 57 insertions(+), 40 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +57 -40
@@ -918,7 +918,7 @@ void bnx2x_panic_dump(struct bnx2x *bp, bool disable_int)u16 start =0 , end =0 ;u8 cos;#endif -if (disable_int) +if (IS_PF (bp) && disable_int)bnx2x_int_disable (bp); bp->stats_state =STATS_STATE_DISABLED ;
@@ -929,33 +929,41 @@ void bnx2x_panic_dump(struct bnx2x *bp, bool disable_int)/* Indices */ /* Common */ -BNX2X_ERR ("def_idx(0x%x) def_att_idx(0x%x) attn_state(0x%x) spq_prod_idx(0x%x) next_stats_cnt(0x%x)\n" , - bp->def_idx, bp->def_att_idx, bp->attn_state, - bp->spq_prod_idx, bp->stats_counter); -BNX2X_ERR ("DSB: attn bits(0x%x) ack(0x%x) id(0x%x) idx(0x%x)\n" , - bp->def_status_blk->atten_status_block.attn_bits, - bp->def_status_blk->atten_status_block.attn_bits_ack, - bp->def_status_blk->atten_status_block.status_block_id, - bp->def_status_blk->atten_status_block.attn_bits_index); -BNX2X_ERR (" def (" ); -for (i =0 ; i <HC_SP_SB_MAX_INDICES ; i++) -pr_cont ("0x%x%s" , - bp->def_status_blk->sp_sb.index_values[i], - (i ==HC_SP_SB_MAX_INDICES -1 ) ?") " :" " ); - -for (i =0 ; i <sizeof (struct hc_sp_status_block_data )/sizeof (u32); i++) - *((u32 *)&sp_sb_data + i) =REG_RD (bp,BAR_CSTRORM_INTMEM + -CSTORM_SP_STATUS_BLOCK_DATA_OFFSET (func) + - i*sizeof (u32)); - -pr_cont ("igu_sb_id(0x%x) igu_seg_id(0x%x) pf_id(0x%x) vnic_id(0x%x) vf_id(0x%x) vf_valid (0x%x) state(0x%x)\n" , - sp_sb_data.igu_sb_id, - sp_sb_data.igu_seg_id, - sp_sb_data.p_func.pf_id, - sp_sb_data.p_func.vnic_id, - sp_sb_data.p_func.vf_id, - sp_sb_data.p_func.vf_valid, - sp_sb_data.state); +if (IS_PF (bp)) { +struct host_sp_status_block *def_sb = bp->def_status_blk; +int data_size, cstorm_offset; + +BNX2X_ERR ("def_idx(0x%x) def_att_idx(0x%x) attn_state(0x%x) spq_prod_idx(0x%x) next_stats_cnt(0x%x)\n" , + bp->def_idx, bp->def_att_idx, bp->attn_state, + bp->spq_prod_idx, bp->stats_counter); +BNX2X_ERR ("DSB: attn bits(0x%x) ack(0x%x) id(0x%x) idx(0x%x)\n" , + def_sb->atten_status_block.attn_bits, + def_sb->atten_status_block.attn_bits_ack, + def_sb->atten_status_block.status_block_id, + def_sb->atten_status_block.attn_bits_index); +BNX2X_ERR (" def (" ); +for (i =0 ; i <HC_SP_SB_MAX_INDICES ; i++) +pr_cont ("0x%x%s" , + def_sb->sp_sb.index_values[i], + (i ==HC_SP_SB_MAX_INDICES -1 ) ?") " :" " ); + + data_size =sizeof (struct hc_sp_status_block_data ) / +sizeof (u32); + cstorm_offset =CSTORM_SP_STATUS_BLOCK_DATA_OFFSET (func); +for (i =0 ; i < data_size; i++) + *((u32 *)&sp_sb_data + i) = +REG_RD (bp,BAR_CSTRORM_INTMEM + cstorm_offset + + i *sizeof (u32)); + +pr_cont ("igu_sb_id(0x%x) igu_seg_id(0x%x) pf_id(0x%x) vnic_id(0x%x) vf_id(0x%x) vf_valid (0x%x) state(0x%x)\n" , + sp_sb_data.igu_sb_id, + sp_sb_data.igu_seg_id, + sp_sb_data.p_func.pf_id, + sp_sb_data.p_func.vnic_id, + sp_sb_data.p_func.vf_id, + sp_sb_data.p_func.vf_valid, + sp_sb_data.state); + }for_each_eth_queue (bp, i) {struct bnx2x_fastpath *fp = &bp->fp[i];
@@ -1013,6 +1021,11 @@ void bnx2x_panic_dump(struct bnx2x *bp, bool disable_int)pr_cont ("0x%x%s" , fp->sb_index_values[j], (j == loop -1 ) ?")" :" " ); + +/* VF cannot access FW refelection for status block */ +if (IS_VF (bp)) +continue ; +/* fw sb data */ data_size =CHIP_IS_E1x (bp) ? sizeof(struct hc_status_block_data_e1x) :
@@ -1064,16 +1077,18 @@ void bnx2x_panic_dump(struct bnx2x *bp, bool disable_int) }#ifdef BNX2X_STOP_ON_ERROR - -/* event queue */ -BNX2X_ERR ("eq cons %x prod %x\n" , bp->eq_cons, bp->eq_prod); -for (i =0 ; i <NUM_EQ_DESC ; i++) { -u32 *data = (u32 *)&bp->eq_ring[i].message.data; - -BNX2X_ERR ("event queue [%d]: header: opcode %d, error %d\n" , - i, bp->eq_ring[i].message.opcode, - bp->eq_ring[i].message.error); -BNX2X_ERR ("data: %x %x %x\n" , data[0 ], data[1 ], data[2 ]); +if (IS_PF (bp)) { +/* event queue */ +BNX2X_ERR ("eq cons %x prod %x\n" , bp->eq_cons, bp->eq_prod); +for (i =0 ; i <NUM_EQ_DESC ; i++) { +u32 *data = (u32 *)&bp->eq_ring[i].message.data; + +BNX2X_ERR ("event queue [%d]: header: opcode %d, error %d\n" , + i, bp->eq_ring[i].message.opcode, + bp->eq_ring[i].message.error); +BNX2X_ERR ("data: %x %x %x\n" , + data[0 ], data[1 ], data[2 ]); + } }/* Rings */
@@ -1140,8 +1155,10 @@ void bnx2x_panic_dump(struct bnx2x *bp, bool disable_int) } }#endif -bnx2x_fw_dump (bp); -bnx2x_mc_assert (bp); +if (IS_PF (bp)) { +bnx2x_fw_dump (bp); +bnx2x_mc_assert (bp); + }BNX2X_ERR ("end crash dump -----------------\n" ); }
Signature · 1 line
1.8.1.227.g44fe835
PATCH 8/9 bnx2x: (semantic) revise scheduling of sp_rtnl
In reply to Yuval MintzThis removes the various points where the driver use bit operations in order to schedule the sp_rtnl_task from the code, adding a single utility function that does it instead.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 2 +- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 18 +++++++++++---- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 3 +++ drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c | 8 ++----- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 28 +++++++---------------- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 17 ++++---------- 6 files changed, 32 insertions(+), 44 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +1 -1
@@ -1402,7 +1402,7 @@ struct bnx2x_fw_stats_data { };/* Public slow path states */ -enum { +enum sp_rtnl_flag {BNX2X_SP_RTNL_SETUP_TC ,BNX2X_SP_RTNL_TX_TIMEOUT ,BNX2X_SP_RTNL_FAN_FAILURE ,
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +13 -5
@@ -4773,12 +4773,8 @@ void bnx2x_tx_timeout(struct net_device *dev)bnx2x_panic ();#endif -smp_mb__before_clear_bit (); -set_bit (BNX2X_SP_RTNL_TX_TIMEOUT , &bp->sp_rtnl_state); -smp_mb__after_clear_bit (); -/* This allows the netif to be shutdown gracefully before resetting */ -schedule_delayed_work (&bp->sp_rtnl_task,0 ); +bnx2x_schedule_sp_rtnl (bp,BNX2X_SP_RTNL_TX_TIMEOUT ,0 ); }int bnx2x_suspend (struct pci_dev *pdev,pm_message_t state)
@@ -4906,3 +4902,15 @@ void bnx2x_update_coalesce_sb_index(struct bnx2x *bp, u8 fw_sb_id, disable = disable ?1 : (usec ?0 :1 );storm_memset_hc_disable (bp, port, fw_sb_id, sb_index, disable); } + +void bnx2x_schedule_sp_rtnl (struct bnx2x *bp,enum sp_rtnl_flag flag, +u32 verbose) +{ +smp_mb__before_clear_bit (); +set_bit (flag, &bp->sp_rtnl_state); +smp_mb__after_clear_bit (); +DP ((BNX2X_MSG_SP | verbose),"Scheduling sp_rtnl task [Flag: %d]\n" , + flag); +schedule_delayed_work (&bp->sp_rtnl_task,0 ); +} +EXPORT_SYMBOL (bnx2x_schedule_sp_rtnl);
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +3 -0
@@ -1324,4 +1324,7 @@ void bnx2x_fill_fw_str(struct bnx2x *bp, char *buf, size_t buf_len);int bnx2x_drain_tx_queues (struct bnx2x *bp);void bnx2x_squeeze_objects (struct bnx2x *bp); +void bnx2x_schedule_sp_rtnl (struct bnx2x *,enum sp_rtnl_flag , +u32 verbose); +#endif /* BNX2X_CMN_H */
drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c +2 -6
@@ -710,8 +710,7 @@ static inline void bnx2x_dcbx_update_tc_mapping(struct bnx2x *bp)* as we are handling an attention on a work queue which must be * flushed at some rtnl-locked contexts (e.g. if down) */ -if (!test_and_set_bit (BNX2X_SP_RTNL_SETUP_TC , &bp->sp_rtnl_state)) -schedule_delayed_work (&bp->sp_rtnl_task,0 ); +bnx2x_schedule_sp_rtnl (bp,BNX2X_SP_RTNL_SETUP_TC ,0 ); }void bnx2x_dcbx_set_params (struct bnx2x *bp,u32 state)
@@ -764,10 +763,7 @@ void bnx2x_dcbx_set_params(struct bnx2x *bp, u32 state)if (IS_MF (bp))bnx2x_link_sync_notify (bp); -set_bit (BNX2X_SP_RTNL_TX_STOP , &bp->sp_rtnl_state); - -schedule_delayed_work (&bp->sp_rtnl_task,0 ); - +bnx2x_schedule_sp_rtnl (bp,BNX2X_SP_RTNL_TX_STOP ,0 );return ; }case BNX2X_DCBX_STATE_TX_PAUSED :
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +8 -20
@@ -3908,10 +3908,7 @@ static void bnx2x_fan_failure(struct bnx2x *bp)* This is due to some boards consuming sufficient power when driver is * up to overheat if fan fails. */ -smp_mb__before_clear_bit (); -set_bit (BNX2X_SP_RTNL_FAN_FAILURE , &bp->sp_rtnl_state); -smp_mb__after_clear_bit (); -schedule_delayed_work (&bp->sp_rtnl_task,0 ); +bnx2x_schedule_sp_rtnl (bp,BNX2X_SP_RTNL_FAN_FAILURE ,0 ); }static void bnx2x_attn_int_deasserted0 (struct bnx2x *bp,u32 attn)
@@ -5303,6 +5300,8 @@ static void bnx2x_eq_int(struct bnx2x *bp)break ; }else { +int cmd =BNX2X_SP_RTNL_AFEX_F_UPDATE ; +DP (BNX2X_MSG_SP |BNX2X_MSG_MCP ,"AFEX: ramrod completed FUNCTION_UPDATE\n" ); f_obj->complete_cmd(bp, f_obj,
@@ -5312,12 +5311,7 @@ static void bnx2x_eq_int(struct bnx2x *bp)* sp_rtnl task as all Queue SP operations * should run under rtnl_lock. */ -smp_mb__before_clear_bit (); -set_bit (BNX2X_SP_RTNL_AFEX_F_UPDATE , - &bp->sp_rtnl_state); -smp_mb__after_clear_bit (); - -schedule_delayed_work (&bp->sp_rtnl_task,0 ); +bnx2x_schedule_sp_rtnl (bp, cmd,0 ); } goto next_spqe;
@@ -12082,11 +12076,8 @@ static void bnx2x_set_rx_mode(struct net_device *dev)return ; }else {/* Schedule an SP task to handle rest of change */ -DP (NETIF_MSG_IFUP ,"Scheduling an Rx mode change\n" ); -smp_mb__before_clear_bit (); -set_bit (BNX2X_SP_RTNL_RX_MODE , &bp->sp_rtnl_state); -smp_mb__after_clear_bit (); -schedule_delayed_work (&bp->sp_rtnl_task,0 ); +bnx2x_schedule_sp_rtnl (bp,BNX2X_SP_RTNL_RX_MODE , +NETIF_MSG_IFUP ); } }
@@ -12119,11 +12110,8 @@ void bnx2x_set_rx_mode_inner(struct bnx2x *bp)/* configuring mcast to a vf involves sleeping (when we * wait for the pf's response). */ -smp_mb__before_clear_bit (); -set_bit (BNX2X_SP_RTNL_VFPF_MCAST , - &bp->sp_rtnl_state); -smp_mb__after_clear_bit (); -schedule_delayed_work (&bp->sp_rtnl_task,0 ); +bnx2x_schedule_sp_rtnl (bp, +BNX2X_SP_RTNL_VFPF_MCAST ,0 ); } }
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +5 -12
@@ -983,11 +983,8 @@ op_err: op_done:case BNX2X_VFOP_QSETUP_DONE : vf->cfg_flags |=VF_CFG_VLAN ; -smp_mb__before_clear_bit (); -set_bit (BNX2X_SP_RTNL_HYPERVISOR_VLAN , - &bp->sp_rtnl_state); -smp_mb__after_clear_bit (); -schedule_delayed_work (&bp->sp_rtnl_task,0 ); +bnx2x_schedule_sp_rtnl (bp,BNX2X_SP_RTNL_HYPERVISOR_VLAN , +BNX2X_MSG_IOV );bnx2x_vfop_end (bp, vf, vfop);return ;default :
@@ -3812,13 +3809,9 @@ void bnx2x_timer_sriov(struct bnx2x *bp)bnx2x_sample_bulletin (bp);/* if channel is down we need to self destruct */ -if (bp->old_bulletin.valid_bitmap &1 <<CHANNEL_DOWN ) { -smp_mb__before_clear_bit (); -set_bit (BNX2X_SP_RTNL_VFPF_CHANNEL_DOWN , - &bp->sp_rtnl_state); -smp_mb__after_clear_bit (); -schedule_delayed_work (&bp->sp_rtnl_task,0 ); - } +if (bp->old_bulletin.valid_bitmap &1 <<CHANNEL_DOWN ) +bnx2x_schedule_sp_rtnl (bp,BNX2X_SP_RTNL_VFPF_CHANNEL_DOWN , +BNX2X_MSG_IOV ); }void __iomem *bnx2x_vf_doorbells (struct bnx2x *bp)
Signature · 1 line
1.8.1.227.g44fe835
PATCH 9/9 bnx2x: utilize FW 7.8.19
In reply to Yuval MintzFrom: Dmitry Kravkov <[email protected]>
This new firmware fixes following bugs:
1. HW attention appears and traffic stops when iSCSI firmware tries to retransmit iSCSI login command when the iSCSI login is carrying data not aligned to 4-bytes.
2. FCoE traffic fails to run when running in switch-independent multi-function mode and there's more than one interface supporting FCoE on a given port.
3. While two ports are running FCoE with at least one of them has a function number (>1) on the same engine in a 4-port device a zeroed CQE is given, causing FCoE traffic to stop.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 4 ++-- drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +2 -2
@@ -26,8 +26,8 @@* (you will need to reboot afterwards) */ /* #define BNX2X_STOP_ON_ERROR */ -#define DRV_MODULE_VERSION "1.78.17-0" -#define DRV_MODULE_RELDATE "2013/04/11" +#define DRV_MODULE_VERSION "1.78.19-0" +#define DRV_MODULE_RELDATE "2014/02/10"#define BNX2X_BC_VER 0x040200#if defined(CONFIG_DCB )
drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h +1 -1
@@ -2848,7 +2848,7 @@ struct afex_stats {#define BCM_5710_FW_MAJOR_VERSION 7#define BCM_5710_FW_MINOR_VERSION 8 -#define BCM_5710_FW_REVISION_VERSION 17 +#define BCM_5710_FW_REVISION_VERSION 19#define BCM_5710_FW_ENGINEERING_VERSION 0#define BCM_5710_FW_COMPILE_FLAGS 1
Signature · 1 line
1.8.5.3
David Miller
maintainerFrom: Yuval Mintz <[email protected]>
Date: Mon, 10 Feb 2014 17:16:53 +0200
Quoted 5 lines
This patch series contains several semantic (or mostly semantic) patches, as well as adding support for packet aggregations on the receive path of windows VMs and updating bnx2x to the new FW recently accepted upstream.
Please consider applying these patches to `net-next'.
The net-next tree is not open yet, please resubmit this when I open that tree back up.
Thanks.