public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/3] Support passing BPF iterator to kfuncs
@ 2024-08-08 23:22 Andrii Nakryiko
  2024-08-08 23:22 ` [PATCH bpf-next 1/3] bpf: extract iterator argument type and name validation logic Andrii Nakryiko
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Andrii Nakryiko @ 2024-08-08 23:22 UTC (permalink / raw)
  To: bpf, ast, daniel, martin.lau; +Cc: tj, void, Andrii Nakryiko

Add support for passing BPF iterator state to any kfunc. Such kfunc has to
declare such argument with valid `struct bpf_iter_<type> *` type and should
use "__iter" suffix in argument name, following the established suffix-based
convention. We add a simple test/demo iterator getter in bpf_testmod.

Andrii Nakryiko (3):
  bpf: extract iterator argument type and name validation logic
  bpf: allow passing struct bpf_iter_<type> as kfunc arguments
  selftests/bpf: test passing iterator to a kfunc

 include/linux/btf.h                           |  5 ++
 kernel/bpf/btf.c                              | 50 +++++++++++++------
 kernel/bpf/verifier.c                         | 35 +++++++++----
 .../selftests/bpf/bpf_testmod/bpf_testmod.c   | 16 ++++--
 .../selftests/bpf/progs/iters_testmod_seq.c   | 50 +++++++++++++++++++
 5 files changed, 127 insertions(+), 29 deletions(-)

-- 
2.43.5


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

end of thread, other threads:[~2024-08-21 17:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-08 23:22 [PATCH bpf-next 0/3] Support passing BPF iterator to kfuncs Andrii Nakryiko
2024-08-08 23:22 ` [PATCH bpf-next 1/3] bpf: extract iterator argument type and name validation logic Andrii Nakryiko
2024-08-09 18:38   ` Eduard Zingerman
2024-08-08 23:22 ` [PATCH bpf-next 2/3] bpf: allow passing struct bpf_iter_<type> as kfunc arguments Andrii Nakryiko
2024-08-09 19:14   ` Eduard Zingerman
2024-08-09 19:28     ` Andrii Nakryiko
2024-08-09 19:40       ` Eduard Zingerman
2024-08-09 20:36         ` Andrii Nakryiko
2024-08-08 23:22 ` [PATCH bpf-next 3/3] selftests/bpf: test passing iterator to a kfunc Andrii Nakryiko
2024-08-21 17:50 ` [PATCH bpf-next 0/3] Support passing BPF iterator to kfuncs patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox