From mboxrd@z Thu Jan 1 00:00:00 1970 From: Didier Pallard Subject: Re: [PATCH] hash: fix CRC32c computation Date: Thu, 11 Feb 2016 09:21:21 +0100 Message-ID: <56BC4481.1060009@6wind.com> References: <1450776898-8951-1-git-send-email-didier.pallard@6wind.com> <3AEA2BF9852C6F48A459DA490692831FFC2238@IRSMSX109.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" To: "Pattan, Reshma" Return-path: Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by dpdk.org (Postfix) with ESMTP id 943908D28 for ; Thu, 11 Feb 2016 09:21:37 +0100 (CET) Received: by mail-wm0-f53.google.com with SMTP id 128so10499757wmz.1 for ; Thu, 11 Feb 2016 00:21:37 -0800 (PST) In-Reply-To: <3AEA2BF9852C6F48A459DA490692831FFC2238@IRSMSX109.ger.corp.intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Ok, i will fix the typo and propose a second serie of patch including unit tests. thanks On 02/10/2016 03:35 PM, Pattan, Reshma wrote: > Hi, > > Small typo. > >> -----Original Message----- >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Didier Pallard >> Sent: Tuesday, December 22, 2015 9:35 AM >> To: dev@dpdk.org; Richardson, Bruce ; De L= ara >> Guarch, Pablo >> Subject: [dpdk-dev] [PATCH] hash: fix CRC32c computation >> diff --git a/lib/librte_hash/rte_hash_crc.h b/lib/librte_hash/rte_hash= _crc.h index >> 78a34b7..485f8a2 100644 >> --- a/lib/librte_hash/rte_hash_crc.h >> +++ b/lib/librte_hash/rte_hash_crc.h >> + * Use single crc32 instruction to perform a hash on a byte value. > "on a byte value" should be =3D=3D=3D> "on 2 bytes". > >> + * Fall back to software crc32 implementation in case SSE4.2 is >> + * not supported >> + * >> + * @param data >> + * Data to perform hash on. >> + * @param init_val >> + * Value to initialise hash generator. >> + * @return >> + * 32bit calculated hash value. >> + */ >> +static inline uint32_t >> +rte_hash_crc_2byte(uint16_t data, uint32_t init_val) { #if defined >> +RTE_ARCH_I686 || defined RTE_ARCH_X86_64 >> + if (likely(crc32_alg & CRC32_SSE42)) >> + return crc32c_sse42_u16(data, init_val); #endif >> + >> + return crc32c_2bytes(data, init_val); >> +} >> + > Thanks, > Reshma --=20 Didier PALLARD 6WIND Software Engineer Tel: +33 1 39 30 92 46 Mob: +33 6 49 11 40 14 Fax: +33 1 39 30 92 11 didier.pallard@6wind.com www.6wind.com This e-mail message, including any attachments, is for the sole use of th= e intended recipient(s) and contains information that is confidential and= proprietary to 6WIND. All unauthorized review, use, disclosure or distri= bution is prohibited. If you are not the intended recipient, please conta= ct the sender by reply e-mail and destroy all copies of the original mess= age. Ce courriel ainsi que toutes les pi=E8ces jointes, est uniquement destin=E9= =E0 son ou ses destinataires. Il contient des informations confidentiell= es qui sont la propri=E9t=E9 de 6WIND. Toute r=E9v=E9lation, distribution= ou copie des informations qu'il contient est strictement interdite. Si v= ous avez re=E7u ce message par erreur, veuillez imm=E9diatement le signal= er =E0 l'=E9metteur et d=E9truire toutes les donn=E9es re=E7ues