[libvirt] SRIOV configuration

Daniel P. Berrangé berrange at redhat.com
Thu Sep 24 14:54:06 UTC 2020


On Mon, Sep 21, 2020 at 06:04:36PM +0300, Edward Haas wrote:
> The PCI addresses appearing on the domxml are not the same as the ones
> mappend/detected in the VM itself. I compared the domxml on the host
> and the lspci in the VM while the VM runs.

Can you clarify what you are comparing here ?

The PCI slot / function in the libvirt XML should match, but the "bus"
number in libvirt XML is just a index referencing the <controller>
element in the libvirt XML.  So the "bus" number won't directly match
what's reported in the guest OS. If you want to correlate, you need
to look at the <address> on the <controller> to translate the libvirt
"bus" number.

> This occurs only when SRIOV is defined, messing up also the other
> "regular" vnics.
> Somehow, everything comes up and runs (with the SRIOV interface as
> well) on the first boot (even though the PCI addresses are not in
> sync), but additional boots cause the VM to mess up the interfaces
> (not all are detected).
> 
> This is how the domxml hostdev section looks like:
> ```
>     <hostdev mode='subsystem' type='pci' managed='yes'>
>       <driver name='vfio'/>
>       <source>
>         <address domain='0x0000' bus='0x3b' slot='0x0a' function='0x4'/>
>       </source>
>       <alias name='hostdev0'/>
>       <address type='pci' domain='0x0000' bus='0x06' slot='0x01'
> function='0x0'/>
>     </hostdev>
> ```
> 
> Is there something we are missing or we misconfigured?
> Tested with 6.0.0-16.fc31
> 
> My second question is: Can libvirt avoid accessing the PF (as we do
> not need mac and other options).

I'm not sure, probably a question for Laine.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




More information about the libvirt-users mailing list