[libvirt] [PATCH v2 0/4] Interface pools and passthrough mode

Shradha Shah sshah at solarflare.com
Mon Dec 12 11:04:09 UTC 2011


Interface Pools and Passthrough mode:

Current Method:
The passthrough mode uses a macvtap direct connection to connect each guest to the network. The physical interface to be used is picked from among those listed in <interface> sub elements of the <forward> element.

The current specification for <forward> extends to allow 0 or more <interface> sub-elements:
Example:
<forward mode='passthrough' dev='eth10'/>
<interface dev='eth10'/>
<interface dev='eth12'/>
<interface dev='eth18'/>
<interface dev='eth20'/>
</forward>

However with an ethernet card with 64 VF's or more, the above method gets tedious on the system.

On the other hand, just parameterizing a string (eth%d) is inadequate, eg, when there are multiple non-contiguous ranges.

Proposed Method:
The 4 patches provided:

i) Introduce a new element 'pf' to implicitly create an interface pool of all the Virtual Functions attached to the specified Physical Function.  
ii) Modify the networkAllocateActualDevice, networkNotifyActualDevice and networkReleaseActualDevice API to use the above mentioned interface pool in the passthrough mode.

Hence Libvirt will now support both the methods mentioned below:

* Explicit interface list. App inputs:

    <forward mode='passthrough'>
     <interface dev='eth10'/>
     <interface dev='eth11'/>
     <interface dev='eth12'/>
     <interface dev='eth13'/>
    </forward>

   libvirt does not change XML

* Automatically interface list from PF. App inputs:

     <forward mode='passthrough'>
      <pf dev='eth0'/>
     </forward>

   libvirt expands XML to be

    <forward mode='passthrough'>
      <pf dev='eth0'/>
      <interface dev='eth10'/>
      <interface dev='eth11'/>
      <interface dev='eth12'/>
      <interface dev='eth13'/>
     </forward>

In the above case we need to differentiate between the implicit and explicit interface pool, which can be done by comparing the dumpxml from active and inactive domains. 
This will need the addition of the flag VIR_NETWORK_XML_INACTIVE to virNetworkGetXMLDesc() as mentioned in a previous suggestion.
I will post this as a separate patch series.

Shradha Shah (4):
  Added function pciSysfsFile to enable access to the PCI SYSFS files.
  Added Function virNetDevGetVirtualFunctions
  Adding the element pf to network xml.
  Functionality to implicitly get interface pool from SR-IOV PF.

 docs/schemas/network.rng    |    7 +++
 src/conf/network_conf.c     |   69 ++++++++++++++++++++++++++++++--
 src/conf/network_conf.h     |    3 +
 src/network/bridge_driver.c |   93 +++++++++++++++++++++++++++++++++---------
 src/util/pci.c              |   39 ++++++++++++++++++
 src/util/pci.h              |    7 +++
 src/util/virnetdev.c        |   83 ++++++++++++++++++++++++++++++++++++++
 src/util/virnetdev.h        |    6 +++
 8 files changed, 283 insertions(+), 24 deletions(-)

-- 
1.7.4.4




More information about the libvir-list mailing list