bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf v2 0/2] bpf: add _impl suffix for kfuncs with implicit args
@ 2025-11-04 15:29 Mykyta Yatsenko
  2025-11-04 15:29 ` [PATCH bpf v2 1/2] bpf:add _impl suffix for bpf_task_work_schedule* kfuncs Mykyta Yatsenko
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Mykyta Yatsenko @ 2025-11-04 15:29 UTC (permalink / raw)
  To: bpf, ast, andrii, daniel, kafai, kernel-team; +Cc: Mykyta Yatsenko

We’re introducing support for implicit kfunc arguments and need to
rename new kfuncs to comply with the naming convention.
This new feature, will for each kfunc of the form:

`bpf_foo_impl(args..., aux__prog)`

generate a public BTF type:

`bpf_foo(args...)`

and the verifier will resolve calls to bpf_foo() to bpf_foo_impl(),
supplying a valid struct bpf_prog_aux via aux__prog.

Three kfuncs added in 6.18 don’t follow this *_impl convention and
therefore won’t participate in the new mechanism:
 * bpf_task_work_schedule_resume()
 * bpf_task_work_schedule_signal()
 * bpf_stream_vprintk()

Rename them to align with the implicit-arg flow:
bpf_task_work_schedule_resume() -> bpf_task_work_schedule_resume_impl()
bpf_task_work_schedule_signal() -> bpf_task_work_schedule_signal_impl()
bpf_stream_vprintk() -> bpf_stream_vprintk_impl()

The implicit-arg mechanism is not in tree yet, so callers must switch to
the *_impl names for now. Once the new mechanism lands, the plain
names (without _impl) will be reintroduced as BTF-visible entry points
and will resolve to the _impl versions automatically.

Signed-off-by: Mykyta Yatsenko <yatsenko@meta.com>
---
Changes in v1:
- Split commit into 2
- Rebase on the correct branch
- Link to v1: https://lore.kernel.org/all/20251103232319.122965-1-mykyta.yatsenko5@gmail.com/

---
Mykyta Yatsenko (2):
      bpf:add _impl suffix for bpf_task_work_schedule* kfuncs
      bpf:add _impl suffix for bpf_stream_vprintk() kfunc

 kernel/bpf/helpers.c                               | 26 +++++++++++---------
 kernel/bpf/stream.c                                |  3 ++-
 kernel/bpf/verifier.c                              | 12 +++++-----
 tools/bpf/bpftool/Documentation/bpftool-prog.rst   |  2 +-
 tools/lib/bpf/bpf_helpers.h                        | 28 +++++++++++-----------
 tools/testing/selftests/bpf/progs/stream_fail.c    |  6 ++---
 tools/testing/selftests/bpf/progs/task_work.c      |  6 ++---
 tools/testing/selftests/bpf/progs/task_work_fail.c |  8 +++----
 .../testing/selftests/bpf/progs/task_work_stress.c |  4 ++--
 9 files changed, 50 insertions(+), 45 deletions(-)
---
base-commit: 6146a0f1dfae5d37442a9ddcba012add260bceb0
change-id: 20251104-implv2-d6c4be255026

Best regards,
-- 
Mykyta Yatsenko <yatsenko@meta.com>


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-11-04 22:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-04 15:29 [PATCH bpf v2 0/2] bpf: add _impl suffix for kfuncs with implicit args Mykyta Yatsenko
2025-11-04 15:29 ` [PATCH bpf v2 1/2] bpf:add _impl suffix for bpf_task_work_schedule* kfuncs Mykyta Yatsenko
2025-11-04 19:21   ` Andrii Nakryiko
2025-11-04 15:29 ` [PATCH bpf v2 2/2] bpf:add _impl suffix for bpf_stream_vprintk() kfunc Mykyta Yatsenko
2025-11-04 19:25   ` Andrii Nakryiko
2025-11-04 17:23 ` [PATCH bpf v2 0/2] bpf: add _impl suffix for kfuncs with implicit args Ihor Solodrai
2025-11-04 19:29   ` Andrii Nakryiko
2025-11-04 19:39     ` Ihor Solodrai
2025-11-04 22:13     ` Mykyta Yatsenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).