All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Leon Hwang" <leon.hwang@linux.dev>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v10 4/9] libbpf: Add support for global percpu data
Date: Wed, 15 Jul 2026 16:00:40 +0000	[thread overview]
Message-ID: <20260715160040.A88481F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260715153254.92010-5-leon.hwang@linux.dev>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] BPF skeleton generation completely omits the `.percpu` map, breaking the promised ergonomic access.
--

--- Patch [4]: [PATCH bpf-next v10 4/9] libbpf: Add support for global percpu data ---
(Note: The format of this review is altered to use a free-form summary rather than inline patch quoting due to automated recitation restrictions.)

commit c26518c258a32645d11a26c0d0ce50242231d6a6
Author: Leon Hwang <leon.hwang@linux.dev>
libbpf: Add support for global percpu data

This commit adds support for a new ".percpu" section in libbpf, enabling
efficient handling of global percpu variables. It handles the section by
creating a percpu_array map and populating it at load time.

[Severity: Medium]
The commit message mentions that users can read initialized percpu data
after loading the program. Does the current implementation fully support
BPF skeleton generation for this new section?

In tools/lib/bpf/libbpf.c:map_is_mmapable(), the new code explicitly
returns false when map->libbpf_type == LIBBPF_MAP_PERCPU.

Because PERCPU_ARRAY maps cannot be memory mapped, this prevents the
skeleton generator from emitting the typed datasec pointer (such as
skel->percpu).

Additionally, does bpftool need a concurrent update to fully support this?
Looking at get_map_ident() in tools/bpf/bpftool/gen.c, the sfxs[] array
only contains ".data", ".rodata", ".bss", and ".kconfig".

Without adding ".percpu" to the bpftool suffix list, it appears the skeleton
generator will entirely omit the map from the generated header. If neither
skel->percpu nor skel->maps.percpu is emitted, will users be forced to fall
back to untyped manual lookups like bpf_object__find_map_by_name() instead
of having the intended ergonomic skeleton access?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260715153254.92010-1-leon.hwang@linux.dev?part=4

  reply	other threads:[~2026-07-15 16:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-15 15:32 [PATCH bpf-next v10 0/9] bpf: Introduce global percpu data Leon Hwang
2026-07-15 15:32 ` [PATCH bpf-next v10 1/9] bpf: Drop duplicate blank lines in verifier Leon Hwang
2026-07-15 15:32 ` [PATCH bpf-next v10 2/9] bpf: Introduce global percpu data Leon Hwang
2026-07-15 15:32 ` [PATCH bpf-next v10 3/9] libbpf: Probe percpu data feature Leon Hwang
2026-07-15 15:32 ` [PATCH bpf-next v10 4/9] libbpf: Add support for global percpu data Leon Hwang
2026-07-15 16:00   ` sashiko-bot [this message]
2026-07-15 15:32 ` [PATCH bpf-next v10 5/9] bpftool: Generate skeleton " Leon Hwang
2026-07-15 15:32 ` [PATCH bpf-next v10 6/9] selftests/bpf: Add tests to verify " Leon Hwang
2026-07-15 15:55   ` sashiko-bot
2026-07-15 16:11   ` bot+bpf-ci
2026-07-15 15:32 ` [PATCH bpf-next v10 7/9] selftests/bpf: Test direct reading/writing read-only percpu_array map Leon Hwang
2026-07-15 15:32 ` [PATCH bpf-next v10 8/9] selftests/bpf: Test verifier log for global percpu data Leon Hwang
2026-07-15 15:32 ` [PATCH bpf-next v10 9/9] selftests/bpf: Verify bpf_iter " Leon Hwang

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=20260715160040.A88481F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=leon.hwang@linux.dev \
    --cc=sashiko-reviews@lists.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.