bnx2x: Semantic patch series
cover bnx2x: Semantic patch series
Hi Dave,
This patch series contains only semantic changes, e.g., removal of unnecessary blank lines, correcting various typos and modifying prints, correcting alignments, etc.
Please consider applying these patches to `net-next'.
Thanks,
Yuval Mintz
PATCH 1/5 bnx2x: Semantic change of empty lines
This patch removes unnecessary blank lines and adds a few where such are needed (between variable declarations and code)
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 23 -------- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 12 +--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 3 - drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c | 11 ---- drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.h | 3 - drivers/net/ethernet/broadcom/bnx2x/bnx2x_dump.h | 1 - .../net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 4 -- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 68 +--------------------- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 30 ---------- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h | 1 - drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 1 - drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h | 1 - drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c | 1 - drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h | 4 -- 14 files changed, 3 insertions(+), 160 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +0 -23
@@ -34,12 +34,10 @@#define BCM_DCBNL #endif -#include "bnx2x_hsi.h" #include "../cnic_if.h" -#define BNX2X_MIN_MSIX_VEC_CNT (bp) ((bp)->min_msix_vec_cnt)#include <linux/mdio.h>
@@ -114,7 +112,6 @@ do { \#define BNX2X_ERROR (fmt, ...) \ pr_err("[%s:%d]" fmt, __func__, __LINE__, ##__VA_ARGS__) -/* before we have a dev->name use dev_info() */ #define BNX2X_DEV_INFO (fmt, ...) \ do { \
@@ -147,7 +144,6 @@ do { \#define U64_HI (x) ((u32)(((u64)(x)) >> 32))#define HILO_U64 (hi, lo) ((((u64)(hi)) << 32) + (lo)) -#define REG_ADDR (bp, offset) ((bp->regview) + (offset))#define REG_RD (bp, offset) readl(REG_ADDR(bp, offset))
@@ -387,7 +383,6 @@ union db_prod {#define BIT_VEC64_ELEM_SHIFT 6#define BIT_VEC64_ELEM_MASK ((u64)BIT_VEC64_ELEM_SZ - 1) -#define __BIT_VEC64_SET_BIT (el, bit) \ do { \ el = ((el) | ((u64)0x1 << (bit))); \
@@ -398,7 +393,6 @@ union db_prod { el = ((el) & (~((u64 )0x1 << (bit)))); \ } while (0) -#define BIT_VEC64_SET_BIT (vec64, idx) \ __BIT_VEC64_SET_BIT((vec64)[(idx) >> BIT_VEC64_ELEM_SHIFT], \ (idx) & BIT_VEC64_ELEM_MASK)
@@ -419,8 +413,6 @@ union db_prod {/*******************************************************/ - -/* Number of u64 elements in SGE mask array */ #define RX_SGE_MASK_LEN (NUM_RX_SGE / BIT_VEC64_ELEM_SZ)#define RX_SGE_MASK_LEN_MASK (RX_SGE_MASK_LEN - 1)
@@ -580,12 +572,10 @@ struct bnx2x_fastpath { txdata_ptr[FIRST_TX_COS_INDEX] \ ->var) -#define IS_ETH_FP (fp) ((fp)->index < BNX2X_NUM_ETH_QUEUES((fp)->bp))#define IS_FCOE_FP (fp) ((fp)->index == FCOE_IDX((fp)->bp))#define IS_FCOE_IDX (idx) ((idx) == FCOE_IDX(bp)) -/* MC hsi */ #define MAX_FETCH_BD 13/* HW max BDs per packet */ #define RX_COPY_THRESH 92
@@ -693,12 +683,10 @@ struct bnx2x_fastpath { FW_DROP_LEVEL(bp))#define RCQ_TH_HI (bp) (RCQ_TH_LO(bp) + DROPLESS_FC_HEADROOM) -/* This is needed for determining of last_max */ #define SUB_S16 (a, b) (s16)((s16)(a) - (s16)(b))#define SUB_S32 (a, b) (s32)((s32)(a) - (s32)(b)) -#define BNX2X_SWCID_SHIFT 17#define BNX2X_SWCID_MASK ((0x1 << BNX2X_SWCID_SHIFT) - 1)
@@ -723,7 +711,6 @@ struct bnx2x_fastpath { DPM_TRIGER_TYPE); \ }while (0 ) -/* TX CSUM helpers */ #define SKB_CS_OFF(skb) (offsetof(struct tcphdr, check) - \ skb->csum_offset)
@@ -766,7 +753,6 @@ struct bnx2x_fastpath {#define BNX2X_RX_SUM_FIX (cqe) \ BNX2X_PRS_FLAG_OVERETH_IPV4(cqe->fast_path_cqe.pars_flags.flags) -#define FP_USB_FUNC_OFF \ offsetof(struct cstorm_status_block_u, func)#define FP_CSB_FUNC_OFF \
@@ -1068,7 +1054,6 @@ struct bnx2x_slowpath {struct eth_classify_rules_ramrod_data e2; } mac_rdata; -union {struct tstorm_eth_mac_filter_config e1x;struct eth_filter_rules_ramrod_data e2;
@@ -1119,7 +1104,6 @@ struct bnx2x_slowpath {#define bnx2x_sp_mapping (bp, var) \ (bp->slowpath_mapping + offsetof(struct bnx2x_slowpath, var)) -/* attn group wiring */ #define MAX_DYNAMIC_ATTN_GRPS 8
@@ -1225,7 +1209,6 @@ enum { BNX2X_SP_RTNL_HYPERVISOR_VLAN, }; -struct bnx2x_prev_path_list {struct list_head list;u8 bus;
@@ -1755,7 +1738,6 @@ extern int num_queues;#define FUNC_FLG_SPQ 0x0010#define FUNC_FLG_LEADING 0x0020/* PF only */ -struct bnx2x_func_init_params {/* dma */ dma_addr_t fw_stat_map;/* valid iff FUNC_FLG_STATS */
@@ -1853,9 +1835,6 @@ struct bnx2x_func_init_params {#define skip_queue (bp, idx) (NO_FCOE(bp) && IS_FCOE_IDX(idx)) - - -/** * bnx2x_set_mac_one - configure a single MAC address *
@@ -2000,7 +1979,6 @@ void bnx2x_igu_clear_sb_gen(struct bnx2x *bp, u8 func, u8 idu_sb_id,#define UNLOAD_CLOSE 1#define UNLOAD_RECOVERY 2 -/* DMAE command defines */ #define DMAE_TIMEOUT -1#define DMAE_PCI_ERROR -2/* E2 and onward */
@@ -2102,7 +2080,6 @@ void bnx2x_igu_clear_sb_gen(struct bnx2x *bp, u8 func, u8 idu_sb_id,#define SP_DESC_CNT (BCM_PAGE_SIZE / sizeof(struct eth_spe))#define MAX_SP_DESC_CNT (SP_DESC_CNT - 1) -#define BNX2X_BTR 4#define MAX_SPQ_PENDING 8
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +1 -11
@@ -165,7 +165,6 @@ static u16 bnx2x_free_tx_pkt(struct bnx2x *bp, struct bnx2x_fp_txdata *txdata,dma_unmap_single (&bp->pdev->dev,BD_UNMAP_ADDR (tx_start_bd),BD_UNMAP_LEN (tx_start_bd),DMA_TO_DEVICE ); - nbd =le16_to_cpu (tx_start_bd->nbd) -1 ;#ifdef BNX2X_STOP_ON_ERROR if ((nbd -1 ) > (MAX_SKB_FRAGS +2 )) {
@@ -733,7 +732,6 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp,dev_kfree_skb_any (skb); } -/* put new data in bin */ rx_buf->data = new_data;
@@ -899,7 +897,6 @@ int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget) cqe_fp); goto next_rx; - } queue = cqe->end_agg_cqe.queue_index; tpa_info = &fp->tpa_info[queue];
@@ -1004,7 +1001,6 @@ reuse_rx: le16_to_cpu(cqe_fp->vlan_tag));napi_gro_receive (&fp->napi, skb); - next_rx: rx_buf->data =NULL ;
@@ -2322,10 +2318,10 @@ static void bnx2x_nic_load_afex_dcc(struct bnx2x *bp, int load_code)static void bnx2x_bz_fp (struct bnx2x *bp,int index) {struct bnx2x_fastpath *fp = &bp->fp[index]; -int cos;struct napi_struct orig_napi = fp->napi;struct bnx2x_agg_info *orig_tpa_info = fp->tpa_info; +/* bzero bnx2x_fastpath contents */ if (fp->tpa_info) memset(fp->tpa_info, 0, ETH_MAX_AGGREGATION_QUEUES_E1H_E2 *
@@ -2435,7 +2431,6 @@ int bnx2x_load_cnic(struct bnx2x *bp)if (bp->state ==BNX2X_STATE_OPEN )bnx2x_cnic_notify (bp,CNIC_CTL_START_CMD ); -DP (NETIF_MSG_IFUP ,"Ending successfully CNIC-related load\n" );return 0 ;
@@ -2961,7 +2956,6 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode, bool keep_link)bnx2x_set_reset_global (bp); } -/* The last driver must disable a "close the gate" if there is no * parity attention or "process kill" pending. */
@@ -4480,7 +4474,6 @@ int bnx2x_alloc_mem_bp(struct bnx2x *bp) alloc_err:bnx2x_free_mem_bp (bp);return -ENOMEM ; - }int bnx2x_reload_if_running (struct net_device *dev)
@@ -4522,7 +4515,6 @@ int bnx2x_get_cur_phy_idx(struct bnx2x *bp) }return sel_phy_idx; - }int bnx2x_get_link_cfg_idx (struct bnx2x *bp) {
@@ -4739,7 +4731,6 @@ int bnx2x_resume(struct pci_dev *pdev)return rc; } -void bnx2x_set_ctx_validation (struct bnx2x *bp,struct eth_context *cxt,u32 cid) {
@@ -4757,7 +4748,6 @@ static void storm_memset_hc_timeout(struct bnx2x *bp, u8 port, u8 fw_sb_id, u8 sb_index, u8 ticks) { - u32 addr = BAR_CSTRORM_INTMEM +CSTORM_STATUS_BLOCK_DATA_TIMEOUT_OFFSET (fw_sb_id, sb_index);REG_WR8 (bp, addr, ticks);
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +0 -3
@@ -22,7 +22,6 @@#include <linux/netdevice.h> #include <linux/etherdevice.h> -#include "bnx2x.h" #include "bnx2x_sriov.h"
@@ -1171,7 +1170,6 @@ static inline u8 bnx2x_cnic_eth_cl_id(struct bnx2x *bp, u8 cl_idx)static inline u8 bnx2x_cnic_fw_sb_id (struct bnx2x *bp) { -/* the 'first' id is allocated for the cnic */ return bp->base_fw_ndsb; }
@@ -1181,7 +1179,6 @@ static inline u8 bnx2x_cnic_igu_sb_id(struct bnx2x *bp)return bp->igu_base_sb; } -static inline void bnx2x_init_fcoe_fp (struct bnx2x *bp) {struct bnx2x_fastpath *fp =bnx2x_fcoe_fp (bp);
drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c +0 -11
@@ -253,7 +253,6 @@ static void bnx2x_dcbx_get_ets_feature(struct bnx2x *bp,memset (&pg_help_data,0 ,sizeof (struct pg_help_data )); -if (GET_FLAGS (error,DCBX_LOCAL_ETS_ERROR ))DP (BNX2X_MSG_DCB ,"DCBX_LOCAL_ETS_ERROR\n" );
@@ -298,7 +297,6 @@ static void bnx2x_dcbx_get_ets_feature(struct bnx2x *bp,static void bnx2x_dcbx_get_pfc_feature (struct bnx2x *bp,struct dcbx_pfc_feature *pfc,u32 error) { -if (GET_FLAGS (error,DCBX_LOCAL_PFC_ERROR ))DP (BNX2X_MSG_DCB ,"DCBX_LOCAL_PFC_ERROR\n" );
@@ -367,7 +365,6 @@ static int bnx2x_dcbx_read_mib(struct bnx2x *bp,struct lldp_remote_mib *remote_mib ;struct lldp_local_mib *local_mib; -switch (read_mib_type) {case DCBX_READ_LOCAL_MIB : mib_size =sizeof (struct lldp_local_mib );
@@ -629,7 +626,6 @@ static int bnx2x_dcbx_read_shmem_neg_results(struct bnx2x *bp)return 0 ; } -#ifdef BCM_DCBNL static inline u8 bnx2x_dcbx_dcbnl_app_up (struct dcbx_app_priority_entry *ent)
@@ -896,13 +892,11 @@ static void bnx2x_dcbx_admin_mib_updated_params(struct bnx2x *bp, } af->app.default_pri = (u8 )dp->admin_default_priority; - }/* Write the data. */ bnx2x_write_data (bp, (u32 *)&admin_mib, offset,sizeof (struct lldp_admin_mib )); - }void bnx2x_dcbx_set_state (struct bnx2x *bp,bool dcb_on,u32 dcbx_enabled)
@@ -1181,7 +1175,6 @@ static void bnx2x_dcbx_separate_pauseable_from_non(struct bnx2x *bp,BNX2X_ERR ("dcbx error: Both groups must have priorities\n" ); } -#ifndef POWER_OF_2 #define POWER_OF_2 (x) ((0 != x) && (0 == (x & (x-1))))#endif
@@ -1524,7 +1517,6 @@ static void bnx2x_dcbx_2cos_limit_cee_three_pg_to_cos_params( } } - static void bnx2x_dcbx_2cos_limit_cee_fill_cos_params(struct bnx2x *bp, struct pg_help_data *help_data, struct dcbx_ets_feature *ets,
@@ -1533,7 +1525,6 @@ static void bnx2x_dcbx_2cos_limit_cee_fill_cos_params(struct bnx2x *bp, u32 pri_join_mask, u8 num_of_dif_pri) { -/* default E2 settings */ cos_data->num_of_cos =DCBX_COS_MAX_NUM_E2 ;
@@ -1629,7 +1620,6 @@ static u8 bnx2x_dcbx_cee_fill_strict_pri(struct bnx2x *bp, u8 num_spread_of_entries, u8 strict_app_pris) { - if (bnx2x_dcbx_spread_strict_pri(bp, cos_data, entry, num_spread_of_entries, strict_app_pris)) {
@@ -1876,7 +1866,6 @@ void bnx2x_dcbx_pmf_update(struct bnx2x *bp)* dcbx negotiation. */ bnx2x_dcbx_update_tc_mapping (bp); - } }
drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.h +0 -3
@@ -134,8 +134,6 @@ enum {#define PFC_BRB1_REG_HIGH_LLFC_LOW_THRESHOLD 130#define PFC_BRB1_REG_HIGH_LLFC_HIGH_THRESHOLD 170 - -struct cos_entry_help_data {u32 pri_join_mask;u32 cos_bw;
@@ -170,7 +168,6 @@ struct cos_help_data { (!(IS_DCBX_PFC_PRI_ONLY_NON_PAUSE ((bp), (pg_pri)) || \ IS_DCBX_PFC_PRI_ONLY_PAUSE((bp), (pg_pri)))) -struct pg_entry_help_data {u8 num_of_dif_pri;u8 pg;
drivers/net/ethernet/broadcom/bnx2x/bnx2x_dump.h +0 -1
@@ -28,7 +28,6 @@#define DRV_DUMP_USTORM_WAITP_ADDRESS 0x338a80#define DRV_DUMP_CSTORM_WAITP_ADDRESS 0x238a80 -/* Possible Chips */ #define DUMP_CHIP_E1 1#define DUMP_CHIP_E1H 2
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +0 -4
@@ -733,7 +733,6 @@ static bool bnx2x_is_reg_in_chip(struct bnx2x *bp,return false; } -static bool bnx2x_is_wreg_in_chip (struct bnx2x *bp,const struct wreg_addr *wreg_info) {
@@ -3071,7 +3070,6 @@ static void bnx2x_get_strings(struct net_device *dev, u32 stringset, u8 *buf) } } -for (i =0 , j =0 ; i <BNX2X_NUM_STATS ; i++) {if (IS_MF_MODE_STAT (bp) &&IS_PORT_STAT (i))continue ;
@@ -3194,7 +3192,6 @@ static int bnx2x_set_phys_id(struct net_device *dev,static int bnx2x_get_rss_flags (struct bnx2x *bp,struct ethtool_rxnfc *info) { -switch (info->flow_type) {case TCP_V4_FLOW :case TCP_V6_FLOW :
@@ -3430,7 +3427,6 @@ static int bnx2x_set_channels(struct net_device *dev, {struct bnx2x *bp =netdev_priv (dev); - DP(BNX2X_MSG_ETHTOOL, "set-channels command parameters: rx = %d, tx = %d, other = %d, combined = %d\n", channels->rx_count, channels->tx_count, channels->other_count,
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +2 -66
447 lines not on this page · raw message
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +0 -30
@@ -142,7 +142,6 @@ free_and_exit:spin_unlock_bh (&o->lock);return rc; - } static inline void __bnx2x_exe_queue_reset_pending(
@@ -163,13 +162,11 @@ static inline void __bnx2x_exe_queue_reset_pending(static inline void bnx2x_exe_queue_reset_pending (struct bnx2x *bp,struct bnx2x_exe_queue_obj *o) { -spin_lock_bh (&o->lock);__bnx2x_exe_queue_reset_pending (bp, o);spin_unlock_bh (&o->lock); - }/**
@@ -308,7 +305,6 @@ static inline int bnx2x_state_wait(struct bnx2x *bp, int state,/* can take a while if any port is running */ int cnt =5000 ; -if (CHIP_REV_IS_EMUL (bp)) cnt *=20 ;
@@ -456,7 +452,6 @@ static int bnx2x_get_n_elements(struct bnx2x *bp, struct bnx2x_vlan_mac_obj *o,DP (BNX2X_MSG_SP ,"copied element number %d to address %p element was:\n" , counter, next); next += stride + size; - } }return counter *ETH_ALEN ;
@@ -518,7 +513,6 @@ static int bnx2x_check_vlan_mac_add(struct bnx2x *bp,return 0 ; } -/* check_del() callbacks */ static struct bnx2x_vlan_mac_registry_elem * bnx2x_check_mac_del(struct bnx2x *bp,
@@ -609,7 +603,6 @@ static bool bnx2x_check_move_always_err(return false; } -static inline u8 bnx2x_vlan_mac_get_rx_tx_flag (struct bnx2x_vlan_mac_obj *o) {struct bnx2x_raw_obj *raw = &o->raw;
@@ -626,7 +619,6 @@ static inline u8 bnx2x_vlan_mac_get_rx_tx_flag(struct bnx2x_vlan_mac_obj *o)return rx_tx_flag; } -void bnx2x_set_mac_in_nig (struct bnx2x *bp,bool add,unsigned char *dev_addr,int index) {
@@ -707,7 +699,6 @@ static inline void bnx2x_vlan_mac_set_rdata_hdr_e2(u32 cid, int type, hdr->rule_cnt = (u8 )rule_cnt; } -/* hw_config() callbacks */ static void bnx2x_set_one_mac_e2(struct bnx2x *bp, struct bnx2x_vlan_mac_obj *o,
@@ -960,7 +951,6 @@ static void bnx2x_set_one_vlan_mac_e2(struct bnx2x *bp,u16 vlan = elem->cmd_data.vlan_mac.u.vlan_mac.vlan;u8 *mac = elem->cmd_data.vlan_mac.u.vlan_mac.mac; -/* Reset the ramrod data buffer for the first rule */ if (rule_idx ==0 )memset (data,0 ,sizeof (*data));
@@ -1818,8 +1808,6 @@ int bnx2x_config_vlan_mac(return rc; } - -/** * bnx2x_vlan_mac_del_all - delete elements with given vlan_mac_flags spec *
@@ -1934,7 +1922,6 @@ static inline void bnx2x_init_vlan_mac_common(struct bnx2x_vlan_mac_obj *o, state, pstate, type); } - void bnx2x_init_mac_obj(struct bnx2x *bp, struct bnx2x_vlan_mac_obj *mac_obj, u8 cl_id, u32 cid, u8 func_id, void *rdata,
@@ -2092,7 +2079,6 @@ void bnx2x_init_vlan_mac_obj(struct bnx2x *bp, bnx2x_execute_vlan_mac, bnx2x_exeq_get_vlan_mac); } - }/* RX_MODE verbs: DROP_ALL/ACCEPT_ALL/ACCEPT_ALL_MULTI/ACCEPT_ALL_VLAN/NORMAL */
@@ -2245,7 +2231,6 @@ static inline void bnx2x_rx_mode_set_cmd_state_e2(struct bnx2x *bp, } cmd->state =cpu_to_le16 (state); - } static int bnx2x_set_rx_mode_e2(struct bnx2x *bp,
@@ -2286,7 +2271,6 @@ static int bnx2x_set_rx_mode_e2(struct bnx2x *bp, false); } -/* * If FCoE Queue configuration has been requested configure the Rx and * internal switching modes for this queue in separate rules.
@@ -2909,7 +2893,6 @@ static int bnx2x_mcast_validate_e2(struct bnx2x *bp,default :BNX2X_ERR ("Unknown command: %d\n" , cmd);return -EINVAL ; - }/* Increase the total number of MACs pending to be configured */
@@ -3223,7 +3206,6 @@ static int bnx2x_mcast_validate_e1(struct bnx2x *bp,default :BNX2X_ERR ("Unknown command: %d\n" , cmd);return -EINVAL ; - }/* We want to ensure that commands are executed one by one for 57710.
@@ -3342,7 +3324,6 @@ static inline int bnx2x_mcast_handle_restore_cmd_e1(return -1 ; } -static inline int bnx2x_mcast_handle_pending_cmds_e1 (struct bnx2x *bp,struct bnx2x_mcast_ramrod_params *p) {
@@ -3352,7 +3333,6 @@ static inline int bnx2x_mcast_handle_pending_cmds_e1(union bnx2x_mcast_config_data cfg_data = {NULL };int cnt =0 ; -/* If nothing to be done - return */ if (list_empty (&o->pending_cmds_head))return 0 ;
@@ -3550,7 +3530,6 @@ static int bnx2x_mcast_setup_e1(struct bnx2x *bp,/* Ramrod completion is pending */ return 1 ; } - }static int bnx2x_mcast_get_registry_size_exact (struct bnx2x_mcast_obj *o)
@@ -3848,7 +3827,6 @@ static bool bnx2x_credit_pool_always_true(struct bnx2x_credit_pool_obj *o,return true; } -static bool bnx2x_credit_pool_get_entry (struct bnx2x_credit_pool_obj *o,int *offset)
@@ -4018,7 +3996,6 @@ void bnx2x_init_mac_credit_pool(struct bnx2x *bp,/* this should never happen! Block MAC operations. */ bnx2x_init_credit_pool (p,0 ,0 ); } - } }
@@ -4215,7 +4192,6 @@ int bnx2x_config_rss(struct bnx2x *bp,return rc; } - void bnx2x_init_rss_config_obj(struct bnx2x *bp, struct bnx2x_rss_config_obj *rss_obj, u8 cl_id, u32 cid, u8 func_id, u8 engine_id,
@@ -4288,7 +4264,6 @@ int bnx2x_queue_state_change(struct bnx2x *bp,return !!test_bit (pending_bit, pending); } -static int bnx2x_queue_set_pending (struct bnx2x_queue_sp_obj *obj,struct bnx2x_queue_state_params *params) {
@@ -4403,7 +4378,6 @@ static void bnx2x_q_fill_init_general_data(struct bnx2x *bp, gen_data->mtu =cpu_to_le16 (params->mtu); gen_data->func_id = o->func_id; - gen_data->cos = params->cos; gen_data->traffic_type =
@@ -4530,7 +4504,6 @@ static void bnx2x_q_fill_init_rx_data(struct bnx2x_queue_sp_obj *o,cpu_to_le16 (params->silent_removal_value); rx_data->silent_vlan_mask =cpu_to_le16 (params->silent_removal_mask); - }/* initialize the general, tx and rx parts of a queue object */
@@ -4706,7 +4679,6 @@ static inline int bnx2x_q_send_setup_tx_only(struct bnx2x *bp, ¶ms->params.tx_only;u8 cid_index = tx_only_params->cid_index; -if (cid_index >= o->max_cos) {BNX2X_ERR ("queue[%d]: cid_index (%d) is out of range\n" , o->cl_id, cid_index);
@@ -4816,7 +4788,6 @@ static inline int bnx2x_q_send_update(struct bnx2x *bp,return -EINVAL ; } -/* Clear the ramrod data */ memset (rdata,0 ,sizeof (*rdata));
@@ -5636,7 +5607,6 @@ static inline void bnx2x_func_reset_cmn(struct bnx2x *bp, drv->reset_hw_cmn (bp); } -static inline int bnx2x_func_hw_reset (struct bnx2x *bp,struct bnx2x_func_state_params *params) {
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h +0 -1
@@ -1377,7 +1377,6 @@ void bnx2x_init_vlan_credit_pool(struct bnx2x *bp, struct bnx2x_credit_pool_obj *p, u8 func_id, u8 func_num); -/****************** RSS CONFIGURATION ****************/ void bnx2x_init_rss_config_obj(struct bnx2x *bp, struct bnx2x_rss_config_obj *rss_obj,
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +0 -1
@@ -3024,7 +3024,6 @@ void bnx2x_unlock_vf_pf_channel(struct bnx2x *bp, struct bnx2x_virtf *vf,int bnx2x_sriov_configure (struct pci_dev *dev,int num_vfs_param) { -struct bnx2x *bp =netdev_priv (pci_get_drvdata (dev)); DP(BNX2X_MSG_IOV, "bnx2x_sriov_configure called with %d, BNX2X_NR_VIRTFN(bp) was %d\n",
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h +0 -1
@@ -722,7 +722,6 @@ u32 bnx2x_crc_vf_bulletin(struct bnx2x *bp, struct pf_vf_bulletin_content *bulletin);int bnx2x_post_vf_bulletin (struct bnx2x *bp,int vf); -enum sample_bulletin_result bnx2x_sample_bulletin (struct bnx2x *bp);/* VF side vfpf channel functions */
drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c +0 -1
@@ -1002,7 +1002,6 @@ static int bnx2x_storm_stats_update(struct bnx2x *bp) qstats->valid_bytes_received_lo = qstats->total_bytes_received_lo; -UPDATE_EXTEND_TSTAT (rcv_ucast_pkts, total_unicast_packets_received); UPDATE_EXTEND_TSTAT(rcv_mcast_pkts,
drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h +0 -4
@@ -40,7 +40,6 @@ struct nig_stats {u32 egress_mac_pkt1_hi; }; -enum bnx2x_stats_event {STATS_EVENT_PMF =0 ,STATS_EVENT_LINK_UP ,
@@ -208,7 +207,6 @@ struct bnx2x_eth_stats {u32 eee_tx_lpi; }; -struct bnx2x_eth_q_stats {u32 total_unicast_bytes_received_hi;u32 total_unicast_bytes_received_lo;
@@ -331,7 +329,6 @@ struct bnx2x_fw_port_stats_old {u32 mac_discard; }; -/**************************************************************************** * Macros ****************************************************************************/
@@ -536,7 +533,6 @@ struct bnx2x_fw_port_stats_old { SUB_EXTEND_64(qstats->t##_hi, qstats->t##_lo, diff); \ }while (0 ) -/* forward */ struct bnx2x;
Signature · 1 line
1.8.1.227.g44fe835
PATCH 2/5 bnx2x: Revise comments and alignment
In reply to Yuval MintzThis patch correct various typos, fix comments conventions and adds/removes a few comments.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 25 +- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 48 ++-- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 4 +- drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c | 37 +-- drivers/net/ethernet/broadcom/bnx2x/bnx2x_dump.h | 6 - .../net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 10 +- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 81 ++++--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 254 +++++++++------------ drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h | 54 ++--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 29 +-- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h | 2 +- drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c | 8 +- 12 files changed, 251 insertions(+), 307 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +13 -12
@@ -362,7 +362,7 @@ union db_prod {/* * Number of required SGEs is the sum of two: * 1. Number of possible opened aggregations (next packet for -* these aggregations will probably consume SGE immidiatelly) +* these aggregations will probably consume SGE immediately) * 2. Rest of BRB blocks divided by 2 (block will consume new SGE only * after placement on BD for new TPA aggregation) *
@@ -486,10 +486,10 @@ struct bnx2x_fastpath {struct napi_struct napi;union host_hc_status_block status_blk; -/* chip independed shortcuts into sb structure */ +/* chip independent shortcuts into sb structure */ __le16 *sb_index_values;__le16 *sb_running_index; -/* chip independed shortcut into rx_prods_offset memory */ +/* chip independent shortcut into rx_prods_offset memory */ u32 ustorm_rx_prods_offset;u32 rx_buf_size;
@@ -603,7 +603,7 @@ struct bnx2x_fastpath {* START_BD(splitted) - includes unpaged data segment for GSO * PARSING_BD - for TSO and CSUM data * PARSING_BD2 - for encapsulation data -* Frag BDs - decribes pages for frags +* Frag BDs - describes pages for frags */ #define BDS_PER_TX_PKT 4#define MAX_BDS_PER_TX_PKT (MAX_SKB_FRAGS + BDS_PER_TX_PKT)
@@ -886,14 +886,14 @@ struct bnx2x_common {#define CHIP_IS_E3A0 (bp) (CHIP_IS_E3(bp) && \ (CHIP_REV(bp) == CHIP_REV_Ax))/* This define is used in two main places: -* 1. In the early stages of nic_load, to know if to configrue Parser / Searcher +* 1. In the early stages of nic_load, to know if to configure Parser / Searcher * to nic-only mode or to offload mode. Offload mode is configured if either the * chip is E1x (where MIC_MODE register is not applicable), or if cnic already * registered for this port (which means that the user wants storage services). * 2. During cnic-related load, to know if offload mode is already configured in -* the HW or needs to be configrued. +* the HW or needs to be configured. * Since the transition from nic-mode to offload-mode in HW causes traffic -* coruption, nic-mode is configured only in ports on which storage services +* corruption, nic-mode is configured only in ports on which storage services * where never requested. */ #define CONFIGURE_NIC_MODE (bp) (!CHIP_IS_E1x(bp) && !CNIC_ENABLED(bp))
@@ -994,14 +994,14 @@ extern struct workqueue_struct *bnx2x_wq;* If the maximum number of FP-SB available is X then: * a. If CNIC is supported it consumes 1 FP-SB thus the max number of * regular L2 queues is Y=X-1 -* b. in MF mode the actual number of L2 queues is Y= (X-1/MF_factor) +* b. In MF mode the actual number of L2 queues is Y= (X-1/MF_factor) * c. If the FCoE L2 queue is supported the actual number of L2 queues * is Y+1 * d. The number of irqs (MSIX vectors) is either Y+1 (one extra for * slow-path interrupts) or Y+2 if CNIC is supported (one additional * FP interrupt context for the CNIC). * e. The number of HW context (CID count) is always X or X+1 if FCoE -* L2 queue is supported. the cid for the FCoE L2 queue is always X. +* L2 queue is supported. The cid for the FCoE L2 queue is always X. */ /* fast-path interrupt contexts E1x */
@@ -1568,7 +1568,7 @@ struct bnx2x {struct mutex cnic_mutex;struct bnx2x_vlan_mac_obj iscsi_l2_mac_obj; -/* Start index of the "special" (CNIC related) L2 cleints */ +/* Start index of the "special" (CNIC related) L2 clients */ u8 cnic_base_cl_id;int dmae_ready;
@@ -1682,7 +1682,7 @@ struct bnx2x {/* operation indication for the sp_rtnl task */ unsigned long sp_rtnl_state; -/* DCBX Negotation results */ +/* DCBX Negotiation results */ struct dcbx_features dcbx_local_feat;u32 dcbx_error;
@@ -2042,7 +2042,8 @@ void bnx2x_igu_clear_sb_gen(struct bnx2x *bp, u8 func, u8 idu_sb_id,#define DMAE_LEN32_WR_MAX (bp) (CHIP_IS_E1(bp) ? 0x400 : 0x2000)#define DMAE_COMP_VAL 0x60d0d0ae/* E2 and on - upper bit -indicates eror */ +* indicates error +*/ #define MAX_DMAE_C_PER_PORT 8#define INIT_DMAE_C (bp) (BP_PORT(bp) * MAX_DMAE_C_PER_PORT + \
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +23 -25
175 lines not on this page · raw message
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +2 -2
@@ -1331,8 +1331,8 @@ static inline bool bnx2x_mtu_allows_gro(int mtu)int fpp =SGE_PAGE_SIZE / (mtu -ETH_MAX_TPA_HEADER_SIZE );/* -* 1. number of frags should not grow above MAX_SKB_FRAGS -* 2. frag must fit the page +* 1. Number of frags should not grow above MAX_SKB_FRAGS +* 2. Frag must fit the page */ return mtu <=SGE_PAGE_SIZE && (U_ETH_SGL_SIZE * fpp) <=MAX_SKB_FRAGS ; }
drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c +20 -17
@@ -687,7 +687,7 @@ static inline void bnx2x_dcbx_update_tc_mapping(struct bnx2x *bp) }/* setup tc must be called under rtnl lock, but we can't take it here -* as we are handling an attetntion on a work queue which must be +* 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))
@@ -707,7 +707,7 @@ void bnx2x_dcbx_set_params(struct bnx2x *bp, u32 state)*/ bnx2x_dcbnl_update_applist (bp, true); -/* Read rmeote mib if dcbx is in the FW */ +/* Read remote mib if dcbx is in the FW */ if (bnx2x_dcbx_read_shmem_remote_mib (bp))return ;#endif
@@ -738,7 +738,7 @@ void bnx2x_dcbx_set_params(struct bnx2x *bp, u32 state)bnx2x_dcbx_update_tc_mapping (bp);/* -* allow other funtions to update their netdevices +* allow other functions to update their netdevices * accordingly */ if (IS_MF (bp))
@@ -860,7 +860,7 @@ static void bnx2x_dcbx_admin_mib_updated_params(struct bnx2x *bp, i, DCBX_PRI_PG_GET(af->ets.pri_pg_tbl, i)); } -/*For IEEE admin_recommendation_bw_precentage +/*For IEEE admin_recommendation_bw_percentage *For IEEE admin_recommendation_ets_pg */ af->pfc.pri_en_bitmap = (u8 )dp->admin_pfc_bitmap;for (i =0 ; i <DCBX_CONFIG_MAX_APP_PROTOCOL ; i++) {
@@ -1070,7 +1070,7 @@ static void bnx2x_dcbx_get_num_pg_traf_type(struct bnx2x *bp,bool pg_found = false;u32 i, traf_type, add_traf_type, add_pg;u32 *ttp = bp->dcbx_port_params.app.traffic_type_priority; -struct pg_entry_help_data *data = help_data->data;/*shotcut*/ +struct pg_entry_help_data *data = help_data->data;/*shortcut*/ /* Set to invalid */ for (i =0 ; i <LLFC_DRIVER_TRAFFIC_TYPE_MAX ; i++)
@@ -1166,7 +1166,8 @@ static void bnx2x_dcbx_separate_pauseable_from_non(struct bnx2x *bp, DCBX_PG_BW_GET(ets->pg_bw_tbl, pg_entry)); else/* If we join a group and one is strict -* than the bw rulls */ +* than the bw rules +*/ cos_data->data[entry].strict =BNX2X_DCBX_STRICT_COS_HIGHEST ; }
@@ -1277,7 +1278,7 @@ static void bnx2x_dcbx_2cos_limit_cee_single_pg_to_cos_params(struct bnx2x *bp, }else {/* If there are only pauseable priorities or * only non-pauseable,* the lower priorities go -* to the first queue and the higherpriorities go +* to the first queue and the higher priorities go * to the second queue. */ cos_data->data[0].pausable =
@@ -1477,7 +1478,7 @@ static void bnx2x_dcbx_2cos_limit_cee_three_pg_to_cos_params(* queue and one priority goes to the second queue. * * We will join this two cases: -* if one is BW limited it will go to the secoend queue +* if one is BW limited it will go to the second queue * otherwise the last priority will get it */
@@ -1497,7 +1498,8 @@ static void bnx2x_dcbx_2cos_limit_cee_three_pg_to_cos_params( false == b_found_strict)/* last entry will be handled separately * If no priority is strict than last -* enty goes to last queue.*/ +* entry goes to last queue. +*/ entry =1 ; cos_data->data[entry].pri_join_mask |= pri_tested;
@@ -1509,7 +1511,8 @@ static void bnx2x_dcbx_2cos_limit_cee_three_pg_to_cos_params( b_found_strict = true; cos_data->data[1 ].pri_join_mask |= pri_tested;/* If we join a group and one is strict -* than the bw rulls */ +* than the bw rules +*/ cos_data->data[1 ].strict =BNX2X_DCBX_STRICT_COS_HIGHEST ; }
@@ -1838,7 +1841,7 @@ static void bnx2x_dcbx_fw_struct(struct bnx2x *bp,void bnx2x_dcbx_pmf_update (struct bnx2x *bp) { -/* if we need to syncronize DCBX result from prev PMF +/* if we need to synchronize DCBX result from prev PMF * read it from shmem and update bp and netdev accordingly */ if (SHMEM2_HAS(bp, drv_flags) &&
@@ -1932,14 +1935,14 @@ static void bnx2x_dcbnl_set_pg_tccfg_tx(struct net_device *netdev, int prio,return ;/** -* bw_pct ingnored - band-width percentage devision between user +* bw_pct ignored - band-width percentage devision between user * priorities within the same group is not * standard and hence not supported * -* prio_type igonred - priority levels within the same group are not +* prio_type ignored - priority levels within the same group are not * standard and hence are not supported. According * to the standard pgid 15 is dedicated to strict -* prioirty traffic (on the port level). +* priority traffic (on the port level). * * up_map ignored */
@@ -1984,14 +1987,14 @@ static void bnx2x_dcbnl_get_pg_tccfg_tx(struct net_device *netdev, int prio,DP (BNX2X_MSG_DCB ,"prio = %d\n" , prio);/** -* bw_pct ingnored - band-width percentage devision between user +* bw_pct ignored - band-width percentage devision between user * priorities within the same group is not * standard and hence not supported * -* prio_type igonred - priority levels within the same group are not +* prio_type ignored - priority levels within the same group are not * standard and hence are not supported. According * to the standard pgid 15 is dedicated to strict -* prioirty traffic (on the port level). +* priority traffic (on the port level). * * up_map ignored */
drivers/net/ethernet/broadcom/bnx2x/bnx2x_dump.h +0 -6
@@ -13,12 +13,6 @@* consent. */ - -/* This struct holds a signature to ensure the dump returned from the driver -* match the meta data file inserted to grc_dump.tcl -* The signature is time stamp, diag version and grc_dump version -*/ -#ifndef BNX2X_DUMP_H #define BNX2X_DUMP_H
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +5 -5
@@ -320,7 +320,7 @@ 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 received a request for an unknown duplex, assume full*/ if (cmd->duplex ==DUPLEX_UNKNOWN ) cmd->duplex =DUPLEX_FULL ;
@@ -849,7 +849,7 @@ static int __bnx2x_get_preset_regs(struct bnx2x *bp, u32 *p, u32 preset)/* Paged registers are supported in E2 & E3 only */ if (CHIP_IS_E2 (bp) ||CHIP_IS_E3 (bp)) { -/* Read "paged" registes */ +/* Read "paged" registers */ bnx2x_read_pages_regs (bp, p, preset); }
@@ -1154,8 +1154,8 @@ static int bnx2x_get_eeprom_len(struct net_device *dev)return bp->common.flash_size; } -/* Per pf misc lock must be aquired before the per port mcp lock. Otherwise, had -* we done things the other way around, if two pfs from the same port would +/* Per pf misc lock must be acquired before the per port mcp lock. Otherwise, +* had we done things the other way around, if two pfs from the same port would * attempt to access nvram at the same time, we could run into a scenario such * as: * pf A takes the port lock.
@@ -2070,7 +2070,7 @@ static int bnx2x_set_eee(struct net_device *dev, struct ethtool_eee *edata)EEE_MODE_OVERRIDE_NVRAM |EEE_MODE_OUTPUT_TIME ; -/* Restart link to propogate changes */ +/* Restart link to propagate changes */ if (netif_running (dev)) {bnx2x_stats_handle (bp,STATS_EVENT_STOP );bnx2x_force_link_reset (bp);
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +40 -41
281 lines not on this page · raw message
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +105 -149
637 lines not on this page · raw message
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h +22 -32
159 lines not on this page · raw message
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +16 -13
@@ -1341,7 +1341,7 @@ int bnx2x_vfop_qdown_cmd(struct bnx2x *bp,*/ /* internal vf enable - until vf is enabled internally all transactions -* are blocked. this routine should always be called last with pretend. +* are blocked. This routine should always be called last with pretend. */ static void bnx2x_vf_enable_internal (struct bnx2x *bp,u8 enable) {
@@ -1743,7 +1743,7 @@ void bnx2x_iov_init_dq(struct bnx2x *bp)REG_WR (bp,DORQ_REG_VF_TYPE_MIN_MCID_0 ,0 );REG_WR (bp,DORQ_REG_VF_TYPE_MAX_MCID_0 ,0x1ffff ); -/* set the number of VF alllowed doorbells to the full DQ range */ +/* set the number of VF allowed doorbells to the full DQ range */ REG_WR (bp,DORQ_REG_VF_NORM_MAX_CID_COUNT ,0x20000 );/* set the VF doorbell threshold */
@@ -2403,7 +2403,7 @@ int bnx2x_iov_eq_sp_event(struct bnx2x *bp, union event_ring_elem *elem)/* extract vf and rxq index from vf_cid - relies on the following: * 1. vfid on cid reflects the true abs_vfid -* 2. the max number of VFs (per path) is 64 +* 2. The max number of VFs (per path) is 64 */ qidx = cid & ((1 <<BNX2X_VF_CID_WND )-1 ); abs_vfid = (cid >>BNX2X_VF_CID_WND ) & (BNX2X_MAX_NUM_OF_VFS -1 );
@@ -2461,7 +2461,7 @@ static struct bnx2x_virtf *bnx2x_vf_by_cid(struct bnx2x *bp, int vf_cid) {/* extract the vf from vf_cid - relies on the following: * 1. vfid on cid reflects the true abs_vfid -* 2. the max number of VFs (per path) is 64 +* 2. The max number of VFs (per path) is 64 */ int abs_vfid = (vf_cid >>BNX2X_VF_CID_WND ) & (BNX2X_MAX_NUM_OF_VFS -1 );return bnx2x_vf_by_abs_fid (bp, abs_vfid);
@@ -2480,7 +2480,7 @@ void bnx2x_iov_set_queue_sp_obj(struct bnx2x *bp, int vf_cid,if (vf) {/* extract queue index from vf_cid - relies on the following: * 1. vfid on cid reflects the true abs_vfid -* 2. the max number of VFs (per path) is 64 +* 2. The max number of VFs (per path) is 64 */ int q_index = vf_cid & ((1 <<BNX2X_VF_CID_WND )-1 ); *q_obj = &bnx2x_vfq (vf, q_index, sp_obj);
@@ -2705,7 +2705,7 @@ int bnx2x_vf_acquire(struct bnx2x *bp, struct bnx2x_virtf *vf, }/* static allocation: -* the global maximum number are fixed per VF. fail the request if +* the global maximum number are fixed per VF. Fail the request if * requested number exceed these globals */ if (!bnx2x_vf_chk_avail_resc (bp, vf, resc)) {
@@ -2890,7 +2890,7 @@ int bnx2x_vfop_close_cmd(struct bnx2x *bp,return -ENOMEM ; } -/* VF release can be called either: 1. the VF was acquired but +/* VF release can be called either: 1. The VF was acquired but * not enabled 2. the vf was enabled or in the process of being * enabled */
@@ -3140,7 +3140,7 @@ int bnx2x_get_vf_config(struct net_device *dev, int vfidx,/* mac configured by ndo so its in bulletin board */ memcpy (&ivi->mac, bulletin->mac,ETH_ALEN ); else - /* funtion has not been loaded yet. Show mac as 0s */ + /* function has not been loaded yet. Show mac as 0s */ memset(&ivi->mac, 0, ETH_ALEN);/* vlan */
@@ -3148,7 +3148,7 @@ int bnx2x_get_vf_config(struct net_device *dev, int vfidx,/* vlan configured by ndo so its in bulletin board */ memcpy (&ivi->vlan, &bulletin->vlan,VLAN_HLEN ); else - /* funtion has not been loaded yet. Show vlans as 0s */ + /* function has not been loaded yet. Show vlans as 0s */ memset(&ivi->vlan, 0, VLAN_HLEN); }
@@ -3188,7 +3188,7 @@ int bnx2x_set_vf_mac(struct net_device *dev, int vfidx, u8 *mac)return -EINVAL ; } -/* update PF's copy of the VF's bulletin. will no longer accept mac +/* update PF's copy of the VF's bulletin. Will no longer accept mac * configuration requests from vf unless match this mac */ bulletin->valid_bitmap |=1 <<MAC_ADDR_VALID ;
@@ -3357,8 +3357,11 @@ int bnx2x_set_vf_vlan(struct net_device *dev, int vfidx, u16 vlan, u8 qos)return 0 ; } -/* crc is the first field in the bulletin board. compute the crc over the -* entire bulletin board excluding the crc field itself +/* crc is the first field in the bulletin board. Compute the crc over the +* entire bulletin board excluding the crc field itself. Use the length field +* as the Bulletin Board was posted by a PF with possibly a different version +* from the vf which will sample it. Therefore, the length is computed by the +* PF and the used blindly by the VF. */ u32 bnx2x_crc_vf_bulletin (struct bnx2x *bp,struct pf_vf_bulletin_content *bulletin)
@@ -3451,7 +3454,7 @@ int bnx2x_open_epilog(struct bnx2x *bp)* register_netdevice which must have rtnl lock taken. As we are holding * the lock right now, that could only work if the probe would not take * the lock. However, as the probe of the vf may be called from other -* contexts as well (such as passthrough to vm failes) it can't assume +* contexts as well (such as passthrough to vm fails) it can't assume * the lock is being held for it. Using delayed work here allows the * probe code to simply take the lock (i.e. wait for it to be released * if it is being held). We only want to do this if the number of VFs
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h +1 -1
@@ -197,7 +197,7 @@ struct bnx2x_virtf {u8 state;#define VF_FREE 0/* VF ready to be acquired holds no resc */ -#define VF_ACQUIRED 1/* VF aquired, but not initalized */ +#define VF_ACQUIRED 1/* VF acquired, but not initialized */ #define VF_ENABLED 2/* VF Enabled */ #define VF_RESET 3/* VF FLR'd, pending cleanup */
drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c +4 -4
@@ -233,7 +233,7 @@ int bnx2x_vfpf_acquire(struct bnx2x *bp, u8 tx_count, u8 rx_count) attempts++; -/* test whether the PF accepted our request. If not, humble the +/* test whether the PF accepted our request. If not, humble * the request and try again. */ if (bp->acquire_resp.hdr.status ==PFVF_STATUS_SUCCESS ) {
@@ -787,7 +787,7 @@ static inline void bnx2x_set_vf_mbxs_valid(struct bnx2x *bp)storm_memset_vf_mbx_valid (bp,bnx2x_vf (bp, i, abs_vfid)); } -/* enable vf_pf mailbox (aka vf-pf-chanell) */ +/* enable vf_pf mailbox (aka vf-pf-channel) */ void bnx2x_vf_enable_mbx (struct bnx2x *bp,u8 abs_vfid) {bnx2x_vf_flr_clnup_epilog (bp, abs_vfid);
@@ -1072,7 +1072,7 @@ static void bnx2x_vf_mbx_set_q_flags(struct bnx2x *bp, u32 mbx_q_flags,if (mbx_q_flags &VFPF_QUEUE_FLG_DHC )__set_bit (BNX2X_Q_FLG_DHC , sp_q_flags); -/* outer vlan removal is set according to the PF's multi fuction mode */ +/* outer vlan removal is set according to PF's multi function mode */ if (IS_MF_SD (bp))__set_bit (BNX2X_Q_FLG_OV , sp_q_flags); }
@@ -1104,7 +1104,7 @@ static void bnx2x_vf_mbx_setup_q(struct bnx2x *bp, struct bnx2x_virtf *vf,struct bnx2x_queue_init_params *init_p;struct bnx2x_queue_setup_params *setup_p; -/* reinit the VF operation context */ +/* re-init the VF operation context */ memset (&vf->op_params.qctor,0 ,sizeof (vf->op_params.qctor)); setup_p = &vf->op_params.qctor.prep_qsetup; init_p = &vf->op_params.qctor.qstate.params.init;
Signature · 1 line
1.8.1.227.g44fe835
PATCH 3/5 bnx2x: Semantic removal and beautification
In reply to Yuval MintzThis patch introduces several small changes to the driver, none which actually change any flow:
1. Removes prototypes of unexisting functions and unused defines.
2. Fixes alignment and spacing issues.
3. Changes numeric usage into constants.
4. Remove unnecessary parenthesis.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 3 --- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 32 ++++++++++-------------- 2 files changed, 13 insertions(+), 22 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +0 -3
@@ -493,9 +493,6 @@ void bnx2x_update_max_mf_config(struct bnx2x *bp, u32 value);/* Error handling */ void bnx2x_fw_dump_lvl (struct bnx2x *bp,const char *lvl); -/* validate currect fw is loaded */ -bool bnx2x_test_firmware_version (struct bnx2x *bp,bool is_err); -/* dev_close main block */ int bnx2x_nic_unload (struct bnx2x *bp,int unload_mode,bool keep_link);
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +13 -19
@@ -102,8 +102,6 @@ static int disable_tpa;module_param (disable_tpa, int,0 );MODULE_PARM_DESC (disable_tpa," Disable the TPA (LRO) feature" ); -#define INT_MODE_INTx 1 -#define INT_MODE_MSI 2int int_mode;module_param (int_mode, int,0 ); MODULE_PARM_DESC(int_mode, " Force interrupt mode other than MSI-X "
@@ -3068,7 +3066,7 @@ static void bnx2x_pf_rx_q_prep(struct bnx2x *bp,* placed on the BD (not including paddings). */ rxq_init->buf_sz = fp->rx_buf_size -BNX2X_FW_RX_ALIGN_START - -BNX2X_FW_RX_ALIGN_END -IP_HEADER_ALIGNMENT_PADDING ; +BNX2X_FW_RX_ALIGN_END -IP_HEADER_ALIGNMENT_PADDING ; rxq_init->cl_qzone_id = fp->cl_qzone_id; rxq_init->tpa_agg_sz = tpa_agg_size;
@@ -3619,15 +3617,14 @@ static int bnx2x_acquire_alr(struct bnx2x *bp)might_sleep ();for (j =0 ; j <1000 ; j++) { - val = (1UL <<31 ); -REG_WR (bp,GRCBASE_MCP +0x9c , val); - val =REG_RD (bp,GRCBASE_MCP +0x9c ); -if (val & (1L <<31 )) +REG_WR (bp,MCP_REG_MCPR_ACCESS_LOCK ,MCPR_ACCESS_LOCK_LOCK ); + val =REG_RD (bp,MCP_REG_MCPR_ACCESS_LOCK ); +if (val &MCPR_ACCESS_LOCK_LOCK )break ;msleep (5 ); } -if (!(val & (1L <<31 ))) { +if (!(val &MCPR_ACCESS_LOCK_LOCK )) {BNX2X_ERR ("Cannot acquire MCP access lock register\n" ); rc = -EBUSY ; }
@@ -3638,7 +3635,7 @@ static int bnx2x_acquire_alr(struct bnx2x *bp)/* release split MCP access lock register */ static void bnx2x_release_alr (struct bnx2x *bp) { -REG_WR (bp,GRCBASE_MCP +0x9c ,0 ); +REG_WR (bp,MCP_REG_MCPR_ACCESS_LOCK ,0 ); }#define BNX2X_DEF_SB_ATT_IDX 0x0001
@@ -4086,7 +4083,7 @@ static void bnx2x_clear_reset_global(struct bnx2x *bp)*/ static bool bnx2x_reset_is_global (struct bnx2x *bp) { -u32 val =REG_RD (bp,BNX2X_RECOVERY_GLOB_REG ); +u32 val =REG_RD (bp,BNX2X_RECOVERY_GLOB_REG );DP (NETIF_MSG_HW ,"GEN_REG_VAL=0x%08x\n" , val);return (val &BNX2X_GLOBAL_RESET_BIT ) ? true : false;
@@ -4137,7 +4134,7 @@ void bnx2x_set_reset_in_progress(struct bnx2x *bp)*/ bool bnx2x_reset_is_done (struct bnx2x *bp,int engine) { -u32 val =REG_RD (bp,BNX2X_RECOVERY_GLOB_REG ); +u32 val =REG_RD (bp,BNX2X_RECOVERY_GLOB_REG );u32 bit = engine ?BNX2X_PATH1_RST_IN_PROG_BIT :BNX2X_PATH0_RST_IN_PROG_BIT ;
@@ -6013,11 +6010,6 @@ void bnx2x_pre_irq_nic_init(struct bnx2x *bp)bnx2x_init_rx_rings (bp);bnx2x_init_tx_rings (bp); -if (IS_VF (bp)) { -bnx2x_memset_stats (bp); -return ; - } -if (IS_PF (bp)) {/* Initialize MOD_ABS interrupts */ bnx2x_init_mod_abs_int(bp, &bp->link_vars, bp->common.chip_id,
@@ -6028,6 +6020,8 @@ void bnx2x_pre_irq_nic_init(struct bnx2x *bp)bnx2x_init_def_sb (bp);bnx2x_update_dsb_idx (bp);bnx2x_init_sp_ring (bp); + }else { +bnx2x_memset_stats (bp); } }
@@ -10011,7 +10005,7 @@ static int bnx2x_prev_unload(struct bnx2x *bp) (MISC_REG_DRIVER_CONTROL_1 + BP_FUNC(bp) * 8) : (MISC_REG_DRIVER_CONTROL_7 + (BP_FUNC (bp) -6 ) *8 ); - hw_lock_val = (REG_RD (bp, hw_lock_reg)); + hw_lock_val =REG_RD (bp, hw_lock_reg);if (hw_lock_val) {if (hw_lock_val &HW_LOCK_RESOURCE_NVRAM ) {BNX2X_DEV_INFO ("Release Previously held NVRAM lock\n" );
@@ -10026,7 +10020,7 @@ static int bnx2x_prev_unload(struct bnx2x *bp)if (MCPR_ACCESS_LOCK_LOCK ®_RD (bp,MCP_REG_MCPR_ACCESS_LOCK )) {BNX2X_DEV_INFO ("Release previously held alr\n" ); -REG_WR (bp,MCP_REG_MCPR_ACCESS_LOCK ,0 ); +bnx2x_release_alr (bp); } do {
@@ -11878,7 +11872,7 @@ static const struct net_device_ops bnx2x_netdev_ops = { .ndo_setup_tc = bnx2x_setup_tc,#ifdef CONFIG_BNX2X_SRIOV .ndo_set_vf_mac = bnx2x_set_vf_mac, - .ndo_set_vf_vlan = bnx2x_set_vf_vlan, + .ndo_set_vf_vlan = bnx2x_set_vf_vlan, .ndo_get_vf_config = bnx2x_get_vf_config,#endif #ifdef NETDEV_FCOE_WWNN
Signature · 1 line
1.8.1.227.g44fe835
PATCH 4/5 bnx2x: Revise prints
In reply to Yuval MintzThis patch revises many bnx2x prints - mainly fixing print typos and adding some new debug prints (mostly for parity issues).
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 1 - drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 8 +- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 16 +- drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c | 4 +- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 257 ++++++++++++++++------ drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h | 6 + drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 6 +- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h | 2 +- drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c | 8 +- 9 files changed, 224 insertions(+), 84 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +0 -1
@@ -1900,7 +1900,6 @@ u32 bnx2x_dmae_opcode(struct bnx2x *bp, u8 src_type, u8 dst_type,void bnx2x_prep_dmae_with_comp (struct bnx2x *bp,struct dmae_command *dmae,u8 src_type,u8 dst_type);int bnx2x_issue_dmae_with_comp (struct bnx2x *bp,struct dmae_command *dmae); -void bnx2x_dp_dmae (struct bnx2x *bp,struct dmae_command *dmae,int msglvl);/* FLR related routines */ u32 bnx2x_flr_clnup_poll_count (struct bnx2x *bp);
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +4 -4
@@ -2162,10 +2162,10 @@ static int bnx2x_alloc_fw_stats_mem(struct bnx2x *bp) bp->fw_stats_data_mapping = bp->fw_stats_mapping + bp->fw_stats_req_sz; -DP (BNX2X_MSG_SP ,"statistics request base address set to %x %x" , +DP (BNX2X_MSG_SP ,"statistics request base address set to %x %x\n" ,U64_HI (bp->fw_stats_req_mapping),U64_LO (bp->fw_stats_req_mapping)); -DP (BNX2X_MSG_SP ,"statistics data base address set to %x %x" , +DP (BNX2X_MSG_SP ,"statistics data base address set to %x %x\n" ,U64_HI (bp->fw_stats_data_mapping),U64_LO (bp->fw_stats_data_mapping));return 0 ;
@@ -2240,7 +2240,7 @@ int bnx2x_nic_load_analyze_req(struct bnx2x *bp, u32 load_code)/* abort nic load if version mismatch */ if (my_fw != loaded_fw) { -BNX2X_ERR ("bnx2x with FW %x was already loaded which mismatches my %x FW. aborting\n" , +BNX2X_ERR ("bnx2x with FW %x was already loaded which mismatches my %x FW. Aborting\n" , loaded_fw, my_fw);return -EBUSY ; }
@@ -3977,7 +3977,7 @@ int bnx2x_setup_tc(struct net_device *dev, u8 num_tc)/* requested to support too many traffic classes */ if (num_tc > bp->max_cos) { -BNX2X_ERR ("support for too many traffic classes requested: %d. max supported is %d\n" , +BNX2X_ERR ("support for too many traffic classes requested: %d. Max supported is %d\n" , num_tc, bp->max_cos);return -EINVAL ; }
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +9 -7
@@ -49,13 +49,15 @@ extern int int_mode; } \ } while (0) -#define BNX2X_PCI_ALLOC (x, y, size) \ -do { \ - x = dma_alloc_coherent(&bp->pdev->dev, size, y, \ - GFP_KERNEL | __GFP_ZERO); \ - if (x == NULL) \ - goto alloc_mem_err; \ -} while (0) +#define BNX2X_PCI_ALLOC (x, y, size) \ + do { \ + x = dma_alloc_coherent(&bp->pdev->dev, size, y, \ + GFP_KERNEL | __GFP_ZERO); \ + if (x == NULL) \ + goto alloc_mem_err; \ + DP(NETIF_MSG_HW, "BNX2X_PCI_ALLOC: Physical %Lx Virtual %p\n", \ + (unsigned long long)(*y), x); \ + } while (0)#define BNX2X_ALLOC (x, size) \ do { \
drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c +2 -2
@@ -2381,7 +2381,7 @@ static u8 bnx2x_dcbnl_get_featcfg(struct net_device *netdev, int featid, *flags |=DCB_FEATCFG_ERROR ;break ;default : -BNX2X_ERR ("Non valid featrue-ID\n" ); +BNX2X_ERR ("Non valid feature-ID\n" ); rval =1 ;break ; }
@@ -2422,7 +2422,7 @@ static u8 bnx2x_dcbnl_set_featcfg(struct net_device *netdev, int featid, flags &DCB_FEATCFG_WILLING ?1 :0 ;break ;default : -BNX2X_ERR ("Non valid featrue-ID\n" ); +BNX2X_ERR ("Non valid feature-ID\n" ); rval =1 ;break ; }
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +195 -62
520 lines not on this page · raw message
drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h +6 -0
@@ -35,6 +35,8 @@#define ATC_REG_ATC_INT_STS_CLR 0x1101c0/* [RW 5] Parity mask register #0 read/write */ #define ATC_REG_ATC_PRTY_MASK 0x1101d8 +/* [R 5] Parity register #0 read */ +#define ATC_REG_ATC_PRTY_STS 0x1101cc/* [RC 5] Parity register #0 read clear */ #define ATC_REG_ATC_PRTY_STS_CLR 0x1101d0/* [RW 19] Interrupt mask register #0 read/write */
@@ -2750,6 +2752,8 @@#define PBF_REG_PBF_INT_STS 0x1401c8/* [RW 20] Parity mask register #0 read/write */ #define PBF_REG_PBF_PRTY_MASK 0x1401e4 +/* [R 28] Parity register #0 read */ +#define PBF_REG_PBF_PRTY_STS 0x1401d8/* [RC 20] Parity register #0 read clear */ #define PBF_REG_PBF_PRTY_STS_CLR 0x1401dc/* [RW 16] The Ethernet type value for L2 tag 0 */
@@ -4517,6 +4521,8 @@#define TM_REG_TM_INT_STS 0x1640f0/* [RW 7] Parity mask register #0 read/write */ #define TM_REG_TM_PRTY_MASK 0x16410c +/* [R 7] Parity register #0 read */ +#define TM_REG_TM_PRTY_STS 0x164100/* [RC 7] Parity register #0 read clear */ #define TM_REG_TM_PRTY_STS_CLR 0x164104/* [RW 8] The event id for aggregated interrupt 0 */
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +3 -3
@@ -1620,7 +1620,7 @@ next_vf_to_clean: i++) ; -DP (BNX2X_MSG_IOV ,"next vf to cleanup: %d. num of vfs: %d\n" , i, +DP (BNX2X_MSG_IOV ,"next vf to cleanup: %d. Num of vfs: %d\n" , i,BNX2X_NR_VIRTFN (bp));if (i <BNX2X_NR_VIRTFN (bp)) {
@@ -3031,7 +3031,7 @@ int bnx2x_sriov_configure(struct pci_dev *dev, int num_vfs_param)/* HW channel is only operational when PF is up */ if (bp->state !=BNX2X_STATE_OPEN ) { -BNX2X_ERR ("VF num configurtion via sysfs not supported while PF is down" ); +BNX2X_ERR ("VF num configuration via sysfs not supported while PF is down\n" );return -EINVAL ; }
@@ -3391,7 +3391,7 @@ enum sample_bulletin_result bnx2x_sample_bulletin(struct bnx2x *bp)if (bulletin.crc ==bnx2x_crc_vf_bulletin (bp, &bulletin))break ; -BNX2X_ERR ("bad crc on bulletin board. contained %x computed %x\n" , +BNX2X_ERR ("bad crc on bulletin board. Contained %x computed %x\n" , bulletin.crc,bnx2x_crc_vf_bulletin (bp, &bulletin)); }
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h +1 -1
@@ -496,7 +496,7 @@ enum {else if ((next) ==VFOP_VERIFY_PEND ) \BNX2X_ERR ("expected pending\n" ); \else { \ -DP (BNX2X_MSG_IOV ,"no ramrod. scheduling\n" ); \ +DP (BNX2X_MSG_IOV ,"no ramrod. Scheduling\n" ); \atomic_set (&vf->op_in_progress,1 ); \queue_delayed_work (bnx2x_wq, &bp->sp_task,0 ); \return ; \
drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c +4 -4
@@ -333,7 +333,7 @@ int bnx2x_vfpf_release(struct bnx2x *bp)DP (BNX2X_MSG_SP ,"vf released\n" ); }else {/* PF reports error */ -BNX2X_ERR ("PF failed our release request - are we out of sync? response status: %d\n" , +BNX2X_ERR ("PF failed our release request - are we out of sync? Response status: %d\n" , resp->hdr.status); rc = -EAGAIN ; goto out;
@@ -844,7 +844,6 @@ static int bnx2x_copy32_vf_dmae(struct bnx2x *bp, u8 from_vf, dmae.dst_addr_hi = vf_addr_hi; } dmae.len = len32; -bnx2x_dp_dmae (bp, &dmae,BNX2X_MSG_DMAE );/* issue the command and wait for completion */ return bnx2x_issue_dmae_with_comp (bp, &dmae);
@@ -1588,8 +1587,9 @@ static void bnx2x_vf_mbx_request(struct bnx2x *bp, struct bnx2x_virtf *vf,* support them. Or this may be because someone wrote a crappy * VF driver and is sending garbage over the channel. */ -BNX2X_ERR ("unknown TLV. type %d length %d. first 20 bytes of mailbox buffer:\n" , - mbx->first_tlv.tl.type, mbx->first_tlv.tl.length); +BNX2X_ERR ("unknown TLV. type %d length %d vf->state was %d. first 20 bytes of mailbox buffer:\n" , + mbx->first_tlv.tl.type, mbx->first_tlv.tl.length, + vf->state);for (i =0 ; i <20 ; i++)DP_CONT (BNX2X_MSG_IOV ,"%x " , mbx->msg->req.tlv_buf_size.tlv_buffer[i]);
Signature · 1 line
1.8.1.227.g44fe835
PATCH 5/5 bnx2x: semi-Semantic changes
In reply to Yuval MintzThis patch includes a few changes that change the driver's flow without truly changing anything in its functionality - use usleep_range for short sleeps instead of msleep and initialize Tx consumer during initialization for better information during errors.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +8 -6
@@ -1954,7 +1954,7 @@ int bnx2x_acquire_hw_lock(struct bnx2x *bp, u32 resource)if (lock_status & resource_bit)return 0 ; -msleep (5 ); +usleep_range (5000 ,10000 ); }BNX2X_ERR ("Timeout\n" );return -EAGAIN ;
@@ -3640,7 +3640,7 @@ static int bnx2x_acquire_alr(struct bnx2x *bp)if (val &MCPR_ACCESS_LOCK_LOCK )break ; -msleep (5 ); +usleep_range (5000 ,10000 ); }if (!(val &MCPR_ACCESS_LOCK_LOCK )) {BNX2X_ERR ("Cannot acquire MCP access lock register\n" );
@@ -6078,6 +6078,8 @@ static void bnx2x_init_tx_ring_one(struct bnx2x_fp_txdata *txdata) BCM_PAGE_SIZE*(i % NUM_TX_RINGS))); } + *txdata->tx_cons_sb =cpu_to_le16 (0 ); +SET_FLAG (txdata->tx_db.data.header.header,DOORBELL_HDR_DB_TYPE ,1 ); txdata->tx_db.data.zero_fill1 =0 ; txdata->tx_db.data.prod =0 ;
@@ -6329,7 +6331,7 @@ static int bnx2x_int_mem_test(struct bnx2x *bp)if (val ==0x10 )break ; -msleep (10 ); +usleep_range (10000 ,20000 ); count--; }if (val !=0x10 ) {
@@ -6344,7 +6346,7 @@ static int bnx2x_int_mem_test(struct bnx2x *bp)if (val ==1 )break ; -msleep (10 ); +usleep_range (10000 ,20000 ); count--; }if (val !=0x1 ) {
@@ -6385,7 +6387,7 @@ static int bnx2x_int_mem_test(struct bnx2x *bp)if (val ==0xb0 )break ; -msleep (10 ); +usleep_range (10000 ,20000 ); count--; }if (val !=0xb0 ) {
@@ -8500,7 +8502,7 @@ static void bnx2x_reset_func(struct bnx2x *bp)* scan to complete */ for (i =0 ; i <200 ; i++) { -msleep (10 ); +usleep_range (10000 ,20000 );if (!REG_RD (bp,TM_REG_LIN0_SCAN_ON + port*4 ))break ; }
Signature · 1 line
1.8.1.227.g44fe835
David Miller
maintainerFrom: "Yuval Mintz" <[email protected]>
Date: Sun, 2 Jun 2013 13:06:16 +0300
Quoted 5 lines
This patch series contains only semantic changes, e.g., removal of unnecessary blank lines, correcting various typos and modifying prints, correcting alignments, etc.
Please consider applying these patches to `net-next'.
Series applied, thanks.