Re: [PATCH bpf-next v3 02/21] bpf: allow loading of a bpf_iter program

Andrii Nakryiko
2020-05-08T18:21:01Z

On Wed, May 6, 2020 at 10:40 PM Yonghong Song <yhs@fb.com> wrote:
>
> A bpf_iter program is a tracing program with attach type
> BPF_TRACE_ITER. The load attribute
> attach_btf_id
> is used by the verifier against a particular kernel function,
> which represents a target, e.g., __bpf_iter__bpf_map
> for target bpf_map which is implemented later.
>
> The program return value must be 0 or 1 for now.
> 0 : successful, except potential seq_file buffer overflow
> which is handled by seq_file reader.
> 1 : request to restart the same object
>
> In the future, other return values may be used for filtering or
> teminating the iterator.
>
> Signed-off-by: Yonghong Song <yhs@fb.com>
> ---

Looks good.

Acked-by: Andrii Nakryiko <andriin@fb.com>

> include/linux/bpf.h | 3 +++
> include/uapi/linux/bpf.h | 1 +
> kernel/bpf/bpf_iter.c | 36 ++++++++++++++++++++++++++++++++++
> kernel/bpf/verifier.c | 21 ++++++++++++++++++++
> tools/include/uapi/linux/bpf.h | 1 +
> 5 files changed, 62 insertions(+)
> …