diff options
author | Alexei Starovoitov <ast@fb.com> | 2016-03-08 00:57:20 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-03-08 15:28:32 -0500 |
commit | 89b976070190eb9dd14943c0d6ca4b7209f61405 (patch) | |
tree | 36762c9aedfdf442e89148c0079e6cc1cbebbd57 /samples/bpf/libbpf.c | |
parent | 3622e7e4935105991dc648bca650c858576aecda (diff) |
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) | |||
19 | } | 19 | } |
20 | 20 | ||
21 | int bpf_create_map(enum bpf_map_type map_type, int key_size, int value_size, | 21 | int bpf_create_map(enum bpf_map_type map_type, int key_size, int value_size, |
22 | int max_entries) | 22 | int max_entries, int map_flags) |
23 | { | 23 | { |
24 | union bpf_attr attr = { | 24 | union bpf_attr attr = { |
25 | .map_type = map_type, | 25 | .map_type = map_type, |
26 | .key_size = key_size, | 26 | .key_size = key_size, |
27 | .value_size = value_size, | 27 | .value_size = value_size, |
28 | .max_entries = max_entries | 28 | .max_entries = max_entries, |
29 | .map_flags = map_flags, | ||
29 | }; | 30 | }; |
30 | 31 | ||
31 | return syscall(__NR_bpf, BPF_MAP_CREATE, &attr, sizeof(attr)); | 32 | return syscall(__NR_bpf, BPF_MAP_CREATE, &attr, sizeof(attr)); |