From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id C04241B160 for ; Wed, 26 Sep 2018 13:16:48 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Sep 2018 04:16:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,306,1534834800"; d="scan'208";a="86687462" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga003.jf.intel.com with ESMTP; 26 Sep 2018 04:14:18 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 26 Sep 2018 04:14:17 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.245]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.220]) with mapi id 14.03.0319.002; Wed, 26 Sep 2018 19:14:15 +0800 From: "Zhang, Qi Z" To: mocan , "Zhao1, Wei" CC: "dev@dpdk.org" Thread-Topic: Re:RE: [dpdk-dev] [PATCH] net/ixgbe: put 5tuple check in front to jump over ntuple filter case Thread-Index: AQHUVXKWfeVpWDyczk6TegBSJB81TaUCZkPw Date: Wed, 26 Sep 2018 11:14:15 +0000 Message-ID: <039ED4275CED7440929022BC67E70611532A6812@SHSMSX103.ccr.corp.intel.com> References: <1537249732-7530-1-git-send-email-faicker.mo@ucloud.cn> <039ED4275CED7440929022BC67E70611532A1A27@SHSMSX103.ccr.corp.intel.com> <27452153.f1c7.16614f29e5f.Coremail.faicker.mo@ucloud.cn> In-Reply-To: <27452153.f1c7.16614f29e5f.Coremail.faicker.mo@ucloud.cn> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzNiMjRmZTMtZTE3Ny00MDkzLWI0ZjYtZWFiNDZmOTg1ZDlkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoibHQwbWJ6Sk9cL0ZGc1BhYzdYOVIxTitJQisydFRmYUNlZlA3RURtZ25DRGp4RE1MRFgxVWdMdVRjYldTSWh4ZmYifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: put 5tuple check in front to jump over ntuple filter case 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: , X-List-Received-Date: Wed, 26 Sep 2018 11:16:49 -0000 OK, got your point. We should not reject a possible valid fdir flow at n-tu= ple flow check stage. Review-by: Qi Zhang Thanks Qi From: mocan [mailto:faicker.mo@ucloud.cn]=20 Sent: Wednesday, September 26, 2018 4:16 PM To: Zhang, Qi Z Cc: dev@dpdk.org Subject: Re:RE: [dpdk-dev] [PATCH] net/ixgbe: put 5tuple check in front to = jump over ntuple filter case Hi Qi, In ixgbe_flow_create function, ntuple filter is parsed first.=A0 If the flow is considered to be ntuple filter, it will not go on to judge e= thertype filter, syn filter and fdir filter. In the function ntuple_filter_to_5tuple, 5 tuple info is checked, but it's = too late to jump over the ntuple filter if it's a fdir filter. At 2018-09-21 23:48:37, "Zhang, Qi Z" wrote: >Hi Faicker: > >> -----Original Message----- >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of faicker.mo >> Sent: Tuesday, September 18, 2018 1:49 PM >> To: dev@dpdk.org >> Cc: faicker.mo >> Subject: [dpdk-dev] [PATCH] net/ixgbe: put 5tuple check in front to jump= over >> ntuple filter case >>=20 >> From: "faicker.mo" >>=20 >> Check in func ntuple_filter_to_5tuple is too late for fdir filter rule, = add check >> in func cons_parse_ntuple_filter. > >Would you explain more about the intention for this patch? >Though it can be more fast to reject an invalid flow, but why it is too la= te in your case?=20 > >Thanks >Qi > > >>=20 >> Signed-off-by: faicker.mo >> --- >> drivers/net/ixgbe/ixgbe_flow.c | 29 +++++++++++++++++++++++++++++ >> 1 file changed, 29 insertions(+) >>=20 >> diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_fl= ow.c >> index 1adf1b8..f0fafeb 100644 >> --- a/drivers/net/ixgbe/ixgbe_flow.c >> +++ b/drivers/net/ixgbe/ixgbe_flow.c >> @@ -363,6 +363,17 @@ const struct rte_flow_action *next_no_void_action( >> item, "Not supported by ntuple filter"); >> return -rte_errno; >> } >> + if ((ipv4_mask->hdr.src_addr !=3D 0 && >> + ipv4_mask->hdr.src_addr !=3D UINT32_MAX) || >> + (ipv4_mask->hdr.dst_addr !=3D 0 && >> + ipv4_mask->hdr.dst_addr !=3D UINT32_MAX) || >> + (ipv4_mask->hdr.next_proto_id !=3D UINT8_MAX && >> + ipv4_mask->hdr.next_proto_id !=3D 0)) { >> + rte_flow_error_set(error, >> + EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, >> + item, "Not supported by ntuple filter"); >> + return -rte_errno; >> + } >>=20 >> filter->dst_ip_mask =3D ipv4_mask->hdr.dst_addr; >> filter->src_ip_mask =3D ipv4_mask->hdr.src_addr; @@ -432,6 +443,15 >> @@ const struct rte_flow_action *next_no_void_action( >> item, "Not supported by ntuple filter"); >> return -rte_errno; >> } >> + if ((tcp_mask->hdr.src_port !=3D 0 && >> + tcp_mask->hdr.src_port !=3D UINT16_MAX) || >> + (tcp_mask->hdr.dst_port !=3D 0 && >> + tcp_mask->hdr.dst_port !=3D UINT16_MAX)) { >> + rte_flow_error_set(error, >> + EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, >> + item, "Not supported by ntuple filter"); >> + return -rte_errno; >> + } >>=20 >> filter->dst_port_mask =3D tcp_mask->hdr.dst_port; >> filter->src_port_mask =3D tcp_mask->hdr.src_port; @@ -467,6 >> +487,15 @@ const struct rte_flow_action *next_no_void_action( >> item, "Not supported by ntuple filter"); >> return -rte_errno; >> } >> + if ((udp_mask->hdr.src_port !=3D 0 && >> + udp_mask->hdr.src_port !=3D UINT16_MAX) || >> + (udp_mask->hdr.dst_port !=3D 0 && >> + udp_mask->hdr.dst_port !=3D UINT16_MAX)) { >> + rte_flow_error_set(error, >> + EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, >> + item, "Not supported by ntuple filter"); >> + return -rte_errno; >> + } >>=20 >> filter->dst_port_mask =3D udp_mask->hdr.dst_port; >> filter->src_port_mask =3D udp_mask->hdr.src_port; >> -- >> 1.8.3.1 >>=20 >