selftests/bpf: Switch fexit_bpf2bpf selftest to set_attach_target() API
mainline inclusion from mainline-5.16-rc1 commit 60aed220 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I5EUVD CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=60aed22076b0d0ec2b7c7f9dba3ccd642520e1f3 ------------------------------------------------ Switch fexit_bpf2bpf selftest to bpf_program__set_attach_target() instead of using bpf_object_open_opts.attach_prog_fd, which is going to be deprecated. These changes also demonstrate the new mode of set_attach_target() in which it allows NULL when the target is BPF program (attach_prog_fd != 0). Signed-off-by: NAndrii Nakryiko <andrii@kernel.org> Signed-off-by: NAlexei Starovoitov <ast@kernel.org> Acked-by: NYonghong Song <yhs@fb.com> Link: https://lore.kernel.org/bpf/20210916015836.1248906-6-andrii@kernel.org (cherry picked from commit 60aed220) Signed-off-by: NWang Yufen <wangyufen@huawei.com> Conflicts: tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c Signed-off-by: NWang Yufen <wangyufen@huawei.com>
Showing
想要评论请 注册 或 登录