diff options
author | Eric Dumazet <edumazet@google.com> | 2022-06-08 17:46:37 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-06-10 06:53:11 +0200 |
commit | 9962acefbcb92736c268aafe5f52200948f60f3e (patch) | |
tree | e9ebc87370b8817868a3fadbdfe1c1073709070c /include/net/ip_tunnels.h | |
parent | wireguard: receive: use dev_sw_netstats_rx_add() (diff) | |
download | linux-9962acefbcb92736c268aafe5f52200948f60f3e.tar.xz linux-9962acefbcb92736c268aafe5f52200948f60f3e.zip |
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 'include/net/ip_tunnels.h')
-rw-r--r-- | include/net/ip_tunnels.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h index c24fa934221d..70cbc4a72669 100644 --- a/include/net/ip_tunnels.h +++ b/include/net/ip_tunnels.h @@ -456,8 +456,8 @@ static inline void iptunnel_xmit_stats(struct net_device *dev, int pkt_len) struct pcpu_sw_netstats *tstats = get_cpu_ptr(dev->tstats); u64_stats_update_begin(&tstats->syncp); - tstats->tx_bytes += pkt_len; - tstats->tx_packets++; + u64_stats_add(&tstats->tx_bytes, pkt_len); + u64_stats_inc(&tstats->tx_packets); u64_stats_update_end(&tstats->syncp); put_cpu_ptr(tstats); } else { |