linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [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 1/7] queue_api: add support for fetching per queue DMA dev Dragos Tatulea
                   ` (7 more replies)
  0 siblings, 8 replies; 29+ 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] 29+ messages in thread

* [RFC net-next v3 1/7] queue_api: add support for fetching per queue DMA dev
  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-15 17:16   ` Jakub Kicinski
                     ` (2 more replies)
  2025-08-15 11:03 ` [RFC net-next v3 2/7] io_uring/zcrx: add support for custom DMA devices Dragos Tatulea
                   ` (6 subsequent siblings)
  7 siblings, 3 replies; 29+ 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
  Cc: Dragos Tatulea, cratiu, tariqt, parav, Christoph Hellwig, netdev,
	linux-kernel

For zerocopy (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.

This patch introduces the a queue based interface for allowing drivers
to expose a different DMA device for zerocopy.

[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>
---
 include/net/netdev_queues.h | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/include/net/netdev_queues.h b/include/net/netdev_queues.h
index 6e835972abd1..d4d8c42b809f 100644
--- a/include/net/netdev_queues.h
+++ b/include/net/netdev_queues.h
@@ -127,6 +127,10 @@ void netdev_stat_queue_sum(struct net_device *netdev,
  * @ndo_queue_stop:	Stop the RX queue at the specified index. The stopped
  *			queue's memory is written at the specified address.
  *
+ * @ndo_queue_get_dma_dev: Get dma device for zero-copy operations to be used
+ *			   for this queue. When such device is not available,
+ *			   the function will return NULL.
+ *
  * Note that @ndo_queue_mem_alloc and @ndo_queue_mem_free may be called while
  * the interface is closed. @ndo_queue_start and @ndo_queue_stop will only
  * be called for an interface which is open.
@@ -144,6 +148,8 @@ struct netdev_queue_mgmt_ops {
 	int			(*ndo_queue_stop)(struct net_device *dev,
 						  void *per_queue_mem,
 						  int idx);
+	struct device *		(*ndo_queue_get_dma_dev)(struct net_device *dev,
+							 int idx);
 };
 
 /**
@@ -321,4 +327,18 @@ static inline void netif_subqueue_sent(const struct net_device *dev,
 					 get_desc, start_thrs);		\
 	})
 
+static inline struct device *
+netdev_queue_get_dma_dev(struct net_device *dev, int idx)
+{
+	const struct netdev_queue_mgmt_ops *queue_ops = dev->queue_mgmt_ops;
+	struct device *dma_dev;
+
+	if (queue_ops && queue_ops->ndo_queue_get_dma_dev)
+		dma_dev = queue_ops->ndo_queue_get_dma_dev(dev, idx);
+	else
+		dma_dev = dev->dev.parent;
+
+	return dma_dev && dma_dev->dma_mask ? dma_dev : NULL;
+}
+
 #endif
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 29+ 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 ` [RFC net-next v3 1/7] queue_api: add support for fetching per queue DMA dev 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 11:03 ` [RFC net-next v3 3/7] net: devmem: get netdev DMA device via new API Dragos Tatulea
                   ` (5 subsequent siblings)
  7 siblings, 2 replies; 29+ 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] 29+ messages in thread

* [RFC net-next v3 3/7] net: devmem: get netdev DMA device via new API
  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 1/7] queue_api: add support for fetching per queue DMA dev Dragos Tatulea
  2025-08-15 11:03 ` [RFC net-next v3 2/7] io_uring/zcrx: add support for custom DMA devices Dragos Tatulea
@ 2025-08-15 11:03 ` Dragos Tatulea
  2025-08-15 17:30   ` Mina Almasry
  2025-08-15 11:03 ` [RFC net-next v3 4/7] net/mlx5e: add op for getting netdev DMA device Dragos Tatulea
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 29+ 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
  Cc: Dragos Tatulea, cratiu, tariqt, parav, Christoph Hellwig, netdev,
	linux-kernel

Switch to the new API for fetching DMA devices for a netdev. The API is
called with queue index 0 for now which is equivalent with the previous
behavior.

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

Multi-PF netdevs are still problematic (as they were before this
change). Upcoming patches will address this for the rx binding.

Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
---
 net/core/devmem.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/net/core/devmem.c b/net/core/devmem.c
index 24c591ab38ae..d66cb0a63bd6 100644
--- a/net/core/devmem.c
+++ b/net/core/devmem.c
@@ -182,6 +182,7 @@ net_devmem_bind_dmabuf(struct net_device *dev,
 {
 	struct net_devmem_dmabuf_binding *binding;
 	static u32 id_alloc_next;
+	struct device *dma_dev;
 	struct scatterlist *sg;
 	struct dma_buf *dmabuf;
 	unsigned int sg_idx, i;
@@ -192,6 +193,13 @@ net_devmem_bind_dmabuf(struct net_device *dev,
 	if (IS_ERR(dmabuf))
 		return ERR_CAST(dmabuf);
 
+	dma_dev = netdev_queue_get_dma_dev(dev, 0);
+	if (!dma_dev) {
+		err = -EOPNOTSUPP;
+		NL_SET_ERR_MSG(extack, "Device doesn't support dma");
+		goto err_put_dmabuf;
+	}
+
 	binding = kzalloc_node(sizeof(*binding), GFP_KERNEL,
 			       dev_to_node(&dev->dev));
 	if (!binding) {
@@ -209,7 +217,7 @@ net_devmem_bind_dmabuf(struct net_device *dev,
 	binding->dmabuf = dmabuf;
 	binding->direction = direction;
 
-	binding->attachment = dma_buf_attach(binding->dmabuf, dev->dev.parent);
+	binding->attachment = dma_buf_attach(binding->dmabuf, dma_dev);
 	if (IS_ERR(binding->attachment)) {
 		err = PTR_ERR(binding->attachment);
 		NL_SET_ERR_MSG(extack, "Failed to bind dmabuf to device");
-- 
2.50.1


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

* [RFC net-next v3 4/7] net/mlx5e: add op for getting netdev DMA device
  2025-08-15 11:03 [RFC net-next v3 0/7] devmem/io_uring: allow more flexibility for ZC DMA devices Dragos Tatulea
                   ` (2 preceding siblings ...)
  2025-08-15 11:03 ` [RFC net-next v3 3/7] net: devmem: get netdev DMA device via new API Dragos Tatulea
@ 2025-08-15 11:03 ` Dragos Tatulea
  2025-08-15 17:37   ` Mina Almasry
  2025-08-15 11:03 ` [RFC net-next v3 5/7] net: devmem: pull out dma_dev out of net_devmem_bind_dmabuf Dragos Tatulea
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 29+ messages in thread
From: Dragos Tatulea @ 2025-08-15 11:03 UTC (permalink / raw)
  To: almasrymina, asml.silence, Saeed Mahameed, Tariq Toukan,
	Mark Bloch, Leon Romanovsky, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Dragos Tatulea, cratiu, parav, Christoph Hellwig, netdev,
	linux-rdma, linux-kernel

For zero-copy (devmem, io_uring), the netdev DMA device used
is the parent device of the net device. However that is not
always accurate for mlx5 devices:
- SFs: The parent device is an auxdev.
- Multi-PF netdevs: The DMA device should be determined by
  the queue.

This change implements the DMA device queue API that returns the DMA
device appropriately for all cases.

Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
---
 .../net/ethernet/mellanox/mlx5/core/en_main.c | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 21bb88c5d3dc..0e48065a46eb 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -5625,12 +5625,36 @@ static int mlx5e_queue_start(struct net_device *dev, void *newq,
 	return 0;
 }
 
+static struct device *mlx5e_queue_get_dma_dev(struct net_device *dev,
+					      int queue_index)
+{
+	struct mlx5e_priv *priv = netdev_priv(dev);
+	struct mlx5e_channels *channels;
+	struct device *pdev = NULL;
+	struct mlx5e_channel *ch;
+
+	channels = &priv->channels;
+
+	mutex_lock(&priv->state_lock);
+
+	if (queue_index >= channels->num)
+		goto out;
+
+	ch = channels->c[queue_index];
+	pdev = ch->pdev;
+out:
+	mutex_unlock(&priv->state_lock);
+
+	return pdev;
+}
+
 static const struct netdev_queue_mgmt_ops mlx5e_queue_mgmt_ops = {
 	.ndo_queue_mem_size	=	sizeof(struct mlx5_qmgmt_data),
 	.ndo_queue_mem_alloc	=	mlx5e_queue_mem_alloc,
 	.ndo_queue_mem_free	=	mlx5e_queue_mem_free,
 	.ndo_queue_start	=	mlx5e_queue_start,
 	.ndo_queue_stop		=	mlx5e_queue_stop,
+	.ndo_queue_get_dma_dev	=	mlx5e_queue_get_dma_dev,
 };
 
 static void mlx5e_build_nic_netdev(struct net_device *netdev)
-- 
2.50.1


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

* [RFC net-next v3 5/7] net: devmem: pull out dma_dev out of net_devmem_bind_dmabuf
  2025-08-15 11:03 [RFC net-next v3 0/7] devmem/io_uring: allow more flexibility for ZC DMA devices Dragos Tatulea
                   ` (3 preceding siblings ...)
  2025-08-15 11:03 ` [RFC net-next v3 4/7] net/mlx5e: add op for getting netdev DMA device Dragos Tatulea
@ 2025-08-15 11:03 ` Dragos Tatulea
  2025-08-18 18:22   ` Mina Almasry
  2025-08-15 11:03 ` [RFC net-next v3 6/7] net: devmem: pre-read requested rx queues during bind Dragos Tatulea
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 29+ 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
  Cc: Dragos Tatulea, cratiu, tariqt, parav, Christoph Hellwig, netdev,
	linux-kernel

Fetch the DMA device before calling net_devmem_bind_dmabuf()
and pass it on as a parameter.

This is needed for an upcoming change which will read the
DMA device per queue.

This patch has no functional changes.

Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
---
 net/core/devmem.c      | 14 ++++++--------
 net/core/devmem.h      |  2 ++
 net/core/netdev-genl.c | 12 ++++++++----
 3 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/net/core/devmem.c b/net/core/devmem.c
index d66cb0a63bd6..c7ca16c9fc04 100644
--- a/net/core/devmem.c
+++ b/net/core/devmem.c
@@ -176,30 +176,28 @@ int net_devmem_bind_dmabuf_to_queue(struct net_device *dev, u32 rxq_idx,
 
 struct net_devmem_dmabuf_binding *
 net_devmem_bind_dmabuf(struct net_device *dev,
+		       struct device *dma_dev,
 		       enum dma_data_direction direction,
 		       unsigned int dmabuf_fd, struct netdev_nl_sock *priv,
 		       struct netlink_ext_ack *extack)
 {
 	struct net_devmem_dmabuf_binding *binding;
 	static u32 id_alloc_next;
-	struct device *dma_dev;
 	struct scatterlist *sg;
 	struct dma_buf *dmabuf;
 	unsigned int sg_idx, i;
 	unsigned long virtual;
 	int err;
 
-	dmabuf = dma_buf_get(dmabuf_fd);
-	if (IS_ERR(dmabuf))
-		return ERR_CAST(dmabuf);
-
-	dma_dev = netdev_queue_get_dma_dev(dev, 0);
 	if (!dma_dev) {
-		err = -EOPNOTSUPP;
 		NL_SET_ERR_MSG(extack, "Device doesn't support dma");
-		goto err_put_dmabuf;
+		return ERR_PTR(-EOPNOTSUPP);
 	}
 
+	dmabuf = dma_buf_get(dmabuf_fd);
+	if (IS_ERR(dmabuf))
+		return ERR_CAST(dmabuf);
+
 	binding = kzalloc_node(sizeof(*binding), GFP_KERNEL,
 			       dev_to_node(&dev->dev));
 	if (!binding) {
diff --git a/net/core/devmem.h b/net/core/devmem.h
index 41cd6e1c9141..101150d761af 100644
--- a/net/core/devmem.h
+++ b/net/core/devmem.h
@@ -85,6 +85,7 @@ struct dmabuf_genpool_chunk_owner {
 void __net_devmem_dmabuf_binding_free(struct work_struct *wq);
 struct net_devmem_dmabuf_binding *
 net_devmem_bind_dmabuf(struct net_device *dev,
+		       struct device *dma_dev,
 		       enum dma_data_direction direction,
 		       unsigned int dmabuf_fd, struct netdev_nl_sock *priv,
 		       struct netlink_ext_ack *extack);
@@ -170,6 +171,7 @@ static inline void net_devmem_put_net_iov(struct net_iov *niov)
 
 static inline struct net_devmem_dmabuf_binding *
 net_devmem_bind_dmabuf(struct net_device *dev,
+		       struct device *dma_dev,
 		       enum dma_data_direction direction,
 		       unsigned int dmabuf_fd,
 		       struct netdev_nl_sock *priv,
diff --git a/net/core/netdev-genl.c b/net/core/netdev-genl.c
index 6314eb7bdf69..3e2d6aa6e060 100644
--- a/net/core/netdev-genl.c
+++ b/net/core/netdev-genl.c
@@ -876,6 +876,7 @@ int netdev_nl_bind_rx_doit(struct sk_buff *skb, struct genl_info *info)
 	u32 ifindex, dmabuf_fd, rxq_idx;
 	struct netdev_nl_sock *priv;
 	struct net_device *netdev;
+	struct device *dma_dev;
 	struct sk_buff *rsp;
 	struct nlattr *attr;
 	int rem, err = 0;
@@ -921,8 +922,9 @@ int netdev_nl_bind_rx_doit(struct sk_buff *skb, struct genl_info *info)
 		goto err_unlock;
 	}
 
-	binding = net_devmem_bind_dmabuf(netdev, DMA_FROM_DEVICE, dmabuf_fd,
-					 priv, info->extack);
+	dma_dev = netdev_queue_get_dma_dev(netdev, 0);
+	binding = net_devmem_bind_dmabuf(netdev, dma_dev, DMA_FROM_DEVICE,
+					 dmabuf_fd, priv, info->extack);
 	if (IS_ERR(binding)) {
 		err = PTR_ERR(binding);
 		goto err_unlock;
@@ -986,6 +988,7 @@ int netdev_nl_bind_tx_doit(struct sk_buff *skb, struct genl_info *info)
 	struct net_devmem_dmabuf_binding *binding;
 	struct netdev_nl_sock *priv;
 	struct net_device *netdev;
+	struct device *dma_dev;
 	u32 ifindex, dmabuf_fd;
 	struct sk_buff *rsp;
 	int err = 0;
@@ -1032,8 +1035,9 @@ int netdev_nl_bind_tx_doit(struct sk_buff *skb, struct genl_info *info)
 		goto err_unlock_netdev;
 	}
 
-	binding = net_devmem_bind_dmabuf(netdev, DMA_TO_DEVICE, dmabuf_fd, priv,
-					 info->extack);
+	dma_dev = netdev_queue_get_dma_dev(netdev, 0);
+	binding = net_devmem_bind_dmabuf(netdev, dma_dev, DMA_TO_DEVICE,
+					 dmabuf_fd, priv, info->extack);
 	if (IS_ERR(binding)) {
 		err = PTR_ERR(binding);
 		goto err_unlock_netdev;
-- 
2.50.1


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

* [RFC net-next v3 6/7] net: devmem: pre-read requested rx queues during bind
  2025-08-15 11:03 [RFC net-next v3 0/7] devmem/io_uring: allow more flexibility for ZC DMA devices Dragos Tatulea
                   ` (4 preceding siblings ...)
  2025-08-15 11:03 ` [RFC net-next v3 5/7] net: devmem: pull out dma_dev out of net_devmem_bind_dmabuf Dragos Tatulea
@ 2025-08-15 11:03 ` Dragos Tatulea
  2025-08-15 17:20   ` Jakub Kicinski
  2025-08-15 18:05   ` Mina Almasry
  2025-08-15 11:03 ` [RFC net-next v3 7/7] net: devmem: allow binding on rx queues with same MA devices Dragos Tatulea
  2025-08-15 15:31 ` [RFC net-next v3 0/7] devmem/io_uring: allow more flexibility for ZC DMA devices Stanislav Fomichev
  7 siblings, 2 replies; 29+ 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
  Cc: Dragos Tatulea, cratiu, tariqt, parav, Christoph Hellwig, netdev,
	linux-kernel

Instead of reading the requested rx queues after binding the buffer,
read the rx queues in advance in a bitmap and iterate over them when
needed.

This is a preparation for fetching the DMA device for each queue.

This patch has no functional changes.

Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
---
 net/core/netdev-genl.c | 76 +++++++++++++++++++++++++++---------------
 1 file changed, 49 insertions(+), 27 deletions(-)

diff --git a/net/core/netdev-genl.c b/net/core/netdev-genl.c
index 3e2d6aa6e060..3e990f100bf0 100644
--- a/net/core/netdev-genl.c
+++ b/net/core/netdev-genl.c
@@ -869,17 +869,50 @@ int netdev_nl_qstats_get_dumpit(struct sk_buff *skb,
 	return err;
 }
 
-int netdev_nl_bind_rx_doit(struct sk_buff *skb, struct genl_info *info)
+static int netdev_nl_read_rxq_bitmap(struct genl_info *info,
+				     unsigned long *rxq_bitmap)
 {
 	struct nlattr *tb[ARRAY_SIZE(netdev_queue_id_nl_policy)];
+	struct nlattr *attr;
+	int rem, err = 0;
+	u32 rxq_idx;
+
+	nla_for_each_attr_type(attr, NETDEV_A_DMABUF_QUEUES,
+			       genlmsg_data(info->genlhdr),
+			       genlmsg_len(info->genlhdr), rem) {
+		err = nla_parse_nested(
+			tb, ARRAY_SIZE(netdev_queue_id_nl_policy) - 1, attr,
+			netdev_queue_id_nl_policy, info->extack);
+		if (err < 0)
+			return err;
+
+		if (NL_REQ_ATTR_CHECK(info->extack, attr, tb, NETDEV_A_QUEUE_ID) ||
+		    NL_REQ_ATTR_CHECK(info->extack, attr, tb, NETDEV_A_QUEUE_TYPE))
+			return -EINVAL;
+
+		if (nla_get_u32(tb[NETDEV_A_QUEUE_TYPE]) != NETDEV_QUEUE_TYPE_RX) {
+			NL_SET_BAD_ATTR(info->extack, tb[NETDEV_A_QUEUE_TYPE]);
+			return -EINVAL;
+		}
+
+		rxq_idx = nla_get_u32(tb[NETDEV_A_QUEUE_ID]);
+
+		bitmap_set(rxq_bitmap, rxq_idx, 1);
+	}
+
+	return 0;
+}
+
+int netdev_nl_bind_rx_doit(struct sk_buff *skb, struct genl_info *info)
+{
 	struct net_devmem_dmabuf_binding *binding;
 	u32 ifindex, dmabuf_fd, rxq_idx;
 	struct netdev_nl_sock *priv;
 	struct net_device *netdev;
+	unsigned long *rxq_bitmap;
 	struct device *dma_dev;
 	struct sk_buff *rsp;
-	struct nlattr *attr;
-	int rem, err = 0;
+	int err = 0;
 	void *hdr;
 
 	if (GENL_REQ_ATTR_CHECK(info, NETDEV_A_DEV_IFINDEX) ||
@@ -922,37 +955,22 @@ int netdev_nl_bind_rx_doit(struct sk_buff *skb, struct genl_info *info)
 		goto err_unlock;
 	}
 
+	rxq_bitmap = bitmap_alloc(netdev->num_rx_queues, GFP_KERNEL);
+	if (!rxq_bitmap) {
+		err = -ENOMEM;
+		goto err_unlock;
+	}
+	netdev_nl_read_rxq_bitmap(info, rxq_bitmap);
+
 	dma_dev = netdev_queue_get_dma_dev(netdev, 0);
 	binding = net_devmem_bind_dmabuf(netdev, dma_dev, DMA_FROM_DEVICE,
 					 dmabuf_fd, priv, info->extack);
 	if (IS_ERR(binding)) {
 		err = PTR_ERR(binding);
-		goto err_unlock;
+		goto err_rxq_bitmap;
 	}
 
-	nla_for_each_attr_type(attr, NETDEV_A_DMABUF_QUEUES,
-			       genlmsg_data(info->genlhdr),
-			       genlmsg_len(info->genlhdr), rem) {
-		err = nla_parse_nested(
-			tb, ARRAY_SIZE(netdev_queue_id_nl_policy) - 1, attr,
-			netdev_queue_id_nl_policy, info->extack);
-		if (err < 0)
-			goto err_unbind;
-
-		if (NL_REQ_ATTR_CHECK(info->extack, attr, tb, NETDEV_A_QUEUE_ID) ||
-		    NL_REQ_ATTR_CHECK(info->extack, attr, tb, NETDEV_A_QUEUE_TYPE)) {
-			err = -EINVAL;
-			goto err_unbind;
-		}
-
-		if (nla_get_u32(tb[NETDEV_A_QUEUE_TYPE]) != NETDEV_QUEUE_TYPE_RX) {
-			NL_SET_BAD_ATTR(info->extack, tb[NETDEV_A_QUEUE_TYPE]);
-			err = -EINVAL;
-			goto err_unbind;
-		}
-
-		rxq_idx = nla_get_u32(tb[NETDEV_A_QUEUE_ID]);
-
+	for_each_set_bit(rxq_idx, rxq_bitmap, netdev->num_rx_queues) {
 		err = net_devmem_bind_dmabuf_to_queue(netdev, rxq_idx, binding,
 						      info->extack);
 		if (err)
@@ -966,6 +984,8 @@ int netdev_nl_bind_rx_doit(struct sk_buff *skb, struct genl_info *info)
 	if (err)
 		goto err_unbind;
 
+	bitmap_free(rxq_bitmap);
+
 	netdev_unlock(netdev);
 
 	mutex_unlock(&priv->lock);
@@ -974,6 +994,8 @@ int netdev_nl_bind_rx_doit(struct sk_buff *skb, struct genl_info *info)
 
 err_unbind:
 	net_devmem_unbind_dmabuf(binding);
+err_rxq_bitmap:
+	bitmap_free(rxq_bitmap);
 err_unlock:
 	netdev_unlock(netdev);
 err_unlock_sock:
-- 
2.50.1


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

* [RFC net-next v3 7/7] net: devmem: allow binding on rx queues with same MA devices
  2025-08-15 11:03 [RFC net-next v3 0/7] devmem/io_uring: allow more flexibility for ZC DMA devices Dragos Tatulea
                   ` (5 preceding siblings ...)
  2025-08-15 11:03 ` [RFC net-next v3 6/7] net: devmem: pre-read requested rx queues during bind Dragos Tatulea
@ 2025-08-15 11:03 ` Dragos Tatulea
  2025-08-15 17:24   ` Jakub Kicinski
  2025-08-15 15:31 ` [RFC net-next v3 0/7] devmem/io_uring: allow more flexibility for ZC DMA devices Stanislav Fomichev
  7 siblings, 1 reply; 29+ 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
  Cc: Dragos Tatulea, cratiu, tariqt, parav, Christoph Hellwig, netdev,
	linux-kernel

Multi-PF netdevs have queues belonging to different PFs which also means
different DMA devices. This means that the binding on the DMA buffer can
be done to the incorrect device.

This change allows devmem binding to multiple queues only when the
queues have the same DMA device. Otherwise an error is returned.

Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
---
 net/core/netdev-genl.c | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/net/core/netdev-genl.c b/net/core/netdev-genl.c
index 3e990f100bf0..649b62803529 100644
--- a/net/core/netdev-genl.c
+++ b/net/core/netdev-genl.c
@@ -903,6 +903,31 @@ static int netdev_nl_read_rxq_bitmap(struct genl_info *info,
 	return 0;
 }
 
+static struct device *netdev_nl_get_dma_dev(struct net_device *netdev,
+					    unsigned long *rxq_bitmap,
+					    struct netlink_ext_ack *extack)
+{
+	struct device *dma_dev = NULL;
+	u32 rxq_idx;
+
+	for_each_set_bit(rxq_idx, rxq_bitmap, netdev->num_rx_queues) {
+		struct device *rxq_dma_dev;
+
+		rxq_dma_dev = netdev_queue_get_dma_dev(netdev, rxq_idx);
+		/* Multi-PF netdev queues can belong to different DMA devoces.
+		 * Block this case.
+		 */
+		if (rxq_dma_dev && dma_dev && rxq_dma_dev != dma_dev) {
+			NL_SET_ERR_MSG(extack, "Can't bind to queues from different dma devices");
+			return NULL;
+		}
+
+		dma_dev = rxq_dma_dev;
+	}
+
+	return dma_dev;
+}
+
 int netdev_nl_bind_rx_doit(struct sk_buff *skb, struct genl_info *info)
 {
 	struct net_devmem_dmabuf_binding *binding;
@@ -962,7 +987,7 @@ int netdev_nl_bind_rx_doit(struct sk_buff *skb, struct genl_info *info)
 	}
 	netdev_nl_read_rxq_bitmap(info, rxq_bitmap);
 
-	dma_dev = netdev_queue_get_dma_dev(netdev, 0);
+	dma_dev = netdev_nl_get_dma_dev(netdev, rxq_bitmap, info->extack);
 	binding = net_devmem_bind_dmabuf(netdev, dma_dev, DMA_FROM_DEVICE,
 					 dmabuf_fd, priv, info->extack);
 	if (IS_ERR(binding)) {
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 29+ 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
                   ` (6 preceding siblings ...)
  2025-08-15 11:03 ` [RFC net-next v3 7/7] net: devmem: allow binding on rx queues with same MA devices Dragos Tatulea
@ 2025-08-15 15:31 ` Stanislav Fomichev
  2025-08-15 15:48   ` Dragos Tatulea
  7 siblings, 1 reply; 29+ 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] 29+ 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 DMA devices Stanislav Fomichev
@ 2025-08-15 15:48   ` Dragos Tatulea
  0 siblings, 0 replies; 29+ 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] 29+ messages in thread

* Re: [RFC net-next v3 1/7] queue_api: add support for fetching per queue DMA dev
  2025-08-15 11:03 ` [RFC net-next v3 1/7] queue_api: add support for fetching per queue DMA dev Dragos Tatulea
@ 2025-08-15 17:16   ` Jakub Kicinski
  2025-08-19 14:41     ` Dragos Tatulea
  2025-08-15 18:11   ` Mina Almasry
  2025-08-19 15:56   ` Pavel Begunkov
  2 siblings, 1 reply; 29+ messages in thread
From: Jakub Kicinski @ 2025-08-15 17:16 UTC (permalink / raw)
  To: Dragos Tatulea
  Cc: almasrymina, asml.silence, David S. Miller, Eric Dumazet,
	Paolo Abeni, Simon Horman, cratiu, tariqt, parav,
	Christoph Hellwig, netdev, linux-kernel

On Fri, 15 Aug 2025 14:03:42 +0300 Dragos Tatulea wrote:
> +static inline struct device *
> +netdev_queue_get_dma_dev(struct net_device *dev, int idx)
> +{
> +	const struct netdev_queue_mgmt_ops *queue_ops = dev->queue_mgmt_ops;
> +	struct device *dma_dev;
> +
> +	if (queue_ops && queue_ops->ndo_queue_get_dma_dev)
> +		dma_dev = queue_ops->ndo_queue_get_dma_dev(dev, idx);
> +	else
> +		dma_dev = dev->dev.parent;
> +
> +	return dma_dev && dma_dev->dma_mask ? dma_dev : NULL;
> +}

This really does not have to live in the header file.

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

* Re: [RFC net-next v3 6/7] net: devmem: pre-read requested rx queues during bind
  2025-08-15 11:03 ` [RFC net-next v3 6/7] net: devmem: pre-read requested rx queues during bind Dragos Tatulea
@ 2025-08-15 17:20   ` Jakub Kicinski
  2025-08-15 18:05   ` Mina Almasry
  1 sibling, 0 replies; 29+ messages in thread
From: Jakub Kicinski @ 2025-08-15 17:20 UTC (permalink / raw)
  To: Dragos Tatulea
  Cc: almasrymina, asml.silence, David S. Miller, Eric Dumazet,
	Paolo Abeni, Simon Horman, cratiu, tariqt, parav,
	Christoph Hellwig, netdev, linux-kernel

On Fri, 15 Aug 2025 14:03:47 +0300 Dragos Tatulea wrote:
> Instead of reading the requested rx queues after binding the buffer,
> read the rx queues in advance in a bitmap and iterate over them when
> needed.
> 
> This is a preparation for fetching the DMA device for each queue.
> 
> This patch has no functional changes.

Nice!

> +	rxq_bitmap = bitmap_alloc(netdev->num_rx_queues, GFP_KERNEL);

FWIW I think you can use num_real_rx_queues since we're holding
the instance lock which prevents it from changing?

But it's just bits so doesn't matter all that much.

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

* Re: [RFC net-next v3 7/7] net: devmem: allow binding on rx queues with same MA devices
  2025-08-15 11:03 ` [RFC net-next v3 7/7] net: devmem: allow binding on rx queues with same MA devices Dragos Tatulea
@ 2025-08-15 17:24   ` Jakub Kicinski
  2025-08-16  9:05     ` Dragos Tatulea
  0 siblings, 1 reply; 29+ messages in thread
From: Jakub Kicinski @ 2025-08-15 17:24 UTC (permalink / raw)
  To: Dragos Tatulea
  Cc: almasrymina, asml.silence, David S. Miller, Eric Dumazet,
	Paolo Abeni, Simon Horman, cratiu, tariqt, parav,
	Christoph Hellwig, netdev, linux-kernel

On Fri, 15 Aug 2025 14:03:48 +0300 Dragos Tatulea wrote:
> +		rxq_dma_dev = netdev_queue_get_dma_dev(netdev, rxq_idx);
> +		/* Multi-PF netdev queues can belong to different DMA devoces.
> +		 * Block this case.
> +		 */
> +		if (rxq_dma_dev && dma_dev && rxq_dma_dev != dma_dev) {

Why rxq_dma_dev ? 🤔️
Don't we want to error out if the first queue gave us a DMA dev but the
second gave us a NULL ?

> +			NL_SET_ERR_MSG(extack, "Can't bind to queues from different dma devices");

_FMT the conflicting queue IDs into this?

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

* Re: [RFC net-next v3 3/7] net: devmem: get netdev DMA device via new API
  2025-08-15 11:03 ` [RFC net-next v3 3/7] net: devmem: get netdev DMA device via new API Dragos Tatulea
@ 2025-08-15 17:30   ` Mina Almasry
  0 siblings, 0 replies; 29+ messages in thread
From: Mina Almasry @ 2025-08-15 17:30 UTC (permalink / raw)
  To: Dragos Tatulea
  Cc: asml.silence, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman, cratiu, tariqt, parav,
	Christoph Hellwig, netdev, linux-kernel

On Fri, Aug 15, 2025 at 4:07 AM Dragos Tatulea <dtatulea@nvidia.com> wrote:
>
> Switch to the new API for fetching DMA devices for a netdev. The API is
> called with queue index 0 for now which is equivalent with the previous
> behavior.
>
> This patch will allow devmem to work with devices where the DMA device
> is not stored in the parent device. mlx5 SFs are an example of such a
> device.
>
> Multi-PF netdevs are still problematic (as they were before this
> change). Upcoming patches will address this for the rx binding.
>
> Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>

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

-- 
Thanks,
Mina

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

* Re: [RFC net-next v3 4/7] net/mlx5e: add op for getting netdev DMA device
  2025-08-15 11:03 ` [RFC net-next v3 4/7] net/mlx5e: add op for getting netdev DMA device Dragos Tatulea
@ 2025-08-15 17:37   ` Mina Almasry
  2025-08-18 17:40     ` Dragos Tatulea
  0 siblings, 1 reply; 29+ messages in thread
From: Mina Almasry @ 2025-08-15 17:37 UTC (permalink / raw)
  To: Dragos Tatulea
  Cc: asml.silence, Saeed Mahameed, Tariq Toukan, Mark Bloch,
	Leon Romanovsky, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, cratiu, parav, Christoph Hellwig,
	netdev, linux-rdma, linux-kernel

On Fri, Aug 15, 2025 at 4:07 AM Dragos Tatulea <dtatulea@nvidia.com> wrote:
>
> For zero-copy (devmem, io_uring), the netdev DMA device used
> is the parent device of the net device. However that is not
> always accurate for mlx5 devices:
> - SFs: The parent device is an auxdev.
> - Multi-PF netdevs: The DMA device should be determined by
>   the queue.
>
> This change implements the DMA device queue API that returns the DMA
> device appropriately for all cases.
>
> Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
> ---
>  .../net/ethernet/mellanox/mlx5/core/en_main.c | 24 +++++++++++++++++++
>  1 file changed, 24 insertions(+)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> index 21bb88c5d3dc..0e48065a46eb 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> @@ -5625,12 +5625,36 @@ static int mlx5e_queue_start(struct net_device *dev, void *newq,
>         return 0;
>  }
>
> +static struct device *mlx5e_queue_get_dma_dev(struct net_device *dev,
> +                                             int queue_index)
> +{
> +       struct mlx5e_priv *priv = netdev_priv(dev);
> +       struct mlx5e_channels *channels;
> +       struct device *pdev = NULL;
> +       struct mlx5e_channel *ch;
> +
> +       channels = &priv->channels;
> +
> +       mutex_lock(&priv->state_lock);
> +
> +       if (queue_index >= channels->num)
> +               goto out;
> +
> +       ch = channels->c[queue_index];
> +       pdev = ch->pdev;

This code assumes priv is initialized, and probably that the device is
up/running/registered. At first I thought that was fine, but now that
I look at the code more closely, netdev_nl_bind_rx_doit checks if the
device is present but doesn't seem to check that the device is
registered.

I wonder if we should have a generic check in netdev_nl_bind_rx_doit
for NETDEV_REGISTERED, and if not, does this code handle unregistered
netdev correctly (like netdev_priv and priv->channels are valid even
for unregistered mlx5 devices)?


-- 
Thanks,
Mina

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

* Re: [RFC net-next v3 6/7] net: devmem: pre-read requested rx queues during bind
  2025-08-15 11:03 ` [RFC net-next v3 6/7] net: devmem: pre-read requested rx queues during bind Dragos Tatulea
  2025-08-15 17:20   ` Jakub Kicinski
@ 2025-08-15 18:05   ` Mina Almasry
  2025-08-16  8:59     ` Dragos Tatulea
  1 sibling, 1 reply; 29+ messages in thread
From: Mina Almasry @ 2025-08-15 18:05 UTC (permalink / raw)
  To: Dragos Tatulea
  Cc: asml.silence, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman, cratiu, tariqt, parav,
	Christoph Hellwig, netdev, linux-kernel

On Fri, Aug 15, 2025 at 4:07 AM Dragos Tatulea <dtatulea@nvidia.com> wrote:
>
> Instead of reading the requested rx queues after binding the buffer,
> read the rx queues in advance in a bitmap and iterate over them when
> needed.
>
> This is a preparation for fetching the DMA device for each queue.
>
> This patch has no functional changes.
>
> Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
> ---
>  net/core/netdev-genl.c | 76 +++++++++++++++++++++++++++---------------
>  1 file changed, 49 insertions(+), 27 deletions(-)
>
> diff --git a/net/core/netdev-genl.c b/net/core/netdev-genl.c
> index 3e2d6aa6e060..3e990f100bf0 100644
> --- a/net/core/netdev-genl.c
> +++ b/net/core/netdev-genl.c
> @@ -869,17 +869,50 @@ int netdev_nl_qstats_get_dumpit(struct sk_buff *skb,
>         return err;
>  }
>
> -int netdev_nl_bind_rx_doit(struct sk_buff *skb, struct genl_info *info)
> +static int netdev_nl_read_rxq_bitmap(struct genl_info *info,
> +                                    unsigned long *rxq_bitmap)
>  {
>         struct nlattr *tb[ARRAY_SIZE(netdev_queue_id_nl_policy)];
> +       struct nlattr *attr;
> +       int rem, err = 0;
> +       u32 rxq_idx;
> +
> +       nla_for_each_attr_type(attr, NETDEV_A_DMABUF_QUEUES,
> +                              genlmsg_data(info->genlhdr),
> +                              genlmsg_len(info->genlhdr), rem) {
> +               err = nla_parse_nested(
> +                       tb, ARRAY_SIZE(netdev_queue_id_nl_policy) - 1, attr,
> +                       netdev_queue_id_nl_policy, info->extack);
> +               if (err < 0)
> +                       return err;
> +
> +               if (NL_REQ_ATTR_CHECK(info->extack, attr, tb, NETDEV_A_QUEUE_ID) ||
> +                   NL_REQ_ATTR_CHECK(info->extack, attr, tb, NETDEV_A_QUEUE_TYPE))
> +                       return -EINVAL;
> +
> +               if (nla_get_u32(tb[NETDEV_A_QUEUE_TYPE]) != NETDEV_QUEUE_TYPE_RX) {
> +                       NL_SET_BAD_ATTR(info->extack, tb[NETDEV_A_QUEUE_TYPE]);
> +                       return -EINVAL;
> +               }
> +
> +               rxq_idx = nla_get_u32(tb[NETDEV_A_QUEUE_ID]);
> +
> +               bitmap_set(rxq_bitmap, rxq_idx, 1);
> +       }
> +
> +       return 0;
> +}
> +
> +int netdev_nl_bind_rx_doit(struct sk_buff *skb, struct genl_info *info)
> +{
>         struct net_devmem_dmabuf_binding *binding;
>         u32 ifindex, dmabuf_fd, rxq_idx;
>         struct netdev_nl_sock *priv;
>         struct net_device *netdev;
> +       unsigned long *rxq_bitmap;
>         struct device *dma_dev;
>         struct sk_buff *rsp;
> -       struct nlattr *attr;
> -       int rem, err = 0;
> +       int err = 0;
>         void *hdr;
>
>         if (GENL_REQ_ATTR_CHECK(info, NETDEV_A_DEV_IFINDEX) ||
> @@ -922,37 +955,22 @@ int netdev_nl_bind_rx_doit(struct sk_buff *skb, struct genl_info *info)
>                 goto err_unlock;
>         }
>
> +       rxq_bitmap = bitmap_alloc(netdev->num_rx_queues, GFP_KERNEL);
> +       if (!rxq_bitmap) {
> +               err = -ENOMEM;
> +               goto err_unlock;
> +       }
> +       netdev_nl_read_rxq_bitmap(info, rxq_bitmap);
> +
>         dma_dev = netdev_queue_get_dma_dev(netdev, 0);
>         binding = net_devmem_bind_dmabuf(netdev, dma_dev, DMA_FROM_DEVICE,
>                                          dmabuf_fd, priv, info->extack);
>         if (IS_ERR(binding)) {
>                 err = PTR_ERR(binding);
> -               goto err_unlock;
> +               goto err_rxq_bitmap;
>         }
>
> -       nla_for_each_attr_type(attr, NETDEV_A_DMABUF_QUEUES,
> -                              genlmsg_data(info->genlhdr),
> -                              genlmsg_len(info->genlhdr), rem) {
> -               err = nla_parse_nested(
> -                       tb, ARRAY_SIZE(netdev_queue_id_nl_policy) - 1, attr,
> -                       netdev_queue_id_nl_policy, info->extack);
> -               if (err < 0)
> -                       goto err_unbind;
> -
> -               if (NL_REQ_ATTR_CHECK(info->extack, attr, tb, NETDEV_A_QUEUE_ID) ||
> -                   NL_REQ_ATTR_CHECK(info->extack, attr, tb, NETDEV_A_QUEUE_TYPE)) {
> -                       err = -EINVAL;
> -                       goto err_unbind;
> -               }
> -
> -               if (nla_get_u32(tb[NETDEV_A_QUEUE_TYPE]) != NETDEV_QUEUE_TYPE_RX) {
> -                       NL_SET_BAD_ATTR(info->extack, tb[NETDEV_A_QUEUE_TYPE]);
> -                       err = -EINVAL;
> -                       goto err_unbind;
> -               }
> -
> -               rxq_idx = nla_get_u32(tb[NETDEV_A_QUEUE_ID]);
> -
> +       for_each_set_bit(rxq_idx, rxq_bitmap, netdev->num_rx_queues) {

Is this code assuming that netdev->num_rx_queues (or
real_num_rx_queues) <= BITS_PER_ULONG? Aren't there devices out there
that support more than 64 hardware queues? If so, I guess you need a
different data structure than a bitmap (or maybe there is arbirary
sized bitmap library somewhere to use).



-- 
Thanks,
Mina

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

* Re: [RFC net-next v3 1/7] queue_api: add support for fetching per queue DMA dev
  2025-08-15 11:03 ` [RFC net-next v3 1/7] queue_api: add support for fetching per queue DMA dev Dragos Tatulea
  2025-08-15 17:16   ` Jakub Kicinski
@ 2025-08-15 18:11   ` Mina Almasry
  2025-08-16  8:55     ` Dragos Tatulea
  2025-08-19 15:56   ` Pavel Begunkov
  2 siblings, 1 reply; 29+ messages in thread
From: Mina Almasry @ 2025-08-15 18:11 UTC (permalink / raw)
  To: Dragos Tatulea
  Cc: asml.silence, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman, cratiu, tariqt, parav,
	Christoph Hellwig, netdev, linux-kernel

On Fri, Aug 15, 2025 at 4:07 AM Dragos Tatulea <dtatulea@nvidia.com> wrote:
>
> For zerocopy (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.
>
> This patch introduces the a queue based interface for allowing drivers
> to expose a different DMA device for zerocopy.
>
> [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>
> ---
>  include/net/netdev_queues.h | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
>
> diff --git a/include/net/netdev_queues.h b/include/net/netdev_queues.h
> index 6e835972abd1..d4d8c42b809f 100644
> --- a/include/net/netdev_queues.h
> +++ b/include/net/netdev_queues.h
> @@ -127,6 +127,10 @@ void netdev_stat_queue_sum(struct net_device *netdev,
>   * @ndo_queue_stop:    Stop the RX queue at the specified index. The stopped
>   *                     queue's memory is written at the specified address.
>   *
> + * @ndo_queue_get_dma_dev: Get dma device for zero-copy operations to be used

I'm wondering a bit why this dma-dev issue exists for memory providers
but not for the dma-dev used by the page_pool itself.

I'm guessing because the pp uses the dev in page_pool_params->dev
while I implemented the memory provider stuff to completely ignore
pp_params->dev and use its own device (sorry...).

We may want to extend your work so that the pp also ignores
pp_params.dev and uses the device returned by the queue API if it's
provided by the driver. But there is no upside to doing things this
way except for some consistency, so I think I'm complicating things
for no reason.

I think this looks good to me. With the helper moved to a .c file as
Jakub requested I can Reviewed-by.

-- 
Thanks,
Mina

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

* Re: [RFC net-next v3 1/7] queue_api: add support for fetching per queue DMA dev
  2025-08-15 18:11   ` Mina Almasry
@ 2025-08-16  8:55     ` Dragos Tatulea
  0 siblings, 0 replies; 29+ messages in thread
From: Dragos Tatulea @ 2025-08-16  8:55 UTC (permalink / raw)
  To: Mina Almasry
  Cc: asml.silence, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman, cratiu, tariqt, parav,
	Christoph Hellwig, netdev, linux-kernel

On Fri, Aug 15, 2025 at 11:11:01AM -0700, Mina Almasry wrote:
> On Fri, Aug 15, 2025 at 4:07 AM Dragos Tatulea <dtatulea@nvidia.com> wrote:
> >
> > For zerocopy (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.
> >
> > This patch introduces the a queue based interface for allowing drivers
> > to expose a different DMA device for zerocopy.
> >
> > [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>
> > ---
> >  include/net/netdev_queues.h | 20 ++++++++++++++++++++
> >  1 file changed, 20 insertions(+)
> >
> > diff --git a/include/net/netdev_queues.h b/include/net/netdev_queues.h
> > index 6e835972abd1..d4d8c42b809f 100644
> > --- a/include/net/netdev_queues.h
> > +++ b/include/net/netdev_queues.h
> > @@ -127,6 +127,10 @@ void netdev_stat_queue_sum(struct net_device *netdev,
> >   * @ndo_queue_stop:    Stop the RX queue at the specified index. The stopped
> >   *                     queue's memory is written at the specified address.
> >   *
> > + * @ndo_queue_get_dma_dev: Get dma device for zero-copy operations to be used
> 
> I'm wondering a bit why this dma-dev issue exists for memory providers
> but not for the dma-dev used by the page_pool itself.
> 
> I'm guessing because the pp uses the dev in page_pool_params->dev
> while I implemented the memory provider stuff to completely ignore
> pp_params->dev and use its own device (sorry...).
>
AFAIU rightly so. The page_pool is created at a later stage.

> We may want to extend your work so that the pp also ignores
> pp_params.dev and uses the device returned by the queue API if it's
> provided by the driver. But there is no upside to doing things this
> way except for some consistency, so I think I'm complicating things
> for no reason.
>
The drivers are setting the pp_params.dev though, so no need for a queue
API call. Or maybe I misunderstood your point?

> I think this looks good to me. With the helper moved to a .c file as
> Jakub requested I can Reviewed-by.
>
Will do.

Thanks,
Dragos


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

* Re: [RFC net-next v3 6/7] net: devmem: pre-read requested rx queues during bind
  2025-08-15 18:05   ` Mina Almasry
@ 2025-08-16  8:59     ` Dragos Tatulea
  2025-08-18 18:24       ` Mina Almasry
  0 siblings, 1 reply; 29+ messages in thread
From: Dragos Tatulea @ 2025-08-16  8:59 UTC (permalink / raw)
  To: Mina Almasry
  Cc: asml.silence, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman, cratiu, tariqt, parav,
	Christoph Hellwig, netdev, linux-kernel

On Fri, Aug 15, 2025 at 11:05:56AM -0700, Mina Almasry wrote:
> On Fri, Aug 15, 2025 at 4:07 AM Dragos Tatulea <dtatulea@nvidia.com> wrote:
> >
> > Instead of reading the requested rx queues after binding the buffer,
> > read the rx queues in advance in a bitmap and iterate over them when
> > needed.
> >
> > This is a preparation for fetching the DMA device for each queue.
> >
> > This patch has no functional changes.
> >
> > Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
> > ---
> >  net/core/netdev-genl.c | 76 +++++++++++++++++++++++++++---------------
> >  1 file changed, 49 insertions(+), 27 deletions(-)
> >
> > diff --git a/net/core/netdev-genl.c b/net/core/netdev-genl.c
> > index 3e2d6aa6e060..3e990f100bf0 100644
> > --- a/net/core/netdev-genl.c
> > +++ b/net/core/netdev-genl.c
> > @@ -869,17 +869,50 @@ int netdev_nl_qstats_get_dumpit(struct sk_buff *skb,
> >         return err;
> >  }
> >
> > -int netdev_nl_bind_rx_doit(struct sk_buff *skb, struct genl_info *info)
> > +static int netdev_nl_read_rxq_bitmap(struct genl_info *info,
> > +                                    unsigned long *rxq_bitmap)
> >  {
> >         struct nlattr *tb[ARRAY_SIZE(netdev_queue_id_nl_policy)];
> > +       struct nlattr *attr;
> > +       int rem, err = 0;
> > +       u32 rxq_idx;
> > +
> > +       nla_for_each_attr_type(attr, NETDEV_A_DMABUF_QUEUES,
> > +                              genlmsg_data(info->genlhdr),
> > +                              genlmsg_len(info->genlhdr), rem) {
> > +               err = nla_parse_nested(
> > +                       tb, ARRAY_SIZE(netdev_queue_id_nl_policy) - 1, attr,
> > +                       netdev_queue_id_nl_policy, info->extack);
> > +               if (err < 0)
> > +                       return err;
> > +
> > +               if (NL_REQ_ATTR_CHECK(info->extack, attr, tb, NETDEV_A_QUEUE_ID) ||
> > +                   NL_REQ_ATTR_CHECK(info->extack, attr, tb, NETDEV_A_QUEUE_TYPE))
> > +                       return -EINVAL;
> > +
> > +               if (nla_get_u32(tb[NETDEV_A_QUEUE_TYPE]) != NETDEV_QUEUE_TYPE_RX) {
> > +                       NL_SET_BAD_ATTR(info->extack, tb[NETDEV_A_QUEUE_TYPE]);
> > +                       return -EINVAL;
> > +               }
> > +
> > +               rxq_idx = nla_get_u32(tb[NETDEV_A_QUEUE_ID]);
> > +
> > +               bitmap_set(rxq_bitmap, rxq_idx, 1);
> > +       }
> > +
> > +       return 0;
> > +}
> > +
> > +int netdev_nl_bind_rx_doit(struct sk_buff *skb, struct genl_info *info)
> > +{
> >         struct net_devmem_dmabuf_binding *binding;
> >         u32 ifindex, dmabuf_fd, rxq_idx;
> >         struct netdev_nl_sock *priv;
> >         struct net_device *netdev;
> > +       unsigned long *rxq_bitmap;
> >         struct device *dma_dev;
> >         struct sk_buff *rsp;
> > -       struct nlattr *attr;
> > -       int rem, err = 0;
> > +       int err = 0;
> >         void *hdr;
> >
> >         if (GENL_REQ_ATTR_CHECK(info, NETDEV_A_DEV_IFINDEX) ||
> > @@ -922,37 +955,22 @@ int netdev_nl_bind_rx_doit(struct sk_buff *skb, struct genl_info *info)
> >                 goto err_unlock;
> >         }
> >
> > +       rxq_bitmap = bitmap_alloc(netdev->num_rx_queues, GFP_KERNEL);
> > +       if (!rxq_bitmap) {
> > +               err = -ENOMEM;
> > +               goto err_unlock;
> > +       }
> > +       netdev_nl_read_rxq_bitmap(info, rxq_bitmap);
> > +
> >         dma_dev = netdev_queue_get_dma_dev(netdev, 0);
> >         binding = net_devmem_bind_dmabuf(netdev, dma_dev, DMA_FROM_DEVICE,
> >                                          dmabuf_fd, priv, info->extack);
> >         if (IS_ERR(binding)) {
> >                 err = PTR_ERR(binding);
> > -               goto err_unlock;
> > +               goto err_rxq_bitmap;
> >         }
> >
> > -       nla_for_each_attr_type(attr, NETDEV_A_DMABUF_QUEUES,
> > -                              genlmsg_data(info->genlhdr),
> > -                              genlmsg_len(info->genlhdr), rem) {
> > -               err = nla_parse_nested(
> > -                       tb, ARRAY_SIZE(netdev_queue_id_nl_policy) - 1, attr,
> > -                       netdev_queue_id_nl_policy, info->extack);
> > -               if (err < 0)
> > -                       goto err_unbind;
> > -
> > -               if (NL_REQ_ATTR_CHECK(info->extack, attr, tb, NETDEV_A_QUEUE_ID) ||
> > -                   NL_REQ_ATTR_CHECK(info->extack, attr, tb, NETDEV_A_QUEUE_TYPE)) {
> > -                       err = -EINVAL;
> > -                       goto err_unbind;
> > -               }
> > -
> > -               if (nla_get_u32(tb[NETDEV_A_QUEUE_TYPE]) != NETDEV_QUEUE_TYPE_RX) {
> > -                       NL_SET_BAD_ATTR(info->extack, tb[NETDEV_A_QUEUE_TYPE]);
> > -                       err = -EINVAL;
> > -                       goto err_unbind;
> > -               }
> > -
> > -               rxq_idx = nla_get_u32(tb[NETDEV_A_QUEUE_ID]);
> > -
> > +       for_each_set_bit(rxq_idx, rxq_bitmap, netdev->num_rx_queues) {
> 
> Is this code assuming that netdev->num_rx_queues (or
> real_num_rx_queues) <= BITS_PER_ULONG? Aren't there devices out there
> that support more than 64 hardware queues? If so, I guess you need a
> different data structure than a bitmap (or maybe there is arbirary
> sized bitmap library somewhere to use).
>
The bitmap API can handle any number of bits. Can it not?

Thanks,
Dragos

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

* Re: [RFC net-next v3 7/7] net: devmem: allow binding on rx queues with same MA devices
  2025-08-15 17:24   ` Jakub Kicinski
@ 2025-08-16  9:05     ` Dragos Tatulea
  0 siblings, 0 replies; 29+ messages in thread
From: Dragos Tatulea @ 2025-08-16  9:05 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: almasrymina, asml.silence, David S. Miller, Eric Dumazet,
	Paolo Abeni, Simon Horman, cratiu, tariqt, parav,
	Christoph Hellwig, netdev, linux-kernel

On Fri, Aug 15, 2025 at 10:24:33AM -0700, Jakub Kicinski wrote:
> On Fri, 15 Aug 2025 14:03:48 +0300 Dragos Tatulea wrote:
> > +		rxq_dma_dev = netdev_queue_get_dma_dev(netdev, rxq_idx);
> > +		/* Multi-PF netdev queues can belong to different DMA devoces.
Just saw the "devoces" typo. Will fix this too.

> > +		 * Block this case.
> > +		 */
> > +		if (rxq_dma_dev && dma_dev && rxq_dma_dev != dma_dev) {
> 
> Why rxq_dma_dev ? 🤔️
> Don't we want to error out if the first queue gave us a DMA dev but the
> second gave us a NULL ?
>
Hmm, yes... I didn't take this case into account. Will fix.

> > +			NL_SET_ERR_MSG(extack, "Can't bind to queues from different dma devices");
> 
> _FMT the conflicting queue IDs into this?
Sure. Will print the last dma_dev index and the current rxq_dma_dev index.

Thanks,
Dragos

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

* Re: [RFC net-next v3 4/7] net/mlx5e: add op for getting netdev DMA device
  2025-08-15 17:37   ` Mina Almasry
@ 2025-08-18 17:40     ` Dragos Tatulea
  2025-08-18 18:18       ` Mina Almasry
  0 siblings, 1 reply; 29+ messages in thread
From: Dragos Tatulea @ 2025-08-18 17:40 UTC (permalink / raw)
  To: Mina Almasry
  Cc: asml.silence, Saeed Mahameed, Tariq Toukan, Mark Bloch,
	Leon Romanovsky, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, cratiu, parav, Christoph Hellwig,
	netdev, linux-rdma, linux-kernel

On Fri, Aug 15, 2025 at 10:37:15AM -0700, Mina Almasry wrote:
> On Fri, Aug 15, 2025 at 4:07 AM Dragos Tatulea <dtatulea@nvidia.com> wrote:
> >
> > For zero-copy (devmem, io_uring), the netdev DMA device used
> > is the parent device of the net device. However that is not
> > always accurate for mlx5 devices:
> > - SFs: The parent device is an auxdev.
> > - Multi-PF netdevs: The DMA device should be determined by
> >   the queue.
> >
> > This change implements the DMA device queue API that returns the DMA
> > device appropriately for all cases.
> >
> > Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
> > ---
> >  .../net/ethernet/mellanox/mlx5/core/en_main.c | 24 +++++++++++++++++++
> >  1 file changed, 24 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> > index 21bb88c5d3dc..0e48065a46eb 100644
> > --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> > @@ -5625,12 +5625,36 @@ static int mlx5e_queue_start(struct net_device *dev, void *newq,
> >         return 0;
> >  }
> >
> > +static struct device *mlx5e_queue_get_dma_dev(struct net_device *dev,
> > +                                             int queue_index)
> > +{
> > +       struct mlx5e_priv *priv = netdev_priv(dev);
> > +       struct mlx5e_channels *channels;
> > +       struct device *pdev = NULL;
> > +       struct mlx5e_channel *ch;
> > +
> > +       channels = &priv->channels;
> > +
> > +       mutex_lock(&priv->state_lock);
> > +
> > +       if (queue_index >= channels->num)
> > +               goto out;
> > +
> > +       ch = channels->c[queue_index];
> > +       pdev = ch->pdev;
> 
> This code assumes priv is initialized, and probably that the device is
> up/running/registered. At first I thought that was fine, but now that
> I look at the code more closely, netdev_nl_bind_rx_doit checks if the
> device is present but doesn't seem to check that the device is
> registered.
> 
> I wonder if we should have a generic check in netdev_nl_bind_rx_doit
> for NETDEV_REGISTERED, and if not, does this code handle unregistered
> netdev correctly (like netdev_priv and priv->channels are valid even
> for unregistered mlx5 devices)?
>
netdev_get_by_index_lock() returns non-NULL only when the device is in
state NETDEV_REGISTERED or NETREG_UNINITIALIZED. So I think  that this
check should suffice.

Thanks,
Dragos

^ permalink raw reply	[flat|nested] 29+ 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 DMA devices Dragos Tatulea
@ 2025-08-18 18:16   ` Mina Almasry
  2025-08-19 16:04   ` Pavel Begunkov
  1 sibling, 0 replies; 29+ 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] 29+ messages in thread

* Re: [RFC net-next v3 4/7] net/mlx5e: add op for getting netdev DMA device
  2025-08-18 17:40     ` Dragos Tatulea
@ 2025-08-18 18:18       ` Mina Almasry
  0 siblings, 0 replies; 29+ messages in thread
From: Mina Almasry @ 2025-08-18 18:18 UTC (permalink / raw)
  To: Dragos Tatulea
  Cc: asml.silence, Saeed Mahameed, Tariq Toukan, Mark Bloch,
	Leon Romanovsky, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, cratiu, parav, Christoph Hellwig,
	netdev, linux-rdma, linux-kernel

On Mon, Aug 18, 2025 at 10:40 AM Dragos Tatulea <dtatulea@nvidia.com> wrote:
>
> On Fri, Aug 15, 2025 at 10:37:15AM -0700, Mina Almasry wrote:
> > On Fri, Aug 15, 2025 at 4:07 AM Dragos Tatulea <dtatulea@nvidia.com> wrote:
> > >
> > > For zero-copy (devmem, io_uring), the netdev DMA device used
> > > is the parent device of the net device. However that is not
> > > always accurate for mlx5 devices:
> > > - SFs: The parent device is an auxdev.
> > > - Multi-PF netdevs: The DMA device should be determined by
> > >   the queue.
> > >
> > > This change implements the DMA device queue API that returns the DMA
> > > device appropriately for all cases.
> > >
> > > Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
> > > ---
> > >  .../net/ethernet/mellanox/mlx5/core/en_main.c | 24 +++++++++++++++++++
> > >  1 file changed, 24 insertions(+)
> > >
> > > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> > > index 21bb88c5d3dc..0e48065a46eb 100644
> > > --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> > > +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> > > @@ -5625,12 +5625,36 @@ static int mlx5e_queue_start(struct net_device *dev, void *newq,
> > >         return 0;
> > >  }
> > >
> > > +static struct device *mlx5e_queue_get_dma_dev(struct net_device *dev,
> > > +                                             int queue_index)
> > > +{
> > > +       struct mlx5e_priv *priv = netdev_priv(dev);
> > > +       struct mlx5e_channels *channels;
> > > +       struct device *pdev = NULL;
> > > +       struct mlx5e_channel *ch;
> > > +
> > > +       channels = &priv->channels;
> > > +
> > > +       mutex_lock(&priv->state_lock);
> > > +
> > > +       if (queue_index >= channels->num)
> > > +               goto out;
> > > +
> > > +       ch = channels->c[queue_index];
> > > +       pdev = ch->pdev;
> >
> > This code assumes priv is initialized, and probably that the device is
> > up/running/registered. At first I thought that was fine, but now that
> > I look at the code more closely, netdev_nl_bind_rx_doit checks if the
> > device is present but doesn't seem to check that the device is
> > registered.
> >
> > I wonder if we should have a generic check in netdev_nl_bind_rx_doit
> > for NETDEV_REGISTERED, and if not, does this code handle unregistered
> > netdev correctly (like netdev_priv and priv->channels are valid even
> > for unregistered mlx5 devices)?
> >
> netdev_get_by_index_lock() returns non-NULL only when the device is in
> state NETDEV_REGISTERED or NETREG_UNINITIALIZED. So I think  that this
> check should suffice.
>

Ack, thanks for checking. For the patch:

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



-- 
Thanks,
Mina

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

* Re: [RFC net-next v3 5/7] net: devmem: pull out dma_dev out of net_devmem_bind_dmabuf
  2025-08-15 11:03 ` [RFC net-next v3 5/7] net: devmem: pull out dma_dev out of net_devmem_bind_dmabuf Dragos Tatulea
@ 2025-08-18 18:22   ` Mina Almasry
  0 siblings, 0 replies; 29+ messages in thread
From: Mina Almasry @ 2025-08-18 18:22 UTC (permalink / raw)
  To: Dragos Tatulea
  Cc: asml.silence, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman, cratiu, tariqt, parav,
	Christoph Hellwig, netdev, linux-kernel

On Fri, Aug 15, 2025 at 4:07 AM Dragos Tatulea <dtatulea@nvidia.com> wrote:
>
> Fetch the DMA device before calling net_devmem_bind_dmabuf()
> and pass it on as a parameter.
>
> This is needed for an upcoming change which will read the
> DMA device per queue.
>
> This patch has no functional changes.
>
> Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>

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

-- 
Thanks,
Mina

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

* Re: [RFC net-next v3 6/7] net: devmem: pre-read requested rx queues during bind
  2025-08-16  8:59     ` Dragos Tatulea
@ 2025-08-18 18:24       ` Mina Almasry
  0 siblings, 0 replies; 29+ messages in thread
From: Mina Almasry @ 2025-08-18 18:24 UTC (permalink / raw)
  To: Dragos Tatulea
  Cc: asml.silence, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman, cratiu, tariqt, parav,
	Christoph Hellwig, netdev, linux-kernel

On Sat, Aug 16, 2025 at 1:59 AM Dragos Tatulea <dtatulea@nvidia.com> wrote:
>
> On Fri, Aug 15, 2025 at 11:05:56AM -0700, Mina Almasry wrote:
> > On Fri, Aug 15, 2025 at 4:07 AM Dragos Tatulea <dtatulea@nvidia.com> wrote:
> > >
> > > Instead of reading the requested rx queues after binding the buffer,
> > > read the rx queues in advance in a bitmap and iterate over them when
> > > needed.
> > >
> > > This is a preparation for fetching the DMA device for each queue.
> > >
> > > This patch has no functional changes.
> > >
> > > Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
> > > ---
> > >  net/core/netdev-genl.c | 76 +++++++++++++++++++++++++++---------------
> > >  1 file changed, 49 insertions(+), 27 deletions(-)
> > >
> > > diff --git a/net/core/netdev-genl.c b/net/core/netdev-genl.c
> > > index 3e2d6aa6e060..3e990f100bf0 100644
> > > --- a/net/core/netdev-genl.c
> > > +++ b/net/core/netdev-genl.c
> > > @@ -869,17 +869,50 @@ int netdev_nl_qstats_get_dumpit(struct sk_buff *skb,
> > >         return err;
> > >  }
> > >
> > > -int netdev_nl_bind_rx_doit(struct sk_buff *skb, struct genl_info *info)
> > > +static int netdev_nl_read_rxq_bitmap(struct genl_info *info,
> > > +                                    unsigned long *rxq_bitmap)
> > >  {
> > >         struct nlattr *tb[ARRAY_SIZE(netdev_queue_id_nl_policy)];
> > > +       struct nlattr *attr;
> > > +       int rem, err = 0;
> > > +       u32 rxq_idx;
> > > +
> > > +       nla_for_each_attr_type(attr, NETDEV_A_DMABUF_QUEUES,
> > > +                              genlmsg_data(info->genlhdr),
> > > +                              genlmsg_len(info->genlhdr), rem) {
> > > +               err = nla_parse_nested(
> > > +                       tb, ARRAY_SIZE(netdev_queue_id_nl_policy) - 1, attr,
> > > +                       netdev_queue_id_nl_policy, info->extack);
> > > +               if (err < 0)
> > > +                       return err;
> > > +
> > > +               if (NL_REQ_ATTR_CHECK(info->extack, attr, tb, NETDEV_A_QUEUE_ID) ||
> > > +                   NL_REQ_ATTR_CHECK(info->extack, attr, tb, NETDEV_A_QUEUE_TYPE))
> > > +                       return -EINVAL;
> > > +
> > > +               if (nla_get_u32(tb[NETDEV_A_QUEUE_TYPE]) != NETDEV_QUEUE_TYPE_RX) {
> > > +                       NL_SET_BAD_ATTR(info->extack, tb[NETDEV_A_QUEUE_TYPE]);
> > > +                       return -EINVAL;
> > > +               }
> > > +
> > > +               rxq_idx = nla_get_u32(tb[NETDEV_A_QUEUE_ID]);
> > > +
> > > +               bitmap_set(rxq_bitmap, rxq_idx, 1);
> > > +       }
> > > +
> > > +       return 0;
> > > +}
> > > +
> > > +int netdev_nl_bind_rx_doit(struct sk_buff *skb, struct genl_info *info)
> > > +{
> > >         struct net_devmem_dmabuf_binding *binding;
> > >         u32 ifindex, dmabuf_fd, rxq_idx;
> > >         struct netdev_nl_sock *priv;
> > >         struct net_device *netdev;
> > > +       unsigned long *rxq_bitmap;
> > >         struct device *dma_dev;
> > >         struct sk_buff *rsp;
> > > -       struct nlattr *attr;
> > > -       int rem, err = 0;
> > > +       int err = 0;
> > >         void *hdr;
> > >
> > >         if (GENL_REQ_ATTR_CHECK(info, NETDEV_A_DEV_IFINDEX) ||
> > > @@ -922,37 +955,22 @@ int netdev_nl_bind_rx_doit(struct sk_buff *skb, struct genl_info *info)
> > >                 goto err_unlock;
> > >         }
> > >
> > > +       rxq_bitmap = bitmap_alloc(netdev->num_rx_queues, GFP_KERNEL);
> > > +       if (!rxq_bitmap) {
> > > +               err = -ENOMEM;
> > > +               goto err_unlock;
> > > +       }
> > > +       netdev_nl_read_rxq_bitmap(info, rxq_bitmap);
> > > +
> > >         dma_dev = netdev_queue_get_dma_dev(netdev, 0);
> > >         binding = net_devmem_bind_dmabuf(netdev, dma_dev, DMA_FROM_DEVICE,
> > >                                          dmabuf_fd, priv, info->extack);
> > >         if (IS_ERR(binding)) {
> > >                 err = PTR_ERR(binding);
> > > -               goto err_unlock;
> > > +               goto err_rxq_bitmap;
> > >         }
> > >
> > > -       nla_for_each_attr_type(attr, NETDEV_A_DMABUF_QUEUES,
> > > -                              genlmsg_data(info->genlhdr),
> > > -                              genlmsg_len(info->genlhdr), rem) {
> > > -               err = nla_parse_nested(
> > > -                       tb, ARRAY_SIZE(netdev_queue_id_nl_policy) - 1, attr,
> > > -                       netdev_queue_id_nl_policy, info->extack);
> > > -               if (err < 0)
> > > -                       goto err_unbind;
> > > -
> > > -               if (NL_REQ_ATTR_CHECK(info->extack, attr, tb, NETDEV_A_QUEUE_ID) ||
> > > -                   NL_REQ_ATTR_CHECK(info->extack, attr, tb, NETDEV_A_QUEUE_TYPE)) {
> > > -                       err = -EINVAL;
> > > -                       goto err_unbind;
> > > -               }
> > > -
> > > -               if (nla_get_u32(tb[NETDEV_A_QUEUE_TYPE]) != NETDEV_QUEUE_TYPE_RX) {
> > > -                       NL_SET_BAD_ATTR(info->extack, tb[NETDEV_A_QUEUE_TYPE]);
> > > -                       err = -EINVAL;
> > > -                       goto err_unbind;
> > > -               }
> > > -
> > > -               rxq_idx = nla_get_u32(tb[NETDEV_A_QUEUE_ID]);
> > > -
> > > +       for_each_set_bit(rxq_idx, rxq_bitmap, netdev->num_rx_queues) {
> >
> > Is this code assuming that netdev->num_rx_queues (or
> > real_num_rx_queues) <= BITS_PER_ULONG? Aren't there devices out there
> > that support more than 64 hardware queues? If so, I guess you need a
> > different data structure than a bitmap (or maybe there is arbirary
> > sized bitmap library somewhere to use).
> >
> The bitmap API can handle any number of bits. Can it not?
>

Ah, yes, I missed this:

+       rxq_bitmap = bitmap_alloc(netdev->num_rx_queues, GFP_KERNEL);


Which allocates netdev->num_rx_queues bits. I was confused by the fact
that rxq_bitmap is an unsigned long * and thought that was the # of
bits in the map.

This patch should be good just with conversion to netdev->real_num_rx_queues.

-- 
Thanks,
Mina

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

* Re: [RFC net-next v3 1/7] queue_api: add support for fetching per queue DMA dev
  2025-08-15 17:16   ` Jakub Kicinski
@ 2025-08-19 14:41     ` Dragos Tatulea
  2025-08-19 15:30       ` Jakub Kicinski
  0 siblings, 1 reply; 29+ messages in thread
From: Dragos Tatulea @ 2025-08-19 14:41 UTC (permalink / raw)
  To: Jakub Kicinski, almasrymina
  Cc: almasrymina, asml.silence, David S. Miller, Eric Dumazet,
	Paolo Abeni, Simon Horman, cratiu, tariqt, parav,
	Christoph Hellwig, netdev, linux-kernel

On Fri, Aug 15, 2025 at 10:16:27AM -0700, Jakub Kicinski wrote:
> On Fri, 15 Aug 2025 14:03:42 +0300 Dragos Tatulea wrote:
> > +static inline struct device *
> > +netdev_queue_get_dma_dev(struct net_device *dev, int idx)
> > +{
> > +	const struct netdev_queue_mgmt_ops *queue_ops = dev->queue_mgmt_ops;
> > +	struct device *dma_dev;
> > +
> > +	if (queue_ops && queue_ops->ndo_queue_get_dma_dev)
> > +		dma_dev = queue_ops->ndo_queue_get_dma_dev(dev, idx);
> > +	else
> > +		dma_dev = dev->dev.parent;
> > +
> > +	return dma_dev && dma_dev->dma_mask ? dma_dev : NULL;
> > +}
> 
> This really does not have to live in the header file.
Alright, but where? It somewhat fits in the existing net/core/dev.c or
net/core/netdev_rx_queue.c. But neither is great.

Maybe it is time to create a net/core/netdev_queues.c?

Thanks,
Dragos

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

* Re: [RFC net-next v3 1/7] queue_api: add support for fetching per queue DMA dev
  2025-08-19 14:41     ` Dragos Tatulea
@ 2025-08-19 15:30       ` Jakub Kicinski
  0 siblings, 0 replies; 29+ messages in thread
From: Jakub Kicinski @ 2025-08-19 15:30 UTC (permalink / raw)
  To: Dragos Tatulea
  Cc: almasrymina, asml.silence, David S. Miller, Eric Dumazet,
	Paolo Abeni, Simon Horman, cratiu, tariqt, parav,
	Christoph Hellwig, netdev, linux-kernel

On Tue, 19 Aug 2025 14:41:08 +0000 Dragos Tatulea wrote:
> On Fri, Aug 15, 2025 at 10:16:27AM -0700, Jakub Kicinski wrote:
> > On Fri, 15 Aug 2025 14:03:42 +0300 Dragos Tatulea wrote:  
> > > +static inline struct device *
> > > +netdev_queue_get_dma_dev(struct net_device *dev, int idx)
> > > +{
> > > +	const struct netdev_queue_mgmt_ops *queue_ops = dev->queue_mgmt_ops;
> > > +	struct device *dma_dev;
> > > +
> > > +	if (queue_ops && queue_ops->ndo_queue_get_dma_dev)
> > > +		dma_dev = queue_ops->ndo_queue_get_dma_dev(dev, idx);
> > > +	else
> > > +		dma_dev = dev->dev.parent;
> > > +
> > > +	return dma_dev && dma_dev->dma_mask ? dma_dev : NULL;
> > > +}  
> > 
> > This really does not have to live in the header file.  
> Alright, but where? It somewhat fits in the existing net/core/dev.c or
> net/core/netdev_rx_queue.c. But neither is great.
> 
> Maybe it is time to create a net/core/netdev_queues.c?

Sure, net/core/netdev_queues.c SGTM

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

* Re: [RFC net-next v3 1/7] queue_api: add support for fetching per queue DMA dev
  2025-08-15 11:03 ` [RFC net-next v3 1/7] queue_api: add support for fetching per queue DMA dev Dragos Tatulea
  2025-08-15 17:16   ` Jakub Kicinski
  2025-08-15 18:11   ` Mina Almasry
@ 2025-08-19 15:56   ` Pavel Begunkov
  2 siblings, 0 replies; 29+ messages in thread
From: Pavel Begunkov @ 2025-08-19 15:56 UTC (permalink / raw)
  To: Dragos Tatulea, almasrymina, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman
  Cc: cratiu, tariqt, parav, Christoph Hellwig, netdev, linux-kernel

On 8/15/25 12:03, Dragos Tatulea wrote:
> For zerocopy (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.
> 
> This patch introduces the a queue based interface for allowing drivers
> to expose a different DMA device for zerocopy.
> 
> [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>
> ---
>   include/net/netdev_queues.h | 20 ++++++++++++++++++++
>   1 file changed, 20 insertions(+)

Assuming it'll be moved and uninlined

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

-- 
Pavel Begunkov


^ permalink raw reply	[flat|nested] 29+ 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 DMA devices Dragos Tatulea
  2025-08-18 18:16   ` Mina Almasry
@ 2025-08-19 16:04   ` Pavel Begunkov
  1 sibling, 0 replies; 29+ 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] 29+ messages in thread

end of thread, other threads:[~2025-08-19 16:03 UTC | newest]

Thread overview: 29+ 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 1/7] queue_api: add support for fetching per queue DMA dev Dragos Tatulea
2025-08-15 17:16   ` Jakub Kicinski
2025-08-19 14:41     ` Dragos Tatulea
2025-08-19 15:30       ` Jakub Kicinski
2025-08-15 18:11   ` Mina Almasry
2025-08-16  8:55     ` Dragos Tatulea
2025-08-19 15:56   ` Pavel Begunkov
2025-08-15 11:03 ` [RFC net-next v3 2/7] io_uring/zcrx: add support for custom DMA devices Dragos Tatulea
2025-08-18 18:16   ` Mina Almasry
2025-08-19 16:04   ` Pavel Begunkov
2025-08-15 11:03 ` [RFC net-next v3 3/7] net: devmem: get netdev DMA device via new API Dragos Tatulea
2025-08-15 17:30   ` Mina Almasry
2025-08-15 11:03 ` [RFC net-next v3 4/7] net/mlx5e: add op for getting netdev DMA device Dragos Tatulea
2025-08-15 17:37   ` Mina Almasry
2025-08-18 17:40     ` Dragos Tatulea
2025-08-18 18:18       ` Mina Almasry
2025-08-15 11:03 ` [RFC net-next v3 5/7] net: devmem: pull out dma_dev out of net_devmem_bind_dmabuf Dragos Tatulea
2025-08-18 18:22   ` Mina Almasry
2025-08-15 11:03 ` [RFC net-next v3 6/7] net: devmem: pre-read requested rx queues during bind Dragos Tatulea
2025-08-15 17:20   ` Jakub Kicinski
2025-08-15 18:05   ` Mina Almasry
2025-08-16  8:59     ` Dragos Tatulea
2025-08-18 18:24       ` Mina Almasry
2025-08-15 11:03 ` [RFC net-next v3 7/7] net: devmem: allow binding on rx queues with same MA devices Dragos Tatulea
2025-08-15 17:24   ` Jakub Kicinski
2025-08-16  9:05     ` Dragos Tatulea
2025-08-15 15:31 ` [RFC net-next v3 0/7] devmem/io_uring: allow more flexibility for ZC DMA devices 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;
as well as URLs for NNTP newsgroup(s).