Skip to content

Commit c23d92b

Browse files
awilliamJeff Kirsher
authored andcommitted
igb: Teardown SR-IOV before unregister_netdev()
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 <[email protected]> Acked-by: Mitch Williams <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 51045ec commit c23d92b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/net/ethernet/intel/igb/igb_main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2809,14 +2809,14 @@ static void igb_remove(struct pci_dev *pdev)
28092809
*/
28102810
igb_release_hw_control(adapter);
28112811

2812-
unregister_netdev(netdev);
2813-
2814-
igb_clear_interrupt_scheme(adapter);
2815-
28162812
#ifdef CONFIG_PCI_IOV
28172813
igb_disable_sriov(pdev);
28182814
#endif
28192815

2816+
unregister_netdev(netdev);
2817+
2818+
igb_clear_interrupt_scheme(adapter);
2819+
28202820
pci_iounmap(pdev, hw->hw_addr);
28212821
if (hw->flash_address)
28222822
iounmap(hw->flash_address);

0 commit comments

Comments
 (0)