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 63A86A0613 for ; Wed, 28 Aug 2019 07:56:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5A6381C1F0; Wed, 28 Aug 2019 07:56:22 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 1B7221C1CC for ; Wed, 28 Aug 2019 07:56:20 +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 fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Aug 2019 22:56:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,440,1559545200"; d="scan'208";a="356002951" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga005.jf.intel.com with ESMTP; 27 Aug 2019 22:56:19 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 27 Aug 2019 22:56:19 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 27 Aug 2019 22:56:18 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.80]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.62]) with mapi id 14.03.0439.000; Wed, 28 Aug 2019 13:56:17 +0800 From: "Tu, Lijuan" To: "Ma, LihongX" , "dts@dpdk.org" CC: "Ma, LihongX" Thread-Topic: [dts] [PATCH V1] tests/pvp_multi_paths: update code to support trex Thread-Index: AQHVUaXaFXh9Hkgq4UGxT1YvnLV/s6cQJ0tg Date: Wed, 28 Aug 2019 05:56:16 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BB06735@SHSMSX101.ccr.corp.intel.com> References: <1565653466-31770-1-git-send-email-lihongx.ma@intel.com> In-Reply-To: <1565653466-31770-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDY4NmIxZWYtNTMwOC00ZDAyLTk2NTUtMDc3NjYzYjIzNzc2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiXC85QlRjUGhXSExPRkZrVG04SURDaFVMMUU3cURcL2t2ckxvbWU5OVNLZnM1M29JVUV6bXdYTVVFd3pIWkkxS3k0In0= 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/pvp_multi_paths: update code to support trex 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 7:44 AM > To: dts@dpdk.org > Cc: Ma, LihongX > Subject: [dts] [PATCH V1] tests/pvp_multi_paths: update code to support > trex >=20 > Signed-off-by: lihong > --- > tests/TestSuite_pvp_multi_paths_performance.py | 37 ++++++++++++++--= - > ----- > ...vp_multi_paths_vhost_single_core_performance.py | 31 +++++++++++-----= - > - ...p_multi_paths_virtio_single_core_performance.py | 36 +++++++++++++-= -- > ----- > 3 files changed, 65 insertions(+), 39 deletions(-) >=20 > diff --git a/tests/TestSuite_pvp_multi_paths_performance.py > b/tests/TestSuite_pvp_multi_paths_performance.py > index 071b2c6..b633b98 100644 > --- a/tests/TestSuite_pvp_multi_paths_performance.py > +++ b/tests/TestSuite_pvp_multi_paths_performance.py > @@ -1,6 +1,6 @@ > # BSD LICENSE > # > -# Copyright(c) 2010-2019 Intel Corporation. All rights reserved. > +# Copyright(c) <2019> Intel Corporation. All rights reserved. > # All rights reserved. > # > # Redistribution and use in source and binary forms, with or without @@ = - > 36,7 +36,8 @@ Test PVP performance using virtio_user on 8 tx/rx path. >=20 > import utils > from test_case import TestCase > -from settings import HEADER_SIZE > +from packet import Packet, save_packets from pktgen import > +PacketGeneratorHelper >=20 >=20 > class TestPVPMultiPathPerformance(TestCase): > @@ -48,8 +49,6 @@ class TestPVPMultiPathPerformance(TestCase): > self.frame_sizes =3D [64, 128, 256, 512, 1024, 1518] > self.core_config =3D "1S/4C/1T" > self.number_of_ports =3D 1 > - self.headers_size =3D HEADER_SIZE['eth'] + HEADER_SIZE['ip'] + \ > - HEADER_SIZE['udp'] > self.dut_ports =3D self.dut.get_ports() > self.verify(len(self.dut_ports) >=3D 1, "Insufficient ports for = testing") > self.ports_socket =3D self.dut.get_numa_id(self.dut_ports[0]) > @@ -59,11 +58,18 @@ class TestPVPMultiPathPerformance(TestCase): > self.core_list_host =3D self.core_list[2:4] > self.core_mask_user =3D utils.create_mask(self.core_list_user) > self.core_mask_host =3D utils.create_mask(self.core_list_host) > - if self.dut.cores[len(self.dut.cores) - 1]['socket'] =3D=3D '0': > + if len(set([int(core['socket']) for core in self.dut.cores])) = =3D=3D 1: > self.socket_mem =3D '1024' > else: > self.socket_mem =3D '1024,1024' >=20 > + 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() > + > def set_up(self): > """ > Run before each test case. > @@ -81,7 +87,6 @@ class TestPVPMultiPathPerformance(TestCase): > """ > Send packet with packet generator and verify > """ > - payload_size =3D frame_size - self.headers_size > tgen_input =3D [] > for port in xrange(self.number_of_ports): > rx_port =3D self.tester.get_local_port( @@ -90,14 +95,17 @@ = class > TestPVPMultiPathPerformance(TestCase): > self.dut_ports[(port) % self.number_of_ports]) > destination_mac =3D self.dut.get_mac_address( > self.dut_ports[(port) % self.number_of_ports]) > - self.tester.scapy_append( > - 'wrpcap("l2fwd_%d.pcap", [Ether(dst=3D"%s")/IP()/UDP()/(= "X"*%d)])' % > - (port, destination_mac, payload_size)) >=20 > - tgen_input.append((tx_port, rx_port, "l2fwd_%d.pcap" % port)= ) > + pkt =3D Packet(pkt_type=3D'UDP', pkt_len=3Dframe_size) > + pkt.config_layer('ether', {'dst': '%s' % destination_mac}) > + save_packets([pkt], "%s/multi_path_%d.pcap" % (self.out_path= , > port)) > + tgen_input.append((tx_port, rx_port, > + "%s/multi_path_%d.pcap" % (self.out_path, port))) >=20 > - self.tester.scapy_execute() > - _, pps =3D self.tester.traffic_generator_throughput(tgen_input) > + self.tester.pktgen.clear_streams() > + streams =3D > self.pktgen_helper.prepare_stream_from_tginput(tgen_input, 100, None, > self.tester.pktgen) > + # set traffic option > + traffic_opt =3D {'delay': 5} > + _, pps =3D > + self.tester.pktgen.measure_throughput(stream_ids=3Dstreams, > + options=3Dtraffic_opt) > Mpps =3D pps / 1000000.0 > self.verify(Mpps > 0, "%s can not receive packets of frame size = %d" % > (self.running_case, frame_size)) >=20 > @@ -119,10 +127,11 @@ class TestPVPMultiPathPerformance(TestCase): > self.dut.send_expect("killall -s INT testpmd", "#") > self.dut.send_expect("killall -s INT qemu-system-x86_64", "#") > command_line_client =3D "./%s/app/testpmd -n %d -c %s --socket-m= em " > + \ > - " %s --legacy-mem --file-prefix=3Dvhost --= vdev " + \ > + " %s --legacy-mem -w %s > + --file-prefix=3Dvhost --vdev " + \ > "'net_vhost0,iface=3Dvhost-net,queues=3D1,= client=3D0' -- -i --nb- > cores=3D1 --txd=3D1024 --rxd=3D1024" > command_line_client =3D command_line_client % (self.target, > - self.dut.get_memory_channels(), self.core_mask_host, > self.socket_mem) > + self.dut.get_memory_channels(), self.core_mask_host, > + self.socket_mem, > + self.dut.ports_info[self.dut_ports[0]]['pci']) > self.vhost.send_expect(command_line_client, "testpmd> ", 120) > self.vhost.send_expect("set fwd mac", "testpmd> ", 120) > self.vhost.send_expect("start", "testpmd> ", 120) diff --git > a/tests/TestSuite_pvp_multi_paths_vhost_single_core_performance.py > b/tests/TestSuite_pvp_multi_paths_vhost_single_core_performance.py > index 8d94491..fcaadf2 100644 > --- a/tests/TestSuite_pvp_multi_paths_vhost_single_core_performance.py > +++ b/tests/TestSuite_pvp_multi_paths_vhost_single_core_performance.py > @@ -1,6 +1,6 @@ > # BSD LICENSE > # > -# Copyright(c) 2010-2019 Intel Corporation. All rights reserved. > +# Copyright(c) <2019> Intel Corporation. All rights reserved. > # All rights reserved. > # > # Redistribution and use in source and binary forms, with or without @@ = - > 36,7 +36,8 @@ Test PVP vhost single core performance using virtio_user on= 8 > tx/rx path. >=20 > import utils > from test_case import TestCase > -from settings import HEADER_SIZE > +from packet import Packet, save_packets from pktgen import > +PacketGeneratorHelper >=20 >=20 > class TestPVPMultiPathVhostPerformance(TestCase): > @@ -48,8 +49,6 @@ class TestPVPMultiPathVhostPerformance(TestCase): > self.frame_sizes =3D [64, 128, 256, 512, 1024, 1518] > self.core_config =3D "1S/5C/1T" > self.number_of_ports =3D 1 > - self.headers_size =3D HEADER_SIZE['eth'] + HEADER_SIZE['ip'] + \ > - HEADER_SIZE['udp'] > self.dut_ports =3D self.dut.get_ports() > self.ports_socket =3D self.dut.get_numa_id(self.dut_ports[0]) > self.core_list =3D self.dut.get_core_list( @@ -58,11 +57,18 @@ c= lass > TestPVPMultiPathVhostPerformance(TestCase): > self.core_list_host =3D self.core_list[3:5] > self.core_mask_user =3D utils.create_mask(self.core_list_user) > self.core_mask_host =3D utils.create_mask(self.core_list_host) > - if self.dut.cores[len(self.dut.cores) - 1]['socket'] =3D=3D '0': > + if len(set([int(core['socket']) for core in self.dut.cores])) = =3D=3D 1: > self.socket_mem =3D '1024' > else: > self.socket_mem =3D '1024,1024' >=20 > + 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() > + > def set_up(self): > """ > Run before each test case. > @@ -78,7 +84,6 @@ class TestPVPMultiPathVhostPerformance(TestCase): > """ > Send packet with packet generator and verify > """ > - payload_size =3D frame_size - self.headers_size > tgen_input =3D [] > for port in xrange(self.number_of_ports): > rx_port =3D self.tester.get_local_port( @@ -87,14 +92,16 @@ = class > TestPVPMultiPathVhostPerformance(TestCase): > self.dut_ports[(port) % self.number_of_ports]) > destination_mac =3D self.dut.get_mac_address( > self.dut_ports[(port) % self.number_of_ports]) > - self.tester.scapy_append( > - 'wrpcap("l2fwd_%d.pcap", [Ether(dst=3D"%s")/IP()/UDP()/(= "X"*%d)])' % > - (port, destination_mac, payload_size)) >=20 > - tgen_input.append((tx_port, rx_port, "l2fwd_%d.pcap" % port)= ) > + pkt =3D Packet(pkt_type=3D'UDP', pkt_len=3Dframe_size) > + pkt.config_layer('ether', {'dst': '%s' % destination_mac}) > + save_packets([pkt], "%s/multi_path_%d.pcap" % (self.out_path= , > port)) > + tgen_input.append((tx_port, rx_port, > + "%s/multi_path_%d.pcap" % (self.out_path, port))) >=20 > - self.tester.scapy_execute() > - _, pps =3D self.tester.traffic_generator_throughput(tgen_input) > + self.tester.pktgen.clear_streams() > + streams =3D > self.pktgen_helper.prepare_stream_from_tginput(tgen_input, 100, None, > 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 > self.verify(Mpps > 0, "%s can not receive packets of frame size = %d" % > (self.running_case, frame_size)) >=20 > diff --git > a/tests/TestSuite_pvp_multi_paths_virtio_single_core_performance.py > b/tests/TestSuite_pvp_multi_paths_virtio_single_core_performance.py > index 32f5171..6cd3a6d 100644 > --- a/tests/TestSuite_pvp_multi_paths_virtio_single_core_performance.py > +++ b/tests/TestSuite_pvp_multi_paths_virtio_single_core_performance.py > @@ -36,7 +36,8 @@ Test PVP virtio single core performance using > virtio_user on 8 tx/rx path. >=20 > import utils > from test_case import TestCase > -from settings import HEADER_SIZE > +from packet import Packet, save_packets from pktgen import > +PacketGeneratorHelper >=20 >=20 > class TestPVPMultiPathVirtioPerformance(TestCase): > @@ -48,8 +49,6 @@ class TestPVPMultiPathVirtioPerformance(TestCase): > self.frame_sizes =3D [64, 128, 256, 512, 1024, 1518] > self.core_config =3D "1S/5C/1T" > self.number_of_ports =3D 1 > - self.headers_size =3D HEADER_SIZE['eth'] + HEADER_SIZE['ip'] + \ > - HEADER_SIZE['udp'] > self.dut_ports =3D self.dut.get_ports() > self.verify(len(self.dut_ports) >=3D 1, "Insufficient ports for = testing") > self.ports_socket =3D self.dut.get_numa_id(self.dut_ports[0]) > @@ -59,11 +58,18 @@ class TestPVPMultiPathVirtioPerformance(TestCase): > self.core_list_host =3D self.core_list[2:5] > self.core_mask_user =3D utils.create_mask(self.core_list_user) > self.core_mask_host =3D utils.create_mask(self.core_list_host) > - if self.dut.cores[len(self.dut.cores) - 1]['socket'] =3D=3D '0': > + if len(set([int(core['socket']) for core in self.dut.cores])) = =3D=3D 1: > self.socket_mem =3D '1024' > else: > self.socket_mem =3D '1024,1024' >=20 > + 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() > + > def set_up(self): > """ > Run before each test case. > @@ -81,7 +87,6 @@ class TestPVPMultiPathVirtioPerformance(TestCase): > """ > Send packet with packet generator and verify > """ > - payload_size =3D frame_size - self.headers_size > tgen_input =3D [] > for port in xrange(self.number_of_ports): > rx_port =3D self.tester.get_local_port( @@ -90,14 +95,18 @@ = class > TestPVPMultiPathVirtioPerformance(TestCase): > self.dut_ports[(port) % self.number_of_ports]) > destination_mac =3D self.dut.get_mac_address( > self.dut_ports[(port) % self.number_of_ports]) > - self.tester.scapy_append( > - 'wrpcap("l2fwd_%d.pcap", [Ether(dst=3D"%s")/IP()/UDP()/(= "X"*%d)])' % > - (port, destination_mac, payload_size)) >=20 > - tgen_input.append((tx_port, rx_port, "l2fwd_%d.pcap" % port)= ) > + pkt =3D Packet(pkt_type=3D'UDP', pkt_len=3Dframe_size) > + pkt.config_layer('ether', {'dst': '%s' % destination_mac}) > + save_packets([pkt], "%s/multi_path_%d.pcap" % > + (self.out_path, port)) > + > + tgen_input.append((tx_port, rx_port, > + "%s/multi_path_%d.pcap" % (self.out_path, port))) >=20 > - self.tester.scapy_execute() > - _, pps =3D self.tester.traffic_generator_throughput(tgen_input) > + self.tester.pktgen.clear_streams() > + streams =3D > self.pktgen_helper.prepare_stream_from_tginput(tgen_input, 100, None, > self.tester.pktgen) > + # set traffic option > + traffic_opt =3D {'delay': 5} > + _, pps =3D > + self.tester.pktgen.measure_throughput(stream_ids=3Dstreams, > + options=3Dtraffic_opt) > Mpps =3D pps / 1000000.0 > self.verify(Mpps > 0, "%s can not receive packets of frame size = %d" % > (self.running_case, frame_size)) >=20 > @@ -119,10 +128,11 @@ class > TestPVPMultiPathVirtioPerformance(TestCase): > self.dut.send_expect("killall -s INT testpmd", "#") > self.dut.send_expect("killall -s INT qemu-system-x86_64", "#") > command_line_client =3D "./%s/app/testpmd -n %d -c %s --socket-m= em " > + \ > - " %s --legacy-mem --file-prefix=3Dvhost --= vdev " + \ > + " %s --legacy-mem -w %s > + --file-prefix=3Dvhost --vdev " + \ > "'net_vhost0,iface=3Dvhost-net,queues=3D1,= client=3D0' -- -i --nb- > cores=3D2 --txd=3D1024 --rxd=3D1024" > command_line_client =3D command_line_client % (self.target, > - self.dut.get_memory_channels(), self.core_mask_host, > self.socket_mem) > + self.dut.get_memory_channels(), self.core_mask_host, > + self.socket_mem, > + self.dut.ports_info[self.dut_ports[0]]['pci']) > self.vhost.send_expect(command_line_client, "testpmd> ", 120) > self.vhost.send_expect("set fwd io", "testpmd> ", 120) > self.vhost.send_expect("start", "testpmd> ", 120) > -- > 2.7.4