Date: Wed, 7 Oct 2020 17:46:49 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366518 - head/sys/dev/mlx5/mlx5_core Message-ID: <202010071746.097Hkneh054240@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202010071746.097Hkneh054240>