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 8421FA00E6 for ; Tue, 6 Aug 2019 10:45:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7A81D1BDFD; Tue, 6 Aug 2019 10:45:43 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 70E3C1BDF5 for ; Tue, 6 Aug 2019 10:45:41 +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 orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Aug 2019 01:45:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,353,1559545200"; d="scan'208";a="164916555" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga007.jf.intel.com with ESMTP; 06 Aug 2019 01:45:36 -0700 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 6 Aug 2019 01:45:35 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 6 Aug 2019 01:45:35 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.80]) by shsmsx102.ccr.corp.intel.com ([169.254.2.19]) with mapi id 14.03.0439.000; Tue, 6 Aug 2019 16:45:32 +0800 From: "Tu, Lijuan" To: "Li, WenjieX A" , "dts@dpdk.org" CC: "Li, WenjieX A" Thread-Topic: [dts] [PATCH V1] tests/rxtx_offload: optimize script Thread-Index: AQHVTCv9AKVt+MPf4k6daPH4a/4JoKbtzjvA Date: Tue, 6 Aug 2019 08:45:32 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BAFD0DB@SHSMSX101.ccr.corp.intel.com> References: <1565110047-28991-1-git-send-email-wenjiex.a.li@intel.com> <1565110047-28991-2-git-send-email-wenjiex.a.li@intel.com> In-Reply-To: <1565110047-28991-2-git-send-email-wenjiex.a.li@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.0.600.7 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzIyNzhkZTUtZTE0NS00MWMzLTgwM2QtNWQwOTBhNWZjNWYwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoibUhWQk55V1hQRis3OGNXSTNNQWZJRVErT0VzdGVmZnpBRnRWUE85bDJSRUVyMEFBdDhrV3c5aGNMblZiUmVuWCJ9 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/rxtx_offload: optimize script 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 Wenjie Li > Sent: Wednesday, August 7, 2019 12:47 AM > To: dts@dpdk.org > Cc: Li, WenjieX A > Subject: [dts] [PATCH V1] tests/rxtx_offload: optimize script >=20 > optimize script: > 1. add more supportted nics > 2. check ports link status before send packets >=20 > --- > tests/TestSuite_rxtx_offload.py | 36 ++++++++++++++++++++++++--------- > 1 file changed, 27 insertions(+), 9 deletions(-) >=20 > diff --git a/tests/TestSuite_rxtx_offload.py b/tests/TestSuite_rxtx_offlo= ad.py > index bcef69d..a08e023 100644 > --- a/tests/TestSuite_rxtx_offload.py > +++ b/tests/TestSuite_rxtx_offload.py > @@ -87,8 +87,10 @@ class TestRxTx_Offload(TestCase): > Run at the start of each test suite. > New rx tx offload API Prerequisites > """ > + # Support i40e/ixgbe NICs > self.verify(self.nic in ["fortville_eagle", "fortville_spirit","= fortville_25g", > - "fortville_spirit_single", "niantic"], = "NIC Unsupported: " > + str(self.nic)) > + "fortville_spirit_single", "fortpark_TL= V", > + "niantic", "twinpond", "sagepond", > + "sageville"], "NIC Unsupported: " + str(self.nic)) > # Based on h/w type, choose how many ports to use > self.dut_ports =3D self.dut.get_ports(self.nic) > # Verify that enough ports are available @@ -116,6 +118,18 @@ cl= ass > TestRxTx_Offload(TestCase): > """ > pass >=20 > + > + def verify_link_up(self, max_delay=3D10): > + ports =3D self.dut.get_ports(self.nic) > + for port_id in range(len(ports)): > + out =3D self.dut.send_expect("show port info %s" % port_id, = "testpmd> > ") > + port_time_up =3D 0 > + while (port_time_up <=3D max_delay) and ("Link status: down"= in out): > + time.sleep(1) > + out =3D self.dut.send_expect("show port info %s" % port_= id, > "testpmd> ") > + port_time_up +=3D 1 > + self.verify("Link status: down" not in out, "Port %s Link > + down, please check your link" % port_id) > + > def check_port_capability(self, rxtx): > """ > Check capabilities. > @@ -147,6 +161,7 @@ class TestRxTx_Offload(TestCase): >=20 > result_config =3D self.dut.send_expect("port start 0", "testpmd>= ") > self.verify("Fail" not in result_config, "Fail to configure port= ") > + self.verify_link_up(20) >=20 > if rxtx =3D=3D "rx": > outstring =3D self.dut.send_expect("show port 0 rx_offload > configuration", "testpmd> ") @@ -173,6 +188,7 @@ class > TestRxTx_Offload(TestCase): >=20 > result_config =3D self.dut.send_expect("port start 0", "testpmd>= ") > self.verify("Fail" not in result_config, "Fail to configure port= ") > + self.verify_link_up(20) >=20 > acl_offloads =3D [] > if rxtx =3D=3D "rx": > @@ -204,6 +220,7 @@ class TestRxTx_Offload(TestCase): > Send packet and get the queue which packet enter. > """ > self.dut.send_expect("start", "testpmd> ") > + self.verify_link_up(20) > self.tester.scapy_foreground() > self.tester.scapy_append(packet) > self.tester.scapy_execute() > @@ -221,6 +238,7 @@ class TestRxTx_Offload(TestCase): > Sends packets and check the flag. > """ > self.dut.send_expect("start", "testpmd>") > + self.verify_link_up(20) > self.tester.scapy_foreground() > self.tester.scapy_append(packet) > self.tester.scapy_execute() > @@ -245,6 +263,7 @@ class TestRxTx_Offload(TestCase): > self.verify("Fail" not in result_config, "Fail to configure port= ") >=20 > self.dut.send_expect("start", "testpmd> ") > + self.verify_link_up(20) > self.tester.scapy_foreground() > self.tester.scapy_append(packet) > self.tester.scapy_execute() > @@ -369,8 +388,8 @@ class TestRxTx_Offload(TestCase): > """ > Set Rx offload by queue. > """ > - # Only support NNT > - self.verify(self.nic in ["niantic"], "%s nic not support rx offl= oad setting > by queue." % self.nic) > + # Only support ixgbe NICs > + self.verify(self.nic in ["niantic", "twinpond", "sagepond", > + "sageville"], "%s nic not support rx offload setting by queue." % > + self.nic) >=20 > self.pmdout.start_testpmd("%s" % self.cores, "--rxq=3D4 --txq=3D= 4") > self.dut.send_expect("set fwd rxonly", "testpmd> ") @@ -425,10 += 444,9 > @@ class TestRxTx_Offload(TestCase): > self.dut.send_expect("set fwd txonly", "testpmd> ") > self.dut.send_expect("set verbose 1", "testpmd> ") > if (self.nic in ["fortville_eagle", "fortville_spirit","fortvill= e_25g", > - "fortville_spirit_single"]): > + "fortville_spirit_single", "fortpark_TLV"]): > self.dut.send_expect("port stop 0", "testpmd> ") > self.dut.send_expect("port config 0 tx_offload mbuf_fast_fre= e off", > "testpmd> ") > - #self.dut.send_expect("port start 0", "testpmd> ") > self.check_port_config("tx", "NULL") > self.start_tcpdump(self.tester_itf0) > self.dut.send_expect("start", "testpmd> ") @@ -469,12 +487,12 @@ > class TestRxTx_Offload(TestCase): > "fortville_spirit_single", "fortpark_TLV"]): > self.dut.send_expect("port stop 0", "testpmd> ") > self.dut.send_expect("port config 0 tx_offload mbuf_fast_fre= e off", > "testpmd> ") > - self.dut.send_expect("port start 0", "testpmd> ") > offload =3D ["vlan_insert"] > self.check_port_config("tx", offload) > self.dut.send_expect("port stop 0", "testpmd> ") > self.dut.send_expect("tx_vlan set 0 1", "testpmd> ") > self.dut.send_expect("port start 0", "testpmd> ") > + self.verify_link_up(20) > self.start_tcpdump(self.tester_itf0) > self.dut.send_expect("start", "testpmd> ") > self.dut.send_expect("stop", "testpmd> ") @@ -531,7 +549,7 @@ cl= ass > TestRxTx_Offload(TestCase): > """ > self.pmdout.start_testpmd("%s" % self.cores, "--rxq=3D4 --txq=3D= 4") > capabilities =3D self.check_port_capability("tx") > - # Disable per queue capability first, if it is FVL. > + # Disable per queue capability first, if it is FVL/Fortpark. > if (self.nic in ["fortville_eagle", "fortville_spirit","fortvill= e_25g", > "fortville_spirit_single", "fortpark_TLV"]): > self.dut.send_expect("port stop 0", "testpmd> ") @@ -550,9 += 568,9 > @@ class TestRxTx_Offload(TestCase): > """ > Set Rx offload by queue. > """ > - # Only support FVL > + # Only support i40e NICs > self.verify(self.nic in ["fortville_eagle", "fortville_spirit","= fortville_25g", > - "fortville_spirit_single",], "%s nic no= t support rx offload > setting by queue." % self.nic) > + "fortville_spirit_single", > + "fortpark_TLV"], "%s nic not support rx offload setting by queue." % > + self.nic) > # Check offload configuration by port and by queue. > self.pmdout.start_testpmd("%s" % self.cores, "--rxq=3D4 --txq=3D= 4") > offload =3D ["mbuf_fast_free"] > -- > 2.17.1