[openstack-dev] [nova][pci-passthrough] definitely specify VFIO driver as the host PCI driver for passthrough
Chen Fan
fan.chen at easystack.cn
Fri Jun 24 08:52:31 UTC 2016
On 2016年06月24日 16:20, Daniel P. Berrange wrote:
> On Fri, Jun 24, 2016 at 12:27:57PM +0800, Chen Fan wrote:
>> hi all,
>> in openstack, we can use the pci passthrough feature now, refer to
>> https://wiki.openstack.org/wiki/Pci_passthrough
>> but we can't definitely specify the host pci driver is LEGACY_KVM or
>> newer VFIO,
>> new VFIO driver is more safer, and higher-performance user-space driver
>> than legacy kvm driver (pci-stub), the benefit relative to kvm
>> assignment driver
>> could refer to http://lwn.net/Articles/474088/.
>> In additional, VFIO driver provides the GPU passthrough as primary card
>> support.
>> I think it is more useful for further GPU passthrough support in
>> openstack.
>>
>> Openstack relies on the libvirt nodedev device configuration to do pci
>> passthrough,
>> with managed mode, the configured device is automatically detached and
>> re-attached
>> with KVM or VFIO driver that depended on the host driver modules
>> configuration,
>> so now we can't specify the driver in openstack to VFIO mode, I think
>> we should need
>> to add this feature support in openstack to get pci passhthrough more
>> scalability.
>>
>> a simply idea is to add a option in nova.conf HOST_PCI_MODEL = VFIO
>> /KVM to specify
>> the pci passthrough device driver is using VFIO driver.
>> any comments are welcome. :)
> I don't see any reason to add a configuration option. If the host is
> capable of doing VFIO, libvirt will always aim to use VFIO in preference
> to the legacy system.
Hi Daniel,
sorry, I directly reference the implementation of nodedev in
libvirt, in function
virHostdevPreparePCIDevices :
257 if (pcisrc->backend == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO)
258 virPCIDeviceSetStubDriver(pci, VIR_PCI_STUB_DRIVER_VFIO);
259 else if (pcisrc->backend ==
VIR_DOMAIN_HOSTDEV_PCI_BACKEND_XEN)
260 virPCIDeviceSetStubDriver(pci, VIR_PCI_STUB_DRIVER_XEN);
261 else
262 virPCIDeviceSetStubDriver(pci, VIR_PCI_STUB_DRIVER_KVM);
IIUC, the stub driver should be "legacy KVM", do we need to change the
stub drvier
to VIR_PCI_STUB_DRIVER_VFIO by default.
Thanks,
Chen
>
>
> Regards,
> Daniel
--
Sincerely,
Chen Fan
More information about the OpenStack-dev
mailing list