| 19 | }; |
| 20 | |
| 21 | static uint32_t thread_loop(void *arg) |
| 22 | { |
| 23 | struct thread_context *t = arg; |
| 24 | unsigned int lcore_id; |
| 25 | |
| 26 | lcore_id = rte_lcore_id(); |
| 27 | if (lcore_id != LCORE_ID_ANY) { |
| 28 | printf("Error: incorrect lcore id for new thread %u\n", lcore_id); |
| 29 | t->state = Thread_ERROR; |
| 30 | } |
| 31 | if (rte_thread_register() < 0) |
| 32 | printf("Warning: could not register new thread (this might be expected during this test), reason %s\n", |
| 33 | rte_strerror(rte_errno)); |
| 34 | lcore_id = rte_lcore_id(); |
| 35 | if ((t->lcore_id_any && lcore_id != LCORE_ID_ANY) || |
| 36 | (!t->lcore_id_any && lcore_id == LCORE_ID_ANY)) { |
| 37 | printf("Error: could not register new thread, got %u while %sexpecting %u\n", |
| 38 | lcore_id, t->lcore_id_any ? "" : "not ", LCORE_ID_ANY); |
| 39 | t->state = Thread_ERROR; |
| 40 | } |
| 41 | /* Report register happened to the control thread. */ |
| 42 | __atomic_fetch_add(t->registered_count, 1, __ATOMIC_RELEASE); |
| 43 | |
| 44 | /* Wait for release from the control thread. */ |
| 45 | while (__atomic_load_n(t->registered_count, __ATOMIC_ACQUIRE) != 0) |
| 46 | ; |
| 47 | rte_thread_unregister(); |
| 48 | lcore_id = rte_lcore_id(); |
| 49 | if (lcore_id != LCORE_ID_ANY) { |
| 50 | printf("Error: could not unregister new thread, %u still assigned\n", |
| 51 | lcore_id); |
| 52 | t->state = Thread_ERROR; |
| 53 | } |
| 54 | |
| 55 | if (t->state != Thread_ERROR) |
| 56 | t->state = Thread_DONE; |
| 57 | |
| 58 | return 0; |
| 59 | } |
| 60 | |
| 61 | static int |
| 62 | test_non_eal_lcores(unsigned int eal_threads_count) |
nothing calls this directly
no test coverage detected