| 345 | } |
| 346 | |
| 347 | int32_t |
| 348 | rte_service_runstate_get(uint32_t id) |
| 349 | { |
| 350 | struct rte_service_spec_impl *s; |
| 351 | SERVICE_VALID_GET_OR_ERR_RET(id, s, -EINVAL); |
| 352 | |
| 353 | /* comp_runstate and app_runstate act as the guard variables. |
| 354 | * Use load-acquire memory order. This synchronizes with |
| 355 | * store-release in service state set functions. |
| 356 | */ |
| 357 | if (rte_atomic_load_explicit(&s->comp_runstate, rte_memory_order_acquire) == |
| 358 | RUNSTATE_RUNNING && |
| 359 | rte_atomic_load_explicit(&s->app_runstate, rte_memory_order_acquire) == |
| 360 | RUNSTATE_RUNNING) { |
| 361 | int check_disabled = !(s->internal_flags & |
| 362 | SERVICE_F_START_CHECK); |
| 363 | int lcore_mapped = (rte_atomic_load_explicit(&s->num_mapped_cores, |
| 364 | rte_memory_order_relaxed) > 0); |
| 365 | |
| 366 | return (check_disabled | lcore_mapped); |
| 367 | } else |
| 368 | return 0; |
| 369 | |
| 370 | } |
| 371 | |
| 372 | static inline void |
| 373 | service_runner_do_callback(struct rte_service_spec_impl *s, |
no outgoing calls