summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/prog_tests/kfunc_param_nullable.c
diff options
context:
space:
mode:
authorVadim Fedorenko <vadfed@meta.com>2024-06-13 14:18:17 -0700
committerAlexei Starovoitov <ast@kernel.org>2024-06-13 16:33:04 -0700
commit2d45ab1eda469c802728d0a74e1601de5e71c098 (patch)
tree57df14787c55b7ddfbf0b609138da6a0459cc3e2 /tools/testing/selftests/bpf/prog_tests/kfunc_param_nullable.c
parent9b560751f75f7b2484fa22c781be68f4f9fec2b0 (diff)
downloadlwn-2d45ab1eda469c802728d0a74e1601de5e71c098.tar.gz
lwn-2d45ab1eda469c802728d0a74e1601de5e71c098.zip
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>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/kfunc_param_nullable.c')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/kfunc_param_nullable.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/kfunc_param_nullable.c b/tools/testing/selftests/bpf/prog_tests/kfunc_param_nullable.c
new file mode 100644
index 000000000000..c8f4dcaac7c7
--- /dev/null
+++ b/tools/testing/selftests/bpf/prog_tests/kfunc_param_nullable.c
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0
+
+/* Copyright (c) 2024 Meta Platforms, Inc */
+
+#include <test_progs.h>
+#include "test_kfunc_param_nullable.skel.h"
+
+void test_kfunc_param_nullable(void)
+{
+ RUN_TESTS(test_kfunc_param_nullable);
+}