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 3DDF0A0613 for ; Wed, 28 Aug 2019 07:30:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E86791C1EE; Wed, 28 Aug 2019 07:30:21 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 1BAB41C1ED for ; Wed, 28 Aug 2019 07:30:19 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Aug 2019 22:30:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,440,1559545200"; d="scan'208";a="355998402" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga005.jf.intel.com with ESMTP; 27 Aug 2019 22:30:18 -0700 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 27 Aug 2019 22:30:17 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 27 Aug 2019 22:30:17 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.80]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.112]) with mapi id 14.03.0439.000; Wed, 28 Aug 2019 13:30:15 +0800 From: "Tu, Lijuan" To: "Ma, LihongX" , "dts@dpdk.org" CC: "Ma, LihongX" Thread-Topic: [dts] [PATCH V1] tests/vhost_multi_queue_qemu: optimization code Thread-Index: AQHVUZt3UBTdTbmqD0m/rC62dFINRKcQIBbQ Date: Wed, 28 Aug 2019 05:30:15 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BB065F6@SHSMSX101.ccr.corp.intel.com> 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: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTVhZTc2ZjItMzM1YS00ZDlhLThmYTQtZTYzZGI1ZWRiYThkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoib0tPRWdXRmhpUGo4REU5UzVBaU95b3UwMHdTK0VFY3NVQ1lhTVFabzhKd3JYNzNoMFI4ejhIRXVmbXNCdDNBQyJ9 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] 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" Applied, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of lihong > Sent: Tuesday, August 13, 2019 6:30 AM > 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)", "LineRa= te(%)", > "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_config, 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 +2= 65,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