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 E33E6A04C0; Tue, 19 Nov 2019 03:07:36 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4FCE42BA8; Tue, 19 Nov 2019 03:07:36 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 5FA4ACF3 for ; Tue, 19 Nov 2019 03:07:35 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Nov 2019 18:07:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,322,1569308400"; d="scan'208";a="407596443" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga006.fm.intel.com with ESMTP; 18 Nov 2019 18:07:34 -0800 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 18 Nov 2019 18:07:34 -0800 Received: from shsmsx105.ccr.corp.intel.com (10.239.4.158) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 18 Nov 2019 18:07:33 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.213]) by SHSMSX105.ccr.corp.intel.com ([169.254.11.225]) with mapi id 14.03.0439.000; Tue, 19 Nov 2019 10:07:31 +0800 From: "Xing, Beilei" To: "Zhang, Qi Z" , "Cao, Yahui" CC: "dev@dpdk.org" Thread-Topic: [PATCH] net/ice: fix flow type selection for FDIR Thread-Index: AQHVnnU6Vzgov2HFeUG74Rf8t6eYQ6eRvu/w Date: Tue, 19 Nov 2019 02:07:31 +0000 Message-ID: <94479800C636CB44BD422CB454846E013CE88C02@SHSMSX101.ccr.corp.intel.com> References: <20191119010702.2684-1-qi.z.zhang@intel.com> In-Reply-To: <20191119010702.2684-1-qi.z.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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: [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" > -----Original Message----- > From: Zhang, Qi Z > Sent: Tuesday, November 19, 2019 9:07 AM > To: Cao, Yahui ; Xing, Beilei > Cc: dev@dpdk.org; Zhang, Qi Z > Subject: [PATCH] net/ice: fix flow type selection for FDIR >=20 > 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 >=20 > The patch fix all the wrong flow ptype selections. >=20 > Fixes: f5cafa961fae ("net/ice: add flow director create and destroy") >=20 > Signed-off-by: Qi Zhang > --- > drivers/net/ice/ice_fdir_filter.c | 27 +++++++++++++++------------ > 1 file changed, 15 insertions(+), 12 deletions(-) >=20 > 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 =3D item->spec; > tcp_mask =3D item->mask; >=20 > + if (l3 =3D=3D RTE_FLOW_ITEM_TYPE_IPV4) > + flow_type =3D ICE_FLTR_PTYPE_NONF_IPV4_TCP; > + else if (l3 =3D=3D RTE_FLOW_ITEM_TYPE_IPV6) > + flow_type =3D 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 =3D > tcp_spec->hdr.dst_port; > - flow_type =3D > - > ICE_FLTR_PTYPE_NONF_IPV4_TCP; > } else if (l3 =3D=3D RTE_FLOW_ITEM_TYPE_IPV6) { > filter->input.ip.v6.dst_port =3D > tcp_spec->hdr.src_port; > filter->input.ip.v6.src_port =3D > tcp_spec->hdr.dst_port; > - flow_type =3D > - > ICE_FLTR_PTYPE_NONF_IPV6_TCP; > } > } > break; > @@ -1746,6 +1747,11 @@ ice_fdir_parse_pattern(__rte_unused struct > ice_adapter *ad, > udp_spec =3D item->spec; > udp_mask =3D item->mask; >=20 > + if (l3 =3D=3D RTE_FLOW_ITEM_TYPE_IPV4) > + flow_type =3D > ICE_FLTR_PTYPE_NONF_IPV4_UDP; > + else if (l3 =3D=3D RTE_FLOW_ITEM_TYPE_IPV6) > + flow_type =3D > 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 =3D > udp_spec->hdr.dst_port; > - flow_type =3D > - > ICE_FLTR_PTYPE_NONF_IPV4_UDP; > } else if (l3 =3D=3D RTE_FLOW_ITEM_TYPE_IPV6) { > filter->input.ip.v6.src_port =3D > udp_spec->hdr.dst_port; > filter->input.ip.v6.dst_port =3D > udp_spec->hdr.src_port; > - flow_type =3D > - > ICE_FLTR_PTYPE_NONF_IPV6_UDP; > } > } > break; > @@ -1788,6 +1790,11 @@ ice_fdir_parse_pattern(__rte_unused struct > ice_adapter *ad, > sctp_spec =3D item->spec; > sctp_mask =3D item->mask; >=20 > + if (l3 =3D=3D RTE_FLOW_ITEM_TYPE_IPV4) > + flow_type =3D > ICE_FLTR_PTYPE_NONF_IPV4_SCTP; > + else if (l3 =3D=3D RTE_FLOW_ITEM_TYPE_IPV6) > + flow_type =3D > 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 =3D > sctp_spec->hdr.dst_port; > - flow_type =3D > - > ICE_FLTR_PTYPE_NONF_IPV4_SCTP; > } else if (l3 =3D=3D RTE_FLOW_ITEM_TYPE_IPV6) { > filter->input.ip.v6.dst_port =3D > sctp_spec->hdr.src_port; > filter->input.ip.v6.src_port =3D > sctp_spec->hdr.dst_port; > - flow_type =3D > - > ICE_FLTR_PTYPE_NONF_IPV6_SCTP; > } > } > break; > -- > 2.13.6 Acked-by: Beilei Xing