net/mlx5: Disable SRIOV before PF removal
authorYishai Hadas <yishaih@nvidia.com>
Thu, 24 Feb 2022 14:20:12 +0000 (16:20 +0200)
committerLeon Romanovsky <leonro@nvidia.com>
Sun, 27 Feb 2022 09:40:23 +0000 (11:40 +0200)
commit143a41d7623d0e0baae173be2d8c5570198de064
treeeac503e8a2e68f472f072353080dc7050e62bfd9
parent6ebd25b80c0d325a4a7f12614885aaf33dae76ab
net/mlx5: Disable SRIOV before PF removal

Virtual functions depend on physical function for device access (for example
firmware host PAGE management), so make sure to disable SR-IOV once PF is gone.

This will prevent also the below warning if PF has gone before disabling SR-IOV.
"driver left SR-IOV enabled after remove"

Next patch from this series will rely on that when the VF may need to
access safely the PF 'driver data'.

Link: https://lore.kernel.org/all/20220224142024.147653-4-yishaih@nvidia.com
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/main.c
drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h
drivers/net/ethernet/mellanox/mlx5/core/sriov.c