From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: Daniel Borkmann <daniel@iogearbox.net>
Cc: David Ahern <dsahern@kernel.org>,
netdev@vger.kernel.org, bpf@vger.kernel.org
Subject: [PATCH bpf 0/2] bpf: Rework bpf_redirect_neigh() to allow supplying nexthop from caller
Date: Mon, 19 Oct 2020 18:04:53 +0200 [thread overview]
Message-ID: <160312349392.7917.6673239142315191801.stgit@toke.dk> (raw)
Based on previous discussion[0], we determined that it would be beneficial to
rework bpf_redirect_neigh() so the caller can supply the nexthop information
(e.g., from a previous call to bpf_fib_lookup()). This way, the two helpers can
be combined without incurring a second FIB lookup to find the nexthop, and
bpf_fib_lookup() becomes usable even if no nexthop entry currently exists.
This patch (and accompanying selftest update) accomplishes this by way of an
optional paramter to bpf_redirect_neigh(). This series is against the -bpf tree,
since we need to change this call signature before it becomes API.
[0] https://lore.kernel.org/bpf/393e17fc-d187-3a8d-2f0d-a627c7c63fca@iogearbox.net/
Changelog:
v1:
- Rebase on -bpf tree
- Fix compilation with INET/INET6 disabled (kbot)
- Keep v4/v6 signatures similar, use internal flag (Daniel)
- Use a separate selftest BPF program instead of modifying existing one (Daniel)
- Fix a few style nits (David Ahern)
---
Toke Høiland-Jørgensen (2):
bpf_redirect_neigh: Support supplying the nexthop as a helper parameter
selftests: Update test_tc_redirect.sh to use the modified bpf_redirect_neigh()
.../selftests/bpf/progs/test_tc_neigh.c | 5 +-
.../selftests/bpf/progs/test_tc_neigh_fib.c | 142 ++++++++++++++++++
.../testing/selftests/bpf/test_tc_redirect.sh | 27 +++-
3 files changed, 169 insertions(+), 5 deletions(-)
create mode 100644 tools/testing/selftests/bpf/progs/test_tc_neigh_fib.c
next reply other threads:[~2020-10-19 16:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-19 16:04 Toke Høiland-Jørgensen [this message]
2020-10-19 16:04 ` [PATCH bpf 1/2] bpf_redirect_neigh: Support supplying the nexthop as a helper parameter Toke Høiland-Jørgensen
2020-10-19 18:23 ` Daniel Borkmann
2020-10-20 3:12 ` David Ahern
2020-10-20 8:59 ` Daniel Borkmann
2020-10-20 13:45 ` David Ahern
2020-10-19 20:23 ` kernel test robot
2020-10-20 3:08 ` David Ahern
2020-10-19 16:04 ` [PATCH bpf 2/2] selftests: Update test_tc_redirect.sh to use the modified bpf_redirect_neigh() Toke Høiland-Jørgensen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=160312349392.7917.6673239142315191801.stgit@toke.dk \
--to=toke@redhat.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=dsahern@kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).