[PATCH 0/3] VirtioNet RSS support

This series of patches add RSS property support for virtio-net-pci. Virtio RSS effectively works with TAP devices, it requires additional vectors for VirtioNet, queues for TAP device, and vCPU cores. Example of device configuration: ``` <interface type="network"> <mac address="52:54:00:c4:90:25"/> <source network="default"/> <model type="virtio"/> <driver name="qemu" queues="9" rss="on" rss_hash_report="off"/> <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/> </interface> ``` Capability "rss" enables RSS, "rss_hash_report" - enables hashes in vheader. For now, "rss" property will trigger "in-qemu" RSS in most cases. Current Qemu(6.2) supports eBPF RSS that may require additional capabilities. In future, the helper will be provided. And this code is the base for VirtIO RSS. Changes since RFC: * rebased and refactored * added tests * postponed the helper Andrew Melnychenko (3): domain_conf: Added configs for RSS and Hash report. qemu_capabilities: Added capabilites for qemu's "rss" and "hash". test: Added caps, xml2argv and xml2xml tests. docs/formatdomain.rst | 15 ++++++++ docs/schemas/domaincommon.rng | 10 ++++++ src/conf/domain_conf.c | 31 +++++++++++++++- src/conf/domain_conf.h | 2 ++ src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 2 ++ src/qemu/qemu_validate.c | 16 +++++++++ .../caps_5.1.0.x86_64.xml | 1 + .../caps_5.2.0.aarch64.xml | 1 + .../qemucapabilitiesdata/caps_5.2.0.ppc64.xml | 1 + .../caps_5.2.0.riscv64.xml | 1 + .../qemucapabilitiesdata/caps_5.2.0.s390x.xml | 1 + .../caps_5.2.0.x86_64.xml | 1 + .../caps_6.0.0.aarch64.xml | 1 + .../qemucapabilitiesdata/caps_6.0.0.s390x.xml | 1 + .../caps_6.0.0.x86_64.xml | 1 + .../caps_6.1.0.x86_64.xml | 1 + .../caps_6.2.0.aarch64.xml | 1 + .../qemucapabilitiesdata/caps_6.2.0.ppc64.xml | 1 + .../caps_6.2.0.x86_64.xml | 1 + tests/qemuxml2argvdata/net-virtio-hash.args | 35 +++++++++++++++++++ tests/qemuxml2argvdata/net-virtio-hash.xml | 29 +++++++++++++++ tests/qemuxml2argvdata/net-virtio-rss.args | 35 +++++++++++++++++++ tests/qemuxml2argvdata/net-virtio-rss.xml | 29 +++++++++++++++ .../qemuxml2argvdata/net-virtio-rsshash.args | 35 +++++++++++++++++++ tests/qemuxml2argvdata/net-virtio-rsshash.xml | 29 +++++++++++++++ .../virtio-options.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/virtio-options.xml | 2 +- tests/qemuxml2argvtest.c | 7 ++++ 30 files changed, 292 insertions(+), 3 deletions(-) create mode 100644 tests/qemuxml2argvdata/net-virtio-hash.args create mode 100644 tests/qemuxml2argvdata/net-virtio-hash.xml create mode 100644 tests/qemuxml2argvdata/net-virtio-rss.args create mode 100644 tests/qemuxml2argvdata/net-virtio-rss.xml create mode 100644 tests/qemuxml2argvdata/net-virtio-rsshash.args create mode 100644 tests/qemuxml2argvdata/net-virtio-rsshash.xml -- 2.34.1

Added "rss" and "rss_hash_report" configuration that should be used with qemu virtio RSS. Both options are triswitches. Used as "driver" options and affects only NIC with model type "virtio". In other patches - options should turn on virtio-net RSS and hash properties. Signed-off-by: Andrew Melnychenko <andrew@daynix.com> --- docs/formatdomain.rst | 15 +++++++++++++++ docs/schemas/domaincommon.rng | 10 ++++++++++ src/conf/domain_conf.c | 31 ++++++++++++++++++++++++++++++- src/conf/domain_conf.h | 2 ++ 4 files changed, 57 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index d4f30bb8af..f7b784ed26 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -5305,6 +5305,21 @@ following attributes are available for the ``"virtio"`` NIC driver: only for ``vhostuser`` type. :since:`Since 3.7.0 (QEMU and KVM only)` **In general you should leave this option alone, unless you are very certain you know what you are doing.** +``rss`` + The ``rss`` option enables in-qemu/ebpf RSS for virtio NIC. RSS works with + virtio and tap backends only. Virtio NIC will be launched with "rss" + property. Qemu may load eBPF RSS if it has CAP_SYS_ADMIN permissions. + In other cases, "in-qemu" RSS is used. + **In general you should leave this option alone, unless you are very certain + you know what you are doing.** +``rss_hash_report`` + The ``rss_hash_report`` option enables in-qemu RSS hash report for virtio + NIC. Virtio NIC will be launched with "hash" property. Ebpf RSS doesn't + support hash report yet. Usually enabled alongside with ``rss``. + Without ``rss`` option, the hash report doesn't affect steering + itself but provides vnet header with a calculated hash. + **In general you should leave this option alone, unless you are very certain + you know what you are doing.** virtio options For virtio interfaces, `Virtio-specific options <#elementsVirtio>`__ can also be set. ( :since:`Since 3.5.0` ) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 7fa5c2b8b5..9b5b94fc6c 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -3595,6 +3595,16 @@ </optional> </element> </optional> + <optional> + <attribute name="rss"> + <ref name="virOnOff"/> + </attribute> + </optional> + <optional> + <attribute name="rss_hash_report"> + <ref name="virOnOff"/> + </attribute> + </optional> </interleave> </element> </optional> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 716c6d2240..762987e8a9 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -10271,6 +10271,8 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt, g_autofree char *vhost_path = NULL; g_autofree char *tap = NULL; g_autofree char *vhost = NULL; + g_autofree char *virtio_rss = NULL; + g_autofree char *virtio_rss_hash_report = NULL; const char *prefix = xmlopt ? xmlopt->config.netPrefix : NULL; if (!(def = virDomainNetDefNew(xmlopt))) @@ -10412,6 +10414,8 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt, queues = virXMLPropString(driver_node, "queues"); rx_queue_size = virXMLPropString(driver_node, "rx_queue_size"); tx_queue_size = virXMLPropString(driver_node, "tx_queue_size"); + virtio_rss = virXMLPropString(driver_node, "rss"); + virtio_rss_hash_report = virXMLPropString(driver_node, "rss_hash_report"); if ((filterref_node = virXPathNode("./filterref", ctxt))) { filter = virXMLPropString(filterref_node, "filter"); @@ -10822,7 +10826,24 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt, } def->driver.virtio.tx_queue_size = q; } - + if (virtio_rss) { + if ((val = virTristateSwitchTypeFromString(virtio_rss)) <= 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("'rss' attribute must be 'on'/'off'/'default': %s"), + virtio_rss); + goto error; + } + def->driver.virtio.rss = val; + } + if (virtio_rss_hash_report) { + if ((val = virTristateSwitchTypeFromString(virtio_rss_hash_report)) <= 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("'rss_hash_report' attribute must be 'on'/'off'/'default': %s"), + virtio_rss_hash_report); + goto error; + } + def->driver.virtio.rss_hash_report = val; + } if ((tmpNode = virXPathNode("./driver/host", ctxt))) { if (virXMLPropTristateSwitch(tmpNode, "csum", VIR_XML_PROP_NONE, &def->driver.virtio.host.csum) < 0) @@ -24751,6 +24772,14 @@ virDomainVirtioNetDriverFormat(virBuffer *buf, if (def->driver.virtio.tx_queue_size) virBufferAsprintf(buf, " tx_queue_size='%u'", def->driver.virtio.tx_queue_size); + if (def->driver.virtio.rss != VIR_TRISTATE_SWITCH_ABSENT) { + virBufferAsprintf(buf, " rss='%s'", + virTristateSwitchTypeToString(def->driver.virtio.rss)); + } + if (def->driver.virtio.rss_hash_report != VIR_TRISTATE_SWITCH_ABSENT) { + virBufferAsprintf(buf, " rss_hash_report='%s'", + virTristateSwitchTypeToString(def->driver.virtio.rss_hash_report)); + } virDomainVirtioOptionsFormat(buf, def->virtio); } diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 144ba4dd12..64ebff012e 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1055,6 +1055,8 @@ struct _virDomainNetDef { virTristateSwitch ecn; virTristateSwitch ufo; } guest; + virTristateSwitch rss; + virTristateSwitch rss_hash_report; } virtio; } driver; struct { -- 2.34.1

On Thu, Dec 30, 2021 at 08:01:43 +0200, Andrew Melnychenko wrote:
Added "rss" and "rss_hash_report" configuration that should be used with qemu virtio RSS. Both options are triswitches. Used as "driver" options and affects only NIC with model type "virtio". In other patches - options should turn on virtio-net RSS and hash properties.
Signed-off-by: Andrew Melnychenko <andrew@daynix.com> --- docs/formatdomain.rst | 15 +++++++++++++++ docs/schemas/domaincommon.rng | 10 ++++++++++ src/conf/domain_conf.c | 31 ++++++++++++++++++++++++++++++- src/conf/domain_conf.h | 2 ++ 4 files changed, 57 insertions(+), 1 deletion(-)
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index d4f30bb8af..f7b784ed26 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -5305,6 +5305,21 @@ following attributes are available for the ``"virtio"`` NIC driver: only for ``vhostuser`` type. :since:`Since 3.7.0 (QEMU and KVM only)` **In general you should leave this option alone, unless you are very certain you know what you are doing.** +``rss`` + The ``rss`` option enables in-qemu/ebpf RSS for virtio NIC. RSS works with + virtio and tap backends only. Virtio NIC will be launched with "rss" + property. Qemu may load eBPF RSS if it has CAP_SYS_ADMIN permissions.
Use 'QEMU' spelling here.
+ In other cases, "in-qemu" RSS is used. + **In general you should leave this option alone, unless you are very certain + you know what you are doing.** +``rss_hash_report`` + The ``rss_hash_report`` option enables in-qemu RSS hash report for virtio + NIC. Virtio NIC will be launched with "hash" property. Ebpf RSS doesn't + support hash report yet. Usually enabled alongside with ``rss``. + Without ``rss`` option, the hash report doesn't affect steering + itself but provides vnet header with a calculated hash. + **In general you should leave this option alone, unless you are very certain + you know what you are doing.** virtio options For virtio interfaces, `Virtio-specific options <#elementsVirtio>`__ can also be set. ( :since:`Since 3.5.0` )
From this description it's not clear what's happening, could you describe a bit more what's happening here. Also it would be great to have more guidance than "do not touch this setting" .

On Thu, Dec 30, 2021 at 08:01:43AM +0200, Andrew Melnychenko wrote:
Added "rss" and "rss_hash_report" configuration that should be used with qemu virtio RSS. Both options are triswitches. Used as "driver" options and affects only NIC with model type "virtio". In other patches - options should turn on virtio-net RSS and hash properties.
Signed-off-by: Andrew Melnychenko <andrew@daynix.com> --- docs/formatdomain.rst | 15 +++++++++++++++ docs/schemas/domaincommon.rng | 10 ++++++++++ src/conf/domain_conf.c | 31 ++++++++++++++++++++++++++++++- src/conf/domain_conf.h | 2 ++ 4 files changed, 57 insertions(+), 1 deletion(-)
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index d4f30bb8af..f7b784ed26 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -5305,6 +5305,21 @@ following attributes are available for the ``"virtio"`` NIC driver: only for ``vhostuser`` type. :since:`Since 3.7.0 (QEMU and KVM only)` **In general you should leave this option alone, unless you are very certain you know what you are doing.** +``rss`` + The ``rss`` option enables in-qemu/ebpf RSS for virtio NIC. RSS works with + virtio and tap backends only. Virtio NIC will be launched with "rss" + property. Qemu may load eBPF RSS if it has CAP_SYS_ADMIN permissions.
QEMU won't have CAP_SYS_ADMIN with libvirt unless someone goes out of their way to make the libvirt host configuration insecure. We would consider such a config to be unsupported aside from developers experimenting with stuff, so I don't think it merits documentation.
+ In other cases, "in-qemu" RSS is used.
So this is only realistic scenario that can be supported under libvirt.
+ **In general you should leave this option alone, unless you are very certain + you know what you are doing.** +``rss_hash_report`` + The ``rss_hash_report`` option enables in-qemu RSS hash report for virtio + NIC. Virtio NIC will be launched with "hash" property. Ebpf RSS doesn't + support hash report yet. Usually enabled alongside with ``rss``. + Without ``rss`` option, the hash report doesn't affect steering + itself but provides vnet header with a calculated hash. + **In general you should leave this option alone, unless you are very certain + you know what you are doing.** virtio options For virtio interfaces, `Virtio-specific options <#elementsVirtio>`__ can also be set. ( :since:`Since 3.5.0` )
Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

Added qemu's property check for virtio-net. And added capability QEMU_CAPS_VIRTIO_RSS. With "rss" and "rss_hash_report" from domain config, qemu should enable "rss" and "hash" for virtio-net. If domain config contains "rss" and/or "rss_hash_report" options for driver. Libvirt will create an NIC device command line with enabled "rss"/"hash". Signed-off-by: Andrew Melnychenko <andrew@daynix.com> --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 2 ++ src/qemu/qemu_validate.c | 16 ++++++++++++++++ 4 files changed, 21 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 4f63322a9e..c36a0b22e1 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -653,6 +653,7 @@ VIR_ENUM_IMPL(virQEMUCaps, "query-dirty-rate", /* QEMU_CAPS_QUERY_DIRTY_RATE */ "rbd-encryption", /* QEMU_CAPS_RBD_ENCRYPTION */ "sev-guest-kernel-hashes", /* QEMU_CAPS_SEV_GUEST_KERNEL_HASHES */ + "virtio-net.rss", /* QEMU_CAPS_VIRTIO_RSS */ ); @@ -1410,6 +1411,7 @@ static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsVirtioNet[] = { { "failover", QEMU_CAPS_VIRTIO_NET_FAILOVER, NULL }, { "packed", QEMU_CAPS_VIRTIO_PACKED_QUEUES, NULL }, { "acpi-index", QEMU_CAPS_ACPI_INDEX, NULL }, + { "rss", QEMU_CAPS_VIRTIO_RSS, NULL }, }; static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsPCIeRootPort[] = { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index aaac20a834..916a087169 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -632,6 +632,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ QEMU_CAPS_QUERY_DIRTY_RATE, /* accepts query-dirty-rate */ QEMU_CAPS_RBD_ENCRYPTION, /* Ceph RBD encryption support */ QEMU_CAPS_SEV_GUEST_KERNEL_HASHES, /* sev-guest.kernel-hashes= */ + QEMU_CAPS_VIRTIO_RSS, /* virtio-net rss feature */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d822533ccb..dfe6eefd1e 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4168,6 +4168,8 @@ qemuBuildNicDevProps(virDomainDef *def, "P:vectors", vectors, "p:rx_queue_size", net->driver.virtio.rx_queue_size, "p:tx_queue_size", net->driver.virtio.tx_queue_size, + "T:rss", net->driver.virtio.rss, + "T:hash", net->driver.virtio.rss_hash_report, "p:host_mtu", net->mtu, "T:failover", failover, NULL) < 0) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 3a69733f81..399f5aa78f 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1743,6 +1743,22 @@ qemuValidateDomainDeviceDefNetwork(const virDomainNetDef *net, } } + if (net->driver.virtio.rss && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_RSS)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("virtio rss is not supported with this " + "QEMU binary")); + return -1; + } + + if (net->driver.virtio.rss_hash_report && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_RSS)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("virtio rss hash report is not supported with this " + "QEMU binary")); + return -1; + } + if (net->mtu && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_NET_HOST_MTU)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -- 2.34.1

On Thu, Dec 30, 2021 at 08:01:44 +0200, Andrew Melnychenko wrote:
Added qemu's property check for virtio-net. And added capability QEMU_CAPS_VIRTIO_RSS.
Please name the new capability 'QEMU_CAPS_VIRTIO_NET_RSS' as it's specific to virtio-net.
With "rss" and "rss_hash_report" from domain config, qemu should enable "rss" and "hash" for virtio-net. If domain config contains "rss" and/or "rss_hash_report" options for driver. Libvirt will create an NIC device command line with enabled "rss"/"hash".
Signed-off-by: Andrew Melnychenko <andrew@daynix.com> --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 2 ++ src/qemu/qemu_validate.c | 16 ++++++++++++++++ 4 files changed, 21 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 4f63322a9e..c36a0b22e1 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -653,6 +653,7 @@ VIR_ENUM_IMPL(virQEMUCaps, "query-dirty-rate", /* QEMU_CAPS_QUERY_DIRTY_RATE */ "rbd-encryption", /* QEMU_CAPS_RBD_ENCRYPTION */ "sev-guest-kernel-hashes", /* QEMU_CAPS_SEV_GUEST_KERNEL_HASHES */ + "virtio-net.rss", /* QEMU_CAPS_VIRTIO_RSS */ );
@@ -1410,6 +1411,7 @@ static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsVirtioNet[] = { { "failover", QEMU_CAPS_VIRTIO_NET_FAILOVER, NULL }, { "packed", QEMU_CAPS_VIRTIO_PACKED_QUEUES, NULL }, { "acpi-index", QEMU_CAPS_ACPI_INDEX, NULL }, + { "rss", QEMU_CAPS_VIRTIO_RSS, NULL }, };
static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsPCIeRootPort[] = { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index aaac20a834..916a087169 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -632,6 +632,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ QEMU_CAPS_QUERY_DIRTY_RATE, /* accepts query-dirty-rate */ QEMU_CAPS_RBD_ENCRYPTION, /* Ceph RBD encryption support */ QEMU_CAPS_SEV_GUEST_KERNEL_HASHES, /* sev-guest.kernel-hashes= */ + QEMU_CAPS_VIRTIO_RSS, /* virtio-net rss feature */
QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags;
'qemucapabilitiestest' fails after this patch because you didn't include the required test data update in this commit. Per our coding guidelines the tree must cleanly compile and pass testsuite after every single commit [1]. [1]: https://www.libvirt.org/hacking.html#preparing-patches
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d822533ccb..dfe6eefd1e 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4168,6 +4168,8 @@ qemuBuildNicDevProps(virDomainDef *def, "P:vectors", vectors, "p:rx_queue_size", net->driver.virtio.rx_queue_size, "p:tx_queue_size", net->driver.virtio.tx_queue_size, + "T:rss", net->driver.virtio.rss, + "T:hash", net->driver.virtio.rss_hash_report, "p:host_mtu", net->mtu, "T:failover", failover, NULL) < 0) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 3a69733f81..399f5aa78f 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1743,6 +1743,22 @@ qemuValidateDomainDeviceDefNetwork(const virDomainNetDef *net, } }
+ if (net->driver.virtio.rss && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_RSS)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("virtio rss is not supported with this " + "QEMU binary"));
Please no linebreaks in error messages. (so that they can be grepped in the repository. We have an exception for the long line rule.
+ return -1; + } + + if (net->driver.virtio.rss_hash_report && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_RSS)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("virtio rss hash report is not supported with this " + "QEMU binary"));
Same here. Aditionally, please split the non-capability changes into a new commit.
+ return -1; + } + if (net->mtu && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_NET_HOST_MTU)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -- 2.34.1

Added caps tests for qemu 5.2+. Added rss, hash and rss+hash xml2argv tests. virtio-options tests was used for xml2xml test. Signed-off-by: Andrew Melnychenko <andrew@daynix.com> --- .../caps_5.1.0.x86_64.xml | 1 + .../caps_5.2.0.aarch64.xml | 1 + .../qemucapabilitiesdata/caps_5.2.0.ppc64.xml | 1 + .../caps_5.2.0.riscv64.xml | 1 + .../qemucapabilitiesdata/caps_5.2.0.s390x.xml | 1 + .../caps_5.2.0.x86_64.xml | 1 + .../caps_6.0.0.aarch64.xml | 1 + .../qemucapabilitiesdata/caps_6.0.0.s390x.xml | 1 + .../caps_6.0.0.x86_64.xml | 1 + .../caps_6.1.0.x86_64.xml | 1 + .../caps_6.2.0.aarch64.xml | 1 + .../qemucapabilitiesdata/caps_6.2.0.ppc64.xml | 1 + .../caps_6.2.0.x86_64.xml | 1 + tests/qemuxml2argvdata/net-virtio-hash.args | 35 +++++++++++++++++++ tests/qemuxml2argvdata/net-virtio-hash.xml | 29 +++++++++++++++ tests/qemuxml2argvdata/net-virtio-rss.args | 35 +++++++++++++++++++ tests/qemuxml2argvdata/net-virtio-rss.xml | 29 +++++++++++++++ .../qemuxml2argvdata/net-virtio-rsshash.args | 35 +++++++++++++++++++ tests/qemuxml2argvdata/net-virtio-rsshash.xml | 29 +++++++++++++++ .../virtio-options.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/virtio-options.xml | 2 +- tests/qemuxml2argvtest.c | 7 ++++ 22 files changed, 214 insertions(+), 2 deletions(-) create mode 100644 tests/qemuxml2argvdata/net-virtio-hash.args create mode 100644 tests/qemuxml2argvdata/net-virtio-hash.xml create mode 100644 tests/qemuxml2argvdata/net-virtio-rss.args create mode 100644 tests/qemuxml2argvdata/net-virtio-rss.xml create mode 100644 tests/qemuxml2argvdata/net-virtio-rsshash.args create mode 100644 tests/qemuxml2argvdata/net-virtio-rsshash.xml diff --git a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml index 578e16e8b0..24d40c5635 100644 --- a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml @@ -224,6 +224,7 @@ <flag name='query-display-options'/> <flag name='virtio-blk.queue-size'/> <flag name='virtio-mem-pci'/> + <flag name='virtio-net.rss'/> <version>5001000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100242</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_5.2.0.aarch64.xml b/tests/qemucapabilitiesdata/caps_5.2.0.aarch64.xml index b943eaedaf..149781aea7 100644 --- a/tests/qemucapabilitiesdata/caps_5.2.0.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_5.2.0.aarch64.xml @@ -184,6 +184,7 @@ <flag name='query-display-options'/> <flag name='virtio-blk.queue-size'/> <flag name='query-dirty-rate'/> + <flag name='virtio-net.rss'/> <version>5002000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>61700243</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_5.2.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_5.2.0.ppc64.xml index ec64e1cacf..3a08a306a5 100644 --- a/tests/qemucapabilitiesdata/caps_5.2.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_5.2.0.ppc64.xml @@ -190,6 +190,7 @@ <flag name='query-display-options'/> <flag name='virtio-blk.queue-size'/> <flag name='query-dirty-rate'/> + <flag name='virtio-net.rss'/> <version>5002000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>42900243</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_5.2.0.riscv64.xml b/tests/qemucapabilitiesdata/caps_5.2.0.riscv64.xml index a11d15f91a..1d47c11a2b 100644 --- a/tests/qemucapabilitiesdata/caps_5.2.0.riscv64.xml +++ b/tests/qemucapabilitiesdata/caps_5.2.0.riscv64.xml @@ -174,6 +174,7 @@ <flag name='query-display-options'/> <flag name='virtio-blk.queue-size'/> <flag name='query-dirty-rate'/> + <flag name='virtio-net.rss'/> <version>5002000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>0</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_5.2.0.s390x.xml b/tests/qemucapabilitiesdata/caps_5.2.0.s390x.xml index 552e1d43c9..ea9f7c0fc1 100644 --- a/tests/qemucapabilitiesdata/caps_5.2.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_5.2.0.s390x.xml @@ -141,6 +141,7 @@ <flag name='query-display-options'/> <flag name='virtio-blk.queue-size'/> <flag name='query-dirty-rate'/> + <flag name='virtio-net.rss'/> <version>5002000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>39100243</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml index bcc262551a..1df20ab526 100644 --- a/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml @@ -227,6 +227,7 @@ <flag name='virtio-mem-pci'/> <flag name='piix4.acpi-root-pci-hotplug'/> <flag name='query-dirty-rate'/> + <flag name='virtio-net.rss'/> <version>5002000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100243</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_6.0.0.aarch64.xml b/tests/qemucapabilitiesdata/caps_6.0.0.aarch64.xml index 0fefe64537..c96c604957 100644 --- a/tests/qemucapabilitiesdata/caps_6.0.0.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_6.0.0.aarch64.xml @@ -192,6 +192,7 @@ <flag name='set-action'/> <flag name='virtio-blk.queue-size'/> <flag name='query-dirty-rate'/> + <flag name='virtio-net.rss'/> <version>6000000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>61700242</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_6.0.0.s390x.xml b/tests/qemucapabilitiesdata/caps_6.0.0.s390x.xml index 61685066b8..fc9eb589fe 100644 --- a/tests/qemucapabilitiesdata/caps_6.0.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_6.0.0.s390x.xml @@ -149,6 +149,7 @@ <flag name='set-action'/> <flag name='virtio-blk.queue-size'/> <flag name='query-dirty-rate'/> + <flag name='virtio-net.rss'/> <version>6000000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>39100242</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml index 1b394198f1..425dfb12c1 100644 --- a/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml @@ -235,6 +235,7 @@ <flag name='virtio-mem-pci'/> <flag name='piix4.acpi-root-pci-hotplug'/> <flag name='query-dirty-rate'/> + <flag name='virtio-net.rss'/> <version>6000000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100242</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml index 1f4f49eb34..6fe35a867b 100644 --- a/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml @@ -239,6 +239,7 @@ <flag name='piix4.acpi-root-pci-hotplug'/> <flag name='query-dirty-rate'/> <flag name='rbd-encryption'/> + <flag name='virtio-net.rss'/> <version>6001000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100243</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml b/tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml index 9662214cd8..9cc2e58e7b 100644 --- a/tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml @@ -204,6 +204,7 @@ <flag name='device.json'/> <flag name='query-dirty-rate'/> <flag name='rbd-encryption'/> + <flag name='virtio-net.rss'/> <version>6001050</version> <kvmVersion>0</kvmVersion> <microcodeVersion>61700244</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml index 94528ba13a..c177ab0aae 100644 --- a/tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml @@ -200,6 +200,7 @@ <flag name='device.json'/> <flag name='query-dirty-rate'/> <flag name='rbd-encryption'/> + <flag name='virtio-net.rss'/> <version>6001050</version> <kvmVersion>0</kvmVersion> <microcodeVersion>42900244</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml index b7d6effa94..50a4fa13f9 100644 --- a/tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml @@ -241,6 +241,7 @@ <flag name='query-dirty-rate'/> <flag name='rbd-encryption'/> <flag name='sev-guest-kernel-hashes'/> + <flag name='virtio-net.rss'/> <version>6002000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100244</microcodeVersion> diff --git a/tests/qemuxml2argvdata/net-virtio-hash.args b/tests/qemuxml2argvdata/net-virtio-hash.args new file mode 100644 index 0000000000..7f6470e7ac --- /dev/null +++ b/tests/qemuxml2argvdata/net-virtio-hash.args @@ -0,0 +1,35 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/tmp/lib/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-i386 \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object secret,id=masterKey0,format=raw,file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc,usb=off,dump-guest-core=off \ +-accel tcg \ +-m 214 \ +-realtime mlock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-no-acpi \ +-boot strict=on \ +-usb \ +-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ +-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ +-netdev user,id=hostnet0 \ +-device virtio-net-pci,hash=on,netdev=hostnet0,id=net0,mac=00:11:22:33:44:55,bus=pci.0,addr=0x2 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ +-msg timestamp=on diff --git a/tests/qemuxml2argvdata/net-virtio-hash.xml b/tests/qemuxml2argvdata/net-virtio-hash.xml new file mode 100644 index 0000000000..daf1dcb1a4 --- /dev/null +++ b/tests/qemuxml2argvdata/net-virtio-hash.xml @@ -0,0 +1,29 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='i686' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-i386</emulator> + <disk type='block' device='disk'> + <source dev='/dev/HostVG/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + </disk> + <controller type='usb' index='0'/> + <interface type='user'> + <mac address='00:11:22:33:44:55'/> + <model type='virtio'/> + <driver rss_hash_report='on'/> + </interface> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/net-virtio-rss.args b/tests/qemuxml2argvdata/net-virtio-rss.args new file mode 100644 index 0000000000..f9607f2abb --- /dev/null +++ b/tests/qemuxml2argvdata/net-virtio-rss.args @@ -0,0 +1,35 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/tmp/lib/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-i386 \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object secret,id=masterKey0,format=raw,file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc,usb=off,dump-guest-core=off \ +-accel tcg \ +-m 214 \ +-realtime mlock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-no-acpi \ +-boot strict=on \ +-usb \ +-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ +-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ +-netdev user,id=hostnet0 \ +-device virtio-net-pci,rss=on,netdev=hostnet0,id=net0,mac=00:11:22:33:44:55,bus=pci.0,addr=0x2 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ +-msg timestamp=on diff --git a/tests/qemuxml2argvdata/net-virtio-rss.xml b/tests/qemuxml2argvdata/net-virtio-rss.xml new file mode 100644 index 0000000000..0ec41565f3 --- /dev/null +++ b/tests/qemuxml2argvdata/net-virtio-rss.xml @@ -0,0 +1,29 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='i686' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-i386</emulator> + <disk type='block' device='disk'> + <source dev='/dev/HostVG/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + </disk> + <controller type='usb' index='0'/> + <interface type='user'> + <mac address='00:11:22:33:44:55'/> + <model type='virtio'/> + <driver rss='on'/> + </interface> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/net-virtio-rsshash.args b/tests/qemuxml2argvdata/net-virtio-rsshash.args new file mode 100644 index 0000000000..2182431748 --- /dev/null +++ b/tests/qemuxml2argvdata/net-virtio-rsshash.args @@ -0,0 +1,35 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/tmp/lib/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-i386 \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object secret,id=masterKey0,format=raw,file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc,usb=off,dump-guest-core=off \ +-accel tcg \ +-m 214 \ +-realtime mlock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-no-acpi \ +-boot strict=on \ +-usb \ +-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ +-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ +-netdev user,id=hostnet0 \ +-device virtio-net-pci,rss=on,hash=off,netdev=hostnet0,id=net0,mac=00:11:22:33:44:55,bus=pci.0,addr=0x2 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ +-msg timestamp=on diff --git a/tests/qemuxml2argvdata/net-virtio-rsshash.xml b/tests/qemuxml2argvdata/net-virtio-rsshash.xml new file mode 100644 index 0000000000..248afa8ef8 --- /dev/null +++ b/tests/qemuxml2argvdata/net-virtio-rsshash.xml @@ -0,0 +1,29 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='i686' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-i386</emulator> + <disk type='block' device='disk'> + <source dev='/dev/HostVG/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + </disk> + <controller type='usb' index='0'/> + <interface type='user'> + <mac address='00:11:22:33:44:55'/> + <model type='virtio'/> + <driver rss='on' rss_hash_report='off'/> + </interface> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/virtio-options.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-options.x86_64-latest.args index 48f6b23c0d..ff21b4bf4a 100644 --- a/tests/qemuxml2argvdata/virtio-options.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-options.x86_64-latest.args @@ -38,7 +38,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,writeout=immediate,id=fsdev-fs1,path=/export/fs2 \ -device '{"driver":"virtio-9p-pci","iommu_platform":true,"ats":true,"packed":true,"page-per-vq":true,"id":"fs1","fsdev":"fsdev-fs1","mount_tag":"fs2","bus":"pci.0","addr":"0x4"}' \ -netdev user,id=hostnet0 \ --device '{"driver":"virtio-net-pci","iommu_platform":true,"ats":true,"packed":true,"page-per-vq":true,"netdev":"hostnet0","id":"net0","mac":"52:54:56:58:5a:5c","bus":"pci.0","addr":"0x6"}' \ +-device '{"driver":"virtio-net-pci","iommu_platform":true,"ats":true,"packed":true,"page-per-vq":true,"rss":true,"hash":true,"netdev":"hostnet0","id":"net0","mac":"52:54:56:58:5a:5c","bus":"pci.0","addr":"0x6"}' \ -device '{"driver":"virtio-mouse-pci","iommu_platform":true,"ats":true,"packed":true,"page-per-vq":true,"id":"input0","bus":"pci.0","addr":"0xe"}' \ -device '{"driver":"virtio-keyboard-pci","iommu_platform":true,"ats":true,"packed":true,"page-per-vq":true,"id":"input1","bus":"pci.0","addr":"0x10"}' \ -device '{"driver":"virtio-tablet-pci","iommu_platform":true,"ats":true,"packed":true,"page-per-vq":true,"id":"input2","bus":"pci.0","addr":"0x11"}' \ diff --git a/tests/qemuxml2argvdata/virtio-options.xml b/tests/qemuxml2argvdata/virtio-options.xml index 59e293d8e9..486bc453a1 100644 --- a/tests/qemuxml2argvdata/virtio-options.xml +++ b/tests/qemuxml2argvdata/virtio-options.xml @@ -53,7 +53,7 @@ <interface type='user'> <mac address='52:54:56:58:5a:5c'/> <model type='virtio'/> - <driver iommu='on' ats='on' packed='on' page_per_vq='on'/> + <driver rss='on' rss_hash_report='on' iommu='on' ats='on' packed='on' page_per_vq='on'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </interface> <input type='mouse' bus='virtio'> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 6c67b36d5c..771898d63c 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -3500,6 +3500,13 @@ mymain(void) DO_TEST_CAPS_LATEST("devices-acpi-index"); + DO_TEST("net-virtio-rss", + QEMU_CAPS_VIRTIO_RSS); + DO_TEST("net-virtio-hash", + QEMU_CAPS_VIRTIO_RSS); + DO_TEST("net-virtio-rsshash", + QEMU_CAPS_VIRTIO_RSS); + if (getenv("LIBVIRT_SKIP_CLEANUP") == NULL) virFileDeleteTree(fakerootdir); -- 2.34.1

On Thu, Dec 30, 2021 at 08:01:45 +0200, Andrew Melnychenko wrote:
Added caps tests for qemu 5.2+. Added rss, hash and rss+hash xml2argv tests. virtio-options tests was used for xml2xml test.
Signed-off-by: Andrew Melnychenko <andrew@daynix.com> --- .../caps_5.1.0.x86_64.xml | 1 + .../caps_5.2.0.aarch64.xml | 1 + .../qemucapabilitiesdata/caps_5.2.0.ppc64.xml | 1 + .../caps_5.2.0.riscv64.xml | 1 + .../qemucapabilitiesdata/caps_5.2.0.s390x.xml | 1 + .../caps_5.2.0.x86_64.xml | 1 + .../caps_6.0.0.aarch64.xml | 1 + .../qemucapabilitiesdata/caps_6.0.0.s390x.xml | 1 + .../caps_6.0.0.x86_64.xml | 1 + .../caps_6.1.0.x86_64.xml | 1 + .../caps_6.2.0.aarch64.xml | 1 + .../qemucapabilitiesdata/caps_6.2.0.ppc64.xml | 1 + .../caps_6.2.0.x86_64.xml | 1 +
As noted in 2/3, all of the above belong to the patch adding the capability code.
tests/qemuxml2argvdata/net-virtio-hash.args | 35 +++++++++++++++++++ tests/qemuxml2argvdata/net-virtio-hash.xml | 29 +++++++++++++++ tests/qemuxml2argvdata/net-virtio-rss.args | 35 +++++++++++++++++++ tests/qemuxml2argvdata/net-virtio-rss.xml | 29 +++++++++++++++ .../qemuxml2argvdata/net-virtio-rsshash.args | 35 +++++++++++++++++++ tests/qemuxml2argvdata/net-virtio-rsshash.xml | 29 +++++++++++++++ .../virtio-options.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/virtio-options.xml | 2 +- tests/qemuxml2argvtest.c | 7 ++++ 22 files changed, 214 insertions(+), 2 deletions(-) create mode 100644 tests/qemuxml2argvdata/net-virtio-hash.args create mode 100644 tests/qemuxml2argvdata/net-virtio-hash.xml create mode 100644 tests/qemuxml2argvdata/net-virtio-rss.args create mode 100644 tests/qemuxml2argvdata/net-virtio-rss.xml create mode 100644 tests/qemuxml2argvdata/net-virtio-rsshash.args create mode 100644 tests/qemuxml2argvdata/net-virtio-rsshash.xml
[...]
diff --git a/tests/qemuxml2argvdata/net-virtio-rsshash.xml b/tests/qemuxml2argvdata/net-virtio-rsshash.xml new file mode 100644 index 0000000000..248afa8ef8 --- /dev/null +++ b/tests/qemuxml2argvdata/net-virtio-rsshash.xml @@ -0,0 +1,29 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='i686' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-i386</emulator> + <disk type='block' device='disk'> + <source dev='/dev/HostVG/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + </disk> + <controller type='usb' index='0'/> + <interface type='user'> + <mac address='00:11:22:33:44:55'/> + <model type='virtio'/> + <driver rss='on' rss_hash_report='off'/> + </interface>
Note that you can add multiple interfaces to one guest XML, so you don't actually have to have 3 XMLs to test all 3 combinations, but add 3 network interfaces insetad.
+ <memballoon model='virtio'/> + </devices> +</domain>
[...]
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 6c67b36d5c..771898d63c 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -3500,6 +3500,13 @@ mymain(void)
DO_TEST_CAPS_LATEST("devices-acpi-index");
+ DO_TEST("net-virtio-rss", + QEMU_CAPS_VIRTIO_RSS); + DO_TEST("net-virtio-hash", + QEMU_CAPS_VIRTIO_RSS); + DO_TEST("net-virtio-rsshash", + QEMU_CAPS_VIRTIO_RSS);
All new test cases should use DO_TEST_CAPS_LATEST instead of DO_TEST, or one of the version-locked alternatives, but DO_TEST should be completely avoided.

+1 for the series On Thu, Dec 30, 2021 at 8:02 AM Andrew Melnychenko <andrew@daynix.com> wrote:
This series of patches add RSS property support for virtio-net-pci.
Virtio RSS effectively works with TAP devices, it requires additional vectors for VirtioNet, queues for TAP device, and vCPU cores. Example of device configuration: ``` <interface type="network"> <mac address="52:54:00:c4:90:25"/> <source network="default"/> <model type="virtio"/> <driver name="qemu" queues="9" rss="on" rss_hash_report="off"/> <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/> </interface> ```
Capability "rss" enables RSS, "rss_hash_report" - enables hashes in vheader. For now, "rss" property will trigger "in-qemu" RSS in most cases. Current Qemu(6.2) supports eBPF RSS that may require additional capabilities. In future, the helper will be provided. And this code is the base for VirtIO RSS.
Changes since RFC: * rebased and refactored * added tests * postponed the helper
Andrew Melnychenko (3): domain_conf: Added configs for RSS and Hash report. qemu_capabilities: Added capabilites for qemu's "rss" and "hash". test: Added caps, xml2argv and xml2xml tests.
docs/formatdomain.rst | 15 ++++++++ docs/schemas/domaincommon.rng | 10 ++++++ src/conf/domain_conf.c | 31 +++++++++++++++- src/conf/domain_conf.h | 2 ++ src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 2 ++ src/qemu/qemu_validate.c | 16 +++++++++ .../caps_5.1.0.x86_64.xml | 1 + .../caps_5.2.0.aarch64.xml | 1 + .../qemucapabilitiesdata/caps_5.2.0.ppc64.xml | 1 + .../caps_5.2.0.riscv64.xml | 1 + .../qemucapabilitiesdata/caps_5.2.0.s390x.xml | 1 + .../caps_5.2.0.x86_64.xml | 1 + .../caps_6.0.0.aarch64.xml | 1 + .../qemucapabilitiesdata/caps_6.0.0.s390x.xml | 1 + .../caps_6.0.0.x86_64.xml | 1 + .../caps_6.1.0.x86_64.xml | 1 + .../caps_6.2.0.aarch64.xml | 1 + .../qemucapabilitiesdata/caps_6.2.0.ppc64.xml | 1 + .../caps_6.2.0.x86_64.xml | 1 + tests/qemuxml2argvdata/net-virtio-hash.args | 35 +++++++++++++++++++ tests/qemuxml2argvdata/net-virtio-hash.xml | 29 +++++++++++++++ tests/qemuxml2argvdata/net-virtio-rss.args | 35 +++++++++++++++++++ tests/qemuxml2argvdata/net-virtio-rss.xml | 29 +++++++++++++++ .../qemuxml2argvdata/net-virtio-rsshash.args | 35 +++++++++++++++++++ tests/qemuxml2argvdata/net-virtio-rsshash.xml | 29 +++++++++++++++ .../virtio-options.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/virtio-options.xml | 2 +- tests/qemuxml2argvtest.c | 7 ++++ 30 files changed, 292 insertions(+), 3 deletions(-) create mode 100644 tests/qemuxml2argvdata/net-virtio-hash.args create mode 100644 tests/qemuxml2argvdata/net-virtio-hash.xml create mode 100644 tests/qemuxml2argvdata/net-virtio-rss.args create mode 100644 tests/qemuxml2argvdata/net-virtio-rss.xml create mode 100644 tests/qemuxml2argvdata/net-virtio-rsshash.args create mode 100644 tests/qemuxml2argvdata/net-virtio-rsshash.xml
-- 2.34.1
participants (4)
-
Andrew Melnychenko
-
Daniel P. Berrangé
-
Peter Krempa
-
Yan Vugenfirer