summaryrefslogtreecommitdiffstats
path: root/include/net/ip_tunnels.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2022-06-08 08:46:37 -0700
committerJakub Kicinski <kuba@kernel.org>2022-06-09 21:53:11 -0700
commit9962acefbcb92736c268aafe5f52200948f60f3e (patch)
treee9ebc87370b8817868a3fadbdfe1c1073709070c /include/net/ip_tunnels.h
parenteeb15885ca30669b354ac78eebb212743177ba4b (diff)
downloadlinux-9962acefbcb92736c268aafe5f52200948f60f3e.tar.bz2
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.h4
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 {