]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_hash/rte_cuckoo_hash.h
hash: validate hash bucket entries while compiling
[dpdk.git] / lib / librte_hash / rte_cuckoo_hash.h
index 658471a714e987fe99dd79cb9fd98ee88806ea7a..bd6ad1bd66703f6a00aaa261326da46771e6a335 100644 (file)
 #define RETURN_IF_TRUE(cond, retval)
 #endif
 
-/* Hash function used if none is specified */
-#if defined(RTE_ARCH_X86) || defined(RTE_MACHINE_CPUFLAG_CRC32)
 #include <rte_hash_crc.h>
-#define DEFAULT_HASH_FUNC       rte_hash_crc
-#else
 #include <rte_jhash.h>
-#define DEFAULT_HASH_FUNC       rte_jhash
-#endif
 
 #if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
 /*
@@ -103,6 +97,10 @@ enum add_key_case {
 /** Number of items per bucket. */
 #define RTE_HASH_BUCKET_ENTRIES                8
 
+#if !RTE_IS_POWER_OF_2(RTE_HASH_BUCKET_ENTRIES)
+#error RTE_HASH_BUCKET_ENTRIES must be a power of 2
+#endif
+
 #define NULL_SIGNATURE                 0
 
 #define EMPTY_SLOT                     0