8d39d3e237
This commit fixes a possible race condition if an application
uses the service-cores infrastructure and the function to run
a service on an application lcore at the same time.
The fix is to change the num_mapped_cores variable to be an
atomic variable. This causes concurrent accesses by multiple
threads to a service using rte_service_run_iter_on_app_lcore()
to detect if another core is currently mapped to the service,
and refuses to run if it is not multi-thread safe.
The run iteration on app lcore function has two arguments, the
service id to run, and if atomics should be used to serialize access
to multi-thread unsafe services. This allows applications to choose
if they wish to use use the service-cores feature, or if they
take responsibility themselves for serializing invoking a service.
See doxygen documentation for more details.
Two unit tests were added to verify the behaviour of the
function to run a service on an application core, testing both
a multi-thread safe service, and a multi-thread unsafe service.
The doxygen API documentation for the function has been updated
to reflect the current and correct behaviour.
Fixes:
|
||
---|---|---|
.. | ||
bond | ||
cmdline | ||
distributor | ||
ethtool | ||
eventdev_pipeline_sw_pmd | ||
exception_path | ||
flow_classify | ||
helloworld | ||
ip_fragmentation | ||
ip_pipeline | ||
ip_reassembly | ||
ipsec-secgw | ||
ipv4_multicast | ||
kni | ||
l2fwd | ||
l2fwd-cat | ||
l2fwd-crypto | ||
l2fwd-jobstats | ||
l2fwd-keepalive | ||
l3fwd | ||
l3fwd-acl | ||
l3fwd-power | ||
l3fwd-vf | ||
link_status_interrupt | ||
load_balancer | ||
multi_process | ||
netmap_compat | ||
packet_ordering | ||
performance-thread | ||
ptpclient | ||
qos_meter | ||
qos_sched | ||
quota_watermark | ||
rxtx_callbacks | ||
server_node_efd | ||
service_cores | ||
skeleton | ||
tep_termination | ||
timer | ||
vhost | ||
vhost_scsi | ||
vm_power_manager | ||
vmdq | ||
vmdq_dcb | ||
Makefile |