- stats->rx_bytes += percpu_stats->rx_bytes;
- stats->rx_packets += percpu_stats->rx_packets;
- stats->tx_bytes += percpu_stats->tx_bytes;
- stats->tx_packets += percpu_stats->tx_packets;
+
+ do {
+ seqcount = read_seqcount_begin(&percpu_stats->seqlock);
+ local_stats = *percpu_stats;
+ } while (read_seqcount_retry(&percpu_stats->seqlock, seqcount));
+
+ stats->rx_bytes += local_stats.rx_bytes;
+ stats->rx_packets += local_stats.rx_packets;
+ stats->tx_bytes += local_stats.tx_bytes;
+ stats->tx_packets += local_stats.tx_packets;