summaryrefslogtreecommitdiffstats
path: root/samples/bpf/xdp_redirect_cpu_user.c
diff options
context:
space:
mode:
authorJesper Dangaard Brouer2018-08-08 23:00:34 +0200
committerDaniel Borkmann2018-08-09 21:50:44 +0200
commitad0ab027fc6da08cbd34070d816ff3b7986c64ae (patch)
tree36f75aa1790a438a29950b2ecd0dddf9baf0b107 /samples/bpf/xdp_redirect_cpu_user.c
parentMerge branch 'sockmap-fixes' (diff)
downloadkernel-qcow2-linux-ad0ab027fc6da08cbd34070d816ff3b7986c64ae.tar.gz
kernel-qcow2-linux-ad0ab027fc6da08cbd34070d816ff3b7986c64ae.tar.xz
kernel-qcow2-linux-ad0ab027fc6da08cbd34070d816ff3b7986c64ae.zip
xdp: fix bug in cpumap teardown code path
When removing a cpumap entry, a number of syncronization steps happen. Eventually the teardown code __cpu_map_entry_free is invoked from/via call_rcu. The teardown code __cpu_map_entry_free() flushes remaining xdp_frames, by invoking bq_flush_to_queue, which calls xdp_return_frame_rx_napi(). The issues is that the teardown code is not running in the RX NAPI code path. Thus, it is not allowed to invoke the NAPI variant of xdp_return_frame. This bug was found and triggered by using the --stress-mode option to the samples/bpf program xdp_redirect_cpu. It is hard to trigger, because the ptr_ring have to be full and cpumap bulk queue max contains 8 packets, and a remote CPU is racing to empty the ptr_ring queue. Fixes: 389ab7f01af9 ("xdp: introduce xdp_return_frame_rx_napi") Tested-by: Jean-Tsung Hsiao <jhsiao@redhat.com> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'samples/bpf/xdp_redirect_cpu_user.c')
0 files changed, 0 insertions, 0 deletions