lib/librte_table: fix arm64 hash function selection

Message ID 20190406132852.14862-1-jerinj@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series lib/librte_table: fix arm64 hash function selection |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Jerin Jacob Kollanukkaran April 6, 2019, 1:29 p.m. UTC
  From: Jerin Jacob <jerinj@marvell.com>

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: Gavin Hu <gavin.hu@arm.com>
Cc: stable@dpdk.org

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
---
 lib/librte_table/rte_table_hash_func.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Cristian Dumitrescu April 8, 2019, 1:37 p.m. UTC | #1
> -----Original Message-----
> From: Jerin Jacob Kollanukkaran [mailto:jerinj@marvell.com]
> Sent: Saturday, April 6, 2019 2:30 PM
> To: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
> Cc: dev@dpdk.org; thomas@monjalon.net; Jerin Jacob Kollanukkaran
> <jerinj@marvell.com>; Gavin Hu <gavin.hu@arm.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] lib/librte_table: fix arm64 hash function
> selection
> 
> From: Jerin Jacob <jerinj@marvell.com>
> 
> 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: Gavin Hu <gavin.hu@arm.com>
> Cc: stable@dpdk.org
> 
> Signed-off-by: Jerin Jacob <jerinj@marvell.com>
> ---
>  lib/librte_table/rte_table_hash_func.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
  
Thomas Monjalon April 10, 2019, 8:05 p.m. UTC | #2
> > From: Jerin Jacob <jerinj@marvell.com>
> > 
> > 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: Gavin Hu <gavin.hu@arm.com>
> > Cc: stable@dpdk.org
> > 
> > Signed-off-by: Jerin Jacob <jerinj@marvell.com>
> 
> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

Applied, thanks
  

Patch

diff --git a/lib/librte_table/rte_table_hash_func.h b/lib/librte_table/rte_table_hash_func.h
index 02296eabe..11ea5a90e 100644
--- a/lib/librte_table/rte_table_hash_func.h
+++ b/lib/librte_table/rte_table_hash_func.h
@@ -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