git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
virtio: suport multiple MAC addresses
[dpdk.git]
/
app
/
test
/
test_hash_perf.c
diff --git
a/app/test/test_hash_perf.c
b/app/test/test_hash_perf.c
index
d3e9990
..
be34957
100644
(file)
--- a/
app/test/test_hash_perf.c
+++ b/
app/test/test_hash_perf.c
@@
-53,8
+53,6
@@
#include "test.h"
#include "test.h"
-#ifdef RTE_LIBRTE_HASH
-
#include <rte_hash.h>
#include <rte_fbk_hash.h>
#include <rte_jhash.h>
#include <rte_hash.h>
#include <rte_fbk_hash.h>
#include <rte_jhash.h>
@@
-399,6
+397,7
@@
struct tbl_perf_test_params tbl_perf_params[] =
if (cond) { \
printf("ERROR line %d: " str "\n", __LINE__, ##__VA_ARGS__); \
if (handle) rte_fbk_hash_free(handle); \
if (cond) { \
printf("ERROR line %d: " str "\n", __LINE__, ##__VA_ARGS__); \
if (handle) rte_fbk_hash_free(handle); \
+ if (keys) rte_free(keys); \
return -1; \
} \
} while(0)
return -1; \
} \
} while(0)
@@
-699,8
+698,8
@@
fbk_hash_perf_test(void)
.entries_per_bucket = 4,
.socket_id = rte_socket_id(),
};
.entries_per_bucket = 4,
.socket_id = rte_socket_id(),
};
- struct rte_fbk_hash_table *handle;
- uint32_t
keys[ENTRIES] = {0}
;
+ struct rte_fbk_hash_table *handle
= NULL
;
+ uint32_t
*keys = NULL
;
unsigned indexes[TEST_SIZE];
uint64_t lookup_time = 0;
unsigned added = 0;
unsigned indexes[TEST_SIZE];
uint64_t lookup_time = 0;
unsigned added = 0;
@@
-710,6
+709,10
@@
fbk_hash_perf_test(void)
handle = rte_fbk_hash_create(¶ms);
RETURN_IF_ERROR_FBK(handle == NULL, "fbk hash creation failed");
handle = rte_fbk_hash_create(¶ms);
RETURN_IF_ERROR_FBK(handle == NULL, "fbk hash creation failed");
+ keys = rte_zmalloc(NULL, ENTRIES * sizeof(*keys), 0);
+ RETURN_IF_ERROR_FBK(keys == NULL,
+ "fbk hash: memory allocation for key store failed");
+
/* Generate random keys and values. */
for (i = 0; i < ENTRIES; i++) {
uint32_t key = (uint32_t)rte_rand();
/* Generate random keys and values. */
for (i = 0; i < ENTRIES; i++) {
uint32_t key = (uint32_t)rte_rand();
@@
-778,4
+781,3
@@
static struct test_command hash_perf_cmd = {
.callback = test_hash_perf,
};
REGISTER_TEST_COMMAND(hash_perf_cmd);
.callback = test_hash_perf,
};
REGISTER_TEST_COMMAND(hash_perf_cmd);
-#endif /* RTE_LIBRTE_HASH */