eal: initialize alarms early
authorDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Mon, 1 Apr 2019 14:18:14 +0000 (16:18 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 2 Apr 2019 13:00:26 +0000 (15:00 +0200)
commitea4e3ab7bd37980f9745e1e63ac33390cc8bae10
tree0dde5c9402ed0cd4db3f5be73b60baec751b42d2
parente840cb3c2a6ca5dfb7fc6840285f1f5693cb41db
eal: initialize alarms early

On Linux, we currently initialize rte_alarms after
starting to listen for IPC hotplug requests, which gives
us a data race window. Upon receiving such hotplug
request we always try to set an alarm and this obviously
doesn't work if the alarms weren't initialized yet.

To fix it, we initialize alarms before starting to
listen for IPC hotplug messages. Specifically, we move
rte_eal_alarm_init() right after rte_eal_intr_init() as
it makes some sense to keep those two close to each other.

We update the BSD code as well to keep the initialization
order the same in both EAL implementations.

Fixes: 244d5130719c ("eal: enable hotplug on multi-process")
Cc: stable@dpdk.org
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
lib/librte_eal/freebsd/eal/eal.c
lib/librte_eal/linux/eal/eal.c