summaryrefslogtreecommitdiff
path: root/tools/lib/bpf/libbpf.h
diff options
context:
space:
mode:
authorNikita V. Shirokov <tehnerd@tehnerd.com>2018-11-20 20:55:56 -0800
committerDaniel Borkmann <daniel@iogearbox.net>2018-11-21 23:33:21 +0100
commitaddb9fc90f13898e7779da54f471792e3dfb0d55 (patch)
tree980d642f9058eb893b7f689ddf1bb9749a2bd74b /tools/lib/bpf/libbpf.h
parent5b32a23e1d879b78ee72144311314eccf7581bf4 (diff)
bpf: adding support for map in map in libbpf
idea is pretty simple. for specified map (pointed by struct bpf_map) we would provide descriptor of already loaded map, which is going to be used as a prototype for inner map. proposed workflow: 1) open bpf's object (bpf_object__open) 2) create bpf's map which is going to be used as a prototype 3) find (by name) map-in-map which you want to load and update w/ descriptor of inner map w/ a new helper from this patch 4) load bpf program w/ bpf_object__load Signed-off-by: Nikita V. Shirokov <tehnerd@tehnerd.com> Acked-by: Yonghong Song <yhs@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/lib/bpf/libbpf.h')
-rw-r--r--tools/lib/bpf/libbpf.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
index 74e57e041705..f30c3d07bb7d 100644
--- a/tools/lib/bpf/libbpf.h
+++ b/tools/lib/bpf/libbpf.h
@@ -297,6 +297,8 @@ LIBBPF_API void bpf_map__set_ifindex(struct bpf_map *map, __u32 ifindex);
LIBBPF_API int bpf_map__pin(struct bpf_map *map, const char *path);
LIBBPF_API int bpf_map__unpin(struct bpf_map *map, const char *path);
+LIBBPF_API int bpf_map__set_inner_map_fd(struct bpf_map *map, int fd);
+
LIBBPF_API long libbpf_get_error(const void *ptr);
struct bpf_prog_load_attr {