From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id A31372A61 for ; Tue, 5 May 2015 16:44:19 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 05 May 2015 07:43:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,373,1427785200"; d="scan'208";a="690228664" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga001.jf.intel.com with ESMTP; 05 May 2015 07:43:56 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t45Ehtl0022800; Tue, 5 May 2015 15:43:55 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id t45Eht98021118; Tue, 5 May 2015 15:43:55 +0100 Received: (from pdelarax@localhost) by sivswdev02.ir.intel.com with id t45Eht3w021114; Tue, 5 May 2015 15:43:55 +0100 From: Pablo de Lara To: dev@dpdk.org Date: Tue, 5 May 2015 15:43:54 +0100 Message-Id: <1430837034-21031-7-git-send-email-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1430837034-21031-1-git-send-email-pablo.de.lara.guarch@intel.com> References: <1429874587-17939-1-git-send-email-pablo.de.lara.guarch@intel.com> <1430837034-21031-1-git-send-email-pablo.de.lara.guarch@intel.com> Subject: [dpdk-dev] [PATCH v3 6/6] hash: rename rte_jhash2 to rte_jhash_32b X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 14:44:20 -0000 From: De Lara Guarch, Pablo Changed name to something more meaningful, and mark rte_jhash2 as deprecated. Signed-off-by: Pablo de Lara --- app/test/test_func_reentrancy.c | 2 +- app/test/test_hash.c | 4 ++-- lib/librte_hash/rte_jhash.h | 17 +++++++++++++++-- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/app/test/test_func_reentrancy.c b/app/test/test_func_reentrancy.c index dc070af..85504c0 100644 --- a/app/test/test_func_reentrancy.c +++ b/app/test/test_func_reentrancy.c @@ -228,7 +228,7 @@ hash_create_free(__attribute__((unused)) void *arg) .entries = 16, .bucket_entries = 4, .key_len = 4, - .hash_func = (rte_hash_function)rte_jhash2, + .hash_func = (rte_hash_function)rte_jhash_32b, .hash_func_init_val = 0, .socket_id = 0, }; diff --git a/app/test/test_hash.c b/app/test/test_hash.c index 1da27c5..4ecb11b 100644 --- a/app/test/test_hash.c +++ b/app/test/test_hash.c @@ -1177,7 +1177,7 @@ test_hash_add_delete_jhash2(void) hash_params_ex.name = "hash_test_jhash2"; hash_params_ex.key_len = 4; - hash_params_ex.hash_func = (rte_hash_function)rte_jhash2; + hash_params_ex.hash_func = (rte_hash_function)rte_jhash_32b; handle = rte_hash_create(&hash_params_ex); if (handle == NULL) { @@ -1216,7 +1216,7 @@ test_hash_add_delete_2_jhash2(void) hash_params_ex.name = "hash_test_2_jhash2"; hash_params_ex.key_len = 8; - hash_params_ex.hash_func = (rte_hash_function)rte_jhash2; + hash_params_ex.hash_func = (rte_hash_function)rte_jhash_32b; handle = rte_hash_create(&hash_params_ex); if (handle == NULL) diff --git a/lib/librte_hash/rte_jhash.h b/lib/librte_hash/rte_jhash.h index 6f05c4c..3a6e3f2 100644 --- a/lib/librte_hash/rte_jhash.h +++ b/lib/librte_hash/rte_jhash.h @@ -46,6 +46,8 @@ extern "C" { #include #include + +#include #include /* jhash.h: Jenkins hash support. @@ -276,7 +278,7 @@ rte_jhash_2hashes(const void *key, uint32_t length, uint32_t *pc, uint32_t *pb) * IN: second seed OUT: secondary hash value. */ static inline void -rte_jhash2_2hashes(const uint32_t *k, uint32_t length, uint32_t *pc, uint32_t *pb) +rte_jhash_32b_2hashes(const uint32_t *k, uint32_t length, uint32_t *pc, uint32_t *pb) { __rte_jhash_2hashes((const void *) k, (length << 2), pc, pb, 0); } @@ -319,11 +321,22 @@ rte_jhash(const void *key, uint32_t length, uint32_t initval) * Calculated hash value. */ static inline uint32_t +rte_jhash_32b(const uint32_t *k, uint32_t length, uint32_t initval) +{ + uint32_t initval2 = 0; + + rte_jhash_32b_2hashes(k, length, &initval, &initval2); + + return initval; +} + +static inline uint32_t rte_jhash2(const uint32_t *k, uint32_t length, uint32_t initval) { uint32_t initval2 = 0; - rte_jhash2_2hashes(k, length, &initval, &initval2); + RTE_LOG(WARNING, HASH, "rte_jhash2 is deprecated\n"); + rte_jhash_32b_2hashes(k, length, &initval, &initval2); return initval; } -- 1.7.4.1