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 41CC6A2EFC for ; Wed, 18 Sep 2019 12:35:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 37CD41C246; Wed, 18 Sep 2019 12:35:36 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 5E09F1C22E for ; Wed, 18 Sep 2019 12:35:34 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Sep 2019 03:35:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,520,1559545200"; d="scan'208";a="199008588" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga002.jf.intel.com with ESMTP; 18 Sep 2019 03:35:33 -0700 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 18 Sep 2019 03:35:32 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.92]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.146]) with mapi id 14.03.0439.000; Wed, 18 Sep 2019 18:35:30 +0800 From: "Tu, Lijuan" To: "pvukkisala@marvell.com" , "dts@dpdk.org" CC: "avijay@marvell.com" , "fmasood@marvell.com" Thread-Topic: [dts] [PATCH] ptype_mapping: Add support to run 'get test' on cavium devices Thread-Index: AQHVZxHeX35e/UMADkqpzmKI3PW4vKcxS2yw Date: Wed, 18 Sep 2019 10:35:29 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BB23DDE@SHSMSX101.ccr.corp.intel.com> References: <1568035421-32446-1-git-send-email-pvukkisala@marvell.com> In-Reply-To: <1568035421-32446-1-git-send-email-pvukkisala@marvell.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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZWRkNTJmMWQtNTY4MC00NzU0LTg1OGMtOTZjOTVkMDk1ZDYwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiWXZ1dm9SOGtHd1wvSitMT3NsbHlnWWZTb25WYlB3dFZiWENURXhKdlJidGZwOUYyYVR3VkZWakxJMjRtaHUzTlQifQ== 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] ptype_mapping: Add support to run 'get test' on cavium devices 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 > pvukkisala@marvell.com > Sent: Monday, September 9, 2019 9:24 PM > To: dts@dpdk.org > Cc: avijay@marvell.com; fmasood@marvell.com; Phanendra Vukkisala > > Subject: [dts] [PATCH] ptype_mapping: Add support to run 'get test' on > cavium devices >=20 > From: Phanendra Vukkisala >=20 > Modified commands and output according implementation for cavium > platform for cavium devices >=20 > Signed-off-by: Phanendra Vukkisala > --- > tests/TestSuite_ptype_mapping.py | 122 +++++++++++++++++++++++++------ > ------- > 1 file changed, 82 insertions(+), 40 deletions(-) >=20 > diff --git a/tests/TestSuite_ptype_mapping.py > b/tests/TestSuite_ptype_mapping.py > index d7af657..8b8306c 100644 > --- a/tests/TestSuite_ptype_mapping.py > +++ b/tests/TestSuite_ptype_mapping.py > @@ -45,21 +45,23 @@ class TestPtype_Mapping(TestCase): > Run at the start of each test suite. > """ > self.verify(self.nic in ['fortville_eagle', 'fortville_spirit', > - 'fortville_spirit_single', 'fortville_25g', 'fortpark_TLV', = 'carlsville'], > + 'fortville_spirit_single', 'fortville_25g', 'fortpark_TLV', = 'carlsville', > 'cavium_a063', 'cavium_a064'], > 'ptype mapping test can not support %s nic' % self.nic) > ports =3D self.dut.get_ports() > - self.verify(len(ports) >=3D 1, "Insufficient ports for testing") > + self.verify(len(ports) >=3D 1, "Insufficient ports for testing") > valports =3D [_ for _ in ports if self.tester.get_local_port(_) = !=3D -1] > self.dut_port =3D valports[0] > tester_port =3D self.tester.get_local_port(self.dut_port) > self.tester_iface =3D self.tester.get_interface(tester_port) > - self.dut.send_expect("sed -i -e '" +\ > - "/printf(\" - VLAN tci=3D0x%x\", mb->vlan_tci);" +\ > - "/a\\\\t\\tprintf(\" - pktype: 0x%x\", mb->packet_type);'" += \ > - " app/test-pmd/util.c", "# ", 30, verify =3D True) >=20 > - self.dut.build_install_dpdk(self.dut.target) > - > + if self.nic not in ["cavium_a063", "cavium_a064"]: > + self.dut.send_expect("sed -i -e '" +\ > + "/printf(\" - VLAN tci=3D0x%x\", mb->vlan_tci);" +\ > + "/a\\\\t\\tprintf(\" - pktype: 0x%x\", mb->packet_type);= '" +\ > + " app/test-pmd/util.c", "# ", 30, verify =3D True) > + > + self.dut.build_install_dpdk(self.dut.target) > + >=20 > def set_up(self): > """ > @@ -83,16 +85,17 @@ class TestPtype_Mapping(TestCase): > else: > pkt_names =3D pkt_types[pkt_type] > pkt =3D Packet(pkt_type=3Dpkt_type) > - pkt.send_pkt(tx_port=3Dself.tester_iface) > + pkt.send_pkt(tx_port=3Dself.tester_iface,count=3D4) > out =3D self.dut.get_session_output(timeout=3D2) > - self.verify(sw_ptype in out, > - "Failed to detect correct ptype value") > + if sw_ptype !=3D None: > + self.verify(sw_ptype in out, > + "Failed to detect correct ptype value") > for pkt_layer_name in pkt_names: > if pkt_layer_name not in out: > print utils.RED("Fail to detect %s" % pkt_layer_name= ) > raise VerifyFailure("Failed to detect %s" % pkt_laye= r_name) > print utils.GREEN("Detected %s successfully" % pkt_type) > - > + > def strip_ptype(self, table, hw_ptype): > """ > Strip software packet type from packet mapping table. > @@ -113,35 +116,73 @@ class TestPtype_Mapping(TestCase): > """ > Get ptype mapping table and run ptype test. > """ > - out =3D self.dut_testpmd.execute_cmd('ptype mapping get 0 0') > - time.sleep(3) > - self.verify("255" in out, > - "Failed to get 255 items ptype mapping table!!!") > - out =3D self.dut_testpmd.execute_cmd('ptype mapping get 0 1') > - time.sleep(3) > - self.verify("166" in out, > - "Failed to get 166 items ptype mapping table!!!") > - sw_ptype =3D self.strip_ptype(out, hw_ptype) > - if hw_ptype =3D=3D 38: > + if self.nic in ["cavium_a063", "cavium_a064"]: > + out =3D self.dut_testpmd.execute_cmd('show port 0 ptypes') > + ptype_list =3D ["L2_ETHER", "L3_IPV4", "INNER_L3_IPV6", > "INNER_L4_UDP", "TUNNEL_GRE", "TUNNEL_NVGRE", "TUNNEL_GENEVE", > "TUNNEL_VXLAN"] > + for ptype in ptype_list : > + self.verify( ptype in out, "Failed to get ptype: %s"%(pt= ype)) > pktType =3D { > - "MAC_IP_IPv6_UDP_PKT": > - ["L2_ETHER", "L3_IPV4_EXT_UNKNOWN", > - "TUNNEL_IP", "INNER_L3_IPV6_EXT_UNKNOWN", > + "MAC_IP_IPv6_UDP_PKT": > + ["L2_ETHER", "L3_IPV4", > + "TUNNEL_IP", "INNER_L3_IPV6", > "INNER_L4_UDP"] > } > - elif hw_ptype =3D=3D 75: > + self.run_test(None, pktType, check_ptype) > pktType =3D { > - "MAC_IP_NVGRE_MAC_VLAN_IP_PKT": > - ["L2_ETHER", "L3_IPV4_EXT_UNKNOWN", > - "TUNNEL_GRENAT", "INNER_L2_ETHER_VLAN", > - "INNER_L3_IPV4_EXT_UNKNOWN", "INNER_L4_NONFRAG"] > - } > - self.run_test(sw_ptype, pktType, check_ptype) > - > + "MAC_IP_NVGRE_MAC_VLAN_IP_UDP_PKT": > + ["L2_ETHER", "L3_IPV4", > + "TUNNEL_NVGRE", "INNER_L2_ETHER_VLAN", > + "INNER_L3_IPV4", "INNER_L4_UDP"] > + } > + self.run_test(None, pktType, check_ptype) > + pktType =3D { > + "MAC_IP_UDP_VXLAN_MAC_IP_UDP_PKT": > + ["L2_ETHER", "L3_IPV4", > + "TUNNEL_VXLAN", > + "INNER_L3_IPV4", "INNER_L4_UDP"] > + } > + self.run_test(None, pktType, check_ptype) > + pktType =3D { > + "MAC_IP_UDP_GENEVE_MAC_IP_UDP_PKT": > + ["L2_ETHER", "L3_IPV4", > + "TUNNEL_GENEVE", > + "INNER_L3_IPV4", "INNER_L4_UDP"] > + } > + self.run_test(None, pktType, check_ptype) > + else: > + out =3D self.dut_testpmd.execute_cmd('ptype mapping get 0 0'= ) > + time.sleep(3) > + self.verify("255" in out, > + "Failed to get 255 items ptype mapping table!!!") > + out =3D self.dut_testpmd.execute_cmd('ptype mapping get 0 1'= ) > + time.sleep(3) > + self.verify("166" in out, > + "Failed to get 166 items ptype mapping table!!!") > + sw_ptype =3D self.strip_ptype(out, hw_ptype) > + sw_ptype =3D None > + if hw_ptype =3D=3D 38: > + pktType =3D { > + "MAC_IP_IPv6_UDP_PKT": > + ["L2_ETHER", "L3_IPV4_EXT_UNKNOWN", > + "TUNNEL_IP", "INNER_L3_IPV6_EXT_UNKNOWN", > + "INNER_L4_UDP"] > + } > + elif hw_ptype =3D=3D 75: > + pktType =3D { > + "MAC_IP_NVGRE_MAC_VLAN_IP_UDP_PKT": > + ["L2_ETHER", "L3_IPV4_EXT_UNKNOWN", > + "TUNNEL_GRENAT", "INNER_L2_ETHER_VLAN", > + "INNER_L3_IPV4_EXT_UNKNOWN", "INNER_L4_NONFRAG"= ] > + } > + self.run_test(sw_ptype, pktType, check_ptype) > + > def ptype_mapping_test(self, check_ptype =3D None): > - > - self.run_ptype_test(hw_ptype =3D 38, check_ptype =3D check_ptype= ) > - self.run_ptype_test(hw_ptype =3D 75, check_ptype =3D check_ptype= ) > + > + if self.nic in ["cavium_a063", "cavium_a064"]: > + self.run_ptype_test(hw_ptype =3D None, check_ptype =3D check= _ptype) > + else: > + self.run_ptype_test(hw_ptype =3D 38, check_ptype =3D check_p= type) > + self.run_ptype_test(hw_ptype =3D 75, check_ptype =3D check_p= type) >=20 >=20 > def test_ptype_mapping_get(self): > @@ -149,7 +190,7 @@ class TestPtype_Mapping(TestCase): > Get hardware defined ptype to software defined ptype mapping ite= ms. > """ > self.ptype_mapping_test() > - > + > def test_ptype_mapping_reset(self): > """ > Reset packet mapping table after changing table. > @@ -230,7 +271,8 @@ class TestPtype_Mapping(TestCase): > """ > Run after each test suite. > """ > - self.dut.send_expect("sed -i '/printf(\" - pktype: 0x%x\", " +\ > - "mb->packet_type);/d' app/test-pmd/util.c", "# ", 30, verify= =3D True) > - self.dut.build_install_dpdk(self.dut.target) > + if self.nic not in ["cavium_a063", "cavium_a064"]: > + self.dut.send_expect("sed -i '/printf(\" - pktype: 0x%x\", "= +\ > + "mb->packet_type);/d' app/test-pmd/util.c", "# ", 30, ve= rify =3D True) > + self.dut.build_install_dpdk(self.dut.target) > self.dut.kill_all() > -- > 1.7.9.5