From 6067182b0d50202a53db610bedfe89b6a7c133f3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A1n=20Tomko?= Date: Fri, 6 Feb 2015 15:35:57 +0100 Subject: [PATCH] Add mrg_rxbuf option to virtio interfaces Add an XML attribute to allow disabling merge of rx buffers on the host: ... 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 873a1c7b18..f6477c28d4 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -4012,7 +4012,7 @@ qemu-kvm -net nic,model=? /dev/null <target dev='vnet1'/> <model type='virtio'/> <driver name='vhost' txmode='iothread' ioeventfd='on' event_idx='off' queues='5'> - <host csum='off' gso='off' tso4='off' tso6='off' ecn='off' ufo='off'/> + <host csum='off' gso='off' tso4='off' tso6='off' ecn='off' ufo='off' mrg_rxbuf='off'/> <guest csum='off' tso4='off' tso6='off' ecn='off' ufo='off'/> </driver> @@ -4127,6 +4127,10 @@ qemu-kvm -net nic,model=? /dev/null and off can be used to turn off host offloading options. By default, the supported offloads are enabled by QEMU. Since 1.2.9 (QEMU only) + The mrg_rxbuf attribute can be used to control + mergeable rx buffers on the host side. Possible values are + on (default) and off. + Since 1.2.13 (QEMU only)
guest offloading options
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 7a1d299b55..27a24b46ba 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2469,6 +2469,11 @@ + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index fd3606379c..b13cae87e1 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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) diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index da21bcefe1..325afa82c9 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.47.2