numam-dpdk/lib/librte_timer
Anatoly Burakov f9d6cd8bfe timer: fix resource leak in finalize
Currently, whenever timer library is initialized, the memory
is leaked because there is no telling when primary or secondary
processes get to use the state, and there is no way to
initialize/deinitialize timer library state without race
conditions [1] because the data itself must live in shared memory.

Add a spinlock to the shared mem config to have a way to
exclusively initialize/deinitialize the timer library without
any races, and implement the synchronization mechanism based
on this lock in the timer library.

Also, update the API doc. Note that the behavior of the API
itself did not change - the requirement to call init in every
process was simply not documented explicitly.

[1] See the following email thread:
https://mails.dpdk.org/archives/dev/2019-May/131498.html

Fixes: c0749f7096 ("timer: allow management in shared memory")
Cc: stable@dpdk.org

Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2019-07-06 10:32:40 +02:00
..
Makefile timer: allow management in shared memory 2019-04-17 20:05:20 +02:00
meson.build timer: allow management in shared memory 2019-04-17 20:05:20 +02:00
rte_timer_version.map timer: add function to stop all timers in a list 2019-04-17 20:05:30 +02:00
rte_timer.c timer: fix resource leak in finalize 2019-07-06 10:32:40 +02:00
rte_timer.h timer: fix resource leak in finalize 2019-07-06 10:32:40 +02:00