summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorCraig Gallek <kraig@google.com>2017-10-05 10:41:58 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-05 21:42:28 -0700
commitfe9b5f774b28143dcc2957eadffefdca6171a26a (patch)
treedb13337e93443d1dca5cb7cd0d7480aa6862f5d6 /tools/lib
parentb13c5c14dbfd5923d773de9661404ed9600c53ef (diff)
downloadlinux-fe9b5f774b28143dcc2957eadffefdca6171a26a.tar.gz
linux-fe9b5f774b28143dcc2957eadffefdca6171a26a.tar.bz2
linux-fe9b5f774b28143dcc2957eadffefdca6171a26a.zip
libbpf: use map_flags when creating maps
This is required to use BPF_MAP_TYPE_LPM_TRIE or any other map type which requires flags. Signed-off-by: Craig Gallek <kraig@google.com> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/bpf/libbpf.c2
-rw-r--r--tools/lib/bpf/libbpf.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 23152890ec60..5aa45f89da93 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -942,7 +942,7 @@ bpf_object__create_maps(struct bpf_object *obj)
def->key_size,
def->value_size,
def->max_entries,
- 0);
+ def->map_flags);
if (*pfd < 0) {
size_t j;
int err = *pfd;
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
index 7959086eb9c9..6e20003109e0 100644
--- a/tools/lib/bpf/libbpf.h
+++ b/tools/lib/bpf/libbpf.h
@@ -207,6 +207,7 @@ struct bpf_map_def {
unsigned int key_size;
unsigned int value_size;
unsigned int max_entries;
+ unsigned int map_flags;
};
/*