]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Add mrg_rxbuf option to virtio interfaces
authorJán Tomko <jtomko@redhat.com>
Fri, 6 Feb 2015 14:35:57 +0000 (15:35 +0100)
committerJán Tomko <jtomko@redhat.com>
Fri, 13 Feb 2015 11:31:38 +0000 (12:31 +0100)
Add an XML attribute to allow disabling merge of rx buffers
on the host:
<interface ...>
  ...
  <model type='virtio'/>
  <driver ...>
    <host mrg_rxbuf='off'/>
  </driver>
</interface>

https://bugzilla.redhat.com/show_bug.cgi?id=1186886

docs/formatdomain.html.in
docs/schemas/domaincommon.rng
src/conf/domain_conf.c
src/conf/domain_conf.h

index 873a1c7b18597c51f608b540d694e112749e7983..f6477c28d4e079424d30480438fa879d8d0fc6ad 100644 (file)
@@ -4012,7 +4012,7 @@ qemu-kvm -net nic,model=? /dev/null
       &lt;target dev='vnet1'/&gt;
       &lt;model type='virtio'/&gt;
       <b>&lt;driver name='vhost' txmode='iothread' ioeventfd='on' event_idx='off' queues='5'&gt;
-        &lt;host csum='off' gso='off' tso4='off' tso6='off' ecn='off' ufo='off'/&gt;
+        &lt;host csum='off' gso='off' tso4='off' tso6='off' ecn='off' ufo='off' mrg_rxbuf='off'/&gt;
         &lt;guest csum='off' tso4='off' tso6='off' ecn='off' ufo='off'/&gt;
       &lt;/driver&gt;
       </b>
@@ -4127,6 +4127,10 @@ qemu-kvm -net nic,model=? /dev/null
         and <code>off</code> can be used to turn off host offloading options.
         By default, the supported offloads are enabled by QEMU.
         <span class="since">Since 1.2.9 (QEMU only)</span>
+        The <code>mrg_rxbuf</code> attribute can be used to control
+        mergeable rx buffers on the host side. Possible values are
+        <code>on</code> (default) and <code>off</code>.
+        <span class="since">Since 1.2.13 (QEMU only)</span>
       </dd>
       <dt><code>guest</code> offloading options</dt>
       <dd>
index 7a1d299b559484c871272a4d48d30628e682b4ef..27a24b46baa60ef59cf26882eaee7974ea713628 100644 (file)
                     <ref name="virOnOff"/>
                   </attribute>
                 </optional>
+                <optional>
+                  <attribute name='mrg_rxbuf'>
+                    <ref name="virOnOff"/>
+                  </attribute>
+                </optional>
               </element>
             </optional>
             <optional>
index fd3606379cb1b03c66ad85d7e453678830ea0c18..b13cae87e1a542fa6990d02fdbd79c6776699cf9 100644 (file)
@@ -8066,6 +8066,16 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
             def->driver.virtio.host.ufo = val;
         }
         VIR_FREE(str);
+        if ((str = virXPathString("string(./driver/host/@mrg_rxbuf)", ctxt))) {
+            if ((val = virTristateSwitchTypeFromString(str)) <= 0) {
+                virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                               _("unknown host mrg_rxbuf mode '%s'"),
+                               str);
+                goto error;
+            }
+            def->driver.virtio.host.mrg_rxbuf = val;
+        }
+        VIR_FREE(str);
         if ((str = virXPathString("string(./driver/guest/@csum)", ctxt))) {
             if ((val = virTristateSwitchTypeFromString(str)) <= 0) {
                 virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
@@ -17916,6 +17926,10 @@ virDomainVirtioNetHostOptsFormat(char **outstr,
         virBufferAsprintf(&buf, "ufo='%s' ",
                           virTristateSwitchTypeToString(def->driver.virtio.host.ufo));
     }
+    if (def->driver.virtio.host.mrg_rxbuf) {
+        virBufferAsprintf(&buf, "mrg_rxbuf='%s' ",
+                          virTristateSwitchTypeToString(def->driver.virtio.host.mrg_rxbuf));
+    }
     virBufferTrim(&buf, " ", -1);
 
     if (virBufferCheckError(&buf) < 0)
index da21bcefe113bc97701fce55910e36df3ce9c83e..325afa82c98a4c73fcf65328f40726314f7243ac 100644 (file)
@@ -938,6 +938,7 @@ struct _virDomainNetDef {
                 virTristateSwitch tso6;
                 virTristateSwitch ecn;
                 virTristateSwitch ufo;
+                virTristateSwitch mrg_rxbuf;
             } host;
             struct {
                 virTristateSwitch csum;