summaryrefslogtreecommitdiff
path: root/kernel/bpf/map_in_map.h
diff options
context:
space:
mode:
authorMartin KaFai Lau <kafai@fb.com>2017-06-27 23:08:34 -0700
committerDavid S. Miller <davem@davemloft.net>2017-06-29 13:13:25 -0400
commit14dc6f04f49dc12614d7e90928b495b8d73cd471 (patch)
tree159ebddef04be2ae417c503ab46593be570c680f /kernel/bpf/map_in_map.h
parent77b0d3617738e532bae683bf9d88ea35fff223e5 (diff)
bpf: Add syscall lookup support for fd array and htab
This patch allows userspace to do BPF_MAP_LOOKUP_ELEM on BPF_MAP_TYPE_PROG_ARRAY, BPF_MAP_TYPE_ARRAY_OF_MAPS and BPF_MAP_TYPE_HASH_OF_MAPS. The lookup returns a prog-id or map-id to the userspace. The userspace can then use the BPF_PROG_GET_FD_BY_ID or BPF_MAP_GET_FD_BY_ID to get a fd. Signed-off-by: Martin KaFai Lau <kafai@fb.com> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'kernel/bpf/map_in_map.h')
-rw-r--r--kernel/bpf/map_in_map.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/bpf/map_in_map.h b/kernel/bpf/map_in_map.h
index 177fadb689dc..6183db9ec08c 100644
--- a/kernel/bpf/map_in_map.h
+++ b/kernel/bpf/map_in_map.h
@@ -19,5 +19,6 @@ bool bpf_map_meta_equal(const struct bpf_map *meta0,
void *bpf_map_fd_get_ptr(struct bpf_map *map, struct file *map_file,
int ufd);
void bpf_map_fd_put_ptr(void *ptr);
+u32 bpf_map_fd_sys_lookup_elem(void *ptr);
#endif