[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260123-skb-meta-bpf-emit-call-from-prologue-v2-0-0e50db4d4663@cloudflare.com>
Date: Fri, 23 Jan 2026 18:05:17 +0100
From: Jakub Sitnicki <jakub@...udflare.com>
To: bpf@...r.kernel.org
Cc: Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
John Fastabend <john.fastabend@...il.com>,
Andrii Nakryiko <andrii@...nel.org>,
Martin KaFai Lau <martin.lau@...ux.dev>,
Eduard Zingerman <eddyz87@...il.com>, Song Liu <song@...nel.org>,
Yonghong Song <yonghong.song@...ux.dev>, KP Singh <kpsingh@...nel.org>,
Stanislav Fomichev <sdf@...ichev.me>, Hao Luo <haoluo@...gle.com>,
Jiri Olsa <jolsa@...nel.org>, Amery Hung <ameryhung@...il.com>,
netdev@...r.kernel.org, kernel-team@...udflare.com,
Martin KaFai Lau <martin.lau@...nel.org>
Subject: [PATCH bpf-next v2 0/4] Switch from kfuncs to direct helper calls
in prologue/epilogue
This series enables direct helper calls using BPF_EMIT_CALL from prologue
and epilogue code generated by verifier ops. The goal is to simplify the
calling convention and remove kfunc support from prologue/epilogue, as
suggested by Alexei [1].
Patch 1 adds the infrastructure to mark direct helper calls as finalized
(already resolved) so the verifier skips the imm fixup.
Patch 2 converts bpf_qdisc to use BPF_EMIT_CALL instead of BPF_CALL_KFUNC
for the init prologue and reset/destroy epilogue helpers.
Patch 3 removes the corresponding selftests that exercised kfuncs in
prologue/epilogue.
Patch 4 removes the now-unused kfunc support code from prologue/epilogue
handling in the verifier.
[1] https://lore.kernel.org/bpf/CAADnVQJ=kmVAZsgkG9P2nEBTUG3E4PrDG=Yz8tfeFysH4ZBqVw@mail.gmail.com/
Signed-off-by: Jakub Sitnicki <jakub@...udflare.com>
---
Changes in v2:
- Swap patch 3 & 4 to avoid selftests fails on bisect (Eduard)
- Rename is_epilogue flag to finalize_helper_calls (Eduard)
- Untie mark_helper_calls_finalized call from epilogue_idx (Eduard)
- Drop review tags for patch 1 after tweaks in patch_insn_buf (patch 1)
- s/__bpf_base_call/__bpf_call_base/ in doc comment (patch 1)
- Link to v1: https://lore.kernel.org/r/20260119-skb-meta-bpf-emit-call-from-prologue-v1-0-e8b88d6430d8@cloudflare.com
---
Jakub Sitnicki (4):
bpf, verifier: Support direct helper calls from prologue/epilogue
bpf: net_sched: Use direct helper calls instead of kfuncs in pro/epilogue
selftests/bpf: Remove tests for prologue/epilogue with kfuncs
bpf: Remove kfunc support in prologue and epilogue
include/linux/bpf_verifier.h | 1 +
kernel/bpf/verifier.c | 52 ++++++------
net/core/filter.c | 3 +-
net/sched/bpf_qdisc.c | 76 ++++++++----------
.../selftests/bpf/prog_tests/pro_epilogue.c | 2 -
.../selftests/bpf/progs/pro_epilogue_with_kfunc.c | 88 ---------------------
.../testing/selftests/bpf/test_kmods/bpf_testmod.c | 92 ----------------------
7 files changed, 63 insertions(+), 251 deletions(-)
Powered by blists - more mailing lists