diff options
author | Eric Leblond <eric@regit.org> | 2018-01-30 15:55:01 -0500 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2018-02-02 20:53:48 -0500 |
commit | 949abbe88436c000cc63fce2bdfeb48b7d06a7df (patch) | |
tree | 0c92cc22fd100260e510f79695e64dbb554eeb8d /tools/lib/bpf/libbpf.c | |
parent | dc2b9f19e3bdaa87a7c3d123b8bba8a42d96d942 (diff) |
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.c | 2 |
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] = { | |||
106 | [ERRCODE_OFFSET(PROG2BIG)] = "Program too big", | 106 | [ERRCODE_OFFSET(PROG2BIG)] = "Program too big", |
107 | [ERRCODE_OFFSET(KVER)] = "Incorrect kernel version", | 107 | [ERRCODE_OFFSET(KVER)] = "Incorrect kernel version", |
108 | [ERRCODE_OFFSET(PROGTYPE)] = "Kernel doesn't support this program type", | 108 | [ERRCODE_OFFSET(PROGTYPE)] = "Kernel doesn't support this program type", |
109 | [ERRCODE_OFFSET(WRNGPID)] = "Wrong pid in netlink message", | ||
110 | [ERRCODE_OFFSET(INVSEQ)] = "Invalid netlink sequence", | ||
109 | }; | 111 | }; |
110 | 112 | ||
111 | int libbpf_strerror(int err, char *buf, size_t size) | 113 | int libbpf_strerror(int err, char *buf, size_t size) |