From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id D6414FBBC for ; Wed, 21 Dec 2016 07:07:08 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP; 20 Dec 2016 22:07:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,382,1477983600"; d="scan'208";a="1102337395" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga002.fm.intel.com with ESMTP; 20 Dec 2016 22:07:07 -0800 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 20 Dec 2016 22:07:07 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 20 Dec 2016 22:07:06 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.77]) with mapi id 14.03.0248.002; Wed, 21 Dec 2016 14:07:02 +0800 From: "Yao, Lei A" To: "Liu, Yong" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH V1] test: add vhost/virtio pvp performance test based on qemu Thread-Index: AQHSWy+B5h2SuIqBxU2H745owzcdsqER5s3g Date: Wed, 21 Dec 2016 06:07:03 +0000 Message-ID: <2DBBFF226F7CF64BAFCA79B681719D953A141EA6@shsmsx102.ccr.corp.intel.com> References: <1482214062-7757-1-git-send-email-lei.a.yao@intel.com> <86228AFD5BCD8E4EBFD2B90117B5E81E62D27CC7@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <86228AFD5BCD8E4EBFD2B90117B5E81E62D27CC7@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] test: add vhost/virtio pvp performance test based on qemu 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: Wed, 21 Dec 2016 06:07:09 -0000 Thanks. Some update in the comment. BRs Lei > -----Original Message----- > From: Liu, Yong > Sent: Wednesday, December 21, 2016 10:11 AM > To: Yao, Lei A ; dts@dpdk.org > Cc: Yao, Lei A > Subject: RE: [dts] [PATCH V1] test: add vhost/virtio pvp performance test > based on qemu >=20 > Thanks Lei, some comments below. >=20 > > -----Original Message----- > > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of lei,yao > > Sent: Tuesday, December 20, 2016 2:08 PM > > To: dts@dpdk.org > > Cc: Yao, Lei A > > Subject: [dts] [PATCH V1] test: add vhost/virtio pvp performance test > > based on qemu > > > > From: lei yao > > > > The test case include 3 part: > > 1. virtio 0.95 performance test > > virtio0.95 is the default version for qemu. Vector, normal, mergeable p= ath > > will be tested on this version > > 2. Test vector performance on differnt qemu version. For exapmle: > qemu2.5, > > qemu2.6, qemu2.7 > > 3. Test vector performance on virtio 1.0. > > > > Signed-off-by: lei yao > > --- > > tests/TestSuite_vhost_qemu_pvp_performance.py | 471 > > ++++++++++++++++++++++++++ > > 1 file changed, 471 insertions(+) > > create mode 100644 tests/TestSuite_vhost_qemu_pvp_performance.py > > > > diff --git a/tests/TestSuite_vhost_qemu_pvp_performance.py > > b/tests/TestSuite_vhost_qemu_pvp_performance.py > > new file mode 100644 > > index 0000000..ced777f > > --- /dev/null > > +++ b/tests/TestSuite_vhost_qemu_pvp_performance.py > > @@ -0,0 +1,471 @@ > > +# BSD LICENSE > > +# > > +# Copyright(c) 2010-2015 Intel Corporation. All rights reserved. > > +# All rights reserved. > > +# > > +# Redistribution and use in source and binary forms, with or without > > +# modification, are permitted provided that the following conditions > > +# are met: > > +# > > +# * Redistributions of source code must retain the above copyright > > +# notice, this list of conditions and the following disclaimer. > > +# * Redistributions in binary form must reproduce the above copyrigh= t > > +# notice, this list of conditions and the following disclaimer in > > +# the documentation and/or other materials provided with the > > +# distribution. > > +# * Neither the name of Intel Corporation nor the names of its > > +# contributors may be used to endorse or promote products derived > > +# from this software without specific prior written permission. > > +# > > +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND > CONTRIBUTORS > > +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT > NOT > > +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND > FITNESS FOR > > +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE > COPYRIGHT > > +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, > INCIDENTAL, > > +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT > NOT > > +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS > OF USE, > > +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED > AND ON ANY > > +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR > TORT > > +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT > OF THE USE > > +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH > DAMAGE. > > + > > +""" > > +DPDK Test suite. > > + > > +Vhost PVP performance using Qemu test suite. > > +""" > > +import os > > +import dts >=20 > Please remove dependency on dts module, we tried to make test suite more > independent. >=20 I will remove this > > +import string > > +import re > > +import time > > +import utils > > +from scapy.utils import wrpcap, rdpcap > > +from test_case import TestCase > > +from exception import VerifyFailure > > +from settings import HEADER_SIZE > > +from etgen import IxiaPacketGenerator > > +from qemu_kvm import QEMUKvm > > + > > + > > +class TestVhostUserOneCopyOneVm(TestCase, IxiaPacketGenerator): > > + > If you do not want to modify internal function of IxiaPacketGenerator, > there's no need to inherit this module. >=20 Removed > > + def set_up_all(self): > > + # To Extend IXIA packet generator method, call the tester's > > method. > > + > > > self.tester.extend_external_packet_generator(TestVhostUserOneCopyOne > Vm, > > self) >=20 > Same comment as previous. Removed > > + > > + > > + # Get and verify the ports > > + self.dut_ports =3D self.dut.get_ports() > > + self.verify(len(self.dut_ports) >=3D 1, "Insufficient ports fo= r > > testing") > > + > > + # Get the port's socket > > + self.pf =3D self.dut_ports[0] > > + netdev =3D self.dut.ports_info[self.pf]['port'] > > + self.socket =3D netdev.get_nic_socket() > > + self.cores =3D self.dut.get_core_list("1S/3C/1T", > > socket=3Dself.socket) > > + > > + # Set the params of vhost sample > > + self.vhost_app =3D "./examples/vhost/build/vhost-switch" > > + self.vm2vm =3D 0 > > + # This parameter is used to define mergeable on/off > > + self.jumbo =3D 0 > > + > > + # Using file to save the vhost sample output since in jumbofra= me > > case, > > + # there will be lots of output > > + self.vhost_test =3D self.vhost_app + \ > > + " -c %s -n %d --socket-mem 2048,2048 -- -p 0x1 -- > > mergeable %d" + \ > > + " --vm2vm %d --socket-file ./vhost-net > ./vhost.out &" >=20 > I'm not sure whether each platform can support two sockets. If there's no > special requirement, please just remove socket-mem option. >=20 For this PVP test, don't use socket-mem will bring performance instability = for the result.=20 Because this is performance test, I can't change it to general " -m " , I n= eed achieve best and stable performance data.=20 > > + # build the vhost sample in vhost-user mode. > > + if self.nic in ['niantic']: > > + self.dut.send_expect( > > + "sed -i -e 's/#define MAX_QUEUES.*$/#define MAX_QUEUES > > 128/' " > > + "./examples/vhost/main.c", > > + "#", 10) > > + else: > > + self.dut.send_expect( > > + "sed -i -e 's/#define MAX_QUEUES.*$/#define MAX_QUEUES > > 512/' " > > + "./examples/vhost/main.c", > > + "#", 10) >=20 > Queue numbers are different between different kinds of NICS. If not sure > with the number, please left it as default. > I guess the logic should be like below: >=20 > if self.nic in ['niantic']: > ... > else if self.nic.startwith('fortville') > ... >=20 Changed as your suggestion. >=20 > > + out =3D self.dut.send_expect("make -C examples/vhost", "#") > > + self.verify("Error" not in out, "compilation error") > > + self.verify("No such file" not in out, "Not found file error") > > + > > + self.virtio1 =3D "eth1" > > + self.virtio1_mac =3D "52:54:00:00:00:01" > > + self.src1 =3D "192.168.4.1" > > + self.dst1 =3D "192.168.3.1" > > + self.vm_dut =3D None > > + > > + self.number_of_ports =3D 1 > > + self.header_row =3D ["FrameSize(B)", "Throughput(Mpps)", > > "LineRate(%)","Cycle"] > > + self.memory_channel =3D 4 > > + # Specify the path of Qemu binary for different Qemu versions, user > > can modify this as necessary > > + self.qemu_path=3D["/home/lei/qemu_install/qemu_2.5/bin/qemu- > system- > > x86_64",\ > > + "/home/lei/qemu_install/qemu_2.6/bin/qemu-system- > > x86_64",\ > > + "/home/lei/qemu_install/qemu_2.7/bin/qemu-system- > > x86_64"] > > + > It's not good to add your local path into the code. You can use configura= tion > file to work around it. > Also has question about why we need to check different versions of qemu. > It's one time task or every time we need to do that. > If just for one time, you can change configuration for qemu path and reru= n > those cases. >=20 Yes, the qemu version performance test is not required for regression test,= only tested for release cycle. I will remove this test and let user just change the qemu pa= th=20 in config file.=20 > > + > > + def set_up(self): > > + # > > + # Run before each test case. > > + # > > + # Launch vhost sample using default params > > + # > > + self.dut.send_expect("rm -rf ./vhost.out", "#") > > + self.dut.send_expect("rm -rf ./vhost-net*", "#") > > + self.dut.send_expect("killall -s INT vhost-switch", "#") > > + self.dut.send_expect("killall -s INT qemu-system-x86_64", "#") > > + > Please make sure code aligned, you can use pep8 check to help on that. >=20 > > + self.frame_sizes =3D [64, 128, 256, 512, 1024, 1500] > > + self.vm_testpmd_vector =3D "./x86_64-native-linuxapp- > > gcc/app/testpmd -c 0x3 -n 3" \ > > + + " -- -i --txqflags=3D0xf01 --disable-hw-vlan-filter" > > + self.vm_testpmd_normal =3D "./x86_64-native-linuxapp- > > gcc/app/testpmd -c 0x3 -n 3" \ > > + + " -- -i --txqflags=3D0xf00 --disable-hw-vlan-filter" > > + self.dut.send_expect("rm -rf ./vhost.out", "#") > > + > > + > > + def launch_vhost_sample(self): > > + # > > + # Launch the vhost sample with different parameters > > + # > > + self.coremask =3D utils.create_mask(self.cores) > > + self.vhostapp_testcmd =3D self.vhost_test % ( > > + self.coremask, self.memory_channel, self.jumbo, self.vm2vm= ) > > + self.dut.send_expect(self.vhostapp_testcmd, "# ", 40) > > + time.sleep(30) > > + try: > > + print "Launch vhost sample:" > It's better to replace print with self.logger.info function. >=20 Changed. > > + self.dut.session.copy_file_from("/root/dpdk/vhost.out") >=20 > Dpdk folder may be changed by command line, you can use self.dut.base_dir > + "vhost.out". >=20 Changed. > > + fp =3D open('./vhost.out', 'r') > > + out =3D fp.read() > > + fp.close() > > + if "Error" in out: > > + raise Exception("Launch vhost sample failed") > > + else: > > + print "Launch vhost sample finished" > > + except Exception as e: > > + print utils.RED("Failed to launch vhost sample: %s" % str(= e)) > > + > It's better to replace print with self.logger.error function. Changed=20 > > + > > + > > + def start_onevm(self, path=3D"", modem=3D0): > > + # > > + # Start One VM with one virtio device > > + # > > + > > + self.vm =3D QEMUKvm(self.dut, 'vm0', 'vhost_sample') > > + if(path!=3D""): > > + self.vm.set_qemu_emulator(path) > > + vm_params =3D {} > > + vm_params['driver'] =3D 'vhost-user' > > + vm_params['opt_path'] =3D './vhost-net' > > + vm_params['opt_mac'] =3D self.virtio1_mac > > + if(modem =3D=3D 1): > > + vm_params['opt_settings'] =3D 'disable-modern=3Dfalse' > > + self.vm.set_vm_device(**vm_params) > > + > > + try: > > + self.vm_dut =3D self.vm.start() > > + if self.vm_dut is None: > > + raise Exception("Set up VM ENV failed") > > + except Exception as e: > > + print utils.RED("Failure for %s" % str(e)) > > + > > + return True > > + > > + > > + > > + def vm_testpmd_start(self): > > + # > > + # Start testpmd in vm > > + # > > + if self.vm_dut is not None: > > + self.vm_dut.send_expect(self.vm_testpmd_vector, "testpmd>"= , > > 20) > > + self.vm_dut.send_expect("start tx_first", "testpmd>") > > + > > + def vm_tx_first_start(self): > > + if self.vm_dut is not None: > > + # Start tx_first > > + self.vm_dut.send_expect("start tx_first", "testpmd>") > > + > Look like this function is redundant, vm_testpmd_start has already start > traffic. >=20 Removed. >=20 > > + > > + def send_verify(self, case, frame_sizes, mac_address, vlan_id1=3D0= , > > tag=3D"Performance"): > > + self.result_table_create(self.header_row) > > + self.virtio_mac=3Dmac_address >=20 > This function is internal used, it's better not change class variable in = this local > function. > You can do that in upper layer. >=20 Changed. > > + for frame_size in frame_sizes: > > + info =3D "Running test %s, and %d frame size." % (case, > > frame_size) > > + self.logger.info(info) > > + payload =3D frame_size - HEADER_SIZE['eth'] - HEADER_SIZE[= 'ip'] > > + flow1 =3D > > '[Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IP(src=3D"%s",dst=3D"%s")/("X"*%d)= ]' % ( > > + self.virtio_mac, vlan_id1, self.src1, self.dst1, paylo= ad) > > + self.tester.scapy_append('wrpcap("flow1.pcap", %s)' % flow= 1) > > + self.tester.scapy_execute() > > + > > + tgenInput =3D [] > > + port =3D self.tester.get_local_port(self.pf) > > + tgenInput.append((port, port, "flow1.pcap")) > > + > > + _, pps =3D self.tester.traffic_generator_throughput(tgenIn= put, > > delay=3D30) > > + Mpps =3D pps / 1000000.0 > > + pct =3D Mpps * 100 / float(self.wirespeed(self.nic, frame= _size, > > + self.number_of_ports)) > > + data_row =3D [frame_size, str(Mpps), str(pct),tag] >=20 > Should add space after ',', please check with pep8 tool. >=20 > > + self.result_table_add(data_row) > > + self.result_table_print() > > + > Look like code is not aligned. >=20 > > + > > + def test_perf_qemu_vector_pmdfwd(self): > > + # > > + # Test the pvp performance for vector path > > + # > > + # start testpmd on VM > > + self.jumbo =3D 0 > > + self.launch_vhost_sample() > > + self.start_onevm() > > + if self.vm_dut is not None: >=20 > When self.vm_dut is None, should we take that as error? Yes. I will handle error handler. >=20 > > + # Start testpmd with user > > + self.vm_dut.send_expect(self.vm_testpmd_vector, "testpmd>"= , > > 20) > > + self.vm_dut.send_expect("start tx_first", "testpmd>") > > + > > + > > + time.sleep(5) > > + # Clean the output to ensure the commands cat ./vhost.out can = be > > sent > > + # and got answered correctly. > > + self.dut.get_session_output(timeout=3D2) > > + self.dut.session.copy_file_from("/root/dpdk/vhost.out") >=20 > Copy vhost.out and strip some information is used in several cases. It's = better > to abstract it to separated function and will make case code more clear. >=20 > > + fp =3D open('./vhost.out', 'r') > > + out =3D fp.read() > > + fp.close() > > + # Get the VLAN ID for virtio > > + print "Check the vlan info: " > > + l1 =3D re.findall( > > + 'MAC_ADDRESS.*?%s.*?and.*?VLAN_TAG.*?(\d+).*?registered' % > > + (str(self.virtio1_mac)), out) > > + if len(l1) > 0: > > + vlan_id1 =3D l1[0] > > + print vlan_id1 >=20 > Please remove debug code here. If you need some special output, please > use function like self.logger.info("Found vlan id %d for virtio device" % > vlan_id1). > > + else: > > + vlan_id1 =3D 1000 > Without vlan information, should we consider it as error? >=20 Actually, I want remove this vlan related code. Using vhost_sample, The vlanid is always 1000.=20 > > + self.send_verify(self.running_case, self.frame_sizes, > > self.virtio1_mac, vlan_id1 ,"Virtio 0.95 Vector Performance") > > + > > + > > + def test_perf_qemu_normal_pmdfwd(self): > > + # > > + # Test the performance for normal path > > + # > > + # start testpmd on VM > > + self.jumbo =3D 0 > > + self.launch_vhost_sample() > > + self.start_onevm() > > + if self.vm_dut is not None: > > + # Start testpmd with user > > + self.vm_dut.send_expect(self.vm_testpmd_normal, "testpmd>"= , > > 20) > > + self.vm_dut.send_expect("start tx_first", "testpmd>") > > + > > + time.sleep(5) > > + # Clean the output to ensure the commands cat ./vhost.out can = be > > sent > > + # and got answered correctly. > > + self.dut.get_session_output(timeout=3D2) > > + self.dut.session.copy_file_from("/root/dpdk/vhost.out") > > + fp =3D open('./vhost.out', 'r') > > + out =3D fp.read() > > + fp.close() > > + # Get the VLAN ID for virtio > > + print "Check the vlan info: " > > + l1 =3D re.findall( > > + 'MAC_ADDRESS.*?%s.*?and.*?VLAN_TAG.*?(\d+).*?registered' % > > + (str(self.virtio1_mac)), out) > > + if len(l1) > 0: > > + vlan_id1 =3D l1[0] > > + print vlan_id1 > > + else: > > + vlan_id1 =3D 1000 > > + self.send_verify(self.running_case, self.frame_sizes, > > self.virtio1_mac, vlan_id1, "Virtio 0.95 Normal Performance") > > + > > + > > + def test_perf_qemu_mergeable_pmdfwd(self): > > + # > > + # Test the performance for mergeable path > > + # > > + # start testpmd on VM > > + self.jumbo =3D 1 > > + self.launch_vhost_sample() > > + self.start_onevm() > > + if self.vm_dut is not None: > > + # Start testpmd with user > > + self.vm_dut.send_expect(self.vm_testpmd_vector, "testpmd>"= , > > 20) > > + self.vm_dut.send_expect("start tx_first", "testpmd>") > > + > > + time.sleep(5) > > + # Clean the output to ensure the commands cat ./vhost.out can = be > > sent > > + # and got answered correctly. > > + self.dut.get_session_output(timeout=3D2) > > + self.dut.session.copy_file_from("/root/dpdk/vhost.out") > > + fp =3D open('./vhost.out', 'r') > > + out =3D fp.read() > > + fp.close() > > + # Get the VLAN ID for virtio > > + print "Check the vlan info: " > > + l1 =3D re.findall( > > + 'MAC_ADDRESS.*?%s.*?and.*?VLAN_TAG.*?(\d+).*?registered' % > > + (str(self.virtio1_mac)), out) > > + if len(l1) > 0: > > + vlan_id1 =3D l1[0] > > + print vlan_id1 > > + else: > > + vlan_id1 =3D 1000 > > + self.send_verify(self.running_case, self.frame_sizes, > > self.virtio1_mac, vlan_id1 , "Virtio 0.95 Mergeable Performance") > > + > > + def test_perf_different_qemuversion_vector_pmdfwd(self): > > + # > > + # Test the performance for different qemu versions, for exampl= e: > > qemu2.5, > > + # qemu2.6, qemu2.7 > > + # > > + # start testpmd on VM > > + for path in self.qemu_path: > > + self.jumbo =3D 0 > > + self.launch_vhost_sample() > > + self.start_onevm(path) > > + if self.vm_dut is not None: > > + # Start testpmd in VM > > + self.vm_dut.send_expect(self.vm_testpmd_vector, > > "testpmd>", 20) > > + self.vm_dut.send_expect("start tx_first", "testpmd>") > > + time.sleep(5) > > + > > + self.dut.get_session_output(timeout=3D2) > > + self.dut.session.copy_file_from("/root/dpdk/vhost.out") > > + fp =3D open('./vhost.out', 'r') > > + out =3D fp.read() > > + fp.close() > > + # Get the VLAN ID for virtio > > + print "Check the vlan info: " > > + l1 =3D re.findall( > > + 'MAC_ADDRESS.*?%s.*?and.*?VLAN_TAG.*?(\d+).*?registere= d' % > > + (str(self.virtio1_mac)), out) > > + if len(l1) > 0: > > + vlan_id1 =3D l1[0] > > + print vlan_id1 > > + else: > > + vlan_id1 =3D 1000 > > + self.send_verify(self.running_case, self.frame_sizes, > > self.virtio1_mac, vlan_id1, path) > > + print "This is the vector result for qemu path %s" % path > > + self.dut.send_expect("rm -rf ./vhost.out", "#") > > + self.dut.send_expect("rm -rf ./vhost-net*", "#") > > + self.dut.send_expect("killall -s INT vhost-switch", "#") > > + self.dut.send_expect("killall -s INT qemu-system-x86_64", = "#") > > + > > + def test_perf_virtio_modern_qemu_vector_pmdfwd(self): > > + # > > + # Test the vhost/virtio pvp performance for virtio1.0 > > + # > > + # > > + # start testpmd on VM > > + self.jumbo =3D 0 > > + self.launch_vhost_sample() > > + self.start_onevm("",1) > > + if self.vm_dut is not None: > > + # Start testpmd with user > > + self.vm_dut.send_expect(self.vm_testpmd_vector, "testpmd>"= , > > 20) > > + self.vm_dut.send_expect("start tx_first", "testpmd>") > > + > > + time.sleep(5) > > + self.dut.get_session_output(timeout=3D2) > > + self.dut.session.copy_file_from("/root/dpdk/vhost.out") > > + fp =3D open('./vhost.out', 'r') > > + out =3D fp.read() > > + fp.close() > > + # Get the VLAN ID for virtio > > + print "Check the vlan info: " > > + l1 =3D re.findall( > > + 'MAC_ADDRESS.*?%s.*?and.*?VLAN_TAG.*?(\d+).*?registered' % > > + (str(self.virtio1_mac)), out) > > + if len(l1) > 0: > > + vlan_id1 =3D l1[0] > > + print vlan_id1 > > + else: > > + vlan_id1 =3D 1000 > > + self.send_verify(self.running_case, self.frame_sizes, > > self.virtio1_mac, vlan_id1, "virtio1.0, Vector") > > + > > + > > + def test_perf_virtio_modern_qemu_normal_pmdfwd(self): > > + # > > + # Test the performance of one vm with 2virtio devices in legac= y > > fwd > > + # > > + # start testpmd on VM > > + self.jumbo =3D 0 > > + self.launch_vhost_sample() > > + self.start_onevm("",1) > > + if self.vm_dut is not None: > > + # Start testpmd with user > > + self.vm_dut.send_expect(self.vm_testpmd_normal, "testpmd>"= , > > 20) > > + self.vm_dut.send_expect("start tx_first", "testpmd>") > > + > > + time.sleep(5) > > + self.dut.get_session_output(timeout=3D2) > > + self.dut.session.copy_file_from("/root/dpdk/vhost.out") > > + fp =3D open('./vhost.out', 'r') > > + out =3D fp.read() > > + fp.close() > > + # Get the VLAN ID for virtio > > + print "Check the vlan info: " > > + l1 =3D re.findall( > > + 'MAC_ADDRESS.*?%s.*?and.*?VLAN_TAG.*?(\d+).*?registered' % > > + (str(self.virtio1_mac)), out) > > + if len(l1) > 0: > > + vlan_id1 =3D l1[0] > > + print vlan_id1 > > + else: > > + vlan_id1 =3D 1000 > > + self.send_verify(self.running_case, self.frame_sizes, > > self.virtio1_mac, vlan_id1, "virtio1.0, Normal") > > + > > + > > + def test_perf_virtio_modern_qemu_mergeable_pmdfwd(self): > > + # > > + # Test the performance of one vm with 2virtio devices in legac= y > > fwd > > + # > > + # start testpmd on VM > > + self.jumbo =3D 1 > > + self.launch_vhost_sample() > > + self.start_onevm("",1) > > + if self.vm_dut is not None: > > + # Start testpmd with user > > + self.vm_dut.send_expect(self.vm_testpmd_vector, "testpmd>"= , > > 20) > > + self.vm_dut.send_expect("start tx_first", "testpmd>") > > + > > + time.sleep(5) > > + self.dut.get_session_output(timeout=3D2) > > + self.dut.session.copy_file_from("/root/dpdk/vhost.out") > > + fp =3D open('./vhost.out', 'r') > > + out =3D fp.read() > > + fp.close() > > + # Get the VLAN ID for virtio > > + print "Check the vlan info: " > > + l1 =3D re.findall( > > + 'MAC_ADDRESS.*?%s.*?and.*?VLAN_TAG.*?(\d+).*?registered' % > > + (str(self.virtio1_mac)), out) > > + if len(l1) > 0: > > + vlan_id1 =3D l1[0] > > + print vlan_id1 > > + else: > > + vlan_id1 =3D 1000 > > + self.send_verify(self.running_case, self.frame_sizes, > > self.virtio1_mac, vlan_id1, "virtio1.0, Mergeable") > > + > > + > > + > > + > > + >=20 > Too much blank line, it should be only one between each method in class. >=20 > > + def tear_down(self): > > + # > > + # Run after each test case. > > + # Clear vhost-switch and qemu to avoid blocking the following = TCs > > + # > > + self.dut.send_expect("killall -s INT vhost-switch", "#") > > + self.dut.send_expect("killall -s INT qemu-system-x86_64", "#") >=20 > Please use self.vm.stop to close virtual machine, there're some resources > need to cleaned up by stop function. >=20 Changed. > > + time.sleep(2) > > + > > + def tear_down_all(self): > > + """ > > + Run after each test suite. > > + """ > > + pass > > -- > > 2.7.4