Author: hselasky
Date: Tue Oct 20 08:25:53 2020
New Revision: 366881
URL: https://svnweb.freebsd.org/changeset/base/366881

Log:
  MFC r366518:
  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.
  
  Sponsored by:         Mellanox Technologies // NVIDIA Networking

Modified:
  stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c
==============================================================================
--- stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c        Tue Oct 20 08:25:02 
2020        (r366880)
+++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c        Tue Oct 20 08:25:53 
2020        (r366881)
@@ -1646,9 +1646,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);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to