From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 006D0A034F for ; Wed, 16 Jun 2021 03:21:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EB290410ED; Wed, 16 Jun 2021 03:21:18 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id E71F540140; Wed, 16 Jun 2021 03:21:15 +0200 (CEST) IronPort-SDR: GwwCSS55vD0GvDxs8sCoH/LpB3FbFu5u4We6Gs6m4/ZxNUQ/sbSiuD3v7kTucbEnVP94IfiI1w ayCBbjYumfAg== X-IronPort-AV: E=McAfee;i="6200,9189,10016"; a="227583132" X-IronPort-AV: E=Sophos;i="5.83,276,1616482800"; d="scan'208";a="227583132" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2021 18:21:14 -0700 IronPort-SDR: 6W9GHcZ3mx/RxI4R0YBEHm3eKQ989dM4Wput/cL4jgA7bhbmtTxn7QmgTGTYHaAD1UlxHTGXxb MQo/cSGinTtQ== X-IronPort-AV: E=Sophos;i="5.83,276,1616482800"; d="scan'208";a="450447825" Received: from unknown (HELO localhost.localdomain) ([10.240.183.93]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2021 18:21:12 -0700 From: dapengx.yu@intel.com To: Qiming Yang , Qi Zhang Cc: dev@dpdk.org, junfeng.guo@intel.com, zhirun.yan@intel.com, Dapeng Yu , stable@dpdk.org Date: Wed, 16 Jun 2021 09:20:53 +0800 Message-Id: <20210616012053.201105-2-dapengx.yu@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210616012053.201105-1-dapengx.yu@intel.com> References: <20210616012053.201105-1-dapengx.yu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH 2/2] net/ice: fix VXLAN flow director creation error X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" From: Dapeng Yu In original implementation, error returned when creating VXLAN flow director with SCTP or TCP as layer 4 protocol of inner segment. There are several root causes for the error: 1. ice_fdir_input_set_hdrs() set ICE_FLOW_SEG_HDR_UDP into protocol header flag of inner segment of VXLAN FDIR rule, even if it shall be ICE_FLOW_SEG_HDR_TCP or ICE_FLOW_SEG_HDR_SCTP 2. ice_fdir_input_set_hdrs() set ICE_FLOW_SEG_HDR_VXLAN into protocol header flag of segments of VXLAN FDIR rule, it not necessary, and can be set automatically by ice_flow_set_fld() later 3. flow type: ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN hides the flow type of inner segment of VXLAN FDIR rule, then further causes function: ice_fdir_get_gen_prgm_pkt() cannot write correct protocol id into inner segment of training packet. This patch fixes those defects described above. Fixes: 855d23a07b36 ("net/ice: support VXLAN VNI field in flow director") Cc: stable@dpdk.org Signed-off-by: Dapeng Yu --- drivers/net/ice/ice_fdir_filter.c | 47 ++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c index 092c704503..29128c5e1b 100644 --- a/drivers/net/ice/ice_fdir_filter.c +++ b/drivers/net/ice/ice_fdir_filter.c @@ -786,6 +786,28 @@ ice_fdir_cross_prof_conflict(struct ice_pf *pf, (pf, cflct_ptype, is_tunnel)) goto err; break; + case ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN_IPV4_SCTP: + cflct_ptype = ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN_IPV4_OTHER; + if (!ice_fdir_prof_resolve_conflict + (pf, cflct_ptype, is_tunnel)) + goto err; + break; + case ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN_IPV4_OTHER: + cflct_ptype = ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN_IPV4_UDP; + if (!ice_fdir_prof_resolve_conflict + (pf, cflct_ptype, is_tunnel)) + goto err; + cflct_ptype = ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN_IPV4_TCP; + if (!ice_fdir_prof_resolve_conflict + (pf, cflct_ptype, is_tunnel)) + goto err; + cflct_ptype = ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN_IPV4_SCTP; + if (!ice_fdir_prof_resolve_conflict + (pf, cflct_ptype, is_tunnel)) + goto err; + break; default: break; } @@ -968,11 +990,12 @@ ice_fdir_input_set_hdrs(enum ice_fltr_ptype flow, struct ice_flow_seg_info *seg) ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_IPV_FRAG); break; - case ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN: - ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_UDP | - ICE_FLOW_SEG_HDR_IPV4 | - ICE_FLOW_SEG_HDR_VXLAN | - ICE_FLOW_SEG_HDR_IPV_OTHER); + case ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN_IPV4_SCTP: + break; + case ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN_IPV4_OTHER: + ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_IPV_OTHER); break; case ICE_FLTR_PTYPE_NONF_IPV4_GTPU: ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_GTPU_IP | @@ -2073,8 +2096,18 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad, else if (tunnel_type == ICE_FDIR_TUNNEL_TYPE_GTPU_EH && flow_type == ICE_FLTR_PTYPE_NONF_IPV6_UDP) flow_type = ICE_FLTR_PTYPE_NONF_IPV6_GTPU_EH; - else if (tunnel_type == ICE_FDIR_TUNNEL_TYPE_VXLAN) - flow_type = ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN; + else if (tunnel_type == ICE_FDIR_TUNNEL_TYPE_VXLAN && + flow_type == ICE_FLTR_PTYPE_NONF_IPV4_UDP) + flow_type = ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN_IPV4_UDP; + else if (tunnel_type == ICE_FDIR_TUNNEL_TYPE_VXLAN && + flow_type == ICE_FLTR_PTYPE_NONF_IPV4_TCP) + flow_type = ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN_IPV4_TCP; + else if (tunnel_type == ICE_FDIR_TUNNEL_TYPE_VXLAN && + flow_type == ICE_FLTR_PTYPE_NONF_IPV4_SCTP) + flow_type = ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN_IPV4_SCTP; + else if (tunnel_type == ICE_FDIR_TUNNEL_TYPE_VXLAN && + flow_type == ICE_FLTR_PTYPE_NONF_IPV4_OTHER) + flow_type = ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN_IPV4_OTHER; filter->tunnel_type = tunnel_type; filter->input.flow_type = flow_type; -- 2.27.0