summaryrefslogtreecommitdiffstats
path: root/include/linux/bpf.h
diff options
context:
space:
mode:
authorMartin KaFai Lau2017-06-05 21:15:47 +0200
committerDavid S. Miller2017-06-06 21:41:22 +0200
commitf3f1c054c288bb6e503005e6d73611151ed20e91 (patch)
treeae79e214e4c8ea0d144f69ac8f0bf85b726752c0 /include/linux/bpf.h
parentbpf: Introduce bpf_prog ID (diff)
downloadkernel-qcow2-linux-f3f1c054c288bb6e503005e6d73611151ed20e91.tar.gz
kernel-qcow2-linux-f3f1c054c288bb6e503005e6d73611151ed20e91.tar.xz
kernel-qcow2-linux-f3f1c054c288bb6e503005e6d73611151ed20e91.zip
bpf: Introduce bpf_map ID
This patch generates an unique ID for each created bpf_map. The approach is similar to the earlier patch for bpf_prog ID. It is worth to note that the bpf_map's ID and bpf_prog's ID are in two independent ID spaces and both have the same valid range: [1, INT_MAX). Signed-off-by: Martin KaFai Lau <kafai@fb.com> Acked-by: Alexei Starovoitov <ast@fb.com> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/bpf.h')
-rw-r--r--include/linux/bpf.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index c5946d19f2ca..c32bace66d3d 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -46,6 +46,7 @@ struct bpf_map {
u32 max_entries;
u32 map_flags;
u32 pages;
+ u32 id;
struct user_struct *user;
const struct bpf_map_ops *ops;
struct work_struct work;