Re: [PATCH] ip_tunnel: disable preemption when updating per-cpu tstats

2015-11-12 Thread Jason A. Donenfeld
By the way, in case anybody is interested, I've done a little bit of historical digging work. The functions in question date back to aa0010f8 from 2012. Before that commit, statistics structures would be incremented after each tunnel's driver itself dereferenced the per-cpu variable. When this got

Re: [PATCH] ip_tunnel: disable preemption when updating per-cpu tstats

2015-11-12 Thread Jason A. Donenfeld
On Thu, Nov 12, 2015 at 5:25 PM, Hannes Frederic Sowa wrote: > The canonical way is get_cpu_ptr(stats) / put_cpu_ptr. Thanks for the pointer. Fixed in v2. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info

Re: [PATCH] ip_tunnel: disable preemption when updating per-cpu tstats

2015-11-12 Thread Hannes Frederic Sowa
On Thu, Nov 12, 2015, at 16:30, Jason A. Donenfeld wrote: > if (err > 0) { > - struct pcpu_sw_netstats *tstats = this_cpu_ptr(stats); > - > + struct pcpu_sw_netstats *tstats; > + preempt_disable(); > + tstats = this_cpu_ptr(stats); The

[PATCH] ip_tunnel: disable preemption when updating per-cpu tstats

2015-11-12 Thread Jason A. Donenfeld
Drivers like vxlan use the recently introduced udp_tunnel_xmit_skb/udp_tunnel6_xmit_skb APIs. udp_tunnel6_xmit_skb makes use of ip6tunnel_xmit, and ip6tunnel_xmit, after sending the packet, updates the struct stats using the usual u64_stats_update_begin/end calls on this_cpu_ptr(dev->tstats). udp_t