From 983066a139b95e74cb06fa022608c760cd179f0a Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Thu, 30 Jan 2025 12:33:14 +0100 Subject: [PATCH] F #6435: Automatic setting of NIC IO queues This commit adds support for "auto" setting for virtio queues of NICs. It follows the approach implemented by VIRTIO_BLK_QUEUES for DISKS. The commit also includes default setting and RSunstone implementation Signed-off-by: Kristian Feldsam --- .../create/wizard-tabs/network/nic-tab/html.hbs | 5 ++++- src/vmm/LibVirtDriverKVM.cc | 16 +++++++++++++++- src/vmm_mad/exec/vmm_exec_kvm.conf | 4 +++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/network/nic-tab/html.hbs b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/network/nic-tab/html.hbs index 61af2e91a3d..1893f248111 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/network/nic-tab/html.hbs +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/network/nic-tab/html.hbs @@ -313,7 +313,10 @@ {{tr "Transmission queue"}} {{{tip (tr "Only supported for virtio driver.")}}} - +
diff --git a/src/vmm/LibVirtDriverKVM.cc b/src/vmm/LibVirtDriverKVM.cc index e9f71f73a64..836945e145a 100644 --- a/src/vmm/LibVirtDriverKVM.cc +++ b/src/vmm/LibVirtDriverKVM.cc @@ -615,7 +615,8 @@ int LibVirtDriver::deployment_description_kvm( string o_peak_kb; string default_filter; - string default_model ; + string default_model; + string default_virtio_queues; const VectorAttribute * graphics; @@ -1697,6 +1698,8 @@ int LibVirtDriver::deployment_description_kvm( get_attribute(nullptr, host, cluster, "NIC", "MODEL", default_model); + get_attribute(nullptr, host, cluster, "NIC", "VIRTIO_QUEUES", default_virtio_queues); + num = vm->get_template_attribute("NIC", nic); for (int i=0; i\n"; + if (!virtio_queues.empty()) + { + set_queues(virtio_queues, vcpu) + } + else if (!default_virtio_queues.empty()) + { + set_queues(default_virtio_queues, vcpu) + + virtio_queues = default_virtio_queues; + } + if (!virtio_queues.empty() && *the_model == "virtio") { file << "\t\t\t