Skip to content

Commit

Permalink
F #6435: Automatic setting of NIC IO queues
Browse files Browse the repository at this point in the history
Signed-off-by: Kristian Feldsam <feldsam@gmail.com>
  • Loading branch information
feldsam committed Dec 17, 2023
1 parent 725337e commit 4349a11
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,10 @@
{{tr "Transmission queue"}}
{{{tip (tr "Only supported for virtio driver.")}}}
</label>
<input type="number" min="0" wizard_field="VIRTIO_QUEUES" id="VIRTIO_QUEUES" name="VIRTIO_QUEUES" />
<select wizard_field="VIRTIO_QUEUES" id="VIRTIO_QUEUES" name="VIRTIO_QUEUES">
<option value=""> - </option>
<option value="auto">Auto</option>
</select>
</div>
</div>
<div class="row pci-row">
Expand Down
16 changes: 15 additions & 1 deletion src/vmm/LibVirtDriverKVM.cc
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,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;

Expand Down Expand Up @@ -1676,6 +1677,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<num; i++)
Expand Down Expand Up @@ -1774,6 +1777,17 @@ int LibVirtDriver::deployment_description_kvm(
file << "\t\t\t<model type="
<< one_util::escape_xml_attr(*the_model) << "/>\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<driver name='vhost' queues="
Expand Down
4 changes: 3 additions & 1 deletion src/vmm_mad/exec/vmm_exec_kvm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
# * NIC:
# - FILTER
# - MODEL
# - VIRTIO_QUEUES
# * RAW: raw attribute value is appended to that on the VM template
# * HYPERV_OPTIONS: options used for FEATURES = [ HYPERV = yes ]
# * HYPERV_TIMERS: timers added when HYPERV is set to yes in FEATURES
Expand Down Expand Up @@ -92,7 +93,8 @@ DISK = [
]

NIC = [
MODEL = "virtio"
MODEL = "virtio",
VIRTIO_QUEUES = "auto"
# FILTER = "clean-traffic"
]

Expand Down

0 comments on commit 4349a11

Please sign in to comment.