* [dts] [PATCH V2] framework: add server mode and multi queue support for qemu framework
@ 2016-12-19 7:34 xu,huilong
2016-12-20 0:25 ` Liu, Yong
0 siblings, 1 reply; 2+ messages in thread
From: xu,huilong @ 2016-12-19 7:34 UTC (permalink / raw)
To: dts; +Cc: lei yao
From: lei yao <lei.a.yao@intel.com>
1. Server mode In vhost reconnection test, we need set qemu
work in server mode(default is client mode) The sample command is :
"-chardev socket,id=char0,path=./vhost-net1,server"
2. Multiqueue
We can set multiqueue connection between vhost and virtio. Add this parameter for the
multi-queue performance testing. The sample command is: "-netdev
type=vhost-user,id=mynet1,chardev=char0,vhostforce,queues=4"
3. Change the VM launch waiting time.Some times,we find that lauching vm need more time.
So change count=20 to count 40
Signed-off-by: lei yao <lei.a.yao@intel.com>
---
conf/vhost_sample.cfg | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++
framework/qemu_kvm.py | 24 +++++++++++++++------
2 files changed, 76 insertions(+), 7 deletions(-)
diff --git a/conf/vhost_sample.cfg b/conf/vhost_sample.cfg
index ce34af8..8bdc20e 100644
--- a/conf/vhost_sample.cfg
+++ b/conf/vhost_sample.cfg
@@ -1,4 +1,63 @@
+# QEMU options
+# name
+# name: vm0
+#
+# enable_kvm
+# enable: [yes | no]
+#
+# cpu
+# model: [host | core2duo | ...]
+# usage:
+# choose model value from the command
+# qemu-system-x86_64 -cpu help
+# number: '4' #number of vcpus
+# cpupin: '3 4 5 6' # host cpu list
+#
+# mem
+# size: 1024
+#
+# disk
+# file: /path/to/image/test.img
+#
+# char
+# opt_path: define the file path to vhost-net socket file
+# opt_server: define the qemu socket connection work at server mode or client mdoe. Default is client
+#
+# net
+# type: [vhost-user | ...]
+# vhost-user
+# opt_queue: queue=n, used for multi-queue connection between vhost and virtio
+#
+# device
+# driver: [ virtio-net-pci | ...]
+# virtio-net-pci
+# prop_netdev: netdev0
+# opt_mac: 00:00:00:00:01:03
+#
+# monitor
+# port: 6061
+# note: if adding monitor to vm, need to specicy
+# this port, else it will get a free port
+# on the host machine.
+#
+# qga
+# enable: [yes | no]
+#
+# serial_port
+# enable: [yes | no]
+#
+# vnc
+# displayNum: 1
+# note: you can choose a number not used on the host.
+#
+# daemon
+# enable: 'yes'
+# note:
+# By default VM will start with the daemonize status.
+# Not support starting it on the stdin now.
+
# vm configuration for vhost sample case
+
[vm0]
cpu =
model=host,number=2,cpupin=24 25;
diff --git a/framework/qemu_kvm.py b/framework/qemu_kvm.py
index 6ced54a..e9d29cc 100644
--- a/framework/qemu_kvm.py
+++ b/framework/qemu_kvm.py
@@ -606,21 +606,31 @@ class QEMUKvm(VirtBase):
if 'opt_path' in options.keys() and options['opt_path']:
dev_boot_line = '-chardev socket'
char_id = 'char%d' % self.char_idx
- dev_boot_line += separator + 'id=%s' % char_id + separator + 'path=%s' % options['opt_path']
- self.char_idx += 1
- self.__add_boot_line(dev_boot_line)
+ if 'opt_server' in options.keys() and options['opt_server']:
+ dev_boot_line += separator + 'id=%s' % char_id + separator + 'path=%s' %options['opt_path'] + separator + '%s' % options['opt_server']
+ self.char_idx += 1
+ self.__add_boot_line(dev_boot_line)
+ else:
+ dev_boot_line += separator + 'id=%s' % char_id + separator + 'path=%s' %options['opt_path']
+ self.char_idx += 1
+ self.__add_boot_line(dev_boot_line)
# netdev parameter
netdev_id = 'netdev%d' % self.netdev_idx
self.netdev_idx += 1
- dev_boot_line = '-netdev type=vhost-user,id=%s,chardev=%s,vhostforce' % (netdev_id, char_id)
+ if 'opt_queue' in options.keys() and options['opt_queue']:
+ queue_num=options['opt_queue']
+ dev_boot_line = '-netdev type=vhost-user,id=%s,chardev=%s,vhostforce,queues=%s' % (netdev_id, char_id,queue_num)
+ else:
+ dev_boot_line = '-netdev type=vhost-user,id=%s,chardev=%s,vhostforce' % (netdev_id, char_id)
self.__add_boot_line(dev_boot_line)
# device parameter
opts = {'opt_netdev': '%s' % netdev_id}
if 'opt_mac' in options.keys() and \
options['opt_mac']:
opts['opt_mac'] = options['opt_mac']
-
- self.__add_vm_virtio_net_pci(**opts)
+ if 'opt_settings' in options.keys() and options['opt_settings']:
+ opts['opt_settings'] = options['opt_settings']
+ self.__add_vm_virtio_net_pci(**opts)
def __add_vm_virtio_cuse_pci(self, **options):
"""
@@ -939,7 +949,7 @@ class QEMUKvm(VirtBase):
wait for 120 seconds for vm net ready
10.0.2.* is the default ip address allocated by qemu
"""
- count = 20
+ count = 40
while count:
out = self.__control_session('ifconfig')
if "10.0.2" in out:
--
2.7.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dts] [PATCH V2] framework: add server mode and multi queue support for qemu framework
2016-12-19 7:34 [dts] [PATCH V2] framework: add server mode and multi queue support for qemu framework xu,huilong
@ 2016-12-20 0:25 ` Liu, Yong
0 siblings, 0 replies; 2+ messages in thread
From: Liu, Yong @ 2016-12-20 0:25 UTC (permalink / raw)
To: xu,huilong, dts; +Cc: lei yao
Thanks, applied.
On 12/19/2016 03:34 PM, xu,huilong wrote:
> From: lei yao <lei.a.yao@intel.com>
>
> 1. Server mode In vhost reconnection test, we need set qemu
> work in server mode(default is client mode) The sample command is :
> "-chardev socket,id=char0,path=./vhost-net1,server"
> 2. Multiqueue
> We can set multiqueue connection between vhost and virtio. Add this parameter for the
> multi-queue performance testing. The sample command is: "-netdev
> type=vhost-user,id=mynet1,chardev=char0,vhostforce,queues=4"
> 3. Change the VM launch waiting time.Some times,we find that lauching vm need more time.
> So change count=20 to count 40
>
> Signed-off-by: lei yao <lei.a.yao@intel.com>
> ---
> conf/vhost_sample.cfg | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++
> framework/qemu_kvm.py | 24 +++++++++++++++------
> 2 files changed, 76 insertions(+), 7 deletions(-)
>
> diff --git a/conf/vhost_sample.cfg b/conf/vhost_sample.cfg
> index ce34af8..8bdc20e 100644
> --- a/conf/vhost_sample.cfg
> +++ b/conf/vhost_sample.cfg
> @@ -1,4 +1,63 @@
> +# QEMU options
> +# name
> +# name: vm0
> +#
> +# enable_kvm
> +# enable: [yes | no]
> +#
> +# cpu
> +# model: [host | core2duo | ...]
> +# usage:
> +# choose model value from the command
> +# qemu-system-x86_64 -cpu help
> +# number: '4' #number of vcpus
> +# cpupin: '3 4 5 6' # host cpu list
> +#
> +# mem
> +# size: 1024
> +#
> +# disk
> +# file: /path/to/image/test.img
> +#
> +# char
> +# opt_path: define the file path to vhost-net socket file
> +# opt_server: define the qemu socket connection work at server mode or client mdoe. Default is client
> +#
> +# net
> +# type: [vhost-user | ...]
> +# vhost-user
> +# opt_queue: queue=n, used for multi-queue connection between vhost and virtio
> +#
> +# device
> +# driver: [ virtio-net-pci | ...]
> +# virtio-net-pci
> +# prop_netdev: netdev0
> +# opt_mac: 00:00:00:00:01:03
> +#
> +# monitor
> +# port: 6061
> +# note: if adding monitor to vm, need to specicy
> +# this port, else it will get a free port
> +# on the host machine.
> +#
> +# qga
> +# enable: [yes | no]
> +#
> +# serial_port
> +# enable: [yes | no]
> +#
> +# vnc
> +# displayNum: 1
> +# note: you can choose a number not used on the host.
> +#
> +# daemon
> +# enable: 'yes'
> +# note:
> +# By default VM will start with the daemonize status.
> +# Not support starting it on the stdin now.
> +
> # vm configuration for vhost sample case
> +
> [vm0]
> cpu =
> model=host,number=2,cpupin=24 25;
> diff --git a/framework/qemu_kvm.py b/framework/qemu_kvm.py
> index 6ced54a..e9d29cc 100644
> --- a/framework/qemu_kvm.py
> +++ b/framework/qemu_kvm.py
> @@ -606,21 +606,31 @@ class QEMUKvm(VirtBase):
> if 'opt_path' in options.keys() and options['opt_path']:
> dev_boot_line = '-chardev socket'
> char_id = 'char%d' % self.char_idx
> - dev_boot_line += separator + 'id=%s' % char_id + separator + 'path=%s' % options['opt_path']
> - self.char_idx += 1
> - self.__add_boot_line(dev_boot_line)
> + if 'opt_server' in options.keys() and options['opt_server']:
> + dev_boot_line += separator + 'id=%s' % char_id + separator + 'path=%s' %options['opt_path'] + separator + '%s' % options['opt_server']
> + self.char_idx += 1
> + self.__add_boot_line(dev_boot_line)
> + else:
> + dev_boot_line += separator + 'id=%s' % char_id + separator + 'path=%s' %options['opt_path']
> + self.char_idx += 1
> + self.__add_boot_line(dev_boot_line)
> # netdev parameter
> netdev_id = 'netdev%d' % self.netdev_idx
> self.netdev_idx += 1
> - dev_boot_line = '-netdev type=vhost-user,id=%s,chardev=%s,vhostforce' % (netdev_id, char_id)
> + if 'opt_queue' in options.keys() and options['opt_queue']:
> + queue_num=options['opt_queue']
> + dev_boot_line = '-netdev type=vhost-user,id=%s,chardev=%s,vhostforce,queues=%s' % (netdev_id, char_id,queue_num)
> + else:
> + dev_boot_line = '-netdev type=vhost-user,id=%s,chardev=%s,vhostforce' % (netdev_id, char_id)
> self.__add_boot_line(dev_boot_line)
> # device parameter
> opts = {'opt_netdev': '%s' % netdev_id}
> if 'opt_mac' in options.keys() and \
> options['opt_mac']:
> opts['opt_mac'] = options['opt_mac']
> -
> - self.__add_vm_virtio_net_pci(**opts)
> + if 'opt_settings' in options.keys() and options['opt_settings']:
> + opts['opt_settings'] = options['opt_settings']
> + self.__add_vm_virtio_net_pci(**opts)
>
> def __add_vm_virtio_cuse_pci(self, **options):
> """
> @@ -939,7 +949,7 @@ class QEMUKvm(VirtBase):
> wait for 120 seconds for vm net ready
> 10.0.2.* is the default ip address allocated by qemu
> """
> - count = 20
> + count = 40
> while count:
> out = self.__control_session('ifconfig')
> if "10.0.2" in out:
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-12-20 0:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-19 7:34 [dts] [PATCH V2] framework: add server mode and multi queue support for qemu framework xu,huilong
2016-12-20 0:25 ` Liu, Yong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).