* Start a service core.
*
* Starting a core makes the core begin polling. Any services assigned to it
- * will be run as fast as possible.
+ * will be run as fast as possible. The application must ensure that the lcore
+ * is in a launchable state: e.g. call *rte_eal_lcore_wait* on the lcore_id
+ * before calling this function.
*
* @retval 0 Success
* @retval -EINVAL Failed to start core. The *lcore_id* passed in is not
/* call remote_launch to verify that app can launch ex-service lcore */
service_remote_launch_flag = 0;
+ rte_eal_wait_lcore(slcore_id);
int ret = rte_eal_remote_launch(service_remote_launch_func, NULL,
slcore_id);
TEST_ASSERT_EQUAL(0, ret, "Ex-service core remote launch failed.");
service_lcore_running_check(void)
{
uint64_t tick = service_tick;
- rte_delay_ms(SERVICE_DELAY * 10);
+ rte_delay_ms(SERVICE_DELAY * 100);
/* if (tick != service_tick) we know the lcore as polled the service */
return tick != service_tick;
}
if (!mt_safe)
test_params[1] = 1;
+ /* wait for lcores before start() */
+ rte_eal_wait_lcore(slcore_1);
+ rte_eal_wait_lcore(slcore_2);
+
rte_service_lcore_start(slcore_1);
rte_service_lcore_start(slcore_2);
TEST_ASSERT_EQUAL(0, rte_service_runstate_set(sid, 0),
"Failed to stop MT Safe service");
+ rte_eal_wait_lcore(slcore_1);
+ rte_eal_wait_lcore(slcore_2);
unregister_all();
/* return the value of the callback pass_test variable to caller */
rte_service_runstate_set(id, 1);
uint32_t app_core2 = rte_get_next_lcore(slcore_id, 1, 1);
+ rte_eal_wait_lcore(app_core2);
int app_core2_ret = rte_eal_remote_launch(service_run_on_app_core_func,
&id, app_core2);