From: Leon Hwang <leon.hwang@linux.dev>
To: "Thiébaud Weksteen" <tweek@google.com>,
"Quentin Monnet" <qmo@kernel.org>,
"Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Andrii Nakryiko" <andrii@kernel.org>,
"Eduard Zingerman" <eddyz87@gmail.com>,
"Kumar Kartikeya Dwivedi" <memxor@gmail.com>,
"Shuah Khan" <shuah@kernel.org>, "KP Singh" <kpsingh@kernel.org>,
"Emil Tsalapatis" <emil@etsalapatis.com>
Cc: Martin KaFai Lau <martin.lau@linux.dev>,
Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
Jiri Olsa <jolsa@kernel.org>,
Ihor Solodrai <ihor.solodrai@linux.dev>,
bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org
Subject: Re: [PATCH bpf-next v2 3/3] selftests/bpf: Verify program FD after non-autoload programs in lskel
Date: Thu, 10 Sep 2026 13:49:34 +0800 [thread overview]
Message-ID: <424ef244-f0e0-46e7-bc27-fffee80f348d@linux.dev> (raw)
In-Reply-To: <20260909042433.1775591-3-tweek@google.com>
On 9/9/26 12:24, Thiébaud Weksteen wrote:
> In test_global_percpu_data.c, dump_percpu_data is defined after two
> non-autoload SEC("?kprobe") programs (verifier_strncmp and
> verifier_snprintf). Verify in test_global_percpu_data_lskel() that
> lskel->progs.dump_percpu_data.prog_fd is properly populated (> 0) when
> loaded via the light skeleton.
>
> Signed-off-by: Thiébaud Weksteen <tweek@google.com>
> ---
> No changes since v1.
The Fixes tags of v1 are dropped.
>
> tools/testing/selftests/bpf/prog_tests/global_data_init.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/global_data_init.c b/tools/testing/selftests/bpf/prog_tests/global_data_init.c
> index 7c539cbcf3a1..ebda60200b71 100644
> --- a/tools/testing/selftests/bpf/prog_tests/global_data_init.c
> +++ b/tools/testing/selftests/bpf/prog_tests/global_data_init.c
> @@ -214,6 +214,8 @@ static void test_global_percpu_data_lskel(void)
> lskel = test_global_percpu_data_lskel__open_and_load();
> if (!ASSERT_OK_PTR(lskel, "test_global_percpu_data_lskel__open_and_load"))
> goto out;
> + if (!ASSERT_GT(lskel->progs.dump_percpu_data.prog_fd, 0, "dump_percpu_data.prog_fd"))
> + goto out;
When the light skeleton does not skip the non-autoload progs,
lskel->progs.dump_percpu_data.prog_fd is 0, actually.
But, theoretically, this ASSERT_GT() is not good enough to prove the FD
is the correct FD of dump_percpu_data prog.
How about running the iter subtest against the lskel? Factor out
test_global_percpu_data_iter_fd() helper first. Then, add an iter
subtest using lskel.
When factoring out test_global_percpu_data_iter_fd() helper, pls change
'do { } while (0);' to '{ /* no-op */ }' btw.
Thanks,
Leon
next prev parent reply other threads:[~2026-09-10 5:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 4:24 [PATCH bpf-next v2 1/3] bpftool: Skip non-autoload programs when generating light skeletons Thiébaud Weksteen
2026-09-09 4:24 ` [PATCH bpf-next v2 2/3] bpftool: Compute light skeleton ctx.sz without relying on links Thiébaud Weksteen
2026-09-09 4:24 ` [PATCH bpf-next v2 3/3] selftests/bpf: Verify program FD after non-autoload programs in lskel Thiébaud Weksteen
2026-09-10 5:49 ` Leon Hwang [this message]
2026-09-09 5:02 ` [PATCH bpf-next v2 1/3] bpftool: Skip non-autoload programs when generating light skeletons bot+bpf-ci
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=424ef244-f0e0-46e7-bc27-fffee80f348d@linux.dev \
--to=leon.hwang@linux.dev \
--cc=andrii@kernel.org \
--cc=ast@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=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=qmo@kernel.org \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=tweek@google.com \
--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
all inboxes | Powered by JetHome®