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 A2167A00E6 for ; Wed, 7 Aug 2019 05:43:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 95EAC4C8F; Wed, 7 Aug 2019 05:43:26 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id E88FE2E8F for ; Wed, 7 Aug 2019 05:43:24 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Aug 2019 20:43:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,356,1559545200"; d="scan'208";a="258230862" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga001.jf.intel.com with ESMTP; 06 Aug 2019 20:43:23 -0700 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 6 Aug 2019 20:43:23 -0700 Received: from shsmsx153.ccr.corp.intel.com (10.239.6.53) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 6 Aug 2019 20:43:23 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.80]) by SHSMSX153.ccr.corp.intel.com ([169.254.12.215]) with mapi id 14.03.0439.000; Wed, 7 Aug 2019 11:43:21 +0800 From: "Tu, Lijuan" To: "Ma, LihongX" , "dts@dpdk.org" CC: "Ma, LihongX" Thread-Topic: [dts] [PATCH V1] tests/vm2vm_virtio_pmd: update testcase according to plan Thread-Index: AQHVO6HY141GOL7we0myF5gD2ZBjQqbvLTcA Date: Wed, 7 Aug 2019 03:43:20 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BAFECBF@SHSMSX101.ccr.corp.intel.com> References: <1563232866-19164-1-git-send-email-lihongx.ma@intel.com> In-Reply-To: <1563232866-19164-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTRkYTllZWYtZGYyNC00Njg2LTgxNDgtYjQwMTk5OGU4OTgyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiS1wvZEJ4QURwRE5PczJ3Y3hqczhFaVlPM05qQXhIU0FcLzVXeHljQ2RVbllTNTc2OXdTWVA2RXA4R2VDSHF6WU4zIn0= 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/vm2vm_virtio_pmd: update testcase according to plan 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, July 16, 2019 7:21 AM > To: dts@dpdk.org > Cc: Ma, LihongX > Subject: [dts] [PATCH V1] tests/vm2vm_virtio_pmd: update testcase > according to plan >=20 > Signed-off-by: lihong > --- > tests/TestSuite_vm2vm_virtio_pmd.py | 153 > ++++++++++++++++++++++++++++++------ > 1 file changed, 128 insertions(+), 25 deletions(-) >=20 > diff --git a/tests/TestSuite_vm2vm_virtio_pmd.py > b/tests/TestSuite_vm2vm_virtio_pmd.py > index 9a62ac8..ca97d4d 100644 > --- a/tests/TestSuite_vm2vm_virtio_pmd.py > +++ b/tests/TestSuite_vm2vm_virtio_pmd.py > @@ -33,12 +33,16 @@ > DPDK Test suite. >=20 > Test cases for Vhost-user/Virtio-pmd VM2VM > +Test cases for vhost/virtio-pmd(0.95/1.0) VM2VM test with 3 rx/tx > +paths, includes mergeable, normal, vector_rx. > +About mergeable path check the large packet payload. > """ > import re > import time > import utils > from virt_common import VM > from test_case import TestCase > +from packet import load_pcapfile >=20 >=20 > class TestVM2VMVirtioPMD(TestCase): > @@ -53,13 +57,14 @@ class TestVM2VMVirtioPMD(TestCase): > self.coremask =3D utils.create_mask(self.cores) > self.memory_channel =3D self.dut.get_memory_channels() > self.vm_num =3D 2 > + self.dump_pcap =3D "/root/pdump-rx.pcap" >=20 > def set_up(self): > """ > run before each test case. > """ > self.table_header =3D ["FrameSize(B)", "Mode", > - "Throughput(Mpps)", "Path"] > + "Throughput(Mpps)", "Queue Number", "Path"] > self.result_table_create(self.table_header) > self.dut.send_expect("killall -s INT testpmd", "#") > self.dut.send_expect("killall -s INT qemu-system-x86_64", "#") @= @ - > 68,6 +73,20 @@ class TestVM2VMVirtioPMD(TestCase): > self.vm_dut =3D [] > self.vm =3D [] >=20 > + def enable_pcap_lib_in_dpdk(self, client_dut): > + """ > + enable pcap lib in dpdk code and recompile > + """ > + client_dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_PCAP=3Dn$/CONFIG_RTE_LIBRTE_PMD_PCAP=3Dy/' > config/common_base", "#") > + client_dut.build_install_dpdk(self.target) > + > + def disable_pcap_lib_in_dpdk(self, client_dut): > + """ > + reset pcap lib in dpdk and recompile > + """ > + client_dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_PCAP=3Dy$/CONFIG_RTE_LIBRTE_PMD_PCAP=3Dn/' > config/common_base", "#") > + client_dut.build_install_dpdk(self.target) > + > def start_vhost_testpmd(self): > """ > launch the testpmd on vhost side @@ -84,22 +103,32 @@ class > TestVM2VMVirtioPMD(TestCase): > self.vhost.send_expect("set fwd mac", "testpmd> ", 30) > self.vhost.send_expect("start", "testpmd> ", 30) >=20 > - def start_vm_testpmd(self, vm_client, path_mode): > + def start_vm_testpmd(self, vm_client, path_mode, extern_param=3D""): > """ > launch the testpmd in vm > """ > if path_mode =3D=3D "mergeable": > - command =3D self.dut.target + "/app/testpmd " + \ > - "-c 0x3 -n 4 -- -i --tx-offloads=3D0x00 " + \ > - "--enable-hw-vlan-strip --txd=3D1024 --rxd=3D102= 4" > + command =3D self.dut.target + "/app/testpmd -c 0x3 -n 4 " + = \ > + "--file-prefix=3Dvirtio -- -i --tx-offloads=3D0x= 00 " + \ > + "--enable-hw-vlan-strip --txd=3D1024 --rxd=3D102= 4 %s" > elif path_mode =3D=3D "normal": > - command =3D self.dut.target + "/app/testpmd " + \ > - "-c 0x3 -n 4 -- -i --tx-offloads=3D0x00 " + \ > - "--enable-hw-vlan-strip --txd=3D1024 --rxd=3D102= 4" > + command =3D self.dut.target + "/app/testpmd -c 0x3 -n 4 " + = \ > + "--file-prefix=3Dvirtio -- -i --tx-offloads=3D0x= 00 " + \ > + "--enable-hw-vlan-strip --txd=3D1024 --rxd=3D102= 4 %s" > elif path_mode =3D=3D "vector_rx": > - command =3D self.dut.target + "/app/testpmd " + \ > - "-c 0x3 -n 4 -- -i --txd=3D1024 --rxd=3D1024" > - vm_client.send_expect(command, "testpmd> ", 20) > + command =3D self.dut.target + "/app/testpmd -c 0x3 -n 4 " + = \ > + "--file-prefix=3Dvirtio -- -i --txd=3D1024 --rxd= =3D1024 %s" > + vm_client.send_expect(command % extern_param, "testpmd> ", 20) > + > + def launch_pdump_in_vm(self, vm_client): > + """ > + bootup pdump in VM > + """ > + self.vm_dump =3D vm_client.new_session(suite=3D"pdump") > + command_line =3D self.target + "/app/dpdk-pdump " + \ > + "-v --file-prefix=3Dvirtio -- " + \ > + "--pdump 'port=3D0,queue=3D*,rx-dev=3D%s,mbuf-size= =3D8000'" > + self.vm_dump.send_expect(command_line % self.dump_pcap, 'Port') >=20 > def start_vms(self, mode=3D0, mergeable=3DTrue): > """ > @@ -153,6 +182,7 @@ class TestVM2VMVirtioPMD(TestCase): > results_row =3D [frame_size] > results_row.append(case_info) > results_row.append(Mpps) > + results_row.append(1) > results_row.append(path) > self.result_table_add(results_row) >=20 > @@ -170,34 +200,51 @@ class TestVM2VMVirtioPMD(TestCase): > self.update_table_info(mode, 64, Mpps, path) > self.result_table_print() >=20 > + def check_packet_payload_valid(self, vm_dut): > + """ > + check the payload is valid > + """ > + # stop pdump > + self.vm_dump.send_expect('^c', '# ', 60) > + # quit testpmd > + vm_dut.send_expect('quit', '#', 60) > + time.sleep(2) > + vm_dut.session.copy_file_from(src=3D"%s" % self.dump_pcap, dst= =3D"%s" % > self.dump_pcap) > + pkts =3D load_pcapfile(self.dump_pcap) > + self.verify(len(pkts) =3D=3D 10, "The vm0 do not capture all the= packets") > + data =3D str(pkts[0].pktgen.pkt['Raw']) > + for i in range(1, 10): > + value =3D str(pkts[i].pktgen.pkt['Raw']) > + self.verify(data =3D=3D value, "the payload in receive packe= ts > + has been changed") > + > def stop_all_apps(self): > for i in range(len(self.vm)): > self.vm_dut[i].send_expect("quit", "#", 20) > self.vm[i].stop() > self.vhost.send_expect("quit", "#", 30) >=20 > - def test_vhost_vm2vm_virito_pmd_with_mergeable_path(self): > + def test_vhost_vm2vm_virtio_pmd_with_normal_path(self): > """ > - vhost-user + virtio-pmd with mergeable path > + vhost-user + virtio-pmd with normal path > """ > - path_mode =3D "mergeable" > + path_mode =3D "normal" > self.start_vhost_testpmd() > - self.start_vms(mode=3D0, mergeable=3DTrue) > + self.start_vms(mode=3D0, mergeable=3DFalse) > self.start_vm_testpmd(self.vm_dut[0], path_mode) > self.start_vm_testpmd(self.vm_dut[1], path_mode) > - self.send_and_verify(mode=3D"virtio 0.95", path=3Dpath_mode) > + self.send_and_verify(mode=3D"virtio 0.95 normal path", > + path=3Dpath_mode) > self.stop_all_apps() >=20 > - def test_vhost_vm2vm_virtio_pmd_with_normal_path(self): > + def test_vhost_vm2vm_virito_10_pmd_with_normal_path(self): > """ > - vhost-user + virtio-pmd with normal path > + vhost-user + virtio1.0-pmd with normal path > """ > path_mode =3D "normal" > self.start_vhost_testpmd() > - self.start_vms(mode=3D0, mergeable=3DFalse) > + self.start_vms(mode=3D1, mergeable=3DFalse) > self.start_vm_testpmd(self.vm_dut[0], path_mode) > self.start_vm_testpmd(self.vm_dut[1], path_mode) > - self.send_and_verify(mode=3D"virtio 0.95", path=3Dpath_mode) > + self.send_and_verify(mode=3D"virtio 1.0 normal path", > + path=3Dpath_mode) > self.stop_all_apps() >=20 > def test_vhost_vm2vm_virtio_pmd_with_vector_rx_path(self): > @@ -209,19 +256,75 @@ class TestVM2VMVirtioPMD(TestCase): > self.start_vms(mode=3D0, mergeable=3DFalse) > self.start_vm_testpmd(self.vm_dut[0], path_mode) > self.start_vm_testpmd(self.vm_dut[1], path_mode) > - self.send_and_verify(mode=3D"virtio 0.95", path=3Dpath_mode) > + self.send_and_verify(mode=3D"virtio 0.95 vector_rx", path=3Dpath= _mode) > + self.stop_all_apps() > + > + def test_vhost_vm2vm_virtioi10_pmd_with_vector_rx_path(self): > + """ > + vhost-user + virtio1.0-pmd with vector_rx path > + """ > + path_mode =3D "vector_rx" > + self.start_vhost_testpmd() > + self.start_vms(mode=3D1, mergeable=3DFalse) > + self.start_vm_testpmd(self.vm_dut[0], path_mode) > + self.start_vm_testpmd(self.vm_dut[1], path_mode) > + self.send_and_verify(mode=3D"virtio 1.0 vector_rx", path=3Dpath_= mode) > + self.stop_all_apps() > + > + def test_vhost_vm2vm_virito_pmd_with_mergeable_path(self): > + """ > + vhost-user + virtio-pmd with mergeable path test with payload ch= eck > + """ > + path_mode =3D "mergeable" > + extern_param =3D '--max-pkt-len=3D9600' > + self.start_vhost_testpmd() > + self.start_vms(mode=3D0, mergeable=3DTrue) > + # enable pcap in VM0 > + self.enable_pcap_lib_in_dpdk(self.vm_dut[0]) > + # git the vm enough huge to run pdump > + self.vm_dut[0].set_huge_pages(2048) > + # start testpmd and pdump in VM0 > + self.start_vm_testpmd(self.vm_dut[0], path_mode, extern_param) > + self.vm_dut[0].send_expect('set fwd rxonly', 'testpmd> ', 30) > + self.vm_dut[0].send_expect('start', 'testpmd> ', 30) > + self.launch_pdump_in_vm(self.vm_dut[0]) > + # start testpmd in VM1 and start to send packet > + self.start_vm_testpmd(self.vm_dut[1], path_mode, extern_param) > + self.vm_dut[1].send_expect('set txpkts 2000,2000,2000,2000', 'te= stpmd> > ', 30) > + self.vm_dut[1].send_expect('set burst 1', 'testpmd> ', 30) > + self.vm_dut[1].send_expect('start tx_first 10', 'testpmd> ', 30) > + # check the packet in vm0 > + self.check_packet_payload_valid(self.vm_dut[0]) > + # reset the evn in vm > + self.disable_pcap_lib_in_dpdk(self.vm_dut[0]) > self.stop_all_apps() >=20 > def test_vhost_vm2vm_virito_10_pmd_with_mergeable_path(self): > """ > - vhost-user + virtio1.0-pmd with mergeable path > + vhost-user + virtio1.0-pmd with mergeable path test with > + payload check > """ > path_mode =3D "mergeable" > + extern_param =3D '--max-pkt-len=3D9600' > self.start_vhost_testpmd() > self.start_vms(mode=3D1, mergeable=3DTrue) > - self.start_vm_testpmd(self.vm_dut[0], path_mode) > - self.start_vm_testpmd(self.vm_dut[1], path_mode) > - self.send_and_verify(mode=3D"virtio 1.0", path=3Dpath_mode) > + # enable pcap in VM0 > + self.enable_pcap_lib_in_dpdk(self.vm_dut[0]) > + # git the vm enough huge to run pdump > + self.vm_dut[0].set_huge_pages(2048) > + # start testpmd and pdump in VM0 > + self.start_vm_testpmd(self.vm_dut[0], path_mode, extern_param) > + self.vm_dut[0].send_expect('set fwd rxonly', 'testpmd> ', 30) > + self.vm_dut[0].send_expect('start', 'testpmd> ', 30) > + self.launch_pdump_in_vm(self.vm_dut[0]) > + # start testpmd in VM1 and start to send packet > + self.start_vm_testpmd(self.vm_dut[1], path_mode, extern_param) > + self.vm_dut[1].send_expect('set txpkts 2000,2000,2000,2000', 'te= stpmd> > ', 30) > + self.vm_dut[1].send_expect('set burst 1', 'testpmd> ', 30) > + self.vm_dut[1].send_expect('start tx_first 10', 'testpmd> ', 30) > + # check the packet in vm0 > + self.check_packet_payload_valid(self.vm_dut[0]) > + # reset the evn in vm > + self.disable_pcap_lib_in_dpdk(self.vm_dut[0]) > self.stop_all_apps() >=20 > def tear_down(self): > -- > 2.7.4