summaryrefslogtreecommitdiff
path: root/tools/lib/bpf/bpf.h
diff options
context:
space:
mode:
authorYonghong Song <yhs@fb.com>2020-08-05 08:50:58 +0300
committerAlexei Starovoitov <ast@kernel.org>2020-08-07 02:39:14 +0300
commit74fc097de327b37e8fe3ff580ce7ffaa7c1740dd (patch)
tree89c462f3b9f1fa1ea8e5d22f67d2f21fbf2766e1 /tools/lib/bpf/bpf.h
parent5e7b30205cef80f6bb922e61834437ca7bff5837 (diff)
downloadlinux-74fc097de327b37e8fe3ff580ce7ffaa7c1740dd.tar.xz
tools/bpf: Support new uapi for map element bpf iterator
Previous commit adjusted kernel uapi for map element bpf iterator. This patch adjusted libbpf API due to uapi change. bpftool and bpf_iter selftests are also changed accordingly. Signed-off-by: Yonghong Song <yhs@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Andrii Nakryiko <andriin@fb.com> Acked-by: John Fastabend <john.fastabend@gmail.com> Link: https://lore.kernel.org/bpf/20200805055058.1457623-1-yhs@fb.com
Diffstat (limited to 'tools/lib/bpf/bpf.h')
-rw-r--r--tools/lib/bpf/bpf.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/lib/bpf/bpf.h b/tools/lib/bpf/bpf.h
index 28855fd5b5f4..015d13f25fcc 100644
--- a/tools/lib/bpf/bpf.h
+++ b/tools/lib/bpf/bpf.h
@@ -168,11 +168,14 @@ LIBBPF_API int bpf_prog_detach(int attachable_fd, enum bpf_attach_type type);
LIBBPF_API int bpf_prog_detach2(int prog_fd, int attachable_fd,
enum bpf_attach_type type);
+union bpf_iter_link_info; /* defined in up-to-date linux/bpf.h */
struct bpf_link_create_opts {
size_t sz; /* size of this struct for forward/backward compatibility */
__u32 flags;
+ union bpf_iter_link_info *iter_info;
+ __u32 iter_info_len;
};
-#define bpf_link_create_opts__last_field flags
+#define bpf_link_create_opts__last_field iter_info_len
LIBBPF_API int bpf_link_create(int prog_fd, int target_fd,
enum bpf_attach_type attach_type,