]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: ECPF, wait for VF pages only after disabling host PFs
authorMaher Sanalla <msanalla@nvidia.com>
Wed, 15 Feb 2023 18:12:05 +0000 (20:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 12:55:27 +0000 (13:55 +0100)
commit2ec7e58e98e6d4bdbf979625b0753f2f792ca60b
tree2cfc5d8d1509d8b70c68443ae1cb303c0b273ba6
parent65fd4cdc7f5ff55acad396f872bfb94a0ba7c054
net/mlx5: ECPF, wait for VF pages only after disabling host PFs

[ Upstream commit 5d35e9e5ae424b11414f0721b834ab0603b076d2 ]

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: b3a33494c91d ("net/mlx5: Disable SRIOV before PF removal")
Signed-off-by: Maher Sanalla <msanalla@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/ecpf.c
drivers/net/ethernet/mellanox/mlx5/core/sriov.c