From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7E3E8A0471 for ; Tue, 13 Aug 2019 08:39:09 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 746B81B94A; Tue, 13 Aug 2019 08:39:09 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id AEA985681 for ; Tue, 13 Aug 2019 08:39:07 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Aug 2019 23:39:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,380,1559545200"; d="scan'208";a="375500919" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga005.fm.intel.com with ESMTP; 12 Aug 2019 23:39:06 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 12 Aug 2019 23:39:06 -0700 Received: from shsmsx153.ccr.corp.intel.com (10.239.6.53) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 12 Aug 2019 23:39:06 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.112]) by SHSMSX153.ccr.corp.intel.com ([169.254.12.215]) with mapi id 14.03.0439.000; Tue, 13 Aug 2019 14:39:03 +0800 From: "Wang, Yinan" To: "Ma, LihongX" , "dts@dpdk.org" CC: "Ma, LihongX" Thread-Topic: [dts] [PATCH V1] tests/vhost_multi_queue_qemu: optimization code Thread-Index: AQHVUZt3gQ/70w/JiESzsW7iikhbRKb4oDJw Date: Tue, 13 Aug 2019 06:39:03 +0000 Message-ID: References: <1565649001-30160-1-git-send-email-lihongx.ma@intel.com> In-Reply-To: <1565649001-30160-1-git-send-email-lihongx.ma@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDdhNWYxMWEtZjRiNi00NGE5LWJmZWMtZjNhODNjMjBjOWI3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiVVJ5a05HRmRxWFlObU5BQm9rT1hQdU4zUWEweWlncDUwdWhualNlZm9lQUpBWXZURng4K3VZSXhQb0tYZkRsVCJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V1] tests/vhost_multi_queue_qemu: optimization code 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: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Acked-by: Wang, Yinan > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of lihong > Sent: 2019=1B$BG/=1B(B8=1B$B7n=1B(B13=1B$BF|=1B(B 6:30 > To: dts@dpdk.org > Cc: Ma, LihongX > Subject: [dts] [PATCH V1] tests/vhost_multi_queue_qemu: optimization code >=20 > 1. update code to support trex > 2. check link status after port restart > 3. modify the class Name >=20 > Signed-off-by: lihong > --- > tests/TestSuite_vhost_multi_queue_qemu.py | 50 > ++++++++++++++++++------------- > 1 file changed, 29 insertions(+), 21 deletions(-) >=20 > diff --git a/tests/TestSuite_vhost_multi_queue_qemu.py > b/tests/TestSuite_vhost_multi_queue_qemu.py > index 1232cf3..9d839d5 100644 > --- a/tests/TestSuite_vhost_multi_queue_qemu.py > +++ b/tests/TestSuite_vhost_multi_queue_qemu.py > @@ -41,9 +41,11 @@ from test_case import TestCase from settings import > HEADER_SIZE from virt_common import VM from packet import Packet, > send_packets, save_packets > +from pmd_output import PmdOutput > +from pktgen import PacketGeneratorHelper >=20 >=20 > -class TestVhostUserOneCopyOneVm(TestCase): > +class TestVhostMultiQueueQemu(TestCase): >=20 > def set_up_all(self): > # Get and verify the ports > @@ -69,6 +71,14 @@ class TestVhostUserOneCopyOneVm(TestCase): > self.number_of_ports =3D 1 > self.header_row =3D ["FrameSize(B)", "Throughput(Mpps)", > "LineRate(%)", "Cycle"] > self.memory_channel =3D self.dut.get_memory_channels() > + self.pmd_out =3D PmdOutput(self.dut) > + > + self.out_path =3D '/tmp' > + out =3D self.tester.send_expect('ls -d %s' % self.out_path, '# '= ) > + if 'No such file or directory' in out: > + self.tester.send_expect('mkdir -p %s' % self.out_path, '# ') > + # create an instance to set stream field setting > + self.pktgen_helper =3D PacketGeneratorHelper() >=20 > def set_up(self): > """ > @@ -76,7 +86,7 @@ class TestVhostUserOneCopyOneVm(TestCase): > """ > 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 testpmd", "#") >=20 > self.frame_sizes =3D [64, 128, 256, 512, 1024, 1500] > self.vm_testpmd_vector =3D self.target + "/app/testpmd -c %s -n = 3" + \ > @@ -135,33 +145,25 @@ class TestVhostUserOneCopyOneVm(TestCase): > for frame_size in self.frame_sizes: > info =3D "Running test %s, and %d frame size." % (self.runni= ng_case, > frame_size) > self.logger.info(info) > - payload_size =3D frame_size - HEADER_SIZE['eth'] - HEADER_SI= ZE['ip'] > - HEADER_SIZE['udp'] > + payload_size =3D frame_size - HEADER_SIZE['eth'] - > + HEADER_SIZE['ip'] > tgenInput =3D [] >=20 > pkt1 =3D Packet() > - pkt1.assign_layers(['ether', 'ipv4', 'udp', 'raw']) > + pkt1.assign_layers(['ether', 'ipv4', 'raw']) > pkt1.config_layers([('ether', {'dst': '%s' % self.virtio1_ma= c}), ('ipv4', > {'dst': '1.1.1.1'}), > - ('udp', {'src': 4789, 'dst': 4789}), ('ra= w', > {'payload': ['01'] * int('%d' % payload_size)})]) > - pkt2 =3D Packet() > - pkt2.assign_layers(['ether', 'ipv4', 'udp', 'raw']) > - pkt2.config_layers([('ether', {'dst': '%s' % self.virtio1_ma= c}), ('ipv4', > {'dst': '1.1.1.20'}), > - ('udp', {'src': 4789, 'dst': 4789}), ('raw= ', > {'payload': ['01'] * int('%d' % payload_size)})]) > - pkt3 =3D Packet() > - pkt3.assign_layers(['ether', 'ipv4', 'udp', 'raw']) > - pkt3.config_layers([('ether', {'dst': '%s' % self.virtio1_ma= c}), ('ipv4', > {'dst': '1.1.1.7'}), > - ('udp', {'src': 4789, 'dst': 4789}), ('ra= w', > {'payload': ['01'] * int('%d' % payload_size)})]) > - pkt4 =3D Packet() > - pkt4.assign_layers(['ether', 'ipv4', 'udp', 'raw']) > - pkt4.config_layers([('ether', {'dst': '%s' % self.virtio1_ma= c}), ('ipv4', > {'dst': '1.1.1.8'}), > - ('udp', {'src': 4789, 'dst': 4789}), ('ra= w', > {'payload': ['01'] * int('%d' % payload_size)})]) > + ('raw', {'payload': ['01'] * int('%d' % > + payload_size)})]) >=20 > - pkt =3D [pkt1, pkt2, pkt3, pkt4] > - save_packets(pkt, "/root/multiqueue_2.pcap") > + pkt =3D [pkt1] > + save_packets(pkt, "%s/multiqueue.pcap" % self.out_path) >=20 > port =3D self.tester.get_local_port(self.pf) > - tgenInput.append((port, port, "multiqueue_2.pcap")) > + tgenInput.append((port, port, "%s/multiqueue.pcap" % > + self.out_path)) >=20 > - _, pps =3D self.tester.traffic_generator_throughput(tgenInpu= t, > delay=3D30) > + fields_config =3D {'ip': {'dst': {'action': 'random'}, }, } > + self.tester.pktgen.clear_streams() > + streams =3D > self.pktgen_helper.prepare_stream_from_tginput(tgenInput, 100, fields_con= fig, > self.tester.pktgen) > + traffic_opt =3D {'delay': 5} > + _, pps =3D > + self.tester.pktgen.measure_throughput(stream_ids=3Dstreams, > + options=3Dtraffic_opt) > Mpps =3D pps / 1000000.0 > pct =3D Mpps * 100 / float(self.wirespeed(self.nic, frame_si= ze, > self.number_of_ports)) @@ -263,6 > +265,9 @@ class TestVhostUserOneCopyOneVm(TestCase): >=20 > self.dut.send_expect("stop", "testpmd> ", 120) > self.dut.send_expect("start", "testpmd> ", 120) > + res =3D self.pmd_out.wait_link_status_up('all', timeout =3D 15) > + self.verify(res is True, 'There has port link is down') > + >=20 > self.dut.send_expect("clear port stats all", "testpmd> ", 120) > self.send_and_verify("vhost queue =3D virtio queue") @@ -301,6 += 306,8 > @@ class TestVhostUserOneCopyOneVm(TestCase): > self.dut.send_expect("port start all", "testpmd>", 20) > self.dut.send_expect("start", "testpmd>") > self.dut.send_expect("clear port stats all", "testpmd>") > + res =3D self.pmd_out.wait_link_status_up('all', timeout =3D 15) > + self.verify(res is True, 'There has port link is down') >=20 > self.send_and_verify("vhost queue =3D virtio queue") >=20 > @@ -313,6 +320,7 @@ class TestVhostUserOneCopyOneVm(TestCase): > Clear vhost-switch and qemu to avoid blocking the following TCs > """ > self.vm.stop() > + self.dut.kill_all() > time.sleep(2) >=20 > def tear_down_all(self): > -- > 2.7.4