From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mgw.gov.kz (mgw.gov.kz [89.218.88.242]) by dpdk.org (Postfix) with ESMTP id 5DA271515 for ; Fri, 28 Nov 2014 04:29:03 +0100 (CET) Received: from mgw.gov.kz (mx.ctsat.kz [178.89.4.95]) by mgw.gov.kz with ESMTP id sAS3SxeK014376-sAS3SxeM014376 (version=TLSv1.0 cipher=AES128-SHA bits=128 verify=NO); Fri, 28 Nov 2014 09:28:59 +0600 Received: from EXCASHUB2.rgp.local (192.168.40.53) by EdgeForefront.rgp.local (192.168.40.59) with Microsoft SMTP Server (TLS) id 14.2.247.3; Fri, 28 Nov 2014 09:28:41 +0600 Received: from [192.168.35.15] (192.168.35.15) by excashub2.rgp.local (192.168.40.48) with Microsoft SMTP Server (TLS) id 14.2.247.3; Fri, 28 Nov 2014 09:28:58 +0600 Message-ID: <5477EBF1.4010508@sts.kz> Date: Fri, 28 Nov 2014 09:28:49 +0600 From: Yerden Zhumabekov User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Thomas Monjalon References: <1409724351-23786-1-git-send-email-e_zhumabekov@sts.kz> <2858592.pE1d5roQkI@xps13> In-Reply-To: <2858592.pE1d5roQkI@xps13> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [192.168.35.15] X-FEAS-SYSTEM-WL: e_zhumabekov@sts.kz Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v5 0/7] rte_hash_crc reworked to be platform-independent 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: Fri, 28 Nov 2014 03:29:04 -0000 28.11.2014 3:04, Thomas Monjalon =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > 2014-11-20 11:15, Yerden Zhumabekov: >> These patches bring a fallback mechanism to ensure that CRC32 hash is = calculated regardless of hardware support from CPU (i.e. SSE4.2 intrinsic= s). >> Performance is also improved by slicing data in 8 bytes. >> >> Patches were tested on machines either with and without SSE4.2 support= =2E >> >> Software implementation seems to be about 4-5 times slower than SSE4.2= -enabled one. Of course, they return identical results. >> >> Summary of changes: >> * added CRC32 software implementation, which is used as a fallback in = case SSE4.2 is not available, or if SSE4.2 is intentionally disabled. >> * added rte_hash_crc_set_alg() function to control availability of SSE= 4.2. >> * added rte_hash_crc_8byte() function to calculate CRC32 on 8-byte ope= rand. >> * reworked rte_hash_crc() function which leverages both versions of CR= C32 hash calculation functions with 4 and 8-byte operands. >> * removed compile-time checks from test_hash_perf and test_hash. >> * setting default algorithm implementation as a constructor while appl= ication startup. >> * SSE4.2 intrinsics are implemented through inline assembly code. >> * added additional run-time check for 64-bit support. > So you don't want to use the target attribute as suggested by Konstanti= n? > > Why the discussion ended without any acknowledgement? > I decided to emit SSE4.2 instruction right from the code, because: * it is supported by gcc 4.3; * use of target attribute (in a way suggested by Konstantin) presumably still requires us to use #ifdef which we want to avoid. Actually then, I didn't investigate it further. I'm quite happy with last revision, but I'm open for ideas and discussion. I made new patch series with solely change of crc32c tables declaration using 'const' just as Stephen suggested, and I may post it. But I'd like to see a confirmation for what I've done so far. --=20 Sincerely, Yerden Zhumabekov State Technical Service Astana, KZ