aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mlx5
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2021-01-08 11:06:11 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2021-01-08 11:35:55 +0000
commit480570dbb309585b04dcb6e9cb3f6b1e1a9bd683 (patch)
tree7c6eeb22b8fbc357cdfbe0dcb6240d77a1d0bf60 /sys/dev/mlx5
parent98140747ca93fa36f49103d6c01e47117b51f48c (diff)
downloadsrc-480570dbb309585b04dcb6e9cb3f6b1e1a9bd683.tar.gz
src-480570dbb309585b04dcb6e9cb3f6b1e1a9bd683.zip
Fixes for SRIOV in mlx5core.
- call pci_iov_detach() on detaching from PCI device to take care of hang on destroying VFs after PF is down. - disable eswitch SRIOV support right after pci_iov_detach(), else the eswitch cleanup sometimes occur while the SRIOV flow table is still present. Submitted by: kib@ MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking
Diffstat (limited to 'sys/dev/mlx5')
-rw-r--r--sys/dev/mlx5/mlx5_core/mlx5_main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/dev/mlx5/mlx5_core/mlx5_main.c b/sys/dev/mlx5/mlx5_core/mlx5_main.c
index 687e7f1b1e0d..843227f928fa 100644
--- a/sys/dev/mlx5/mlx5_core/mlx5_main.c
+++ b/sys/dev/mlx5/mlx5_core/mlx5_main.c
@@ -1664,6 +1664,11 @@ static void remove_one(struct pci_dev *pdev)
struct mlx5_core_dev *dev = pci_get_drvdata(pdev);
struct mlx5_priv *priv = &dev->priv;
+#ifdef PCI_IOV
+ pci_iov_detach(pdev->dev.bsddev);
+ mlx5_eswitch_disable_sriov(priv->eswitch);
+#endif
+
if (mlx5_unload_one(dev, priv, true)) {
mlx5_core_err(dev, "mlx5_unload_one() failed, leaked %lld bytes\n",
(long long)(dev->priv.fw_pages * MLX5_ADAPTER_PAGE_SIZE));