| 326 | #define TIME_MS 100 |
| 327 | |
| 328 | static int |
| 329 | load_loop_fn_helper(struct thread_params *p, const int esize) |
| 330 | { |
| 331 | uint64_t time_diff = 0; |
| 332 | uint64_t begin = 0; |
| 333 | uint64_t hz = rte_get_timer_hz(); |
| 334 | uint64_t lcount = 0; |
| 335 | const unsigned int lcore = rte_lcore_id(); |
| 336 | struct thread_params *params = p; |
| 337 | void *burst = NULL; |
| 338 | |
| 339 | burst = test_ring_calloc(MAX_BURST, esize); |
| 340 | if (burst == NULL) |
| 341 | return -1; |
| 342 | |
| 343 | /* wait synchro for workers */ |
| 344 | if (lcore != rte_get_main_lcore()) |
| 345 | rte_wait_until_equal_32(&synchro, 1, __ATOMIC_RELAXED); |
| 346 | |
| 347 | begin = rte_get_timer_cycles(); |
| 348 | while (time_diff < hz * TIME_MS / 1000) { |
| 349 | test_ring_enqueue(params->r, burst, esize, params->size, |
| 350 | TEST_RING_THREAD_MPMC | TEST_RING_ELEM_BULK); |
| 351 | test_ring_dequeue(params->r, burst, esize, params->size, |
| 352 | TEST_RING_THREAD_MPMC | TEST_RING_ELEM_BULK); |
| 353 | lcount++; |
| 354 | time_diff = rte_get_timer_cycles() - begin; |
| 355 | } |
| 356 | queue_count[lcore] = lcount; |
| 357 | |
| 358 | rte_free(burst); |
| 359 | |
| 360 | return 0; |
| 361 | } |
| 362 | |
| 363 | static int |
| 364 | load_loop_fn(void *p) |
no test coverage detected