From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 0798A108F for ; Tue, 24 Jan 2017 16:17:32 +0100 (CET) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP; 24 Jan 2017 07:17:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,278,1477983600"; d="scan'208";a="51950153" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.38]) ([10.237.220.38]) by orsmga004.jf.intel.com with ESMTP; 24 Jan 2017 07:17:30 -0800 To: Beilei Xing , jingjing.wu@intel.com References: <1485225867-116610-1-git-send-email-beilei.xing@intel.com> Cc: wenzhuo.lu@intel.com, dev@dpdk.org From: Ferruh Yigit Message-ID: <04cedc82-acfa-63ab-c519-e295914e3f3e@intel.com> Date: Tue, 24 Jan 2017 15:17:30 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <1485225867-116610-1-git-send-email-beilei.xing@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit 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: Tue, 24 Jan 2017 15:17:33 -0000 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 == RTE_LITTLE_ENDIAN > + tenant_id = (vni[0] << 16) | (vni[1] << 8) | vni[2]; > +#else > + tenant_id = vni[0] | (vni[1] << 8) | (vni[2] << 16); > +#endif Instead of a new function, will following do the same?: uint32_t tenant_id_be= 0; rte_memcpy(((uint8_t *)&tenant_id_be + 1), vxlan_spec->vni, 3) filter->tenant_id = rte_be_to_cpu(tenant_id_be); I think it is easier to understand, what do you think? Thanks, ferruh