selftests/bpf: Add BPF XDP link selftests
Add selftest validating all the attachment logic around BPF XDP link. Test also link updates and get_obj_info() APIs. Signed-off-by: Andrii Nakryiko <andriin@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20200722064603.3350758-9-andriin@fb.com
This commit is contained in:

committed by
Alexei Starovoitov

parent
dc8698cac7
commit
fe48230cf2
12
tools/testing/selftests/bpf/progs/test_xdp_link.c
Normal file
12
tools/testing/selftests/bpf/progs/test_xdp_link.c
Normal file
@@ -0,0 +1,12 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/* Copyright (c) 2020 Facebook */
|
||||
#include <linux/bpf.h>
|
||||
#include <bpf/bpf_helpers.h>
|
||||
|
||||
char LICENSE[] SEC("license") = "GPL";
|
||||
|
||||
SEC("xdp/handler")
|
||||
int xdp_handler(struct xdp_md *xdp)
|
||||
{
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user