• Jason Wang's avatar
    tuntap: disable preemption during XDP processing · 23e43f07
    Jason Wang authored
    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: 761876c8 ("tap: XDP support")
    Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    23e43f07
tun.c 78.6 KB