[PATCH 1/2] Add mrg_rxbuf option to virtio interfaces

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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     |  6 +++++-
 docs/schemas/domaincommon.rng |  5 +++++
 src/conf/domain_conf.c        | 14 ++++++++++++++
 src/conf/domain_conf.h        |  1 +
 4 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 679194f..96fb8de 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -3998,7 +3998,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>
@@ -4113,6 +4113,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>
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index d467dce..bc4b088 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -2425,6 +2425,11 @@
                     <ref name="virOnOff"/>
                   </attribute>
                 </optional>
+                <optional>
+                  <attribute name='mrg_rxbuf'>
+                    <ref name="virOnOff"/>
+                  </attribute>
+                </optional>
               </element>
             </optional>
             <optional>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index f0b715d..ef0eb3a 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -7944,6 +7944,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,
@@ -17585,6 +17595,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)
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 93f2314..626901b 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -938,6 +938,7 @@ struct _virDomainNetDef {
                 virTristateSwitch tso6;
                 virTristateSwitch ecn;
                 virTristateSwitch ufo;
+                virTristateSwitch mrg_rxbuf;
             } host;
             struct {
                 virTristateSwitch csum;
-- 
2.0.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]