[PATCH v2 3/4] qemu_command: Added "rss" and "hash" properties.

Andrew Melnychenko andrew at daynix.com
Sun Jan 9 21:07:37 UTC 2022


Libvirt will create an NIC device command line with enabled "rss"/"hash".
If domain config contains "rss" and/or "rss_hash_report" options for driver.
Also if the qemu has device capabilities for RSS.

Signed-off-by: Andrew Melnychenko <andrew at daynix.com>
---
 src/qemu/qemu_command.c  |  2 ++
 src/qemu/qemu_validate.c | 14 ++++++++++++++
 2 files changed, 16 insertions(+)

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..155bb4a550 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -1743,6 +1743,20 @@ qemuValidateDomainDeviceDefNetwork(const virDomainNetDef *net,
             }
         }
 
+        if (net->driver.virtio.rss &&
+            !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_NET_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_NET_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




More information about the libvir-list mailing list