mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: bot+bpf-ci@kernel.org
To: sh_def@163.com,bpf@vger.kernel.org,ast@kernel.org,daniel@iogearbox.net,andrii@kernel.org,eddyz87@gmail.com,memxor@gmail.com
Cc: yonghong.song@linux.dev,qmo@kernel.org,martin.lau@linux.dev,song@kernel.org,jolsa@kernel.org,emil@etsalapatis.com,ihor.solodrai@linux.dev,shuah@kernel.org,linux-kselftest@vger.kernel.org,linux-kernel@vger.kernel.org,sh_def@163.com,ast@kernel.org,andrii@kernel.org,daniel@iogearbox.net,martin.lau@kernel.org,eddyz87@gmail.com,yonghong.song@linux.dev,mason@kernel.org,ihor.solodrai@linux.dev
Subject: Re: [PATCH bpf-next v2 2/3] selftests/bpf: Test querying BPF_F_PREORDER cgroup attachments
Date: Sat, 19 Sep 2026 10:43:13 +0000 (UTC)	[thread overview]
Message-ID: <f45c182798066473dcd807ce86590d80bddab5d5790b711f48ff2f4e1fb55d9a@mail.kernel.org> (raw)
In-Reply-To: <20260919094400.600585-3-sh_def@163.com>

[-- Attachment #1: Type: text/plain, Size: 1805 bytes --]

> selftests/bpf: Test querying BPF_F_PREORDER cgroup attachments
>
> Extend cgroup_mprog_opts selftests to verify that BPF_PROG_QUERY reports
> BPF_F_PREORDER in prog_attach_flags for both direct program and link
> attachments.
>
> Specifically, add assert_preorder_query_flags() and use it from
> test_preorder_prog_attach_detach() and
> test_preorder_link_attach_detach() to verify that:
> - Programs attached with BPF_F_PREORDER report
>   BPF_F_ALLOW_MULTI | BPF_F_PREORDER (0x42) in prog_attach_flags.
> - Programs attached without BPF_F_PREORDER report BPF_F_ALLOW_MULTI (0x2).
> - Transient flags such as BPF_F_AFTER or BPF_F_LINK are not present in
>   prog_attach_flags.
> - Per-program attach flags are validated by matching each attached prog_id
>   via a query helper, avoiding fragile assumptions on the internal slot
>   order of the direct query list.
> - Failures during prog_id lookup are guarded so uninitialized flag values
>   do not trigger secondary assertion failures.
>
> Signed-off-by: Hui Su <sh_def@163.com>

This isn't a bug, but could the last two bullets be dropped so the
changelog stays on what behaviour is now covered, rather than describing
how the test helper is written?

The first three bullets state which behaviour the new test covers, which
is the useful part. The last two bullets describe how the test code is
written (a lookup helper instead of indexing, and guarding the lookup
return before reading the flags variable) rather than what kernel
behaviour is being pinned down; that detail is visible in the diff
itself.


---
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/35436378806

  reply	other threads:[~2026-09-19 10:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-19  9:43 [PATCH bpf-next v2 0/3] bpf: expose cgroup preorder attachment state to userspace Hui Su
2026-09-19  9:43 ` [PATCH bpf-next v2 1/3] bpf: Report BPF_F_PREORDER in cgroup program queries Hui Su
2026-09-19 10:57   ` bot+bpf-ci
2026-09-19  9:43 ` [PATCH bpf-next v2 2/3] selftests/bpf: Test querying BPF_F_PREORDER cgroup attachments Hui Su
2026-09-19 10:43   ` bot+bpf-ci [this message]
2026-09-19  9:44 ` [PATCH bpf-next v2 3/3] bpftool: Add support for BPF_F_PREORDER cgroup attach flag Hui Su
2026-09-19 10:58   ` bot+bpf-ci
2026-09-21 13:42   ` 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=f45c182798066473dcd807ce86590d80bddab5d5790b711f48ff2f4e1fb55d9a@mail.kernel.org \
    --to=bot+bpf-ci@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=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=martin.lau@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=mason@kernel.org \
    --cc=memxor@gmail.com \
    --cc=qmo@kernel.org \
    --cc=sh_def@163.com \
    --cc=shuah@kernel.org \
    --cc=song@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

all inboxes | Powered by JetHome®