mbox series

[bpf-next,0/3] Support passing BPF iterator to kfuncs

Message ID 20240808232230.2848712-1-andrii@kernel.org (mailing list archive)
Headers show
Series Support passing BPF iterator to kfuncs | expand

Message

Andrii Nakryiko Aug. 8, 2024, 11:22 p.m. UTC
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(-)

Comments

patchwork-bot+netdevbpf@kernel.org Aug. 21, 2024, 5:50 p.m. UTC | #1
Hello:

This series was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@kernel.org>:

On Thu,  8 Aug 2024 16:22:27 -0700 you wrote:
> 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
> 
> [...]

Here is the summary with links:
  - [bpf-next,1/3] bpf: extract iterator argument type and name validation logic
    https://git.kernel.org/bpf/bpf-next/c/496ddd19a0fa
  - [bpf-next,2/3] bpf: allow passing struct bpf_iter_<type> as kfunc arguments
    https://git.kernel.org/bpf/bpf-next/c/baebe9aaba1e
  - [bpf-next,3/3] selftests/bpf: test passing iterator to a kfunc
    https://git.kernel.org/bpf/bpf-next/c/b0cd726f9a82

You are awesome, thank you!