From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 9CFA41B163 for ; Wed, 30 Jan 2019 07:18:36 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jan 2019 22:18:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,540,1539673200"; d="scan'208";a="110932411" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga007.jf.intel.com with ESMTP; 29 Jan 2019 22:18:35 -0800 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.408.0; Tue, 29 Jan 2019 22:18:34 -0800 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 29 Jan 2019 22:18:34 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.110]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.162]) with mapi id 14.03.0415.000; Wed, 30 Jan 2019 14:18:32 +0800 From: "Tu, Lijuan" To: "Yao, BingX Y" , "dts@dpdk.org" CC: "Yao, BingX Y" Thread-Topic: [dts] [PATCH V2] tests/uni_pkt:fix wrong pkt type Thread-Index: AQHUtH42YvktLdQ2yUOq/RynSv8va6XHXjfw Date: Wed, 30 Jan 2019 06:18:31 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BA1ED67@SHSMSX101.ccr.corp.intel.com> References: <1548400927-36417-1-git-send-email-bingx.y.yao@intel.com> In-Reply-To: <1548400927-36417-1-git-send-email-bingx.y.yao@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.400.15 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYmExODU4NDEtNWNlNC00YjFlLWJlMWItNjdjMzVmYmZiMTdhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiSENpeUhQZnc5VGttQk5Xck1rUHN1MjdPM3hudFRqdmg2WkRPcVVaZlFneGlXWDZzZnRhcWsrYkNkWDZXOXdERyJ9 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 V2] tests/uni_pkt:fix wrong pkt type 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: , X-List-Received-Date: Wed, 30 Jan 2019 06:18:37 -0000 Applied, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of yaobing > Sent: Friday, January 25, 2019 3:22 PM > To: dts@dpdk.org > Cc: Yao, BingX Y > Subject: [dts] [PATCH V2] tests/uni_pkt:fix wrong pkt type >=20 > 1. fix typos: SCT to SCTP >=20 > 2. fix wrong nic name: i350 to powerville >=20 > 3. IPv6_in_IPv4_tunnel support more nics >=20 > 4. pkt_type in GRE and IPv6_in_IPv4_tunnel: unified packet type flag not > match,update flags >=20 > 5. add run_nvgre_cope to generate IPV6 NVGRE SCTP and ICMP packets >=20 > Signed-off-by: yaobing > --- > tests/TestSuite_uni_pkt.py | 79 +++++++++++++++++++++++++------------- > 1 file changed, 52 insertions(+), 27 deletions(-) >=20 > diff --git a/tests/TestSuite_uni_pkt.py b/tests/TestSuite_uni_pkt.py inde= x > 17de58f..172c24d 100644 > --- a/tests/TestSuite_uni_pkt.py > +++ b/tests/TestSuite_uni_pkt.py > @@ -118,14 +118,14 @@ class TestUniPacket(TestCase): > if "fortville" in self.nic or "fortpark_TLV" in self.nic: > outerL4Type =3D "L4_NONFRAG" > ipv4_default_packet_type =3D ["L2_ETHER", "L3_IPV4_EXT_UNKNO= WN"] > - elif "niantic" in self.nic.lower() or "i350" in self.nic.lower()= or "cavium" in > self.nic.lower(): > + elif "niantic" in self.nic.lower() or "powerville" in self.nic.l= ower() or > "cavium" in self.nic.lower(): > outerL4Type =3D "" > ipv4_default_packet_type =3D ["L2_ETHER", "L3_IPV4"] > pktType =3D { > "MAC_IP_PKT": ipv4_default_packet_type + [out= erL4Type], > "MAC_IP_UDP_PKT": ipv4_default_packet_type + ["L4= _UDP"], > "MAC_IP_TCP_PKT": ipv4_default_packet_type + ["L4= _TCP"], > - "MAC_IP_SCTP_PKT": ipv4_default_packet_type + ["L4= _SCT"], > + "MAC_IP_SCTP_PKT": ipv4_default_packet_type + ["L4= _SCTP"], > "MAC_IP_ICMP_PKT": ipv4_default_packet_type + ["L4= _ICMP"], > "MAC_IPFRAG_TCP_PKT": ipv4_default_packet_type + ["L4= _FRAG"], > "MAC_IPihl_PKT": ["L2_ETHER", "L3_IPV4_EXT"], > @@ -136,7 +136,7 @@ class TestUniPacket(TestCase): > if "fortville" in self.nic or "fortpark_TLV" in self.nic: > pktType.pop("MAC_IPihl_PKT") > pktType.pop("MAC_IPihl_SCTP_PKT") > - elif "niantic" in self.nic.lower() or "i350" in self.nic.lower()= or "cavium" in > self.nic.lower(): > + elif "niantic" in self.nic.lower() or "powerville" in self.nic.l= ower() or > "cavium" in self.nic.lower(): > pktType.pop("MAC_IP_ICMP_PKT") > pktType.pop("MAC_IPFRAG_TCP_PKT") >=20 > @@ -149,7 +149,7 @@ class TestUniPacket(TestCase): > if "fortville" in self.nic or "fortpark_TLV" in self.nic: > outerL4Type =3D "L4_NONFRAG" > ipv6_default_packet_type =3D ["L2_ETHER", "L3_IPV6_EXT_UNKNO= WN"] > - elif "niantic" in self.nic.lower() or "i350" in self.nic.lower()= or "cavium" in > self.nic.lower(): > + elif "niantic" in self.nic.lower() or "powerville" in self.nic.l= ower() or > "cavium" in self.nic.lower(): > outerL4Type =3D "" > ipv6_default_packet_type =3D ["L2_ETHER", "L3_IPV6"] >=20 > @@ -164,7 +164,7 @@ class TestUniPacket(TestCase): > # delete the unsupported packet based on nic type > if "fortville" in self.nic or "fortpark_TLV" in self.nic: > pktType.pop("MAC_IPv6FRAG_PKT_N") > - elif "niantic" in self.nic.lower() or "i350" in self.nic.lower()= or "cavium" in > self.nic.lower(): > + elif "niantic" in self.nic.lower() or "powerville" in self.nic.l= ower() or > "cavium" in self.nic.lower(): > pktType.pop("MAC_IPv6FRAG_PKT_F") >=20 > self.run_test(pktType) > @@ -199,18 +199,19 @@ class TestUniPacket(TestCase): > def test_IPv6_in_IPv4_tunnel(self): > """ > checked that whether IPv4 in IPv6 tunnel packet can be normally > - detected by Niantic and i350. > + detected. > """ > - if "niantic" not in self.nic.lower() and "i350" not in self.nic.= lower(): > - return > + self.verify(self.nic in ["niantic", "fortville_eagle", "fortvill= e_spirit", > + "powerville", "fortpark_TLV", "fortville_25g"= , > + "fortville_spirit_single"], "not support %s" > + % self.nic) >=20 > pktType =3D { > - "MAC_IP_IPv6_PKT": ["L2_ETHER", "L3_IPV4", "TUNNE= L_IP", > "INNER"], > - "MAC_IP_IPv6EXT2_PKT": ["L2_ETHER", "L3_IPV4", "TUNNE= L_IP", > "INNER"], > - "MAC_IP_IPv6_UDP_PKT": ["L2_ETHER", "L3_IPV4", "TUNNE= L_IP", > "INNER"], > - "MAC_IP_IPv6_TCP_PKT": ["L2_ETHER", "L3_IPV4", "TUNNE= L_IP", > "INNER"], > - "MAC_IP_IPv6EXT2_UDP_PKT": ["L2_ETHER", "L3_IPV4", "TUNNE= L_IP", > "INNER"], > - "MAC_IP_IPv6EXT2_TCP_PKT": ["L2_ETHER", "L3_IPV4", "TUNNE= L_IP", > "INNER"] > + "MAC_IP_IPv6_PKT": ["L2_ETHER", "L3_IPV4", "TUNNE= L_IP", > "INNER_L3_IPV6"], > + "MAC_IP_IPv6EXT2_PKT": ["L2_ETHER", "L3_IPV4", "TUNNE= L_IP", > "INNER_L3_IPV6_EXT"], > + "MAC_IP_IPv6_UDP_PKT": ["L2_ETHER", "L3_IPV4", "TUNNE= L_IP", > "INNER_L3_IPV6", "INNER_L4_UDP"], > + "MAC_IP_IPv6_TCP_PKT": ["L2_ETHER", "L3_IPV4", "TUNNE= L_IP", > "INNER_L3_IPV6", "INNER_L4_TCP"], > + "MAC_IP_IPv6EXT2_UDP_PKT": ["L2_ETHER", "L3_IPV4", "TUNNE= L_IP", > "INNER_L3_IPV6_EXT", "INNER_L4_UDP"], > + "MAC_IP_IPv6EXT2_TCP_PKT": ["L2_ETHER", "L3_IPV4", "TUNNE= L_IP", > "INNER_L3_IPV6_EXT", "INNER_L4_TCP"] > } > self.run_test(pktType) >=20 > @@ -306,8 +307,6 @@ class TestUniPacket(TestCase): > "MAC_IPv6_NVGRE_MAC_IPv6_PKT": > nvgre_ipv6_default_packet_type + ["INNER_L4_NONFRAG"], > "MAC_IPv6_NVGRE_MAC_IPv6_UDP_PKT": > nvgre_ipv6_default_packet_type + ["INNER_L4_UDP"], > "MAC_IPv6_NVGRE_MAC_IPv6_TCP_PKT": > nvgre_ipv6_default_packet_type + ["INNER_L4_TCP"], > - "MAC_IPv6_NVGRE_MAC_IPv6_SCTP_PKT": > nvgre_ipv6_default_packet_type + ["INNER_L4_NONFRAG"], > - "MAC_IPv6_NVGRE_MAC_IPv6_ICMP_PKT": > nvgre_ipv6_default_packet_type + ["INNER_L4_NONFRAG"], > "MAC_IPv6_NVGRE_MAC_VLAN_IPFRAG_PKT": > nvgre_ipv4_vlan_packet_type + ["INNER_L4_FRAG"], > "MAC_IPv6_NVGRE_MAC_VLAN_IP_PKT": > nvgre_ipv4_vlan_packet_type + ["INNER_L4_NONFRAG"], > "MAC_IPv6_NVGRE_MAC_VLAN_IP_UDP_PKT": > nvgre_ipv4_vlan_packet_type + ["INNER_L4_UDP"], > @@ -318,28 +317,54 @@ class TestUniPacket(TestCase): > "MAC_IPv6_NVGRE_MAC_VLAN_IPv6_PKT": > nvgre_ipv6_vlan_packet_type + ["INNER_L4_NONFRAG"], > "MAC_IPv6_NVGRE_MAC_VLAN_IPv6_UDP_PKT": > nvgre_ipv6_vlan_packet_type + ["INNER_L4_UDP"], > "MAC_IPv6_NVGRE_MAC_VLAN_IPv6_TCP_PKT": > nvgre_ipv6_vlan_packet_type + ["INNER_L4_TCP"], > - > "MAC_IPv6_NVGRE_MAC_VLAN_IPv6_SCTP_PKT":nvgre_ipv6_vlan_packet_type > + ["INNER_L4_NONFRAG"], > - > "MAC_IPv6_NVGRE_MAC_VLAN_IPv6_ICMP_PKT":nvgre_ipv6_vlan_packet_typ > e + ["INNER_L4_NONFRAG"] > } >=20 > self.run_test(pkt_types) >=20 > + pkt_nvgre =3D [ > + > ["MAC_IPv6_NVGRE_MAC_IPv6_SCTP_PKT",nvgre_ipv6_default_packet_type + > ["INNER_L4_SCTP"], > + ['ether', 'ipv6', 'nvgre', 'inner_mac', 'inner_ip= v6', 'inner_sctp', > 'raw']], > + > ["MAC_IPv6_NVGRE_MAC_IPv6_ICMP_PKT",nvgre_ipv6_default_packet_type + > ["INNER_L4_ICMP"], > + ['ether', 'ipv6', 'nvgre', 'inner_mac', 'inner_ip= v6', 'inner_icmp', > 'raw']], > + > ["MAC_IPv6_NVGRE_MAC_VLAN_IPv6_SCTP_PKT",nvgre_ipv6_vlan_packet_typ > e + ["INNER_L4_SCTP"], > + ['ether', 'ipv6', 'nvgre', 'inner_mac', 'inner_vl= an', 'inner_ipv6', > 'inner_sctp', 'raw']], > + > ["MAC_IPv6_NVGRE_MAC_VLAN_IPv6_ICMP_PKT",nvgre_ipv6_vlan_packet_typ > e + ["INNER_L4_ICMP"], > + ['ether', 'ipv6', 'nvgre', 'inner_mac', 'inner_vl= an', 'inner_ipv6', > 'inner_icmp', 'raw']] > + ] > + self.run_nvgre_cope(pkt_nvgre) > + > + def run_nvgre_cope(self, pkt_nvgre): > + time.sleep(1) > + for pkts in pkt_nvgre: > + pkt =3D Packet() > + pkt.assign_layers(pkts[2]) > + if 'inner_icmp' in pkts[2]: > + pkt.config_layers([('ipv6',{'nh':47}), ('inner_ipv6', {'= nh': 58})]) > + else: > + pkt.config_layers([('ipv6',{'nh':47}),('inner_ipv6', {'n= h': 132})]) > + pkt.send_pkt(tx_port=3Dself.tester_iface) > + out =3D self.dut.get_session_output(timeout=3D2) > + for pkt_layer_name in pkts[1]: > + 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" % pkts[0]) > + > def test_GRE_tunnel(self): > """ > checked that whether GRE tunnel packet can be normally detected = by > Fortville. > """ > self.verify(("fortville" in self.nic or "fortpark_TLV" in self.n= ic), > "GRE tunnel packet type detect only support by Fortv= ille") > - IPv4_packet_type =3D [" L2_ETHER", " L3_IPV4_EXT_UNKNOWN", > "L4_NONFRAG"] > - > + base_packet_type =3D [" L2_ETHER", " L3_IPV4_EXT_UNKNOWN", > + "TUNNEL_GRENAT"] > pktType =3D { > - "MAC_IP_GRE_IPFRAG_PKT": IPv4_packet_type, > - "MAC_IP_GRE_IP_PKT": IPv4_packet_type, > - "MAC_IP_GRE_IP_UDP_PKT": IPv4_packet_type, > - "MAC_IP_GRE_IP_TCP_PKT": IPv4_packet_type, > - "MAC_IP_GRE_IP_SCTP_PKT": IPv4_packet_type, > - "MAC_IP_GRE_IP_ICMP_PKT": IPv4_packet_type, > - "MAC_IP_GRE_PKT": IPv4_packet_type > + "MAC_IP_GRE_IPFRAG_PKT": base_packet_type + > ["INNER_L3_IPV4_EXT_UNKNOWN", "INNER_L4_FRAG"], > + "MAC_IP_GRE_IP_PKT": base_packet_type + > ["INNER_L3_IPV4_EXT_UNKNOWN", "INNER_L4_NONFRAG"], > + "MAC_IP_GRE_IP_UDP_PKT": base_packet_type + > ["INNER_L3_IPV4_EXT_UNKNOWN", "INNER_L4_UDP"], > + "MAC_IP_GRE_IP_TCP_PKT": base_packet_type + > ["INNER_L3_IPV4_EXT_UNKNOWN", "INNER_L4_TCP"], > + "MAC_IP_GRE_IP_SCTP_PKT": base_packet_type + > ["INNER_L3_IPV4_EXT_UNKNOWN", "INNER_L4_SCTP"], > + "MAC_IP_GRE_IP_ICMP_PKT": base_packet_type + > ["INNER_L3_IPV4_EXT_UNKNOWN", "INNER_L4_ICMP"], > + "MAC_IP_GRE_PKT": base_packet_type > } > self.run_test(pktType) >=20 > -- > 2.17.2