diff options
author | Ben Greear <greearb@candelatech.com> | 2009-09-30 08:08:16 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-09-30 23:02:59 -0400 |
commit | aad719182d9c6a785931efe87b978eb6f7742e0e (patch) | |
tree | 81e969be4ac9aee0181f0734db8e8f2bb9d1009a /drivers | |
parent | e0f4daffb3025357849153899b114813fddf7b9e (diff) |
ixgbe patch to provide NIC's tx/rx counters via ethtool
When LRO is enabled, the received packet and byte counters represent the
LRO'd packets, not the packets/bytes on the wire. The Intel 82599 NIC has
registers that keep count of the physical packets. Add these counters to
the ethtool stats. The byte counters are 36-bit, but the high 4 bits were
being ignored in the 2.6.31 ixgbe driver: Read those as well to allow
longer time between polling the stats to detect wraps.
Signed-off-by: Ben Greear <greearb@candelatech.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_ethtool.c | 4 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index 53b0a6680254..fa314cb005a4 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
@@ -53,6 +53,10 @@ static struct ixgbe_stats ixgbe_gstrings_stats[] = { | |||
53 | {"tx_packets", IXGBE_STAT(net_stats.tx_packets)}, | 53 | {"tx_packets", IXGBE_STAT(net_stats.tx_packets)}, |
54 | {"rx_bytes", IXGBE_STAT(net_stats.rx_bytes)}, | 54 | {"rx_bytes", IXGBE_STAT(net_stats.rx_bytes)}, |
55 | {"tx_bytes", IXGBE_STAT(net_stats.tx_bytes)}, | 55 | {"tx_bytes", IXGBE_STAT(net_stats.tx_bytes)}, |
56 | {"rx_pkts_nic", IXGBE_STAT(stats.gprc)}, | ||
57 | {"tx_pkts_nic", IXGBE_STAT(stats.gptc)}, | ||
58 | {"rx_bytes_nic", IXGBE_STAT(stats.gorc)}, | ||
59 | {"tx_bytes_nic", IXGBE_STAT(stats.gotc)}, | ||
56 | {"lsc_int", IXGBE_STAT(lsc_int)}, | 60 | {"lsc_int", IXGBE_STAT(lsc_int)}, |
57 | {"tx_busy", IXGBE_STAT(tx_busy)}, | 61 | {"tx_busy", IXGBE_STAT(tx_busy)}, |
58 | {"non_eop_descs", IXGBE_STAT(non_eop_descs)}, | 62 | {"non_eop_descs", IXGBE_STAT(non_eop_descs)}, |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index c19818303629..960967399209 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -4449,10 +4449,13 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter) | |||
4449 | 4449 | ||
4450 | /* 82598 hardware only has a 32 bit counter in the high register */ | 4450 | /* 82598 hardware only has a 32 bit counter in the high register */ |
4451 | if (hw->mac.type == ixgbe_mac_82599EB) { | 4451 | if (hw->mac.type == ixgbe_mac_82599EB) { |
4452 | u64 tmp; | ||
4452 | adapter->stats.gorc += IXGBE_READ_REG(hw, IXGBE_GORCL); | 4453 | adapter->stats.gorc += IXGBE_READ_REG(hw, IXGBE_GORCL); |
4453 | IXGBE_READ_REG(hw, IXGBE_GORCH); /* to clear */ | 4454 | tmp = IXGBE_READ_REG(hw, IXGBE_GORCH) & 0xF; /* 4 high bits of GORC */ |
4455 | adapter->stats.gorc += (tmp << 32); | ||
4454 | adapter->stats.gotc += IXGBE_READ_REG(hw, IXGBE_GOTCL); | 4456 | adapter->stats.gotc += IXGBE_READ_REG(hw, IXGBE_GOTCL); |
4455 | IXGBE_READ_REG(hw, IXGBE_GOTCH); /* to clear */ | 4457 | tmp = IXGBE_READ_REG(hw, IXGBE_GOTCH) & 0xF; /* 4 high bits of GOTC */ |
4458 | adapter->stats.gotc += (tmp << 32); | ||
4456 | adapter->stats.tor += IXGBE_READ_REG(hw, IXGBE_TORL); | 4459 | adapter->stats.tor += IXGBE_READ_REG(hw, IXGBE_TORL); |
4457 | IXGBE_READ_REG(hw, IXGBE_TORH); /* to clear */ | 4460 | IXGBE_READ_REG(hw, IXGBE_TORH); /* to clear */ |
4458 | adapter->stats.lxonrxc += IXGBE_READ_REG(hw, IXGBE_LXONRXCNT); | 4461 | adapter->stats.lxonrxc += IXGBE_READ_REG(hw, IXGBE_LXONRXCNT); |