eal: fix memory ordering around lcore task accesses
authorHonnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Mon, 25 Oct 2021 04:52:36 +0000 (23:52 -0500)
committerDavid Marchand <david.marchand@redhat.com>
Mon, 25 Oct 2021 16:20:59 +0000 (18:20 +0200)
commit3596537005e151934d20cf8a768b30ef1a5da203
treed9560c9ca042819afc7dabfe703d06a47e07f2e9
parentf6c6c686f134dac6a0b4540b1a6b85719991b6dc
eal: fix memory ordering around lcore task accesses

Ensure that the memory operations before the call to
rte_eal_remote_launch are visible to the worker thread.
Use the function pointer to execute in worker thread
as the guard variable.

Ensure that the memory operations in worker thread, that happen
before it returns the status of the assigned function, are
visible to the main thread. Use the variable containing the
lcore's state as the guard variable.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>
Reviewed-by: Feifei Wang <feifei.wang2@arm.com>
lib/eal/common/eal_common_launch.c
lib/eal/freebsd/eal_thread.c
lib/eal/linux/eal_thread.c
lib/eal/windows/eal_thread.c