summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorPablo de Lara <pablo.de.lara.guarch@intel.com>2015-09-04 10:05:40 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2015-09-04 15:56:58 +0200
commit0f201fe961d75b7a920d6c1649f462feb47631a6 (patch)
tree61d8023a70a136baa5c4c170ee46283ad9710f67 /app
parent2b9c06e78b3ef2059053c831ba7b533fa749e231 (diff)
downloaddpdk-0f201fe961d75b7a920d6c1649f462feb47631a6.zip
dpdk-0f201fe961d75b7a920d6c1649f462feb47631a6.tar.gz
dpdk-0f201fe961d75b7a920d6c1649f462feb47631a6.tar.xz
hash: remove deprecated function and macros
The function rte_jhash2() was renamed rte_jhash_32b and macros RTE_HASH_KEY_LENGTH_MAX and RTE_HASH_BUCKET_ENTRIES_MAX were tagged as deprecated, so they can be removed in 2.2. RTE_HASH_KEY_LENGTH is replaced in unit tests by an internal macro for the memory allocation of all keys used. The library version number is incremented. Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Diffstat (limited to 'app')
-rw-r--r--app/test/test_hash.c7
-rw-r--r--app/test/test_hash_functions.c4
-rw-r--r--app/test/test_hash_perf.c2
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;