aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Chan <mchan@broadcom.com>2006-06-13 01:16:13 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-06-18 00:30:40 -0400
commitcea94db9b496d7fe25bbd3ebd0f24afaac2069d5 (patch)
treee425453a1f5fcc28c4db9c750f825161a58d03ac
parentbc726a71d2799f0f8b68a17f49d86aa030f64abc (diff)
[BNX2]: Add an rx drop counter
Add a counter for packets dropped by firmware. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/bnx2.c14
-rw-r--r--drivers/net/bnx2.h3
2 files changed, 14 insertions, 3 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 7a1fb52d5cba..7ffda643c802 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -4034,6 +4034,8 @@ bnx2_timer(unsigned long data)
4034 msg = (u32) ++bp->fw_drv_pulse_wr_seq; 4034 msg = (u32) ++bp->fw_drv_pulse_wr_seq;
4035 REG_WR_IND(bp, bp->shmem_base + BNX2_DRV_PULSE_MB, msg); 4035 REG_WR_IND(bp, bp->shmem_base + BNX2_DRV_PULSE_MB, msg);
4036 4036
4037 bp->stats_blk->stat_FwRxDrop = REG_RD_IND(bp, BNX2_FW_RX_DROP_COUNT);
4038
4037 if ((bp->phy_flags & PHY_SERDES_FLAG) && 4039 if ((bp->phy_flags & PHY_SERDES_FLAG) &&
4038 (CHIP_NUM(bp) == CHIP_NUM_5706)) { 4040 (CHIP_NUM(bp) == CHIP_NUM_5706)) {
4039 4041
@@ -4504,6 +4506,10 @@ bnx2_get_stats(struct net_device *dev)
4504 net_stats->tx_aborted_errors + 4506 net_stats->tx_aborted_errors +
4505 net_stats->tx_carrier_errors; 4507 net_stats->tx_carrier_errors;
4506 4508
4509 net_stats->rx_missed_errors =
4510 (unsigned long) (stats_blk->stat_IfInMBUFDiscards +
4511 stats_blk->stat_FwRxDrop);
4512
4507 return net_stats; 4513 return net_stats;
4508} 4514}
4509 4515
@@ -4986,7 +4992,7 @@ bnx2_set_rx_csum(struct net_device *dev, u32 data)
4986 return 0; 4992 return 0;
4987} 4993}
4988 4994
4989#define BNX2_NUM_STATS 45 4995#define BNX2_NUM_STATS 46
4990 4996
4991static struct { 4997static struct {
4992 char string[ETH_GSTRING_LEN]; 4998 char string[ETH_GSTRING_LEN];
@@ -5036,6 +5042,7 @@ static struct {
5036 { "rx_mac_ctrl_frames" }, 5042 { "rx_mac_ctrl_frames" },
5037 { "rx_filtered_packets" }, 5043 { "rx_filtered_packets" },
5038 { "rx_discards" }, 5044 { "rx_discards" },
5045 { "rx_fw_discards" },
5039}; 5046};
5040 5047
5041#define STATS_OFFSET32(offset_name) (offsetof(struct statistics_block, offset_name) / 4) 5048#define STATS_OFFSET32(offset_name) (offsetof(struct statistics_block, offset_name) / 4)
@@ -5086,6 +5093,7 @@ static const unsigned long bnx2_stats_offset_arr[BNX2_NUM_STATS] = {
5086 STATS_OFFSET32(stat_MacControlFramesReceived), 5093 STATS_OFFSET32(stat_MacControlFramesReceived),
5087 STATS_OFFSET32(stat_IfInFramesL2FilterDiscards), 5094 STATS_OFFSET32(stat_IfInFramesL2FilterDiscards),
5088 STATS_OFFSET32(stat_IfInMBUFDiscards), 5095 STATS_OFFSET32(stat_IfInMBUFDiscards),
5096 STATS_OFFSET32(stat_FwRxDrop),
5089}; 5097};
5090 5098
5091/* stat_IfHCInBadOctets and stat_Dot3StatsCarrierSenseErrors are 5099/* stat_IfHCInBadOctets and stat_Dot3StatsCarrierSenseErrors are
@@ -5096,7 +5104,7 @@ static u8 bnx2_5706_stats_len_arr[BNX2_NUM_STATS] = {
5096 4,0,4,4,4,4,4,4,4,4, 5104 4,0,4,4,4,4,4,4,4,4,
5097 4,4,4,4,4,4,4,4,4,4, 5105 4,4,4,4,4,4,4,4,4,4,
5098 4,4,4,4,4,4,4,4,4,4, 5106 4,4,4,4,4,4,4,4,4,4,
5099 4,4,4,4,4, 5107 4,4,4,4,4,4,
5100}; 5108};
5101 5109
5102static u8 bnx2_5708_stats_len_arr[BNX2_NUM_STATS] = { 5110static u8 bnx2_5708_stats_len_arr[BNX2_NUM_STATS] = {
@@ -5104,7 +5112,7 @@ static u8 bnx2_5708_stats_len_arr[BNX2_NUM_STATS] = {
5104 4,4,4,4,4,4,4,4,4,4, 5112 4,4,4,4,4,4,4,4,4,4,
5105 4,4,4,4,4,4,4,4,4,4, 5113 4,4,4,4,4,4,4,4,4,4,
5106 4,4,4,4,4,4,4,4,4,4, 5114 4,4,4,4,4,4,4,4,4,4,
5107 4,4,4,4,4, 5115 4,4,4,4,4,4,
5108}; 5116};
5109 5117
5110#define BNX2_NUM_TESTS 6 5118#define BNX2_NUM_TESTS 6
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h
index b87925f6a228..ea1ab06046d7 100644
--- a/drivers/net/bnx2.h
+++ b/drivers/net/bnx2.h
@@ -231,6 +231,7 @@ struct statistics_block {
231 u32 stat_GenStat13; 231 u32 stat_GenStat13;
232 u32 stat_GenStat14; 232 u32 stat_GenStat14;
233 u32 stat_GenStat15; 233 u32 stat_GenStat15;
234 u32 stat_FwRxDrop;
234}; 235};
235 236
236 237
@@ -3481,6 +3482,8 @@ struct l2_fhdr {
3481 3482
3482#define BNX2_COM_SCRATCH 0x00120000 3483#define BNX2_COM_SCRATCH 0x00120000
3483 3484
3485#define BNX2_FW_RX_DROP_COUNT 0x00120084
3486
3484 3487
3485/* 3488/*
3486 * cp_reg definition 3489 * cp_reg definition