Skip to content

Commit e1ed30c

Browse files
msanallaSaeed Mahameed
authored andcommitted
net/mlx5: ECPF, wait for VF pages only after disabling host PFs
Currently, during the early stages of their unloading, particularly during SRIOV disablement, PFs/ECPFs wait on the release of all of their VFs memory pages. Furthermore, ECPFs are considered the page supplier for host VFs, hence the host VFs memory pages are freed only during ECPF cleanup when host interfaces get disabled. Thus, disabling SRIOV early in unload timeline causes the DPU ECPF to stall on driver unload while waiting on the release of host VF pages that won't be freed before host interfaces get disabled later on. Therefore, for ECPFs, wait on the release of VFs pages only after the disablement of host PFs during ECPF cleanup flow. Then, host PFs and VFs are disabled and their memory shall be freed accordingly. Fixes: 143a41d ("net/mlx5: Disable SRIOV before PF removal") Signed-off-by: Maher Sanalla <[email protected]> Reviewed-by: Moshe Shemesh <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 3a50cf1 commit e1ed30c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/ecpf.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,8 @@ void mlx5_ec_cleanup(struct mlx5_core_dev *dev)
9898
err = mlx5_wait_for_pages(dev, &dev->priv.page_counters[MLX5_HOST_PF]);
9999
if (err)
100100
mlx5_core_warn(dev, "Timeout reclaiming external host PF pages err(%d)\n", err);
101+
102+
err = mlx5_wait_for_pages(dev, &dev->priv.page_counters[MLX5_VF]);
103+
if (err)
104+
mlx5_core_warn(dev, "Timeout reclaiming external host VFs pages err(%d)\n", err);
101105
}

drivers/net/ethernet/mellanox/mlx5/core/sriov.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ mlx5_device_disable_sriov(struct mlx5_core_dev *dev, int num_vfs, bool clear_vf)
147147

148148
mlx5_eswitch_disable_sriov(dev->priv.eswitch, clear_vf);
149149

150+
/* For ECPFs, skip waiting for host VF pages until ECPF is destroyed */
151+
if (mlx5_core_is_ecpf(dev))
152+
return;
153+
150154
if (mlx5_wait_for_pages(dev, &dev->priv.page_counters[MLX5_VF]))
151155
mlx5_core_warn(dev, "timeout reclaiming VFs pages\n");
152156
}

0 commit comments

Comments
 (0)