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 C88F5A0613 for ; Wed, 28 Aug 2019 08:03:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AE84A1C1F1; Wed, 28 Aug 2019 08:03:47 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 8EA131C1E9 for ; Wed, 28 Aug 2019 08:03:45 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Aug 2019 23:03:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,440,1559545200"; d="scan'208";a="210029061" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga002.fm.intel.com with ESMTP; 27 Aug 2019 23:03:45 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 27 Aug 2019 23:03:45 -0700 Received: from shsmsx105.ccr.corp.intel.com (10.239.4.158) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 27 Aug 2019 23:03:44 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.80]) by SHSMSX105.ccr.corp.intel.com ([169.254.11.15]) with mapi id 14.03.0439.000; Wed, 28 Aug 2019 14:03:42 +0800 From: "Tu, Lijuan" To: "Ma, LihongX" , "dts@dpdk.org" CC: "Ma, LihongX" Thread-Topic: [dts] [PATCH V1] tests/vhost_virtio_pmd_interrupt: update code to support trex Thread-Index: AQHVUnQDecS+kHwUNE+Kqpchv51kLKcQJ8Lg Date: Wed, 28 Aug 2019 06:03:41 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BB067CD@SHSMSX101.ccr.corp.intel.com> References: <1565742008-24080-1-git-send-email-lihongx.ma@intel.com> In-Reply-To: <1565742008-24080-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiN2FjZTU0ODQtYjdlYS00ODMzLWE0ODktNzc4ZDM4MWVjODcyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoic0JDbmpQYXZzeUNzZDdsY1c1aktiOWhNV1BHbnJMUzZiZVdKR3ZFS3VONmo4S1U5R2Q1OU16ME9iZFwvZTRBaTUifQ== 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/vhost_virtio_pmd_interrupt: 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: Wednesday, August 14, 2019 8:20 AM > To: dts@dpdk.org > Cc: Ma, LihongX > Subject: [dts] [PATCH V1] tests/vhost_virtio_pmd_interrupt: update code t= o > support trex >=20 > Signed-off-by: lihong > --- > tests/TestSuite_vhost_virtio_pmd_interrupt.py | 59 +++++++++++++++------= -- > ---- > 1 file changed, 33 insertions(+), 26 deletions(-) >=20 > diff --git a/tests/TestSuite_vhost_virtio_pmd_interrupt.py > b/tests/TestSuite_vhost_virtio_pmd_interrupt.py > index fbfcf32..41b2b41 100644 > --- a/tests/TestSuite_vhost_virtio_pmd_interrupt.py > +++ b/tests/TestSuite_vhost_virtio_pmd_interrupt.py > @@ -38,10 +38,11 @@ import utils > import time > from virt_common import VM > from test_case import TestCase > -from etgen import IxiaPacketGenerator > +from packet import Packet, save_packets from pktgen import > +PacketGeneratorHelper >=20 >=20 > -class TestVhostVirtioPmdInterrupt(TestCase, IxiaPacketGenerator): > +class TestVhostVirtioPmdInterrupt(TestCase): >=20 > def set_up_all(self): > """ > @@ -62,6 +63,13 @@ class TestVhostVirtioPmdInterrupt(TestCase, > IxiaPacketGenerator): > self.logger.info("Please comfirm the kernel of vm greater than 4= .8.0 " > "and enable vfio-noiommu in kernel") >=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. > @@ -74,25 +82,6 @@ class TestVhostVirtioPmdInterrupt(TestCase, > IxiaPacketGenerator): > self.vhost_user =3D self.dut.new_session(suite=3D"vhost-user") > self.vm_dut =3D None >=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) > - if self.fix_ip is False: > - self.add_tcl_cmd('ip config -destIpAddrMode ipRandom') > - else: > - self.add_tcl_cmd('ip config -destIpAddr "%s"' % dst) > - 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 get_core_list(self): > """ > get core list about testpmd > @@ -160,6 +149,7 @@ class TestVhostVirtioPmdInterrupt(TestCase, > IxiaPacketGenerator): > "-c %s -n 4 --log-level=3D'user1,7' -- -p 1 -P = " + \ > "--config '%s' --no-numa --parse-ptype " > command_line_client =3D command_client % (core_mask_l3fwd, > config_info) > + self.vm_dut.get_session_output(timeout=3D2) > self.vm_dut.send_expect(command_line_client, "POWER", 40) > time.sleep(10) > out =3D self.vm_dut.get_session_output() @@ -229,13 +219,30 @@ c= lass > TestVhostVirtioPmdInterrupt(TestCase, IxiaPacketGenerator): > self.verify(change =3D=3D self.queues, > "There has cores not change the status") >=20 > + def set_fields(self): > + """ > + set ip protocol field behavior > + """ > + fields_config =3D {'ip': {'dst': {'action': 'random'}, }, } > + return fields_config > + > def send_packets(self): > tgen_input =3D [] > - > self.tester.scapy_append('a=3D[Ether(dst=3D"%s")/IP(src=3D"0.240.74.101",= proto=3D25 > 5)/UDP()/("X"*18)]' % (self.dst_mac)) > - self.tester.scapy_append('wrpcap("interrupt.pcap", a)') > - self.tester.scapy_execute() > - tgen_input.append((self.tx_port, self.tx_port, "interrupt.pcap")= ) > - _, pps =3D self.tester.traffic_generator_throughput(tgen_input) > + if self.fix_ip is True: > + pkt =3D Packet(pkt_type=3D'UDP') > + else: > + pkt =3D Packet(pkt_type=3D'IP_RAW') > + pkt.config_layer('ether', {'dst': '%s' % self.dst_mac}) > + save_packets([pkt], "%s/interrupt.pcap" % self.out_path) > + tgen_input.append((self.tx_port, self.tx_port, "%s/interrupt.pca= p" % > self.out_path)) > + self.tester.pktgen.clear_streams() > + vm_config =3D self.set_fields() > + if self.fix_ip is True: > + vm_config =3D None > + 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) >=20 > def send_and_verify(self): > """ > -- > 2.7.4