Re: [RFC net-next v3 1/7] queue_api: add support for fetching per queue DMA dev
From: Mina Almasry <hidden>
Date: 2025-08-15 18:11:15
Also in:
lkml
On Fri, Aug 15, 2025 at 4:07 AM Dragos Tatulea [off-list ref] wrote:
quoted hunk ↗ jump to hunk
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@nvidia.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...). 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. I think this looks good to me. With the helper moved to a .c file as Jakub requested I can Reviewed-by. -- Thanks, Mina