Re: [RFC PATCH v3 04/12] netdev: support binding dma-buf to netdevice

2023-11-10 Thread Mina Almasry
On Fri, Nov 10, 2023 at 3:20 PM Jakub Kicinski wrote: > > On Sun, 5 Nov 2023 18:44:03 -0800 Mina Almasry wrote: > > --- a/include/linux/netdevice.h > > +++ b/include/linux/netdevice.h > > @@ -52,6 +52,8 @@ > > #include > > #include > > #include > > +#include > > +#include > > > > struct

Re: [RFC PATCH v3 04/12] netdev: support binding dma-buf to netdevice

2023-11-10 Thread Jakub Kicinski
On Sun, 5 Nov 2023 18:44:03 -0800 Mina Almasry wrote: > --- a/include/linux/netdevice.h > +++ b/include/linux/netdevice.h > @@ -52,6 +52,8 @@ > #include > #include > #include > +#include > +#include > > struct netpoll_info; > struct device; > @@ -808,6 +810,84 @@ bool

Re: [RFC PATCH v3 04/12] netdev: support binding dma-buf to netdevice

2023-11-10 Thread Yunsheng Lin
On 2023/11/10 10:59, Mina Almasry wrote: > On Thu, Nov 9, 2023 at 12:30 AM Paolo Abeni wrote: >> >> I'm trying to wrap my head around the whole infra... the above line is >> confusing. Why do you increment dma_addr? it will be re-initialized in >> the next iteration. >> > > That is just a

Re: [RFC PATCH v3 04/12] netdev: support binding dma-buf to netdevice

2023-11-10 Thread Mina Almasry
On Thu, Nov 9, 2023 at 11:38 PM Yunsheng Lin wrote: > > On 2023/11/10 10:59, Mina Almasry wrote: > > On Thu, Nov 9, 2023 at 12:30 AM Paolo Abeni wrote: > >> > >> I'm trying to wrap my head around the whole infra... the above line is > >> confusing. Why do you increment dma_addr? it will be

Re: [RFC PATCH v3 04/12] netdev: support binding dma-buf to netdevice

2023-11-09 Thread Mina Almasry
On Thu, Nov 9, 2023 at 12:30 AM Paolo Abeni wrote: > > I'm trying to wrap my head around the whole infra... the above line is > confusing. Why do you increment dma_addr? it will be re-initialized in > the next iteration. > That is just a mistake, sorry. Will remove this increment. On Thu, Nov

Re: [RFC PATCH v3 04/12] netdev: support binding dma-buf to netdevice

2023-11-09 Thread Yunsheng Lin
On 2023/11/9 10:22, Mina Almasry wrote: > On Tue, Nov 7, 2023 at 7:40 PM Yunsheng Lin wrote: >> >> On 2023/11/8 5:59, Mina Almasry wrote: >>> On Mon, Nov 6, 2023 at 11:46 PM Yunsheng Lin wrote: On 2023/11/6 10:44, Mina Almasry wrote: > + > +void

Re: [RFC PATCH v3 04/12] netdev: support binding dma-buf to netdevice

2023-11-09 Thread Paolo Abeni
On Sun, 2023-11-05 at 18:44 -0800, Mina Almasry wrote: [...] > +int netdev_bind_dmabuf(struct net_device *dev, unsigned int dmabuf_fd, > +struct netdev_dmabuf_binding **out) > +{ > + struct netdev_dmabuf_binding *binding; > + struct scatterlist *sg; > + struct

Re: [RFC PATCH v3 04/12] netdev: support binding dma-buf to netdevice

2023-11-08 Thread Mina Almasry
On Wed, Nov 8, 2023 at 3:47 PM David Wei wrote: > > On 2023-11-05 18:44, Mina Almasry wrote: > > Add a netdev_dmabuf_binding struct which represents the > > dma-buf-to-netdevice binding. The netlink API will bind the dma-buf to > > rx queues on the netdevice. On the binding, the dma_buf_attach >

Re: [RFC PATCH v3 04/12] netdev: support binding dma-buf to netdevice

2023-11-08 Thread Mina Almasry
On Tue, Nov 7, 2023 at 7:40 PM Yunsheng Lin wrote: > > On 2023/11/8 5:59, Mina Almasry wrote: > > On Mon, Nov 6, 2023 at 11:46 PM Yunsheng Lin wrote: > >> > >> On 2023/11/6 10:44, Mina Almasry wrote: > >>> + > >>> +void __netdev_devmem_binding_free(struct netdev_dmabuf_binding *binding) > >>> +{

Re: [RFC PATCH v3 04/12] netdev: support binding dma-buf to netdevice

2023-11-08 Thread David Wei
On 2023-11-05 18:44, Mina Almasry wrote: > Add a netdev_dmabuf_binding struct which represents the > dma-buf-to-netdevice binding. The netlink API will bind the dma-buf to > rx queues on the netdevice. On the binding, the dma_buf_attach > & dma_buf_map_attachment will occur. The entries in the

Re: [RFC PATCH v3 04/12] netdev: support binding dma-buf to netdevice

2023-11-07 Thread Yunsheng Lin
On 2023/11/8 5:59, Mina Almasry wrote: > On Mon, Nov 6, 2023 at 11:46 PM Yunsheng Lin wrote: >> >> On 2023/11/6 10:44, Mina Almasry wrote: >>> + >>> +void __netdev_devmem_binding_free(struct netdev_dmabuf_binding *binding) >>> +{ >>> + size_t size, avail; >>> + >>> +

Re: [RFC PATCH v3 04/12] netdev: support binding dma-buf to netdevice

2023-11-07 Thread Mina Almasry
On Mon, Nov 6, 2023 at 11:46 PM Yunsheng Lin wrote: > > On 2023/11/6 10:44, Mina Almasry wrote: > > + > > +void __netdev_devmem_binding_free(struct netdev_dmabuf_binding *binding) > > +{ > > + size_t size, avail; > > + > > + gen_pool_for_each_chunk(binding->chunk_pool, > > +

Re: [RFC PATCH v3 04/12] netdev: support binding dma-buf to netdevice

2023-11-06 Thread Yunsheng Lin
On 2023/11/6 10:44, Mina Almasry wrote: > + > +void __netdev_devmem_binding_free(struct netdev_dmabuf_binding *binding) > +{ > + size_t size, avail; > + > + gen_pool_for_each_chunk(binding->chunk_pool, > + netdev_devmem_free_chunk_owner, NULL); > + > + size

[RFC PATCH v3 04/12] netdev: support binding dma-buf to netdevice

2023-11-05 Thread Mina Almasry
Add a netdev_dmabuf_binding struct which represents the dma-buf-to-netdevice binding. The netlink API will bind the dma-buf to rx queues on the netdevice. On the binding, the dma_buf_attach & dma_buf_map_attachment will occur. The entries in the sg_table from mapping will be inserted into a