svn commit: r366518 - head/sys/dev/mlx5/mlx5_core

Hans Petter Selasky hselasky at FreeBSD.org
Wed Oct 7 17:46:50 UTC 2020


Author: hselasky
Date: Wed Oct  7 17:46:49 2020
New Revision: 366518
URL: https://svnweb.freebsd.org/changeset/base/366518

Log:
  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

Modified:
  head/sys/dev/mlx5/mlx5_core/mlx5_main.c

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c
==============================================================================
--- head/sys/dev/mlx5/mlx5_core/mlx5_main.c	Wed Oct  7 15:22:48 2020	(r366517)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c	Wed Oct  7 17:46:49 2020	(r366518)
@@ -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);


More information about the svn-src-all mailing list