Eric Dumazet 60d5113428 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 <eric.dumazet@gmail.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-08 20:10:12 -08:00
..
2009-10-13 11:48:18 -07:00
2009-12-08 20:10:12 -08:00
2009-09-01 01:13:50 -07:00
2009-11-30 00:13:28 -08:00
2009-12-03 15:58:00 -08:00
2009-08-12 23:03:00 -07:00
2009-08-12 22:53:28 -07:00
2009-11-05 20:00:41 -08:00
2009-11-05 20:00:29 -08:00
2009-11-06 20:26:09 -08:00
2009-10-11 23:30:16 -07:00
2009-12-02 19:57:22 -08:00
2009-10-11 23:30:16 -07:00
2009-10-13 11:48:18 -07:00
2009-11-11 19:22:21 -08:00
2009-09-23 07:39:43 -07:00
2009-10-11 11:20:58 -07:00
2009-10-20 18:51:37 -07:00
2009-11-11 19:03:36 -08:00
2009-09-07 01:56:52 -07:00
2009-11-20 15:35:04 -08:00
2009-07-06 13:05:13 -07:00
2009-10-13 11:48:18 -07:00
2009-10-20 19:11:06 -07:00
2009-11-29 17:04:31 -08:00
2009-11-13 14:07:30 -08:00
2009-10-13 11:48:18 -07:00
2009-10-13 11:48:18 -07:00
2009-10-01 15:14:54 -07:00
2009-10-29 22:57:27 -07:00
2009-12-03 13:18:08 -08:00
2009-12-03 13:18:04 -08:00
2009-11-06 22:52:32 -08:00
2009-11-26 15:51:29 -08:00