From patchwork Sat Apr 1 00:10:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rustad, Mark D" X-Patchwork-Id: 745851 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vvzK814WXz9ryZ for ; Sat, 1 Apr 2017 11:10:20 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 7BF6A88E00; Sat, 1 Apr 2017 00:10:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qKS7zmW6+FKC; Sat, 1 Apr 2017 00:10:18 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id F2C3988D12; Sat, 1 Apr 2017 00:10:17 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 0EECD1C3EF6 for ; Sat, 1 Apr 2017 00:10:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0FE4386E5A for ; Sat, 1 Apr 2017 00:10:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8ZbQhaZk5kGs for ; Sat, 1 Apr 2017 00:10:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by whitealder.osuosl.org (Postfix) with ESMTPS id 1146185DCA for ; Sat, 1 Apr 2017 00:10:16 +0000 (UTC) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP; 31 Mar 2017 17:10:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.36,254,1486454400"; d="scan'208"; a="1149496146" Received: from mdrustad-mac04.sj.intel.com (HELO mdrustad-mac04.local) ([10.233.80.162]) by fmsmga002.fm.intel.com with ESMTP; 31 Mar 2017 17:10:15 -0700 To: intel-wired-lan@lists.osuosl.org From: Mark D Rustad Date: Fri, 31 Mar 2017 17:10:15 -0700 Message-ID: <20170401001015.29245.28963.stgit@mdrustad-mac04.local> User-Agent: StGit/0.15 MIME-Version: 1.0 Subject: [Intel-wired-lan] [PATCH] ixgbe: Allow disabling VFs when they are pre-existing X-BeenThere: intel-wired-lan@lists.osuosl.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@lists.osuosl.org Sender: "Intel-wired-lan" Right now if VFs existing when the driver is loaded, it is not possible to destroy those VFs, even though messages from the driver suggest doing that when trying to change the number. This change permits the disabling of SR-IOV for the case when there are pre-existing VFs. Testing-hints: Signed-off-by: Mark Rustad Change-type: DefectResolution Title: ixgbe: Allow disabling VFs when they are pre-existing --- src/CORE/ixgbe_sriov.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CORE/ixgbe_sriov.c b/src/CORE/ixgbe_sriov.c index 9b7d05110fe9..231acf274a70 100644 --- a/src/CORE/ixgbe_sriov.c +++ b/src/CORE/ixgbe_sriov.c @@ -603,7 +603,7 @@ static int ixgbe_pci_sriov_disable(struct pci_dev *dev) u32 current_flags = adapter->flags; #endif - if (adapter->num_vfs == 0) + if (!adapter->num_vfs && !pci_num_vf(dev)) return -EINVAL; err = ixgbe_disable_sriov(adapter);