selftests/bpf: Avoid pinning bpf prog in the netns_load_bpf() callers
authorMartin KaFai Lau <martin.lau@kernel.org>
Tue, 29 Nov 2022 07:08:57 +0000 (23:08 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 30 Nov 2022 21:47:43 +0000 (22:47 +0100)
commit5dc42a7fc2866a56bc5616babace0a252458fe01
tree51696d4d687327102548902a3c4aa471c7764a2f
parentf1b73577bb3c5b23872fde2907386635ea726d6d
selftests/bpf: Avoid pinning bpf prog in the netns_load_bpf() callers

This patch removes the need to pin prog in the remaining tests in
tc_redirect.c by directly using the bpf_tc_hook_create() and
bpf_tc_attach().  The clsact qdisc will go away together with
the test netns, so no need to do bpf_tc_hook_destroy().

Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Stanislav Fomichev <sdf@google.com>
Link: https://lore.kernel.org/bpf/20221129070900.3142427-5-martin.lau@linux.dev
tools/testing/selftests/bpf/prog_tests/tc_redirect.c