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 30F80A04FA; Wed, 8 Jan 2020 07:53:59 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D96B11C239; Wed, 8 Jan 2020 07:53:58 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 1074A1C237 for ; Wed, 8 Jan 2020 07:53:56 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Jan 2020 22:53:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,408,1571727600"; d="scan'208";a="215863922" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga008.jf.intel.com with ESMTP; 07 Jan 2020 22:53:55 -0800 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 7 Jan 2020 22:53:55 -0800 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 7 Jan 2020 22:53:54 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.30]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.39]) with mapi id 14.03.0439.000; Wed, 8 Jan 2020 14:53:53 +0800 From: "Tu, Lijuan" To: "Yao, BingX Y" , "dts@dpdk.org" CC: "Yao, BingX Y" Thread-Topic: [dts] [PATCH V1 1/3] add case to ip_pipeline Thread-Index: AQHVxe52vwodCAsjS0WxpEBFbnouBKfgUn6A Date: Wed, 8 Jan 2020 06:53:52 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BBA43E7@SHSMSX101.ccr.corp.intel.com> References: <1578465068-113248-1-git-send-email-bingx.y.yao@intel.com> In-Reply-To: <1578465068-113248-1-git-send-email-bingx.y.yao@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-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 1/3] add case to ip_pipeline 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" Comments inline > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of yaobing > Sent: Wednesday, January 8, 2020 2:31 PM > To: dts@dpdk.org > Cc: Yao, BingX Y > Subject: [dts] [PATCH V1 1/3] add case to ip_pipeline >=20 > add test_perf_pipeline_with_traffic_management >=20 > Signed-off-by: yaobing > --- > tests/TestSuite_ip_pipeline.py | 60 ++++++++++++++++++++++++++++++++++ > 1 file changed, 60 insertions(+) >=20 > diff --git a/tests/TestSuite_ip_pipeline.py b/tests/TestSuite_ip_pipeline= .py > index f05b5cd..7bdfc52 100644 > --- a/tests/TestSuite_ip_pipeline.py > +++ b/tests/TestSuite_ip_pipeline.py > @@ -61,6 +61,7 @@ from scapy.packet import bind_layers, Raw from > scapy.arch import get_if_hwaddr from scapy.sendrecv import sniff from > scapy.sendrecv import sendp > +from pktgen import PacketGeneratorHelper >=20 > class TestIPPipeline(TestCase): >=20 > @@ -224,6 +225,15 @@ class TestIPPipeline(TestCase): > self.verify("Error" not in out, "Compilation error") >=20 > self.param_flow_dir =3D self.get_flow_direction_param_of_tcpdump= () > + # get dts output path [Lijuan] why need to get dts output path, I didn't find any call? > + if self.logger.log_path.startswith(os.sep): > + self.output_path =3D self.logger.log_path > + else: > + cur_path =3D os.path.dirname( > + os.path.dirname(os.path.realpath(__file__))) > + self.output_path =3D os.sep.join([cur_path, self.logger.log_= path]) > + # create an instance to set stream field setting > + self.pktgen_helper =3D PacketGeneratorHelper() >=20 > def set_up(self): > """ > @@ -231,6 +241,56 @@ class TestIPPipeline(TestCase): > """ > pass >=20 > + def set_fields(self): > + """ > + set ip protocol field behavior > + """ > + fields_config =3D { > + 'ip': { > + 'dst': {'range': 1, 'action': 'inc'}, }, } > + return fields_config > + > + def copy_cli_files_to_dut(self): > + """ > + Copy traffic_manager.cli from tester to DUT > + """ > + src_file =3D r'./dep/traffic_manager.cli' > + dst =3D '/tmp' > + self.dut.session.copy_file_to(src_file, dst) > + self.dut.send_expect("cp %s/traffic_manager.cli > + ./examples/ip_pipeline/examples/" % dst, "#", 30) [Lijuan] Can we copy to " ./examples/ip_pipeline/examples/ " directly? > + > + def test_perf_pipeline_with_traffic_management(self): > + """ > + rss pipeline > + """ > + self.copy_cli_files_to_dut() > + cmd =3D "sed -i -e > 's/0000:07:00.0/%s/' ./examples/ip_pipeline/examples/traffic_manager.cli"= % > self.dut_p0_pci > + self.dut.send_expect(cmd, "# ", 20) > + IP_PIPELINE =3D "./examples/ip_pipeline/build/ip_pipeline" > + DUT_PORTS =3D " -w {0}".format(self.dut_p0_pci) > + SCRIPT_FILE =3D "./examples/ip_pipeline/examples/traffic_manager= .cli" > + cmd =3D "{0} -c 0x3 -n 4 {1} -- -s {2}".format(IP_PIPELINE, DUT_= PORTS, > SCRIPT_FILE) > + out =3D self.dut.send_expect(cmd, "15.255.0.0", 60) > + self.verify("failed" not in out, "Create rule failed!") > + pcap =3D os.sep.join([self.output_path, "test.pcap"]) > + dmac =3D self.dut.get_mac_address(self.dut_ports[0]) > + pkts =3D 'Ether(dst=3D"%s")/IP(src=3D"192.168.0.2",dst=3D"0.%s.0= .0")' > + strandard_pps =3D 14880000 / 4096 [Lijuan] why is 14880000 / 4096, can I use a 40Gb NIC for testing ? > + for i in range(0, 15): > + flow =3D pkts % (dmac, i) > + self.tester.scapy_append('wrpcap("%s", [%s])' % (pcap, flow)= ) > + tgenInput =3D [] > + port =3D self.tester.get_local_port(self.dut_ports[0]) > + vm_config =3D self.set_fields() > + tgenInput.append([port, port, pcap]) > + self.tester.scapy_execute() > + self.tester.pktgen.clear_streams() > + streams =3D > self.pktgen_helper.prepare_stream_from_tginput(tgenInput, 100, vm_config, > self.tester.pktgen) > + _, pps =3D self.tester.pktgen.measure_throughput(stream_ids= =3Dstreams) > + difference_value =3D pps - strandard_pps > + self.verify(-100 < difference_value < 100, "throughput valid= ation > failure") > + self.dut.send_expect("^C", "#", 20) > + > def test_routing_pipeline(self): > """ > routing pipeline > -- > 2.17.2