]> www.infradead.org Git - users/hch/configfs.git/commit
selftests: bpf: add testmod kfunc for nullable params
authorVadim Fedorenko <vadfed@meta.com>
Thu, 13 Jun 2024 21:18:17 +0000 (14:18 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 13 Jun 2024 23:33:04 +0000 (16:33 -0700)
commit2d45ab1eda469c802728d0a74e1601de5e71c098
tree57df14787c55b7ddfbf0b609138da6a0459cc3e2
parent9b560751f75f7b2484fa22c781be68f4f9fec2b0
selftests: bpf: add testmod kfunc for nullable params

Add special test to be sure that only __nullable BTF params can be
replaced by NULL. This patch adds fake kfuncs in bpf_testmod to
properly test different params.

Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Vadim Fedorenko <vadfed@meta.com>
Link: https://lore.kernel.org/r/20240613211817.1551967-6-vadfed@meta.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
tools/testing/selftests/bpf/bpf_testmod/bpf_testmod_kfunc.h
tools/testing/selftests/bpf/prog_tests/kfunc_param_nullable.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/test_kfunc_param_nullable.c [new file with mode: 0644]