From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 2E7B0293B for ; Mon, 6 Feb 2017 02:38:13 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP; 05 Feb 2017 17:38:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,339,1477983600"; d="scan'208";a="1122501277" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga002.fm.intel.com with ESMTP; 05 Feb 2017 17:38:12 -0800 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 5 Feb 2017 17:38:11 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 5 Feb 2017 17:38:11 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.177]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.204]) with mapi id 14.03.0248.002; Mon, 6 Feb 2017 09:38:08 +0800 From: "Xing, Beilei" To: "Yigit, Ferruh" , "Wu, Jingjing" CC: "Lu, Wenzhuo" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] net/i40e: fix parsing tunnel filter issue Thread-Index: AQHSdewGXFFAYeifLkCNpTMpSNFHmqFHOAAAgBQOftA= Date: Mon, 6 Feb 2017 01:38:07 +0000 Message-ID: <94479800C636CB44BD422CB454846E0131599AE3@SHSMSX101.ccr.corp.intel.com> References: <1485225867-116610-1-git-send-email-beilei.xing@intel.com> <04cedc82-acfa-63ab-c519-e295914e3f3e@intel.com> In-Reply-To: <04cedc82-acfa-63ab-c519-e295914e3f3e@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDhkYjE1YzItYjgxZC00MzczLWIxYmItMjVlY2RjZDQyMjAxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IjVOZzdnRDIzYXlBMVA3NzF5OGZ1YldpaXZmcXh2aTZMK0xcL3l0RUh2K3NJPSJ9 x-ctpclassification: CTP_IC 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/i40e: fix parsing tunnel filter issue 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: Mon, 06 Feb 2017 01:38:13 -0000 Hi Ferruh, Sorry for late reply due to Chinese New Year. > -----Original Message----- > From: Yigit, Ferruh > Sent: Tuesday, January 24, 2017 11:18 PM > To: Xing, Beilei ; Wu, Jingjing > Cc: Lu, Wenzhuo ; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix parsing tunnel filter issue >=20 > On 1/24/2017 2:44 AM, Beilei Xing wrote: > > VNI of VXLAN is parsed wrongly. The root cause is that array vni in > > item VXLAN also uses network byte ordering. > > > > Fixes: d416530e6358 ("net/i40e: parse tunnel filter") > > > > Signed-off-by: Beilei Xing > > --- > > drivers/net/i40e/i40e_flow.c | 22 ++++++++++++++++++---- > > 1 file changed, 18 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/net/i40e/i40e_flow.c > > b/drivers/net/i40e/i40e_flow.c index 76bb332..51b3223 100644 > > --- a/drivers/net/i40e/i40e_flow.c > > +++ b/drivers/net/i40e/i40e_flow.c > > @@ -1196,6 +1196,20 @@ i40e_check_tenant_id_mask(const uint8_t > *mask) > > return is_masked; > > } > > > > +static uint32_t > > +i40e_flow_set_tenant_id(const uint8_t *vni) { > > + uint32_t tenant_id; > > + > > +#if RTE_BYTE_ORDER =3D=3D RTE_LITTLE_ENDIAN > > + tenant_id =3D (vni[0] << 16) | (vni[1] << 8) | vni[2]; #else > > + tenant_id =3D vni[0] | (vni[1] << 8) | (vni[2] << 16); #endif >=20 > Instead of a new function, will following do the same?: >=20 > uint32_t tenant_id_be=3D 0; > rte_memcpy(((uint8_t *)&tenant_id_be + 1), vxlan_spec->vni, 3) > filter->tenant_id =3D rte_be_to_cpu(tenant_id_be); >=20 > I think it is easier to understand, what do you think? Agree. Thanks for the comments. >=20 > Thanks, > ferruh