diff options
author | Eric Dumazet <edumazet@google.com> | 2022-06-08 18:46:37 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-06-10 07:53:11 +0300 |
commit | 9962acefbcb92736c268aafe5f52200948f60f3e (patch) | |
tree | e9ebc87370b8817868a3fadbdfe1c1073709070c /net/dsa/slave.c | |
parent | eeb15885ca30669b354ac78eebb212743177ba4b (diff) | |
download | linux-9962acefbcb92736c268aafe5f52200948f60f3e.tar.xz |
net: adopt u64_stats_t in struct pcpu_sw_netstats
As explained in commit 316580b69d0a ("u64_stats: provide u64_stats_t type")
we should use u64_stats_t and related accessors to avoid load/store tearing.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/dsa/slave.c')
-rw-r--r-- | net/dsa/slave.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 801a5d445833..2e1ac638d135 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -935,10 +935,10 @@ static void dsa_slave_get_ethtool_stats(struct net_device *dev, s = per_cpu_ptr(dev->tstats, i); do { start = u64_stats_fetch_begin_irq(&s->syncp); - tx_packets = s->tx_packets; - tx_bytes = s->tx_bytes; - rx_packets = s->rx_packets; - rx_bytes = s->rx_bytes; + tx_packets = u64_stats_read(&s->tx_packets); + tx_bytes = u64_stats_read(&s->tx_bytes); + rx_packets = u64_stats_read(&s->rx_packets); + rx_bytes = u64_stats_read(&s->rx_bytes); } while (u64_stats_fetch_retry_irq(&s->syncp, start)); data[0] += tx_packets; data[1] += tx_bytes; |