From patchwork Fri Sep 4 09:05:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "De Lara Guarch, Pablo" X-Patchwork-Id: 6876 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 600FD8D95; Fri, 4 Sep 2015 11:05:49 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id A88E18D8B for ; Fri, 4 Sep 2015 11:05:46 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 04 Sep 2015 02:05:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,468,1437462000"; d="scan'208";a="798107763" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga002.fm.intel.com with ESMTP; 04 Sep 2015 02:05:44 -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 t8495h3U007436; Fri, 4 Sep 2015 10:05:43 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id t8495hiA009863; Fri, 4 Sep 2015 10:05:43 +0100 Received: (from pdelarax@localhost) by sivswdev02.ir.intel.com with id t8495hnB009859; Fri, 4 Sep 2015 10:05:43 +0100 From: Pablo de Lara To: dev@dpdk.org Date: Fri, 4 Sep 2015 10:05:40 +0100 Message-Id: <1441357542-9820-2-git-send-email-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1441357542-9820-1-git-send-email-pablo.de.lara.guarch@intel.com> References: <1441357542-9820-1-git-send-email-pablo.de.lara.guarch@intel.com> Subject: [dpdk-dev] [PATCH 1/3] hash: use max key length as internal macro instead of deprecated one 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" RTE_HASH_KEY_LENGTH_MAX has been deprecated in DPDK 2.1 and it is going to be removed in 2.2, so the macro is defined internally for the memory allocation of all keys used. Signed-off-by: Pablo de Lara --- app/test/test_hash.c | 7 ++++--- app/test/test_hash_functions.c | 4 ++-- app/test/test_hash_perf.c | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/test/test_hash.c b/app/test/test_hash.c index 7f8c0d3..4f2509d 100644 --- a/app/test/test_hash.c +++ b/app/test/test_hash.c @@ -66,6 +66,7 @@ static rte_hash_function hashtest_funcs[] = {rte_jhash, rte_hash_crc}; static uint32_t hashtest_initvals[] = {0}; static uint32_t hashtest_key_lens[] = {0, 2, 4, 5, 6, 7, 8, 10, 11, 15, 16, 21, 31, 32, 33, 63, 64}; +#define MAX_KEYSIZE 64 /******************************************************************************/ #define LOCAL_FBK_HASH_ENTRIES_MAX (1 << 15) @@ -238,7 +239,7 @@ test_crc32_hash_alg_equiv(void) static void run_hash_func_test(rte_hash_function f, uint32_t init_val, uint32_t key_len) { - static uint8_t key[RTE_HASH_KEY_LENGTH_MAX]; + static uint8_t key[MAX_KEYSIZE]; unsigned i; @@ -1100,7 +1101,7 @@ test_hash_creation_with_good_parameters(void) static int test_average_table_utilization(void) { struct rte_hash *handle; - uint8_t simple_key[RTE_HASH_KEY_LENGTH_MAX]; + uint8_t simple_key[MAX_KEYSIZE]; unsigned i, j; unsigned added_keys, average_keys_added = 0; int ret; @@ -1154,7 +1155,7 @@ static int test_hash_iteration(void) { struct rte_hash *handle; unsigned i; - uint8_t keys[NUM_ENTRIES][RTE_HASH_KEY_LENGTH_MAX]; + uint8_t keys[NUM_ENTRIES][MAX_KEYSIZE]; const void *next_key; void *next_data; void *data[NUM_ENTRIES]; diff --git a/app/test/test_hash_functions.c b/app/test/test_hash_functions.c index 8c7cf63..3ad6d80 100644 --- a/app/test/test_hash_functions.c +++ b/app/test/test_hash_functions.c @@ -85,7 +85,7 @@ static uint32_t hash_values_crc[2][10] = {{ * from the array entries is tested. */ #define HASHTEST_ITERATIONS 1000000 - +#define MAX_KEYSIZE 64 static rte_hash_function hashtest_funcs[] = {rte_jhash, rte_hash_crc}; static uint32_t hashtest_initvals[] = {0, 0xdeadbeef}; static uint32_t hashtest_key_lens[] = { @@ -119,7 +119,7 @@ static void run_hash_func_perf_test(uint32_t key_len, uint32_t init_val, rte_hash_function f) { - static uint8_t key[HASHTEST_ITERATIONS][RTE_HASH_KEY_LENGTH_MAX]; + static uint8_t key[HASHTEST_ITERATIONS][MAX_KEYSIZE]; uint64_t ticks, start, end; unsigned i, j; diff --git a/app/test/test_hash_perf.c b/app/test/test_hash_perf.c index a87fc80..9d53c14 100644 --- a/app/test/test_hash_perf.c +++ b/app/test/test_hash_perf.c @@ -140,7 +140,7 @@ shuffle_input_keys(unsigned table_index) { unsigned i; uint32_t swap_idx; - uint8_t temp_key[RTE_HASH_KEY_LENGTH_MAX]; + uint8_t temp_key[MAX_KEYSIZE]; hash_sig_t temp_signature; int32_t temp_position;