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 | |
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')
-rw-r--r-- | drivers/net/benet/be_cmds.h | 12 | ||||
-rw-r--r-- | drivers/net/benet/be_ethtool.c | 13 |
2 files changed, 21 insertions, 4 deletions
diff --git a/drivers/net/benet/be_cmds.h b/drivers/net/benet/be_cmds.h index 91c5d2b09aa1..331e9540bc74 100644 --- a/drivers/net/benet/be_cmds.h +++ b/drivers/net/benet/be_cmds.h | |||
@@ -619,7 +619,10 @@ struct be_rxf_stats { | |||
619 | u32 rx_drops_invalid_ring; /* dword 145*/ | 619 | u32 rx_drops_invalid_ring; /* dword 145*/ |
620 | u32 forwarded_packets; /* dword 146*/ | 620 | u32 forwarded_packets; /* dword 146*/ |
621 | u32 rx_drops_mtu; /* dword 147*/ | 621 | u32 rx_drops_mtu; /* dword 147*/ |
622 | u32 rsvd0[15]; | 622 | u32 rsvd0[7]; |
623 | u32 port0_jabber_events; | ||
624 | u32 port1_jabber_events; | ||
625 | u32 rsvd1[6]; | ||
623 | }; | 626 | }; |
624 | 627 | ||
625 | struct be_erx_stats { | 628 | struct be_erx_stats { |
@@ -630,11 +633,16 @@ struct be_erx_stats { | |||
630 | u32 debug_pmem_pbuf_dealloc; /* dword 47*/ | 633 | u32 debug_pmem_pbuf_dealloc; /* dword 47*/ |
631 | }; | 634 | }; |
632 | 635 | ||
636 | struct be_pmem_stats { | ||
637 | u32 eth_red_drops; | ||
638 | u32 rsvd[4]; | ||
639 | }; | ||
640 | |||
633 | struct be_hw_stats { | 641 | struct be_hw_stats { |
634 | struct be_rxf_stats rxf; | 642 | struct be_rxf_stats rxf; |
635 | u32 rsvd[48]; | 643 | u32 rsvd[48]; |
636 | struct be_erx_stats erx; | 644 | struct be_erx_stats erx; |
637 | u32 rsvd1[6]; | 645 | struct be_pmem_stats pmem; |
638 | }; | 646 | }; |
639 | 647 | ||
640 | struct be_cmd_req_get_stats { | 648 | struct be_cmd_req_get_stats { |
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; |