Message ID | 20230822050558.2937659-2-davemarchevsky@fb.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | BPF |
Headers | show |
Series | Open-coded task_vma iter | expand |
On Mon, Aug 21, 2023 at 10:06 PM Dave Marchevsky <davemarchevsky@fb.com> wrote: > > Commit 6018e1f407cc ("bpf: implement numbers iterator") added the > BTF_TYPE_EMIT line that this patch is modifying. The struct btf_iter_num > doesn't exist, so only a forward declaration is emitted in BTF: > > FWD 'btf_iter_num' fwd_kind=struct > > That commit was probably hoping to ensure that struct bpf_iter_num is > emitted in vmlinux BTF. A previous version of this patch changed the > line to emit the correct type, but Yonghong confirmed that it would > definitely be emitted regardless in [0], so this patch simply removes > the line. > > This isn't marked "Fixes" because the extraneous btf_iter_num FWD wasn't > causing any issues that I noticed, aside from mild confusion when I > looked through the code. > > [0]: https://lore.kernel.org/bpf/25d08207-43e6-36a8-5e0f-47a913d4cda5@linux.dev/ > > Signed-off-by: Dave Marchevsky <davemarchevsky@fb.com> > Acked-by: Yonghong Song <yonghong.song@linux.dev> > --- > kernel/bpf/bpf_iter.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/kernel/bpf/bpf_iter.c b/kernel/bpf/bpf_iter.c > index 96856f130cbf..833faa04461b 100644 > --- a/kernel/bpf/bpf_iter.c > +++ b/kernel/bpf/bpf_iter.c > @@ -793,8 +793,6 @@ __bpf_kfunc int bpf_iter_num_new(struct bpf_iter_num *it, int start, int end) > BUILD_BUG_ON(sizeof(struct bpf_iter_num_kern) != sizeof(struct bpf_iter_num)); > BUILD_BUG_ON(__alignof__(struct bpf_iter_num_kern) != __alignof__(struct bpf_iter_num)); > > - BTF_TYPE_EMIT(struct btf_iter_num); > - heh, hard to notice this typo... I think I needed it for the version of patch set before the switch to kfunc, so yeah, we don't need it anymore, thanks! Acked-by: Andrii Nakryiko <andrii@kernel.org> > /* start == end is legit, it's an empty range and we'll just get NULL > * on first (and any subsequent) bpf_iter_num_next() call > */ > -- > 2.34.1 >
diff --git a/kernel/bpf/bpf_iter.c b/kernel/bpf/bpf_iter.c index 96856f130cbf..833faa04461b 100644 --- a/kernel/bpf/bpf_iter.c +++ b/kernel/bpf/bpf_iter.c @@ -793,8 +793,6 @@ __bpf_kfunc int bpf_iter_num_new(struct bpf_iter_num *it, int start, int end) BUILD_BUG_ON(sizeof(struct bpf_iter_num_kern) != sizeof(struct bpf_iter_num)); BUILD_BUG_ON(__alignof__(struct bpf_iter_num_kern) != __alignof__(struct bpf_iter_num)); - BTF_TYPE_EMIT(struct btf_iter_num); - /* start == end is legit, it's an empty range and we'll just get NULL * on first (and any subsequent) bpf_iter_num_next() call */