From owner-dev-commits-src-branches@freebsd.org Fri Jan 22 12:30:23 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D7B944F38A1; Fri, 22 Jan 2021 12:30:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DMdrb5XTYz4p9v; Fri, 22 Jan 2021 12:30:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FF9B1E91D; Fri, 22 Jan 2021 12:30:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10MCUN6d000703; Fri, 22 Jan 2021 12:30:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10MCUNAY000702; Fri, 22 Jan 2021 12:30:23 GMT (envelope-from git) Date: Fri, 22 Jan 2021 12:30:23 GMT Message-Id: <202101221230.10MCUNAY000702@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 1dd0ee9b5382 - stable/12 - MFC 480570dbb309: Fixes for SRIOV in mlx5core. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 1dd0ee9b5382b0d9af0236587e3fe10b341f2a59 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2021 12:30:23 -0000 The branch stable/12 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=1dd0ee9b5382b0d9af0236587e3fe10b341f2a59 commit 1dd0ee9b5382b0d9af0236587e3fe10b341f2a59 Author: Hans Petter Selasky AuthorDate: 2021-01-08 11:06:11 +0000 Commit: Hans Petter Selasky CommitDate: 2021-01-22 12:09:35 +0000 MFC 480570dbb309: 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. Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/dev/mlx5/mlx5_core/mlx5_main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/mlx5/mlx5_core/mlx5_main.c b/sys/dev/mlx5/mlx5_core/mlx5_main.c index 8f41f3b30ac7..ce3a06d2f495 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_main.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_main.c @@ -1663,6 +1663,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));