bnx2x: patch series
cover bnx2x: patch series
Hi Dave,
This patch series contain several Semi-semantic patches (i.e., some are purely semantic, such as correcting comments & typos, while others slightly change the bnx2x code without effectively changing any flow), while other fix several small issues, mostly either memory-related or missing segments from our recent SR-IOV submission.
Please consider applying this patch-series to 'net-next'.
Thanks,
Yuval Mintz
PATCH 1/12 bnx2x: Semantic renovation
Mostly corrects white spaces, indentations, and comments.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 50 +++++++++------------ drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 28 +++++------- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 3 +- drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c | 5 ++- .../net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 26 +++++------ .../net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h | 6 --- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 51 +++++++++++----------- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 20 ++++----- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h | 2 +- 9 files changed, 86 insertions(+), 105 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +21 -29
@@ -141,8 +141,8 @@ do { \#define bnx2x_mc_addr (ha) ((ha)->addr)#define bnx2x_uc_addr (ha) ((ha)->addr) -#define U64_LO (x) (u32)(((u64)(x)) & 0xffffffff) -#define U64_HI (x) (u32)(((u64)(x)) >> 32) +#define U64_LO (x) ((u32)(((u64)(x)) & 0xffffffff)) +#define U64_HI (x) ((u32)(((u64)(x)) >> 32))#define HILO_U64 (hi, lo) ((((u64)(hi)) << 32) + (lo))
@@ -812,7 +812,7 @@ struct bnx2x_common {#define CHIP_NUM_57811 0x163d#define CHIP_NUM_57811_MF 0x163e#define CHIP_NUM_57811_VF 0x163f -#define CHIP_NUM_57840_OBSOLETE 0x168d +#define CHIP_NUM_57840_OBSOLETE 0x168d#define CHIP_NUM_57840_MF_OBSOLETE 0x16ab#define CHIP_NUM_57840_4_10 0x16a1#define CHIP_NUM_57840_2_20 0x16a2
@@ -1195,11 +1195,11 @@ struct bnx2x_fw_stats_req { };struct bnx2x_fw_stats_data { -struct stats_counter storm_counters; -struct per_port_stats port; -struct per_pf_stats pf; +struct stats_counter storm_counters; +struct per_port_stats port; +struct per_pf_stats pf;struct fcoe_statistics_params fcoe; -struct per_queue_stats queue_stats[1 ]; +struct per_queue_stats queue_stats[1 ]; };/* Public slow path states */
@@ -1343,8 +1343,6 @@ struct bnx2x {__le16 *eq_cons_sb;atomic_t eq_spq_left;/* COMMON_XXX ramrods credit */ - -/* Counter for marking that there is a STAT_QUERY ramrod pending */ u16 stats_pending;/* Counter for completed statistics ramrods */
@@ -2076,10 +2074,8 @@ void bnx2x_igu_clear_sb_gen(struct bnx2x *bp, u8 func, u8 idu_sb_id,#define BNX2X_LOOPBACK_FAILED (BNX2X_MAC_LOOPBACK_FAILED | \ BNX2X_PHY_LOOPBACK_FAILED) -#define STROM_ASSERT_ARRAY_SIZE 50 -/* must be used on a CID before placing it on a HW ring */ #define HW_CID (bp, x) ((BP_PORT(bp) << 23) | \ (BP_VN(bp) << BNX2X_SWCID_SHIFT) | \
@@ -2110,7 +2106,6 @@ void bnx2x_igu_clear_sb_gen(struct bnx2x *bp, u8 func, u8 idu_sb_id,/* Memory of fairness algorithm . 2 cycles */ #define FAIR_MEM 2 -#define ATTN_NIG_FOR_FUNC (1L << 8)#define ATTN_SW_TIMER_4_FUNC (1L << 9)#define GPIO_2_FUNC (1L << 10)
@@ -2215,7 +2210,6 @@ void bnx2x_igu_clear_sb_gen(struct bnx2x *bp, u8 func, u8 idu_sb_id,#define MULTI_MASK 0x7f -#define DEF_USB_FUNC_OFF offsetof(struct cstorm_def_status_block_u, func)#define DEF_CSB_FUNC_OFF offsetof(struct cstorm_def_status_block_c, func)#define DEF_XSB_FUNC_OFF offsetof(struct xstorm_def_status_block, func)
@@ -2243,18 +2237,6 @@ void bnx2x_igu_clear_sb_gen(struct bnx2x *bp, u8 func, u8 idu_sb_id, (&bp->def_status_blk->sp_sb.\ index_values[HC_SP_INDEX_ETH_DEF_CONS]) -#define SET_FLAG (value, mask, flag) \ - do {\ - (value) &= ~(mask);\ - (value) |= ((flag) << (mask##_SHIFT));\ - } while (0) - -#define GET_FLAG (value, mask) \ - (((value) & (mask)) >> (mask##_SHIFT)) - -#define GET_FIELD (value, fname) \ - (((value) & (fname##_MASK)) >> (fname##_SHIFT)) -#define CAM_IS_INVALID (x) \ (GET_FLAG(x.flags, \ MAC_CONFIGURATION_ENTRY_ACTION_TYPE) == \
@@ -2265,7 +2247,6 @@ void bnx2x_igu_clear_sb_gen(struct bnx2x *bp, u8 func, u8 idu_sb_id,#define MC_HASH_OFFSET (bp, i) (BAR_TSTRORM_INTMEM + \ TSTORM_APPROXIMATE_MATCH_MULTICAST_FILTERING_OFFSET(BP_FUNC(bp)) + i*4) -#ifndef PXP2_REG_PXP2_INT_STS #define PXP2_REG_PXP2_INT_STS PXP2_REG_PXP2_INT_STS_0#endif
@@ -2285,8 +2266,8 @@ void bnx2x_igu_clear_sb_gen(struct bnx2x *bp, u8 func, u8 idu_sb_id, (!((me_reg) & ME_REG_VF_ERR)))int bnx2x_nic_load_analyze_req (struct bnx2x *bp,u32 load_code);/* Congestion management fairness mode */ -#define CMNG_FNS_NONE 0 -#define CMNG_FNS_MINMAX 1 +#define CMNG_FNS_NONE 0 +#define CMNG_FNS_MINMAX 1#define HC_SEG_ACCESS_DEF 0/*Driver decision 0-3*/ #define HC_SEG_ACCESS_ATTN 4
@@ -2302,7 +2283,6 @@ static const u32 dmae_reg_go_c[] = {void bnx2x_set_ethtool_ops (struct net_device *netdev);void bnx2x_notify_link_changed (struct bnx2x *bp); -#define BNX2X_MF_SD_PROTOCOL (bp) \ ((bp)->mf_config[BP_VN(bp)] & FUNC_MF_CFG_PROTOCOL_MASK)
@@ -2323,6 +2303,18 @@ void bnx2x_notify_link_changed(struct bnx2x *bp); (BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp) || \ BNX2X_IS_MF_SD_PROTOCOL_FCOE(bp))) +#define SET_FLAG (value, mask, flag) \ + do {\ + (value) &= ~(mask);\ + (value) |= ((flag) << (mask##_SHIFT));\ + } while (0) + +#define GET_FLAG (value, mask) \ + (((value) & (mask)) >> (mask##_SHIFT)) + +#define GET_FIELD (value, fname) \ + (((value) & (fname##_MASK)) >> (fname##_SHIFT)) +enum {SWITCH_UPDATE ,AFEX_UPDATE ,
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +12 -16
@@ -237,7 +237,7 @@ int bnx2x_tx_int(struct bnx2x *bp, struct bnx2x_fp_txdata *txdata) txdata->txq_index, hw_cons, sw_cons, pkt_cons); bd_cons =bnx2x_free_tx_pkt (bp, txdata, pkt_cons, - &pkts_compl, &bytes_compl); + &pkts_compl, &bytes_compl); sw_cons++; }
@@ -343,14 +343,14 @@ static inline void bnx2x_update_sge_prod(struct bnx2x_fastpath *fp, fp->last_max_sge, fp->rx_sge_prod); } -/* Set Toeplitz hash value in the skb using the value from the +/* Get Toeplitz hash value in the skb using the value from the * CQE (calculated by HW). */ static u32 bnx2x_get_rxhash (const struct bnx2x *bp,const struct eth_fast_path_rx_cqe *cqe,bool *l4_rxhash) { -/* Set Toeplitz hash from CQE */ +/* Get Toeplitz hash from CQE */ if ((bp->dev->features &NETIF_F_RXHASH ) && (cqe->status_flags Ð_FAST_PATH_RX_CQE_RSS_HASH_FLG )) {enum eth_rss_hash_type htype;
@@ -449,7 +449,7 @@ static void bnx2x_tpa_start(struct bnx2x_fastpath *fp, u16 queue,* * Approximate value of the MSS for this aggregation calculated using * the first packet of it. -* Compute number of aggregated segments, and gso_type +* Compute number of aggregated segments, and gso_type. */ static void bnx2x_set_gro_params (struct sk_buff *skb,u16 parsing_flags,u16 len_on_bd,unsigned int pkt_len)
@@ -619,7 +619,6 @@ static void *bnx2x_frag_alloc(const struct bnx2x_fastpath *fp)return kmalloc (fp->rx_buf_size +NET_SKB_PAD ,GFP_ATOMIC ); } -#ifdef CONFIG_INET static void bnx2x_gro_ip_csum (struct bnx2x *bp,struct sk_buff *skb) {
@@ -1827,7 +1826,6 @@ u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb)return __skb_tx_hash (dev, skb,BNX2X_NUM_ETH_QUEUES (bp)); } -void bnx2x_set_num_queues (struct bnx2x *bp) {/* RSS queues */
@@ -2483,7 +2481,6 @@ load_error_cnic0:#endif /* ! BNX2X_STOP_ON_ERROR */ } -/* must be called with rtnl_lock */ int bnx2x_nic_load (struct bnx2x *bp,int load_mode) {
@@ -3064,7 +3061,6 @@ int bnx2x_poll(struct napi_struct *napi, int budget)if (bnx2x_tx_queue_has_work (fp->txdata_ptr[cos]))bnx2x_tx_int (bp, fp->txdata_ptr[cos]); -if (bnx2x_has_rx_work (fp)) { work_done +=bnx2x_rx_int (fp, budget - work_done);
@@ -3337,12 +3333,12 @@ static inline void bnx2x_set_pbd_gso(struct sk_buff *skb,* 57712 related */ static inline u8 bnx2x_set_pbd_csum_e2 (struct bnx2x *bp,struct sk_buff *skb, -u32 *parsing_data,u32 xmit_type) +u32 *parsing_data,u32 xmit_type) { *parsing_data |= - ((((u8 *)skb_transport_header (skb) - skb->data) >>1 ) << -ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W_SHIFT ) & -ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W ; + ((((u8 *)skb_transport_header (skb) - skb->data) >>1 ) << +ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W_SHIFT ) & +ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W ;if (xmit_type &XMIT_CSUM_TCP ) { *parsing_data |= ((tcp_hdrlen(skb) / 4) <<
@@ -3488,8 +3484,8 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)dev_kfree_skb (skb);return NETDEV_TX_OK ; } -bnx2x_fp_qstats (bp, txdata->parent_fp)->driver_xoff++; -netif_tx_stop_queue (txq); +bnx2x_fp_qstats (bp, txdata->parent_fp)->driver_xoff++; +netif_tx_stop_queue (txq);BNX2X_ERR ("BUG! Tx ring full when queue awake!\n" );return NETDEV_TX_BUSY ;
@@ -4254,7 +4250,7 @@ int bnx2x_alloc_mem_bp(struct bnx2x *bp)/* * The biggest MSI-X table we might need is as a maximum number of fast -* path IGU SBs plus default SB (for PF). +* path IGU SBs plus default SB (for PF only). */ msix_table_size = bp->igu_sb_cnt;if (IS_PF (bp))
@@ -4364,7 +4360,7 @@ int bnx2x_get_link_cfg_idx(struct bnx2x *bp) {u32 sel_phy_idx =bnx2x_get_cur_phy_idx (bp);/* -* The selected actived PHY is always after swapping (in case PHY +* The selected activated PHY is always after swapping (in case PHY * swapping is enabled). So when swapping is enabled, we need to reverse * the configuration */
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +1 -2
@@ -975,7 +975,6 @@ static inline int bnx2x_func_start(struct bnx2x *bp)return bnx2x_func_state_change (bp, &func_params); } -/** * bnx2x_set_fw_mac_addr - fill in a MAC address in FW format *
@@ -1391,7 +1390,7 @@ static inline bool bnx2x_is_valid_ether_addr(struct bnx2x *bp, u8 *addr) }/** -* bnx2x_fill_fw_str - Fill buffer with FW version string. +* bnx2x_fill_fw_str - Fill buffer with FW version string * * @bp: driver handle * @buf: character buffer to fill with the fw name
drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c +4 -1
@@ -416,6 +416,7 @@ static void bnx2x_pfc_set_pfc(struct bnx2x *bp)int mfw_configured =SHMEM2_HAS (bp, drv_flags) &&GET_FLAGS (SHMEM2_RD (bp, drv_flags),1 <<DRV_FLAGS_DCB_MFW_CONFIGURED ); +if (bp->dcbx_port_params.pfc.enabled && (!(bp->dcbx_error &DCBX_REMOTE_MIB_ERROR ) || mfw_configured))/*
@@ -558,6 +559,7 @@ static void bnx2x_dcbx_update_ets_params(struct bnx2x *bp)int mfw_configured =SHMEM2_HAS (bp, drv_flags) &&GET_FLAGS (SHMEM2_RD (bp, drv_flags),1 <<DRV_FLAGS_DCB_MFW_CONFIGURED ); +bnx2x_ets_disabled (&bp->link_params, &bp->link_vars); if (!bp->dcbx_port_params.ets.enabled ||
@@ -1904,11 +1906,13 @@ static u8 bnx2x_dcbnl_set_state(struct net_device *netdev, u8 state)struct bnx2x *bp =netdev_priv (netdev);DP (BNX2X_MSG_DCB ,"state = %s\n" , state ?"on" :"off" ); +/* Fail to set state to "enabled" if dcbx is disabled in nvram */ if (state && ((bp->dcbx_enabled ==BNX2X_DCBX_ENABLED_OFF ) || (bp->dcbx_enabled ==BNX2X_DCBX_ENABLED_INVALID ))) {DP (BNX2X_MSG_DCB ,"Can not set dcbx to enabled while it is disabled in nvm\n" );return 1 ; } +bnx2x_dcbx_set_state (bp, (state ? true : false), bp->dcbx_enabled);return 0 ; }
@@ -2052,7 +2056,6 @@ static void bnx2x_dcbnl_set_pfc_cfg(struct net_device *netdev, int prio,if (!bnx2x_dcbnl_set_valid (bp) || prio >=MAX_PFC_PRIORITIES )return ; -if (setting) { bp->dcbx_config_params.admin_pfc_bitmap |= (1 << prio); bp->dcbx_config_params.admin_pfc_tx_enable =1 ;
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +12 -14
@@ -234,7 +234,7 @@ static int bnx2x_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)if ((bp->state ==BNX2X_STATE_OPEN ) && bp->link_vars.link_up && !(bp->flags &MF_FUNC_DIS )) { - cmd->duplex = bp->link_vars.duplex; + cmd->duplex = bp->link_vars.duplex;if (IS_MF (bp) && !BP_NOMCP (bp))ethtool_cmd_speed_set (cmd,bnx2x_get_mf_speed (bp));
@@ -400,7 +400,7 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)DP (BNX2X_MSG_ETHTOOL ,"Unsupported port type\n" );return -EINVAL ; } -/* Save new config in case command complete successully */ +/* Save new config in case command complete successfully */ new_multi_phy_config = bp->link_params.multi_phy_config;/* Get the new cfg_idx */ cfg_idx =bnx2x_get_link_cfg_idx (bp);
@@ -751,11 +751,10 @@ static bool bnx2x_is_wreg_in_chip(struct bnx2x *bp,* @bp device handle * @p output buffer * -* Reads "paged" memories: memories that may only be read by -* first writing to a specific address ("write address") and -* then reading from a specific address ("read address"). There -* may be more than one write address per "page" and more than -* one read address per write address. +* Reads "paged" memories: memories that may only be read by first writing to a +* specific address ("write address") and then reading from a specific address +* ("read address"). There may be more than one write address per "page" and +* more than one read address per write address. */ static void bnx2x_read_pages_regs (struct bnx2x *bp,u32 *p,u32 preset) {
@@ -1082,13 +1081,13 @@ static int bnx2x_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)struct bnx2x *bp =netdev_priv (dev);if (wol->wolopts & ~WAKE_MAGIC ) { -DP (BNX2X_MSG_ETHTOOL ,"WOL not supproted\n" ); +DP (BNX2X_MSG_ETHTOOL ,"WOL not supported\n" );return -EINVAL ; }if (wol->wolopts &WAKE_MAGIC ) {if (bp->flags &NO_WOL_FLAG ) { -DP (BNX2X_MSG_ETHTOOL ,"WOL not supproted\n" ); +DP (BNX2X_MSG_ETHTOOL ,"WOL not supported\n" );return -EINVAL ; } bp->wol =1 ;
@@ -1161,7 +1160,7 @@ static int bnx2x_get_eeprom_len(struct net_device *dev)* Pf B takes the lock and proceeds to perform it's own access. * pf A unlocks the per port lock, while pf B is still working (!). * mcp takes the per port lock and corrupts pf B's access (and/or has it's own -* acess corrupted by pf B).* +* access corrupted by pf B) */ static int bnx2x_acquire_nvram_lock (struct bnx2x *bp) {
@@ -1970,7 +1969,6 @@ static int bnx2x_set_eee(struct net_device *dev, struct ethtool_eee *edata)return 0 ; } -enum {BNX2X_CHIP_E1_OFST =0 ,BNX2X_CHIP_E1H_OFST ,
@@ -2621,6 +2619,7 @@ static void bnx2x_self_test(struct net_device *dev, etest->flags |=ETH_TEST_FL_FAILED ;return ; } + DP(BNX2X_MSG_ETHTOOL, "Self-test command parameters: offline = %d, external_lb = %d\n", (etest->flags & ETH_TEST_FL_OFFLINE),
@@ -2976,15 +2975,14 @@ static int bnx2x_set_rss_flags(struct bnx2x *bp, struct ethtool_rxnfc *info)DP (BNX2X_MSG_ETHTOOL ,"Command parameters not supported\n" );return -EINVAL ; - }else { -return 0 ; } +return 0 ;case UDP_V4_FLOW :case UDP_V6_FLOW :/* For UDP either 2-tupple hash or 4-tupple hash is supported */ if (info->data == (RXH_IP_SRC |RXH_IP_DST | -RXH_L4_B_0_1 |RXH_L4_B_2_3 )) +RXH_L4_B_0_1 |RXH_L4_B_2_3 )) udp_rss_requested =1 ;else if (info->data == (RXH_IP_SRC |RXH_IP_DST )) udp_rss_requested =0 ;
drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h +0 -6
@@ -305,12 +305,10 @@#define MAX_VLAN_CREDIT_E1H 0/* Per Chip */ #define MAX_VLAN_CREDIT_E2 272/* Per Path */ -/* Maximal aggregation queues supported */ #define ETH_MAX_AGGREGATION_QUEUES_E1 32#define ETH_MAX_AGGREGATION_QUEUES_E1H_E2 64 -#define ETH_NUM_OF_MCAST_BINS 256#define ETH_NUM_OF_MCAST_ENGINES_E2 72
@@ -353,7 +351,6 @@/* max number of slow path commands per port */ #define MAX_RAMRODS_PER_PORT 8 -/**** DEFINES FOR TIMERS/CLOCKS RESOLUTIONS ****/ #define TIMERS_TICK_SIZE_CHIP (1e-3)
@@ -380,7 +377,6 @@that is not mapped to priority*/ #define LLFC_TRAFFIC_TYPE_TO_PRIORITY_UNMAPPED 0xFF -#define C_ERES_PER_PAGE \ (PAGE_SIZE / BITS_TO_BYTES(STRUCT_SIZE(event_ring_elem)))#define C_ERE_PER_PAGE_MASK (C_ERES_PER_PAGE - 1)
@@ -391,8 +387,6 @@#define INVALID_VNIC_ID 0xFF -#define UNDEF_IRO 0x80000000 -#endif /* BNX2X_FW_DEFS_H */
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +25 -26
189 lines not on this page · raw message
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +10 -10
@@ -1442,7 +1442,7 @@ static int bnx2x_complete_vlan_mac(struct bnx2x *bp,if (cqe->message.error)return -EINVAL ; -/* Run the next bulk of pending commands if requeted */ +/* Run the next bulk of pending commands if requested */ if (test_bit (RAMROD_CONT , ramrod_flags)) { rc =bnx2x_exe_queue_step (bp, &o->exe_queue, ramrod_flags);if (rc <0 )
@@ -2103,7 +2103,7 @@ static inline void __storm_memset_mac_filters(struct bnx2x *bp,static int bnx2x_set_rx_mode_e1x (struct bnx2x *bp,struct bnx2x_rx_mode_ramrod_params *p) { -/* update the bp MAC filter structure */ +/* update the bp MAC filter structure */ u32 mask = (1 << p->cl_id); struct tstorm_eth_mac_filter_config *mac_filters =
@@ -2166,7 +2166,7 @@ static int bnx2x_set_rx_mode_e1x(struct bnx2x *bp, mac_filters->unmatched_unicast & ~mask;DP (BNX2X_MSG_SP ,"drop_ucast 0x%x\ndrop_mcast 0x%x\n accp_ucast 0x%x\n" -"accp_mcast 0x%x\naccp_bcast 0x%x\n" , +"accp_mcast 0x%x\naccp_bcast 0x%x\n" , mac_filters->ucast_drop_all, mac_filters->mcast_drop_all, mac_filters->ucast_accept_all, mac_filters->mcast_accept_all, mac_filters->bcast_accept_all);
@@ -2790,7 +2790,7 @@ static inline void bnx2x_mcast_hdl_add(struct bnx2x *bp, cnt++;DP (BNX2X_MSG_SP ,"About to configure %pM mcast MAC\n" , - mlist_pos->mac); + mlist_pos->mac); } *line_idx = cnt;
@@ -3085,7 +3085,7 @@ static inline void bnx2x_mcast_hdl_add_e1h(struct bnx2x *bp,BNX2X_57711_SET_MC_FILTER (mc_filter, bit);DP (BNX2X_MSG_SP ,"About to configure %pM mcast MAC, bin %d\n" , - mlist_pos->mac, bit); + mlist_pos->mac, bit);/* bookkeeping... */ BIT_VEC64_SET_BIT(o->registry.aprox_match.vec,
@@ -3319,7 +3319,7 @@ static inline int bnx2x_mcast_handle_restore_cmd_e1( i++;DP (BNX2X_MSG_SP ,"About to configure %pM mcast MAC\n" , - cfg_data.mac); + cfg_data.mac); } *rdata_idx = i;
@@ -3355,7 +3355,7 @@ static inline int bnx2x_mcast_handle_pending_cmds_e1( cnt++;DP (BNX2X_MSG_SP ,"About to configure %pM mcast MAC\n" , - pmac_pos->mac); + pmac_pos->mac); }break ;
@@ -5652,9 +5652,9 @@ static inline int bnx2x_func_send_start(struct bnx2x *bp,memset (rdata,0 ,sizeof (*rdata));/* Fill the ramrod data with provided parameters */ - rdata->function_mode = (u8 )start_params->mf_mode; - rdata->sd_vlan_tag =cpu_to_le16 (start_params->sd_vlan_tag); - rdata->path_id =BP_PATH (bp); + rdata->function_mode = (u8 )start_params->mf_mode; + rdata->sd_vlan_tag =cpu_to_le16 (start_params->sd_vlan_tag); + rdata->path_id =BP_PATH (bp); rdata->network_cos_mode = start_params->network_cos_mode;/*
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h +1 -1
@@ -54,7 +54,7 @@ typedef enum {BNX2X_OBJ_TYPE_RX_TX , } bnx2x_obj_type; -/* Filtering states */ +/* Public slow path states */ enum {BNX2X_FILTER_MAC_PENDING , BNX2X_FILTER_VLAN_PENDING,
Signature · 1 line
1.8.1.227.g44fe835
PATCH 2/12 bnx2x: reorganization and beautification
In reply to Yuval MintzSlightly changes the bnx2x code without `true' functional changes. Changes include:
1. Gathering macros into a single macro when combination is used multiple times.
2. Exporting parts of functions into their own functions.
3. Return values after if-else instead of only on the else condition (where current flow would simply return same value later in the code)
4. Removing some unnecessary code (either dead-code or incorrect conditions)
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 28 ++-- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 14 +- .../net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 12 +- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 143 +++++++++------------ drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 64 ++++----- 5 files changed, 122 insertions(+), 139 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +11 -17
@@ -417,8 +417,7 @@ static void bnx2x_tpa_start(struct bnx2x_fastpath *fp, u16 queue, tpa_info->rxhash =bnx2x_get_rxhash (bp, cqe, &tpa_info->l4_rxhash);if (fp->mode ==TPA_MODE_GRO ) {u16 gro_size =le16_to_cpu (cqe->pkt_len_or_gro_seg_len); - tpa_info->full_page = -SGE_PAGE_SIZE *PAGES_PER_SGE / gro_size * gro_size; + tpa_info->full_page =SGE_PAGES / gro_size * gro_size; tpa_info->gro_size = gro_size; }
@@ -499,7 +498,7 @@ static int bnx2x_alloc_rx_sge(struct bnx2x *bp, } mapping =dma_map_page (&bp->pdev->dev, page,0 , -SGE_PAGE_SIZE *PAGES_PER_SGE ,DMA_FROM_DEVICE ); +SGE_PAGES ,DMA_FROM_DEVICE );if (unlikely (dma_mapping_error (&bp->pdev->dev, mapping))) {__free_pages (page,PAGES_PER_SGE_SHIFT );BNX2X_ERR ("Can't map sge\n" );
@@ -541,7 +540,7 @@ static int bnx2x_fill_frag_skb(struct bnx2x *bp, struct bnx2x_fastpath *fp, le16_to_cpu(cqe->pkt_len));#ifdef BNX2X_STOP_ON_ERROR -if (pages >min_t (u32,8 ,MAX_SKB_FRAGS )*SGE_PAGE_SIZE *PAGES_PER_SGE ) { +if (pages >min_t (u32,8 ,MAX_SKB_FRAGS ) *SGE_PAGES ) {BNX2X_ERR ("SGL length is too long: %d. CQE index is %d\n" , pages, cqe_idx);BNX2X_ERR ("cqe->pkt_len = %d\n" , cqe->pkt_len);
@@ -559,8 +558,7 @@ static int bnx2x_fill_frag_skb(struct bnx2x *bp, struct bnx2x_fastpath *fp,if (fp->mode ==TPA_MODE_GRO ) frag_len =min_t (u32, frag_size, (u32 )full_page);else /* LRO */ - frag_len =min_t (u32, frag_size, - (u32)(SGE_PAGE_SIZE *PAGES_PER_SGE )); + frag_len =min_t (u32, frag_size, (u32 )SGE_PAGES ); rx_pg = &fp->rx_page_ring[sge_idx]; old_rx_pg = *rx_pg;
@@ -576,7 +574,7 @@ static int bnx2x_fill_frag_skb(struct bnx2x *bp, struct bnx2x_fastpath *fp,/* Unmap the page as we r going to pass it to the stack */ dma_unmap_page (&bp->pdev->dev,dma_unmap_addr (&old_rx_pg, mapping), -SGE_PAGE_SIZE *PAGES_PER_SGE ,DMA_FROM_DEVICE ); +SGE_PAGES ,DMA_FROM_DEVICE );/* Add one frag and update the appropriate fields in the skb */ if (fp->mode ==TPA_MODE_LRO )skb_fill_page_desc (skb, j, old_rx_pg.page,0 , frag_len);
@@ -594,7 +592,7 @@ static int bnx2x_fill_frag_skb(struct bnx2x *bp, struct bnx2x_fastpath *fp, } skb->data_len += frag_len; - skb->truesize +=SGE_PAGE_SIZE *PAGES_PER_SGE ; + skb->truesize +=SGE_PAGES ; skb->len += frag_len; frag_size -= frag_len;
@@ -2500,12 +2498,9 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) bp->state =BNX2X_STATE_OPENING_WAIT4_LOAD ; -/* Set the initial link reported state to link down */ -bnx2x_acquire_phy_lock (bp);memset (&bp->last_reported_link,0 ,sizeof (bp->last_reported_link));__set_bit (BNX2X_LINK_REPORT_LINK_DOWN , &bp->last_reported_link.link_report_flags); -bnx2x_release_phy_lock (bp);if (IS_PF (bp))/* must be called before memory allocation and HW init */
@@ -3346,12 +3341,11 @@ static inline u8 bnx2x_set_pbd_csum_e2(struct bnx2x *bp, struct sk_buff *skb,ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW ;return skb_transport_header (skb) +tcp_hdrlen (skb) - skb->data; - }else -/* We support checksum offload for TCP and UDP only. -* No need to pass the UDP header length - it's a constant. -*/ -return skb_transport_header (skb) + -sizeof (struct udphdr ) - skb->data; + } +/* We support checksum offload for TCP and UDP only. +* No need to pass the UDP header length - it's a constant. +*/ +return skb_transport_header (skb) +sizeof (struct udphdr ) - skb->data; } static inline void bnx2x_set_sbd_csum(struct bnx2x *bp, struct sk_buff *skb,
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +7 -7
@@ -403,7 +403,7 @@ void bnx2x_set_rx_mode(struct net_device *dev);* If bp->state is OPEN, should be called with * netif_addr_lock_bh(). */ -void bnx2x_set_storm_rx_mode (struct bnx2x *bp); +int bnx2x_set_storm_rx_mode (struct bnx2x *bp);/** * bnx2x_set_q_rx_mode - configures rx_mode for a single queue.
@@ -415,11 +415,11 @@ void bnx2x_set_storm_rx_mode(struct bnx2x *bp);* @tx_accept_flags: tx accept configuration (tx switch) * @ramrod_flags: ramrod configuration */ -void bnx2x_set_q_rx_mode (struct bnx2x *bp,u8 cl_id, -unsigned long rx_mode_flags, -unsigned long rx_accept_flags, -unsigned long tx_accept_flags, -unsigned long ramrod_flags); +int bnx2x_set_q_rx_mode (struct bnx2x *bp,u8 cl_id, +unsigned long rx_mode_flags, +unsigned long rx_accept_flags, +unsigned long tx_accept_flags, +unsigned long ramrod_flags);/* Parity errors related */ void bnx2x_set_pf_load (struct bnx2x *bp);
@@ -821,7 +821,7 @@ static inline void bnx2x_free_rx_sge(struct bnx2x *bp,return ;dma_unmap_page (&bp->pdev->dev,dma_unmap_addr (sw_buf, mapping), -SGE_PAGE_SIZE *PAGES_PER_SGE ,DMA_FROM_DEVICE ); +SGE_PAGES ,DMA_FROM_DEVICE );__free_pages (page,PAGES_PER_SGE_SHIFT ); sw_buf->page =NULL ;
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +6 -6
@@ -3002,9 +3002,9 @@ static int bnx2x_set_rss_flags(struct bnx2x *bp, struct ethtool_rxnfc *info)"rss re-configured, UDP 4-tupple %s\n" , udp_rss_requested ? "enabled" : "disabled");return bnx2x_config_rss_pf (bp, &bp->rss_conf_obj,0 ); - }else { -return 0 ; } +return 0 ; +case IPV4_FLOW :case IPV6_FLOW :/* For IP only 2-tupple hash is supported */
@@ -3012,9 +3012,9 @@ static int bnx2x_set_rss_flags(struct bnx2x *bp, struct ethtool_rxnfc *info)DP (BNX2X_MSG_ETHTOOL ,"Command parameters not supported\n" );return -EINVAL ; - }else { -return 0 ; } +return 0 ; +case SCTP_V4_FLOW :case AH_ESP_V4_FLOW :case AH_V4_FLOW :
@@ -3030,9 +3030,9 @@ static int bnx2x_set_rss_flags(struct bnx2x *bp, struct ethtool_rxnfc *info)DP (BNX2X_MSG_ETHTOOL ,"Command parameters not supported\n" );return -EINVAL ; - }else { -return 0 ; } +return 0 ; +default :return -EINVAL ; }
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +64 -79
218 lines not on this page · raw message
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +34 -30
108 lines not on this page · raw message
Signature · 1 line
1.8.1.227.g44fe835
PATCH 3/12 bnx2x: correct usleep_range usage
In reply to Yuval MintzChange the incorrect usage of usleep_range(1000, 1000)' into usleep_range(1000, 2000)'.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 4 ++-- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 10 +++++----- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 4 ++-- drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +2 -2
@@ -1224,7 +1224,7 @@ static inline int bnx2x_clean_tx_queue(struct bnx2x *bp,#endif } cnt--; -usleep_range (1000 ,1000 ); +usleep_range (1000 ,2000 ); }return 0 ;
@@ -1259,7 +1259,7 @@ static inline bool bnx2x_wait_sp_comp(struct bnx2x *bp, unsigned long mask) }netif_addr_unlock_bh (bp->dev); -usleep_range (1000 ,1000 ); +usleep_range (1000 ,2000 ); }smp_mb ();
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +5 -5
@@ -8654,7 +8654,7 @@ void bnx2x_chip_cleanup(struct bnx2x *bp, int unload_mode, bool keep_link) }/* Give HW time to discard old tx messages */ -usleep_range (1000 ,1000 ); +usleep_range (1000 ,2000 );/* Clean all ETH MACs */ rc = bnx2x_del_all_macs(bp, &bp->sp_objs[0].mac_obj, BNX2X_ETH_MAC,
@@ -9078,7 +9078,7 @@ static int bnx2x_er_poll_igu_vq(struct bnx2x *bp)if (pend_bits ==0 )break ; -usleep_range (1000 ,1000 ); +usleep_range (1000 ,2000 ); }while (cnt-- >0 );if (cnt <=0 ) {
@@ -9113,7 +9113,7 @@ static int bnx2x_process_kill(struct bnx2x *bp, bool global) (pgl_exp_rom2 ==0xffffffff ) && (!CHIP_IS_E3(bp) || (tags_63_32 == 0xffffffff))) break; -usleep_range (1000 ,1000 ); +usleep_range (1000 ,2000 ); }while (cnt-- >0 );if (cnt <=0 ) {
@@ -9146,7 +9146,7 @@ static int bnx2x_process_kill(struct bnx2x *bp, bool global)/* Wait for 1ms to empty GLUE and PCI-E core queues, * PSWHST, GRC and PSWRD Tetris buffer. */ -usleep_range (1000 ,1000 ); +usleep_range (1000 ,2000 );/* Prepare to chip reset: */ /* MCP */
@@ -10917,7 +10917,7 @@ static int bnx2x_get_hwinfo(struct bnx2x *bp)while (tout &®_RD (bp,IGU_REG_RESET_MEMORIES )) { tout--; -usleep_range (1000 ,1000 ); +usleep_range (1000 ,2000 ); }if (REG_RD (bp,IGU_REG_RESET_MEMORIES )) {
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +2 -2
@@ -325,7 +325,7 @@ static inline int bnx2x_state_wait(struct bnx2x *bp, int state,return 0 ; } -usleep_range (1000 ,1000 ); +usleep_range (1000 ,2000 );if (bp->panic)return -EIO ;
@@ -1407,7 +1407,7 @@ static int bnx2x_wait_vlan_mac(struct bnx2x *bp,/* Wait until there are no pending commands */ if (!bnx2x_exe_queue_empty (exeq)) -usleep_range (1000 ,1000 ); +usleep_range (1000 ,2000 );else return 0 ; }
drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c +1 -1
@@ -212,7 +212,7 @@ static int bnx2x_stats_comp(struct bnx2x *bp)break ; } cnt--; -usleep_range (1000 ,1000 ); +usleep_range (1000 ,2000 ); }return 1 ; }
Signature · 1 line
1.8.1.227.g44fe835
PATCH 4/12 bnx2x: Add additional debug information
In reply to Yuval MintzAdd/Revise several debug prints in the bnx2x driver - on regular flows as well as error flows.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 7 +++++-- drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 4 ++++ drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 21 +++++++++++++++++++-- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 12 ++++++++++-- 4 files changed, 38 insertions(+), 6 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +5 -2
@@ -3486,9 +3486,10 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) }DP (NETIF_MSG_TX_QUEUED , -"queue[%d]: SKB: summed %x protocol %x protocol(%x,%x) gso type %x xmit_type %x\n" , +"queue[%d]: SKB: summed %x protocol %x protocol(%x,%x) gso type %x xmit_type %x len %d\n" , txq_index, skb->ip_summed, skb->protocol,ipv6_hdr (skb)->nexthdr, -ip_hdr (skb)->protocol,skb_shinfo (skb)->gso_type, xmit_type); +ip_hdr (skb)->protocol,skb_shinfo (skb)->gso_type, xmit_type, + skb->len); eth = (struct ethhdr *)skb->data;
@@ -4078,6 +4079,8 @@ static int bnx2x_alloc_fp_mem_at(struct bnx2x *bp, int index) }else /* if rx_ring_size specified - use it */ rx_ring_size = bp->rx_ring_size; +DP (BNX2X_MSG_SP ,"calculated rx_ring_size %d\n" , rx_ring_size); +/* Common */ sb = &bnx2x_fp (bp, index, status_blk);
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +4 -0
@@ -1731,6 +1731,10 @@ static int bnx2x_set_ringparam(struct net_device *dev, {struct bnx2x *bp =netdev_priv (dev); +DP (BNX2X_MSG_ETHTOOL , +"set ring params command parameters: rx_pending = %d, tx_pending = %d\n" , + ering->rx_pending, ering->tx_pending); +if (bp->recovery_state !=BNX2X_RECOVERY_DONE ) {DP (BNX2X_MSG_ETHTOOL ,"Handling parity error recovery. Try again later\n" );
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +19 -2
@@ -1027,6 +1027,17 @@ void bnx2x_panic_dump(struct bnx2x *bp, bool disable_int) }#ifdef BNX2X_STOP_ON_ERROR + +/* event queue */ +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 */ /* Rx */ for_each_valid_rx_queue (bp, i) {
@@ -7395,8 +7406,10 @@ static int bnx2x_init_hw_func(struct bnx2x *bp)/* FLR cleanup - hmmm */ if (!CHIP_IS_E1x (bp)) { rc =bnx2x_pf_flr_clnup (bp); -if (rc) +if (rc) { +bnx2x_fw_dump (bp);return rc; + } }/* set MSI reconfigure capability */
@@ -9782,6 +9795,8 @@ static int bnx2x_prev_unload_uncommon(struct bnx2x *bp)if (bnx2x_prev_is_path_marked (bp))return bnx2x_prev_mcp_done (bp); +BNX2X_DEV_INFO ("Path is unmarked\n" ); +/* If function has FLR capabilities, and existing FW version matches * the one required, then FLR will be sufficient to clean any residue * left by previous driver
@@ -9917,7 +9932,8 @@ static void bnx2x_prev_interrupted_dmae(struct bnx2x *bp)if (!CHIP_IS_E1x (bp)) {u32 val =REG_RD (bp,PGLUE_B_REG_PGLUE_B_INT_STS );if (val &PGLUE_B_PGLUE_B_INT_STS_REG_WAS_ERROR_ATTN ) { -BNX2X_ERR ("was error bit was found to be set in pglueb upon startup. Clearing" ); +DP (BNX2X_MSG_SP , +"'was error' bit was found to be set in pglueb upon startup. Clearing\n" );REG_WR (bp,PGLUE_B_REG_WAS_ERROR_PF_7_0_CLR ,1 <<BP_FUNC (bp)); }
@@ -12488,6 +12504,7 @@ static int bnx2x_init_one(struct pci_dev *pdev,dev_err (&pdev->dev,"Cannot set interrupts\n" ); goto init_one_exit; } +BNX2X_DEV_INFO ("set interrupts successfully\n" );/* register the net device */ rc =register_netdev (dev);
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +10 -2
@@ -4241,11 +4241,16 @@ int bnx2x_queue_state_change(struct bnx2x *bp,unsigned long *pending = &o->pending;/* Check that the requested transition is legal */ -if (o->check_transition (bp, o, params)) + rc = o->check_transition (bp, o, params); +if (rc) { +BNX2X_ERR ("check transition returned an error. rc %d\n" , rc);return -EINVAL ; + }/* Set "pending" bit */ +DP (BNX2X_MSG_SP ,"pending bit was=%lx\n" , o->pending); pending_bit = o->set_pending (o, params); +DP (BNX2X_MSG_SP ,"pending bit now=%lx\n" , o->pending);/* Don't send a command if only driver cleanup was requested */ if (test_bit (RAMROD_DRV_CLR_ONLY , ¶ms->ramrod_flags))
@@ -5029,8 +5034,11 @@ static int bnx2x_queue_chk_transition(struct bnx2x *bp,* Don't allow a next state transition if we are in the middle of * the previous one. */ -if (o->pending) +if (o->pending) { +BNX2X_ERR ("Blocking transition since pending was %lx\n" , + o->pending);return -EBUSY ; + }switch (state) {case BNX2X_Q_STATE_RESET :
Signature · 1 line
1.8.1.227.g44fe835
PATCH 8/12 bnx2x: Remove many sparse warnings
In reply to Yuval MintzRemove most of the sparse warnings in the bnx2x compilation (i.e., thus resulting when compiling with `C=2 CF=-D__CHECK_ENDIAN__').
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 42 +++--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 4 +- drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h | 26 ++-- .../net/ethernet/broadcom/bnx2x/bnx2x_init_ops.h | 6 +- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 148 +++++++++++---------- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 80 +++++------ drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h | 17 ++- drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c | 20 +-- drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h | 11 +- 9 files changed, 195 insertions(+), 159 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +24 -18
@@ -3128,17 +3128,21 @@ static noinline u16 bnx2x_tx_split(struct bnx2x *bp,return bd_prod; } -static inline u16 bnx2x_csum_fix (unsigned char *t_header,u16 csum,s8 fix) +#define bswab32 (b32) ((__force __le32) swab32((__force __u32) (b32))) +#define bswab16 (b16) ((__force __le16) swab16((__force __u16) (b16))) +static inline __le16 bnx2x_csum_fix (unsigned char *t_header,u16 csum,s8 fix) { +__sum16 tsum = (__force __sum16 ) csum; +if (fix >0 ) - csum = (u16 ) ~csum_fold (csum_sub (csum, -csum_partial (t_header - fix, fix,0 ))); + tsum = ~csum_fold (csum_sub ((__force __wsum ) csum, +csum_partial (t_header - fix, fix,0 )));else if (fix <0 ) - csum = (u16 ) ~csum_fold (csum_add (csum, -csum_partial (t_header, -fix,0 ))); + tsum = ~csum_fold (csum_add ((__force __wsum ) csum, +csum_partial (t_header, -fix,0 ))); -return swab16 (csum); +return bswab16 (csum); }static inline u32 bnx2x_xmit_type (struct bnx2x *bp,struct sk_buff *skb)
@@ -3272,23 +3276,24 @@ static inline void bnx2x_set_pbd_gso(struct sk_buff *skb, u32 xmit_type) { pbd->lso_mss =cpu_to_le16 (skb_shinfo (skb)->gso_size); - pbd->tcp_send_seq =swab32 (tcp_hdr (skb)->seq); + pbd->tcp_send_seq =bswab32 (tcp_hdr (skb)->seq); pbd->tcp_flags =pbd_tcp_flags (skb);if (xmit_type &XMIT_GSO_V4 ) { - pbd->ip_id =swab16 (ip_hdr (skb)->id); + pbd->ip_id =bswab16 (ip_hdr (skb)->id); pbd->tcp_pseudo_csum = -swab16 (~csum_tcpudp_magic (ip_hdr (skb)->saddr, -ip_hdr (skb)->daddr, -0 ,IPPROTO_TCP ,0 )); +bswab16 (~csum_tcpudp_magic (ip_hdr (skb)->saddr, +ip_hdr (skb)->daddr, +0 ,IPPROTO_TCP ,0 )); }else pbd->tcp_pseudo_csum = -swab16 (~csum_ipv6_magic (&ipv6_hdr (skb)->saddr, - &ipv6_hdr (skb)->daddr, -0 ,IPPROTO_TCP ,0 )); +bswab16 (~csum_ipv6_magic (&ipv6_hdr (skb)->saddr, + &ipv6_hdr (skb)->daddr, +0 ,IPPROTO_TCP ,0 )); - pbd->global_data |=ETH_TX_PARSE_BD_E1X_PSEUDO_CS_WITHOUT_LEN ; + pbd->global_data |= +cpu_to_le16 (ETH_TX_PARSE_BD_E1X_PSEUDO_CS_WITHOUT_LEN ); }/**
@@ -3354,8 +3359,9 @@ static inline u8 bnx2x_set_pbd_csum(struct bnx2x *bp, struct sk_buff *skb,/* for now NS flag is not used in Linux */ pbd->global_data = - (hlen | ((skb->protocol ==cpu_to_be16 (ETH_P_8021Q )) << -ETH_TX_PARSE_BD_E1X_LLC_SNAP_EN_SHIFT )); +cpu_to_le16 (hlen | + ((skb->protocol ==cpu_to_be16 (ETH_P_8021Q )) << +ETH_TX_PARSE_BD_E1X_LLC_SNAP_EN_SHIFT )); pbd->ip_hlen_w = (skb_transport_header (skb) -skb_network_header (skb)) >>1 ;
@@ -3372,7 +3378,7 @@ static inline u8 bnx2x_set_pbd_csum(struct bnx2x *bp, struct sk_buff *skb, hlen = hlen*2 ;if (xmit_type &XMIT_CSUM_TCP ) { - pbd->tcp_pseudo_csum =swab16 (tcp_hdr (skb)->check); + pbd->tcp_pseudo_csum =bswab16 (tcp_hdr (skb)->check); }else {s8 fix =SKB_CS_OFF (skb);/* signed! */
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +2 -2
@@ -983,8 +983,8 @@ static inline int bnx2x_func_start(struct bnx2x *bp)* @fw_lo: pointer to lower part * @mac: pointer to MAC address */ -static inline void bnx2x_set_fw_mac_addr (u16 *fw_hi,u16 *fw_mid,u16 *fw_lo, -u8 *mac) +static inline void bnx2x_set_fw_mac_addr (__le16 *fw_hi,__le16 *fw_mid, +__le16 *fw_lo,u8 *mac) { ((u8 *)fw_hi)[0 ] = mac[1 ]; ((u8 *)fw_hi)[1 ] = mac[0 ];
drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h +15 -11
@@ -3378,6 +3378,10 @@ struct regpair {__le32 hi; }; +struct regpair_native { +u32 lo; +u32 hi; +};/* * Classify rule opcodes in E2/E3
@@ -4404,13 +4408,13 @@ struct tstorm_eth_function_common_config {* MAC filtering configuration parameters per port in Tstorm */ struct tstorm_eth_mac_filter_config { -__le32 ucast_drop_all; -__le32 ucast_accept_all; -__le32 mcast_drop_all; -__le32 mcast_accept_all; -__le32 bcast_accept_all; -__le32 vlan_filter[2 ]; -__le32 unmatched_unicast; +u32 ucast_drop_all; +u32 ucast_accept_all; +u32 mcast_drop_all; +u32 mcast_accept_all; +u32 bcast_accept_all; +u32 vlan_filter[2 ]; +u32 unmatched_unicast; };
@@ -4902,7 +4906,7 @@ union event_data {* per PF event ring data */ struct event_ring_data { -struct regpair base_addr; +struct regpair_native base_addr;#if defined(__BIG_ENDIAN)u8 index_id;u8 sb_id;
@@ -5135,7 +5139,7 @@ struct pci_entity {* The fast-path status block meta-data, common to all chips */ struct hc_sb_data { -struct regpair host_sb_addr; +struct regpair_native host_sb_addr;struct hc_status_block_sm state_machine[HC_SB_MAX_SM ];struct pci_entity p_func;#if defined(__BIG_ENDIAN)
@@ -5149,7 +5153,7 @@ struct hc_sb_data {u8 state;u8 rsrv0;#endif -struct regpair rsrv1[2 ]; +struct regpair_native rsrv1[2 ]; };
@@ -5167,7 +5171,7 @@ enum hc_segment {* The fast-path status block meta-data */ struct hc_sp_status_block_data { -struct regpair host_sb_addr; +struct regpair_native host_sb_addr;#if defined(__BIG_ENDIAN)u8 rsrv1;u8 state;
drivers/net/ethernet/broadcom/bnx2x/bnx2x_init_ops.h +3 -3
@@ -218,7 +218,7 @@ static void bnx2x_init_wr_zp(struct bnx2x *bp, u32 addr, u32 len,/* gunzip_outlen is in dwords */ len =GUNZIP_OUTLEN (bp);for (i =0 ; i < len; i++) - ((u32 *)GUNZIP_BUF (bp))[i] = + ((u32 *)GUNZIP_BUF (bp))[i] = (__force u32 )cpu_to_le32 (((u32 *)GUNZIP_BUF (bp))[i]);bnx2x_write_big_buf_wb (bp, addr, len);
@@ -232,7 +232,7 @@ static void bnx2x_init_block(struct bnx2x *bp, u32 block, u32 stage)u16 op_end =INIT_OPS_OFFSETS (bp)[BLOCK_OPS_IDX (block, stage,STAGE_END )]; -union init_op *op; +const union init_op *op;u32 op_idx, op_type, addr, len;const u32 *data, *data_base;
@@ -244,7 +244,7 @@ static void bnx2x_init_block(struct bnx2x *bp, u32 block, u32 stage)for (op_idx = op_start; op_idx < op_end; op_idx++) { - op = (union init_op *)&(INIT_OPS (bp)[op_idx]); + op = (const union init_op *)&(INIT_OPS (bp)[op_idx]);/* Get generic data */ op_type = op->raw.op; addr = op->raw.offset;
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +81 -67
256 lines not on this page · raw message
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +42 -38
250 lines not on this page · raw message
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h +11 -6
@@ -524,7 +524,7 @@ struct bnx2x_mcast_ramrod_params {int mcast_list_len; }; -enum { +enum bnx2x_mcast_cmd {BNX2X_MCAST_CMD_ADD ,BNX2X_MCAST_CMD_CONT ,BNX2X_MCAST_CMD_DEL ,
@@ -573,7 +573,8 @@ struct bnx2x_mcast_obj {* @param cmd command to execute (BNX2X_MCAST_CMD_X, see above) */ int (*config_mcast)(struct bnx2x *bp, -struct bnx2x_mcast_ramrod_params *p,int cmd); +struct bnx2x_mcast_ramrod_params *p, +enum bnx2x_mcast_cmd cmd);/** * Fills the ramrod data during the RESTORE flow.
@@ -590,11 +591,13 @@ struct bnx2x_mcast_obj { int start_bin, int *rdata_idx);int (*enqueue_cmd)(struct bnx2x *bp,struct bnx2x_mcast_obj *o, -struct bnx2x_mcast_ramrod_params *p,int cmd); +struct bnx2x_mcast_ramrod_params *p, +enum bnx2x_mcast_cmd cmd);void (*set_one_rule)(struct bnx2x *bp,struct bnx2x_mcast_obj *o,int idx, -union bnx2x_mcast_config_data *cfg_data,int cmd); +union bnx2x_mcast_config_data *cfg_data, +enum bnx2x_mcast_cmd cmd);/** Checks if there are more mcast MACs to be set or a previous * command is still pending.
@@ -617,7 +620,8 @@ struct bnx2x_mcast_obj {* feasible. */ int (*validate)(struct bnx2x *bp, -struct bnx2x_mcast_ramrod_params *p,int cmd); +struct bnx2x_mcast_ramrod_params *p, +enum bnx2x_mcast_cmd cmd);/** * Restore the values of internal counters in case of a failure.
@@ -1347,7 +1351,8 @@ void bnx2x_init_mcast_obj(struct bnx2x *bp,* completions. */ int bnx2x_config_mcast (struct bnx2x *bp, -struct bnx2x_mcast_ramrod_params *p,int cmd); +struct bnx2x_mcast_ramrod_params *p, +enum bnx2x_mcast_cmd cmd);/****************** CREDIT POOL ****************/ void bnx2x_init_mac_credit_pool(struct bnx2x *bp,
drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c +10 -10
@@ -1010,8 +1010,8 @@ static int bnx2x_storm_stats_update(struct bnx2x *bp)UPDATE_EXTEND_TSTAT (rcv_bcast_pkts, total_broadcast_packets_received);UPDATE_EXTEND_E_TSTAT (pkts_too_big_discard, - etherstatsoverrsizepkts); -UPDATE_EXTEND_E_TSTAT (no_buff_discard, no_buff_discard); + etherstatsoverrsizepkts,32 ); +UPDATE_EXTEND_E_TSTAT (no_buff_discard, no_buff_discard,16 );SUB_EXTEND_USTAT (ucast_no_buff_pkts, total_unicast_packets_received);
@@ -1090,15 +1090,15 @@ static int bnx2x_storm_stats_update(struct bnx2x *bp) estats->total_bytes_received_lo, estats->rx_stat_ifhcinbadoctets_lo); -ADD_64 (estats->total_bytes_received_hi, -le32_to_cpu (tfunc->rcv_error_bytes.hi), - estats->total_bytes_received_lo, -le32_to_cpu (tfunc->rcv_error_bytes.lo)); +ADD_64_LE (estats->total_bytes_received_hi, + tfunc->rcv_error_bytes.hi, + estats->total_bytes_received_lo, + tfunc->rcv_error_bytes.lo); -ADD_64 (estats->error_bytes_received_hi, -le32_to_cpu (tfunc->rcv_error_bytes.hi), - estats->error_bytes_received_lo, -le32_to_cpu (tfunc->rcv_error_bytes.lo)); +ADD_64_LE (estats->error_bytes_received_hi, + tfunc->rcv_error_bytes.hi, + estats->error_bytes_received_lo, + tfunc->rcv_error_bytes.lo);UPDATE_ESTAT (etherstatsoverrsizepkts, rx_stat_dot3statsframestoolong);
drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h +7 -4
@@ -421,16 +421,19 @@ struct bnx2x_fw_port_stats_old { new->s); \ } while (0) -#define UPDATE_EXTEND_TSTAT (s, t) \ +#define UPDATE_EXTEND_TSTAT_X (s, t, size) \ do { \ - diff = le32_to_cpu(tclient->s) - le32_to_cpu(old_tclient->s); \ + diff = le##size##_to_cpu(tclient->s) - \ + le##size##_to_cpu(old_tclient->s); \ old_tclient->s = tclient->s; \ ADD_EXTEND_64(qstats->t##_hi, qstats->t##_lo, diff); \ } while (0) -#define UPDATE_EXTEND_E_TSTAT (s, t) \ +#define UPDATE_EXTEND_TSTAT (s, t) UPDATE_EXTEND_TSTAT_X(s, t, 32) + +#define UPDATE_EXTEND_E_TSTAT (s, t, size) \ do { \ - UPDATE_EXTEND_TSTAT(s, t); \ + UPDATE_EXTEND_TSTAT_X(s, t, size); \ ADD_EXTEND_64(estats->t##_hi, estats->t##_lo, diff); \ } while (0)
Signature · 1 line
1.8.1.227.g44fe835
PATCH 11/12 bnx2x: Fix compilation with stop-on-error
In reply to Yuval MintzCommit 823e1d9 caused bnx2x to fail once BNX2X_STOP_ON_ERROR is set. Fixes compilation by moving function declarations between header files.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 2 ++ drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +2 -0
@@ -122,6 +122,8 @@ do { \ dev_info(&bp->pdev->dev, fmt, ##__VA_ARGS__); \ }while (0 ) +/* Error handling */ +void bnx2x_panic_dump(struct bnx2x *bp, bool disable_int);#ifdef BNX2X_STOP_ON_ERROR #define bnx2x_panic () \ do { \
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +0 -2
@@ -479,8 +479,6 @@ int bnx2x_set_power_state(struct bnx2x *bp, pci_power_t state);*/ void bnx2x_update_max_mf_config (struct bnx2x *bp,u32 value);/* Error handling */ -void bnx2x_panic_dump (struct bnx2x *bp,bool disable_int); -void bnx2x_fw_dump_lvl (struct bnx2x *bp,const char *lvl);/* validate currect fw is loaded */
Signature · 1 line
1.8.1.227.g44fe835
PATCH 7/12 bnx2x: Modify unload conditions
In reply to Yuval MintzDon't unload the bnx2x driver if its in a recovery process, or if the previous load have failed.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +11 -3
@@ -2805,7 +2805,7 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode, bool keep_link) val & ~DRV_FLAGS_CAPABILITIES_LOADED_L2); } -if (IS_PF (bp) && +if (IS_PF (bp) && bp->recovery_state !=BNX2X_RECOVERY_DONE && (bp->state ==BNX2X_STATE_CLOSED || bp->state ==BNX2X_STATE_ERROR )) {/* We can get here if the driver has been unloaded
@@ -2825,8 +2825,16 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode, bool keep_link)return -EINVAL ; } -/* -* It's important to set the bp->state to the value different from +/* Nothing to do during unload if previous bnx2x_nic_load() +* have not completed succesfully - all resourses are released. +* +* we can get here only after unsuccessful ndo_* callback, during which +* dev->IFF_UP flag is still on. +*/ +if (bp->state ==BNX2X_STATE_CLOSED || bp->state ==BNX2X_STATE_ERROR ) +return 0 ; + +/* It's important to set the bp->state to the value different from * BNX2X_STATE_OPEN and only then stop the Tx. Otherwise bnx2x_tx_int() * may restart the Tx from the NAPI context (see bnx2x_tx_int()). */
Signature · 1 line
1.8.1.227.g44fe835
PATCH 6/12 bnx2x: Correct memory preparation and release
In reply to Yuval MintzFrom: Dmitry Kravkov <[email protected]>
Since commit 15192a8cf there have been a memory leak upon rmmod of the bnx2x driver.
This corrects the memory leak and corrects the zeroing of internal memories upon driver load.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 2 + drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 58 ++++++------------------- 2 files changed, 16 insertions(+), 44 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +2 -0
@@ -1702,6 +1702,8 @@ struct bnx2x {/* priority to cos mapping */ u8 prio_to_cos[8 ]; + +int fp_array_size;u32 dump_preset_idx; };
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +14 -44
95 lines not on this page · raw message
Signature · 1 line
1.8.1.227.g44fe835
PATCH 9/12 bnx2x: correct memory release scheme
In reply to Yuval MintzFix an incorrect SR-IOV memory release which was committed in 1ab4434.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 6 ++---- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h | 1 + 2 files changed, 3 insertions(+), 4 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +2 -4
@@ -7738,10 +7738,6 @@ void bnx2x_free_mem(struct bnx2x *bp) {int i; -/* fastpath */ -bnx2x_free_fp_mem (bp); -/* end of fastpath */ -BNX2X_PCI_FREE (bp->def_status_blk, bp->def_status_blk_mapping,sizeof (struct host_sp_status_block ));
@@ -7762,6 +7758,8 @@ void bnx2x_free_mem(struct bnx2x *bp)BNX2X_PCI_FREE (bp->eq_ring, bp->eq_mapping,BCM_PAGE_SIZE *NUM_EQ_PAGES ); + +bnx2x_iov_free_mem (bp); }
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h +1 -0
@@ -773,6 +773,7 @@ static inline void bnx2x_vf_mbx(struct bnx2x *bp,static inline int bnx2x_iov_init_ilt (struct bnx2x *bp,u16 line) {return line; }static inline void bnx2x_iov_init_dq (struct bnx2x *bp) {}static inline int bnx2x_iov_alloc_mem (struct bnx2x *bp) {return 0 ; } +static inline void bnx2x_iov_free_mem (struct bnx2x *bp) {}static inline int bnx2x_iov_chip_cleanup (struct bnx2x *bp) {return 0 ; }static inline void bnx2x_iov_init_dmae (struct bnx2x *bp) {} static inline int bnx2x_iov_init_one(struct bnx2x *bp, int int_mode_param,
Signature · 1 line
1.8.1.227.g44fe835
PATCH 10/12 cnic, bnx2x: Add CNIC_DRV_STATE_HANDLES_IRQ to ethdev->drv_state
In reply to Yuval MintzFrom: Michael Chan <[email protected]>
In INTA mode, cnic and bnx2x share the same IRQ. During chip reset, for example, cnic will stop servicing IRQs after it has shutdown the cnic hardware resources. However, the shared IRQ is still active as bnx2x needs to finish the reset. There is a window when bnx2x does not know that cnic is no longer handling IRQ and things don't always work properly.
Add a flag to tell bnx2x that cnic is handling IRQ. The flag is set before the first cnic IRQ is expected and cleared when no more cnic IRQs are expected, so there should be no race conditions.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 14 ++++++-------- drivers/net/ethernet/broadcom/cnic.c | 4 ++++ drivers/net/ethernet/broadcom/cnic_if.h | 1 + 3 files changed, 11 insertions(+), 8 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +6 -8
@@ -1875,14 +1875,12 @@ irqreturn_t bnx2x_interrupt(int irq, void *dev_instance)if (status & (mask |0x1 )) {struct cnic_ops *c_ops =NULL ; -if (likely (bp->state ==BNX2X_STATE_OPEN )) { -rcu_read_lock (); - c_ops =rcu_dereference (bp->cnic_ops); -if (c_ops) - c_ops->cnic_handler (bp->cnic_data, -NULL ); -rcu_read_unlock (); - } +rcu_read_lock (); + c_ops =rcu_dereference (bp->cnic_ops); +if (c_ops && (bp->cnic_eth_dev.drv_state & +CNIC_DRV_STATE_HANDLES_IRQ )) + c_ops->cnic_handler (bp->cnic_data,NULL ); +rcu_read_unlock (); status &= ~mask; }
drivers/net/ethernet/broadcom/cnic.c +4 -0
@@ -4816,6 +4816,8 @@ static int cnic_start_bnx2_hw(struct cnic_dev *dev)return err; } + ethdev->drv_state |=CNIC_DRV_STATE_HANDLES_IRQ ; +return 0 ; }
@@ -5136,6 +5138,7 @@ static int cnic_start_bnx2x_hw(struct cnic_dev *dev)if (ret)return ret; + ethdev->drv_state |=CNIC_DRV_STATE_HANDLES_IRQ ;return 0 ; }
@@ -5387,6 +5390,7 @@ static void cnic_stop_hw(struct cnic_dev *dev) }cnic_shutdown_rings (dev); cp->stop_cm (dev); + cp->ethdev->drv_state &= ~CNIC_DRV_STATE_HANDLES_IRQ ;clear_bit (CNIC_F_CNIC_UP , &dev->flags);RCU_INIT_POINTER (cp->ulp_ops[CNIC_ULP_L4 ],NULL );synchronize_rcu ();
drivers/net/ethernet/broadcom/cnic_if.h +1 -0
@@ -179,6 +179,7 @@ struct cnic_eth_dev {#define CNIC_DRV_STATE_NO_ISCSI_OOO 0x00000004#define CNIC_DRV_STATE_NO_ISCSI 0x00000008#define CNIC_DRV_STATE_NO_FCOE 0x00000010 +#define CNIC_DRV_STATE_HANDLES_IRQ 0x00000020u32 chip_id;u32 max_kwqe_pending;struct pci_dev *pdev;
Signature · 1 line
1.8.1.227.g44fe835
PATCH 12/12 bnx2x: SR-IOV version compatibility bugfix
In reply to Yuval MintzFrom: Ariel Elior <[email protected]>
When posting a message on the bulletin board, the PF calculates crc over the message and places the result in the message. When the VF samples the Bulletin Board it copies the message aside and validates this crc. The length of the message is crucial here and must be the same in both parties. Since the PF is running in the Hypervisor and the VF is running in a Vm, they can possibly be of different versions. As the Bulletin Board is designed to grow forward in future versions, in the VF the length must not be the size of the message structure but instead it should be a field in the message itself.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 2 +- drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c | 4 ++-- drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.h | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +1 -1
@@ -3124,7 +3124,7 @@ u32 bnx2x_crc_vf_bulletin(struct bnx2x *bp, {return crc32 (BULLETIN_CRC_SEED , ((u8 *)bulletin) +sizeof (bulletin->crc), -BULLETIN_CONTENT_SIZE -sizeof (bulletin->crc)); + bulletin->length -sizeof (bulletin->crc)); }/* Check for new posts on the bulletin board */
drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c +2 -2
@@ -1631,7 +1631,6 @@ int bnx2x_post_vf_bulletin(struct bnx2x *bp, int vf)dma_addr_t pf_addr =BP_VF_BULLETIN_DMA (bp)->mapping + vf *BULLETIN_CONTENT_SIZE ;dma_addr_t vf_addr =bnx2x_vf (bp, vf, bulletin_map); -u32 len =BULLETIN_CONTENT_SIZE ;int rc;/* can only update vf after init took place */
@@ -1641,11 +1640,12 @@ int bnx2x_post_vf_bulletin(struct bnx2x *bp, int vf)/* increment bulletin board version and compute crc */ bulletin->version++; + bulletin->length =BULLETIN_CONTENT_SIZE ; bulletin->crc =bnx2x_crc_vf_bulletin (bp, bulletin);/* propagate bulletin board via dmae to vm memory */ rc =bnx2x_copy32_vf_dmae (bp, false, pf_addr,bnx2x_vf (bp, vf, abs_vfid),U64_HI (vf_addr), -U64_LO (vf_addr), len/4 ); +U64_LO (vf_addr), bulletin->length /4 );return rc; }
drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.h +2 -1
@@ -318,7 +318,8 @@ struct pf_vf_bulletin_content {u32 crc;/* crc of structure to ensure is not in * mid-update */ -u32 version; +u16 version; +u16 length;aligned_u64 valid_bitmap;/* bitmap indicating which fields * hold valid values
Signature · 1 line
1.8.1.227.g44fe835
PATCH 5/12 bnx2x: Add missing VFs reference in macros
In reply to Yuval MintzAdd missing 57712_VF and 57800_VF to CHIP_IS_E2 and CHIP_IS_E3 macros (missing from commit 8395be5).
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +3 -1
@@ -843,9 +843,11 @@ struct bnx2x_common {#define CHIP_IS_E1H (bp) (CHIP_IS_57711(bp) || \ CHIP_IS_57711E(bp))#define CHIP_IS_E2 (bp) (CHIP_IS_57712(bp) || \ - CHIP_IS_57712_MF(bp)) + CHIP_IS_57712_MF(bp) || \ + CHIP_IS_57712_VF(bp))#define CHIP_IS_E3 (bp) (CHIP_IS_57800(bp) || \ CHIP_IS_57800_MF(bp) || \ + CHIP_IS_57800_VF(bp) || \ CHIP_IS_57810(bp) || \ CHIP_IS_57810_MF(bp) || \ CHIP_IS_57810_VF(bp) || \
Signature · 1 line
1.8.1.227.g44fe835
David Miller
maintainerFrom: "Yuval Mintz" <[email protected]>
Date: Wed, 23 Jan 2013 15:21:42 +0200
Quoted 9 lines
Hi Dave,
This patch series contain several Semi-semantic patches (i.e., some are purely semantic, such as correcting comments & typos, while others slightly change the bnx2x code without effectively changing any flow), while other fix several small issues, mostly either memory-related or missing segments from our recent SR-IOV submission.
Please consider applying this patch-series to 'net-next'.
Series applied, thanks.