Skip to content

igb/ixgbe: Fix ordering of SR-IOV teardown

Alex Williamson intel-wired-lan lkml netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 1 replyIn review
  2. v12 patches 7 repliesSuperseded

Changes in v2 from the cover letter

- Rebase to DaveM's net tree, context-only change
- Add Mitch's Acks

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2igb: Teardown SR-IOV before unregister_netdev()drivers/net/ethernet/intel/igb/igb_main.c+4 -41 reply
2/2ixgbe: Teardown SR-IOV before unregister_netdev()drivers/net/ethernet/intel/ixgbe/ixgbe_main.c+3 -30 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchMitch WilliamsAaron Brown
1/2A-b T-b
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] igb/ixgbe: Fix ordering of SR-IOV teardown

v2:
- Rebase to DaveM's net tree, context-only change
- Add Mitch's Acks

There's no functional change from v1, so the choice of v1 or v2 is just a matter of which maintainer wants to take these.

Original description:

When running a Windows 2012 R2 guest with a pair of VFs assigned through vfio-pci, we run into a problem trying to hot-unplug those VFs after the PF has unregistered the netdev. This is a common scenario if the PF is unbound from the driver while VFs are active. In the case of igb, the resulting guest behavior differs slightly between the Microsoft provided and Intel add-on guest drivers. With the Microsoft driver, the guest seems to stumble through ejecting both VFs, but takes longer than normal to do so. With the Intel drivers, only one VF is unplugged, but Device Manager still shows it as present. The second VF is non-functional but also still shown in Device Manager. At this point, the guest is in such a state that it will not cleanly shutdown. With ixgbe VFs, both the Microsoft and Intel drivers take on this latter behavior.

For both, I've found that disabling SR-IOV before unregistering the PF netdev device allows the hot-unplug to proceed without interruption or further ill behavior in the guest. This is true regardless of which driver is used. I don't fully understand what dependency is broken by unregistering the netdev prior to disabling SR-IOV, but I also don't see the benefit in delaying SR-IOV teardown in this call path. It could potentially be moved even earlier, but I'll let those more familiar with the hardware and code make that determination. In any case, the VM behavior is substantially improved by this slight re-ordering.

I don't have an i40e for testing, but it already appears to disable SR-IOV much earlier in the unbind path, so I wouldn't expect to find similar issues. Thanks,

Alex

---

Alex Williamson (2):
igb: Teardown SR-IOV before unregister_netdev()
ixgbe: Teardown SR-IOV before unregister_netdev()

 drivers/net/ethernet/intel/igb/igb_main.c     |    8 ++++----
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |    6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)