From: "Kumar Kartikeya Dwivedi" <memxor@gmail.com>
To: <bot+bpf-ci@kernel.org>, <bpf@vger.kernel.org>
Cc: <ast@kernel.org>, <andrii@kernel.org>, <daniel@iogearbox.net>,
<eddyz87@gmail.com>, <emil@etsalapatis.com>,
<ihor.solodrai@linux.dev>, <tj@kernel.org>, <kkd@meta.com>,
<kernel-team@meta.com>, <martin.lau@kernel.org>,
<yonghong.song@linux.dev>, <mason@kernel.org>
Subject: Re: [PATCH bpf-next v2 07/13] selftests/bpf: Test __arena pointer members
Date: Tue, 13 Oct 2026 11:19:42 +0200 [thread overview]
Message-ID: <DM3LKPQPHXE3.GP6SHET5TH6K@gmail.com> (raw)
In-Reply-To: <19d84db7443c99a6256ac4bda3e1eabefb2a052b231f8aa571dc0628ee2ed2ff@mail.kernel.org>
On Tue Oct 13, 2026 at 11:14 AM CEST, bot+bpf-ci wrote:
>> selftests/bpf: Test __arena pointer members
>
> TL;DR: Test issue in test_struct_ops_arena.c: if the bpf_testmod BTF lacks the
> "arena" type tag, the new arena member tests are silently dropped,
> test__skip() is never called, and the test still reports OK.
>
>> diff --git a/tools/testing/selftests/bpf/prog_tests/test_struct_ops_arena.c b/tools/testing/selftests/bpf/prog_tests/test_struct_ops_arena.c
>> --- a/tools/testing/selftests/bpf/prog_tests/test_struct_ops_arena.c
>> +++ b/tools/testing/selftests/bpf/prog_tests/test_struct_ops_arena.c
>
> [ ... ]
>
>> +/*
>> + * The tags on the members of struct bpf_testmod_arena_member_args reach the
>> + * module BTF only from a toolchain with btf_type_tag support.
>> + */
>> +static bool testmod_has_type_tag(const char *tag)
>> +{
>> + struct btf *vmlinux_btf, *module_btf;
>> + bool found = false;
>> +
>> + vmlinux_btf = btf__load_vmlinux_btf();
>> + if (!ASSERT_OK_PTR(vmlinux_btf, "vmlinux_btf"))
>> + return false;
>> + module_btf = btf__load_module_btf("bpf_testmod", vmlinux_btf);
>> + if (ASSERT_OK_PTR(module_btf, "module_btf"))
>> + found = btf__find_by_name_kind(module_btf, tag, BTF_KIND_TYPE_TAG) > 0;
>> + if (!found)
>> + printf("%s:SKIP: no %s type tag in the bpf_testmod BTF\n", __func__, tag);
>> + btf__free(module_btf);
>> + btf__free(vmlinux_btf);
>> + return found;
>> +}
>
> [ ... ]
>
>> @@ -122,6 +201,18 @@ void serial_test_struct_ops_arena(void)
>> arena_arg_fail();
>> if (test__start_subtest("arena_arg_attach"))
>> arena_arg_attach();
>> + if (testmod_has_type_tag("arena")) {
>> + if (test__start_subtest("arena_member"))
>> + arena_member();
>> + if (test__start_subtest("arena_member_render"))
>> + arena_member_render();
>> + RUN_TESTS(struct_ops_arena_member_fail__union);
>> + RUN_TESTS(struct_ops_arena_member_fail__load_acq);
>> + RUN_TESTS(struct_ops_arena_member_fail__mismatch);
>> + RUN_TESTS(struct_ops_arena_member_fail__mismatch_mem);
>> + RUN_TESTS(struct_ops_arena_member_fail__write);
>> + RUN_TESTS(struct_ops_arena_member_fail__no_arena);
>> + }
>> #else
>> test__skip();
>> #endif
>
> When the bpf_testmod BTF has no "arena" type tag, testmod_has_type_tag()
> prints a SKIP line but never calls test__skip(). Is the skip reported
> anywhere?
>
> serial_test_struct_ops_arena() then leaves out the arena_member and
> arena_member_render subtests and all six RUN_TESTS() groups, and the parent
> test still reports OK. test_progs only prints a test's captured stdout when
> the test fails or runs verbose (dump_test_log() uses print_test = verbose()
> || force_log || test_failed), so in a normal run the message is never shown
> and the skip is never counted.
>
> That seems realistic for kernels built with a toolchain that lacks
> btf_type_tag support, where this coverage would be silently dropped.
> prog_tests/btf_tag.c does the same check
> (btf__find_by_name_kind(*module_btf, "user", BTF_KIND_TYPE_TAG) <= 0) and
> pairs the printf with test__skip().
>
> Could the arena_member and arena_member_render subtests still be started
> unconditionally, calling test__skip() from inside each one when the tag is
> missing? That would keep the arena_arg* results intact while making the
> skip visible.
>
It's fine.
>
> ---
> AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
> See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
>
> CI run summary: https://github.com/kernel-patches/bpf/actions/runs/38370395582
next prev parent reply other threads:[~2026-10-13 9:19 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 8:19 [PATCH bpf-next v2 00/13] Fix some arena paper cuts Kumar Kartikeya Dwivedi
2026-10-13 8:19 ` [PATCH bpf-next v2 01/13] libbpf: Keep the fd_array fill index out of bpf_program__clone() Kumar Kartikeya Dwivedi
2026-10-13 13:00 ` Mykyta Yatsenko
2026-10-13 8:19 ` [PATCH bpf-next v2 02/13] selftests/bpf: Clone a program that calls a module kfunc Kumar Kartikeya Dwivedi
2026-10-13 8:19 ` [PATCH bpf-next v2 03/13] compiler_types: Add __arena and __nullable BTF type tag qualifiers Kumar Kartikeya Dwivedi
2026-10-13 8:19 ` [PATCH bpf-next v2 04/13] bpf: Recognize __nullable on pointer members of kernel structs Kumar Kartikeya Dwivedi
2026-10-13 8:52 ` sashiko-bot
2026-10-13 9:19 ` Kumar Kartikeya Dwivedi
2026-10-13 8:20 ` [PATCH bpf-next v2 05/13] bpf: Turn loads of __arena pointer members into arena pointers Kumar Kartikeya Dwivedi
2026-10-13 8:40 ` sashiko-bot
2026-10-13 9:04 ` Kumar Kartikeya Dwivedi
2026-10-13 8:20 ` [PATCH bpf-next v2 06/13] selftests/bpf: Test __nullable pointer members Kumar Kartikeya Dwivedi
2026-10-13 8:20 ` [PATCH bpf-next v2 07/13] selftests/bpf: Test __arena " Kumar Kartikeya Dwivedi
2026-10-13 9:14 ` bot+bpf-ci
2026-10-13 9:19 ` Kumar Kartikeya Dwivedi [this message]
2026-10-13 8:20 ` [PATCH bpf-next v2 08/13] libbpf: Bind the arena of an object to every program in it Kumar Kartikeya Dwivedi
2026-10-13 9:14 ` bot+bpf-ci
2026-10-13 8:20 ` [PATCH bpf-next v2 09/13] selftests/bpf: Test arena binding by libbpf Kumar Kartikeya Dwivedi
2026-10-13 8:20 ` [PATCH bpf-next v2 10/13] bpf: Set up the arena base only in functions that use it Kumar Kartikeya Dwivedi
2026-10-13 8:20 ` [PATCH bpf-next v2 11/13] libbpf: Render the arena type tag with its address space Kumar Kartikeya Dwivedi
2026-10-13 8:20 ` [PATCH bpf-next v2 12/13] selftests/bpf: Test the address space rendering of the arena type tag Kumar Kartikeya Dwivedi
2026-10-13 8:20 ` [PATCH bpf-next v2 13/13] selftests/bpf: Test an arena kfunc argument passed from a subprogram Kumar Kartikeya Dwivedi
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=DM3LKPQPHXE3.GP6SHET5TH6K@gmail.com \
--to=memxor@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bot+bpf-ci@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=ihor.solodrai@linux.dev \
--cc=kernel-team@meta.com \
--cc=kkd@meta.com \
--cc=martin.lau@kernel.org \
--cc=mason@kernel.org \
--cc=tj@kernel.org \
--cc=yonghong.song@linux.dev \
/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