libbpf: use map_flags when creating maps
authorCraig Gallek <kraig@google.com>
Thu, 5 Oct 2017 14:41:58 +0000 (10:41 -0400)
committerDavid S. Miller <davem@davemloft.net>
Fri, 6 Oct 2017 04:42:28 +0000 (21:42 -0700)
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>
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf.h

index 23152890ec606b61679ec58d70678b55fae65c71..5aa45f89da93a931ec09e4fe65d0560b8d4b4baf 100644 (file)
@@ -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;
index 7959086eb9c920260246dc126846282aa489d7c7..6e20003109e0f0d811d95d3a7683e1d967f7ad02 100644 (file)
@@ -207,6 +207,7 @@ struct bpf_map_def {
        unsigned int key_size;
        unsigned int value_size;
        unsigned int max_entries;
+       unsigned int map_flags;
 };
 
 /*