[dpdk-dev] [PATCH v5 03/10] test/hash: update key size range and initial values for testing

Pablo de Lara pablo.de.lara.guarch at intel.com
Fri May 22 12:16:04 CEST 2015


Previous key sizes used for testing did not have much purpose.
This patch substitutes them with some more meaninful
(standard multiple of 2 key sizes, plus IPv4/v6 tuple and others)

Also an arbitrary initial value has been added
to increase the test coverage.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch at intel.com>
---
 app/test/test_hash_functions.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/app/test/test_hash_functions.c b/app/test/test_hash_functions.c
index 767b2bc..973fbe8 100644
--- a/app/test/test_hash_functions.c
+++ b/app/test/test_hash_functions.c
@@ -57,8 +57,14 @@
 #define HASHTEST_ITERATIONS 1000000
 
 static rte_hash_function hashtest_funcs[] = {rte_jhash, rte_hash_crc};
-static uint32_t hashtest_initvals[] = {0};
-static uint32_t hashtest_key_lens[] = {2, 4, 5, 6, 7, 8, 10, 11, 15, 16, 21, 31, 32, 33, 63, 64};
+static uint32_t hashtest_initvals[] = {0, 0xdeadbeef};
+static uint32_t hashtest_key_lens[] = {
+ 4, 8, 16, 32, 48, 64, /* standard key sizes */
+ 9,                    /* IPv4 SRC + DST + protocol, unpadded */
+ 13,                   /* IPv4 5-tuple, unpadded */
+ 37,                   /* IPv6 5-tuple, unpadded */
+ 40                    /* IPv6 5-tuple, padded to 8-byte boundary */
+};
 /******************************************************************************/
 
 /*
-- 
1.7.4.1



More information about the dev mailing list