1 Jan 2011 02:34
[PATCH net-next] sky2: implement 64 bit stats
Stephen Hemminger <shemminger <at> vyatta.com>
2011-01-01 01:34:27 GMT
2011-01-01 01:34:27 GMT
This implements 64 bit statistics support and fixes races when reading
counter values. The PHY counters can only be accessed 16 bits at a time,
so they are subject to carry races.
NB:
* TX/RX counters are maintained in software because the the hardware packet count
is only a 32 bit value.
* Error counters are really only 32 bit.
* Old 32 bit counter fields in dev->stats still used for some
software counters
Signed-off-by: Stephen Hemminger <shemminger <at> vyatta.com>
---
drivers/net/sky2.c | 100 ++++++++++++++++++++++++++++++++++-------------------
drivers/net/sky2.h | 9 ++++
2 files changed, 74 insertions(+), 35 deletions(-)
--- a/drivers/net/sky2.c 2010-12-29 11:22:13.557333420 -0800
+++ b/drivers/net/sky2.c 2010-12-29 14:39:35.694667578 -0800
<at> <at> -1917,8 +1917,10 <at> <at> static void sky2_tx_complete(struct sky2
netif_printk(sky2, tx_done, KERN_DEBUG, dev,
"tx done %u\n", idx);
- dev->stats.tx_packets++;
- dev->stats.tx_bytes += skb->len;
+ u64_stats_update_begin(&sky2->tx_stats.syncp);
+ ++sky2->tx_stats.packets;
(Continue reading)
RSS Feed