Skip to contentSkip to conversation

net-forcedeth: fix possible stats inaccuracies on 32b hosts

PATCH Applied David Decotigny 3 participants 3 messages Nov 17, 2011 – Nov 18, 2011 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 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)

---
 drivers/net/ethernet/nvidia/forcedeth.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/ethernet/nvidia/forcedeth.c +4 -4
index 0d8d5c0..4990534 100644
@@ -1756,19 +1756,19 @@ nv_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *storage)
 
 	/* software stats */
 	do {
-		syncp_start = u64_stats_fetch_begin(&np->swstats_rx_syncp);
+		syncp_start = u64_stats_fetch_begin_bh(&np->swstats_rx_syncp);
 		storage->rx_packets       = np->stat_rx_packets;
 		storage->rx_bytes         = np->stat_rx_bytes;
 		storage->rx_dropped       = np->stat_rx_dropped;
 		storage->rx_missed_errors = np->stat_rx_missed_errors;
-	} while (u64_stats_fetch_retry(&np->swstats_rx_syncp, syncp_start));
+	} while (u64_stats_fetch_retry_bh(&np->swstats_rx_syncp, syncp_start));
 
 	do {
-		syncp_start = u64_stats_fetch_begin(&np->swstats_tx_syncp);
+		syncp_start = u64_stats_fetch_begin_bh(&np->swstats_tx_syncp);
 		storage->tx_packets = np->stat_tx_packets;
 		storage->tx_bytes   = np->stat_tx_bytes;
 		storage->tx_dropped = np->stat_tx_dropped;
-	} while (u64_stats_fetch_retry(&np->swstats_tx_syncp, syncp_start));
+	} while (u64_stats_fetch_retry_bh(&np->swstats_tx_syncp, syncp_start));
 
 	/* If the nic supports hw counters then retrieve latest values */
 	if (np->driver_data & DEV_HAS_STATISTICS_V123) {
Signature · 1 line
1.7.3.1
Acked-by on v1 1/1
#2 lore raw
Quoted 11 lines · David Decotigny

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)

maintainer Applied
#3 lore raw

From: Eric Dumazet <[email protected]>
Date: Thu, 17 Nov 2011 21:08:15 +0100

Quoted 11 lines · David Decotigny
Quoted 10 lines

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)

Quoted 3 lines
Quoted 1 line

Applied, thanks.