CSIT-494 Add multi-queue support for Qemu 78/4178/2
authorpmikus <pmikus@cisco.com>
Thu, 8 Dec 2016 13:28:52 +0000 (14:28 +0100)
committerPeter Mikus <pmikus@cisco.com>
Thu, 8 Dec 2016 14:14:14 +0000 (14:14 +0000)
Add multi-queue support when starting qemu. Full implementation
will be following in near future.

Change-Id: I743bbde67254b26a4e4e98072bad57dde728845a
Signed-off-by: pmikus <pmikus@cisco.com>
resources/libraries/python/QemuUtils.py

index ea1d56a..1e3a8aa 100644 (file)
@@ -39,7 +39,7 @@ class QemuUtils(object):
         # Daemonize the QEMU process after initialization. Default one
         # management interface.
         self._qemu_opt['options'] = '-cpu host -daemonize -enable-kvm ' \
-            '-machine pc-1.0,accel=kvm,usb=off,mem-merge=off ' \
+            '-machine pc,accel=kvm,usb=off,mem-merge=off ' \
             '-net nic,macaddr=52:54:00:00:02:01 -balloon none'
         self._qemu_opt['ssh_fwd_port'] = 10022
         # Default serial console port
@@ -60,6 +60,8 @@ class QemuUtils(object):
             'password': 'cisco',
             'interfaces': {},
         }
+        # Virtio queue count
+        self._qemu_opt['queues'] = 1
         self._vhost_id = 0
         self._ssh = None
         self._node = None
@@ -194,15 +196,15 @@ class QemuUtils(object):
             chardev += ',server'
         self._qemu_opt['options'] += chardev
         # Create Vhost-user network backend.
-        netdev = ' -netdev vhost-user,id=vhost{0},chardev=char{0}'.format(
-            self._vhost_id)
+        netdev = ' -netdev vhost-user,id=vhost{0},chardev=char{0},'\
+            'queues={1}'.format(self._vhost_id, self._qemu_opt['queues'])
         self._qemu_opt['options'] += netdev
         # If MAC is not specified use autogenerated 52:54:00:00:04:<vhost_id>
         # e.g. vhost1 MAC is 52:54:00:00:04:01
         if mac is None:
             mac = '52:54:00:00:04:{0:02x}'.format(self._vhost_id)
-        extend_options = 'csum=off,gso=off,guest_tso4=off,guest_tso6=off,'\
-            'guest_ecn=off,mrg_rxbuf=off'
+        extend_options = 'mq=on,csum=off,gso=off,guest_tso4=off,'\
+            'guest_tso6=off,guest_ecn=off,mrg_rxbuf=off'
         # Create Virtio network device.
         device = ' -device virtio-net-pci,netdev=vhost{0},mac={1},{2}'.format(
             self._vhost_id, mac, extend_options)

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.