Skip to contentSkip to conversation

ipv6: fix the use of pcpu_tstats in sit

PATCH Applied [email protected] 3 participants 4 messages Jan 2, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipv6: fix the use of pcpu_tstats in sit

From: Li RongQing <[email protected]>

when read/write the 64bit data, the correct lock should be hold.

---
 net/ipv6/sit.c |    2 ++
 1 file changed, 2 insertions(+)
net/ipv6/sit.c +2 -0
index 366fbba..1e33d77 100644
@@ -702,8 +702,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);
 
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw
Quoted 14 lines · On Thu, 2014-01-02 at 08:49 +0800, [email protected] wrote:

From: Li RongQing <[email protected]>

when read/write the 64bit data, the correct lock should be hold.

---
 net/ipv6/sit.c |    2 ++
 1 file changed, 2 insertions(+)
net/ipv6/sit.c +0 -0
index 366fbba..1e33d77 100644

net/ipv6/sit.c static int ipip6_rcv(struct sk_buff *skb) · line 711

Quoted 10 lines
net/ipv6/sit.c +2 -0
@@ -702,8 +702,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);
 
Fixes 87b6d218f3adb ("tunnel: implement 64 bits statistics")
Cc Stephen Hemminger <[email protected]>

Thats a candidate for net and stable trees.