summaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/libbpf.c
diff options
context:
space:
mode:
authorEric Leblond2018-01-30 21:55:01 +0100
committerAlexei Starovoitov2018-02-03 02:53:48 +0100
commit949abbe88436c000cc63fce2bdfeb48b7d06a7df (patch)
tree0c92cc22fd100260e510f79695e64dbb554eeb8d /tools/lib/bpf/libbpf.c
parenttools: add netlink.h and if_link.h in tools uapi (diff)
downloadkernel-qcow2-linux-949abbe88436c000cc63fce2bdfeb48b7d06a7df.tar.gz
kernel-qcow2-linux-949abbe88436c000cc63fce2bdfeb48b7d06a7df.tar.xz
kernel-qcow2-linux-949abbe88436c000cc63fce2bdfeb48b7d06a7df.zip
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>
Diffstat (limited to 'tools/lib/bpf/libbpf.c')
-rw-r--r--tools/lib/bpf/libbpf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 30c776375118..c60122d3ea85 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -106,6 +106,8 @@ static const char *libbpf_strerror_table[NR_ERRNO] = {
[ERRCODE_OFFSET(PROG2BIG)] = "Program too big",
[ERRCODE_OFFSET(KVER)] = "Incorrect kernel version",
[ERRCODE_OFFSET(PROGTYPE)] = "Kernel doesn't support this program type",
+ [ERRCODE_OFFSET(WRNGPID)] = "Wrong pid in netlink message",
+ [ERRCODE_OFFSET(INVSEQ)] = "Invalid netlink sequence",
};
int libbpf_strerror(int err, char *buf, size_t size)