Daniel Borkmann
0bfb95f59a
selftests, bpf: Do not yet switch to new libbpf XDP APIs
...
Revert commit 544356524d ("selftests/bpf: switch to new libbpf XDP APIs")
for now given this will heavily conflict with 4b27480dca ("bpf/selftests:
convert xdp_link test to ASSERT_* macros") upon merge. Andrii agreed to redo
the conversion cleanly after trees merged.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net >
Acked-by: Alexei Starovoitov <ast@kernel.org >
Acked-by: Andrii Nakryiko <andrii@kernel.org >
2022-01-24 23:02:29 +01:00
Lorenzo Bianconi
0c5e118cb4
bpf: selftests: add CPUMAP/DEVMAP selftests for xdp frags
...
Verify compatibility checks attaching a XDP frags program to a
CPUMAP/DEVMAP
Acked-by: Toke Hoiland-Jorgensen <toke@redhat.com >
Acked-by: John Fastabend <john.fastabend@gmail.com >
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org >
Link: https://lore.kernel.org/r/d94b4d35adc1e42c9ca5004e6b2cdfd75992304d.1642758637.git.lorenzo@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org >
2022-01-21 14:14:03 -08:00
Andrii Nakryiko
544356524d
selftests/bpf: switch to new libbpf XDP APIs
...
Switch to using new bpf_xdp_*() APIs across all selftests. Take
advantage of a more straightforward and user-friendly semantics of
old_prog_fd (0 means "don't care") in few places.
Signed-off-by: Andrii Nakryiko <andrii@kernel.org >
Link: https://lore.kernel.org/r/20220120061422.2710637-4-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org >
2022-01-20 21:22:02 -08:00
Andrii Nakryiko
6972dc3b87
selftests/bpf: Normalize selftest entry points
...
Ensure that all test entry points are global void functions with no
input arguments. Mark few subtest entry points as static.
Signed-off-by: Andrii Nakryiko <andrii@kernel.org >
Signed-off-by: Alexei Starovoitov <ast@kernel.org >
Link: https://lore.kernel.org/bpf/20211022223228.99920-2-andrii@kernel.org
2021-10-25 14:45:45 -07:00
Yucong Sun
d3f7b1664d
selfetest/bpf: Make some tests serial
...
Change tests that often fails in parallel execution mode to serial.
Signed-off-by: Yucong Sun <sunyucong@gmail.com >
Signed-off-by: Andrii Nakryiko <andrii@kernel.org >
Link: https://lore.kernel.org/bpf/20211006185619.364369-15-fallentree@fb.com
2021-10-08 15:17:00 -07:00
Kumar Kartikeya Dwivedi
36246d5a7a
bpf: Tidy xdp attach selftests
...
Support for cpumap and devmap entry progs in previous commits means the
test needs to be updated for the new semantics. Also take this
opportunity to convert it from CHECK macros to the new ASSERT macros.
Since xdp_cpumap_attach has no subtest, put the sole test inside the
test_xdp_cpumap_attach function.
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com >
Signed-off-by: Alexei Starovoitov <ast@kernel.org >
Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com >
Link: https://lore.kernel.org/bpf/20210702111825.491065-6-memxor@gmail.com
2021-07-07 20:01:45 -07:00
Jesper Dangaard Brouer
042b1545fe
bpf: Selftests and tools use struct bpf_devmap_val from uapi
...
Sync tools uapi bpf.h header file and update selftests that use
struct bpf_devmap_val.
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com >
Signed-off-by: Alexei Starovoitov <ast@kernel.org >
Link: https://lore.kernel.org/bpf/159170951195.2102545.1833108712124273987.stgit@firesoul
2020-06-09 11:36:19 -07:00
David Ahern
d39aec79e5
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 >
2020-06-01 14:48:32 -07:00