diff options
author | Ajit Khaparde <ajit.khaparde@emulex.com> | 2011-02-20 06:41:04 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-02-22 13:26:44 -0500 |
commit | f6c4bf3e6927e1cc98b33c64df93aa8964349195 (patch) | |
tree | c2f47cd97969132e42eef467a90b018f3effe2e3 /drivers/net/benet/be_ethtool.c | |
parent | 2a3bcfdde613884ba7c5bf0e116cfd1991d4ba20 (diff) |
be2net: add new counters to display via ethtool stats
New counters:
> jabber frame stats
> red drop stats
Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet/be_ethtool.c')
-rw-r--r-- | drivers/net/benet/be_ethtool.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c index 07b4ab902b17..82a9a27a9812 100644 --- a/drivers/net/benet/be_ethtool.c +++ b/drivers/net/benet/be_ethtool.c | |||
@@ -26,7 +26,8 @@ struct be_ethtool_stat { | |||
26 | int offset; | 26 | int offset; |
27 | }; | 27 | }; |
28 | 28 | ||
29 | enum {NETSTAT, PORTSTAT, MISCSTAT, DRVSTAT_TX, DRVSTAT_RX, ERXSTAT}; | 29 | enum {NETSTAT, PORTSTAT, MISCSTAT, DRVSTAT_TX, DRVSTAT_RX, ERXSTAT, |
30 | PMEMSTAT}; | ||
30 | #define FIELDINFO(_struct, field) FIELD_SIZEOF(_struct, field), \ | 31 | #define FIELDINFO(_struct, field) FIELD_SIZEOF(_struct, field), \ |
31 | offsetof(_struct, field) | 32 | offsetof(_struct, field) |
32 | #define NETSTAT_INFO(field) #field, NETSTAT,\ | 33 | #define NETSTAT_INFO(field) #field, NETSTAT,\ |
@@ -43,6 +44,8 @@ enum {NETSTAT, PORTSTAT, MISCSTAT, DRVSTAT_TX, DRVSTAT_RX, ERXSTAT}; | |||
43 | field) | 44 | field) |
44 | #define ERXSTAT_INFO(field) #field, ERXSTAT,\ | 45 | #define ERXSTAT_INFO(field) #field, ERXSTAT,\ |
45 | FIELDINFO(struct be_erx_stats, field) | 46 | FIELDINFO(struct be_erx_stats, field) |
47 | #define PMEMSTAT_INFO(field) #field, PMEMSTAT,\ | ||
48 | FIELDINFO(struct be_pmem_stats, field) | ||
46 | 49 | ||
47 | static const struct be_ethtool_stat et_stats[] = { | 50 | static const struct be_ethtool_stat et_stats[] = { |
48 | {NETSTAT_INFO(rx_packets)}, | 51 | {NETSTAT_INFO(rx_packets)}, |
@@ -99,7 +102,10 @@ static const struct be_ethtool_stat et_stats[] = { | |||
99 | {MISCSTAT_INFO(rx_drops_too_many_frags)}, | 102 | {MISCSTAT_INFO(rx_drops_too_many_frags)}, |
100 | {MISCSTAT_INFO(rx_drops_invalid_ring)}, | 103 | {MISCSTAT_INFO(rx_drops_invalid_ring)}, |
101 | {MISCSTAT_INFO(forwarded_packets)}, | 104 | {MISCSTAT_INFO(forwarded_packets)}, |
102 | {MISCSTAT_INFO(rx_drops_mtu)} | 105 | {MISCSTAT_INFO(rx_drops_mtu)}, |
106 | {MISCSTAT_INFO(port0_jabber_events)}, | ||
107 | {MISCSTAT_INFO(port1_jabber_events)}, | ||
108 | {PMEMSTAT_INFO(eth_red_drops)} | ||
103 | }; | 109 | }; |
104 | #define ETHTOOL_STATS_NUM ARRAY_SIZE(et_stats) | 110 | #define ETHTOOL_STATS_NUM ARRAY_SIZE(et_stats) |
105 | 111 | ||
@@ -276,6 +282,9 @@ be_get_ethtool_stats(struct net_device *netdev, | |||
276 | case MISCSTAT: | 282 | case MISCSTAT: |
277 | p = &hw_stats->rxf; | 283 | p = &hw_stats->rxf; |
278 | break; | 284 | break; |
285 | case PMEMSTAT: | ||
286 | p = &hw_stats->pmem; | ||
287 | break; | ||
279 | } | 288 | } |
280 | 289 | ||
281 | p = (u8 *)p + et_stats[i].offset; | 290 | p = (u8 *)p + et_stats[i].offset; |