From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yerden Zhumabekov Subject: [PATCH v5 0/7] rte_hash_crc reworked to be platform-independent Date: Thu, 20 Nov 2014 11:15:44 +0600 Message-ID: References: <1409724351-23786-1-git-send-email-e_zhumabekov@sts.kz> Mime-Version: 1.0 Content-Type: text/plain To: Return-path: In-Reply-To: <1409724351-23786-1-git-send-email-e_zhumabekov-8EHiFRVJVgQ@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" These patches bring a fallback mechanism to ensure that CRC32 hash is calculated regardless of hardware support from CPU (i.e. SSE4.2 intrinsics). Performance is also improved by slicing data in 8 bytes. Patches were tested on machines either with and without SSE4.2 support. 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 SSE4.2. * added rte_hash_crc_8byte() function to calculate CRC32 on 8-byte operand. * reworked rte_hash_crc() function which leverages both versions of CRC32 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 application startup. * SSE4.2 intrinsics are implemented through inline assembly code. * added additional run-time check for 64-bit support. Yerden Zhumabekov (7): hash: add software CRC32 implementation hash: add assembly implementation of CRC32 intrinsics hash: replace built-in functions implementing SSE4.2 hash: add rte_hash_crc_8byte function hash: add fallback to software CRC32 implementation hash: rte_hash_crc() slices data into 8-byte pieces test: remove redundant compile checks app/test/test_hash.c | 7 - app/test/test_hash_perf.c | 11 - lib/librte_hash/rte_hash_crc.h | 459 +++++++++++++++++++++++++++++++++++++++- 3 files changed, 448 insertions(+), 29 deletions(-) -- 1.7.9.5