From: Quentin Monnet <qmo@kernel.org>
To: "Thiébaud Weksteen" <tweek@google.com>,
"Leon Hwang" <leon.hwang@linux.dev>
Cc: 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>,
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, 17 Sep 2026 13:04:45 +0100 [thread overview]
Message-ID: <046917ac-3de6-40e5-85c3-93b55160b098@kernel.org> (raw)
In-Reply-To: <CA+zpnLeRmo3RTAxmMUHepm+kmpG4nw+z_vhR_kNubqEEEAVxbA@mail.gmail.com>
2026-09-17 11:06 UTC+1000 ~ Thiébaud Weksteen <tweek@google.com>
> On Thu, Sep 10, 2026 at 3:49 PM Leon Hwang <leon.hwang@linux.dev> wrote:
>>
>> 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 for the review Leon. That sounds good, I can implement these
> changes. I am just waiting for Quentin's feedback on the first patch
> in this series before spinning up a new patch set.
>
Apologies for the delay. Patch 1 looks good to me, I just posted some
minor suggestions regarding comments. Thank you!
Quentin
next prev parent reply other threads:[~2026-09-17 12:04 UTC|newest]
Thread overview: 9+ 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-17 12:03 ` Quentin Monnet
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
2026-09-17 1:06 ` Thiébaud Weksteen
2026-09-17 12:04 ` Quentin Monnet [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
2026-09-17 12:03 ` Quentin Monnet
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=046917ac-3de6-40e5-85c3-93b55160b098@kernel.org \
--to=qmo@kernel.org \
--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=leon.hwang@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--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®