diff options
author | Christian Trautman <ctrautma@redhat.com> | 2016-07-01 22:44:38 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2016-07-01 22:44:38 +0000 |
commit | 26a7262cee1a2961ed5aa76bd969dddeff8ea472 (patch) | |
tree | 31017520e60b8bbec9a992fc43ac7c0195495f4e /vnfs/qemu/qemu_dpdk_vhost_user.py | |
parent | 4bd09fc0c95f89f3041e6a5a66613eb7cd7eaff8 (diff) | |
parent | 095fa73e80f7a9485e72a7f3ba23c4e4608627cd (diff) |
Merge "multi-queue: Add basic multi-queue functionality"
Diffstat (limited to 'vnfs/qemu/qemu_dpdk_vhost_user.py')
-rw-r--r-- | vnfs/qemu/qemu_dpdk_vhost_user.py | 19 |
1 files changed, 14 insertions, 5 deletions
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, ] - |