table: fix arm64 hash function selection
authorJerin Jacob <jerinj@marvell.com>
Sat, 6 Apr 2019 13:29:41 +0000 (13:29 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 10 Apr 2019 20:04:37 +0000 (22:04 +0200)
Use CRC32 instruction only when it is available to avoid
the build issue like below.

{standard input}:16: Error:
selected processor does not support `crc32cx w3,w3,x0'

Fixes: ea7be0a0386e ("lib/librte_table: add hash function headers")
Cc: stable@dpdk.org
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
lib/librte_table/rte_table_hash_func.h

index 02296ea..11ea5a9 100644 (file)
@@ -40,7 +40,7 @@ rte_crc32_u64(uint64_t crc, uint64_t v)
        return _mm_crc32_u64(crc, v);
 }
 
-#elif defined(RTE_ARCH_ARM64)
+#elif defined(RTE_ARCH_ARM64) && defined(RTE_MACHINE_CPUFLAG_CRC32)
 #include "rte_table_hash_func_arm64.h"
 #else