bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislav Fomichev <sdf@google.com>
To: David Vernet <void@manifault.com>
Cc: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net,
	 andrii@kernel.org, martin.lau@linux.dev, song@kernel.org,
	yhs@fb.com,  john.fastabend@gmail.com, kpsingh@kernel.org,
	haoluo@google.com,  jolsa@kernel.org,
	linux-kernel@vger.kernel.org, kernel-team@meta.com
Subject: Re: [PATCH] selftests/bpf: Add missing selftests kconfig options
Date: Fri, 2 Jun 2023 09:27:10 -0700	[thread overview]
Message-ID: <ZHoYXlofKUK9YWqv@google.com> (raw)
In-Reply-To: <20230602140108.1177900-1-void@manifault.com>

On 06/02, David Vernet wrote:
> Our selftests of course rely on the kernel being built with
> CONFIG_DEBUG_INFO_BTF=y, though this (nor its dependencies of
> CONFIG_DEBUG_INFO=y and CONFIG_DEBUG_INFO_DWARF4=y) are not specified.
> This causes the wrong kernel to be built, and selftests to similarly
> fail to build.
> 
> Additionally, in the BPF selftests kconfig file,
> CONFIG_NF_CONNTRACK_MARK=y is specified, so that the 'u_int32_t mark'
> field will be present in the definition of struct nf_conn.  While a
> dependency of CONFIG_NF_CONNTRACK_MARK=y, CONFIG_NETFILTER_ADVANCED=y,
> should be enabled by default, I've run into instances of
> CONFIG_NF_CONNTRACK_MARK not being set because CONFIG_NETFILTER_ADVANCED
> isn't set, and have to manually enable them with make menuconfig.
> 
> Let's add these missing kconfig options to the file so that the
> necessary dependencies are in place to build vmlinux. Otherwise, we'll
> get errors like this when we try to compile selftests and generate
> vmlinux.h:
> 
> $ cd /path/to/bpf-next
> $ make mrproper; make defconfig
> $ cat tools/testing/selftests/config >> .config
> $ make -j
> ...
> $ cd tools/testing/selftests/bpf
> $ make clean
> $ make -j
> ...
>   LD [M]
>   tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.ko
>   tools/testing/selftests/bpf/tools/build/bpftool/bootstrap/bpftool
>   btf dump file vmlinux format c >
>   tools/testing/selftests/bpf/tools/build/bpftool/vmlinux.h
>   libbpf: failed to find '.BTF' ELF section in
>   vmlinux
>   Error: failed to load BTF from bpf-next/vmlinux:
>   No data available
>   make[1]: *** [Makefile:208:
>   tools/testing/selftests/bpf/tools/build/bpftool/vmlinux.h]
>   Error 195
>   make[1]: *** Deleting file
>   'tools/testing/selftests/bpf/tools/build/bpftool/vmlinux.h'
>   make: *** [Makefile:261:
>   tools/testing/selftests/bpf/tools/sbin/bpftool]
>   Error 2
> 
> Signed-off-by: David Vernet <void@manifault.com>

Acked-by: Stanislav Fomichev <sdf@google.com>

(I've been also setting these manually myself for local testing)

> ---
>  tools/testing/selftests/bpf/config | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/tools/testing/selftests/bpf/config b/tools/testing/selftests/bpf/config
> index 63cd4ab70171..3b350bc31343 100644
> --- a/tools/testing/selftests/bpf/config
> +++ b/tools/testing/selftests/bpf/config
> @@ -13,6 +13,9 @@ CONFIG_CGROUP_BPF=y
>  CONFIG_CRYPTO_HMAC=y
>  CONFIG_CRYPTO_SHA256=y
>  CONFIG_CRYPTO_USER_API_HASH=y
> +CONFIG_DEBUG_INFO=y
> +CONFIG_DEBUG_INFO_BTF=y
> +CONFIG_DEBUG_INFO_DWARF4=y
>  CONFIG_DYNAMIC_FTRACE=y
>  CONFIG_FPROBE=y
>  CONFIG_FTRACE_SYSCALLS=y
> @@ -60,6 +63,7 @@ CONFIG_NET_SCH_INGRESS=y
>  CONFIG_NET_SCHED=y
>  CONFIG_NETDEVSIM=y
>  CONFIG_NETFILTER=y
> +CONFIG_NETFILTER_ADVANCED=y
>  CONFIG_NETFILTER_SYNPROXY=y
>  CONFIG_NETFILTER_XT_CONNMARK=y
>  CONFIG_NETFILTER_XT_MATCH_STATE=y
> -- 
> 2.40.1
> 

  reply	other threads:[~2023-06-02 16:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-02 14:01 [PATCH] selftests/bpf: Add missing selftests kconfig options David Vernet
2023-06-02 16:27 ` Stanislav Fomichev [this message]
2023-06-05 23:40 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZHoYXlofKUK9YWqv@google.com \
    --to=sdf@google.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kernel-team@meta.com \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=song@kernel.org \
    --cc=void@manifault.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).