[RFC net-next v3 2/7] io_uring/zcrx: add support for custom DMA devices

Dragos Tatulea posted 7 patches 1 month, 2 weeks ago
There is a newer version of this series
[RFC net-next v3 2/7] io_uring/zcrx: add support for custom DMA devices
Posted by Dragos Tatulea 1 month, 2 weeks ago
Use the new API for getting a DMA device for a specific netdev queue.

This patch will allow io_uring zero-copy rx to work with devices
where the DMA device is not stored in the parent device. mlx5 SFs
are an example of such a device.

Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
---
 io_uring/zcrx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c
index e5ff49f3425e..319eddfd30e0 100644
--- a/io_uring/zcrx.c
+++ b/io_uring/zcrx.c
@@ -12,6 +12,7 @@
 #include <net/page_pool/helpers.h>
 #include <net/page_pool/memory_provider.h>
 #include <net/netlink.h>
+#include <net/netdev_queues.h>
 #include <net/netdev_rx_queue.h>
 #include <net/tcp.h>
 #include <net/rps.h>
@@ -599,7 +600,7 @@ int io_register_zcrx_ifq(struct io_ring_ctx *ctx,
 		goto err;
 	}
 
-	ifq->dev = ifq->netdev->dev.parent;
+	ifq->dev = netdev_queue_get_dma_dev(ifq->netdev, ifq->if_rxq);
 	if (!ifq->dev) {
 		ret = -EOPNOTSUPP;
 		goto err;
-- 
2.50.1
Re: [RFC net-next v3 2/7] io_uring/zcrx: add support for custom DMA devices
Posted by Pavel Begunkov 1 month, 2 weeks ago
On 8/15/25 12:03, Dragos Tatulea wrote:
> Use the new API for getting a DMA device for a specific netdev queue.
> 
> This patch will allow io_uring zero-copy rx to work with devices
> where the DMA device is not stored in the parent device. mlx5 SFs
> are an example of such a device.

Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>

It'll likely be fine for it to go to the net tree.

-- 
Pavel Begunkov
Re: [RFC net-next v3 2/7] io_uring/zcrx: add support for custom DMA devices
Posted by Mina Almasry 1 month, 2 weeks ago
On Fri, Aug 15, 2025 at 4:07 AM Dragos Tatulea <dtatulea@nvidia.com> wrote:
>
> Use the new API for getting a DMA device for a specific netdev queue.
>
> This patch will allow io_uring zero-copy rx to work with devices
> where the DMA device is not stored in the parent device. mlx5 SFs
> are an example of such a device.
>
> Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>

Looks like a straightforward change. FWIW,

Reviewed-by: Mina Almasry <almasrymina@google.com>

-- 
Thanks,
Mina