ipv6: fix the use of pcpu_tstats in sit
authorLi RongQing <roy.qing.li@gmail.com>
Thu, 2 Jan 2014 00:49:36 +0000 (08:49 +0800)
committerDanny Wood <danwood76@gmail.com>
Thu, 15 Jul 2021 09:45:32 +0000 (10:45 +0100)
when read/write the 64bit data, the correct lock should be hold.

Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Change-Id: Ie289d00d1761200ae14336c38324c2b8ba179ec7

net/ipv6/sit.c

index 89d501db67117522175a8b239d6e908a438d95f1..30733a47b94c71ad0a9c19e22a6d03adf4ca30e0 100644 (file)
@@ -668,8 +668,10 @@ static int ipip6_rcv(struct sk_buff *skb)
                }
 
                tstats = this_cpu_ptr(tunnel->dev->tstats);
+               u64_stats_update_begin(&tstats->syncp);
                tstats->rx_packets++;
                tstats->rx_bytes += skb->len;
+               u64_stats_update_end(&tstats->syncp);
 
                netif_rx(skb);