diff options
author | Michael Chan <mchan@broadcom.com> | 2009-08-21 12:20:47 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-22 20:48:49 -0400 |
commit | 790dab2f671cb477e6179322a6c48c898e311e72 (patch) | |
tree | 70ab66f1d99f39a1e84d1020a6be6aedfb2bc8a5 /drivers/net/bnx2.c | |
parent | 61d9e3fa7eacabfb7879e3da91709f1a5420c507 (diff) |
bnx2: Report FTQ discard counter.
Report this counter to ethtool -S and include it in netstat.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2.c')
-rw-r--r-- | drivers/net/bnx2.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 085c2dd8e7f8..e025833e664f 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -6485,7 +6485,8 @@ bnx2_get_stats(struct net_device *dev) | |||
6485 | stats_blk->stat_EtherStatsOverrsizePkts); | 6485 | stats_blk->stat_EtherStatsOverrsizePkts); |
6486 | 6486 | ||
6487 | net_stats->rx_over_errors = | 6487 | net_stats->rx_over_errors = |
6488 | (unsigned long) stats_blk->stat_IfInMBUFDiscards; | 6488 | (unsigned long) (stats_blk->stat_IfInFTQDiscards + |
6489 | stats_blk->stat_IfInMBUFDiscards); | ||
6489 | 6490 | ||
6490 | net_stats->rx_frame_errors = | 6491 | net_stats->rx_frame_errors = |
6491 | (unsigned long) stats_blk->stat_Dot3StatsAlignmentErrors; | 6492 | (unsigned long) stats_blk->stat_Dot3StatsAlignmentErrors; |
@@ -6518,8 +6519,8 @@ bnx2_get_stats(struct net_device *dev) | |||
6518 | net_stats->tx_carrier_errors; | 6519 | net_stats->tx_carrier_errors; |
6519 | 6520 | ||
6520 | net_stats->rx_missed_errors = | 6521 | net_stats->rx_missed_errors = |
6521 | (unsigned long) (stats_blk->stat_IfInMBUFDiscards + | 6522 | (unsigned long) (stats_blk->stat_IfInFTQDiscards + |
6522 | stats_blk->stat_FwRxDrop); | 6523 | stats_blk->stat_IfInMBUFDiscards + stats_blk->stat_FwRxDrop); |
6523 | 6524 | ||
6524 | return net_stats; | 6525 | return net_stats; |
6525 | } | 6526 | } |
@@ -7090,11 +7091,9 @@ bnx2_set_tso(struct net_device *dev, u32 data) | |||
7090 | return 0; | 7091 | return 0; |
7091 | } | 7092 | } |
7092 | 7093 | ||
7093 | #define BNX2_NUM_STATS 46 | ||
7094 | |||
7095 | static struct { | 7094 | static struct { |
7096 | char string[ETH_GSTRING_LEN]; | 7095 | char string[ETH_GSTRING_LEN]; |
7097 | } bnx2_stats_str_arr[BNX2_NUM_STATS] = { | 7096 | } bnx2_stats_str_arr[] = { |
7098 | { "rx_bytes" }, | 7097 | { "rx_bytes" }, |
7099 | { "rx_error_bytes" }, | 7098 | { "rx_error_bytes" }, |
7100 | { "tx_bytes" }, | 7099 | { "tx_bytes" }, |
@@ -7139,10 +7138,14 @@ static struct { | |||
7139 | { "tx_xoff_frames" }, | 7138 | { "tx_xoff_frames" }, |
7140 | { "rx_mac_ctrl_frames" }, | 7139 | { "rx_mac_ctrl_frames" }, |
7141 | { "rx_filtered_packets" }, | 7140 | { "rx_filtered_packets" }, |
7141 | { "rx_ftq_discards" }, | ||
7142 | { "rx_discards" }, | 7142 | { "rx_discards" }, |
7143 | { "rx_fw_discards" }, | 7143 | { "rx_fw_discards" }, |
7144 | }; | 7144 | }; |
7145 | 7145 | ||
7146 | #define BNX2_NUM_STATS (sizeof(bnx2_stats_str_arr)/\ | ||
7147 | sizeof(bnx2_stats_str_arr[0])) | ||
7148 | |||
7146 | #define STATS_OFFSET32(offset_name) (offsetof(struct statistics_block, offset_name) / 4) | 7149 | #define STATS_OFFSET32(offset_name) (offsetof(struct statistics_block, offset_name) / 4) |
7147 | 7150 | ||
7148 | static const unsigned long bnx2_stats_offset_arr[BNX2_NUM_STATS] = { | 7151 | static const unsigned long bnx2_stats_offset_arr[BNX2_NUM_STATS] = { |
@@ -7190,6 +7193,7 @@ static const unsigned long bnx2_stats_offset_arr[BNX2_NUM_STATS] = { | |||
7190 | STATS_OFFSET32(stat_OutXoffSent), | 7193 | STATS_OFFSET32(stat_OutXoffSent), |
7191 | STATS_OFFSET32(stat_MacControlFramesReceived), | 7194 | STATS_OFFSET32(stat_MacControlFramesReceived), |
7192 | STATS_OFFSET32(stat_IfInFramesL2FilterDiscards), | 7195 | STATS_OFFSET32(stat_IfInFramesL2FilterDiscards), |
7196 | STATS_OFFSET32(stat_IfInFTQDiscards), | ||
7193 | STATS_OFFSET32(stat_IfInMBUFDiscards), | 7197 | STATS_OFFSET32(stat_IfInMBUFDiscards), |
7194 | STATS_OFFSET32(stat_FwRxDrop), | 7198 | STATS_OFFSET32(stat_FwRxDrop), |
7195 | }; | 7199 | }; |
@@ -7202,7 +7206,7 @@ static u8 bnx2_5706_stats_len_arr[BNX2_NUM_STATS] = { | |||
7202 | 4,0,4,4,4,4,4,4,4,4, | 7206 | 4,0,4,4,4,4,4,4,4,4, |
7203 | 4,4,4,4,4,4,4,4,4,4, | 7207 | 4,4,4,4,4,4,4,4,4,4, |
7204 | 4,4,4,4,4,4,4,4,4,4, | 7208 | 4,4,4,4,4,4,4,4,4,4, |
7205 | 4,4,4,4,4,4, | 7209 | 4,4,4,4,4,4,4, |
7206 | }; | 7210 | }; |
7207 | 7211 | ||
7208 | static u8 bnx2_5708_stats_len_arr[BNX2_NUM_STATS] = { | 7212 | static u8 bnx2_5708_stats_len_arr[BNX2_NUM_STATS] = { |
@@ -7210,7 +7214,7 @@ static u8 bnx2_5708_stats_len_arr[BNX2_NUM_STATS] = { | |||
7210 | 4,4,4,4,4,4,4,4,4,4, | 7214 | 4,4,4,4,4,4,4,4,4,4, |
7211 | 4,4,4,4,4,4,4,4,4,4, | 7215 | 4,4,4,4,4,4,4,4,4,4, |
7212 | 4,4,4,4,4,4,4,4,4,4, | 7216 | 4,4,4,4,4,4,4,4,4,4, |
7213 | 4,4,4,4,4,4, | 7217 | 4,4,4,4,4,4,4, |
7214 | }; | 7218 | }; |
7215 | 7219 | ||
7216 | #define BNX2_NUM_TESTS 6 | 7220 | #define BNX2_NUM_TESTS 6 |