[Intel-wired-lan] Not able to create VFs on PF passthrough of ethernet interface to VM

Jesse Brandeburg jesse.brandeburg at intel.com
Mon May 13 17:53:19 UTC 2019


On Mon, 13 May 2019 07:36:41 +0000 Periyasamy wrote:
> Hi,
> 
> I’m trying to achieve PF passthrough of 40/10G ethernet interface (i40e) into guest VM running on qemu/kvm hypervisor and then create VFs on the PF inside the VM.
> This is to have a flexibility and better manageability of VFs inside the VM (for example, kubernetes worker node) itself and not on the host.
> 
> 
> The ethernet PCI device is seen inside the VM and bound to i40e driver. But I don’t see an option to create VFs. i.e. sriov_numvfs file is not seen under /sys/devices/pci0000:00/0000:00:02.1/0000:02:00.0 directory.

Hi Periyasamy,

The PCI space itself is not passed-through, it is completely fake and
generated by QEMU.

Do you know if anyone has ever gotten what you're trying to do to
work?  I don't think you can do what you're trying to do with using a
VM to spawn SR-IOV devices, at least I've not heard of it working.

Basically you have a scoping problem.  At it's core, the PCI space is
owned by the host, not the VM, and the hardware is literally in the
host PCI device space no matter where you pass it to.  The hardware
actually creates (starts decoding addresses and PCI space for) the new
PCI devices when you enable the device via sriov_numvfs.  Those devices
will appear in space reserved by the host, for SR-IOV devices to
"appear", but there is no guarantee that memory range will be passed
through to the VF, and again all the VM PCI devices are "fake" PCI
config space, so without some daemon monitoring and adding the devices
via virsh or something, I doubt the VM would ever see them even.


> Host versions:
> OS: Ubuntu 16.04.5 LTS, Kernel: 4.15.0-48-generic, libvirt: 4.0.0, qemu: 2.11.1
> i40e version: 2.1.14-k, firmware-version: 6.01 0x800034a3 1.1747.0
> 
> Guest versions:
> OS: CentOS 7 (Core) Kernel: 3.10.0-862.14.4.el7.x86_64
> i40e version: 2.1.14-k, firmware-version: 6.01 0x800034a3 1.1747.0
> 
> The VM libvirt xml configuration [1], PF configuration at host [2], PF configuration at VM [3] are attached.
> The lspci output line nos. 63-75 related to SRIOV Capabilities in host [2] are missing in VM which looks bit weird.

as per above, the PCI config space is completely virtualized by QEMU.

Hope this helps!
Jesse


More information about the Intel-wired-lan mailing list