| 304 | } |
| 305 | |
| 306 | static int |
| 307 | test_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 | |
| 342 | static int |
| 343 | __test_stack(uint32_t flags) |
no test coverage detected