From: Eric Dumazet Date: Tue, 8 Dec 2009 07:22:03 +0000 (+0000) Subject: ixgbe: Fix TX stats accounting X-Git-Tag: v2.6.33-rc1~299^2~39 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60d51134281fbeb352013d782a440fb338d31f01;p=pandora-kernel.git ixgbe: Fix TX stats accounting Here is an updated version, because ixgbe_get_ethtool_stats() needs to call dev_get_stats() or "ethtool -S" wont give correct tx_bytes/tx_packets values. Several cpus can update netdev->stats.tx_bytes & netdev->stats.tx_packets in parallel. In this case, TX stats are under estimated and false sharing takes place. After a pktgen session sending exactly 200000000 packets : # ifconfig fiber0 | grep TX TX packets:198501982 errors:0 dropped:0 overruns:0 carrier:0 Multi queue devices should instead use txq->tx_bytes & txq->tx_packets in their xmit() method (appropriate txq lock already held by caller, no cache line miss), or use appropriate locking. After patch, same pktgen session gives : # ifconfig fiber0 | grep TX TX packets:200000000 errors:0 dropped:0 overruns:0 carrier:0 Signed-off-by: Eric Dumazet Signed-off-by: Jeff Kirsher Signed-off-by: David S. Miller --- Reading git-diff-tree failed