summaryrefslogtreecommitdiffstats
path: root/vnfs/qemu
diff options
context:
space:
mode:
authorChristian Trautman <ctrautma@redhat.com>2016-06-28 12:27:17 -0400
committerChristian Trautman <ctrautma@redhat.com>2016-06-29 17:49:52 -0400
commit095fa73e80f7a9485e72a7f3ba23c4e4608627cd (patch)
treeef727e2aba11f9a15fd29099a07ced1a85ed6607 /vnfs/qemu
parente04b1b9a22f93bb1783ff9e82486aec38dcb0efb (diff)
multi-queue: Add basic multi-queue functionality
Adds support for multi-queue using the following config. * VNF = QemuDpdkVhostUser * VSWITCH = OvsDpdkVhost * Guest Loopback as testpmd Adds CPU mask, nbcore, rxq, and txq options for testpmd. Adds option for guest nic multi-queue. Adds option for dpdkvhostuser and dpdk multi-queue enable JIRA: VSPERF-309 Change-Id: I5296fc18b430eace598d8c51620fc27a6c46a65e Signed-off-by: Christian Trautman <ctrautma@redhat.com>
Diffstat (limited to 'vnfs/qemu')
-rw-r--r--vnfs/qemu/qemu.py19
-rw-r--r--vnfs/qemu/qemu_dpdk_vhost_user.py19
2 files changed, 30 insertions, 8 deletions
diff --git a/vnfs/qemu/qemu.py b/vnfs/qemu/qemu.py
index 2de8df2a..9382edef 100644
--- a/vnfs/qemu/qemu.py
+++ b/vnfs/qemu/qemu.py
@@ -354,9 +354,22 @@ class IVnfQemu(IVnf):
'/DPDK/app/test-pmd')
self.execute_and_wait('make clean')
self.execute_and_wait('make')
- self.execute_and_wait('./testpmd -c 0x3 -n 4 --socket-mem 512 --'
- ' --burst=64 -i --txqflags=0xf00 ' +
- '--disable-hw-vlan', 60, "Done")
+ if int(S.getValue('GUEST_NIC_QUEUES')):
+ self.execute_and_wait(
+ './testpmd {} -n4 --socket-mem 512 --'.format(
+ S.getValue('GUEST_TESTPMD_CPU_MASK')) +
+ ' --burst=64 -i --txqflags=0xf00 ' +
+ '--nb-cores={} --rxq={} --txq={} '.format(
+ S.getValue('GUEST_TESTPMD_NB_CORES'),
+ S.getValue('GUEST_TESTPMD_TXQ'),
+ S.getValue('GUEST_TESTPMD_RXQ')) +
+ '--disable-hw-vlan', 60, "Done")
+ else:
+ self.execute_and_wait(
+ './testpmd {} -n 4 --socket-mem 512 --'.format(
+ S.getValue('GUEST_TESTPMD_CPU_MASK')) +
+ ' --burst=64 -i --txqflags=0xf00 ' +
+ '--disable-hw-vlan', 60, "Done")
self.execute('set fwd ' + self._testpmd_fwd_mode, 1)
self.execute_and_wait('start', 20,
'TX RS bit threshold=.+ - TXQ flags=0xf00')
diff --git a/vnfs/qemu/qemu_dpdk_vhost_user.py b/vnfs/qemu/qemu_dpdk_vhost_user.py
index f0f97d8a..49131423 100644
--- a/vnfs/qemu/qemu_dpdk_vhost_user.py
+++ b/vnfs/qemu/qemu_dpdk_vhost_user.py
@@ -38,6 +38,14 @@ class QemuDpdkVhostUser(IVnfQemu):
net1 = 'net' + str(i + 1)
net2 = 'net' + str(i + 2)
+ # multi-queue values
+ if int(S.getValue('GUEST_NIC_QUEUES')):
+ queue_str = ',queues={}'.format(S.getValue('GUEST_NIC_QUEUES'))
+ mq_vector_str = ',mq=on,vectors={}'.format(
+ int(S.getValue('GUEST_NIC_QUEUES')) * 2 + 2)
+ else:
+ queue_str, mq_vector_str = '', ''
+
self._cmd += ['-chardev',
'socket,id=char' + if1 +
',path=' + S.getValue('OVS_VAR_DIR') +
@@ -48,19 +56,20 @@ class QemuDpdkVhostUser(IVnfQemu):
'dpdkvhostuser' + if2,
'-netdev',
'type=vhost-user,id=' + net1 +
- ',chardev=char' + if1 + ',vhostforce',
+ ',chardev=char' + if1 + ',vhostforce' + queue_str,
'-device',
'virtio-net-pci,mac=' +
S.getValue('GUEST_NET1_MAC')[self._number] +
',netdev=' + net1 + ',csum=off,gso=off,' +
- 'guest_tso4=off,guest_tso6=off,guest_ecn=off',
+ 'guest_tso4=off,guest_tso6=off,guest_ecn=off' +
+ mq_vector_str,
'-netdev',
'type=vhost-user,id=' + net2 +
- ',chardev=char' + if2 + ',vhostforce',
+ ',chardev=char' + if2 + ',vhostforce' + queue_str,
'-device',
'virtio-net-pci,mac=' +
S.getValue('GUEST_NET2_MAC')[self._number] +
',netdev=' + net2 + ',csum=off,gso=off,' +
- 'guest_tso4=off,guest_tso6=off,guest_ecn=off',
+ 'guest_tso4=off,guest_tso6=off,guest_ecn=off' +
+ mq_vector_str,
]
-