summaryrefslogtreecommitdiffstats
path: root/vnfs
diff options
context:
space:
mode:
Diffstat (limited to 'vnfs')
-rw-r--r--vnfs/qemu/qemu.py39
-rw-r--r--vnfs/qemu/qemu_dpdk_vhost_user.py5
2 files changed, 41 insertions, 3 deletions
diff --git a/vnfs/qemu/qemu.py b/vnfs/qemu/qemu.py
index 977b7bc1..ae0056dc 100644
--- a/vnfs/qemu/qemu.py
+++ b/vnfs/qemu/qemu.py
@@ -81,6 +81,11 @@ class IVnfQemu(IVnf):
self._testpmd_fwd_mode, 'io')
self._testpmd_fwd_mode = 'io'
+ guest_smp = int(get_test_param('guest_smp', 0))
+ if guest_smp:
+ override_list = [guest_smp] * (self._number + 1)
+ S.setValue('GUEST_SMP', override_list)
+
name = 'Client%d' % self._number
vnc = ':%d' % self._number
# NOTE: affinization of main qemu process can cause hangup of 2nd VM
@@ -232,14 +237,18 @@ class IVnfQemu(IVnf):
stdin=proc.stdout)
proc.wait()
+ guest_core_binding = int(get_test_param('guest_core_binding', 0))
for cpu in range(0, int(S.getValue('GUEST_SMP')[self._number])):
match = None
for line in output.decode(cur_locale).split('\n'):
match = re.search(thread_id % cpu, line)
if match:
- self._affinitize_pid(
- S.getValue('GUEST_CORE_BINDING')[self._number][cpu],
- match.group(1))
+ if guest_core_binding:
+ self._affinitize_pid(guest_core_binding, match.group(1))
+ else:
+ self._affinitize_pid(
+ S.getValue('GUEST_CORE_BINDING')[self._number][cpu],
+ match.group(1))
break
if not match:
@@ -391,6 +400,30 @@ class IVnfQemu(IVnf):
'/DPDK/app/test-pmd')
self.execute_and_wait('make clean')
self.execute_and_wait('make')
+
+ # get multi-queue settings from CLI
+ guest_testpmd_txq = int(get_test_param('guest_testpmd_txq', 0))
+ if guest_testpmd_txq:
+ override_list = [guest_testpmd_txq] * (self._number + 1)
+ S.setValue('GUEST_TESTPMD_TXQ', override_list)
+
+ guest_testpmd_rxq = int(get_test_param('guest_testpmd_rxq', 0))
+ if guest_testpmd_rxq:
+ override_list = [guest_testpmd_rxq] * (self._number + 1)
+ S.setValue('GUEST_TESTPMD_RXQ', override_list)
+
+ guest_testpmd_nb_cores = \
+ int(get_test_param('guest_testpmd_nb_cores', 0))
+ if guest_testpmd_nb_cores:
+ override_list = [guest_testpmd_nb_cores] * (self._number + 1)
+ S.setValue('GUEST_TESTPMD_NB_CORES', override_list)
+
+ guest_testpmd_cpu_mask = \
+ int(get_test_param('guest_testpmd_cpu_mask', 0))
+ if guest_testpmd_cpu_mask:
+ override_list = [guest_testpmd_cpu_mask] * (self._number + 1)
+ S.setValue('GUEST_TESTPMD_CPU_MASK', override_list)
+
if int(S.getValue('GUEST_NIC_QUEUES')[self._number]):
self.execute_and_wait(
'./testpmd {} -n4 --socket-mem 512 --'.format(
diff --git a/vnfs/qemu/qemu_dpdk_vhost_user.py b/vnfs/qemu/qemu_dpdk_vhost_user.py
index 51c10242..a25c61ef 100644
--- a/vnfs/qemu/qemu_dpdk_vhost_user.py
+++ b/vnfs/qemu/qemu_dpdk_vhost_user.py
@@ -18,6 +18,7 @@
import logging
from conf import settings as S
+from conf import get_test_param
from vnfs.qemu.qemu import IVnfQemu
class QemuDpdkVhostUser(IVnfQemu):
@@ -32,6 +33,10 @@ class QemuDpdkVhostUser(IVnfQemu):
self._logger = logging.getLogger(__name__)
# multi-queue values
+ guest_nic_queues = int(get_test_param('guest_nic_queues', 0))
+ if guest_nic_queues:
+ override_list = [guest_nic_queues] * (self._number + 1)
+ S.setValue('GUEST_NIC_QUEUES', override_list)
if int(S.getValue('GUEST_NIC_QUEUES')[self._number]):
queue_str = ',queues={}'.format(S.getValue('GUEST_NIC_QUEUES')[self._number])
mq_vector_str = ',mq=on,vectors={}'.format(