On Sun, 21 Feb 2021 21:09:53 +0100
Björn Töpel [off-list ref] wrote:
From: Björn Töpel <redacted>
Currently the bpf_redirect_map() implementation dispatches to the
correct map-lookup function via a switch-statement. To avoid the
dispatching, this change adds one bpf_redirect_map() implementation per
map. Correct function is automatically selected by the BPF verifier.
v2->v3 : Fix build when CONFIG_NET is not set. (lkp)
v1->v2 : Re-added comment. (Toke)
rfc->v1: Get rid of the macro and use __always_inline. (Jesper)
Acked-by: Toke Høiland-Jørgensen <redacted>
Signed-off-by: Björn Töpel <redacted>
---
include/linux/bpf.h | 20 +++++++-------
include/linux/filter.h | 9 +++++++
include/net/xdp_sock.h | 6 ++---
kernel/bpf/cpumap.c | 2 +-
kernel/bpf/devmap.c | 4 +--
kernel/bpf/verifier.c | 17 ++++++++----
net/core/filter.c | 61 ++++++++++++++++++++++++++++--------------
7 files changed, 78 insertions(+), 41 deletions(-)
Love it! :-)
Acked-by: Jesper Dangaard Brouer <redacted>
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer