From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 23B551B111 for ; Thu, 11 Oct 2018 10:24:27 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Oct 2018 01:24:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,367,1534834800"; d="scan'208";a="96550558" Received: from kmsmsx152.gar.corp.intel.com ([172.21.73.87]) by fmsmga004.fm.intel.com with ESMTP; 11 Oct 2018 01:13:16 -0700 Received: from pgsmsx103.gar.corp.intel.com ([169.254.2.13]) by KMSMSX152.gar.corp.intel.com ([169.254.11.48]) with mapi id 14.03.0319.002; Thu, 11 Oct 2018 16:10:30 +0800 From: "Zhao1, Wei" To: "Zhang, Qi Z" , mocan CC: "dev@dpdk.org" , "Lu, Wenzhuo" Thread-Topic: Re:RE: [dpdk-dev] [PATCH] net/ixgbe: put 5tuple check in front to jump over ntuple filter case Thread-Index: AQHUVXFXYMbcuuZBIkClVX2dndaqq6UB4x+AgBNEqPCAAzeIgIABZ5+w Date: Thu, 11 Oct 2018 08:10:29 +0000 Message-ID: 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> <039ED4275CED7440929022BC67E70611532A6812@SHSMSX103.ccr.corp.intel.com> <039ED4275CED7440929022BC67E70611532BF9CE@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <039ED4275CED7440929022BC67E70611532BF9CE@SHSMSX103.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [172.30.20.205] Content-Type: text/plain; charset="us-ascii" 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: Thu, 11 Oct 2018 08:24:28 -0000 Hi, qi > -----Original Message----- > From: Zhang, Qi Z > Sent: Thursday, October 11, 2018 2:36 AM > To: Zhao1, Wei ; mocan > Cc: dev@dpdk.org; Lu, Wenzhuo > Subject: RE: Re:RE: [dpdk-dev] [PATCH] net/ixgbe: put 5tuple check in fro= nt > to jump over ntuple filter case >=20 >=20 >=20 > > -----Original Message----- > > From: Zhao1, Wei > > Sent: Monday, October 8, 2018 2:46 AM > > To: Zhang, Qi Z ; mocan > > Cc: dev@dpdk.org; Lu, Wenzhuo > > Subject: RE: Re:RE: [dpdk-dev] [PATCH] net/ixgbe: put 5tuple check in > > front to jump over ntuple filter case > > > > Hi, > > > > > > > -----Original Message----- > > > From: Zhang, Qi Z > > > Sent: Wednesday, September 26, 2018 7:14 PM > > > To: mocan ; Zhao1, Wei > > > Cc: dev@dpdk.org > > > Subject: RE: Re:RE: [dpdk-dev] [PATCH] net/ixgbe: put 5tuple check > > > in front to jump over ntuple filter case > > > > > > OK, got your point. We should not reject a possible valid fdir flow > > > at n-tuple flow check stage. > > > > > > Review-by: Qi Zhang > > > > > > I agree with the point of " We should not reject a possible valid fdir > > flow at n-tuple flow check stage". > > But, I think the fix patch should be more generic for all types filter > > of this problem. > > Maybe, we should delete all " goto out" in function ixgbe_flow_create(= ). > > Then, it will go to ntuple filter and ethertype filter, syn filter > > and fdir filter ,l2_tn_filter one by one. > > And aslo, we should code as > > > > { > > > > Ntuple: > > .......... > > if(ret) > > Goto ethertype > > .......... > > > > Ethertype: > > > > .......... > > if(ret) > > Goto fdir filter > > ......... > > > > fdir filter: > > > > if(ret) > > Goto l2_tn_filter > > > > l2_tn_filter: > > > > ............. > > > > } > > > > This fix patch only solve the problem of ntuple and fdir. > > Qi, What do you think of this? >=20 > I'm not the author of this part of code, so my understanding of current > implementation is: > It assume a flow will not be ambiguous which means if it match to some fi= lter > parser (ixgbe_parse_xxx_filter), it is not necessary to match on a differ= ent > filter. > But I'm not sure if the assumption is correct or not, (this depends on th= e > knowledge of the device capability), So do you mean the assumption is not > correct? If you think a generic fix is necessary, I have below comments Yes, the assumption is may cause bug, this patch is an evidence, maybe this= user has encountered this problem. >=20 > 1. it is better be done by Intel people with enough validation=20 I agree with you, I will commit a generic fix patch later. >2. two options for patch submit. > Submit a v2 with the generic fix, and it will be captured in this releas= e. > If it is not urgent, we can just accept current one first, then have a > separate patch in next release. Ok, If someone supply a v2 with the generic fix, I will ack. >=20 > Thanks > Qi >=20 >=20 > > > > > > > > Thanks > > > Qi > > > > > > From: mocan [mailto:faicker.mo@ucloud.cn] > > > 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. If the > > > flow is considered to be ntuple filter, it will not go on to judge > > > ethertype 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 filte= r. > > > > > > > > > > > > > > > > > > > > > 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 > > > >> > > > >> From: "faicker.mo" > > > >> > > > >> 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 late in > > > your case? > > > > > > > >Thanks > > > >Qi > > > > > > > > > > > >> > > > >> Signed-off-by: faicker.mo > > > >> --- > > > >> drivers/net/ixgbe/ixgbe_flow.c | 29 > > > +++++++++++++++++++++++++++++ > > > >> 1 file changed, 29 insertions(+) > > > >> > > > >> diff --git a/drivers/net/ixgbe/ixgbe_flow.c > > > b/drivers/net/ixgbe/ixgbe_flow.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; > > > >> + } > > > >> > > > >> 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; > > > >> + } > > > >> > > > >> 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; > > > >> + } > > > >> > > > >> filter->dst_port_mask =3D udp_mask->hdr.dst_port; > > > >> filter->src_port_mask =3D udp_mask->hdr.src_port; > > > >> -- > > > >> 1.8.3.1 > > > >> > > > >