numam-dpdk/examples
Harry van Haaren 8d39d3e237 service: fix race in service on app lcore function
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: e9139a32f6 ("service: add function to run on app lcore")

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-11-07 01:42:04 +01:00
..
bond remove useless memzone includes 2017-11-06 22:12:08 +01:00
cmdline remove useless memzone includes 2017-11-06 22:12:08 +01:00
distributor examples: fix port id type 2017-10-13 21:57:49 +02:00
ethtool pci: introduce library and driver 2017-10-26 23:17:31 +02:00
eventdev_pipeline_sw_pmd service: fix race in service on app lcore function 2017-11-07 01:42:04 +01:00
exception_path remove useless memzone includes 2017-11-06 22:12:08 +01:00
flow_classify examples/flow_classify: add sample application 2017-10-24 22:26:54 +02:00
helloworld remove useless memzone includes 2017-11-06 22:12:08 +01:00
ip_fragmentation remove useless memzone includes 2017-11-06 22:12:08 +01:00
ip_pipeline pci: introduce library and driver 2017-10-26 23:17:31 +02:00
ip_reassembly remove useless memzone includes 2017-11-06 22:12:08 +01:00
ipsec-secgw mbuf: rename data address helpers to IOVA 2017-11-06 22:44:26 +01:00
ipv4_multicast remove useless memzone includes 2017-11-06 22:12:08 +01:00
kni remove useless memzone includes 2017-11-06 22:12:08 +01:00
l2fwd remove useless memzone includes 2017-11-06 22:12:08 +01:00
l2fwd-cat examples/l2fwd-cat: fix build with PQOS 1.4 2017-10-14 00:26:34 +02:00
l2fwd-crypto cryptodev: rename physical address type to IOVA 2017-11-06 22:44:26 +01:00
l2fwd-jobstats remove useless memzone includes 2017-11-06 22:12:08 +01:00
l2fwd-keepalive remove useless memzone includes 2017-11-06 22:12:08 +01:00
l3fwd remove useless memzone includes 2017-11-06 22:12:08 +01:00
l3fwd-acl remove useless memzone includes 2017-11-06 22:12:08 +01:00
l3fwd-power remove useless memzone includes 2017-11-06 22:12:08 +01:00
l3fwd-vf remove useless memzone includes 2017-11-06 22:12:08 +01:00
link_status_interrupt remove useless memzone includes 2017-11-06 22:12:08 +01:00
load_balancer remove useless memzone includes 2017-11-06 22:12:08 +01:00
multi_process remove useless memzone includes 2017-11-06 22:12:08 +01:00
netmap_compat remove useless memzone includes 2017-11-06 22:12:08 +01:00
packet_ordering ethdev: increase port id range 2017-10-06 18:23:25 +02:00
performance-thread remove useless memzone includes 2017-11-06 22:12:08 +01:00
ptpclient examples: fix port id type 2017-10-13 21:57:49 +02:00
qos_meter examples: fix port id type 2017-10-13 21:57:49 +02:00
qos_sched examples/qos_sched: fix uninitialized config 2017-10-24 23:58:14 +02:00
quota_watermark examples: fix port id type 2017-10-13 21:57:49 +02:00
rxtx_callbacks examples: fix port id type 2017-10-13 21:57:49 +02:00
server_node_efd remove useless memzone includes 2017-11-06 22:12:08 +01:00
service_cores remove useless memzone includes 2017-11-06 22:12:08 +01:00
skeleton ethdev: increase port id range 2017-10-06 18:23:25 +02:00
tep_termination examples: fix port id type 2017-10-13 21:57:49 +02:00
timer remove useless memzone includes 2017-11-06 22:12:08 +01:00
vhost ethdev: increase port id range 2017-10-06 18:23:25 +02:00
vhost_scsi examples/vhost_scsi: fix product id string termination 2017-10-25 12:16:51 +02:00
vm_power_manager examples/vm_power_manager: add turbo commands to help text 2017-10-24 23:50:55 +02:00
vmdq remove useless memzone includes 2017-11-06 22:12:08 +01:00
vmdq_dcb remove useless memzone includes 2017-11-06 22:12:08 +01:00
Makefile examples/ipsec-secgw: fix build without security lib 2017-10-26 22:33:22 +02:00