Properly cleanup driver during remove_one() in mlx5core.

Cleanup all host resources, SYSCTLs, MSIX vectors and memory used
by the host and only leave the device allocated memory behind, if any,
because it may still be in use, when the PCI remove function is called.
Else future probe calls may fail due to SYSCTLs already existing.

MFC after:		1 week
Sponsored by:		Mellanox Technologies // NVIDIA Networking
This commit is contained in:
Hans Petter Selasky 2020-10-07 17:46:49 +00:00
parent e7a39b856a
commit 194ddc011a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=366518

View File

@ -1665,9 +1665,8 @@ static void remove_one(struct pci_dev *pdev)
struct mlx5_priv *priv = &dev->priv;
if (mlx5_unload_one(dev, priv, true)) {
mlx5_core_err(dev, "mlx5_unload_one failed\n");
mlx5_health_cleanup(dev);
return;
mlx5_core_err(dev, "mlx5_unload_one() failed, leaked %lld bytes\n",
(long long)(dev->priv.fw_pages * MLX5_ADAPTER_PAGE_SIZE));
}
mlx5_pagealloc_cleanup(dev);