mbuf: fix performance with 128-byte cache line
[dpdk.git] / app / test / test_hash_functions.c
index df7c909..3ad6d80 100644 (file)
@@ -85,7 +85,7 @@ static uint32_t hash_values_crc[2][10] = {{
  * from the array entries is tested.
  */
 #define HASHTEST_ITERATIONS 1000000
-
+#define MAX_KEYSIZE 64
 static rte_hash_function hashtest_funcs[] = {rte_jhash, rte_hash_crc};
 static uint32_t hashtest_initvals[] = {0, 0xdeadbeef};
 static uint32_t hashtest_key_lens[] = {
@@ -119,7 +119,7 @@ static void
 run_hash_func_perf_test(uint32_t key_len, uint32_t init_val,
                rte_hash_function f)
 {
-       static uint8_t key[HASHTEST_ITERATIONS][RTE_HASH_KEY_LENGTH_MAX];
+       static uint8_t key[HASHTEST_ITERATIONS][MAX_KEYSIZE];
        uint64_t ticks, start, end;
        unsigned i, j;
 
@@ -223,7 +223,7 @@ 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_jhash_32b((const uint32_t *)key,
+                               hash32 = rte_jhash_32b((const unaligned_uint32_t *)key,
                                                hashtest_key_lens[i] >> 2,
                                                hashtest_initvals[j]);
                                if (hash != hash32) {