summaryrefslogtreecommitdiff
path: root/tools/lib/bpf/bpf_helpers.h
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2025-11-04 17:50:26 -0800
committerAlexei Starovoitov <ast@kernel.org>2025-11-04 17:50:33 -0800
commit44e8f13f07cfaa978c19fb4d66904f65905c7259 (patch)
tree7a5dfe5fbe5fd370a5e5007f2bef8024a7896a5f /tools/lib/bpf/bpf_helpers.h
parent156c75f596c98852c30981baea6c2cc8a7a411fc (diff)
parent137cc92ffe2e71705fce112656a460d924934ebe (diff)
Merge branch 'bpf-add-_impl-suffix-for-kfuncs-with-implicit-args'
Mykyta Yatsenko says: ==================== bpf: Add _impl suffix for kfuncs with implicit args We have established a pattern of function naming win "_impl" suffix; those functions accept verifier-provided bpf_prog_aux argument. Following uniform convention will allow for transparent backwards compatibility with the upcoming KF_IMPLICIT_ARGS feature. This patch set aims to fix current deviation from the convention to eliminate unnecessary backwards incompatibility in the future. Three kfuncs added in 6.18 don’t follow this *_impl convention and therefore won’t participate in the new KF_IMPLICIT_ARGS 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 KF_IMPLICIT_ARGS 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. Signed-off-by: Mykyta Yatsenko <yatsenko@meta.com> Acked-by: Ihor Solodrai <ihor.solodrai@linux.dev> --- Changes in v3: - Fix commit messages - Link to v2: https://lore.kernel.org/r/20251104-implv2-v2-0-6dbc35f39f28@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/ ==================== Link: https://patch.msgid.link/20251104-implv2-v3-0-4772b9ae0e06@meta.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/lib/bpf/bpf_helpers.h')
-rw-r--r--tools/lib/bpf/bpf_helpers.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/tools/lib/bpf/bpf_helpers.h b/tools/lib/bpf/bpf_helpers.h
index 80c028540656..d4e4e388e625 100644
--- a/tools/lib/bpf/bpf_helpers.h
+++ b/tools/lib/bpf/bpf_helpers.h
@@ -315,20 +315,20 @@ enum libbpf_tristate {
___param, sizeof(___param)); \
})
-extern int bpf_stream_vprintk(int stream_id, const char *fmt__str, const void *args,
- __u32 len__sz, void *aux__prog) __weak __ksym;
-
-#define bpf_stream_printk(stream_id, fmt, args...) \
-({ \
- static const char ___fmt[] = fmt; \
- unsigned long long ___param[___bpf_narg(args)]; \
- \
- _Pragma("GCC diagnostic push") \
- _Pragma("GCC diagnostic ignored \"-Wint-conversion\"") \
- ___bpf_fill(___param, args); \
- _Pragma("GCC diagnostic pop") \
- \
- bpf_stream_vprintk(stream_id, ___fmt, ___param, sizeof(___param), NULL);\
+extern int bpf_stream_vprintk_impl(int stream_id, const char *fmt__str, const void *args,
+ __u32 len__sz, void *aux__prog) __weak __ksym;
+
+#define bpf_stream_printk(stream_id, fmt, args...) \
+({ \
+ static const char ___fmt[] = fmt; \
+ unsigned long long ___param[___bpf_narg(args)]; \
+ \
+ _Pragma("GCC diagnostic push") \
+ _Pragma("GCC diagnostic ignored \"-Wint-conversion\"") \
+ ___bpf_fill(___param, args); \
+ _Pragma("GCC diagnostic pop") \
+ \
+ bpf_stream_vprintk_impl(stream_id, ___fmt, ___param, sizeof(___param), NULL); \
})
/* Use __bpf_printk when bpf_printk call has 3 or fewer fmt args