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

Function __test_stack_perf

dpdk/app/test/test_stack_perf.c:297–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295}
296
297static int
298__test_stack_perf(uint32_t flags)
299{
300 struct lcore_pair cores;
301 struct rte_stack *s;
302
303 __atomic_store_n(&lcore_barrier, 0, __ATOMIC_RELAXED);
304
305 s = rte_stack_create(STACK_NAME, STACK_SIZE, rte_socket_id(), flags);
306 if (s == NULL) {
307 printf("[%s():%u] failed to create a stack\n",
308 __func__, __LINE__);
309 return -1;
310 }
311
312 printf("### Testing single element push/pop ###\n");
313 test_single_push_pop(s);
314
315 printf("\n### Testing empty pop ###\n");
316 test_empty_pop(s);
317
318 printf("\n### Testing using a single lcore ###\n");
319 test_bulk_push_pop(s);
320
321 if (get_two_hyperthreads(&cores) == 0) {
322 printf("\n### Testing using two hyperthreads ###\n");
323 run_on_core_pair(&cores, s, bulk_push_pop);
324 }
325 if (get_two_cores(&cores) == 0) {
326 printf("\n### Testing using two physical cores ###\n");
327 run_on_core_pair(&cores, s, bulk_push_pop);
328 }
329 if (get_two_sockets(&cores) == 0) {
330 printf("\n### Testing using two NUMA nodes ###\n");
331 run_on_core_pair(&cores, s, bulk_push_pop);
332 }
333
334 printf("\n### Testing on all %u lcores ###\n", rte_lcore_count());
335 run_on_n_cores(s, bulk_push_pop, rte_lcore_count());
336
337 rte_stack_free(s);
338 return 0;
339}
340
341static int
342test_stack_perf(void)

Callers 2

test_stack_perfFunction · 0.85
test_lf_stack_perfFunction · 0.85

Calls 13

rte_stack_createFunction · 0.85
rte_socket_idFunction · 0.85
test_single_push_popFunction · 0.85
test_empty_popFunction · 0.85
test_bulk_push_popFunction · 0.85
rte_lcore_countFunction · 0.85
run_on_n_coresFunction · 0.85
rte_stack_freeFunction · 0.85
get_two_hyperthreadsFunction · 0.70
run_on_core_pairFunction · 0.70
get_two_coresFunction · 0.70
get_two_socketsFunction · 0.70

Tested by

no test coverage detected