]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
selftests/bpf: Adapt assert_mprog_count to always expect 0 count
authorDaniel Borkmann <daniel@iogearbox.net>
Fri, 6 Oct 2023 22:06:53 +0000 (00:06 +0200)
committerMartin KaFai Lau <martin.lau@kernel.org>
Sat, 7 Oct 2023 00:11:21 +0000 (17:11 -0700)
commitb77368269dda3f5d09c3ffa1b59021f6b74a2fa2
tree0613d4beed552a8cb6e890565716a862f44af143
parentf9b08790fa695f6304c2ad531bf9d249c63b5c33
selftests/bpf: Adapt assert_mprog_count to always expect 0 count

Simplify __assert_mprog_count() to remove the -ENOENT corner case as the
bpf_prog_query() now returns 0 when no bpf_mprog is attached. This also
allows to convert a few test cases from using raw __assert_mprog_count()
over to plain assert_mprog_count() helper.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/r/20231006220655.1653-5-daniel@iogearbox.net
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
tools/testing/selftests/bpf/prog_tests/tc_helpers.h
tools/testing/selftests/bpf/prog_tests/tc_links.c
tools/testing/selftests/bpf/prog_tests/tc_opts.c