From: Craig Gallek Date: Thu, 5 Oct 2017 14:41:58 +0000 (-0400) Subject: libbpf: use map_flags when creating maps X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=fe9b5f774b28143dcc2957eadffefdca6171a26a;p=linux.git 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 Acked-by: Daniel Borkmann Signed-off-by: David S. Miller --- diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 23152890ec606..5aa45f89da93a 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 7959086eb9c92..6e20003109e0f 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; }; /*