| 295 | } |
| 296 | |
| 297 | static 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 | |
| 341 | static int |
| 342 | test_stack_perf(void) |
no test coverage detected