Skip to content

devmem/io_uring: allow more flexibility for ZC DMA devices

Dragos Tatulea io-uring linux-rdma lkml netdev 4 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest7 patches 0 repliesApplied 7/7
  2. v57 patches 2 repliesSuperseded
  3. v47 patches 12 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v3 RFC7 patches22 repliesSuperseded

Patches in v6 All 7 applied

#Subject and filesSizeRepliesApplied
1/7queue_api: add support for fetching per queue DMA devinclude/net/netdev_queues.h net/core/Makefile net/core/netdev_queues.c+35 -00 repliesApplied
2/7io_uring/zcrx: add support for custom DMA devicesio_uring/zcrx.c+2 -10 repliesApplied
3/7net: devmem: get netdev DMA device via new APInet/core/devmem.c+9 -10 repliesApplied
4/7net/mlx5e: add op for getting netdev DMA devicedrivers/net/ethernet/mellanox/mlx5/core/en_main.c+24 -00 repliesApplied
5/7net: devmem: pull out dma_dev out of net_devmem_bind_dmabufnet/core/devmem.c net/core/devmem.h net/core/netdev-genl.c+16 -120 repliesApplied
6/7net: devmem: pre-read requested rx queues during bindnet/core/netdev-genl.c+58 -270 repliesApplied
7/7net: devmem: allow binding on rx queues with same DMA devicesnet/core/netdev-genl.c+30 -10 repliesApplied

Reviews trailers per patch

6 of 7 patches have a Reviewed-by or Acked-by.

PatchMina AlmasryPavel Begunkov
1/7R-b R-b
2/7R-b R-b
3/7R-b
4/7R-b
5/7R-b
6/7R-b
7/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH net-next v6 0/7] devmem/io_uring: allow more flexibility for ZC DMA devices

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

---
Changes sice v5 [6]:
- Added NL_SET_BAD_ATTR for incorrect rq idx. (patch 6)

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/[email protected]/

[2]  v1: https://lore.kernel.org/all/[email protected]/
[3]  v2: https://lore.kernel.org/all/[email protected]/
[4]  v3: https://lore.kernel.org/all/[email protected]/
[5]  v4: https://lore.kernel.org/all/[email protected]/
[6]  v5: https://lore.kernel.org/all/[email protected]/

---

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                        | 122 +++++++++++++-----
 net/core/netdev_queues.c                      |  27 ++++
 8 files changed, 163 insertions(+), 31 deletions(-)
 create mode 100644 net/core/netdev_queues.c
Signature · 1 line
2.50.1