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 E117C326C for ; Tue, 4 Apr 2017 14:52:25 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP; 04 Apr 2017 05:52:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,275,1486454400"; d="scan'208";a="73408865" Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by orsmga004.jf.intel.com with ESMTP; 04 Apr 2017 05:52:24 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.239]) by IRSMSX102.ger.corp.intel.com ([169.254.2.153]) with mapi id 14.03.0319.002; Tue, 4 Apr 2017 13:52:23 +0100 From: "Iremonger, Bernard" To: "Yigit, Ferruh" , "dev@dpdk.org" , "Xing, Beilei" CC: "Lu, Wenzhuo" Thread-Topic: [dpdk-dev] [PATCH] net/i40e: fix eth pattern parsing Thread-Index: AQHSrJVXlFuIDmI2p0qbQA3BaizEDqG1FyeAgAATDvA= Date: Tue, 4 Apr 2017 12:52:23 +0000 Message-ID: <8CEF83825BEC744B83065625E567D7C224D4F2B7@IRSMSX108.ger.corp.intel.com> References: <1491236049-6747-1-git-send-email-bernard.iremonger@intel.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMTMxNjU3YTYtNmZiOS00MDc5LThiYTMtYzEwNTU0ZDliNzg0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IkZzS0VKeFpoS21Wc1oxK3BrMWlsU3ZHUm91TEJmRVVsZ2NMYzRCb1FKMk09In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix eth pattern parsing 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: Tue, 04 Apr 2017 12:52:26 -0000 Hi Ferruh, > -----Original Message----- > From: Yigit, Ferruh > Sent: Tuesday, April 4, 2017 1:40 PM > To: Iremonger, Bernard ; dev@dpdk.org; > Xing, Beilei > Cc: Lu, Wenzhuo > Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix eth pattern parsing >=20 > On 4/3/2017 5:14 PM, Bernard Iremonger wrote: > > Handle the following eth patterns: > > eth dst spec aa:bb:cc:dd:ee:ff > > eth dst mask ff:ff:ff:ff:ff:ff > > eth src spec aa:bb:cc:dd:ee:ff > > eth src mask ff:ff:ff:ff:ff:ff > > > > Fixes: d46e85af6b5c ("net/i40e: parse QinQ pattern") > > > > Signed-off-by: Bernard Iremonger > > --- > > drivers/net/i40e/i40e_flow.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/net/i40e/i40e_flow.c > > b/drivers/net/i40e/i40e_flow.c index 9f541eaff..3fcd31036 100644 > > --- a/drivers/net/i40e/i40e_flow.c > > +++ b/drivers/net/i40e/i40e_flow.c > > @@ -1772,7 +1772,8 @@ i40e_flow_parse_qinq_pattern(__rte_unused > struct rte_eth_dev *dev, > > case RTE_FLOW_ITEM_TYPE_ETH: > > eth_spec =3D (const struct rte_flow_item_eth *)item- > >spec; > > eth_mask =3D (const struct rte_flow_item_eth *)item- > >mask; > > - if (eth_spec && eth_mask) { > > + if ((eth_spec && eth_mask) || > > + (eth_spec || eth_mask)) { >=20 > Is this check requires both spec and mask to be all zeros? If this is the= real > intention, can you please add a comment above check to clarify it. Yes , the intention is to only except the "eth" key word, I will send a v2. >=20 > Also other i40e_flow_parse_xxx_pattern() functions has function comment > to describe expected/valid pattern for the flow rule. > i40e_flow_parse_qinq_pattern() is missing that function comment. Would > you mind adding it, which helps to validate implementation against intent= ion. Yes , I will describe valid patterns for the flow rule in a separate patch.= =20 =20 > Thanks, > ferruh >=20 > > rte_flow_error_set(error, EINVAL, > > > RTE_FLOW_ERROR_TYPE_ITEM, > > item, > > Regards, Bernard.