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 DE6FFA2EFC for ; Fri, 20 Sep 2019 08:29:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A042F1F2C7; Fri, 20 Sep 2019 08:29:06 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id AFAA81F2C5 for ; Fri, 20 Sep 2019 08:29:04 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 23:29:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,527,1559545200"; d="scan'208";a="181718654" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga008.jf.intel.com with ESMTP; 19 Sep 2019 23:29:03 -0700 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 19 Sep 2019 23:29:02 -0700 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 19 Sep 2019 23:29:02 -0700 Received: from shsmsx153.ccr.corp.intel.com (10.239.6.53) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 19 Sep 2019 23:29:02 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.92]) by SHSMSX153.ccr.corp.intel.com ([169.254.12.235]) with mapi id 14.03.0439.000; Fri, 20 Sep 2019 14:29:00 +0800 From: "Tu, Lijuan" To: "Ma, LihongX" , "dts@dpdk.org" CC: "Ma, LihongX" Thread-Topic: [dts] [PATCH V1] tests/virtio_event_idx_interrupt: update code to support trex Thread-Index: AQHVbE0CzXdsPnR95EeaUQJH4niB/Kc0IL5g Date: Fri, 20 Sep 2019 06:29:00 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BB24C3E@SHSMSX101.ccr.corp.intel.com> References: <1568583926-6050-1-git-send-email-lihongx.ma@intel.com> In-Reply-To: <1568583926-6050-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZmEzYTg5NjAtYzYzYy00NTVmLTlhOTMtM2MzMGQ3NDZhOWE4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoid0ZoMzh4cVV3SzAwelk5eEpIU2tOK0dvc29lemp2eE50dXcrVXFcL250VXFYYTVUbkl5S3oyWDBwZzRtajN0RlIifQ== 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/virtio_event_idx_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" Applying: tests/virtio_event_idx_interrupt: update code to support trex error: patch failed: tests/TestSuite_virtio_event_idx_interrupt.py:59 > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of lihong > Sent: Monday, September 16, 2019 5:45 AM > To: dts@dpdk.org > Cc: Ma, LihongX > Subject: [dts] [PATCH V1] tests/virtio_event_idx_interrupt: update code t= o > support trex >=20 > Signed-off-by: lihong > --- > tests/TestSuite_virtio_event_idx_interrupt.py | 43 ++++++++++++---------= ------ > 1 file changed, 19 insertions(+), 24 deletions(-) >=20 > diff --git a/tests/TestSuite_virtio_event_idx_interrupt.py > b/tests/TestSuite_virtio_event_idx_interrupt.py > index acaa18a..3ce7b46 100644 > --- a/tests/TestSuite_virtio_event_idx_interrupt.py > +++ b/tests/TestSuite_virtio_event_idx_interrupt.py > @@ -40,10 +40,10 @@ import thread > import re > from virt_common import VM > from test_case import TestCase > -from etgen import IxiaPacketGenerator > +from pktgen import PacketGeneratorHelper >=20 >=20 > -class TestVirtioIdxInterrupt(TestCase, IxiaPacketGenerator): > +class TestVirtioIdxInterrupt(TestCase): >=20 > def set_up_all(self): > """ > @@ -59,6 +59,14 @@ class TestVirtioIdxInterrupt(TestCase, > IxiaPacketGenerator): > =3D=3D self.ports_socket]) > self.mem_channels =3D self.dut.get_memory_channels() > self.dst_mac =3D self.dut.get_mac_address(self.dut_ports[0]) > + self.pf_pci =3D self.dut.ports_info[0]['pci'] > + > + 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() >=20 > def set_up(self): > """ > @@ -71,23 +79,6 @@ class TestVirtioIdxInterrupt(TestCase, > IxiaPacketGenerator): > self.dut.send_expect("rm -rf ./vhost-net*", "#") > self.vhost =3D self.dut.new_session(suite=3D"vhost") >=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 get_core_mask(self): > self.core_config =3D "1S/%dC/1T" % (self.nb_cores + 1) > self.verify(self.cores_num >=3D (self.nb_cores + 1), @@ -102,11 = +93,11 > @@ class TestVirtioIdxInterrupt(TestCase, IxiaPacketGenerator): > """ > # get the core mask depend on the nb_cores number > self.get_core_mask() > - command_line =3D self.dut.target + "/app/testpmd -c %s -n %d " += \ > + command_line =3D self.dut.target + "/app/testpmd -c %s -n %d -w > + %s " + \ > "--socket-mem 2048,2048 --legacy-mem --file-prefix=3Dvho= st " + \ > "--vdev 'net_vhost,iface=3Dvhost-net,queues=3D%d' -- -i = " + \ > "--nb-cores=3D%d --txd=3D1024 --rxd=3D1024 --rxq=3D%d --= txq=3D%d" > - command_line =3D command_line % (self.core_mask, self.mem_channe= ls, > + command_line =3D command_line % (self.core_mask, > + self.mem_channels, self.pf_pci, > self.queues, self.nb_cores, self.queues, self.qu= eues) > self.vhost.send_expect(command_line, "testpmd> ", 30) > self.vhost.send_expect("start", "testpmd> ", 30) @@ -155,11 +146= ,15 > @@ class TestVirtioIdxInterrupt(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=3D25 > 5)/UDP()/("X"*18)]' % (self.dst_mac)) > - self.tester.scapy_append('wrpcap("interrupt.pcap", a)') > + self.tester.scapy_append('wrpcap("%s/interrupt.pcap", a)' % > + self.out_path) > self.tester.scapy_execute() >=20 > - tgen_input.append((port, port, "interrupt.pcap")) > - _, self.flag =3D self.tester.traffic_generator_throughput(tgen_i= nput, > delay=3Ddelay) > + tgen_input.append((port, port, "%s/interrupt.pcap" % self.out_pa= th)) > + self.tester.pktgen.clear_streams() > + fields_config =3D {'ip': {'dst': {'action': 'random'}, }, } > + streams =3D > self.pktgen_helper.prepare_stream_from_tginput(tgen_input, 1, > fields_config, self.tester.pktgen) > + traffic_opt =3D {'delay': 5, 'duration': delay, 'rate': 1} > + _, self.flag =3D > + self.tester.pktgen.measure_throughput(stream_ids=3Dstreams, > + options=3Dtraffic_opt) >=20 > def check_packets_after_reload_virtio_device(self, reload_times): > """ > -- > 2.7.4