Feature #2159: Add support for RX queues for virt-io NICS (VIRTIO_QUEUES)

(cherry picked from commit 798b7cdb41)
This commit is contained in:
Ruben S. Montero committed 2018-06-14 11:16:34 +02:00
1 parent ff4c32a631
commit c4e978ca9d
3 files changed
+24 -8

No files matched your search

+3
View File
@@ -855,6 +855,7 @@ function get_disk_information {
# * MODEL
# * IP
# * FILTER
# * VIRTIO_QUEUES
# * VROUTER_IP
# * INBOUND_AVG_BW
# * INBOUND_PEAK_BW
@@ -887,6 +888,7 @@ function get_nic_information {
$NIC_XPATH/MODEL \
$NIC_XPATH/IP \
$NIC_XPATH/FILTER \
$NIC_XPATH/VIRTIO_QUEUES \
$NIC_XPATH/VROUTER_IP \
$NIC_XPATH/INBOUND_AVG_BW \
$NIC_XPATH/INBOUND_PEAK_BW \
@@ -906,6 +908,7 @@ function get_nic_information {
MODEL="${XPATH_ELEMENTS[j++]}"
IP="${XPATH_ELEMENTS[j++]}"
FILTER="${XPATH_ELEMENTS[j++]}"
VIRTIO_QUEUES="${XPATH_ELEMENTS[j++]}"
VROUTER_IP="${XPATH_ELEMENTS[j++]}"
INBOUND_AVG_BW="${XPATH_ELEMENTS[j++]}"
INBOUND_PEAK_BW="${XPATH_ELEMENTS[j++]}"
+17 -8
View File
@@ -174,6 +174,7 @@ int LibVirtDriver::deployment_description_kvm(
string ip = "";
string vrouter_ip = "";
string filter = "";
string virtio_queues = "";
string i_avg_bw = "";
string i_peak_bw = "";
@@ -902,14 +903,15 @@ int LibVirtDriver::deployment_description_kvm(
for(int i=0; i<num; i++)
{
bridge = nic[i]->vector_value("BRIDGE");
vn_mad = nic[i]->vector_value("VN_MAD");
mac = nic[i]->vector_value("MAC");
target = nic[i]->vector_value("TARGET");
script = nic[i]->vector_value("SCRIPT");
model = nic[i]->vector_value("MODEL");
ip = nic[i]->vector_value("IP");
filter = nic[i]->vector_value("FILTER");
bridge = nic[i]->vector_value("BRIDGE");
vn_mad = nic[i]->vector_value("VN_MAD");
mac = nic[i]->vector_value("MAC");
target = nic[i]->vector_value("TARGET");
script = nic[i]->vector_value("SCRIPT");
model = nic[i]->vector_value("MODEL");
ip = nic[i]->vector_value("IP");
filter = nic[i]->vector_value("FILTER");
virtio_queues = nic[i]->vector_value("VIRTIO_QUEUES");
vrouter_ip = nic[i]->vector_value("VROUTER_IP");
@@ -978,6 +980,13 @@ int LibVirtDriver::deployment_description_kvm(
{
file << "\t\t\t<model type="
<< one_util::escape_xml_attr(*the_model) << "/>\n";
if(!virtio_queues.empty() && *the_model == "virtio")
{
file << "\t\t\t<driver name='vhost' queues="
<< one_util::escape_xml_attr(virtio_queues)
<< "/>\n";
}
}
if (!ip.empty() )
+4
View File
@@ -58,6 +58,10 @@ fi
[ -n "${SCRIPT}" ] && DEVICE+=" <script path='$(xml_esc "${SCRIPT}")'/>"
[ -n "${MODEL}" ] && DEVICE+=" <model type='$(xml_esc "${MODEL}")'/>"
if [ -n "${VIRTIO_QUEUES}" ] && [ "${MODEL}" = "virtio" ]; then
DEVICE+=" <driver name='vhost' queues='$(xml_esc "${VIRTIO_QUEUES}")'/>"
fi
if [ -n "${IP}" ] && [ -n "${FILTER}" ]; then
DEVICE+=" <filterref filter='$(xml_esc "${FILTER}")'>"
DEVICE+=" <parameter name='IP' value='$(xml_esc "${IP}")'/>"