| 315 | } |
| 316 | |
| 317 | static int |
| 318 | timed_adds_sketch(struct member_perf_params *params, int type) |
| 319 | { |
| 320 | const uint64_t start_tsc = rte_rdtsc(); |
| 321 | unsigned int i, j, a; |
| 322 | int32_t ret; |
| 323 | |
| 324 | for (i = 0; i < NUM_ADDS / KEYS_TO_ADD; i++) { |
| 325 | for (j = 0; j < KEYS_TO_ADD; j++) { |
| 326 | if (type == SKETCH_BYTE) |
| 327 | ret = rte_member_add_byte_count(params->setsum[type], |
| 328 | &hh_keys[j], SKETCH_PKT_SIZE); |
| 329 | else |
| 330 | ret = rte_member_add(params->setsum[type], &hh_keys[j], 1); |
| 331 | if (ret < 0) { |
| 332 | printf("Error %d in rte_member_add - key=0x", ret); |
| 333 | for (a = 0; a < params->key_size; a++) |
| 334 | printf("%02x", hh_keys[j][a]); |
| 335 | printf("type: %d\n", type); |
| 336 | |
| 337 | return -1; |
| 338 | } |
| 339 | } |
| 340 | } |
| 341 | |
| 342 | const uint64_t end_tsc = rte_rdtsc(); |
| 343 | const uint64_t time_taken = end_tsc - start_tsc; |
| 344 | |
| 345 | cycles[type][params->cycle][ADD] = time_taken / NUM_ADDS; |
| 346 | |
| 347 | return 0; |
| 348 | } |
| 349 | |
| 350 | static int |
| 351 | timed_lookups(struct member_perf_params *params, int type) |
no test coverage detected