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