| 250 | } |
| 251 | |
| 252 | static int |
| 253 | generate_keys(void) |
| 254 | { |
| 255 | uint32_t *keys = NULL; |
| 256 | uint32_t *keys_no_ks = NULL; |
| 257 | uint32_t *keys_ks = NULL; |
| 258 | uint32_t *keys_absent = NULL; |
| 259 | uint32_t *keys_non_shift_path = NULL; |
| 260 | uint32_t *keys_ext_bkt = NULL; |
| 261 | uint32_t *keys_ks_extbkt = NULL; |
| 262 | uint32_t *found = NULL; |
| 263 | uint32_t count_keys_no_ks = 0; |
| 264 | uint32_t count_keys_ks = 0; |
| 265 | uint32_t count_keys_extbkt = 0; |
| 266 | uint32_t i; |
| 267 | |
| 268 | if (init_params(0, 0, 0, 0) != 0) |
| 269 | return -1; |
| 270 | |
| 271 | /* |
| 272 | * keys will consist of a) keys whose addition to the hash table |
| 273 | * will result in shifting of the existing keys to their alternate |
| 274 | * locations b) keys whose addition to the hash table will not result |
| 275 | * in shifting of the existing keys. |
| 276 | */ |
| 277 | keys = rte_malloc(NULL, sizeof(uint32_t) * TOTAL_INSERT, 0); |
| 278 | if (keys == NULL) { |
| 279 | printf("RTE_MALLOC failed\n"); |
| 280 | goto err; |
| 281 | } |
| 282 | |
| 283 | /* |
| 284 | * keys_no_ks (no key-shifts): Subset of 'keys' - consists of keys that |
| 285 | * will NOT result in shifting of the existing keys to their alternate |
| 286 | * locations. Roughly around 900K keys. |
| 287 | */ |
| 288 | keys_no_ks = rte_malloc(NULL, sizeof(uint32_t) * TOTAL_INSERT, 0); |
| 289 | if (keys_no_ks == NULL) { |
| 290 | printf("RTE_MALLOC failed\n"); |
| 291 | goto err; |
| 292 | } |
| 293 | |
| 294 | /* |
| 295 | * keys_ks (key-shifts): Subset of 'keys' - consists of keys that will |
| 296 | * result in shifting of the existing keys to their alternate locations. |
| 297 | * Roughly around 146K keys. There might be repeating keys. More code is |
| 298 | * required to filter out these keys which will complicate the test case |
| 299 | */ |
| 300 | keys_ks = rte_malloc(NULL, sizeof(uint32_t) * TOTAL_INSERT, 0); |
| 301 | if (keys_ks == NULL) { |
| 302 | printf("RTE_MALLOC failed\n"); |
| 303 | goto err; |
| 304 | } |
| 305 | |
| 306 | /* Used to identify keys not inserted in the hash table */ |
| 307 | found = rte_zmalloc(NULL, sizeof(uint32_t) * TOTAL_INSERT, 0); |
| 308 | if (found == NULL) { |
| 309 | printf("RTE_MALLOC failed\n"); |
no test coverage detected