diff options
author | david decotigny <david.decotigny@google.com> | 2011-11-17 04:38:23 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-18 02:08:47 -0500 |
commit | 505a467b66233fd08ac32fca943100130928bf89 (patch) | |
tree | 0f20460634939cfd8220ca99ec64c0941f3672c2 | |
parent | dd2bc8e9c0685d8eaaaf06e65919e31d60478411 (diff) |
net-forcedeth: fix possible stats inaccuracies on 32b hosts
The software stats are updated from BH, this change ensures that 32b
UP hosts use appropriate protection.
Tested:
- HW/SW stats consistent with pktgen (in particular tx=rx)
- HW/SW stats consistent when tx/rx offloads disabled
- no problem with+without lockdep (SMP 16-way)
Signed-off-by: David Decotigny <david.decotigny@google.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/nvidia/forcedeth.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c index 0d8d5c0ab336..49905347e0b2 100644 --- a/drivers/net/ethernet/nvidia/forcedeth.c +++ b/drivers/net/ethernet/nvidia/forcedeth.c | |||
@@ -1756,19 +1756,19 @@ nv_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *storage) | |||
1756 | 1756 | ||
1757 | /* software stats */ | 1757 | /* software stats */ |
1758 | do { | 1758 | do { |
1759 | syncp_start = u64_stats_fetch_begin(&np->swstats_rx_syncp); | 1759 | syncp_start = u64_stats_fetch_begin_bh(&np->swstats_rx_syncp); |
1760 | storage->rx_packets = np->stat_rx_packets; | 1760 | storage->rx_packets = np->stat_rx_packets; |
1761 | storage->rx_bytes = np->stat_rx_bytes; | 1761 | storage->rx_bytes = np->stat_rx_bytes; |
1762 | storage->rx_dropped = np->stat_rx_dropped; | 1762 | storage->rx_dropped = np->stat_rx_dropped; |
1763 | storage->rx_missed_errors = np->stat_rx_missed_errors; | 1763 | storage->rx_missed_errors = np->stat_rx_missed_errors; |
1764 | } while (u64_stats_fetch_retry(&np->swstats_rx_syncp, syncp_start)); | 1764 | } while (u64_stats_fetch_retry_bh(&np->swstats_rx_syncp, syncp_start)); |
1765 | 1765 | ||
1766 | do { | 1766 | do { |
1767 | syncp_start = u64_stats_fetch_begin(&np->swstats_tx_syncp); | 1767 | syncp_start = u64_stats_fetch_begin_bh(&np->swstats_tx_syncp); |
1768 | storage->tx_packets = np->stat_tx_packets; | 1768 | storage->tx_packets = np->stat_tx_packets; |
1769 | storage->tx_bytes = np->stat_tx_bytes; | 1769 | storage->tx_bytes = np->stat_tx_bytes; |
1770 | storage->tx_dropped = np->stat_tx_dropped; | 1770 | storage->tx_dropped = np->stat_tx_dropped; |
1771 | } while (u64_stats_fetch_retry(&np->swstats_tx_syncp, syncp_start)); | 1771 | } while (u64_stats_fetch_retry_bh(&np->swstats_tx_syncp, syncp_start)); |
1772 | 1772 | ||
1773 | /* If the nic supports hw counters then retrieve latest values */ | 1773 | /* If the nic supports hw counters then retrieve latest values */ |
1774 | if (np->driver_data & DEV_HAS_STATISTICS_V123) { | 1774 | if (np->driver_data & DEV_HAS_STATISTICS_V123) { |