Commit 502820a3 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

netxen: fix a race in netxen_nic_get_stats()

Dont clear netdev->stats, it might give transient wrong values to
concurrent stat readers.
Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1003201a
...@@ -2032,8 +2032,6 @@ struct net_device_stats *netxen_nic_get_stats(struct net_device *netdev) ...@@ -2032,8 +2032,6 @@ struct net_device_stats *netxen_nic_get_stats(struct net_device *netdev)
struct netxen_adapter *adapter = netdev_priv(netdev); struct netxen_adapter *adapter = netdev_priv(netdev);
struct net_device_stats *stats = &netdev->stats; struct net_device_stats *stats = &netdev->stats;
memset(stats, 0, sizeof(*stats));
stats->rx_packets = adapter->stats.rx_pkts + adapter->stats.lro_pkts; stats->rx_packets = adapter->stats.rx_pkts + adapter->stats.lro_pkts;
stats->tx_packets = adapter->stats.xmitfinished; stats->tx_packets = adapter->stats.xmitfinished;
stats->rx_bytes = adapter->stats.rxbytes; stats->rx_bytes = adapter->stats.rxbytes;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment