@@ -468,7 +468,7 @@ wait_workers_to_join(int lcore, const rte_atomic32_t *count)
RTE_SET_USED(count);
print_cycles = cycles = rte_get_timer_cycles();
- while (rte_eal_get_lcore_state(lcore) != FINISHED) {
+ while (rte_eal_get_lcore_state(lcore) != WAIT) {
uint64_t new_cycles = rte_get_timer_cycles();
if (new_cycles - print_cycles > rte_get_timer_hz()) {
@@ -579,7 +579,7 @@ wait_workers_to_join(int lcore, const rte_atomic32_t *count)
RTE_SET_USED(count);
print_cycles = cycles = rte_get_timer_cycles();
- while (rte_eal_get_lcore_state(lcore) != FINISHED) {
+ while (rte_eal_get_lcore_state(lcore) != WAIT) {
uint64_t new_cycles = rte_get_timer_cycles();
if (new_cycles - print_cycles > rte_get_timer_hz()) {
@@ -3140,8 +3140,8 @@ worker_loopback(struct test *t, uint8_t disable_implicit_release)
rte_eal_remote_launch(worker_loopback_worker_fn, t, w_lcore);
print_cycles = cycles = rte_get_timer_cycles();
- while (rte_eal_get_lcore_state(p_lcore) != FINISHED ||
- rte_eal_get_lcore_state(w_lcore) != FINISHED) {
+ while (rte_eal_get_lcore_state(p_lcore) != WAIT ||
+ rte_eal_get_lcore_state(w_lcore) != WAIT) {
rte_service_run_iter_on_app_lcore(t->service_id, 1);
@@ -507,8 +507,7 @@ dead_core(__rte_unused void *ptr_data, const int id_core)
if (terminate_signal_received)
return;
printf("Dead core %i - restarting..\n", id_core);
- if (rte_eal_get_lcore_state(id_core) == FINISHED) {
- rte_eal_wait_lcore(id_core);
+ if (rte_eal_get_lcore_state(id_core) == WAIT) {
rte_eal_remote_launch(l2fwd_launch_one_lcore, NULL, id_core);
} else {
printf("..false positive!\n");
@@ -26,14 +26,11 @@ rte_eal_wait_lcore(unsigned worker_id)
if (lcore_config[worker_id].state == WAIT)
return 0;
- while (lcore_config[worker_id].state != WAIT &&
- lcore_config[worker_id].state != FINISHED)
+ while (lcore_config[worker_id].state != WAIT)
rte_pause();
rte_rmb();
- /* we are in finished state, go to wait state */
- lcore_config[worker_id].state = WAIT;
return lcore_config[worker_id].ret;
}
@@ -62,7 +59,7 @@ rte_eal_mp_remote_launch(int (*f)(void *), void *arg,
if (call_main == CALL_MAIN) {
lcore_config[main_lcore].ret = f(arg);
- lcore_config[main_lcore].state = FINISHED;
+ lcore_config[main_lcore].state = WAIT;
}
return 0;
@@ -28,7 +28,7 @@
/*
* Send a message to a worker lcore identified by worker_id to call a
* function f with argument arg. Once the execution is done, the
- * remote lcore switch in FINISHED state.
+ * remote lcore switches to WAIT state.
*/
int
rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned worker_id)
@@ -140,7 +140,7 @@ eal_thread_loop(__rte_unused void *arg)
lcore_config[lcore_id].f = NULL;
lcore_config[lcore_id].arg = NULL;
rte_wmb();
- lcore_config[lcore_id].state = FINISHED;
+ lcore_config[lcore_id].state = WAIT;
}
/* never reached */
@@ -19,9 +19,10 @@ extern "C" {
* State of an lcore.
*/
enum rte_lcore_state_t {
- WAIT, /**< waiting a new command */
- RUNNING, /**< executing command */
- FINISHED, /**< command executed */
+ WAIT,
+ /**< waiting for new command */
+ RUNNING,
+ /**< executing command */
};
/**
@@ -41,7 +42,7 @@ typedef int (lcore_function_t)(void *);
*
* When the remote lcore receives the message, it switches to
* the RUNNING state, then calls the function f with argument arg. Once the
- * execution is done, the remote lcore switches to a FINISHED state and
+ * execution is done, the remote lcore switches to WAIT state and
* the return value of f is stored in a local variable to be read using
* rte_eal_wait_lcore().
*
@@ -321,9 +321,7 @@ int32_t rte_service_lcore_count(void);
* from duty, just unmaps all services / cores, and stops() the service cores.
* The runstate of services is not modified.
*
- * The cores that are stopped with this call, are in FINISHED state and
- * the application must take care of bringing them back to a launchable state:
- * e.g. call *rte_eal_lcore_wait* on the lcore_id.
+ * The cores that are stopped with this call, are in WAIT state.
*
* @retval 0 Success
*/
@@ -28,7 +28,7 @@
/*
* Send a message to a worker lcore identified by worker_id to call a
* function f with argument arg. Once the execution is done, the
- * remote lcore switch in FINISHED state.
+ * remote lcore switches to WAIT state.
*/
int
rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned int worker_id)
@@ -141,13 +141,7 @@ eal_thread_loop(__rte_unused void *arg)
lcore_config[lcore_id].arg = NULL;
rte_wmb();
- /* when a service core returns, it should go directly to WAIT
- * state, because the application will not lcore_wait() for it.
- */
- if (lcore_config[lcore_id].core_role == ROLE_SERVICE)
- lcore_config[lcore_id].state = WAIT;
- else
- lcore_config[lcore_id].state = FINISHED;
+ lcore_config[lcore_id].state = WAIT;
}
/* never reached */
@@ -19,7 +19,7 @@
/*
* Send a message to a worker lcore identified by worker_id to call a
* function f with argument arg. Once the execution is done, the
- * remote lcore switch in FINISHED state.
+ * remote lcore switches to WAIT state.
*/
int
rte_eal_remote_launch(lcore_function_t *f, void *arg, unsigned int worker_id)
@@ -125,13 +125,7 @@ eal_thread_loop(void *arg __rte_unused)
lcore_config[lcore_id].arg = NULL;
rte_wmb();
- /* when a service core returns, it should go directly to WAIT
- * state, because the application will not lcore_wait() for it.
- */
- if (lcore_config[lcore_id].core_role == ROLE_SERVICE)
- lcore_config[lcore_id].state = WAIT;
- else
- lcore_config[lcore_id].state = FINISHED;
+ lcore_config[lcore_id].state = WAIT;
}
}