[PATCH 2/4] bpf: Add dmabuf iterator

Alexei Starovoitov alexei.starovoitov at gmail.com
Mon Apr 21 23:38:59 UTC 2025


On Mon, Apr 21, 2025 at 1:40 PM T.J. Mercier <tjmercier at google.com> wrote:
>
> > > new file mode 100644
> > > index 000000000000..b4b8be1d6aa4
> > > --- /dev/null
> > > +++ b/kernel/bpf/dmabuf_iter.c
> >
> > Maybe we should add this file to drivers/dma-buf. I would like to
> > hear other folks thoughts on this.
>
> This is fine with me, and would save us the extra
> CONFIG_DMA_SHARED_BUFFER check that's currently needed in
> kernel/bpf/Makefile but would require checking CONFIG_BPF instead.
> Sumit / Christian any objections to moving the dmabuf bpf iterator
> implementation into drivers/dma-buf?

The driver directory would need to 'depends on BPF_SYSCALL'.
Are you sure you want this?
imo kernel/bpf/ is fine for this.

You also probably want
.feature                = BPF_ITER_RESCHED
in bpf_dmabuf_reg_info.

Also have you considered open coded iterator for dmabufs?
Would it help with the interface to user space?


More information about the dri-devel mailing list