Skip to content

Commit

Permalink
bnx2x: Statistics
Browse files Browse the repository at this point in the history
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: Yitchak Gertner <gertner@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yitchak Gertner authored and David S. Miller committed Aug 13, 2008
1 parent 1adcd8b commit 66e855f
Show file tree
Hide file tree
Showing 4 changed files with 154 additions and 94 deletions.
11 changes: 7 additions & 4 deletions drivers/net/bnx2x.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,7 @@ struct bnx2x_fastpath {

unsigned long tx_pkt,
rx_pkt,
rx_calls,
rx_alloc_failed;
rx_calls;
/* TPA related */
struct sw_rx_bd tpa_pool[ETH_MAX_AGGREGATION_QUEUES_E1H];
u8 tpa_state[ETH_MAX_AGGREGATION_QUEUES_E1H];
Expand Down Expand Up @@ -655,6 +654,8 @@ struct bnx2x_eth_stats {

u32 brb_drop_hi;
u32 brb_drop_lo;
u32 brb_truncate_hi;
u32 brb_truncate_lo;

u32 jabber_packets_received;

Expand All @@ -671,6 +672,9 @@ struct bnx2x_eth_stats {
u32 mac_discard;

u32 driver_xoff;
u32 rx_err_discard_pkt;
u32 rx_skb_alloc_failed;
u32 hw_csum_err;
};

#define STATS_OFFSET32(stat_name) \
Expand Down Expand Up @@ -844,7 +848,6 @@ struct bnx2x {
u16 rx_ticks_int;
u16 rx_ticks;

u32 stats_ticks;
u32 lin_cnt;

int state;
Expand Down Expand Up @@ -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 BNX2X_NUM_STATS 39
#define BNX2X_NUM_STATS 42
#define BNX2X_NUM_TESTS 8

#define BNX2X_MAC_LOOPBACK 0
Expand Down
6 changes: 6 additions & 0 deletions drivers/net/bnx2x_fw_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@
#define TSTORM_MAC_FILTER_CONFIG_OFFSET(function) \
(IS_E1H_OFFSET? (0x3008 + (function * 0x38)) : (0x1508 + \
(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) \
(IS_E1H_OFFSET? (0x3350 + (port * 0x3e8) + (client_id * 0x28)) : \
(0x9c0 + (port * 0x2f8) + (client_id * 0x28)))
Expand Down Expand Up @@ -157,6 +160,9 @@
(IS_E1H_OFFSET? 0x2ac8 : 0xffffffff)
#define XSTORM_HC_BTR_OFFSET(port) \
(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) \
(IS_E1H_OFFSET? (0x2528 + (function * 0x70)) : (0x3c20 + \
(function * 0x70)))
Expand Down
Loading

0 comments on commit 66e855f

Please sign in to comment.