From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 7C83AF91A for ; Thu, 12 Jan 2017 04:16:46 +0100 (CET) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP; 11 Jan 2017 19:16:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,348,1477983600"; d="scan'208";a="52028027" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga005.jf.intel.com with ESMTP; 11 Jan 2017 19:16:43 -0800 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 11 Jan 2017 19:16:43 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 11 Jan 2017 19:16:41 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX104.ccr.corp.intel.com ([10.239.4.70]) with mapi id 14.03.0248.002; Thu, 12 Jan 2017 11:16:39 +0800 From: "Tu, LijuanX A" To: "Liu, Yong" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH V1] framework: add kill qemu script. If vm not quit normally, VF will not released. and this will cause next testsuite failed. Thread-Index: AQHSaj5P0qNXu07yokKVSNKiT9XQAaE0EktAgAAKknA= Date: Thu, 12 Jan 2017 03:16:38 +0000 Message-ID: <38D041F150D4184C8114E499040E62343D1DFAD4@shsmsx102.ccr.corp.intel.com> References: <1483941920-33564-1-git-send-email-lijuanx.a.tu@intel.com> <86228AFD5BCD8E4EBFD2B90117B5E81E62D42F71@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <86228AFD5BCD8E4EBFD2B90117B5E81E62D42F71@SHSMSX103.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V1] framework: add kill qemu script. If vm not quit normally, VF will not released. and this will cause next testsuite failed. X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 03:16:47 -0000 Hi yong I have got your comments, will sent v2 as soon as possible. > Do not known why need to enable autoneg on PF device. [lijuan] I will remove this ,it's not related with the function, though it'= s know issue, refer to DPDK-1754 > -----Original Message----- > From: Liu, Yong > Sent: Thursday, January 12, 2017 9:43 AM > To: Tu, LijuanX A; dts@dpdk.org > Cc: Tu, LijuanX A > Subject: RE: [dts] [PATCH V1] framework: add kill qemu script. If vm not= quit > normally, VF will not released. and this will cause next testsuite faile= d. >=20 > Lijuan, > Some comments below. Please make the email subject more compact and add > detail description in your git comment. >=20 > > -----Original Message----- > > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Lijuan Tu > > Sent: Monday, January 09, 2017 2:05 PM > > To: dts@dpdk.org > > Cc: Tu, LijuanX A > > Subject: [dts] [PATCH V1] framework: add kill qemu script. If vm not > > quit normally, VF will not released. and this will cause next testsuit= e > failed. > > > > Signed-off-by: Lijuan Tu > > --- > > framework/dut.py | 24 ++++++++++++++++++++++++ > > framework/qemu_kvm.py | 30 ++++++++++++++++++++++++++++++ > > framework/test_case.py | 6 ++++++ > > 3 files changed, 60 insertions(+) > > > > diff --git a/framework/dut.py b/framework/dut.py index > > 1d4a383..9500107 > > 100644 > > --- a/framework/dut.py > > +++ b/framework/dut.py > > @@ -73,6 +73,8 @@ class Dut(Crb): > > self.conf =3D PortConf() > > self.ports_map =3D [] > > self.virt_pool =3D None > > + # hypervisor pid list, used for cleanup > > + self.virt_pids =3D [] > > > > def init_host_session(self): > > if self.host_init_flag: > > @@ -816,6 +818,17 @@ class Dut(Crb): > > pci =3D self.ports_info[port_id]['pci'] > > self.virt_pool.del_vf_on_pf(pf_pci=3Dpci, vflist=3Dvflist) > > > > + def destroy_all_sriov_vfs(self): > > + > > + if self.ports_info =3D=3D None: > > + return > > + for port_id in (0,len(self.ports_info)-1): > Not satisfy with pep8 rule, please check first. > Parameter port_id in destroy_sriov_vfs_by_port mean port index, the func= tion > here only destroy devices of the first and last port. > You need use code like "range(len(self.ports_info))" to loop on all port= s. >=20 > > + print port_id >=20 > Need remove this debug code. >=20 > > + self.destroy_sriov_vfs_by_port(port_id) > > + # know issue: nic up > I can't understand this comment, please add more description. >=20 > > + intf =3D self.ports_info[port_id]['intf'] > > + self.send_expect("ethtool -s %s autoneg on" % intf, "# ") > > + >=20 > Do not known why need to enable autoneg on PF device. [lijuan] I will remove this ,it's not related with the function, though it'= s know issue, refer to DPDK-1754 >=20 > > def get_vm_core_list(self): > > return VMCORELIST[self.crb['VM CoreList']] > > > > @@ -966,6 +979,17 @@ class Dut(Crb): > > if self.host_init_flag: > > self.host_session.close() > > > > + def virt_exit(self): > > + """ > > + Stop all unstopped hypervisors process > > + """ > > + # try to kill all hypervisor process > > + for pid in self.virt_pids: > > + print "kill %d" % pid >=20 > Please remove debug code here. >=20 > > + self.send_expect("kill -s SIGTERM %d" % pid, "# ", > alt_session=3DTrue) > > + time.sleep(3) > > + self.virt_pids =3D [] > > + > > def crb_exit(self): > > """ > > Recover all resource before crb exit diff --git > > a/framework/qemu_kvm.py b/framework/qemu_kvm.py index e9d29cc..79e8417 > > 100644 > > --- a/framework/qemu_kvm.py > > +++ b/framework/qemu_kvm.py > > @@ -105,6 +105,7 @@ class QEMUKvm(VirtBase): > > def set_vm_default(self): > > self.set_vm_name(self.vm_name) > > self.set_vm_enable_kvm() > > + self.set_vm_pid_file() > > self.set_vm_qga() > > self.set_vm_daemon() > > self.set_vm_monitor() > > @@ -244,6 +245,25 @@ class QEMUKvm(VirtBase): > > enable_kvm_boot_line =3D '-enable-kvm' > > self.__add_boot_line(enable_kvm_boot_line) > > > > + def set_vm_pid_file(self): > > + """ > > + Set VM pidfile option for manage qemu process > > + """ > > + self.__pid_file =3D '/tmp/.%s.pid' % self.vm_name > > + index =3D self.find_option_index('pid_file') > > + if index: > > + self.params[index] =3D {'pid_file': [{'name': '%s' % > self.__pid_file}]} > > + else: > > + self.params.append({'pid_file': [{'name': '%s' % > > + self.__pid_file}]}) > > + > > + def add_vm_pid_file(self, **options): > > + """ > > + 'name' : '/tmp/.qemu_vm0.pid' > > + """ > > + if 'name' in options.keys(): > > + self.__add_boot_line('-pidfile %s' % options['name']) > > + > > + > > def set_vm_name(self, vm_name): > > """ > > Set VM name. > > @@ -1155,6 +1175,16 @@ class QEMUKvm(VirtBase): > > else: > > self.vm_status =3D ST_UNKNOWN > > > > + info =3D self.host_session.send_expect('cat %s' % self.__pid_= file, > "# ") > > + try: > > + pid =3D int(info) > > + # save pid into dut structure > > + self.host_dut.virt_pids.append(pid) > > + except: > > + self.host_logger.info("Failed to capture pid!!!") > > + > > + > > + > > def __strip_guest_pci(self): > > """ > > Strip all pci-passthrough device information, based on qemu > > monitor diff -- git a/framework/test_case.py b/framework/test_case.py > > index > > 85fdb70..270f7b9 100644 > > --- a/framework/test_case.py > > +++ b/framework/test_case.py > > @@ -335,6 +335,12 @@ class TestCase(object): > > dutobj.kill_all() > > self.tester.kill_all() > > > > + for dutobj in self.duts: > > + dutobj.virt_exit() > > + # destroy all vfs > > + dutobj.destroy_all_sriov_vfs() > > + > > + > > def wirespeed(self, nic, frame_size, num_ports): > > """ > > Calculate bit rate. It is depended for NICs > > -- > > 1.9.3