]> git.baikalelectronics.ru Git - kernel.git/commit
selftest: Add tests for XDP programs in devmap entries
authorDavid Ahern <dsahern@kernel.org>
Fri, 29 May 2020 22:07:16 +0000 (16:07 -0600)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 1 Jun 2020 21:48:32 +0000 (14:48 -0700)
commit51eeacc7822da8b6c36ecf3a9013970ac3f1ba2a
tree315a7405aabf602bdff8a8d95450829cd25f61ba
parent741ac5eca0ec37c0f6a0185a28a000e1db076adf
selftest: Add tests for XDP programs in devmap entries

Add tests to verify ability to add an XDP program to a
entry in a DEVMAP.

Add negative tests to show DEVMAP programs can not be
attached to devices as a normal XDP program, and accesses
to egress_ifindex require BPF_XDP_DEVMAP attach type.

Signed-off-by: David Ahern <dsahern@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://lore.kernel.org/bpf/20200529220716.75383-6-dsahern@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/test_xdp_devmap_helpers.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/test_xdp_with_devmap_helpers.c [new file with mode: 0644]