service: add mechanism for quiescing
authorGage Eads <gage.eads@intel.com>
Thu, 21 Jun 2018 14:23:22 +0000 (09:23 -0500)
committerJerin Jacob <jerin.jacob@caviumnetworks.com>
Fri, 6 Jul 2018 04:54:49 +0000 (06:54 +0200)
commite30dd31847d212cd1b766612cbd980c7d8240baa
tree25bad5496317c25911585ec1d854042c44563da5
parent6461abf76b89f96d667adec8ca151c5d25f70fcc
service: add mechanism for quiescing

Existing service functions allow us to stop a service, but doing so doesn't
guarantee that the service has finished running on a service core. This
commit introduces rte_service_may_be_active(), which returns whether the
service may be executing on one or more lcores currently, or definitely is
not.

The service core layer supports this function by setting a flag when
a service core is going to execute a service, and unsetting the flag when
the core is no longer able to run the service (its runstate becomes stopped
or the lcore is no longer mapped).

With this new function, applications can set a service's runstate to
stopped, then poll rte_service_may_be_active() until it returns false. At
that point, the service is quiesced.

Signed-off-by: Gage Eads <gage.eads@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
lib/librte_eal/common/include/rte_service.h
lib/librte_eal/common/rte_service.c
lib/librte_eal/rte_eal_version.map
test/test/test_service_cores.c