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)
.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;
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();