From patchwork Sat Apr 1 00:26:03 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: 745852 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vvzgQ26rlz9s7k for ; Sat, 1 Apr 2017 11:26:09 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 8257081F8F; Sat, 1 Apr 2017 00:26:07 +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 ABta8tP86-Zc; Sat, 1 Apr 2017 00:26:06 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id BFC3281E96; Sat, 1 Apr 2017 00:26:06 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 450911C1FC5 for ; Sat, 1 Apr 2017 00:26:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 3708788D67 for ; Sat, 1 Apr 2017 00:26:05 +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 pCt+m-pJYjra for ; Sat, 1 Apr 2017 00:26:04 +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 hemlock.osuosl.org (Postfix) with ESMTPS id 7F26A88D66 for ; Sat, 1 Apr 2017 00:26:04 +0000 (UTC) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP; 31 Mar 2017 17:26:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.36,254,1486454400"; d="scan'208"; a="1114186761" Received: from mdrustad-mac04.sj.intel.com (HELO mdrustad-mac04.local) ([10.233.80.162]) by orsmga001.jf.intel.com with ESMTP; 31 Mar 2017 17:26:03 -0700 To: intel-wired-lan@lists.osuosl.org From: Mark D Rustad Date: Fri, 31 Mar 2017 17:26:03 -0700 Message-ID: <20170401002603.29536.93262.stgit@mdrustad-mac04.local> User-Agent: StGit/0.15 MIME-Version: 1.0 Subject: [Intel-wired-lan] [PATCH V2] 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. Signed-off-by: Mark Rustad --- Changes in V2: - Remove unwanted content in the changelog message - sorry about that --- 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);