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 5A7D958EF for ; Thu, 19 Mar 2015 03:00:56 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 18 Mar 2015 19:00:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,426,1422950400"; d="scan'208";a="700785236" Received: from pgsmsx101.gar.corp.intel.com ([10.221.44.78]) by orsmga002.jf.intel.com with ESMTP; 18 Mar 2015 19:00:55 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by PGSMSX101.gar.corp.intel.com (10.221.44.78) with Microsoft SMTP Server (TLS) id 14.3.224.2; Thu, 19 Mar 2015 10:00:47 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.36]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.108]) with mapi id 14.03.0224.002; Thu, 19 Mar 2015 10:00:46 +0800 From: "Qiu, Michael" To: Thomas Monjalon Thread-Topic: [dpdk-dev] [PATCH 1/3 v2] librte_hash: Fix unsupported instruction `crc32' in i686 platform Thread-Index: AQHQV2U5FnYjrJBY6UetCuCVTidWCg== Date: Thu, 19 Mar 2015 02:00:46 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E60286D1603B@SHSMSX101.ccr.corp.intel.com> References: <1425561339-13300-2-git-send-email-michael.qiu@intel.com> <9902699.YtPW44peIi@xps13> <533710CFB86FA344BFBF2D6802E60286CEF549@SHSMSX101.ccr.corp.intel.com> <9442704.dXlXz1iyK3@xps13> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH 1/3 v2] librte_hash: Fix unsupported instruction `crc32' in i686 platform X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2015 02:00:56 -0000 On 3/8/2015 2:39 AM, Thomas Monjalon wrote:=0A= > 2015-03-06 01:39, Qiu, Michael:=0A= >> On 3/6/2015 1:11 AM, Thomas Monjalon wrote:=0A= >>> 2015-03-06 00:55, Michael Qiu:=0A= >>>> CC rte_hash.o=0A= >>>> Error: unsupported instruction `crc32'=0A= >>>>=0A= >>>> The root cause is that i686 platform does not support 'crc32q'=0A= >>>> Need make it only available in x86_64 platform=0A= >>>>=0A= >>>> Signed-off-by: Michael Qiu =0A= >>>> ---=0A= >>>> v2 --> v1:=0A= >>>> Make crc32 instruction only works in X86 platform=0A= >>>> lib/librte_hash/rte_hash_crc.h | 12 ++++++++++++=0A= >>>> 1 file changed, 12 insertions(+)=0A= >>>>=0A= >>>> diff --git a/lib/librte_hash/rte_hash_crc.h b/lib/librte_hash/rte_hash= _crc.h=0A= >>>> index d28bb2a..c0a789e 100644=0A= >>>> --- a/lib/librte_hash/rte_hash_crc.h=0A= >>>> +++ b/lib/librte_hash/rte_hash_crc.h=0A= >>>> @@ -364,6 +364,7 @@ crc32c_2words(uint64_t data, uint32_t init_val)=0A= >>>> return crc;=0A= >>>> }=0A= >>>> =0A= >>>> +#if defined RTE_ARCH_I686 || defined RTE_ARCH_X86_64=0A= >>>> static inline uint32_t=0A= >>>> crc32c_sse42_u32(uint32_t data, uint32_t init_val)=0A= >>>> {=0A= >>>> @@ -373,7 +374,9 @@ crc32c_sse42_u32(uint32_t data, uint32_t init_val)= =0A= >>>> : [data] "rm" (data));=0A= >>>> return init_val;=0A= >>>> }=0A= >>>> +#endif=0A= >>> Wouldn't it be more elegant to define a stub which returns 0 in #else= =0A= >>> in order to remove #ifdef below?=0A= >>> Not sure, matter of taste.=0A= >> It may be not a good idea, see rte_hash_crc_8byte(), if no crc32=0A= >> support, it will use crc32c_2words(), if we define a stub which returns= =0A= >> 0 in #else, then we need always check the return value whether it is=0A= >> none-zero otherwise need fallback.=0A= > I don't think so.=0A= > The stub won't never been called because they are protected by the cpufla= g=0A= > condition.=0A= =0A= Hi, Thomas=0A= =0A= Indeed what I concerned occurs, when compile target i686 in X86_64=0A= platform, it will call the stub function=0A= =0A= Then, should I make a patch to fix, change the code as this one(V2)=0A= =0A= Another choice is you could revert V3 and merge V2.=0A= =0A= Or if have other solution?=0A= =0A= Thanks,=0A= Michael=0A= >=0A= =0A=