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 B6335A00E6 for ; Wed, 7 Aug 2019 08:56:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 91EA9375B; Wed, 7 Aug 2019 08:56:40 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id D8CCF14E8 for ; Wed, 7 Aug 2019 08:56:38 +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 orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Aug 2019 23:56:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,356,1559545200"; d="scan'208";a="373670583" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga005.fm.intel.com with ESMTP; 06 Aug 2019 23:56:36 -0700 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 6 Aug 2019 23:56:36 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 6 Aug 2019 23:56:36 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.80]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.139]) with mapi id 14.03.0439.000; Wed, 7 Aug 2019 14:56:35 +0800 From: "Tu, Lijuan" To: "Zhang, YanX A" , "dts@dpdk.org" CC: "Zhang, YanX A" Thread-Topic: [dts] [PATCH V1] tests/TestSuite_vf_to_vf_nic_bridge:Change the way you distribute Thread-Index: AQHVPhsxMVAwtPGokket6r+ZaBAvp6bvXkCg Date: Wed, 7 Aug 2019 06:56:34 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BAFEEF4@SHSMSX101.ccr.corp.intel.com> References: <1563531703-152978-1-git-send-email-yanx.a.zhang@intel.com> In-Reply-To: <1563531703-152978-1-git-send-email-yanx.a.zhang@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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTg5ZTMyNGUtNjUwZS00ZTRiLTg3ODMtMjQwOTJiNzcwMjFhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiR3pZVkFoRklWYkRjSExLNUNEMmUyckFoc3JcL1BaaWxLVzRCTjZ2MisxRFVLUU02VVwva0lIMnlxN3hzbkU3RGVSIn0= 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/TestSuite_vf_to_vf_nic_bridge:Change the way you distribute 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 zhang,yan > Sent: Friday, July 19, 2019 6:22 PM > To: dts@dpdk.org > Cc: Zhang, YanX A > Subject: [dts] [PATCH V1] tests/TestSuite_vf_to_vf_nic_bridge:Change the > way you distribute >=20 > Change the way packets are sent and use testpmd instead of pktgen. >=20 > Signed-off-by: zhang,yan > --- > tests/TestSuite_vf_to_vf_nic_bridge.py | 116 +++++++------------------ > 1 file changed, 33 insertions(+), 83 deletions(-) >=20 > diff --git a/tests/TestSuite_vf_to_vf_nic_bridge.py > b/tests/TestSuite_vf_to_vf_nic_bridge.py > index 15b2ff9..1e7374c 100644 > --- a/tests/TestSuite_vf_to_vf_nic_bridge.py > +++ b/tests/TestSuite_vf_to_vf_nic_bridge.py > @@ -125,57 +125,7 @@ class TestVF2VFBridge(TestCase): > port.bind_driver() > self.pf_port_for_vfs =3D 0 >=20 > - def generate_pcap_pkt(self, dst, src, load, pktname=3D'flow.pcap'): > - """ > - dst: > - server: dst server object > - ether: dst mac > - ip: dst ip > - udp: dst udp protocol > - tcp: dst tcp protocal > - src: > - server: src server object > - ether: src mac > - ip: src ip > - udp: src udp protocol > - tcp: src tcp protocal > - load: > - content: pay load > - length: content length > - """ > - context =3D '[Ether(dst=3D"%s", src=3D"%s")/IP()/Raw(load=3D%s)]= ' % \ > - (str(dst['ether']), str(src['ether']), load['content']) > - src['server'].send_expect('scapy', '>>> ', 10) > - src['server'].send_expect( > - 'wrpcap("%s", %s)' % (pktname, context), '>>> ', 10) > - src['server'].send_expect('quit()', '#', 10) > - > - def prepare_pktgen(self, vm): > - vm.session.copy_file_to('./dep/tgen.tgz') > - vm.send_expect("cd /root", "#", 10) > - vm.send_expect("tar xvf tgen.tgz", '#', 20) > - > - def send_stream_pktgen(self, vm, pktname=3D'flow.pcap'): > - vm.send_expect( > - "echo 2048 > /sys/kernel/mm/hugepages/hugepages- > 2048kB/nr_hugepages", "#", 10) > - vm.send_expect(" mount -t hugetlbfs nodedev /mnt/huge/", "#", 10= ) > - vm.send_expect( > - "./pktgen -c 0xf -n 2 --proc-type auto -- -P -T -m '1.0' -s = 0:%s" % > - pktname, "", 100) > - time.sleep(60) > - vm.send_expect("set 0 rate 50", "", 20) > - time.sleep(5) > - vm.send_expect("set 0 count %d" % SEND_PACKET, "", 20) > - time.sleep(5) > - vm.send_expect("start all", "", 20) > - time.sleep(20) > - > - def stop_stream_pktgen(self, vm): > - vm.send_expect("stop all", "", 20) > - time.sleep(5) > - vm.send_expect("quit", "#", 20) > - > - def test_2vf_d2d_pktgen_stream(self): > + def test_2vf_d2d_testpmd_stream(self): > self.vm0_ports =3D self.vm0_dut.get_ports('any') > self.vm0_pmd =3D PmdOutput(self.vm0_dut) > self.vm0_pmd.start_testpmd('all') @@ -183,60 +133,60 @@ class > TestVF2VFBridge(TestCase): > self.vm0_pmd.execute_cmd("set promisc all off") > self.vm0_pmd.execute_cmd('start') >=20 > - self.vm1_ports =3D self.vm1_dut.get_ports('any') > - self.prepare_pktgen(self.vm1_dut) > - > - dst =3D {} > - dst['server'] =3D self.vm0_dut > - dst['ether'] =3D self.vm0_dut.ports_info[self.vm0_ports[0]]['mac= '] > - src =3D {} > - src['server'] =3D self.vm1_dut > - src['ether'] =3D self.vm1_dut.ports_info[self.vm1_ports[0]]['mac= '] > - load =3D {} > - load['content'] =3D "'X'*46" > - self.generate_pcap_pkt(dst, src, load) > - self.vm0_pmd.execute_cmd('clear port stats all') > - self.send_stream_pktgen(self.vm1_dut) > + vm0_mac =3D self.vm0_dut.ports_info[self.vm0_ports[0]]['mac'] > + > + self.vm1_pmd =3D PmdOutput(self.vm1_dut) > + self.vm1_pmd.start_testpmd('all') > + self.vm1_pmd.execute_cmd('set fwd mac') > + self.vm1_pmd.execute_cmd("set promisc all off") > + self.vm1_pmd.execute_cmd('set eth-peer 0 %s' % vm0_mac) > + self.vm1_pmd.execute_cmd('set burst 50') > + self.vm1_pmd.execute_cmd('start tx_first 2') > + > recv_num =3D self.vm0_pmd.get_pmd_stats(0)['RX-packets'] > time.sleep(1) > - self.stop_stream_pktgen(self.vm1_dut) > self.vm0_pmd.execute_cmd('stop') > self.vm0_pmd.execute_cmd('quit', '# ') >=20 > + self.vm1_pmd.execute_cmd('stop') > + self.vm1_pmd.execute_cmd('quit', '# ') > + > self.verify(recv_num is SEND_PACKET, > 'Rx port recv error: %d' % recv_num) >=20 > - def test_2vf_d2k_pktgen_stream(self): > + def test_2vf_d2k_testpmd_stream(self): > self.vm0_dut.restore_interfaces() > self.vm0_ports =3D self.vm0_dut.get_ports('any') > vf0_intf =3D self.vm0_dut.ports_info[self.vm0_ports[0]]['intf'] >=20 > self.vm1_ports =3D self.vm1_dut.get_ports('any') > - self.prepare_pktgen(self.vm1_dut) > - > - dst =3D {} > - dst['server'] =3D self.vm0_dut > - dst['ether'] =3D self.vm0_dut.ports_info[self.vm0_ports[0]]['mac= '] > - src =3D {} > - src['server'] =3D self.vm1_dut > - src['ether'] =3D self.vm1_dut.ports_info[self.vm1_ports[0]]['mac= '] > - load =3D {} > - load['content'] =3D "'X'*46" > - self.generate_pcap_pkt(dst, src, load) > + > + vm0_mac =3D self.vm0_dut.ports_info[self.vm0_ports[0]]['mac'] > + filename =3D "m.pcap" > + > self.vm0_dut.send_expect( > - 'tcpdump -i %s -s 1000 "ether src %s and ether dst %s"' % > - (vf0_intf, src['ether'], dst['ether']),= 'tcpdump', 30) > - self.send_stream_pktgen(self.vm1_dut) > - self.stop_stream_pktgen(self.vm1_dut) > + 'tcpdump -i %s ether dst %s -w %s' % (vf0_intf, > + vm0_mac, filename), 'tcpdump', 30) >=20 > + self.vm1_pmd =3D PmdOutput(self.vm1_dut) > + self.vm1_pmd.start_testpmd('all') > + self.vm1_pmd.execute_cmd('set fwd mac') > + self.vm1_pmd.execute_cmd("set promisc all off") > + self.vm1_pmd.execute_cmd('set eth-peer 0 %s' % vm0_mac) > + self.vm1_pmd.execute_cmd('set burst 50') > + self.vm1_pmd.execute_cmd('start tx_first 2') > + > + time.sleep(1) > recv_tcpdump =3D self.vm0_dut.send_expect('^C', '#', 30) > time.sleep(5) > - recv_pattern =3D re.compile("(\d+) packets captured") > + recv_pattern =3D re.compile("(\d+) packet\w{0,1} captured") > recv_info =3D recv_pattern.search(recv_tcpdump) > recv_str =3D recv_info.group(0).split(' ')[0] > recv_number =3D int(recv_str, 10) > self.vm0_dut.bind_interfaces_linux(self.drivername) >=20 > + self.vm1_pmd.execute_cmd('stop') > + self.vm1_pmd.execute_cmd('quit', '# ') > + > self.verify(recv_number is SEND_PACKET, > 'Rx port recv error: %d' % recv_number) >=20 > -- > 2.17.2