Skip to content

Commit 4107a1a

Browse files
Saket Kumar Bhaskaranakryiko
authored andcommitted
selftests/bpf: Select NUMA_NO_NODE to create map
On powerpc, a CPU does not necessarily originate from NUMA node 0. This contrasts with architectures like x86, where CPU 0 is not hot-pluggable, making NUMA node 0 a consistently valid node. This discrepancy can lead to failures when creating a map on NUMA node 0, which is initialized by default, if no CPUs are allocated from NUMA node 0. This patch fixes the issue by setting NUMA_NO_NODE (-1) for map creation for this selftest. Fixes: 96eabe7 ("bpf: Allow selecting numa node during map creation") Signed-off-by: Saket Kumar Bhaskar <skb99@linux.ibm.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Yonghong Song <yonghong.song@linux.dev> Link: https://lore.kernel.org/bpf/cf1f61468b47425ecf3728689bc9636ddd1d910e.1738302337.git.skb99@linux.ibm.com
1 parent 650f20b commit 4107a1a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/testing/selftests/bpf/prog_tests/bloom_filter_map.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
#include <test_progs.h>
77
#include "bloom_filter_map.skel.h"
88

9+
#ifndef NUMA_NO_NODE
10+
#define NUMA_NO_NODE (-1)
11+
#endif
12+
913
static void test_fail_cases(void)
1014
{
1115
LIBBPF_OPTS(bpf_map_create_opts, opts);
@@ -69,6 +73,7 @@ static void test_success_cases(void)
6973

7074
/* Create a map */
7175
opts.map_flags = BPF_F_ZERO_SEED | BPF_F_NUMA_NODE;
76+
opts.numa_node = NUMA_NO_NODE;
7277
fd = bpf_map_create(BPF_MAP_TYPE_BLOOM_FILTER, NULL, 0, sizeof(value), 100, &opts);
7378
if (!ASSERT_GE(fd, 0, "bpf_map_create bloom filter success case"))
7479
return;

0 commit comments

Comments
 (0)