OSDN Git Service

ixgbe: Remove bimodal SR-IOV disabling
authorAlex Williamson <alex.williamson@redhat.com>
Fri, 10 Jul 2015 21:31:34 +0000 (15:31 -0600)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 2 Sep 2015 00:17:41 +0000 (17:17 -0700)
commit7837e2867f56ec4435e75af54236732885303694
tree424aa219424b99af69adbf2a63f85a032253ddb5
parent454adb008d78e4ecdfec3f2e5e9eb08ee5a60f1a
ixgbe: Remove bimodal SR-IOV disabling

When unbinding an SR-IOV device with VFs configured from ixgbe, the
driver behaves in one of two ways.  If max_vfs was specified, the
SR-IOV state is disabled, removing the VFs.  The occurs regardless of
whether the VF count was later modified through sysfs.  If however
max_vfs is zero, such as by not specifying the module parameter, the
VFs persist after the PF is unbound from ixgbe.  If the PF is then
bound to vfio-pci to be assigned to a VM, the PF is non-functional.

>From the comment, commit da36b64736cf ("ixgbe: Implement PCI SR-IOV
sysfs callback operation") clearly intended this alternate behavior,
but probably didn't realize the PF doesn't work in this mode.

This bimodal behavior is confusing to users and results in a state
where the PF is broken for other uses unless the user sets
sriov_numvfs to zero prior to unbinding the device.  Remove this
behavior so that VFs are removed and the PF is functional for other
uses after unbind, regardless of the way VFs are enabled.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Acked-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c