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

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

 



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@xxxxxxxxxx>
---
 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




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

  Powered by Linux