From 8e66b9bf4ba90279631e6a0e8ccc2eab5f9156c2 Mon Sep 17 00:00:00 2001 From: Gabriel Ganne Date: Thu, 14 Dec 2017 16:20:37 +0100 Subject: Use crc32 wrapper (VPP-1086) This allows arm platforms to also take advantage of crc32 hardware acceleration. * add a wrapper for crc32_u64. It's the only one really used. Using it instead of a call to clib_crc32c() eases building symmetrical hash functions. * replace #ifdef on SSE4 by a test on clib_crc32c_uses_intrinsics. Note: keep the test on i386 * fix typo in lb test log Change-Id: I03a0897b70f6c1717e6901d93cf0fe024d5facb5 Signed-off-by: Gabriel Ganne --- src/vnet/bfd/bfd_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/vnet/bfd/bfd_main.c') diff --git a/src/vnet/bfd/bfd_main.c b/src/vnet/bfd/bfd_main.c index 5d1c5404333..668a44e89e5 100644 --- a/src/vnet/bfd/bfd_main.c +++ b/src/vnet/bfd/bfd_main.c @@ -39,10 +39,10 @@ static u64 bfd_calc_echo_checksum (u32 discriminator, u64 expire_time, u32 secret) { u64 checksum = 0; -#if __SSE4_2__ && !defined (__i386__) - checksum = _mm_crc32_u64 (0, discriminator); - checksum = _mm_crc32_u64 (checksum, expire_time); - checksum = _mm_crc32_u64 (checksum, secret); +#if defined(clib_crc32c_uses_intrinsics) && !defined (__i386__) + checksum = crc32_u64 (0, discriminator); + checksum = crc32_u64 (checksum, expire_time); + checksum = crc32_u64 (checksum, secret); #else checksum = clib_xxhash (discriminator ^ expire_time ^ secret); #endif -- cgit 1.2.3-korg