diff options
author | Alexei Starovoitov <ast@fb.com> | 2016-03-08 08:57:20 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-03-08 23:28:32 +0300 |
commit | 89b976070190eb9dd14943c0d6ca4b7209f61405 (patch) | |
tree | 36762c9aedfdf442e89148c0079e6cc1cbebbd57 /samples/bpf/libbpf.c | |
parent | 3622e7e4935105991dc648bca650c858576aecda (diff) | |
download | linux-89b976070190eb9dd14943c0d6ca4b7209f61405.tar.xz |
samples/bpf: add map_flags to bpf loader
note old loader is compatible with new kernel.
map_flags are optional
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples/bpf/libbpf.c')
-rw-r--r-- | samples/bpf/libbpf.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/samples/bpf/libbpf.c b/samples/bpf/libbpf.c index 65a8d48d2799..9969e35550c3 100644 --- a/samples/bpf/libbpf.c +++ b/samples/bpf/libbpf.c @@ -19,13 +19,14 @@ static __u64 ptr_to_u64(void *ptr) } int bpf_create_map(enum bpf_map_type map_type, int key_size, int value_size, - int max_entries) + int max_entries, int map_flags) { union bpf_attr attr = { .map_type = map_type, .key_size = key_size, .value_size = value_size, - .max_entries = max_entries + .max_entries = max_entries, + .map_flags = map_flags, }; return syscall(__NR_bpf, BPF_MAP_CREATE, &attr, sizeof(attr)); |