]> 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)
commit1a533744fa798cf4e98848055c0c6e5bfc0ed5d2
tree315a7405aabf602bdff8a8d95450829cd25f61ba
parent3835e1daa7b4f91cd166defbc8e38414543fbcdb
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]