mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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
This commit is contained in:
parent
5e7b30205c
commit
74fc097de3
7 changed files with 58 additions and 25 deletions
|
@ -8306,10 +8306,8 @@ bpf_program__attach_iter(struct bpf_program *prog,
|
|||
if (!OPTS_VALID(opts, bpf_iter_attach_opts))
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
if (OPTS_HAS(opts, map_fd)) {
|
||||
target_fd = opts->map_fd;
|
||||
link_create_opts.flags = BPF_ITER_LINK_MAP_FD;
|
||||
}
|
||||
link_create_opts.iter_info = OPTS_GET(opts, link_info, (void *)0);
|
||||
link_create_opts.iter_info_len = OPTS_GET(opts, link_info_len, 0);
|
||||
|
||||
prog_fd = bpf_program__fd(prog);
|
||||
if (prog_fd < 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue