selftests/bpf: Avoid pinning prog when attaching to tc ingress in btf_skc_cls_ingress
authorMartin KaFai Lau <martin.lau@kernel.org>
Tue, 29 Nov 2022 07:09:00 +0000 (23:09 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 30 Nov 2022 21:47:43 +0000 (22:47 +0100)
commit443f216448ab5ddd1b4d08ad6c9b69628ac25adf
tree15d8eb3b29571d530d412ed163bbe1083790d2df
parent9b6a7773973707bad13f6c8b2a27e93ef4d46182
selftests/bpf: Avoid pinning prog when attaching to tc ingress in btf_skc_cls_ingress

This patch removes the need to pin prog when attaching to tc ingress
in the btf_skc_cls_ingress test.  Instead, directly use the
bpf_tc_hook_create() and bpf_tc_attach().  The qdisc clsact
will go away together with the netns, so no need to
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-8-martin.lau@linux.dev
tools/testing/selftests/bpf/prog_tests/btf_skc_cls_ingress.c