netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Alex Williamson <alex.williamson@redhat.com>,
	netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
	jogreene@redhat.com, Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 06/15] igb: Teardown SR-IOV before unregister_netdev()
Date: Tue, 18 Aug 2015 14:09:13 -0700	[thread overview]
Message-ID: <1439932162-1995-7-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1439932162-1995-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Alex Williamson <alex.williamson@redhat.com>

When the .remove() callback for a PF is called, SR-IOV support for the
device is disabled, which requires unbinding and removing the VFs.
The VFs may be in-use either by the host kernel or userspace, such as
assigned to a VM through vfio-pci.  In this latter case, the VFs may
be removed either by shutting down the VM or hot-unplugging the
devices from the VM.  Unfortunately in the case of a Windows 2012 R2
guest, hot-unplug is broken due to the ordering of the PF driver
teardown.  Disabling SR-IOV prior to unregister_netdev() avoids this
issue.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Acked-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/igb/igb_main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 67ac0ea..8d22298 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -2809,14 +2809,14 @@ static void igb_remove(struct pci_dev *pdev)
 	 */
 	igb_release_hw_control(adapter);
 
-	unregister_netdev(netdev);
-
-	igb_clear_interrupt_scheme(adapter);
-
 #ifdef CONFIG_PCI_IOV
 	igb_disable_sriov(pdev);
 #endif
 
+	unregister_netdev(netdev);
+
+	igb_clear_interrupt_scheme(adapter);
+
 	pci_iounmap(pdev, hw->hw_addr);
 	if (hw->flash_address)
 		iounmap(hw->flash_address);
-- 
2.4.3

  parent reply	other threads:[~2015-08-18 21:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-18 21:09 [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2015-08-18 Jeff Kirsher
2015-08-18 21:09 ` [net-next 01/15] igb: Fix oops caused by missing queue pairing Jeff Kirsher
2015-08-18 21:09 ` [net-next 02/15] igb: missing rtnl_unlock in igb_sriov_reinit() Jeff Kirsher
2015-08-18 21:09 ` [net-next 03/15] igb: do not re-init SR-IOV during probe Jeff Kirsher
2015-08-18 21:09 ` [net-next 04/15] igb: implement high frequency periodic output signals Jeff Kirsher
2015-08-18 21:09 ` [net-next 05/15] igb: add support for 1512 PHY Jeff Kirsher
2015-08-18 21:09 ` Jeff Kirsher [this message]
2015-08-18 21:09 ` [net-next 07/15] e100: Add a check after pci_pool_create to avoid null pointer dereference Jeff Kirsher
2015-08-18 21:09 ` [net-next 08/15] e100: Release skb when DMA mapping is failed in e100_xmit_prepare Jeff Kirsher
2015-08-18 21:09 ` [net-next 09/15] igb: Fix a deadlock in igb_sriov_reinit Jeff Kirsher
2015-08-18 21:09 ` [net-next 10/15] e1000e: Modify Tx/Rx configurations to avoid null pointer dereferences in e1000_open Jeff Kirsher
2015-08-18 21:09 ` [net-next 11/15] igb: Fix a memory leak in igb_probe Jeff Kirsher
2015-08-18 21:09 ` [net-next 12/15] igbvf: clear buffer_info->dma after dma_unmap_single() Jeff Kirsher
2015-08-18 21:09 ` [net-next 13/15] igb: make sure SR-IOV init uses the right number of queues Jeff Kirsher
2015-08-18 21:09 ` [net-next 14/15] ixgbe: Simplify port-specific macros Jeff Kirsher
2015-08-18 21:09 ` [net-next 15/15] ixgbe: TRIVIAL fix up double 'the' and comment style Jeff Kirsher
2015-08-19  3:21 ` [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2015-08-18 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1439932162-1995-7-git-send-email-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=alex.williamson@redhat.com \
    --cc=davem@davemloft.net \
    --cc=jogreene@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=sassmann@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).