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 228DEA04B4; Tue, 19 Nov 2019 06:07:14 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 540392BE2; Tue, 19 Nov 2019 06:07:13 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id F169C2956 for ; Tue, 19 Nov 2019 06:07:10 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Nov 2019 21:07:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,322,1569308400"; d="scan'208";a="237197095" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.117.17]) by fmsmga002.fm.intel.com with ESMTP; 18 Nov 2019 21:07:08 -0800 Date: Tue, 19 Nov 2019 13:03:36 +0800 From: Ye Xiaolong To: Qi Zhang Cc: yahui.cao@intel.com, beilei.xing@intel.com, dev@dpdk.org Message-ID: <20191119050336.GI69793@intel.com> References: <20191119010702.2684-1-qi.z.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191119010702.2684-1-qi.z.zhang@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH] net/ice: fix flow type selection for FDIR 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" On 11/19, Qi Zhang wrote: >The FDIR parser will select ICE_FLTR_PTYPE_NONF_IPV4_OTHER as flow type >for an IPv4 UDP flow with empty l4 matching field which is not correct. >Same issues happens on all the combination between IPv4/IPv6 and >UDP/TCP/SCTP cases > >The patch fix all the wrong flow ptype selections. > >Fixes: f5cafa961fae ("net/ice: add flow director create and destroy") > >Signed-off-by: Qi Zhang >--- > drivers/net/ice/ice_fdir_filter.c | 27 +++++++++++++++------------ > 1 file changed, 15 insertions(+), 12 deletions(-) > >diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c >index e5a35dfe8..6db48e994 100644 >--- a/drivers/net/ice/ice_fdir_filter.c >+++ b/drivers/net/ice/ice_fdir_filter.c >@@ -1699,6 +1699,11 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad, > tcp_spec = item->spec; > tcp_mask = item->mask; > >+ if (l3 == RTE_FLOW_ITEM_TYPE_IPV4) >+ flow_type = ICE_FLTR_PTYPE_NONF_IPV4_TCP; >+ else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6) >+ flow_type = ICE_FLTR_PTYPE_NONF_IPV6_TCP; >+ > if (tcp_spec && tcp_mask) { > /* Check TCP mask and update input set */ > if (tcp_mask->hdr.sent_seq || >@@ -1730,15 +1735,11 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad, > tcp_spec->hdr.src_port; > filter->input.ip.v4.src_port = > tcp_spec->hdr.dst_port; >- flow_type = >- ICE_FLTR_PTYPE_NONF_IPV4_TCP; > } else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6) { > filter->input.ip.v6.dst_port = > tcp_spec->hdr.src_port; > filter->input.ip.v6.src_port = > tcp_spec->hdr.dst_port; >- flow_type = >- ICE_FLTR_PTYPE_NONF_IPV6_TCP; > } > } > break; >@@ -1746,6 +1747,11 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad, > udp_spec = item->spec; > udp_mask = item->mask; > >+ if (l3 == RTE_FLOW_ITEM_TYPE_IPV4) >+ flow_type = ICE_FLTR_PTYPE_NONF_IPV4_UDP; >+ else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6) >+ flow_type = ICE_FLTR_PTYPE_NONF_IPV6_UDP; >+ > if (udp_spec && udp_mask) { > /* Check UDP mask and update input set*/ > if (udp_mask->hdr.dgram_len || >@@ -1772,15 +1778,11 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad, > udp_spec->hdr.src_port; > filter->input.ip.v4.src_port = > udp_spec->hdr.dst_port; >- flow_type = >- ICE_FLTR_PTYPE_NONF_IPV4_UDP; > } else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6) { > filter->input.ip.v6.src_port = > udp_spec->hdr.dst_port; > filter->input.ip.v6.dst_port = > udp_spec->hdr.src_port; >- flow_type = >- ICE_FLTR_PTYPE_NONF_IPV6_UDP; > } > } > break; >@@ -1788,6 +1790,11 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad, > sctp_spec = item->spec; > sctp_mask = item->mask; > >+ if (l3 == RTE_FLOW_ITEM_TYPE_IPV4) >+ flow_type = ICE_FLTR_PTYPE_NONF_IPV4_SCTP; >+ else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6) >+ flow_type = ICE_FLTR_PTYPE_NONF_IPV6_SCTP; >+ > if (sctp_spec && sctp_mask) { > /* Check SCTP mask and update input set */ > if (sctp_mask->hdr.cksum) { >@@ -1813,15 +1820,11 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad, > sctp_spec->hdr.src_port; > filter->input.ip.v4.src_port = > sctp_spec->hdr.dst_port; >- flow_type = >- ICE_FLTR_PTYPE_NONF_IPV4_SCTP; > } else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6) { > filter->input.ip.v6.dst_port = > sctp_spec->hdr.src_port; > filter->input.ip.v6.src_port = > sctp_spec->hdr.dst_port; >- flow_type = >- ICE_FLTR_PTYPE_NONF_IPV6_SCTP; > } > } > break; >-- >2.13.6 > Applied to dpdk-next-net-intel, Thanks.