linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v5 0/7] devmem/io_uring: allow more flexibility for ZC DMA devices
@ 2025-08-25  6:36 Dragos Tatulea
  2025-08-25  6:36 ` [PATCH net-next v5 1/7] queue_api: add support for fetching per queue DMA dev Dragos Tatulea
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Dragos Tatulea @ 2025-08-25  6:36 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, netdev, sdf, 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 v4 [5]:
- Dropped EXPORT_SYMBOL of netdev_queue_get_dma_dev() (patch 1).
- Fixed nits, typos and line length issues.

Changes sice v3 [4]:
- Moved ndo_queue_get_dma_dev() from header to own file (patch 1).
- Used rel_num_rx_queues for queue bitmap (patch 6).
- Allocate zeroed bitmap (patch 6).
- Validate queue index (patch 6).
- Dropped rxq_dma_dev check (patch 7).
- Fixed incorrect handling of extack message on bad dma dev (patch 7).
- Added conflicting queues in error message (patch 7).
- Dropped RFC status as feedback was mostly positive.

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/
[4]  v3: https://lore.kernel.org/all/20250815110401.2254214-2-dtatulea@nvidia.com/
[5]  v4: https://lore.kernel.org/all/20250820171214.3597901-1-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 DMA devices

 .../net/ethernet/mellanox/mlx5/core/en_main.c |  24 ++++
 include/net/netdev_queues.h                   |   7 +
 io_uring/zcrx.c                               |   3 +-
 net/core/Makefile                             |   1 +
 net/core/devmem.c                             |   8 +-
 net/core/devmem.h                             |   2 +
 net/core/netdev-genl.c                        | 120 +++++++++++++-----
 net/core/netdev_queues.c                      |  27 ++++
 8 files changed, 161 insertions(+), 31 deletions(-)
 create mode 100644 net/core/netdev_queues.c

-- 
2.50.1


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

end of thread, other threads:[~2025-08-27 14:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-25  6:36 [PATCH net-next v5 0/7] devmem/io_uring: allow more flexibility for ZC DMA devices Dragos Tatulea
2025-08-25  6:36 ` [PATCH net-next v5 1/7] queue_api: add support for fetching per queue DMA dev Dragos Tatulea
2025-08-25  6:36 ` [PATCH net-next v5 2/7] io_uring/zcrx: add support for custom DMA devices Dragos Tatulea
2025-08-25  6:36 ` [PATCH net-next v5 3/7] net: devmem: get netdev DMA device via new API Dragos Tatulea
2025-08-25  6:36 ` [PATCH net-next v5 4/7] net/mlx5e: add op for getting netdev DMA device Dragos Tatulea
2025-08-25  6:36 ` [PATCH net-next v5 5/7] net: devmem: pull out dma_dev out of net_devmem_bind_dmabuf Dragos Tatulea
2025-08-25  6:36 ` [PATCH net-next v5 6/7] net: devmem: pre-read requested rx queues during bind Dragos Tatulea
2025-08-27  0:33   ` Jakub Kicinski
2025-08-27 14:34     ` Dragos Tatulea
2025-08-25  6:36 ` [PATCH net-next v5 7/7] net: devmem: allow binding on rx queues with same DMA devices Dragos Tatulea

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).