Commit 66e855f3 authored by Yitchak Gertner's avatar Yitchak Gertner Committed by David S. Miller

bnx2x: Statistics

Statistics
- Making sure that each drop is accounted for in the driver statistics
- Clearing the FW statistics when driver is loaded to prevent
  inconsistency with HW statistics
- Once error is detected (bnx2x_panic_dump), stop the statistics
  before other actions (currently it is stopped last and can corrupt
  the data) - Adding HW checksum error counter to the statistics
- Removing unused variable stats_ticks
- Using macros instead of magic numbers to indicate which statistics are
  shared per port and which are per function
Signed-off-by: default avatarYitchak Gertner <gertner@broadcom.com>
Signed-off-by: default avatarEilon Greenstein <eilong@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1adcd8be
...@@ -258,8 +258,7 @@ struct bnx2x_fastpath { ...@@ -258,8 +258,7 @@ struct bnx2x_fastpath {
unsigned long tx_pkt, unsigned long tx_pkt,
rx_pkt, rx_pkt,
rx_calls, rx_calls;
rx_alloc_failed;
/* TPA related */ /* TPA related */
struct sw_rx_bd tpa_pool[ETH_MAX_AGGREGATION_QUEUES_E1H]; struct sw_rx_bd tpa_pool[ETH_MAX_AGGREGATION_QUEUES_E1H];
u8 tpa_state[ETH_MAX_AGGREGATION_QUEUES_E1H]; u8 tpa_state[ETH_MAX_AGGREGATION_QUEUES_E1H];
...@@ -655,6 +654,8 @@ struct bnx2x_eth_stats { ...@@ -655,6 +654,8 @@ struct bnx2x_eth_stats {
u32 brb_drop_hi; u32 brb_drop_hi;
u32 brb_drop_lo; u32 brb_drop_lo;
u32 brb_truncate_hi;
u32 brb_truncate_lo;
u32 jabber_packets_received; u32 jabber_packets_received;
...@@ -671,6 +672,9 @@ struct bnx2x_eth_stats { ...@@ -671,6 +672,9 @@ struct bnx2x_eth_stats {
u32 mac_discard; u32 mac_discard;
u32 driver_xoff; u32 driver_xoff;
u32 rx_err_discard_pkt;
u32 rx_skb_alloc_failed;
u32 hw_csum_err;
}; };
#define STATS_OFFSET32(stat_name) \ #define STATS_OFFSET32(stat_name) \
...@@ -844,7 +848,6 @@ struct bnx2x { ...@@ -844,7 +848,6 @@ struct bnx2x {
u16 rx_ticks_int; u16 rx_ticks_int;
u16 rx_ticks; u16 rx_ticks;
u32 stats_ticks;
u32 lin_cnt; u32 lin_cnt;
int state; int state;
...@@ -984,7 +987,7 @@ static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms, ...@@ -984,7 +987,7 @@ static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms,
#define PCICFG_LINK_SPEED_SHIFT 16 #define PCICFG_LINK_SPEED_SHIFT 16
#define BNX2X_NUM_STATS 39 #define BNX2X_NUM_STATS 42
#define BNX2X_NUM_TESTS 8 #define BNX2X_NUM_TESTS 8
#define BNX2X_MAC_LOOPBACK 0 #define BNX2X_MAC_LOOPBACK 0
......
...@@ -79,6 +79,9 @@ ...@@ -79,6 +79,9 @@
#define TSTORM_MAC_FILTER_CONFIG_OFFSET(function) \ #define TSTORM_MAC_FILTER_CONFIG_OFFSET(function) \
(IS_E1H_OFFSET? (0x3008 + (function * 0x38)) : (0x1508 + \ (IS_E1H_OFFSET? (0x3008 + (function * 0x38)) : (0x1508 + \
(function * 0x38))) (function * 0x38)))
#define TSTORM_PER_COUNTER_ID_STATS_OFFSET(port, stats_counter_id) \
(IS_E1H_OFFSET ? (0x2010 + (port * 0x5b0) + (stats_counter_id * \
0x50)) : (0x4000 + (port * 0x3f0) + (stats_counter_id * 0x38)))
#define TSTORM_RX_PRODS_OFFSET(port, client_id) \ #define TSTORM_RX_PRODS_OFFSET(port, client_id) \
(IS_E1H_OFFSET? (0x3350 + (port * 0x3e8) + (client_id * 0x28)) : \ (IS_E1H_OFFSET? (0x3350 + (port * 0x3e8) + (client_id * 0x28)) : \
(0x9c0 + (port * 0x2f8) + (client_id * 0x28))) (0x9c0 + (port * 0x2f8) + (client_id * 0x28)))
...@@ -157,6 +160,9 @@ ...@@ -157,6 +160,9 @@
(IS_E1H_OFFSET? 0x2ac8 : 0xffffffff) (IS_E1H_OFFSET? 0x2ac8 : 0xffffffff)
#define XSTORM_HC_BTR_OFFSET(port) \ #define XSTORM_HC_BTR_OFFSET(port) \
(IS_E1H_OFFSET? (0xa144 + (port * 0x30)) : (0x1454 + (port * 0x18))) (IS_E1H_OFFSET? (0xa144 + (port * 0x30)) : (0x1454 + (port * 0x18)))
#define XSTORM_PER_COUNTER_ID_STATS_OFFSET(port, stats_counter_id) \
(IS_E1H_OFFSET ? (0xc000 + (port * 0x3f0) + (stats_counter_id * \
0x38)) : (0x3378 + (port * 0x3f0) + (stats_counter_id * 0x38)))
#define XSTORM_RATE_SHAPING_PER_VN_VARS_OFFSET(function) \ #define XSTORM_RATE_SHAPING_PER_VN_VARS_OFFSET(function) \
(IS_E1H_OFFSET? (0x2528 + (function * 0x70)) : (0x3c20 + \ (IS_E1H_OFFSET? (0x2528 + (function * 0x70)) : (0x3c20 + \
(function * 0x70))) (function * 0x70)))
......
This diff is collapsed.
...@@ -1727,6 +1727,9 @@ ...@@ -1727,6 +1727,9 @@
/* [R 32] Rx statistics : In user packets discarded due to BRB backpressure /* [R 32] Rx statistics : In user packets discarded due to BRB backpressure
for port0 */ for port0 */
#define NIG_REG_STAT0_BRB_DISCARD 0x105f0 #define NIG_REG_STAT0_BRB_DISCARD 0x105f0
/* [R 32] Rx statistics : In user packets truncated due to BRB backpressure
for port0 */
#define NIG_REG_STAT0_BRB_TRUNCATE 0x105f8
/* [WB_R 36] Tx statistics : Number of packets from emac0 or bmac0 that /* [WB_R 36] Tx statistics : Number of packets from emac0 or bmac0 that
between 1024 and 1522 bytes for port0 */ between 1024 and 1522 bytes for port0 */
#define NIG_REG_STAT0_EGRESS_MAC_PKT0 0x10750 #define NIG_REG_STAT0_EGRESS_MAC_PKT0 0x10750
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment