service: fix race condition for MT unsafe service
authorHonnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Wed, 6 May 2020 15:27:59 +0000 (23:27 +0800)
committerDavid Marchand <david.marchand@redhat.com>
Mon, 11 May 2020 07:33:45 +0000 (09:33 +0200)
commit18cae99cb9096abe0f33b43e51eb8b781e8a5ff9
treebe84c620b993591436a215903b537afb273d2a0f
parent9ec8f11369dd816da9347afc516d8ccdd35f3755
service: fix race condition for MT unsafe service

A MT unsafe service might get configured to run on another core
while the service is running currently. This might result in the
MT unsafe service running on multiple cores simultaneously. Use
'execute_lock' always when the service is MT unsafe.

If the service is known to be mapped on a single lcore,
setting the service capability to MT safe will avoid taking
the lock and improve the performance.

Fixes: e9139a32f6e8 ("service: add function to run on app lcore")
Cc: stable@dpdk.org
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
lib/librte_eal/common/rte_service.c
lib/librte_eal/include/rte_service.h
lib/librte_eal/include/rte_service_component.h