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 BA0B9A0471 for ; Wed, 14 Aug 2019 04:42:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8E28F1BE8A; Wed, 14 Aug 2019 04:42:48 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 48EE71BE89 for ; Wed, 14 Aug 2019 04:42:46 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Aug 2019 19:42:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,383,1559545200"; d="scan'208";a="167246445" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga007.jf.intel.com with ESMTP; 13 Aug 2019 19:42:45 -0700 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 13 Aug 2019 19:42:44 -0700 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by fmsmsx121.amr.corp.intel.com (10.18.125.36) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 13 Aug 2019 19:42:28 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.112]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.163]) with mapi id 14.03.0439.000; Wed, 14 Aug 2019 10:42:27 +0800 From: "Wang, Yinan" 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: AQHVUaXa24eUBhbSBU6MWhYedH7ujKb58H4g Date: Wed, 14 Aug 2019 02:42:26 +0000 Message-ID: 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: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYWRlODNhNDItZTUyNy00ZjgyLWExYWQtYWZjMDYzZDlkZjNhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiSHl0d2NseG5oYVRnaTljQ3FFVlwvaDdxMnlobUNJdHZmbFpRUWtBcUFnaWQ1K29cL0FOUHN5aVwvbEJvYmxKNWNOOCJ9 x-ctpclassification: CTP_NT 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="iso-2022-jp" 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" Acked-by: Wang, Yinan > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of lihong > Sent: 2019=1B$BG/=1B(B8=1B$B7n=1B(B13=1B$BF|=1B(B 7:44 > To: dts@dpdk.org > Cc: Ma, LihongX > Subject: [dts] [PATCH V1] tests/pvp_multi_paths: update code to support t= rex >=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 " + \ >=20 > "'net_vhost0,iface=3Dvhost-net,queues=3D1,client=3D0' -- -i --nb-cores=3D= 1 --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_performan= ce.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_us= er 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 " + \ >=20 > "'net_vhost0,iface=3Dvhost-net,queues=3D1,client=3D0' -- -i --nb-cores=3D= 2 --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