]> git.baikalelectronics.ru Git - kernel.git/commit
xdp: introduce xdp_return_frame_rx_napi
authorJesper Dangaard Brouer <brouer@redhat.com>
Thu, 24 May 2018 14:46:07 +0000 (16:46 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 25 May 2018 01:36:15 +0000 (18:36 -0700)
commit4219d0a244f02d77fe64b3e5ee7968dc548370a3
tree3d21a2d33a7587b4db4841332117916f0f238246
parenta532601b9b538bfc609eefe7e511bdab986daeb3
xdp: introduce xdp_return_frame_rx_napi

When sending an xdp_frame through xdp_do_redirect call, then error
cases can happen where the xdp_frame needs to be dropped, and
returning an -errno code isn't sufficient/possible any-longer
(e.g. for cpumap case). This is already fully supported, by simply
calling xdp_return_frame.

This patch is an optimization, which provides xdp_return_frame_rx_napi,
which is a faster variant for these error cases.  It take advantage of
the protection provided by XDP RX running under NAPI protection.

This change is mostly relevant for drivers using the page_pool
allocator as it can take advantage of this. (Tested with mlx5).

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/net/page_pool.h
include/net/xdp.h
kernel/bpf/cpumap.c
kernel/bpf/devmap.c
net/core/xdp.c