public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC net-next 0/4] devmem/io_uring: Allow devices without parent PCI device
@ 2025-07-02 17:24 Dragos Tatulea
  2025-07-02 17:24 ` [RFC net-next 2/4] io_uring/zcrx: Use the new netdev_get_dma_dev() API Dragos Tatulea
  0 siblings, 1 reply; 2+ messages in thread
From: Dragos Tatulea @ 2025-07-02 17:24 UTC (permalink / raw)
  To: almasrymina, asml.silence, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Andrew Lunn,
	Jens Axboe, Saeed Mahameed, Tariq Toukan, Leon Romanovsky
  Cc: Dragos Tatulea, cratiu, netdev, linux-kernel, io-uring,
	linux-rdma

The io_uring and devmem code is assuming that the parent device of the
netdev is a DMA capable device. This is not always the case.

Some devices do have a DMA capable device that can be used, but not as
parent: mlx5 SFs have an auxdev as parent, but they do have an
associated PCI device.

Also, if DMA is not supported the operation should be blocked. Otherwise
the mapping will return success with 0 mapped entries and the caller
will consider the mapping as succesful.

This RFC is supposed to start the discussion on the best way to:
- Block the binding operation early if not supported.
- Allow devices that support this usecase but don't have a
  parent device as a PCI device.

Dragos Tatulea (4):
  net: Allow non parent devices to be used for ZC DMA
  io_uring/zcrx: Use the new netdev_get_dma_dev() API
  net: devmem: Use the new netdev_get_dma_dev() API
  net/mlx5e: Enable HDS zerocopy flows for SFs

 drivers/net/ethernet/mellanox/mlx5/core/en_main.c |  3 +++
 include/linux/netdevice.h                         | 13 +++++++++++++
 io_uring/zcrx.c                                   |  2 +-
 net/core/devmem.c                                 | 10 +++++++++-
 4 files changed, 26 insertions(+), 2 deletions(-)

-- 
2.50.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [RFC net-next 2/4] io_uring/zcrx: Use the new netdev_get_dma_dev() API
  2025-07-02 17:24 [RFC net-next 0/4] devmem/io_uring: Allow devices without parent PCI device Dragos Tatulea
@ 2025-07-02 17:24 ` Dragos Tatulea
  0 siblings, 0 replies; 2+ messages in thread
From: Dragos Tatulea @ 2025-07-02 17:24 UTC (permalink / raw)
  To: almasrymina, asml.silence, Jens Axboe
  Cc: Dragos Tatulea, Saeed Mahameed, tariqt, cratiu, io-uring,
	linux-kernel

Using the new DMA dev helper API, there will be an early failure if the
device does not support DMA.

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

diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c
index 797247a34cb7..93462e5b2207 100644
--- a/io_uring/zcrx.c
+++ b/io_uring/zcrx.c
@@ -584,7 +584,7 @@ int io_register_zcrx_ifq(struct io_ring_ctx *ctx,
 		goto err;
 	}
 
-	ifq->dev = ifq->netdev->dev.parent;
+	ifq->dev = netdev_get_dma_dev(ifq->netdev);
 	if (!ifq->dev) {
 		ret = -EOPNOTSUPP;
 		goto err;
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-02 17:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-02 17:24 [RFC net-next 0/4] devmem/io_uring: Allow devices without parent PCI device Dragos Tatulea
2025-07-02 17:24 ` [RFC net-next 2/4] io_uring/zcrx: Use the new netdev_get_dma_dev() API Dragos Tatulea

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox