Skip to content

bpf: expose cgroup preorder attachment state to userspace

Hui Su bpf linux-kselftest lkml sashiko-reviews 3 versions – Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 2 repliesApplied 3/3
  2. v23 patches 1 replySuperseded
  3. v13 patches 1 replySuperseded

Changes in v3 from the cover letter

- Simplify the changelogs for patches 1 and 2.
- Simplify the ATTACH_FLAGS synopsis and represent attach flags as an array in JSON output, as suggested by Quentin Monnet.
- Widen the plain-text AttachFlags column for combined flags.
- Address checkpatch line-length and alignment warnings.

Patches in v3 All 3 applied

#Subject and filesSizeRepliesApplied
1/3bpf: Report BPF_F_PREORDER in cgroup program querieskernel/bpf/cgroup.c+8 -80 repliesApplied
2/3selftests/bpf: Test querying BPF_F_PREORDER cgroup attachmentstools/testing/selftests/bpf/prog_tests/cgroup_mprog_opts.c+69 -20 repliesApplied
3/3bpftool: Add support for BPF_F_PREORDER cgroup attach flagtools/bpf/bpftool/Documentation/bpftool-cgroup.rst tools/bpf/bpftool/bash-completion/bpftool tools/bpf/bpftool/cgroup.c+89 -392 repliesApplied

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchQuentin Monnet
1/3
2/3
3/3A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH bpf-next v3 0/3] bpf: expose cgroup preorder attachment state to userspace

The BPF_F_PREORDER attach flag changes the ordering of programs in the effective cgroup program array, but BPF_PROG_QUERY did not report the per-program flag. This series exposes that state and updates bpftool to display, accept, and document this flag.

The series is split into three patches:

1. Report BPF_F_PREORDER in direct cgroup program queries.
2. Add selftests for direct and link-based program queries.
3. Add bpftool support for text, JSON, command-line, completion, and documentation handling of BPF_F_PREORDER.

Changes in v3:
- Simplify the changelogs for patches 1 and 2.
- Simplify the ATTACH_FLAGS synopsis and represent attach flags as an array in JSON output, as suggested by Quentin Monnet.
- Widen the plain-text AttachFlags column for combined flags.
- Address checkpatch line-length and alignment warnings.

Testing:
- PASS: cgroup_mprog_opts, cgroup_preorder, and bpftool cgroup plain-text/JSON smoke (x86_64 QEMU/KVM).
- PASS: bpftool build, Documentation build, bash -n, and checkpatch on generated v3 patches.

Previous versions:
v2: https://lore.kernel.org/bpf/[email protected]/
v1: https://lore.kernel.org/bpf/[email protected]/

Hui Su (3):
bpf: Report BPF_F_PREORDER in cgroup program queries selftests/bpf: Test querying BPF_F_PREORDER cgroup attachments
bpftool: Add support for BPF_F_PREORDER cgroup attach flag

 kernel/bpf/cgroup.c                           | 16 +--
 .../bpftool/Documentation/bpftool-cgroup.rst  | 25 +++--
 tools/bpf/bpftool/bash-completion/bpftool     |  4 +-
 tools/bpf/bpftool/cgroup.c                    | 99 +++++++++++++------
 .../bpf/prog_tests/cgroup_mprog_opts.c        | 71 ++++++++++++-
 5 files changed, 166 insertions(+), 49 deletions(-)

base-commit: 79dc258c9392051420a26f1504c647bd3d27c66a

Signature · 1 line
2.55.0