DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yipeng Wang <yipeng1.wang@intel.com>
To: bruce.richardson@intel.com
Cc: stephen@networkplumber.org, dev@dpdk.org, yipeng1.wang@intel.com,
	honnappa.nagarahalli@arm.com, sameh.gobriel@intel.com
Subject: [dpdk-dev] [PATCH v1 2/3] test/hash: change multiwriter test to use jhash
Date: Wed, 10 Oct 2018 14:48:04 -0700	[thread overview]
Message-ID: <1539208085-30756-3-git-send-email-yipeng1.wang@intel.com> (raw)
In-Reply-To: <1539208085-30756-1-git-send-email-yipeng1.wang@intel.com>

With sequential key, the test will cover more corner
cases with jhash instead of crc hash, since jhash
generates more random hash pattern on sequential key.
It is useful for functional verification.

Signed-off-by: Yipeng Wang <yipeng1.wang@intel.com>
---
 test/test/test_hash_multiwriter.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/test/test/test_hash_multiwriter.c b/test/test/test_hash_multiwriter.c
index 6a3eb10..7f2deae 100644
--- a/test/test/test_hash_multiwriter.c
+++ b/test/test/test_hash_multiwriter.c
@@ -12,6 +12,7 @@
 #include <rte_malloc.h>
 #include <rte_random.h>
 #include <rte_spinlock.h>
+#include <rte_jhash.h>
 
 #include "test.h"
 
@@ -95,7 +96,7 @@ test_hash_multiwriter_worker(void *arg)
 
 
 static int
-test_hash_multiwriter(void)
+test_hash_multiwriter(int use_jhash)
 {
 	unsigned int i, rounded_nb_total_tsx_insertion;
 	static unsigned calledCount = 1;
@@ -108,10 +109,14 @@ test_hash_multiwriter(void)
 	struct rte_hash_parameters hash_params = {
 		.entries = nb_entries,
 		.key_len = sizeof(uint32_t),
-		.hash_func = rte_hash_crc,
 		.hash_func_init_val = 0,
 		.socket_id = rte_socket_id(),
 	};
+	if (use_jhash)
+		hash_params.hash_func = rte_jhash;
+	else
+		hash_params.hash_func = rte_hash_crc;
+
 	if (use_htm)
 		hash_params.extra_flag =
 			RTE_HASH_EXTRA_FLAGS_TRANS_MEM_SUPPORT
@@ -259,6 +264,8 @@ test_hash_multiwriter(void)
 static int
 test_hash_multiwriter_main(void)
 {
+	int use_jhash = 1;
+
 	if (rte_lcore_count() == 1) {
 		printf("More than one lcore is required to do multiwriter test\n");
 		return 0;
@@ -278,13 +285,13 @@ test_hash_multiwriter_main(void)
 		printf("Test multi-writer with Hardware transactional memory\n");
 
 		use_htm = 1;
-		if (test_hash_multiwriter() < 0)
+		if (test_hash_multiwriter(use_jhash) < 0)
 			return -1;
 	}
 
 	printf("Test multi-writer without Hardware transactional memory\n");
 	use_htm = 0;
-	if (test_hash_multiwriter() < 0)
+	if (test_hash_multiwriter(use_jhash) < 0)
 		return -1;
 
 	return 0;
-- 
2.7.4

  parent reply	other threads:[~2018-10-11  4:52 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-10 21:48 [dpdk-dev] [PATCH v1 0/3] Improvements over rte hash and tests Yipeng Wang
2018-10-10 21:48 ` [dpdk-dev] [PATCH v1 1/3] hash: fix unnecessary pause Yipeng Wang
2018-10-10 21:48 ` Yipeng Wang [this message]
2018-10-11 11:27   ` [dpdk-dev] [PATCH v1 2/3] test/hash: change multiwriter test to use jhash Bruce Richardson
2018-10-10 21:48 ` [dpdk-dev] [PATCH v1 3/3] test/hash: add readwrite test for ext table Yipeng Wang
2018-10-24 20:36   ` Bruce Richardson
2018-10-25  1:06     ` Wang, Yipeng1
2018-10-26  0:23     ` Honnappa Nagarahalli
2018-10-26 10:12       ` Bruce Richardson
2018-10-29  5:54         ` Honnappa Nagarahalli
2018-10-31  4:21         ` Honnappa Nagarahalli
2018-11-01  4:54   ` [dpdk-dev] [PATCH 0/3] hash: deprecate lock ellision and read/write concurreny flags Honnappa Nagarahalli
2018-11-01  4:54     ` [dpdk-dev] [PATCH 1/3] " Honnappa Nagarahalli
2018-11-01  9:45       ` Bruce Richardson
2018-11-01  9:48         ` Bruce Richardson
2018-11-01 19:43         ` Honnappa Nagarahalli
2018-11-02 11:11           ` Bruce Richardson
2018-11-01 23:25       ` [dpdk-dev] [PATCH v2 0/4] " Honnappa Nagarahalli
2018-11-01 23:25         ` [dpdk-dev] [PATCH v2 1/4] hash: prepare for deprecation of flags Honnappa Nagarahalli
2018-11-02 11:14           ` Bruce Richardson
2018-11-01 23:25         ` [dpdk-dev] [PATCH v2 2/4] hash: deprecate lock ellision and read/write concurreny flags Honnappa Nagarahalli
2018-11-01 23:25         ` [dpdk-dev] [PATCH v2 3/4] test/hash: stop using " Honnappa Nagarahalli
2018-11-01 23:25         ` [dpdk-dev] [PATCH v2 4/4] doc/hash: deprecate " Honnappa Nagarahalli
2018-11-02 11:21           ` Bruce Richardson
2018-11-02 11:25         ` [dpdk-dev] [PATCH v2 0/4] hash: " Bruce Richardson
2018-11-02 17:38           ` Honnappa Nagarahalli
2018-12-20 20:10             ` Yigit, Ferruh
2018-11-01  4:54     ` [dpdk-dev] [PATCH 2/3] test/hash: stop using " Honnappa Nagarahalli
2018-11-01  4:54     ` [dpdk-dev] [PATCH 3/3] doc/hash: deprecate " Honnappa Nagarahalli

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=1539208085-30756-3-git-send-email-yipeng1.wang@intel.com \
    --to=yipeng1.wang@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=honnappa.nagarahalli@arm.com \
    --cc=sameh.gobriel@intel.com \
    --cc=stephen@networkplumber.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).