.entries = 16,
.bucket_entries = 4,
.key_len = 4,
- .hash_func = (rte_hash_function)rte_jhash2,
+ .hash_func = (rte_hash_function)rte_jhash_32b,
.hash_func_init_val = 0,
.socket_id = 0,
};
hash_params_ex.name = "hash_test_jhash2";
hash_params_ex.key_len = 4;
- hash_params_ex.hash_func = (rte_hash_function)rte_jhash2;
+ hash_params_ex.hash_func = (rte_hash_function)rte_jhash_32b;
handle = rte_hash_create(&hash_params_ex);
if (handle == NULL) {
hash_params_ex.name = "hash_test_2_jhash2";
hash_params_ex.key_len = 8;
- hash_params_ex.hash_func = (rte_hash_function)rte_jhash2;
+ hash_params_ex.hash_func = (rte_hash_function)rte_jhash_32b;
handle = rte_hash_create(&hash_params_ex);
if (handle == NULL)
}
/*
- * Verify that rte_jhash and rte_jhash2 return the same
+ * Verify that rte_jhash and rte_jhash_32b return the same
*/
static int
verify_jhash_32bits(void)
hash = rte_jhash(key, hashtest_key_lens[i],
hashtest_initvals[j]);
/* Divide key length by 4 in rte_jhash for 32 bits */
- hash32 = rte_jhash2((const uint32_t *)key,
+ hash32 = rte_jhash_32b((const uint32_t *)key,
hashtest_key_lens[i] >> 2,
hashtest_initvals[j]);
if (hash != hash32) {
printf("rte_jhash returns different value (0x%x)"
- "than rte_jhash2 (0x%x)\n",
+ "than rte_jhash_32b (0x%x)\n",
hash, hash32);
return -1;
}
#include <stdint.h>
#include <string.h>
+
+#include <rte_log.h>
#include <rte_byteorder.h>
/* jhash.h: Jenkins hash support.
* IN: second seed OUT: secondary hash value.
*/
static inline void
-rte_jhash2_2hashes(const uint32_t *k, uint32_t length, uint32_t *pc, uint32_t *pb)
+rte_jhash_32b_2hashes(const uint32_t *k, uint32_t length, uint32_t *pc, uint32_t *pb)
{
__rte_jhash_2hashes((const void *) k, (length << 2), pc, pb, 0);
}
* Calculated hash value.
*/
static inline uint32_t
+rte_jhash_32b(const uint32_t *k, uint32_t length, uint32_t initval)
+{
+ uint32_t initval2 = 0;
+
+ rte_jhash_32b_2hashes(k, length, &initval, &initval2);
+
+ return initval;
+}
+
+static inline uint32_t
+__attribute__ ((deprecated))
rte_jhash2(const uint32_t *k, uint32_t length, uint32_t initval)
{
uint32_t initval2 = 0;
- rte_jhash2_2hashes(k, length, &initval, &initval2);
+ rte_jhash_32b_2hashes(k, length, &initval, &initval2);
return initval;
}