Re: [PATCH v5 bpf-next 1/3] bpf: Add kmem_cache iterator

From: Alexei Starovoitov
Date: Fri Oct 11 2024 - 14:44:49 EST


On Thu, Oct 10, 2024 at 4:25 PM Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
>
> +struct bpf_iter__kmem_cache {
> + __bpf_md_ptr(struct bpf_iter_meta *, meta);
> + __bpf_md_ptr(struct kmem_cache *, s);
> +};

Just noticed this.
Not your fault. You're copy pasting from bpf_iter__*.
It looks like tech debt.

Andrii, Song,

do you remember why all iters are using this?
__bpf_md_ptr() wrap was necessary in uapi/bpf.h,
but this is kernel iters that go into vmlinux.h
It should be fine to remove them all and
progs wouldn't need to do the ugly dance of:

#define bpf_iter__ksym bpf_iter__ksym___not_used
#include "vmlinux.h"
#undef bpf_iter__ksym