On Thu, 2014-01-30 at 22:54 +0530, Bandan Das wrote: > Some drivers such as ixgbe rely on pci_vfs_assigned() to prevent > disabling sr-iov when vfs are still assigned during hotplug > event or module removal. Set and unset PCI_DEV_FLAGS_ASSIGNED > appropriately This flag has always felt like a band-aide for KVM device assignment because a device could be used without an actual driver attached to the device. vfio-pci is an actual driver, so why should it matter whether the device is assigned or in use by ixgbevf or in use by pci-vfio? It seems like sr-iov shouldn't be disabled so long as either a driver or this (needs to be deprecated) flag are set. Thanks, Alex > --- > drivers/vfio/pci/vfio_pci.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c > index 7ba0424..7cc7ed6 100644 > --- a/drivers/vfio/pci/vfio_pci.c > +++ b/drivers/vfio/pci/vfio_pci.c > @@ -90,6 +90,7 @@ static int vfio_pci_enable(struct vfio_pci_device *vdev) > vdev->has_vga = true; > #endif > > + pdev->dev_flags |= PCI_DEV_FLAGS_ASSIGNED; > return 0; > } > > @@ -149,6 +150,7 @@ static void vfio_pci_disable(struct vfio_pci_device *vdev) > __func__, dev_name(&pdev->dev), ret); > } > > + pdev->dev_flags &= ~PCI_DEV_FLAGS_ASSIGNED; > pci_restore_state(pdev); > } > -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html