libbpf: add function to setup XDP
Most of the code is taken from set_link_xdp_fd() in bpf_load.c and slightly modified to be library compliant. Signed-off-by: Eric Leblond <eric@regit.org> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:

committed by
Alexei Starovoitov

parent
dc2b9f19e3
commit
949abbe884
@@ -42,6 +42,8 @@ enum libbpf_errno {
|
||||
LIBBPF_ERRNO__PROG2BIG, /* Program too big */
|
||||
LIBBPF_ERRNO__KVER, /* Incorrect kernel version */
|
||||
LIBBPF_ERRNO__PROGTYPE, /* Kernel doesn't support this program type */
|
||||
LIBBPF_ERRNO__WRNGPID, /* Wrong pid in netlink message */
|
||||
LIBBPF_ERRNO__INVSEQ, /* Invalid netlink sequence */
|
||||
__LIBBPF_ERRNO__END,
|
||||
};
|
||||
|
||||
@@ -246,4 +248,6 @@ long libbpf_get_error(const void *ptr);
|
||||
|
||||
int bpf_prog_load(const char *file, enum bpf_prog_type type,
|
||||
struct bpf_object **pobj, int *prog_fd);
|
||||
|
||||
int bpf_set_link_xdp_fd(int ifindex, int fd, __u32 flags);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user