[RFC net-next 4/4] net/mlx5e: Enable HDS zerocopy flows for SFs
From: Dragos Tatulea
Date: Wed Jul 02 2025 - 13:28:20 EST
An SF has an auxiliary device as a parent. This type of device can't be
used for zerocopy DMA mapping operations. A PCI device is required.
Use the new netdev dma_dev functionality to expose the actual PCI device
to be used for DMA. Always set it to keep things generic.
Signed-off-by: Dragos Tatulea <dtatulea@xxxxxxxxxx>
---
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index e8e5b347f9b2..c4e45205fba4 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -5841,6 +5841,9 @@ static int mlx5e_nic_init(struct mlx5_core_dev *mdev,
/* update XDP supported features */
mlx5e_set_xdp_feature(netdev);
+ /* Set pci device for dma. Useful for SFs. */
+ netdev->dma_dev = &mdev->pdev->dev;
+
if (take_rtnl)
rtnl_unlock();
--
2.50.0