aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorKevin Groeneveld <kgroeneveld@gmail.com>2012-07-21 02:30:50 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-22 15:12:32 -0400
commite3906486f616da7cc086a3ba06c0df4e5a48b4ab (patch)
tree573b6a99cf6f1e2958c59223d2e77ebe36e71ffa /drivers/net/ethernet
parent0980e56e506b1e45022fad00bca8c8a974fda4e6 (diff)
net: fix race condition in several drivers when reading stats
Fix race condition in several network drivers when reading stats on 32bit UP architectures. These drivers update their stats in a BH context and therefore should use u64_stats_fetch_begin_bh/u64_stats_fetch_retry_bh instead of u64_stats_fetch_begin/u64_stats_fetch_retry when reading the stats. Signed-off-by: Kevin Groeneveld <kgroeneveld@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/neterion/vxge/vxge-main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ethernet/neterion/vxge/vxge-main.c b/drivers/net/ethernet/neterion/vxge/vxge-main.c
index 4e20c5f02712..de2190443510 100644
--- a/drivers/net/ethernet/neterion/vxge/vxge-main.c
+++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c
@@ -3131,12 +3131,12 @@ vxge_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *net_stats)
3131 u64 packets, bytes, multicast; 3131 u64 packets, bytes, multicast;
3132 3132
3133 do { 3133 do {
3134 start = u64_stats_fetch_begin(&rxstats->syncp); 3134 start = u64_stats_fetch_begin_bh(&rxstats->syncp);
3135 3135
3136 packets = rxstats->rx_frms; 3136 packets = rxstats->rx_frms;
3137 multicast = rxstats->rx_mcast; 3137 multicast = rxstats->rx_mcast;
3138 bytes = rxstats->rx_bytes; 3138 bytes = rxstats->rx_bytes;
3139 } while (u64_stats_fetch_retry(&rxstats->syncp, start)); 3139 } while (u64_stats_fetch_retry_bh(&rxstats->syncp, start));
3140 3140
3141 net_stats->rx_packets += packets; 3141 net_stats->rx_packets += packets;
3142 net_stats->rx_bytes += bytes; 3142 net_stats->rx_bytes += bytes;
@@ -3146,11 +3146,11 @@ vxge_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *net_stats)
3146 net_stats->rx_dropped += rxstats->rx_dropped; 3146 net_stats->rx_dropped += rxstats->rx_dropped;
3147 3147
3148 do { 3148 do {
3149 start = u64_stats_fetch_begin(&txstats->syncp); 3149 start = u64_stats_fetch_begin_bh(&txstats->syncp);
3150 3150
3151 packets = txstats->tx_frms; 3151 packets = txstats->tx_frms;
3152 bytes = txstats->tx_bytes; 3152 bytes = txstats->tx_bytes;
3153 } while (u64_stats_fetch_retry(&txstats->syncp, start)); 3153 } while (u64_stats_fetch_retry_bh(&txstats->syncp, start));
3154 3154
3155 net_stats->tx_packets += packets; 3155 net_stats->tx_packets += packets;
3156 net_stats->tx_bytes += bytes; 3156 net_stats->tx_bytes += bytes;