selftests/bpf: Add selftest for XDP_REDIRECT in BPF_PROG_RUN
authorToke Høiland-Jørgensen <toke@redhat.com>
Wed, 9 Mar 2022 10:53:46 +0000 (11:53 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 9 Mar 2022 22:19:23 +0000 (14:19 -0800)
commit55fcacca36468801e62e1d9cc81e5870eea620ba
tree40d6fee68c036e60785dc760569091b1b5fa74fd
parenta30338840fa5c6e400673b7d8a31323280bfd521
selftests/bpf: Add selftest for XDP_REDIRECT in BPF_PROG_RUN

This adds a selftest for the XDP_REDIRECT facility in BPF_PROG_RUN, that
redirects packets into a veth and counts them using an XDP program on the
other side of the veth pair and a TC program on the local side of the veth.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20220309105346.100053-6-toke@redhat.com
tools/testing/selftests/bpf/prog_tests/xdp_do_redirect.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/test_xdp_do_redirect.c [new file with mode: 0644]