[virt-tools-list] 答复: Re: [virt-manager PATCH] network: add support to create SR-IOV VFs pool

Jim Fehlig jfehlig at suse.com
Wed Mar 22 17:33:59 UTC 2017


Lin Ma wrote:
> 
> 
>>>> Cole Robinson <crobinso at redhat.com> 2017/3/18 星期六 上午 1:10 >>>
>>On 03/17/2017 04:02 AM, Lin Ma wrote:
>>> Create a network with a device pool containing all the VFs of an SR-IOV
>>> device.
>>>
>>> Signed-off-by: Lin Ma <lma at suse.com>
>>> ---
>>>  ui/createnet.ui          |  92 +++++++++++++++++++++++++++++++++-
>>>  virtManager/createnet.py | 127
> +++++++++++++++++++++++++++++------------------
>>>  virtinst/network.py      |  12 +++++
>>>  3 files changed, 182 insertions(+), 49 deletions(-)
>>
>>This breaks the test suite, you'll need to extend the network-* test in
>>tests/xmlparse.py
>>
>>"""
>>Second list contains 2 additional elements.
>>First extra element 0:
>><XMLProperty ./@dev 140596782899032>
>>
>>- []
>>+ [<XMLProperty ./@dev 140596782899032>,
>>+  <XMLProperty ./@managed 140596782936352>]
>>
>>
>>This means that there are XML properties that are
>>untested in the test suite. This could be caused
>>by a previous test suite failure, or if you added
>>a new property and didn't extend the test suite.
>>Look into extending clitest.py and/or xmlparse.py.
>>"""
> Thanks for your review, I'll try to learn how to add the tests :-)
>>I don't know much about this feature. Can you provide an example <network>
>>definition that we can add to tests/testdriver.xml?
> Please refer to
> https://wiki.libvirt.org/page/Networking#Assignment_from_a_pool_of_SRIOV_VFs_in_a_libvirt_.3Cnetwork.3E_definition
>  
> The example <network> is:
>  <network>
>    <name>passthrough</name>
>    <forward mode='hostdev' managed='yes'>
>      <pf dev='eth3'/>
>    </forward>
>  </network>
>  
> Should I add it to tests/testdriver.xml?
> (if no VFs on host, the network can't be created successfully)
> 
>>Also, is the XML meant to only use an SR-IOV host device? If so, is that
>>something we can detect from nodedev XML? Right now looks like your patch
>>shows all host devices regardless of whether they are SR-IOV enabled
> Yes, It's only use for an SR-IOV host device.
> I knew that showing all host devices regardless of whether they are
> SR-IOV enabled
> is not a good idea, but as far as I know, SR-IOV status can't be
> detected from
> nodedev XML so far.

I think it is possible to determine SR-IOV capabilities from the nodedev XML

# virsh nodedev-dumpxml pci_0000_09_00_2
<device>
  <name>pci_0000_09_00_2</name>
  <path>/sys/devices/pci0000:00/0000:00:1c.0/0000:09:00.2</path>
  <parent>pci_0000_00_1c_0</parent>
  <driver>
    <name>igb</name>
  </driver>
  <capability type='pci'>
    <domain>0</domain>
    <bus>9</bus>
    <slot>0</slot>
    <function>2</function>
    <product id='0x1521'>I350 Gigabit Network Connection</product>
    <vendor id='0x8086'>Intel Corporation</vendor>
    <capability type='virt_functions' maxCount='7'>
      <address domain='0x0000' bus='0x0a' slot='0x10' function='0x2'/>
      <address domain='0x0000' bus='0x0a' slot='0x10' function='0x6'/>
      <address domain='0x0000' bus='0x0a' slot='0x11' function='0x2'/>
      <address domain='0x0000' bus='0x0a' slot='0x11' function='0x6'/>
      <address domain='0x0000' bus='0x0a' slot='0x12' function='0x2'/>
      <address domain='0x0000' bus='0x0a' slot='0x12' function='0x6'/>
      <address domain='0x0000' bus='0x0a' slot='0x13' function='0x2'/>
    </capability>
    <numa node='0'/>
    <pci-express>
      <link validity='cap' port='0' speed='5' width='4'/>
      <link validity='sta' speed='5' width='4'/>
    </pci-express>
  </capability>
</device>

So this device has 'virt_functions' capability and currently has 7 configured.

Regards,
Jim




More information about the virt-tools-list mailing list