| 246 | }; |
| 247 | |
| 248 | static int control_thread_init(void *arg) |
| 249 | { |
| 250 | struct internal_config *internal_conf = |
| 251 | eal_get_internal_configuration(); |
| 252 | rte_cpuset_t *cpuset = &internal_conf->ctrl_cpuset; |
| 253 | struct control_thread_params *params = arg; |
| 254 | |
| 255 | __rte_thread_init(rte_lcore_id(), cpuset); |
| 256 | /* Set control thread socket ID to SOCKET_ID_ANY |
| 257 | * as control threads may be scheduled on any NUMA node. |
| 258 | */ |
| 259 | RTE_PER_LCORE(_socket_id) = SOCKET_ID_ANY; |
| 260 | params->ret = rte_thread_set_affinity_by_id(rte_thread_self(), cpuset); |
| 261 | if (params->ret != 0) { |
| 262 | rte_atomic_store_explicit(¶ms->status, |
| 263 | CTRL_THREAD_ERROR, rte_memory_order_release); |
| 264 | return 1; |
| 265 | } |
| 266 | |
| 267 | rte_atomic_store_explicit(¶ms->status, |
| 268 | CTRL_THREAD_RUNNING, rte_memory_order_release); |
| 269 | |
| 270 | return 0; |
| 271 | } |
| 272 | |
| 273 | static uint32_t control_thread_start(void *arg) |
| 274 | { |
no test coverage detected