DPDK patches and discussions
 help / color / mirror / Atom feed
From: Didier Pallard <didier.pallard@6wind.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v3 1/2] test: fix CRC hash function autotest
Date: Fri, 19 Feb 2016 12:00:30 +0100	[thread overview]
Message-ID: <1455879631-18420-2-git-send-email-didier.pallard@6wind.com> (raw)
In-Reply-To: <1455879631-18420-1-git-send-email-didier.pallard@6wind.com>

Add some small key lengthes (below 4 bytes), and fix odd key lengthes
expected returned values for CRC computation to match real CRC values.

Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
---
 app/test/test_hash_functions.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/app/test/test_hash_functions.c b/app/test/test_hash_functions.c
index 3ad6d80..f767a48 100644
--- a/app/test/test_hash_functions.c
+++ b/app/test/test_hash_functions.c
@@ -54,26 +54,30 @@
  * e.g.: key size = 4, key = 0x03020100
  *       key size = 8, key = 0x0706050403020100
  */
-static uint32_t hash_values_jhash[2][10] = {{
+static uint32_t hash_values_jhash[2][12] = {{
+	0x8ba9414b, 0xdf0d39c9,
 	0xe4cf1d42, 0xd4ccb93c, 0x5e84eafc, 0x21362cfe,
 	0x2f4775ab, 0x9ff036cc, 0xeca51474, 0xbc9d6816,
 	0x12926a31, 0x1c9fa888
 },
 {
+	0x5c62c303, 0x1b8cf784,
 	0x8270ac65, 0x05fa6668, 0x762df861, 0xda088f2f,
 	0x59614cd4, 0x7a94f690, 0xdc1e4993, 0x30825494,
 	0x91d0e462, 0x768087fc
 }
 };
-static uint32_t hash_values_crc[2][10] = {{
+static uint32_t hash_values_crc[2][12] = {{
+	0x00000000, 0xf26b8303,
 	0x91545164, 0x06040eb1, 0x9bb99201, 0xcc4c4fe4,
-	0x14a90993, 0xf8a5dd8c, 0xc62beb31, 0x32bf340e,
-	0x72f9d22b, 0x4a11475e
+	0x14a90993, 0xf8a5dd8c, 0xcaa1ad0b, 0x7ac1e03e,
+	0x43f44466, 0x4a11475e
 },
 {
+	0xbdfd3980, 0x70204542,
 	0x98cd4c70, 0xd52c702f, 0x41fc0e1c, 0x3905f65c,
-	0x94bff47f, 0x1bab102d, 0xd2911ed7, 0xe8faa813,
-	0x6bea184b, 0x53028d3e
+	0x94bff47f, 0x1bab102d, 0xf4a2c645, 0xbf441539,
+	0x789c104f, 0x53028d3e
 }
 };
 
@@ -89,6 +93,7 @@ static uint32_t hash_values_crc[2][10] = {{
 static rte_hash_function hashtest_funcs[] = {rte_jhash, rte_hash_crc};
 static uint32_t hashtest_initvals[] = {0, 0xdeadbeef};
 static uint32_t hashtest_key_lens[] = {
+	1, 2,                 /* Unusual key sizes */
 	4, 8, 16, 32, 48, 64, /* standard key sizes */
 	9,                    /* IPv4 SRC + DST + protocol, unpadded */
 	13,                   /* IPv4 5-tuple, unpadded */
-- 
2.1.4

  reply	other threads:[~2016-02-19 11:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-22  9:34 [dpdk-dev] [PATCH] hash: fix CRC32c computation Didier Pallard
2015-12-23  9:12 ` Qiu, Michael
2015-12-23 11:37   ` Vincent JARDIN
     [not found]     ` <E115CCD9D858EF4F90C690B0DCB4D8973C8A16BD@IRSMSX108.ger.corp.intel.com>
2016-02-08 14:43       ` De Lara Guarch, Pablo
2016-02-09  9:34 ` [dpdk-dev] [PATCH v2] " Didier Pallard
2016-02-10 12:16   ` De Lara Guarch, Pablo
2016-02-19 11:00   ` [dpdk-dev] [PATCH v3 0/2] Fix " Didier Pallard
2016-02-19 11:00     ` Didier Pallard [this message]
2016-02-19 11:00     ` [dpdk-dev] [PATCH v3 2/2] hash: fix " Didier Pallard
2016-02-19 15:08     ` [dpdk-dev] [PATCH v3 0/2] Fix " De Lara Guarch, Pablo
2016-03-01 13:31       ` Thomas Monjalon
2016-02-10 14:35 ` [dpdk-dev] [PATCH] hash: fix " Pattan, Reshma
2016-02-11  8:21   ` Didier Pallard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1455879631-18420-2-git-send-email-didier.pallard@6wind.com \
    --to=didier.pallard@6wind.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).