From 8d9c5f34a25d6a30d15a800d83a3428ad44271d8 Mon Sep 17 00:00:00 2001 From: Eilon Greenstein Date: Sun, 15 Feb 2009 23:24:08 -0800 Subject: bnx2x: New FW This is the FW blob and the relevant definitions without any logic. It also contains the minimal mandatory code changes to work with this FW but it does not contain enabling of the new features that this FW provides. This FW is needed for: - More efficient multi-queue - per queue statistics - Big-endian issue with MSI - Improved pause response Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- drivers/net/bnx2x.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/bnx2x.h') diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index 15a5cf0f676..de094d4b68a 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h @@ -1125,7 +1125,7 @@ static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms, TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_TCP_CAPABILITY | \ TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_CAPABILITY | \ TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY | \ - TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_ENABLE) + TSTORM_ETH_FUNCTION_COMMON_CONFIG_DEFAULT_ENABLE) #define MULTI_MASK 0x7f -- cgit v1.2.3-18-g5258 From 555f6c78373f969f14487253abe331d085449360 Mon Sep 17 00:00:00 2001 From: Eilon Greenstein Date: Thu, 12 Feb 2009 08:36:11 +0000 Subject: bnx2x: Multi-queue Adding Tx multi-queue and enabling multi-queue by default Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- drivers/net/bnx2x.h | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'drivers/net/bnx2x.h') diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index de094d4b68a..7edad1f9b33 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h @@ -25,6 +25,10 @@ #endif +#define BNX2X_MULTI_QUEUE + +#define BNX2X_NEW_NAPI + /* error/debug prints */ #define DRV_MODULE_NAME "bnx2x" @@ -266,6 +270,7 @@ struct bnx2x_fastpath { u64 tpa_queue_used; #endif + char name[IFNAMSIZ]; struct bnx2x *bp; /* parent */ }; @@ -680,11 +685,7 @@ struct bnx2x_eth_stats { (offsetof(struct bnx2x_eth_stats, stat_name) / 4) -#ifdef BNX2X_MULTI #define MAX_CONTEXT 16 -#else -#define MAX_CONTEXT 1 -#endif union cdu_context { struct eth_context eth; @@ -859,8 +860,9 @@ struct bnx2x { #define BNX2X_STATE_DIAG 0xe000 #define BNX2X_STATE_ERROR 0xf000 - int num_queues; -#define BP_MAX_QUEUES(bp) (IS_E1HMF(bp) ? 4 : 16) + int multi_mode; + int num_rx_queues; + int num_tx_queues; u32 rx_mode; #define BNX2X_RX_MODE_NONE 0 @@ -911,11 +913,19 @@ struct bnx2x { }; -#define for_each_queue(bp, var) for (var = 0; var < bp->num_queues; var++) +#define BNX2X_MAX_QUEUES(bp) (IS_E1HMF(bp) ? (MAX_CONTEXT / E1HVN_MAX) : \ + MAX_CONTEXT) +#define BNX2X_NUM_QUEUES(bp) max(bp->num_rx_queues, bp->num_tx_queues) +#define is_multi(bp) (BNX2X_NUM_QUEUES(bp) > 1) +#define for_each_rx_queue(bp, var) \ + for (var = 0; var < bp->num_rx_queues; var++) +#define for_each_tx_queue(bp, var) \ + for (var = 0; var < bp->num_tx_queues; var++) +#define for_each_queue(bp, var) \ + for (var = 0; var < BNX2X_NUM_QUEUES(bp); var++) #define for_each_nondefault_queue(bp, var) \ - for (var = 1; var < bp->num_queues; var++) -#define is_multi(bp) (bp->num_queues > 1) + for (var = 1; var < BNX2X_NUM_QUEUES(bp); var++) void bnx2x_read_dmae(struct bnx2x *bp, u32 src_addr, u32 len32); @@ -1120,12 +1130,13 @@ static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms, AEU_INPUTS_ATTN_BITS_MISC_PARITY_ERROR) -#define MULTI_FLAGS \ +#define MULTI_FLAGS(bp) \ (TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY | \ TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_TCP_CAPABILITY | \ TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_CAPABILITY | \ TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY | \ - TSTORM_ETH_FUNCTION_COMMON_CONFIG_DEFAULT_ENABLE) + (bp->multi_mode << \ + TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE_SHIFT)) #define MULTI_MASK 0x7f -- cgit v1.2.3-18-g5258 From 8badd27aa0d7c02572fcd1a4a3c6b57d67f40b78 Mon Sep 17 00:00:00 2001 From: Eilon Greenstein Date: Thu, 12 Feb 2009 08:36:15 +0000 Subject: bnx2x: MSI support Enabling MSI on top of MSI-X and INTA. Also changing the module parameter to allow choosing INTA or MSI even when MSI-X is available. The default status block should not be reversed for endianity. Since MSI can issue re-configuration, the interrupt disable function now requires mmiowb Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- drivers/net/bnx2x.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/net/bnx2x.h') diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index 7edad1f9b33..153cc9564b4 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h @@ -740,6 +740,9 @@ struct bnx2x { atomic_t intr_sem; struct msix_entry msix_table[MAX_CONTEXT+1]; +#define INT_MODE_INTx 1 +#define INT_MODE_MSI 2 +#define INT_MODE_MSIX 3 int tx_ring_size; @@ -794,7 +797,7 @@ struct bnx2x { #define NO_WOL_FLAG 8 #define USING_DAC_FLAG 0x10 #define USING_MSIX_FLAG 0x20 -#define ASF_ENABLE_FLAG 0x40 +#define USING_MSI_FLAG 0x40 #define TPA_ENABLE_FLAG 0x80 #define NO_MCP_FLAG 0x100 #define BP_NOMCP(bp) (bp->flags & NO_MCP_FLAG) -- cgit v1.2.3-18-g5258 From 0f00846deb9c9eaaeb4668b81496b783a04a241f Mon Sep 17 00:00:00 2001 From: Eilon Greenstein Date: Thu, 12 Feb 2009 08:36:18 +0000 Subject: bnx2x: System-page alignment Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- drivers/net/bnx2x.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'drivers/net/bnx2x.h') diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index 153cc9564b4..89a72c86ef8 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h @@ -158,8 +158,6 @@ struct sw_rx_page { #define SGE_PAGE_SHIFT PAGE_SHIFT #define SGE_PAGE_ALIGN(addr) PAGE_ALIGN(addr) -#define BCM_RX_ETH_PAYLOAD_ALIGN 64 - /* SGE ring related macros */ #define NUM_RX_SGE_PAGES 2 #define RX_SGE_CNT (BCM_PAGE_SIZE / sizeof(struct eth_rx_sge)) @@ -758,6 +756,11 @@ struct bnx2x { #define ETH_MAX_PACKET_SIZE 1500 #define ETH_MAX_JUMBO_PACKET_SIZE 9600 + /* Max supported alignment is 256 (8 shift) */ +#define BNX2X_RX_ALIGN_SHIFT ((L1_CACHE_SHIFT < 8) ? \ + L1_CACHE_SHIFT : 8) +#define BNX2X_RX_ALIGN (1 << BNX2X_RX_ALIGN_SHIFT) + struct host_def_status_block *def_status_blk; #define DEF_SB_ID 16 u16 def_c_idx; -- cgit v1.2.3-18-g5258 From d3d4f49527249e87d11219a22469dff25b674c08 Mon Sep 17 00:00:00 2001 From: Eilon Greenstein Date: Thu, 12 Feb 2009 08:36:27 +0000 Subject: bnx2x: Removing microcode assertion check This check is unreliable since latest MC can issue warnings on rare occasions which are not fatal errors Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- drivers/net/bnx2x.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/bnx2x.h') diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index 89a72c86ef8..cfbeabb8e5e 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h @@ -1009,7 +1009,7 @@ static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms, #define BNX2X_NUM_STATS 42 -#define BNX2X_NUM_TESTS 8 +#define BNX2X_NUM_TESTS 7 #define BNX2X_MAC_LOOPBACK 0 #define BNX2X_PHY_LOOPBACK 1 -- cgit v1.2.3-18-g5258 From de832a55d28bdcc38a3f3c160554d2dfa5a62069 Mon Sep 17 00:00:00 2001 From: Eilon Greenstein Date: Thu, 12 Feb 2009 08:36:33 +0000 Subject: bnx2x: Per queue statistics Re-ordering the statistics to enhance readability and adding per queue statistics (available via ethtool -S) Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- drivers/net/bnx2x.h | 67 +++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 57 insertions(+), 10 deletions(-) (limited to 'drivers/net/bnx2x.h') diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index cfbeabb8e5e..b411497a4fd 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h @@ -189,6 +189,43 @@ struct sw_rx_page { #define NEXT_SGE_MASK_ELEM(el) (((el) + 1) & RX_SGE_MASK_LEN_MASK) +struct bnx2x_eth_q_stats { + u32 total_bytes_received_hi; + u32 total_bytes_received_lo; + u32 total_bytes_transmitted_hi; + u32 total_bytes_transmitted_lo; + u32 total_unicast_packets_received_hi; + u32 total_unicast_packets_received_lo; + u32 total_multicast_packets_received_hi; + u32 total_multicast_packets_received_lo; + u32 total_broadcast_packets_received_hi; + u32 total_broadcast_packets_received_lo; + u32 total_unicast_packets_transmitted_hi; + u32 total_unicast_packets_transmitted_lo; + u32 total_multicast_packets_transmitted_hi; + u32 total_multicast_packets_transmitted_lo; + u32 total_broadcast_packets_transmitted_hi; + u32 total_broadcast_packets_transmitted_lo; + u32 valid_bytes_received_hi; + u32 valid_bytes_received_lo; + + u32 error_bytes_received_hi; + u32 error_bytes_received_lo; + u32 etherstatsoverrsizepkts_hi; + u32 etherstatsoverrsizepkts_lo; + u32 no_buff_discard_hi; + u32 no_buff_discard_lo; + + u32 driver_xoff; + u32 rx_err_discard_pkt; + u32 rx_skb_alloc_failed; + u32 hw_csum_err; +}; + +#define BNX2X_NUM_Q_STATS 11 +#define Q_STATS_OFFSET32(stat_name) \ + (offsetof(struct bnx2x_eth_q_stats, stat_name) / 4) + struct bnx2x_fastpath { struct napi_struct napi; @@ -268,6 +305,11 @@ struct bnx2x_fastpath { u64 tpa_queue_used; #endif + struct tstorm_per_client_stats old_tclient; + struct ustorm_per_client_stats old_uclient; + struct xstorm_per_client_stats old_xclient; + struct bnx2x_eth_q_stats eth_q_stats; + char name[IFNAMSIZ]; struct bnx2x *bp; /* parent */ }; @@ -576,6 +618,10 @@ struct bnx2x_eth_stats { u32 error_bytes_received_hi; u32 error_bytes_received_lo; + u32 etherstatsoverrsizepkts_hi; + u32 etherstatsoverrsizepkts_lo; + u32 no_buff_discard_hi; + u32 no_buff_discard_lo; u32 rx_stat_ifhcinbadoctets_hi; u32 rx_stat_ifhcinbadoctets_lo; @@ -654,19 +700,20 @@ struct bnx2x_eth_stats { u32 tx_stat_bmac_ufl_hi; u32 tx_stat_bmac_ufl_lo; - u32 brb_drop_hi; - u32 brb_drop_lo; - u32 brb_truncate_hi; - u32 brb_truncate_lo; - - u32 jabber_packets_received; + u32 pause_frames_received_hi; + u32 pause_frames_received_lo; + u32 pause_frames_sent_hi; + u32 pause_frames_sent_lo; u32 etherstatspkts1024octetsto1522octets_hi; u32 etherstatspkts1024octetsto1522octets_lo; u32 etherstatspktsover1522octets_hi; u32 etherstatspktsover1522octets_lo; - u32 no_buff_discard; + u32 brb_drop_hi; + u32 brb_drop_lo; + u32 brb_truncate_hi; + u32 brb_truncate_lo; u32 mac_filter_discard; u32 xxoverflow_discard; @@ -677,8 +724,11 @@ struct bnx2x_eth_stats { u32 rx_err_discard_pkt; u32 rx_skb_alloc_failed; u32 hw_csum_err; + + u32 nig_timer_max; }; +#define BNX2X_NUM_STATS 41 #define STATS_OFFSET32(stat_name) \ (offsetof(struct bnx2x_eth_stats, stat_name) / 4) @@ -906,8 +956,6 @@ struct bnx2x { int executer_idx; u16 stats_counter; - struct tstorm_per_client_stats old_tclient; - struct xstorm_per_client_stats old_xclient; struct bnx2x_eth_stats eth_stats; struct z_stream_s *strm; @@ -1008,7 +1056,6 @@ static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms, #define PCICFG_LINK_SPEED_SHIFT 16 -#define BNX2X_NUM_STATS 42 #define BNX2X_NUM_TESTS 7 #define BNX2X_MAC_LOOPBACK 0 -- cgit v1.2.3-18-g5258 From 8a1c38d17d88c8df3dcbea1c01a390ab2087f8ad Mon Sep 17 00:00:00 2001 From: Eilon Greenstein Date: Thu, 12 Feb 2009 08:36:40 +0000 Subject: bnx2x: BW shaper enhancements Some of the configuration can be set when loading the device and shouldn't be re-calculated after each link up indication since it is not dependent on the link speed Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- drivers/net/bnx2x.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/net/bnx2x.h') diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index b411497a4fd..b40d4f127d3 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h @@ -883,6 +883,9 @@ struct bnx2x { struct bnx2x_common common; struct bnx2x_port port; + struct cmng_struct_per_port cmng; + u32 vn_weight_sum; + u32 mf_config; u16 e1hov; u8 e1hmf; -- cgit v1.2.3-18-g5258 From 1c06328c0345638ea7532b45cadfe713c9e9781e Mon Sep 17 00:00:00 2001 From: Eilon Greenstein Date: Thu, 12 Feb 2009 08:36:43 +0000 Subject: bnx2x: Flow control enhancement Setting better HW thresholds and enabling FW capabilities for better enforcement. Also set the HW to more efficiently use the internal buffers if this is a single port design Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- drivers/net/bnx2x.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/bnx2x.h') diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index b40d4f127d3..8c2124e0eae 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h @@ -846,7 +846,7 @@ struct bnx2x { u32 flags; #define PCIX_FLAG 1 #define PCI_32BIT_FLAG 2 -#define ONE_TDMA_FLAG 4 /* no longer used */ +#define ONE_PORT_FLAG 4 #define NO_WOL_FLAG 8 #define USING_DAC_FLAG 0x10 #define USING_MSIX_FLAG 0x20 -- cgit v1.2.3-18-g5258 From 35b19ba51c1e6258a338a0855c72384abc33ce11 Mon Sep 17 00:00:00 2001 From: Eilon Greenstein Date: Thu, 12 Feb 2009 08:36:47 +0000 Subject: bnx2x: Removing the board type There are too many different board types and this field is not scalable. Removing it and making decisions according to other fields Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- drivers/net/bnx2x.h | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/net/bnx2x.h') diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index 8c2124e0eae..a18ace07fa4 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h @@ -523,7 +523,6 @@ struct bnx2x_common { u32 shmem_base; u32 hw_config; - u32 board; u32 bc_ver; -- cgit v1.2.3-18-g5258 From 87942b467880fb65381af87a5ff61fdb7ede5eb3 Mon Sep 17 00:00:00 2001 From: Eilon Greenstein Date: Thu, 12 Feb 2009 08:36:49 +0000 Subject: bnx2x: Removing redundant device parameters Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- drivers/net/bnx2x.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'drivers/net/bnx2x.h') diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index a18ace07fa4..2397a891e1b 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h @@ -525,8 +525,6 @@ struct bnx2x_common { u32 hw_config; u32 bc_ver; - - char *name; }; @@ -798,7 +796,6 @@ struct bnx2x { #endif u32 rx_csum; - u32 rx_offset; u32 rx_buf_size; #define ETH_OVREHEAD (ETH_HLEN + 8) /* 8 for CRC + VLAN */ #define ETH_MIN_PACKET_SIZE 60 @@ -819,7 +816,6 @@ struct bnx2x { u16 def_att_idx; u32 attn_state; struct attn_route attn_group[MAX_DYNAMIC_ATTN_GRPS]; - u32 nig_mask; /* slow path ring */ struct eth_spe *spq; @@ -869,7 +865,6 @@ struct bnx2x { struct work_struct reset_task; struct timer_list timer; - int timer_interval; int current_interval; u16 fw_seq; -- cgit v1.2.3-18-g5258 From 4acac6a53a3c9dfc604a9a8647f16b0242080e93 Mon Sep 17 00:00:00 2001 From: Eilon Greenstein Date: Thu, 12 Feb 2009 08:36:52 +0000 Subject: bnx2x: GPIO accessories A GPIO is used with the 8726 PHY. Adding the GPIO related functions in this Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- drivers/net/bnx2x.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/net/bnx2x.h') diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index 2397a891e1b..d66be72d832 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h @@ -982,7 +982,9 @@ struct bnx2x { void bnx2x_read_dmae(struct bnx2x *bp, u32 src_addr, u32 len32); void bnx2x_write_dmae(struct bnx2x *bp, dma_addr_t dma_addr, u32 dst_addr, u32 len32); +int bnx2x_get_gpio(struct bnx2x *bp, int gpio_num, u8 port); int bnx2x_set_gpio(struct bnx2x *bp, int gpio_num, u32 mode, u8 port); +int bnx2x_set_gpio_int(struct bnx2x *bp, int gpio_num, u32 mode, u8 port); static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms, int wait) -- cgit v1.2.3-18-g5258 From 46c6a67495b3ec76204db800fc8d60a260f91cfe Mon Sep 17 00:00:00 2001 From: Eilon Greenstein Date: Thu, 12 Feb 2009 08:36:58 +0000 Subject: bnx2x: PHY lock list Some dual port PHY require HW lock since they are used by both interfaces (different driver instances). Since this list is getting longer, update a parameter at load time instead of calculating it on runtime Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- drivers/net/bnx2x.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/net/bnx2x.h') diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index d66be72d832..12d2d0bd9a4 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h @@ -570,6 +570,7 @@ struct bnx2x_port { /* used to synchronize phy accesses */ struct mutex phy_mutex; + int need_hw_lock; u32 port_stx; -- cgit v1.2.3-18-g5258 From 052a38e096dece43e38a19a896ae7ad019415bc1 Mon Sep 17 00:00:00 2001 From: Eilon Greenstein Date: Thu, 12 Feb 2009 08:37:16 +0000 Subject: bnx2x: Using registers name Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- drivers/net/bnx2x.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'drivers/net/bnx2x.h') diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index 12d2d0bd9a4..9834a86d813 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h @@ -446,10 +446,13 @@ struct bnx2x_fastpath { #define BNX2X_RX_CSUM_OK(cqe) \ (!(BNX2X_L4_CSUM_ERR(cqe) || BNX2X_IP_CSUM_ERR(cqe))) +#define BNX2X_PRS_FLAG_OVERETH_IPV4(flags) \ + (((le16_to_cpu(flags) & \ + PARSING_FLAGS_OVER_ETHERNET_PROTOCOL) >> \ + PARSING_FLAGS_OVER_ETHERNET_PROTOCOL_SHIFT) \ + == PRS_FLAG_OVERETH_IPV4) #define BNX2X_RX_SUM_FIX(cqe) \ - ((le16_to_cpu(cqe->fast_path_cqe.pars_flags.flags) & \ - PARSING_FLAGS_OVER_ETHERNET_PROTOCOL) == \ - (1 << PARSING_FLAGS_OVER_ETHERNET_PROTOCOL_SHIFT)) + BNX2X_PRS_FLAG_OVERETH_IPV4(cqe->fast_path_cqe.pars_flags.flags) #define FP_USB_FUNC_OFF (2 + 2*HC_USTORM_SB_NUM_INDICES) -- cgit v1.2.3-18-g5258 From 8d5726c404fd41fedb7a49e1fbef62c60754021a Mon Sep 17 00:00:00 2001 From: Eilon Greenstein Date: Thu, 12 Feb 2009 08:37:19 +0000 Subject: bnx2x: Manual setting for MRRS Allows better debug capabilities if the user wants to force an MRRS value Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- drivers/net/bnx2x.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/net/bnx2x.h') diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index 9834a86d813..891a58ed759 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h @@ -864,6 +864,7 @@ struct bnx2x { int pm_cap; int pcie_cap; + int mrrs; struct delayed_work sp_task; struct work_struct reset_task; -- cgit v1.2.3-18-g5258 From b5bf9068ebb1b4012e4c0fef58490f97e6b6a0db Mon Sep 17 00:00:00 2001 From: Eilon Greenstein Date: Thu, 12 Feb 2009 08:38:08 +0000 Subject: bnx2x: Loopback in diag mode When loading in diag mode, set the device to loopback instead of normal link and then changing it to loopback mode Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- drivers/net/bnx2x.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/net/bnx2x.h') diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index 891a58ed759..88eeee9197c 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h @@ -1062,10 +1062,10 @@ static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms, #define BNX2X_NUM_TESTS 7 -#define BNX2X_MAC_LOOPBACK 0 -#define BNX2X_PHY_LOOPBACK 1 -#define BNX2X_MAC_LOOPBACK_FAILED 1 -#define BNX2X_PHY_LOOPBACK_FAILED 2 +#define BNX2X_PHY_LOOPBACK 0 +#define BNX2X_MAC_LOOPBACK 1 +#define BNX2X_PHY_LOOPBACK_FAILED 1 +#define BNX2X_MAC_LOOPBACK_FAILED 2 #define BNX2X_LOOPBACK_FAILED (BNX2X_MAC_LOOPBACK_FAILED | \ BNX2X_PHY_LOOPBACK_FAILED) -- cgit v1.2.3-18-g5258 From 0626b89971d75b35698f208fd7abe4303e1588b9 Mon Sep 17 00:00:00 2001 From: Eilon Greenstein Date: Thu, 12 Feb 2009 08:38:14 +0000 Subject: bnx2x: Removing redundant macros Signed-off-by: Harvey Harrison Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- drivers/net/bnx2x.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'drivers/net/bnx2x.h') diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index 88eeee9197c..e07d91582cf 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h @@ -96,12 +96,10 @@ #define REG_RD(bp, offset) readl(REG_ADDR(bp, offset)) #define REG_RD8(bp, offset) readb(REG_ADDR(bp, offset)) -#define REG_RD64(bp, offset) readq(REG_ADDR(bp, offset)) #define REG_WR(bp, offset, val) writel((u32)val, REG_ADDR(bp, offset)) #define REG_WR8(bp, offset, val) writeb((u8)val, REG_ADDR(bp, offset)) #define REG_WR16(bp, offset, val) writew((u16)val, REG_ADDR(bp, offset)) -#define REG_WR32(bp, offset, val) REG_WR(bp, offset, val) #define REG_RD_IND(bp, offset) bnx2x_reg_rd_ind(bp, offset) #define REG_WR_IND(bp, offset, val) bnx2x_reg_wr_ind(bp, offset, val) @@ -267,11 +265,6 @@ struct bnx2x_fastpath { u8 index; /* number in fp array */ u8 cl_id; /* eth client id */ u8 sb_id; /* status block number in HW */ -#define FP_IDX(fp) (fp->index) -#define FP_CL_ID(fp) (fp->cl_id) -#define BP_CL_ID(bp) (bp->fp[0].cl_id) -#define FP_SB_ID(fp) (fp->sb_id) -#define CNIC_SB_ID 0 u16 tx_pkt_prod; u16 tx_pkt_cons; @@ -1128,9 +1121,6 @@ static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms, #define BNX2X_MCP_ASSERT \ GENERAL_ATTEN_OFFSET(MCP_FATAL_ASSERT_ATTENTION_BIT) -#define BNX2X_DOORQ_ASSERT \ - AEU_INPUTS_ATTN_BITS_DOORBELLQ_HW_INTERRUPT - #define BNX2X_GRC_TIMEOUT GENERAL_ATTEN_OFFSET(LATCHED_ATTN_TIMEOUT_GRC) #define BNX2X_GRC_RSV (GENERAL_ATTEN_OFFSET(LATCHED_ATTN_RBCR) | \ GENERAL_ATTEN_OFFSET(LATCHED_ATTN_RBCT) | \ -- cgit v1.2.3-18-g5258 From 4781bfad732af717784ee6b5bcdd97f4c3e8f597 Mon Sep 17 00:00:00 2001 From: Eilon Greenstein Date: Thu, 12 Feb 2009 08:38:17 +0000 Subject: bnx2x: Sparse endianity annotation Resolving the majority of the issues, but there are still some left for future patches. Signed-off-by: Harvey Harrison Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- drivers/net/bnx2x.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'drivers/net/bnx2x.h') diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index e07d91582cf..bec5aff649a 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h @@ -270,10 +270,10 @@ struct bnx2x_fastpath { u16 tx_pkt_cons; u16 tx_bd_prod; u16 tx_bd_cons; - u16 *tx_cons_sb; + __le16 *tx_cons_sb; - u16 fp_c_idx; - u16 fp_u_idx; + __le16 fp_c_idx; + __le16 fp_u_idx; u16 rx_bd_prod; u16 rx_bd_cons; @@ -282,8 +282,8 @@ struct bnx2x_fastpath { u16 rx_sge_prod; /* The last maximal completed SGE */ u16 last_max_sge; - u16 *rx_cons_sb; - u16 *rx_bd_cons_sb; + __le16 *rx_cons_sb; + __le16 *rx_bd_cons_sb; unsigned long tx_pkt, rx_pkt, @@ -806,11 +806,11 @@ struct bnx2x { struct host_def_status_block *def_status_blk; #define DEF_SB_ID 16 - u16 def_c_idx; - u16 def_u_idx; - u16 def_x_idx; - u16 def_t_idx; - u16 def_att_idx; + __le16 def_c_idx; + __le16 def_u_idx; + __le16 def_x_idx; + __le16 def_t_idx; + __le16 def_att_idx; u32 attn_state; struct attn_route attn_group[MAX_DYNAMIC_ATTN_GRPS]; @@ -820,7 +820,7 @@ struct bnx2x { u16 spq_prod_idx; struct eth_spe *spq_prod_bd; struct eth_spe *spq_last_bd; - u16 *dsb_sp_prod; + __le16 *dsb_sp_prod; u16 spq_left; /* serialize spq */ /* used to synchronize spq accesses */ spinlock_t spq_lock; -- cgit v1.2.3-18-g5258 From 359d8b1599050977771190cf938ef010e951ee04 Mon Sep 17 00:00:00 2001 From: Eilon Greenstein Date: Thu, 12 Feb 2009 08:38:25 +0000 Subject: bnx2x: Moving includes Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- drivers/net/bnx2x.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/net/bnx2x.h') diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index bec5aff649a..5eb35a66f23 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h @@ -29,6 +29,12 @@ #define BNX2X_NEW_NAPI + +#include "bnx2x_reg.h" +#include "bnx2x_fw_defs.h" +#include "bnx2x_hsi.h" +#include "bnx2x_link.h" + /* error/debug prints */ #define DRV_MODULE_NAME "bnx2x" -- cgit v1.2.3-18-g5258 From 356e23850b5ed4471470a918623021765fcaf125 Mon Sep 17 00:00:00 2001 From: Eilon Greenstein Date: Thu, 12 Feb 2009 08:38:32 +0000 Subject: bnx2x: Clean-up Whitespaces, empty lines, 80 columns, indentations and removing redundant parenthesis Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- drivers/net/bnx2x.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/bnx2x.h') diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index 5eb35a66f23..408eae7d6cc 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h @@ -906,7 +906,7 @@ struct bnx2x { u32 lin_cnt; int state; -#define BNX2X_STATE_CLOSED 0x0 +#define BNX2X_STATE_CLOSED 0 #define BNX2X_STATE_OPENING_WAIT4_LOAD 0x1000 #define BNX2X_STATE_OPENING_WAIT4_PORT 0x2000 #define BNX2X_STATE_OPEN 0x3000 -- cgit v1.2.3-18-g5258