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

Function test_stack_multithreaded

dpdk/app/test/test_stack.c:306–340  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

304}
305
306static int
307test_stack_multithreaded(uint32_t flags)
308{
309 unsigned int lcore_id;
310 struct rte_stack *s;
311 int result = 0;
312
313 if (rte_lcore_count() < 2) {
314 printf("Not enough cores for test_stack_multithreaded, expecting at least 2\n");
315 return TEST_SKIPPED;
316 }
317
318 printf("[%s():%u] Running with %u lcores\n",
319 __func__, __LINE__, rte_lcore_count());
320
321 s = rte_stack_create("test", MAX_BULK * rte_lcore_count(), rte_socket_id(), flags);
322 if (s == NULL) {
323 printf("[%s():%u] Failed to create a stack\n",
324 __func__, __LINE__);
325 return -1;
326 }
327
328 thread_test_args.s = s;
329
330 if (rte_eal_mp_remote_launch(stack_thread_push_pop, NULL, CALL_MAIN))
331 rte_panic("Failed to launch tests\n");
332
333 RTE_LCORE_FOREACH(lcore_id) {
334 if (rte_eal_wait_lcore(lcore_id) < 0)
335 result = -1;
336 }
337
338 rte_stack_free(s);
339 return result;
340}
341
342static int
343__test_stack(uint32_t flags)

Callers 1

__test_stackFunction · 0.85

Calls 7

rte_lcore_countFunction · 0.85
rte_stack_createFunction · 0.85
rte_socket_idFunction · 0.85
rte_eal_mp_remote_launchFunction · 0.85
rte_eal_wait_lcoreFunction · 0.85
rte_stack_freeFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected