Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 96eabe7a40aa ("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

authored by

Saket Kumar Bhaskar and committed by
Andrii Nakryiko
4107a1ae 650f20bb

+5
+5
tools/testing/selftests/bpf/prog_tests/bloom_filter_map.c
··· 6 6 #include <test_progs.h> 7 7 #include "bloom_filter_map.skel.h" 8 8 9 + #ifndef NUMA_NO_NODE 10 + #define NUMA_NO_NODE (-1) 11 + #endif 12 + 9 13 static void test_fail_cases(void) 10 14 { 11 15 LIBBPF_OPTS(bpf_map_create_opts, opts); ··· 73 69 74 70 /* Create a map */ 75 71 opts.map_flags = BPF_F_ZERO_SEED | BPF_F_NUMA_NODE; 72 + opts.numa_node = NUMA_NO_NODE; 76 73 fd = bpf_map_create(BPF_MAP_TYPE_BLOOM_FILTER, NULL, 0, sizeof(value), 100, &opts); 77 74 if (!ASSERT_GE(fd, 0, "bpf_map_create bloom filter success case")) 78 75 return;