[libvirt] [PATCH v2 0/3] Add support for coalesce settings on interfaces

In linux this is supported since 4.11-rc3, I tested it with 4.11.0-rc5-next-20170407. The particular patch can be found here: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/commit/?i... Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1414627 In this version the XML is different so that there are no underscores (and it's actually more readable, IMHO). Plus some minor adjustments needed after rebase. Martin Kletzander (3): util: Add virNetDevSetCoalesce function conf, docs: Add support for coalesce setting(s) Set coalesce settings for domain interfaces configure.ac | 3 +- docs/formatdomain.html.in | 24 ++++ docs/schemas/domaincommon.rng | 131 +++++++++++++++++++++ src/bhyve/bhyve_command.c | 2 +- src/conf/domain_conf.c | 80 +++++++++++++ src/conf/domain_conf.h | 2 + src/libvirt_private.syms | 1 + src/network/bridge_driver.c | 2 +- src/qemu/qemu_domain.c | 31 +++++ src/qemu/qemu_interface.c | 2 +- src/uml/uml_conf.c | 2 +- src/util/virnetdev.c | 83 +++++++++++++ src/util/virnetdev.h | 34 ++++++ src/util/virnetdevtap.c | 5 + src/util/virnetdevtap.h | 2 + tests/bhyvexml2argvmock.c | 1 + .../qemuxml2argvdata/qemuxml2argv-net-coalesce.xml | 68 +++++++++++ .../qemuxml2xmlout-net-coalesce.xml | 71 +++++++++++ tests/qemuxml2xmltest.c | 1 + 19 files changed, 540 insertions(+), 5 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-coalesce.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml -- 2.12.2

That function is able to configure coalesce settings for an interface, similarly to 'ethtool -C'. This function also updates back the structure so that it contains actual data on the device (if the device doesn't support some settings kernel might just return 0 and not set whatever is not supported), so this way we'll have up-to-date information in the live domain XML. Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- configure.ac | 3 +- src/libvirt_private.syms | 1 + src/util/virnetdev.c | 83 ++++++++++++++++++++++++++++++++++++++++++++++++ src/util/virnetdev.h | 34 ++++++++++++++++++++ 4 files changed, 120 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 383493836bff..5f7a07a2a67a 100644 --- a/configure.ac +++ b/configure.ac @@ -347,7 +347,8 @@ AC_CHECK_TYPE([struct sockpeercred], ]]) AC_CHECK_DECLS([ETH_FLAG_TXVLAN, ETH_FLAG_NTUPLE, ETH_FLAG_RXHASH, ETH_FLAG_LRO, - ETHTOOL_GGSO, ETHTOOL_GGRO, ETHTOOL_GFLAGS, ETHTOOL_GFEATURES], + ETHTOOL_GGSO, ETHTOOL_GGRO, ETHTOOL_GFLAGS, ETHTOOL_GFEATURES, + ETHTOOL_SCOALESCE, ETHTOOL_GCOALESCE], [], [], [[#include <linux/ethtool.h> ]]) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 181e178753a4..83e979a2bdaa 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2077,6 +2077,7 @@ virNetDevRxFilterModeTypeFromString; virNetDevRxFilterModeTypeToString; virNetDevRxFilterNew; virNetDevSaveNetConfig; +virNetDevSetCoalesce; virNetDevSetMAC; virNetDevSetMTU; virNetDevSetMTUFromDevice; diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index 170e34827f12..6ff1b489857d 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -3078,6 +3078,89 @@ virNetDevGetEthtoolGFeatures(virBitmapPtr bitmap ATTRIBUTE_UNUSED, # endif +# if HAVE_DECL_ETHTOOL_SCOALESCE && HAVE_DECL_ETHTOOL_GCOALESCE +/** + * virNetDevSetCoalesce: + * @ifname: interface name to modify + * @coalesce: Coalesce settings to set and update + * + * This function sets the various coalesce settings for a given interface + * @ifname and updates them back into @coalesce. + * + * Returns 0 in case of success or -1 on failure + */ +int virNetDevSetCoalesce(const char *ifname, + virNetDevCoalescePtr coalesce) +{ + int fd = -1; + int ret = -1; + struct ifreq ifr; + struct ethtool_coalesce coal = {0}; + + if (!coalesce) + return 0; + + coal = (struct ethtool_coalesce) { + .cmd = ETHTOOL_SCOALESCE, + .rx_max_coalesced_frames = coalesce->rx_max_coalesced_frames, + .rx_coalesce_usecs_irq = coalesce->rx_coalesce_usecs_irq, + .rx_max_coalesced_frames_irq = coalesce->rx_max_coalesced_frames_irq, + .tx_coalesce_usecs = coalesce->tx_coalesce_usecs, + .tx_max_coalesced_frames = coalesce->tx_max_coalesced_frames, + .tx_coalesce_usecs_irq = coalesce->tx_coalesce_usecs_irq, + .tx_max_coalesced_frames_irq = coalesce->tx_max_coalesced_frames_irq, + .stats_block_coalesce_usecs = coalesce->stats_block_coalesce_usecs, + .use_adaptive_rx_coalesce = coalesce->use_adaptive_rx_coalesce, + .use_adaptive_tx_coalesce = coalesce->use_adaptive_tx_coalesce, + .pkt_rate_low = coalesce->pkt_rate_low, + .rx_coalesce_usecs_low = coalesce->rx_coalesce_usecs_low, + .rx_max_coalesced_frames_low = coalesce->rx_max_coalesced_frames_low, + .tx_coalesce_usecs_low = coalesce->tx_coalesce_usecs_low, + .tx_max_coalesced_frames_low = coalesce->tx_max_coalesced_frames_low, + .pkt_rate_high = coalesce->pkt_rate_high, + .rx_coalesce_usecs_high = coalesce->rx_coalesce_usecs_high, + .rx_max_coalesced_frames_high = coalesce->rx_max_coalesced_frames_high, + .tx_coalesce_usecs_high = coalesce->tx_coalesce_usecs_high, + .tx_max_coalesced_frames_high = coalesce->tx_max_coalesced_frames_high, + .rate_sample_interval = coalesce->rate_sample_interval, + }; + + if ((fd = virNetDevSetupControl(ifname, &ifr)) < 0) + return -1; + + ifr.ifr_data = (void *) &coal; + + if (virNetDevSendEthtoolIoctl(fd, &ifr) < 0) { + virReportSystemError(errno, + _("Cannot set coalesce info on '%s'"), + ifname); + goto cleanup; + } + + coal = (struct ethtool_coalesce) { + .cmd = ETHTOOL_GCOALESCE, + }; + + /* Don't fail if the update itself fails */ + virNetDevSendEthtoolIoctl(fd, &ifr); + + ret = 0; + cleanup: + VIR_FORCE_CLOSE(fd); + return ret; +} +# else +int virNetDevSetCoalesce(const char *ifname, + virNetDevCoalescePtr coalesce ATTRIBUTE_UNUSED) +{ + virReportSystemError(ENOSYS, + _("Cannot set coalesce info on interface '%s'"), + ifname); + return -1; +} +# endif + + /** * virNetDevGetFeatures: * This function gets the nic offloads features available for ifname diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h index 12a31236c546..19036cca25c0 100644 --- a/src/util/virnetdev.h +++ b/src/util/virnetdev.h @@ -112,6 +112,36 @@ typedef enum { VIR_ENUM_DECL(virNetDevFeature) +/* Modeled after struct ethtool_coalesce, see linux/ethtool.h for explanations + * of particular fields */ +typedef struct _virNetDevCoalesce virNetDevCoalesce; +typedef virNetDevCoalesce *virNetDevCoalescePtr; +struct _virNetDevCoalesce { + uint32_t rx_coalesce_usecs; + uint32_t rx_max_coalesced_frames; + uint32_t rx_coalesce_usecs_irq; + uint32_t rx_max_coalesced_frames_irq; + uint32_t tx_coalesce_usecs; + uint32_t tx_max_coalesced_frames; + uint32_t tx_coalesce_usecs_irq; + uint32_t tx_max_coalesced_frames_irq; + uint32_t stats_block_coalesce_usecs; + uint32_t use_adaptive_rx_coalesce; + uint32_t use_adaptive_tx_coalesce; + uint32_t pkt_rate_low; + uint32_t rx_coalesce_usecs_low; + uint32_t rx_max_coalesced_frames_low; + uint32_t tx_coalesce_usecs_low; + uint32_t tx_max_coalesced_frames_low; + uint32_t pkt_rate_high; + uint32_t rx_coalesce_usecs_high; + uint32_t rx_max_coalesced_frames_high; + uint32_t tx_coalesce_usecs_high; + uint32_t tx_max_coalesced_frames_high; + uint32_t rate_sample_interval; +}; + + int virNetDevSetupControl(const char *ifname, virIfreq *ifr) ATTRIBUTE_RETURN_CHECK; @@ -144,6 +174,10 @@ int virNetDevRestoreMacAddress(const char *linkdev, const char *stateDir) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; +int virNetDevSetCoalesce(const char *ifname, + virNetDevCoalescePtr coalesce) + ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; + int virNetDevSetMTU(const char *ifname, int mtu) ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; -- 2.12.2

We are currently parsing only rx_max_coalesced_frames because that's the only value that makes sense for us. The tun device just added support for this one and the others are only supported by hardware devices which we don't need to worry about as the only way we'd pass those to the domain is using <hostdev/> or <interface type='hostdev'/>. And in those cases the guest can modify the settings itself. Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- docs/formatdomain.html.in | 24 ++++ docs/schemas/domaincommon.rng | 131 +++++++++++++++++++++ src/conf/domain_conf.c | 80 +++++++++++++ src/conf/domain_conf.h | 2 + src/qemu/qemu_domain.c | 31 +++++ .../qemuxml2argvdata/qemuxml2argv-net-coalesce.xml | 68 +++++++++++ .../qemuxml2xmlout-net-coalesce.xml | 71 +++++++++++ tests/qemuxml2xmltest.c | 1 + 8 files changed, 408 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-coalesce.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index b1e38f00e423..ea64b7fd1193 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -5405,6 +5405,30 @@ qemu-kvm -net nic,model=? /dev/null <span class="since">Since 3.1.0</span> </p> + <h5><a name="coalesce">Coalesce settings</a></h5> +<pre> +... +<devices> + <interface type='network'> + <source network='default'/> + <target dev='vnet0'/> + <b><coalesce> + <rx_max_coalesced_frames>5</rx_max_coalesced_frames> + </coalesce></b> + </interface> +</devices> +...</pre> + + <p> + This element provides means of setting coalesce settings for some + interface devices (currently only type <code>network</code> + and <code>bridge</code>. Currently there is just one sub-element + named <code>rx_max_coalesced_frames</code> which accepts a non-negative + integer that specifies the maximum number of packets that will be received + before an interrupt. + <span class="since">Since 3.3.0</span> + </p> + <h5><a name="ipconfig">IP configuration</a></h5> <pre> ... diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index edc225fe50c5..eb4b0f7437ba 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2509,6 +2509,9 @@ <ref name="mtu"/> </optional> <optional> + <ref name="coalesce"/> + </optional> + <optional> <element name="target"> <attribute name="dev"> <ref name="deviceName"/> @@ -5743,4 +5746,132 @@ </choice> </attribute> </define> + + <define name="coalesce"> + <element name="coalesce"> + <interleave> + <optional> + <element name="rx"> + <optional> + <element name="frames"> + <optional> + <attribute name="max"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <!-- + This is how we'd add more Rx-related settings for + frames, like irq, high, and low + + <optional> + <attribute name="irq"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="high"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="low"> + <ref name="unsignedInt"/> + </attribute> + </optional> + + --> + </element> + </optional> + <!-- + This is how we'd add more Rx-related settings, like + usecs + + <optional> + <element name="usecs"> + <optional> + <attribute name="max"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="irq"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="high"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="low"> + <ref name="unsignedInt"/> + </attribute> + </optional> + </element> + </optional> + --> + </element> + </optional> + <!-- + This is how you would add more coalesce settings, like + Tx-related ones + + <optional> + <element name="tx"> + <optional> + <element name="frames"> + <optional> + <attribute name="max"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="irq"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="high"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="low"> + <ref name="unsignedInt"/> + </attribute> + </optional> + </element> + </optional> + <optional> + <element name="usecs"> + <optional> + <attribute name="max"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="irq"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="high"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="low"> + <ref name="unsignedInt"/> + </attribute> + </optional> + </element> + </optional> + </element> + </optional> + --> + </interleave> + </element> + </define> + </grammar> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 705deb39a1bf..cbeebdc56880 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6772,6 +6772,77 @@ virDomainNetIPInfoParseXML(const char *source, return ret; } + +static virNetDevCoalescePtr +virDomainNetDefCoalesceParseXML(xmlNodePtr node, + xmlXPathContextPtr ctxt) +{ + virNetDevCoalescePtr ret = NULL; + xmlNodePtr save = NULL; + char *str = NULL; + unsigned long long tmp = 0; + + save = ctxt->node; + ctxt->node = node; + + str = virXPathString("string(./rx/frames/@max)", ctxt); + if (!str) + goto cleanup; + + if (!ret && VIR_ALLOC(ret) < 0) + goto cleanup; + + if (virStrToLong_ullp(str, NULL, 10, &tmp) < 0) { + virReportError(VIR_ERR_XML_DETAIL, + _("cannot parse value '%s' for coalesce parameter"), + str); + VIR_FREE(str); + goto error; + } + VIR_FREE(str); + + if (tmp > UINT32_MAX) { + virReportError(VIR_ERR_OVERFLOW, + _("value '%llu' is too big for coalesce " + "parameter, maximum is '%lu'"), + tmp, (unsigned long) UINT32_MAX); + goto error; + } + ret->rx_max_coalesced_frames = tmp; + + cleanup: + ctxt->node = save; + return ret; + + error: + VIR_FREE(ret); + goto cleanup; +} + +static void +virDomainNetDefCoalesceFormatXML(virBufferPtr buf, + virNetDevCoalescePtr coalesce) +{ + if (!coalesce || !coalesce->rx_max_coalesced_frames) + return; + + virBufferAddLit(buf, "<coalesce>\n"); + virBufferAdjustIndent(buf, 2); + + virBufferAddLit(buf, "<rx>\n"); + virBufferAdjustIndent(buf, 2); + + virBufferAsprintf(buf, "<frames max='%u'/>\n", + coalesce->rx_max_coalesced_frames); + + virBufferAdjustIndent(buf, -2); + virBufferAddLit(buf, "</rx>\n"); + + virBufferAdjustIndent(buf, -2); + virBufferAddLit(buf, "</coalesce>\n"); +} + + static int virDomainHostdevDefParseXMLCaps(xmlNodePtr node ATTRIBUTE_UNUSED, xmlXPathContextPtr ctxt, @@ -10255,6 +10326,13 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt, goto error; } + node = virXPathNode("./coalesce", ctxt); + if (node) { + def->coalesce = virDomainNetDefCoalesceParseXML(node, ctxt); + if (!def->coalesce) + goto error; + } + cleanup: ctxt->node = oldnode; VIR_FREE(macaddr); @@ -22147,6 +22225,8 @@ virDomainNetDefFormat(virBufferPtr buf, if (def->mtu) virBufferAsprintf(buf, "<mtu size='%u'/>\n", def->mtu); + virDomainNetDefCoalesceFormatXML(buf, def->coalesce); + if (virDomainDeviceInfoFormat(buf, &def->info, flags | VIR_DOMAIN_DEF_FORMAT_ALLOW_BOOT | VIR_DOMAIN_DEF_FORMAT_ALLOW_ROM) < 0) diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 7da554f8ee28..3b6b17451618 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -41,6 +41,7 @@ # include "numa_conf.h" # include "virnetdevmacvlan.h" # include "virsysinfo.h" +# include "virnetdev.h" # include "virnetdevip.h" # include "virnetdevvportprofile.h" # include "virnetdevbandwidth.h" @@ -1036,6 +1037,7 @@ struct _virDomainNetDef { int trustGuestRxFilters; /* enum virTristateBool */ int linkstate; unsigned int mtu; + virNetDevCoalescePtr coalesce; }; /* Used for prefix of ifname of any network name generated dynamically diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index b3e1573c690d..d906fe6fdd4f 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2984,6 +2984,30 @@ qemuDomainDefValidate(const virDomainDef *def, } +static bool +qemuDomainNetSupportsCoalesce(virDomainNetType type) +{ + switch (type) { + case VIR_DOMAIN_NET_TYPE_NETWORK: + case VIR_DOMAIN_NET_TYPE_BRIDGE: + return true; + case VIR_DOMAIN_NET_TYPE_VHOSTUSER: + case VIR_DOMAIN_NET_TYPE_ETHERNET: + case VIR_DOMAIN_NET_TYPE_DIRECT: + case VIR_DOMAIN_NET_TYPE_HOSTDEV: + case VIR_DOMAIN_NET_TYPE_USER: + case VIR_DOMAIN_NET_TYPE_SERVER: + case VIR_DOMAIN_NET_TYPE_CLIENT: + case VIR_DOMAIN_NET_TYPE_MCAST: + case VIR_DOMAIN_NET_TYPE_INTERNAL: + case VIR_DOMAIN_NET_TYPE_UDP: + case VIR_DOMAIN_NET_TYPE_LAST: + break; + } + return false; +} + + static int qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev, const virDomainDef *def ATTRIBUTE_UNUSED, @@ -3018,6 +3042,13 @@ qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev, virDomainNetTypeToString(net->type)); goto cleanup; } + + if (net->coalesce && !qemuDomainNetSupportsCoalesce(net->type)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("coalesce settings on interface type %s are not supported"), + virDomainNetTypeToString(net->type)); + goto cleanup; + } } ret = 0; diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-coalesce.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-coalesce.xml new file mode 100644 index 000000000000..b510324427d3 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-net-coalesce.xml @@ -0,0 +1,68 @@ +<domain type='qemu'> + <name>test</name> + <uuid>15d091de-0181-456b-9554-e4382dc1f1ab</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64' machine='pc-0.13'>hvm</type> + <boot dev='cdrom'/> + <boot dev='hd'/> + <bootmenu enable='yes'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>restart</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='qcow2' event_idx='on'/> + <source file='/var/lib/libvirt/images/f14.img'/> + <target dev='vda' bus='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> + </disk> + <disk type='file' device='cdrom'> + <driver name='qemu' type='raw'/> + <source file='/var/lib/libvirt/Fedora-14-x86_64-Live-KDE.iso'/> + <target dev='hdc' bus='ide'/> + <readonly/> + <address type='drive' controller='0' bus='1' target='0' unit='0'/> + </disk> + <controller type='usb' index='0'/> + <controller type='virtio-serial' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> + </controller> + <controller type='ide' index='0'/> + <controller type='pci' index='0' model='pci-root'/> + <interface type='network'> + <source network='default'/> + <mac address='52:54:00:e5:48:58'/> + <model type='virtio'/> + <coalesce> + <rx> + <frames max='7'/> + </rx> + </coalesce> + </interface> + <interface type='network'> + <source network='default'/> + <mac address='52:54:00:e5:48:59'/> + <model type='virtio'/> + <coalesce> + <rx> + <frames max='0'/> + </rx> + </coalesce> + </interface> + <serial type='pty'> + <target port='0'/> + </serial> + <console type='pty'> + <target type='serial' port='0'/> + </console> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml new file mode 100644 index 000000000000..fd5fdbece528 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml @@ -0,0 +1,71 @@ +<domain type='qemu'> + <name>test</name> + <uuid>15d091de-0181-456b-9554-e4382dc1f1ab</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64' machine='pc-0.13'>hvm</type> + <boot dev='cdrom'/> + <boot dev='hd'/> + <bootmenu enable='yes'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>restart</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='qcow2' event_idx='on'/> + <source file='/var/lib/libvirt/images/f14.img'/> + <target dev='vda' bus='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> + </disk> + <disk type='file' device='cdrom'> + <driver name='qemu' type='raw'/> + <source file='/var/lib/libvirt/Fedora-14-x86_64-Live-KDE.iso'/> + <target dev='hdc' bus='ide'/> + <readonly/> + <address type='drive' controller='0' bus='1' target='0' unit='0'/> + </disk> + <controller type='usb' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='virtio-serial' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> + </controller> + <controller type='ide' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <interface type='network'> + <mac address='52:54:00:e5:48:58'/> + <source network='default'/> + <model type='virtio'/> + <coalesce> + <rx> + <frames max='7'/> + </rx> + </coalesce> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </interface> + <interface type='network'> + <mac address='52:54:00:e5:48:59'/> + <source network='default'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> + </interface> + <serial type='pty'> + <target port='0'/> + </serial> + <console type='pty'> + <target type='serial' port='0'/> + </console> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <memballoon model='virtio'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> + </memballoon> + </devices> +</domain> diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index e4b510fd31ee..2dccde746ef1 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -528,6 +528,7 @@ mymain(void) DO_TEST("net-bandwidth", NONE); DO_TEST("net-bandwidth2", NONE); DO_TEST("net-mtu", NONE); + DO_TEST("net-coalesce", NONE); DO_TEST("serial-vc", NONE); DO_TEST("serial-pty", NONE); -- 2.12.2

On 04/20/2017 02:21 PM, Martin Kletzander wrote:
We are currently parsing only rx_max_coalesced_frames because that's the only value that makes sense for us. The tun device just added support for this one and the others are only supported by hardware devices which we don't need to worry about as the only way we'd pass those to the domain is using <hostdev/> or <interface type='hostdev'/>. And in those cases the guest can modify the settings itself.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- docs/formatdomain.html.in | 24 ++++ docs/schemas/domaincommon.rng | 131 +++++++++++++++++++++ src/conf/domain_conf.c | 80 +++++++++++++ src/conf/domain_conf.h | 2 + src/qemu/qemu_domain.c | 31 +++++ .../qemuxml2argvdata/qemuxml2argv-net-coalesce.xml | 68 +++++++++++ .../qemuxml2xmlout-net-coalesce.xml | 71 +++++++++++ tests/qemuxml2xmltest.c | 1 + 8 files changed, 408 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-coalesce.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index b1e38f00e423..ea64b7fd1193 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -5405,6 +5405,30 @@ qemu-kvm -net nic,model=? /dev/null <span class="since">Since 3.1.0</span> </p>
+ <h5><a name="coalesce">Coalesce settings</a></h5> +<pre> +... +<devices> + <interface type='network'> + <source network='default'/> + <target dev='vnet0'/> + <b><coalesce> + <rx_max_coalesced_frames>5</rx_max_coalesced_frames> + </coalesce></b> + </interface> +</devices> +...</pre> + + <p> + This element provides means of setting coalesce settings for some + interface devices (currently only type <code>network</code> + and <code>bridge</code>. Currently there is just one sub-element + named <code>rx_max_coalesced_frames</code> which accepts a non-negative + integer that specifies the maximum number of packets that will be received + before an interrupt. + <span class="since">Since 3.3.0</span> + </p>
This does not correspond to the schema or tests introduced later in the patch.
+ <h5><a name="ipconfig">IP configuration</a></h5> <pre> ... diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index edc225fe50c5..eb4b0f7437ba 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2509,6 +2509,9 @@ <ref name="mtu"/> </optional> <optional> + <ref name="coalesce"/> + </optional> + <optional> <element name="target"> <attribute name="dev"> <ref name="deviceName"/> @@ -5743,4 +5746,132 @@ </choice> </attribute> </define> + + <define name="coalesce"> + <element name="coalesce"> + <interleave> + <optional> + <element name="rx"> + <optional> + <element name="frames"> + <optional> + <attribute name="max"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <!-- + This is how we'd add more Rx-related settings for + frames, like irq, high, and low + + <optional> + <attribute name="irq"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="high"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="low"> + <ref name="unsignedInt"/> + </attribute> + </optional> + + --> + </element> + </optional> + <!-- + This is how we'd add more Rx-related settings, like + usecs + + <optional> + <element name="usecs"> + <optional> + <attribute name="max"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="irq"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="high"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="low"> + <ref name="unsignedInt"/> + </attribute> + </optional> + </element> + </optional> + --> + </element> + </optional> + <!-- + This is how you would add more coalesce settings, like + Tx-related ones + + <optional> + <element name="tx"> + <optional> + <element name="frames"> + <optional> + <attribute name="max"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="irq"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="high"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="low"> + <ref name="unsignedInt"/> + </attribute> + </optional> + </element> + </optional> + <optional> + <element name="usecs"> + <optional> + <attribute name="max"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="irq"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="high"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="low"> + <ref name="unsignedInt"/> + </attribute> + </optional> + </element> + </optional> + </element> + </optional> + --> + </interleave> + </element> + </define> + </grammar> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 705deb39a1bf..cbeebdc56880 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6772,6 +6772,77 @@ virDomainNetIPInfoParseXML(const char *source, return ret; }
+ +static virNetDevCoalescePtr +virDomainNetDefCoalesceParseXML(xmlNodePtr node, + xmlXPathContextPtr ctxt) +{ + virNetDevCoalescePtr ret = NULL; + xmlNodePtr save = NULL; + char *str = NULL; + unsigned long long tmp = 0; + + save = ctxt->node; + ctxt->node = node; + + str = virXPathString("string(./rx/frames/@max)", ctxt); + if (!str) + goto cleanup; + + if (!ret && VIR_ALLOC(ret) < 0) + goto cleanup; + + if (virStrToLong_ullp(str, NULL, 10, &tmp) < 0) { + virReportError(VIR_ERR_XML_DETAIL, + _("cannot parse value '%s' for coalesce parameter"), + str); + VIR_FREE(str); + goto error; + } + VIR_FREE(str); + + if (tmp > UINT32_MAX) { + virReportError(VIR_ERR_OVERFLOW, + _("value '%llu' is too big for coalesce " + "parameter, maximum is '%lu'"), + tmp, (unsigned long) UINT32_MAX); + goto error; + } + ret->rx_max_coalesced_frames = tmp;
I wonder if we can turn this into a macro (despite some of us hating them) because potentially we'll parse all the 32 coalesce attributes (or how many there are). But for now, this is okay as is.
+ + cleanup: + ctxt->node = save; + return ret; + + error: + VIR_FREE(ret); + goto cleanup; +}
Michal

On Fri, Apr 21, 2017 at 11:19:36AM +0200, Michal Privoznik wrote:
On 04/20/2017 02:21 PM, Martin Kletzander wrote:
We are currently parsing only rx_max_coalesced_frames because that's the only value that makes sense for us. The tun device just added support for this one and the others are only supported by hardware devices which we don't need to worry about as the only way we'd pass those to the domain is using <hostdev/> or <interface type='hostdev'/>. And in those cases the guest can modify the settings itself.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- docs/formatdomain.html.in | 24 ++++ docs/schemas/domaincommon.rng | 131 +++++++++++++++++++++ src/conf/domain_conf.c | 80 +++++++++++++ src/conf/domain_conf.h | 2 + src/qemu/qemu_domain.c | 31 +++++ .../qemuxml2argvdata/qemuxml2argv-net-coalesce.xml | 68 +++++++++++ .../qemuxml2xmlout-net-coalesce.xml | 71 +++++++++++ tests/qemuxml2xmltest.c | 1 + 8 files changed, 408 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-coalesce.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index b1e38f00e423..ea64b7fd1193 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -5405,6 +5405,30 @@ qemu-kvm -net nic,model=? /dev/null <span class="since">Since 3.1.0</span> </p>
+ <h5><a name="coalesce">Coalesce settings</a></h5> +<pre> +... +<devices> + <interface type='network'> + <source network='default'/> + <target dev='vnet0'/> + <b><coalesce> + <rx_max_coalesced_frames>5</rx_max_coalesced_frames> + </coalesce></b> + </interface> +</devices> +...</pre> + + <p> + This element provides means of setting coalesce settings for some + interface devices (currently only type <code>network</code> + and <code>bridge</code>. Currently there is just one sub-element + named <code>rx_max_coalesced_frames</code> which accepts a non-negative + integer that specifies the maximum number of packets that will be received + before an interrupt. + <span class="since">Since 3.3.0</span> + </p>
This does not correspond to the schema or tests introduced later in the patch.
Good catch, thanks for noticing.
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 705deb39a1bf..cbeebdc56880 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6772,6 +6772,77 @@ virDomainNetIPInfoParseXML(const char *source, return ret; }
+ +static virNetDevCoalescePtr +virDomainNetDefCoalesceParseXML(xmlNodePtr node, + xmlXPathContextPtr ctxt) +{ + virNetDevCoalescePtr ret = NULL; + xmlNodePtr save = NULL; + char *str = NULL; + unsigned long long tmp = 0; + + save = ctxt->node; + ctxt->node = node; + + str = virXPathString("string(./rx/frames/@max)", ctxt); + if (!str) + goto cleanup; + + if (!ret && VIR_ALLOC(ret) < 0) + goto cleanup; + + if (virStrToLong_ullp(str, NULL, 10, &tmp) < 0) { + virReportError(VIR_ERR_XML_DETAIL, + _("cannot parse value '%s' for coalesce parameter"), + str); + VIR_FREE(str); + goto error; + } + VIR_FREE(str); + + if (tmp > UINT32_MAX) { + virReportError(VIR_ERR_OVERFLOW, + _("value '%llu' is too big for coalesce " + "parameter, maximum is '%lu'"), + tmp, (unsigned long) UINT32_MAX); + goto error; + } + ret->rx_max_coalesced_frames = tmp;
I wonder if we can turn this into a macro (despite some of us hating them) because potentially we'll parse all the 32 coalesce attributes (or how many there are). But for now, this is okay as is.
I did that. Multiple times. GET_COAL(rx, frames, max) for example and I tried various ways how to do that so it's nicely extensible. But after a while I gave up because it would be used once and whatever. Maybe nobody will ever want to add any other parameter...
+ + cleanup: + ctxt->node = save; + return ret; + + error: + VIR_FREE(ret); + goto cleanup; +}
Michal

On 04/20/2017 08:21 AM, Martin Kletzander wrote:
We are currently parsing only rx_max_coalesced_frames because that's the only value that makes sense for us. The tun device just added support for this one and the others are only supported by hardware devices which we don't need to worry about as the only way we'd pass those to the domain is using <hostdev/> or <interface type='hostdev'/>. And in those cases the guest can modify the settings itself.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- docs/formatdomain.html.in | 24 ++++ docs/schemas/domaincommon.rng | 131 +++++++++++++++++++++ src/conf/domain_conf.c | 80 +++++++++++++ src/conf/domain_conf.h | 2 + src/qemu/qemu_domain.c | 31 +++++ .../qemuxml2argvdata/qemuxml2argv-net-coalesce.xml | 68 +++++++++++ .../qemuxml2xmlout-net-coalesce.xml | 71 +++++++++++ tests/qemuxml2xmltest.c | 1 + 8 files changed, 408 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-coalesce.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml
Coverity found a resource leak...
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 705deb39a1bf..cbeebdc56880 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6772,6 +6772,77 @@ virDomainNetIPInfoParseXML(const char *source, return ret; }
+ +static virNetDevCoalescePtr +virDomainNetDefCoalesceParseXML(xmlNodePtr node, + xmlXPathContextPtr ctxt) +{ + virNetDevCoalescePtr ret = NULL; + xmlNodePtr save = NULL; + char *str = NULL; + unsigned long long tmp = 0; + + save = ctxt->node; + ctxt->node = node; + + str = virXPathString("string(./rx/frames/@max)", ctxt); + if (!str) + goto cleanup; + + if (!ret && VIR_ALLOC(ret) < 0) + goto cleanup;
Right here - str isn't free'd in cleanup (or error), but could be...
+ + if (virStrToLong_ullp(str, NULL, 10, &tmp) < 0) { + virReportError(VIR_ERR_XML_DETAIL, + _("cannot parse value '%s' for coalesce parameter"), + str); + VIR_FREE(str); + goto error; + } + VIR_FREE(str); + + if (tmp > UINT32_MAX) { + virReportError(VIR_ERR_OVERFLOW, + _("value '%llu' is too big for coalesce " + "parameter, maximum is '%lu'"), + tmp, (unsigned long) UINT32_MAX); + goto error; + } + ret->rx_max_coalesced_frames = tmp; + + cleanup: + ctxt->node = save; + return ret; + + error: + VIR_FREE(ret); + goto cleanup; +} + ...

On Sat, Apr 22, 2017 at 07:30:05AM -0400, John Ferlan wrote:
On 04/20/2017 08:21 AM, Martin Kletzander wrote:
We are currently parsing only rx_max_coalesced_frames because that's the only value that makes sense for us. The tun device just added support for this one and the others are only supported by hardware devices which we don't need to worry about as the only way we'd pass those to the domain is using <hostdev/> or <interface type='hostdev'/>. And in those cases the guest can modify the settings itself.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- docs/formatdomain.html.in | 24 ++++ docs/schemas/domaincommon.rng | 131 +++++++++++++++++++++ src/conf/domain_conf.c | 80 +++++++++++++ src/conf/domain_conf.h | 2 + src/qemu/qemu_domain.c | 31 +++++ .../qemuxml2argvdata/qemuxml2argv-net-coalesce.xml | 68 +++++++++++ .../qemuxml2xmlout-net-coalesce.xml | 71 +++++++++++ tests/qemuxml2xmltest.c | 1 + 8 files changed, 408 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-coalesce.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml
Coverity found a resource leak...
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 705deb39a1bf..cbeebdc56880 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6772,6 +6772,77 @@ virDomainNetIPInfoParseXML(const char *source, return ret; }
+ +static virNetDevCoalescePtr +virDomainNetDefCoalesceParseXML(xmlNodePtr node, + xmlXPathContextPtr ctxt) +{ + virNetDevCoalescePtr ret = NULL; + xmlNodePtr save = NULL; + char *str = NULL; + unsigned long long tmp = 0; + + save = ctxt->node; + ctxt->node = node; + + str = virXPathString("string(./rx/frames/@max)", ctxt); + if (!str) + goto cleanup; + + if (!ret && VIR_ALLOC(ret) < 0) + goto cleanup;
Right here - str isn't free'd in cleanup (or error), but could be...
Well, the code is pushed already, but I'll push a trivial patch in a minute. Thanks for noticing.

This patch makes use of the virNetDevSetCoalesce() function to make appropriate settings effective for devices that support them. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1414627 Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- src/bhyve/bhyve_command.c | 2 +- src/network/bridge_driver.c | 2 +- src/qemu/qemu_interface.c | 2 +- src/uml/uml_conf.c | 2 +- src/util/virnetdevtap.c | 5 +++++ src/util/virnetdevtap.h | 2 ++ tests/bhyvexml2argvmock.c | 1 + 7 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c index e0528ed77a2c..e9c072b9f578 100644 --- a/src/bhyve/bhyve_command.c +++ b/src/bhyve/bhyve_command.c @@ -100,7 +100,7 @@ bhyveBuildNetArgStr(virConnectPtr conn, def->uuid, NULL, NULL, 0, virDomainNetGetActualVirtPortProfile(net), virDomainNetGetActualVlan(net), - 0, NULL, + NULL, 0, NULL, VIR_NETDEV_TAP_CREATE_IFUP | VIR_NETDEV_TAP_CREATE_PERSIST) < 0) { goto cleanup; } diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 45abe16964b8..d2d8557d280d 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -2311,7 +2311,7 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr driver, if (virNetDevTapCreateInBridgePort(network->def->bridge, &macTapIfName, &network->def->mac, NULL, NULL, &tapfd, 1, NULL, NULL, - network->def->mtu, NULL, + NULL, network->def->mtu, NULL, VIR_NETDEV_TAP_CREATE_USE_MAC_FOR_BRIDGE | VIR_NETDEV_TAP_CREATE_IFUP | VIR_NETDEV_TAP_CREATE_PERSIST) < 0) { diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c index c5dca60f1f65..2057ac9293f2 100644 --- a/src/qemu/qemu_interface.c +++ b/src/qemu/qemu_interface.c @@ -545,7 +545,7 @@ qemuInterfaceBridgeConnect(virDomainDefPtr def, def->uuid, tunpath, tapfd, *tapfdSize, virDomainNetGetActualVirtPortProfile(net), virDomainNetGetActualVlan(net), - net->mtu, mtu, + net->coalesce, net->mtu, mtu, tap_create_flags) < 0) { virDomainAuditNetDevice(def, net, tunpath, false); goto cleanup; diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c index 871653c5a64c..bdef78324385 100644 --- a/src/uml/uml_conf.c +++ b/src/uml/uml_conf.c @@ -125,7 +125,7 @@ umlConnectTapDevice(virDomainDefPtr vm, vm->uuid, net->backend.tap, &tapfd, 1, virDomainNetGetActualVirtPortProfile(net), virDomainNetGetActualVlan(net), - 0, NULL, + NULL, 0, NULL, VIR_NETDEV_TAP_CREATE_IFUP | VIR_NETDEV_TAP_CREATE_PERSIST) < 0) { if (template_ifname) diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c index 02ef7fd24047..4d333d75e4c5 100644 --- a/src/util/virnetdevtap.c +++ b/src/util/virnetdevtap.c @@ -584,6 +584,7 @@ virNetDevTapAttachBridge(const char *tapname, * @tapfd: array of file descriptor return value for the new tap device * @tapfdSize: number of file descriptors in @tapfd * @virtPortProfile: bridge/port specific configuration + * @coalesce: optional coalesce parameters * @mtu: requested MTU for port (or 0 for "default") * @actualMTU: MTU actually set for port (after accounting for bridge's MTU) * @flags: OR of virNetDevTapCreateFlags: @@ -616,6 +617,7 @@ int virNetDevTapCreateInBridgePort(const char *brname, size_t tapfdSize, virNetDevVPortProfilePtr virtPortProfile, virNetDevVlanPtr virtVlan, + virNetDevCoalescePtr coalesce, unsigned int mtu, unsigned int *actualMTU, unsigned int flags) @@ -661,6 +663,9 @@ int virNetDevTapCreateInBridgePort(const char *brname, if (virNetDevSetOnline(*ifname, !!(flags & VIR_NETDEV_TAP_CREATE_IFUP)) < 0) goto error; + if (virNetDevSetCoalesce(*ifname, coalesce) < 0) + goto error; + return 0; error: diff --git a/src/util/virnetdevtap.h b/src/util/virnetdevtap.h index 311f0698b155..0b17feb8d94d 100644 --- a/src/util/virnetdevtap.h +++ b/src/util/virnetdevtap.h @@ -24,6 +24,7 @@ # define __VIR_NETDEV_TAP_H__ # include "internal.h" +# include "virnetdev.h" # include "virnetdevvportprofile.h" # include "virnetdevvlan.h" @@ -83,6 +84,7 @@ int virNetDevTapCreateInBridgePort(const char *brname, size_t tapfdSize, virNetDevVPortProfilePtr virtPortProfile, virNetDevVlanPtr virtVlan, + virNetDevCoalescePtr coalesce, unsigned int mtu, unsigned int *actualMTU, unsigned int flags) diff --git a/tests/bhyvexml2argvmock.c b/tests/bhyvexml2argvmock.c index fd714694f0bd..7afa0e34c43c 100644 --- a/tests/bhyvexml2argvmock.c +++ b/tests/bhyvexml2argvmock.c @@ -28,6 +28,7 @@ int virNetDevTapCreateInBridgePort(const char *brname ATTRIBUTE_UNUSED, size_t tapfdSize ATTRIBUTE_UNUSED, virNetDevVPortProfilePtr virtPortProfile ATTRIBUTE_UNUSED, virNetDevVlanPtr virtVlan ATTRIBUTE_UNUSED, + virNetDevCoalescePtr coalesce ATTRIBUTE_UNUSED, unsigned int mtu ATTRIBUTE_UNUSED, unsigned int *actualMTU ATTRIBUTE_UNUSED, unsigned int fakeflags ATTRIBUTE_UNUSED) -- 2.12.2

On 04/20/2017 02:21 PM, Martin Kletzander wrote:
In linux this is supported since 4.11-rc3, I tested it with 4.11.0-rc5-next-20170407. The particular patch can be found here:
https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/commit/?i...
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1414627
In this version the XML is different so that there are no underscores (and it's actually more readable, IMHO).
Plus some minor adjustments needed after rebase.
Martin Kletzander (3): util: Add virNetDevSetCoalesce function conf, docs: Add support for coalesce setting(s) Set coalesce settings for domain interfaces
configure.ac | 3 +- docs/formatdomain.html.in | 24 ++++ docs/schemas/domaincommon.rng | 131 +++++++++++++++++++++ src/bhyve/bhyve_command.c | 2 +- src/conf/domain_conf.c | 80 +++++++++++++ src/conf/domain_conf.h | 2 + src/libvirt_private.syms | 1 + src/network/bridge_driver.c | 2 +- src/qemu/qemu_domain.c | 31 +++++ src/qemu/qemu_interface.c | 2 +- src/uml/uml_conf.c | 2 +- src/util/virnetdev.c | 83 +++++++++++++ src/util/virnetdev.h | 34 ++++++ src/util/virnetdevtap.c | 5 + src/util/virnetdevtap.h | 2 + tests/bhyvexml2argvmock.c | 1 + .../qemuxml2argvdata/qemuxml2argv-net-coalesce.xml | 68 +++++++++++ .../qemuxml2xmlout-net-coalesce.xml | 71 +++++++++++ tests/qemuxml2xmltest.c | 1 + 19 files changed, 540 insertions(+), 5 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-coalesce.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml
ACK series if you fix the documentation in 2/3. Michal
participants (3)
-
John Ferlan
-
Martin Kletzander
-
Michal Privoznik