Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-13 Thread Jakub Kicinski
On Tue, 13 Aug 2024 16:11:15 +0100 Pavel Begunkov wrote: > On 8/13/24 15:39, Jakub Kicinski wrote: > > On Tue, 13 Aug 2024 03:31:13 +0100 Pavel Begunkov wrote: > >> I'm getting lost, so repeating myself a bit. What I think > >> would be a good approach is if we get an error back from > >> the dri

Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-13 Thread Pavel Begunkov
On 8/13/24 15:39, Jakub Kicinski wrote: On Tue, 13 Aug 2024 03:31:13 +0100 Pavel Begunkov wrote: I'm getting lost, so repeating myself a bit. What I think would be a good approach is if we get an error back from the driver if it doesn't support netiov / providers. netdev_rx_queue_restart() {

Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-13 Thread Jakub Kicinski
On Tue, 13 Aug 2024 03:31:13 +0100 Pavel Begunkov wrote: > I'm getting lost, so repeating myself a bit. What I think > would be a good approach is if we get an error back from > the driver if it doesn't support netiov / providers. > > netdev_rx_queue_restart() { > ... > err = dev->queu

Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-13 Thread Jakub Kicinski
On Tue, 13 Aug 2024 04:39:47 -0400 Mina Almasry wrote: > On Mon, Aug 12, 2024 at 8:15 PM Jakub Kicinski wrote: > > BTW, Mina, the core should probably also check that XDP isn't installed > > before / while the netmem is bound to a queue. > > Sorry if noob question, but what is the proper check

Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-13 Thread Mina Almasry
On Tue, Aug 13, 2024 at 4:39 AM Mina Almasry wrote: > > On Mon, Aug 12, 2024 at 8:15 PM Jakub Kicinski wrote: > > BTW, Mina, the core should probably also check that XDP isn't installed > > before / while the netmem is bound to a queue. > > Sorry if noob question, but what is the proper check for

Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-13 Thread Mina Almasry
On Mon, Aug 12, 2024 at 8:15 PM Jakub Kicinski wrote: > BTW, Mina, the core should probably also check that XDP isn't installed > before / while the netmem is bound to a queue. Sorry if noob question, but what is the proper check for this? I tried adding this to net_devmem_bind_dmabuf_to_queue():

Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-12 Thread Pavel Begunkov
On 8/13/24 00:57, Jakub Kicinski wrote: On Mon, 12 Aug 2024 20:10:39 +0100 Pavel Begunkov wrote: 1. Drivers need to be able to say "I support unreadable netmem". Failure to report unreadable netmem support should cause the netlink API to fail when the user tries to bind dmabuf/io uring memory.

Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-12 Thread Pavel Begunkov
On 8/13/24 01:15, Jakub Kicinski wrote: On Mon, 12 Aug 2024 20:04:41 +0100 Pavel Begunkov wrote: Also don't see the upside of the explicit "non-capable" flag, but I haven't thought of that. Is there any use? Or maybe I don't get what you're asking, I explained why to have that "PP_IGNORE_PROVI

Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-12 Thread Jakub Kicinski
On Mon, 12 Aug 2024 20:04:41 +0100 Pavel Begunkov wrote: > >> Also don't see the upside of the explicit "non-capable" flag, > >> but I haven't thought of that. Is there any use? > > Or maybe I don't get what you're asking, I explained > why to have that "PP_IGNORE_PROVIDERS" on top of the flag >

Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-12 Thread Jakub Kicinski
On Mon, 12 Aug 2024 20:10:39 +0100 Pavel Begunkov wrote: > > 1. Drivers need to be able to say "I support unreadable netmem". > > Failure to report unreadable netmem support should cause the netlink > > API to fail when the user tries to bind dmabuf/io uring memory. > > > > 2. Drivers need to be a

Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-12 Thread Pavel Begunkov
On 8/12/24 19:55, Mina Almasry wrote: On Mon, Aug 12, 2024 at 1:57 PM Jakub Kicinski wrote: On Sun, 11 Aug 2024 22:51:13 +0100 Pavel Begunkov wrote: I think we're talking about 2 slightly different flags, AFAIU.> Pavel and I are suggesting the driver reports "I support memory providers" direc

Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-12 Thread Pavel Begunkov
On 8/12/24 19:57, Pavel Begunkov wrote: On 8/12/24 18:57, Jakub Kicinski wrote: On Sun, 11 Aug 2024 22:51:13 +0100 Pavel Begunkov wrote: I think we're talking about 2 slightly different flags, AFAIU.> Pavel and I are suggesting the driver reports "I support memory providers" directly to core (v

Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-12 Thread Pavel Begunkov
On 8/12/24 18:57, Jakub Kicinski wrote: On Sun, 11 Aug 2024 22:51:13 +0100 Pavel Begunkov wrote: I think we're talking about 2 slightly different flags, AFAIU.> Pavel and I are suggesting the driver reports "I support memory providers" directly to core (via the queue-api or what not), and we che

Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-12 Thread Mina Almasry
On Mon, Aug 12, 2024 at 1:57 PM Jakub Kicinski wrote: > > On Sun, 11 Aug 2024 22:51:13 +0100 Pavel Begunkov wrote: > > > I think we're talking about 2 slightly different flags, AFAIU.> > > > Pavel and I are suggesting the driver reports "I support memory > > > providers" directly to core (via the

Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-12 Thread Jakub Kicinski
On Sun, 11 Aug 2024 22:51:13 +0100 Pavel Begunkov wrote: > > I think we're talking about 2 slightly different flags, AFAIU.> > > Pavel and I are suggesting the driver reports "I support memory > > providers" directly to core (via the queue-api or what not), and we > > check that flag directly in ne

Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-11 Thread Pavel Begunkov
On 8/11/24 03:21, Mina Almasry wrote: On Fri, Aug 9, 2024 at 11:52 PM Jakub Kicinski wrote: On Fri, 9 Aug 2024 16:45:50 +0100 Pavel Begunkov wrote: I think this is good, and it doesn't seem hacky to me, because we can check the page_pools of the netdev while we hold rtnl, so we can be sure no

Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-10 Thread Mina Almasry
On Fri, Aug 9, 2024 at 11:52 PM Jakub Kicinski wrote: > > On Fri, 9 Aug 2024 16:45:50 +0100 Pavel Begunkov wrote: > > > I think this is good, and it doesn't seem hacky to me, because we can > > > check the page_pools of the netdev while we hold rtnl, so we can be > > > sure nothing is messing with

Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-09 Thread Jakub Kicinski
On Fri, 9 Aug 2024 16:45:50 +0100 Pavel Begunkov wrote: > > I think this is good, and it doesn't seem hacky to me, because we can > > check the page_pools of the netdev while we hold rtnl, so we can be > > sure nothing is messing with the pp configuration in the meantime. > > Like you say below it

Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-09 Thread Pavel Begunkov
On 8/9/24 15:10, Mina Almasry wrote: On Thu, Aug 8, 2024 at 10:24 PM Jakub Kicinski wrote: On Thu, 8 Aug 2024 16:36:24 -0400 Mina Almasry wrote: How do you know that the driver: - supports net_iov at all (let's not make implicit assumptions based on presence of queue API); - supports

Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-09 Thread Mina Almasry
On Thu, Aug 8, 2024 at 10:24 PM Jakub Kicinski wrote: > > On Thu, 8 Aug 2024 16:36:24 -0400 Mina Almasry wrote: > > > How do you know that the driver: > > > - supports net_iov at all (let's not make implicit assumptions based > > >on presence of queue API); > > > - supports net_iov in curren

Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-08 Thread Jakub Kicinski
On Thu, 8 Aug 2024 16:36:24 -0400 Mina Almasry wrote: > > How do you know that the driver: > > - supports net_iov at all (let's not make implicit assumptions based > >on presence of queue API); > > - supports net_iov in current configuration (eg header-data split is > >enabled) > > - sup

Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-08 Thread Mina Almasry
On Tue, Aug 6, 2024 at 4:59 PM Jakub Kicinski wrote: > ... > On Mon, 5 Aug 2024 21:25:20 + Mina Almasry wrote: > > + if (pool->p.queue) { > > + /* We rely on rtnl_lock()ing to make sure netdev_rx_queue > > + * configuration doesn't change while we're initializing

Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-06 Thread Jakub Kicinski
On Mon, 5 Aug 2024 21:25:20 + Mina Almasry wrote: > + if (pool->p.queue) { > + /* We rely on rtnl_lock()ing to make sure netdev_rx_queue > + * configuration doesn't change while we're initializing the > + * page_pool. > + */ > +

[PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-05 Thread Mina Almasry
Implement a memory provider that allocates dmabuf devmem in the form of net_iov. The provider receives a reference to the struct netdev_dmabuf_binding via the pool->mp_priv pointer. The driver needs to set this pointer for the provider in the net_iov. The provider obtains a reference on the netde