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

bpf: selftests: nf: Opt out of using generated kfunc prototypes

The bpf-nf selftests play various games with aliased types such that
folks with CONFIG_NF_CONNTRACK=m/n configs can still build the
selftests. See commits:

1058b6a78db2 ("selftests/bpf: Do not fail build if CONFIG_NF_CONNTRACK=m/n")
92afc5329a5b ("selftests/bpf: Fix build errors if CONFIG_NF_CONNTRACK=m")

Thus, it is simpler if these selftests opt out of using generated kfunc
prototypes. The preprocessor macro this commit uses will be introduced
in the final commit.

Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
Link: https://lore.kernel.org/r/044a5b10cb3abd0d71cb1c818ee0bfc4a2239332.1718207789.git.dxu@dxuuu.xyz
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Daniel Xu and committed by
Alexei Starovoitov
f709124d cce4c40b

+3
+1
tools/testing/selftests/bpf/progs/test_bpf_nf.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 + #define BPF_NO_KFUNC_PROTOTYPES 2 3 #include <vmlinux.h> 3 4 #include <bpf/bpf_helpers.h> 4 5 #include <bpf/bpf_endian.h>
+1
tools/testing/selftests/bpf/progs/test_bpf_nf_fail.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 + #define BPF_NO_KFUNC_PROTOTYPES 2 3 #include <vmlinux.h> 3 4 #include <bpf/bpf_tracing.h> 4 5 #include <bpf/bpf_helpers.h>
+1
tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c
··· 1 1 // SPDX-License-Identifier: LGPL-2.1 OR BSD-2-Clause 2 2 /* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */ 3 3 4 + #define BPF_NO_KFUNC_PROTOTYPES 4 5 #include "vmlinux.h" 5 6 6 7 #include <bpf/bpf_helpers.h>