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 2FC7BA052B; Fri, 31 Jul 2020 03:24:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E827F2862; Fri, 31 Jul 2020 03:24:31 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 657F311A2 for ; Fri, 31 Jul 2020 03:24:30 +0200 (CEST) IronPort-SDR: 38ynX1PagJuc+xTdF8CXh4JrjJSWq9FePChepyXm2Pm0KnHN4xKLU5CDBoKyd2VDEue1UZ2QRl XZYDUuCBtSWg== X-IronPort-AV: E=McAfee;i="6000,8403,9698"; a="139277985" X-IronPort-AV: E=Sophos;i="5.75,416,1589266800"; d="scan'208";a="139277985" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jul 2020 18:24:29 -0700 IronPort-SDR: VmwhTHanq01nQWfHi5flA3oO1sI2wS+LtZV6FqT5EBu7R1AEJxvdpa2SL1wQAILb7Dqc0Xw0/I dCrVF8tswA2Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,416,1589266800"; d="scan'208";a="291072644" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga006.jf.intel.com with ESMTP; 30 Jul 2020 18:24:29 -0700 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 30 Jul 2020 18:24:28 -0700 Received: from cdsmsx101.ccr.corp.intel.com (172.17.3.36) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 30 Jul 2020 18:24:28 -0700 Received: from cdsmsx102.ccr.corp.intel.com ([169.254.2.201]) by CDSMSX101.ccr.corp.intel.com ([169.254.1.153]) with mapi id 14.03.0439.000; Fri, 31 Jul 2020 09:24:24 +0800 From: "Huang, ZhiminX" To: "Zhao1, Wei" , "dev@dpdk.org" CC: "Zhang, Qi Z" , "Zhao1, Wei" Thread-Topic: [dpdk-dev] [PATCH v2] net/ice: fix FDIR GTPU rule create fail Thread-Index: AQHWZld6g4vNGylkHkS08t9DAvjIOakg5aQQ Date: Fri, 31 Jul 2020 01:24:23 +0000 Message-ID: <1DCDE90B92229844B9E6C0E67C1C8D6B046EADC8@CDSMSX102.ccr.corp.intel.com> References: <20200730083034.21616-1-wei.zhao1@intel.com> <20200730092801.31771-1-wei.zhao1@intel.com> In-Reply-To: <20200730092801.31771-1-wei.zhao1@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.17.6.105] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] net/ice: fix FDIR GTPU rule create fail X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Tested-by: Huang, ZhiminX Regards, HuangZhiMin -----Original Message----- From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wei Zhao Sent: Thursday, July 30, 2020 5:28 PM To: dev@dpdk.org Cc: Zhang, Qi Z ; Zhao1, Wei Subject: [dpdk-dev] [PATCH v2] net/ice: fix FDIR GTPU rule create fail For GTPU rule without extend header the trainning packet for FDIR is differ= ent. This patch enable these case. Fixes: 934fd00c9389 ("net/ice/base: fix GTPU IP hash") Signed-off-by: Wei Zhao --- drivers/net/ice/base/ice_fdir.c | 63 +++++++++++++++++++++++- drivers/net/ice/base/ice_type.h | 2 + drivers/net/ice/ice_fdir_filter.c | 80 +++++++++++++------------------ 3 files changed, 97 insertions(+), 48 deletions(-) diff --git a/drivers/net/ice/base/ice_fdir.c b/drivers/net/ice/base/ice_fdi= r.c index 2c47fb57b..a904ff513 100644 --- a/drivers/net/ice/base/ice_fdir.c +++ b/drivers/net/ice/base/ice_fdir.c @@ -89,6 +89,37 @@ static const u8 ice_fdir_icmp4_gtpu4_pkt[] =3D { }; =20 static const u8 ice_fdir_ipv4_gtpu4_pkt[] =3D { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x44, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x08, 0x68, 0x08, 0x68, 0x00, 0x00, + 0x00, 0x00, 0x33, 0xff, 0x00, 0x20, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x45, 0x00, + 0x00, 0x14, 0x00, 0x00, 0x40, 0x00, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, +}; + +static const u8 ice_fdir_ipv6_gtpu6_pkt[] =3D { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x44, 0x11, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x44, 0x7f, 0xed, 0x33, 0xff, + 0x00, 0x34, 0x12, 0x34, 0x56, 0x78, 0x00, 0x00, + 0x00, 0x85, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3b, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, +}; + +static const u8 ice_fdir_ipv4_gtpu4_eh_pkt[] =3D { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, 0x00, 0x44, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, @@ -102,7 +133,7 @@ stati= c const u8 ice_fdir_ipv4_gtpu4_pkt[] =3D { 0x00, 0x00, }; =20 -static const u8 ice_fdir_ipv6_gtpu6_pkt[] =3D { +static const u8 ice_fdir_ipv6_gtpu6_eh_pkt[] =3D { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, 0x00, 0x00, 0x00, 0x44, 0x11, 0x40, 0x00, 0x00, @@ -492,6 +523,20 @@ stat= ic const struct ice_fdir_base_pkt ice_fdir_pkt[] =3D { sizeof(ice_fdir_ipv6_gtpu6_pkt), ice_fdir_ipv6_gtpu6_pkt, }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV4_OTHER, + sizeof(ice_fdir_ipv4_gtpu4_eh_pkt), + ice_fdir_ipv4_gtpu4_eh_pkt, + sizeof(ice_fdir_ipv4_gtpu4_eh_pkt), + ice_fdir_ipv4_gtpu4_eh_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_GTPU_EH_IPV6_OTHER, + sizeof(ice_fdir_ipv6_gtpu6_eh_pkt), + ice_fdir_ipv6_gtpu6_eh_pkt, + sizeof(ice_fdir_ipv6_gtpu6_eh_pkt), + ice_fdir_ipv6_gtpu6_eh_pkt, + }, { ICE_FLTR_PTYPE_NONF_IPV4_L2TPV3, sizeof(ice_fdir_ipv4_l2tpv3_pkt), ice_fdir_ipv4_l2tpv3_pkt, @@ -1053,6 += 1098,14 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_flt= r *input, case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_TCP: case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_ICMP: case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER: + ice_pkt_insert_u32(loc, ICE_IPV4_DST_ADDR_OFFSET, + input->ip.v4.src_ip); + ice_pkt_insert_u32(loc, ICE_IPV4_SRC_ADDR_OFFSET, + input->ip.v4.dst_ip); + ice_pkt_insert_u32(loc, ICE_IPV4_GTPU_TEID_OFFSET, + input->gtpu_data.teid); + break; + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV4_OTHER: ice_pkt_insert_u32(loc, ICE_IPV4_DST_ADDR_OFFSET, input->ip.v4.src_ip); ice_pkt_insert_u32(loc, ICE_IPV4_SRC_ADDR_OFFSET, @@ -1063,6 +1116,14 @@= ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input, input->gtpu_data.qfi); break; case ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER: + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_DST_ADDR_OFFSET, + input->ip.v6.src_ip); + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_SRC_ADDR_OFFSET, + input->ip.v6.dst_ip); + ice_pkt_insert_u32(loc, ICE_IPV6_GTPU_TEID_OFFSET, + input->gtpu_data.teid); + break; + case ICE_FLTR_PTYPE_NONF_IPV6_GTPU_EH_IPV6_OTHER: ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_DST_ADDR_OFFSET, input->ip.v6.src_ip); ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_SRC_ADDR_OFFSET, diff --git a/dri= vers/net/ice/base/ice_type.h b/drivers/net/ice/base/ice_type.h index c13cd7= b00..3775689a9 100644 --- a/drivers/net/ice/base/ice_type.h +++ b/drivers/net/ice/base/ice_type.h @@ -297,6 +297,8 @@ enum ice_fltr_ptype { ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_ICMP, ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER, ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER, + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV4_OTHER, + ICE_FLTR_PTYPE_NONF_IPV6_GTPU_EH_IPV6_OTHER, ICE_FLTR_PTYPE_NONF_IPV4_L2TPV3, ICE_FLTR_PTYPE_NONF_IPV6_L2TPV3, ICE_FLTR_PTYPE_NONF_IPV4_ESP, diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_f= ilter.c index 745d7291a..c59fe46b9 100644 --- a/drivers/net/ice/ice_fdir_filter.c +++ b/drivers/net/ice/ice_fdir_filter.c @@ -778,30 +778,15 @@ ice_fdir_cross_prof_conflict(struct ice_pf *pf, goto err; break; case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER: - cflct_ptype =3D ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER; + cflct_ptype =3D ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_UDP; if (!ice_fdir_prof_resolve_conflict (pf, cflct_ptype, is_tunnel)) goto err; - cflct_ptype =3D ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER; + cflct_ptype =3D ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_TCP; if (!ice_fdir_prof_resolve_conflict (pf, cflct_ptype, is_tunnel)) goto err; - cflct_ptype =3D ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER; - if (!ice_fdir_prof_resolve_conflict - (pf, cflct_ptype, is_tunnel)) - goto err; - break; - /* IPv6 GTPU */ - case ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER: - cflct_ptype =3D ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER; - if (!ice_fdir_prof_resolve_conflict - (pf, cflct_ptype, is_tunnel)) - goto err; - cflct_ptype =3D ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER; - if (!ice_fdir_prof_resolve_conflict - (pf, cflct_ptype, is_tunnel)) - goto err; - cflct_ptype =3D ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER; + cflct_ptype =3D ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_ICMP; if (!ice_fdir_prof_resolve_conflict (pf, cflct_ptype, is_tunnel)) goto err; @@ -1025,30 +1010,26 @@ ice_fdir_input_set_conf(struct ice_pf *pf, enum ice= _fltr_ptype flow, case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_TCP: case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_ICMP: case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER: - if (ttype =3D=3D ICE_FDIR_TUNNEL_TYPE_GTPU) - ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_GTPU_IP | - ICE_FLOW_SEG_HDR_IPV4 | - ICE_FLOW_SEG_HDR_IPV_OTHER); - else if (ttype =3D=3D ICE_FDIR_TUNNEL_TYPE_GTPU_EH) - ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_GTPU_EH | - ICE_FLOW_SEG_HDR_GTPU_IP | - ICE_FLOW_SEG_HDR_IPV4 | - ICE_FLOW_SEG_HDR_IPV_OTHER); - else - PMD_DRV_LOG(ERR, "not supported tunnel type."); + ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_GTPU_IP | + ICE_FLOW_SEG_HDR_IPV4 | + ICE_FLOW_SEG_HDR_IPV_OTHER); + break; + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV4_OTHER: + ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_GTPU_EH | + ICE_FLOW_SEG_HDR_GTPU_IP | + ICE_FLOW_SEG_HDR_IPV4 | + ICE_FLOW_SEG_HDR_IPV_OTHER); break; case ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER: - if (ttype =3D=3D ICE_FDIR_TUNNEL_TYPE_GTPU) - ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_GTPU_IP | - ICE_FLOW_SEG_HDR_IPV6 | - ICE_FLOW_SEG_HDR_IPV_OTHER); - else if (ttype =3D=3D ICE_FDIR_TUNNEL_TYPE_GTPU_EH) - ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_GTPU_EH | - ICE_FLOW_SEG_HDR_GTPU_IP | - ICE_FLOW_SEG_HDR_IPV6 | - ICE_FLOW_SEG_HDR_IPV_OTHER); - else - PMD_DRV_LOG(ERR, "not supported tunnel type."); + ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_GTPU_IP | + ICE_FLOW_SEG_HDR_IPV6 | + ICE_FLOW_SEG_HDR_IPV_OTHER); + break; + case ICE_FLTR_PTYPE_NONF_IPV6_GTPU_EH_IPV6_OTHER: + ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_GTPU_EH | + ICE_FLOW_SEG_HDR_GTPU_IP | + ICE_FLOW_SEG_HDR_IPV6 | + ICE_FLOW_SEG_HDR_IPV_OTHER); break; case ICE_FLTR_PTYPE_NON_IP_L2: ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_ETH_NON_IP); @@ -2007,13 +1988,1= 8 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad, } } =20 - if (tunnel_type =3D=3D ICE_FDIR_TUNNEL_TYPE_GTPU || - tunnel_type =3D=3D ICE_FDIR_TUNNEL_TYPE_GTPU_EH) { - if (flow_type =3D=3D ICE_FLTR_PTYPE_NONF_IPV4_UDP) - flow_type =3D ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER; - else - flow_type =3D ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER; - } + if (tunnel_type =3D=3D ICE_FDIR_TUNNEL_TYPE_GTPU && + flow_type =3D=3D ICE_FLTR_PTYPE_NONF_IPV4_UDP) + flow_type =3D ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER; + else if (tunnel_type =3D=3D ICE_FDIR_TUNNEL_TYPE_GTPU_EH && + flow_type =3D=3D ICE_FLTR_PTYPE_NONF_IPV4_UDP) + flow_type =3D ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV4_OTHER; + else if (tunnel_type =3D=3D ICE_FDIR_TUNNEL_TYPE_GTPU && + flow_type =3D=3D ICE_FLTR_PTYPE_NONF_IPV6_UDP) + flow_type =3D ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER; + else if (tunnel_type =3D=3D ICE_FDIR_TUNNEL_TYPE_GTPU_EH && + flow_type =3D=3D ICE_FLTR_PTYPE_NONF_IPV4_UDP) + flow_type =3D ICE_FLTR_PTYPE_NONF_IPV6_GTPU_EH_IPV6_OTHER; =20 filter->tunnel_type =3D tunnel_type; filter->input.flow_type =3D flow_type; -- 2.19.1