[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <gdrdgfsmn3gikjzdspe7cnwsd3dw4dgo2uds6amfqnxlhzedxe@wkewgyhn2t6b>
Date: Sat, 16 Aug 2025 08:55:16 +0000
From: Dragos Tatulea <dtatulea@...dia.com>
To: Mina Almasry <almasrymina@...gle.com>
Cc: asml.silence@...il.com, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>, cratiu@...dia.com,
tariqt@...dia.com, parav@...dia.com, Christoph Hellwig <hch@...radead.org>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC net-next v3 1/7] queue_api: add support for fetching per
queue DMA dev
On Fri, Aug 15, 2025 at 11:11:01AM -0700, Mina Almasry wrote:
> On Fri, Aug 15, 2025 at 4:07 AM Dragos Tatulea <dtatulea@...dia.com> wrote:
> >
> > For zerocopy (io_uring, devmem), there is an assumption that the
> > parent device can do DMA. However that is not always the case:
> > - Scalable Function netdevs [1] have the DMA device in the grandparent.
> > - For Multi-PF netdevs [2] queues can be associated to different DMA
> > devices.
> >
> > This patch introduces the a queue based interface for allowing drivers
> > to expose a different DMA device for zerocopy.
> >
> > [1] Documentation/networking/device_drivers/ethernet/mellanox/mlx5/switchdev.rst
> > [2] Documentation/networking/multi-pf-netdev.rst
> >
> > Signed-off-by: Dragos Tatulea <dtatulea@...dia.com>
> > ---
> > include/net/netdev_queues.h | 20 ++++++++++++++++++++
> > 1 file changed, 20 insertions(+)
> >
> > diff --git a/include/net/netdev_queues.h b/include/net/netdev_queues.h
> > index 6e835972abd1..d4d8c42b809f 100644
> > --- a/include/net/netdev_queues.h
> > +++ b/include/net/netdev_queues.h
> > @@ -127,6 +127,10 @@ void netdev_stat_queue_sum(struct net_device *netdev,
> > * @ndo_queue_stop: Stop the RX queue at the specified index. The stopped
> > * queue's memory is written at the specified address.
> > *
> > + * @ndo_queue_get_dma_dev: Get dma device for zero-copy operations to be used
>
> I'm wondering a bit why this dma-dev issue exists for memory providers
> but not for the dma-dev used by the page_pool itself.
>
> I'm guessing because the pp uses the dev in page_pool_params->dev
> while I implemented the memory provider stuff to completely ignore
> pp_params->dev and use its own device (sorry...).
>
AFAIU rightly so. The page_pool is created at a later stage.
> We may want to extend your work so that the pp also ignores
> pp_params.dev and uses the device returned by the queue API if it's
> provided by the driver. But there is no upside to doing things this
> way except for some consistency, so I think I'm complicating things
> for no reason.
>
The drivers are setting the pp_params.dev though, so no need for a queue
API call. Or maybe I misunderstood your point?
> I think this looks good to me. With the helper moved to a .c file as
> Jakub requested I can Reviewed-by.
>
Will do.
Thanks,
Dragos
Powered by blists - more mailing lists