MCPcopy Create free account
hub / github.com/F-Stack/f-stack / load_loop_fn_helper

Function load_loop_fn_helper

dpdk/app/test/test_ring_perf.c:328–361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

326#define TIME_MS 100
327
328static int
329load_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
363static int
364load_loop_fn(void *p)

Callers 2

load_loop_fnFunction · 0.85
load_loop_fn_16BFunction · 0.85

Calls 7

rte_lcore_idFunction · 0.85
test_ring_callocFunction · 0.85
rte_get_main_lcoreFunction · 0.85
test_ring_enqueueFunction · 0.85
test_ring_dequeueFunction · 0.85
rte_freeFunction · 0.85
rte_wait_until_equal_32Function · 0.50

Tested by

no test coverage detected