xsk: Restructure/inline XSKMAP lookup/redirect/flush
authorBjörn Töpel <bjorn.topel@intel.com>
Fri, 1 Nov 2019 11:03:46 +0000 (12:03 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 1 Nov 2019 23:38:49 +0000 (00:38 +0100)
commitd817991cc7486ab83f6c7188b0bc80eebee872f6
tree1d607cd8ca901d97ee0c80f6d716061a21a2629c
parente65650f291ee72fc578d6346080fc4699204ef2c
xsk: Restructure/inline XSKMAP lookup/redirect/flush

In this commit the XSKMAP entry lookup function used by the XDP
redirect code is moved from the xskmap.c file to the xdp_sock.h
header, so the lookup can be inlined from, e.g., the
bpf_xdp_redirect_map() function.

Further the __xsk_map_redirect() and __xsk_map_flush() is moved to the
xsk.c, which lets the compiler inline the xsk_rcv() and xsk_flush()
functions.

Finally, all the XDP socket functions were moved from linux/bpf.h to
net/xdp_sock.h, where most of the XDP sockets functions are anyway.

This yields a ~2% performance boost for the xdpsock "rx_drop"
scenario.

Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20191101110346.15004-4-bjorn.topel@gmail.com
include/linux/bpf.h
include/net/xdp_sock.h
kernel/bpf/xskmap.c
net/xdp/xsk.c