]> git.baikalelectronics.ru Git - kernel.git/commit
tuntap: disable preemption during XDP processing
authorJason Wang <jasowang@redhat.com>
Sat, 24 Feb 2018 03:32:25 +0000 (11:32 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 26 Feb 2018 18:49:48 +0000 (13:49 -0500)
commit031b3b97bf38f873c6db346f1634d43dc6cfb178
tree00f62a532d1c824ab730820f12d42c6654a1cd52
parent44ac788d7c0ce3c359df1254027e14ac2fe92b55
tuntap: disable preemption during XDP processing

Except for tuntap, all other drivers' XDP was implemented at NAPI
poll() routine in a bh. This guarantees all XDP operation were done at
the same CPU which is required by e.g BFP_MAP_TYPE_PERCPU_ARRAY. But
for tuntap, we do it in process context and we try to protect XDP
processing by RCU reader lock. This is insufficient since
CONFIG_PREEMPT_RCU can preempt the RCU reader critical section which
breaks the assumption that all XDP were processed in the same CPU.

Fixing this by simply disabling preemption during XDP processing.

Fixes: 0a085d13c41f ("tap: XDP support")
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tun.c