* [RFC net-next v3 0/7] devmem/io_uring: allow more flexibility for ZC DMA devices
@ 2025-08-15 11:03 Dragos Tatulea
2025-08-15 11:03 ` [RFC net-next v3 2/7] io_uring/zcrx: add support for custom " Dragos Tatulea
2025-08-15 15:31 ` [RFC net-next v3 0/7] devmem/io_uring: allow more flexibility for ZC " Stanislav Fomichev
0 siblings, 2 replies; 6+ messages in thread
From: Dragos Tatulea @ 2025-08-15 11:03 UTC (permalink / raw)
To: almasrymina, asml.silence, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Jens Axboe,
Saeed Mahameed, Tariq Toukan, Mark Bloch, Leon Romanovsky,
Andrew Lunn
Cc: Dragos Tatulea, cratiu, parav, Christoph Hellwig, netdev,
linux-kernel, io-uring, linux-rdma
For TCP zerocopy rx (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.
The series adds an API for getting the DMA device for a netdev queue.
Drivers that have special requirements can implement the newly added
queue management op. Otherwise the parent will still be used as before.
This series continues with switching to this API for io_uring zcrx and
devmem and adds a ndo_queue_dma_dev op for mlx5.
The last part of the series changes devmem rx bind to get the DMA device
per queue and blocks the case when multiple queues use different DMA
devices. The tx bind is left as is.
[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>
----
Changes sice v2 [3]:
- Downgraded to RFC status until consensus is reached.
- Implemented more generic approach as discussed during
v2 review.
- Refactor devmem to get DMA device for multiple rx queues for
multi PF netdev support.
- Renamed series with a more generic name.
Changes since v1 [2]:
- Dropped the Fixes tag.
- Added more documentation as requeseted.
- Renamed the patch title to better reflect its purpose.
Changes since RFC [1]:
- Upgraded from RFC status.
- Dropped driver specific bits for generic solution.
- Implemented single patch as a fix as requested in RFC.
- Handling of multi-PF netdevs will be handled in a subsequent patch
series.
[1] RFC: https://lore.kernel.org/all/20250702172433.1738947-2-dtatulea@nvidia.com/
[2] v1: https://lore.kernel.org/all/20250709124059.516095-2-dtatulea@nvidia.com/
[3] v2: https://lore.kernel.org/all/20250711092634.2733340-2-dtatulea@nvidia.com/
---
Dragos Tatulea (7):
queue_api: add support for fetching per queue DMA dev
io_uring/zcrx: add support for custom DMA devices
net: devmem: get netdev DMA device via new API
net/mlx5e: add op for getting netdev DMA device
net: devmem: pull out dma_dev out of net_devmem_bind_dmabuf
net: devmem: pre-read requested rx queues during bind
net: devmem: allow binding on rx queues with same MA devices
.../net/ethernet/mellanox/mlx5/core/en_main.c | 24 ++++
include/net/netdev_queues.h | 20 ++++
io_uring/zcrx.c | 3 +-
net/core/devmem.c | 8 +-
net/core/devmem.h | 2 +
net/core/netdev-genl.c | 113 +++++++++++++-----
6 files changed, 137 insertions(+), 33 deletions(-)
--
2.50.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [RFC net-next v3 2/7] io_uring/zcrx: add support for custom DMA devices
2025-08-15 11:03 [RFC net-next v3 0/7] devmem/io_uring: allow more flexibility for ZC DMA devices Dragos Tatulea
@ 2025-08-15 11:03 ` Dragos Tatulea
2025-08-18 18:16 ` Mina Almasry
2025-08-19 16:04 ` Pavel Begunkov
2025-08-15 15:31 ` [RFC net-next v3 0/7] devmem/io_uring: allow more flexibility for ZC " Stanislav Fomichev
1 sibling, 2 replies; 6+ messages in thread
From: Dragos Tatulea @ 2025-08-15 11:03 UTC (permalink / raw)
To: almasrymina, asml.silence, Jens Axboe
Cc: Dragos Tatulea, cratiu, tariqt, parav, Christoph Hellwig,
io-uring, linux-kernel
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [RFC net-next v3 2/7] io_uring/zcrx: add support for custom DMA devices
2025-08-15 11:03 ` [RFC net-next v3 2/7] io_uring/zcrx: add support for custom " Dragos Tatulea
@ 2025-08-18 18:16 ` Mina Almasry
2025-08-19 16:04 ` Pavel Begunkov
1 sibling, 0 replies; 6+ messages in thread
From: Mina Almasry @ 2025-08-18 18:16 UTC (permalink / raw)
To: Dragos Tatulea
Cc: asml.silence, Jens Axboe, cratiu, tariqt, parav,
Christoph Hellwig, io-uring, linux-kernel
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC net-next v3 2/7] io_uring/zcrx: add support for custom DMA devices
2025-08-15 11:03 ` [RFC net-next v3 2/7] io_uring/zcrx: add support for custom " Dragos Tatulea
2025-08-18 18:16 ` Mina Almasry
@ 2025-08-19 16:04 ` Pavel Begunkov
1 sibling, 0 replies; 6+ messages in thread
From: Pavel Begunkov @ 2025-08-19 16:04 UTC (permalink / raw)
To: Dragos Tatulea, almasrymina, Jens Axboe
Cc: cratiu, tariqt, parav, Christoph Hellwig, io-uring, linux-kernel
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC net-next v3 0/7] devmem/io_uring: allow more flexibility for ZC DMA devices
2025-08-15 11:03 [RFC net-next v3 0/7] devmem/io_uring: allow more flexibility for ZC DMA devices Dragos Tatulea
2025-08-15 11:03 ` [RFC net-next v3 2/7] io_uring/zcrx: add support for custom " Dragos Tatulea
@ 2025-08-15 15:31 ` Stanislav Fomichev
2025-08-15 15:48 ` Dragos Tatulea
1 sibling, 1 reply; 6+ messages in thread
From: Stanislav Fomichev @ 2025-08-15 15:31 UTC (permalink / raw)
To: Dragos Tatulea
Cc: almasrymina, asml.silence, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Jens Axboe,
Saeed Mahameed, Tariq Toukan, Mark Bloch, Leon Romanovsky,
Andrew Lunn, cratiu, parav, Christoph Hellwig, netdev,
linux-kernel, io-uring, linux-rdma
On 08/15, Dragos Tatulea wrote:
> For TCP zerocopy rx (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.
>
> The series adds an API for getting the DMA device for a netdev queue.
> Drivers that have special requirements can implement the newly added
> queue management op. Otherwise the parent will still be used as before.
>
> This series continues with switching to this API for io_uring zcrx and
> devmem and adds a ndo_queue_dma_dev op for mlx5.
>
> The last part of the series changes devmem rx bind to get the DMA device
> per queue and blocks the case when multiple queues use different DMA
> devices. The tx bind is left as is.
>
> [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>
>
> ----
> Changes sice v2 [3]:
> - Downgraded to RFC status until consensus is reached.
> - Implemented more generic approach as discussed during
> v2 review.
> - Refactor devmem to get DMA device for multiple rx queues for
> multi PF netdev support.
> - Renamed series with a more generic name.
>
> Changes since v1 [2]:
> - Dropped the Fixes tag.
> - Added more documentation as requeseted.
> - Renamed the patch title to better reflect its purpose.
>
> Changes since RFC [1]:
> - Upgraded from RFC status.
> - Dropped driver specific bits for generic solution.
> - Implemented single patch as a fix as requested in RFC.
> - Handling of multi-PF netdevs will be handled in a subsequent patch
> series.
>
> [1] RFC: https://lore.kernel.org/all/20250702172433.1738947-2-dtatulea@nvidia.com/
> [2] v1: https://lore.kernel.org/all/20250709124059.516095-2-dtatulea@nvidia.com/
> [3] v2: https://lore.kernel.org/all/20250711092634.2733340-2-dtatulea@nvidia.com/
> ---
> Dragos Tatulea (7):
> queue_api: add support for fetching per queue DMA dev
[..]
> io_uring/zcrx: add support for custom DMA devices
Did something happen to 2/7? I don't see it in my mailbox and in the
lore..
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC net-next v3 0/7] devmem/io_uring: allow more flexibility for ZC DMA devices
2025-08-15 15:31 ` [RFC net-next v3 0/7] devmem/io_uring: allow more flexibility for ZC " Stanislav Fomichev
@ 2025-08-15 15:48 ` Dragos Tatulea
0 siblings, 0 replies; 6+ messages in thread
From: Dragos Tatulea @ 2025-08-15 15:48 UTC (permalink / raw)
To: Stanislav Fomichev
Cc: almasrymina, asml.silence, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Jens Axboe,
Saeed Mahameed, Tariq Toukan, Mark Bloch, Leon Romanovsky,
Andrew Lunn, cratiu, parav, Christoph Hellwig, netdev,
linux-kernel, io-uring, linux-rdma
On Fri, Aug 15, 2025 at 08:31:05AM -0700, Stanislav Fomichev wrote:
> On 08/15, Dragos Tatulea wrote:
> > For TCP zerocopy rx (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.
> >
> > The series adds an API for getting the DMA device for a netdev queue.
> > Drivers that have special requirements can implement the newly added
> > queue management op. Otherwise the parent will still be used as before.
> >
> > This series continues with switching to this API for io_uring zcrx and
> > devmem and adds a ndo_queue_dma_dev op for mlx5.
> >
> > The last part of the series changes devmem rx bind to get the DMA device
> > per queue and blocks the case when multiple queues use different DMA
> > devices. The tx bind is left as is.
> >
> > [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>
> >
> > ----
> > Changes sice v2 [3]:
> > - Downgraded to RFC status until consensus is reached.
> > - Implemented more generic approach as discussed during
> > v2 review.
> > - Refactor devmem to get DMA device for multiple rx queues for
> > multi PF netdev support.
> > - Renamed series with a more generic name.
> >
> > Changes since v1 [2]:
> > - Dropped the Fixes tag.
> > - Added more documentation as requeseted.
> > - Renamed the patch title to better reflect its purpose.
> >
> > Changes since RFC [1]:
> > - Upgraded from RFC status.
> > - Dropped driver specific bits for generic solution.
> > - Implemented single patch as a fix as requested in RFC.
> > - Handling of multi-PF netdevs will be handled in a subsequent patch
> > series.
> >
> > [1] RFC: https://lore.kernel.org/all/20250702172433.1738947-2-dtatulea@nvidia.com/
> > [2] v1: https://lore.kernel.org/all/20250709124059.516095-2-dtatulea@nvidia.com/
> > [3] v2: https://lore.kernel.org/all/20250711092634.2733340-2-dtatulea@nvidia.com/
> > ---
> > Dragos Tatulea (7):
> > queue_api: add support for fetching per queue DMA dev
>
> [..]
>
> > io_uring/zcrx: add support for custom DMA devices
>
> Did something happen to 2/7? I don't see it in my mailbox and in the
> lore..
I see it in lore:
https://lore.kernel.org/all/20250815110401.2254214-4-dtatulea@nvidia.com
But it seems to have been sent to io-uring ml only and since you were
not CC'ed, I guess it never reached your inbox... I should have
explicitly CC'ed netdev instead of relying on get_maintainers.pl. Will
do it next time.
Thanks,
Dragos
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-08-19 16:03 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-15 11:03 [RFC net-next v3 0/7] devmem/io_uring: allow more flexibility for ZC DMA devices Dragos Tatulea
2025-08-15 11:03 ` [RFC net-next v3 2/7] io_uring/zcrx: add support for custom " Dragos Tatulea
2025-08-18 18:16 ` Mina Almasry
2025-08-19 16:04 ` Pavel Begunkov
2025-08-15 15:31 ` [RFC net-next v3 0/7] devmem/io_uring: allow more flexibility for ZC " Stanislav Fomichev
2025-08-15 15:48 ` Dragos Tatulea
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox