selftests/bpf: Add test for bpf_cpumask_weight() kfunc
authorDavid Vernet <void@manifault.com>
Thu, 7 Dec 2023 21:08:43 +0000 (15:08 -0600)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 10 Dec 2023 05:37:33 +0000 (21:37 -0800)
commit88f6047191e69bdd02cf1b9b5b514f7e514e8b86
tree21a2ba3658473f297c164c78c15ef1ce6eedec20
parenta6de18f310a511278c1ff16b96eb2d500eada725
selftests/bpf: Add test for bpf_cpumask_weight() kfunc

The new bpf_cpumask_weight() kfunc can be used to count the number of
bits that are set in a struct cpumask* kptr. Let's add a selftest to
verify its behavior.

Signed-off-by: David Vernet <void@manifault.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20231207210843.168466-3-void@manifault.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/cpumask.c
tools/testing/selftests/bpf/progs/cpumask_common.h
tools/testing/selftests/bpf/progs/cpumask_success.c