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 6D294A046B for ; Tue, 20 Aug 2019 04:37:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6422C1BE94; Tue, 20 Aug 2019 04:37:51 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 9B8E31B994 for ; Tue, 20 Aug 2019 04:37:49 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Aug 2019 19:37:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,407,1559545200"; d="scan'208";a="195668535" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga001.fm.intel.com with ESMTP; 19 Aug 2019 19:37:48 -0700 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 19 Aug 2019 19:37:47 -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; Mon, 19 Aug 2019 19:37:48 -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; Tue, 20 Aug 2019 10:37:46 +0800 From: "Wang, Yinan" To: "Ma, LihongX" , "dts@dpdk.org" CC: "Ma, LihongX" Thread-Topic: [dts] [PATCH V1] tests/pvp_virtio_user_multi_queues: update code to support trex Thread-Index: AQHVUwSkJ6jgOCmwHE6Y83R7idKXZKcDWm/Q Date: Tue, 20 Aug 2019 02:37:45 +0000 Message-ID: References: <1565804132-8853-1-git-send-email-lihongx.ma@intel.com> In-Reply-To: <1565804132-8853-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzExMTQ4NjAtMjFkOS00MjcxLTk1MzYtZjNmZThhMzhlMzU4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiWGlESUQrZVVwTWhBZ1JoU055d2J4bndFa0ZwWjlvRjYzWEVNaHlWR1E5bWRGQnkyaWo4ekpNcUpaelhqZnVqYyJ9 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_virtio_user_multi_queues: 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(B15=1B$BF|=1B(B 1:36 > To: dts@dpdk.org > Cc: Ma, LihongX > Subject: [dts] [PATCH V1] tests/pvp_virtio_user_multi_queues: update code= to > support trex >=20 > Signed-off-by: lihong > --- > tests/TestSuite_pvp_virtio_user_multi_queues.py | 45 > ++++++++++++++----------- > 1 file changed, 25 insertions(+), 20 deletions(-) >=20 > diff --git a/tests/TestSuite_pvp_virtio_user_multi_queues.py > b/tests/TestSuite_pvp_virtio_user_multi_queues.py > index ebe65ba..ff8a0c4 100644 > --- a/tests/TestSuite_pvp_virtio_user_multi_queues.py > +++ b/tests/TestSuite_pvp_virtio_user_multi_queues.py > @@ -42,10 +42,10 @@ import time > import re > from settings import HEADER_SIZE > from test_case import TestCase > -from etgen import IxiaPacketGenerator > +from pktgen import PacketGeneratorHelper >=20 >=20 > -class TestPVPVirtioMultiQueues(TestCase, IxiaPacketGenerator): > +class TestPVPVirtioMultiQueues(TestCase): >=20 > def set_up_all(self): > """ > @@ -79,6 +79,13 @@ class TestPVPVirtioMultiQueues(TestCase, > IxiaPacketGenerator): > if 'packet_sizes' in self.get_suite_cfg(): > self.frame_sizes =3D self.get_suite_cfg()['packet_sizes'] >=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. > @@ -92,21 +99,6 @@ class TestPVPVirtioMultiQueues(TestCase, > IxiaPacketGenerator): > self.vhost_user =3D self.dut.new_session(suite=3D"vhost-user") > self.virtio_user =3D self.dut.new_session(suite=3D"virtio-user") >=20 > - def ip(self, port, frag, src, proto, tos, dst, chksum, len, options,= version, flags, > ihl, ttl, id): > - """ > - Configure IP protocol. > - """ > - self.add_tcl_cmd("protocol config -name ip") > - self.add_tcl_cmd('ip config -sourceIpAddr "%s"' % src) > - self.add_tcl_cmd('ip config -destIpAddrMode ipRandom') > - self.add_tcl_cmd("ip config -ttl %d" % ttl) > - self.add_tcl_cmd("ip config -totalLength %d" % len) > - self.add_tcl_cmd("ip config -fragment %d" % frag) > - self.add_tcl_cmd("ip config -ipProtocol %d" % proto) > - self.add_tcl_cmd("ip config -identifier %d" % id) > - self.add_tcl_cmd("stream config -framesize %d" % (len + 18)) > - self.add_tcl_cmd("ip set %d %d %d" % (self.chasId, port['card'], > port['port'])) > - > def start_vhost_testpmd(self): > """ > start testpmd on vhost > @@ -166,6 +158,13 @@ class TestPVPVirtioMultiQueues(TestCase, > IxiaPacketGenerator): >=20 > self.vhost_user.send_expect("start", "testpmd> ", 60) >=20 > + def set_fields(self): > + """ > + set ip protocol field behavior > + """ > + fields_config =3D {'ip': {'dst': {'action': 'random'}, }, } > + return fields_config > + > def send_and_verify(self, case_info): > """ > start to send packets and calculate avg throughput @@ -175,11 +1= 74,17 > @@ class TestPVPVirtioMultiQueues(TestCase, IxiaPacketGenerator): > tgen_input =3D [] > port =3D self.tester.get_local_port(self.dut_ports[0]) >=20 > self.tester.scapy_append('a=3D[Ether(dst=3D"%s")/IP(src=3D"0.240.74.101",= proto=3D255)/ > UDP()/("X"*%d)]' % (self.dst_mac, payload_size)) > - self.tester.scapy_append('wrpcap("multiqueue.pcap", a)') > + self.tester.scapy_append('wrpcap("%s/multiqueue.pcap" , a)' > + % self.out_path) > self.tester.scapy_execute() >=20 > - tgen_input.append((port, port, "multiqueue.pcap")) > - _, pps =3D self.tester.traffic_generator_throughput(tgen_inp= ut) > + tgen_input.append((port, port, "%s/multiqueue.pcap" % > + self.out_path)) > + > + vm_config =3D self.set_fields() > + self.tester.pktgen.clear_streams() > + streams =3D > self.pktgen_helper.prepare_stream_from_tginput(tgen_input, 100, vm_config= , > self.tester.pktgen) > + # set traffic option > + traffic_opt =3D {'delay': 5, 'duration': 20} > + _, pps =3D > + self.tester.pktgen.measure_throughput(stream_ids=3Dstreams, > + options=3Dtraffic_opt) > Mpps =3D pps / 1000000.0 > self.verify(Mpps > 0, "can not receive packets of frame size= %d" % > (frame_size)) > throughput =3D Mpps * 100 / \ > -- > 2.7.4