summaryrefslogtreecommitdiff
path: root/samples/bpf/map_perf_test_user.c
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2021-12-03 02:08:37 +0300
committerAlexei Starovoitov <ast@kernel.org>2021-12-03 02:23:41 +0300
commit080a70b21f476b39ad66524c0ce0729972c61a10 (patch)
treedad6591838a9b35d8414ed4e80d0763b02ff2287 /samples/bpf/map_perf_test_user.c
parent8b4ff5f8bb126fa8ee6918f4854748277609cf68 (diff)
parentc93faaaf2f67ba5396840316651cdc7640d9fa9e (diff)
downloadlinux-080a70b21f476b39ad66524c0ce0729972c61a10.tar.xz
Merge branch 'Deprecate bpf_prog_load_xattr() API'
Andrii Nakryiko says: ==================== Few lines in the last patch to mark bpf_prog_load_xattr() deprecated required a decent amount of clean ups in all the other patches. samples/bpf is big part of the clean up. This patch set also bumps libbpf version to 0.7, as libbpf v0.6 release will be cut shortly. ==================== Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'samples/bpf/map_perf_test_user.c')
-rw-r--r--samples/bpf/map_perf_test_user.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/samples/bpf/map_perf_test_user.c b/samples/bpf/map_perf_test_user.c
index 9db949290a78..319fd31522f3 100644
--- a/samples/bpf/map_perf_test_user.c
+++ b/samples/bpf/map_perf_test_user.c
@@ -134,19 +134,22 @@ static void do_test_lru(enum test_type test, int cpu)
*/
int outer_fd = map_fd[array_of_lru_hashs_idx];
unsigned int mycpu, mynode;
+ LIBBPF_OPTS(bpf_map_create_opts, opts,
+ .map_flags = BPF_F_NUMA_NODE,
+ );
assert(cpu < MAX_NR_CPUS);
ret = syscall(__NR_getcpu, &mycpu, &mynode, NULL);
assert(!ret);
+ opts.numa_node = mynode;
inner_lru_map_fds[cpu] =
- bpf_create_map_node(BPF_MAP_TYPE_LRU_HASH,
- test_map_names[INNER_LRU_HASH_PREALLOC],
- sizeof(uint32_t),
- sizeof(long),
- inner_lru_hash_size, 0,
- mynode);
+ bpf_map_create(BPF_MAP_TYPE_LRU_HASH,
+ test_map_names[INNER_LRU_HASH_PREALLOC],
+ sizeof(uint32_t),
+ sizeof(long),
+ inner_lru_hash_size, &opts);
if (inner_lru_map_fds[cpu] == -1) {
printf("cannot create BPF_MAP_TYPE_LRU_HASH %s(%d)\n",
strerror(errno), errno);