]> git.baikalelectronics.ru Git - kernel.git/commit
bpf, selftests: Extend test_tc_redirect to use modified bpf_redirect_neigh()
authorToke Høiland-Jørgensen <toke@redhat.com>
Tue, 20 Oct 2020 21:25:57 +0000 (23:25 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 21 Oct 2020 23:30:00 +0000 (01:30 +0200)
commit1fa1985131286cb58f1bf21fda4b3fd802ab8f91
tree10b89471c15288c7b3402937670ec95270ddf092
parent582bc1dc36055ef4e2f51b9d28dd9a595e66e6c2
bpf, selftests: Extend test_tc_redirect to use modified bpf_redirect_neigh()

This updates the test_tc_neigh prog in selftests to use the new syntax of
bpf_redirect_neigh(). To exercise the helper both with and without the
optional parameter, add an additional test_tc_neigh_fib test program, which
does a bpf_fib_lookup() followed by a call to bpf_redirect_neigh() instead
of looking up the ifindex in a map.

Update the test_tc_redirect.sh script to run both versions of the test,
and while we're add it, fix it to work on systems that have a consolidated
dual-stack 'ping' binary instead of separate ping/ping6 versions.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/160322915724.32199.17530068594636950447.stgit@toke.dk
tools/testing/selftests/bpf/progs/test_tc_neigh.c
tools/testing/selftests/bpf/progs/test_tc_neigh_fib.c [new file with mode: 0644]
tools/testing/selftests/bpf/test_tc_redirect.sh