From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 10985293B for ; Thu, 25 Oct 2018 03:14:47 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Oct 2018 18:14:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,422,1534834800"; d="scan'208";a="244139400" Received: from skx-yipeng.jf.intel.com ([10.54.81.175]) by orsmga004.jf.intel.com with ESMTP; 24 Oct 2018 18:14:46 -0700 From: Yipeng Wang To: bruce.richardson@intel.com Cc: stephen@networkplumber.org, dev@dpdk.org, yipeng1.wang@intel.com, honnappa.nagarahalli@arm.com, sameh.gobriel@intel.com Date: Wed, 24 Oct 2018 11:09:28 -0700 Message-Id: <1540404570-102126-3-git-send-email-yipeng1.wang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1540404570-102126-1-git-send-email-yipeng1.wang@intel.com> References: <1540404570-102126-1-git-send-email-yipeng1.wang@intel.com> Subject: [dpdk-dev] [PATCH v2 2/4] test/hash: change multiwriter test to use jhash X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2018 01:14:48 -0000 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 --- test/test/test_hash_multiwriter.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/test/test_hash_multiwriter.c b/test/test/test_hash_multiwriter.c index 6a3eb10..456bc5f 100644 --- a/test/test/test_hash_multiwriter.c +++ b/test/test/test_hash_multiwriter.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "test.h" @@ -31,6 +32,9 @@ #define RTE_APP_TEST_HASH_MULTIWRITER_FAILED 0 +/* Use jhash or crc hash */ +#define USE_JHASH 1 + struct { uint32_t *keys; uint32_t *found; @@ -108,10 +112,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 -- 2.7.4