[dpdk-dev] [PATCH v2] eal: fix lcore state bug

Van Haaren, Harry harry.van.haaren at intel.com
Wed Jul 8 16:52:11 CEST 2020


> -----Original Message-----
> From: Lukasz Wojciechowski <l.wojciechow at partner.samsung.com>
> Sent: Wednesday, July 8, 2020 2:38 PM
> To: Van Haaren, Harry <harry.van.haaren at intel.com>; Jerin Jacob
> <jerin.jacob at caviumnetworks.com>
> Cc: dev at dpdk.org; l.wojciechow at partner.samsung.com; stable at dpdk.org
> Subject: [PATCH v2] eal: fix lcore state bug
> 
> The rte_service_lcore_reset_all function stops execution of services
> on all lcores and switches them back from ROLE_SERVICE to ROLE_RTE.
> However the thread loop for slave lcores (eal_thread_loop) distincts these
> roles to set lcore state after processing delegated function.
> It sets WAIT state for ROLE_SERVICE, but FINISHED for ROLE_RTE.
> So changing the role to RTE before stopping work in slave lcores
> causes lcores to end in FINISHED state. That is why the rte_eal_lcore_wait
> must be run after rte_service_lcore_reset_all to bring back lcores to
> launchable (WAIT) state.
> This has been fixed in test app and clarified in API documentation.
> 
> Setting the state to WAIT in rte_service_runner_func is premature
> as the rte_service_runner_func function is still a part of the lcore
> function delegated to slave lcore. The state is overwritten anyway in
> slave lcore thread loop. This premature setting state to WAIT might
> however cause rte_eal_lcore_wait, that was called by the application,
> to return before slave lcore thread set the FINISHED state. That's
> why it is removed from librte_eal rte_service_runner_func function.
> 
> Bugzilla ID: 464
> Fixes: 21698354c832 ("service: introduce service cores concept")
> Fixes: f038a81e1c56 ("service: add unit tests")
> Cc: harry.van.haaren at intel.com
> Cc: stable at dpdk.org
> 
> Signed-off-by: Lukasz Wojciechowski <l.wojciechow at partner.samsung.com>

Thanks for v2, applies cleanly. Tested patch with unit tests, bug description,
service_cores sample app, and testpmd running (idle) service cores in bg, all fine;

Acked-by: Harry van Haaren <harry.van.haaren at intel.com>


More information about the dev mailing list