eal/windows: fix deadlock when setting alarm
authorDmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Fri, 30 Oct 2020 18:42:16 +0000 (21:42 +0300)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 3 Nov 2020 21:45:02 +0000 (22:45 +0100)
commitbd117d62a6ac105bcb7062cef2aa141f50057787
tree394ad9872fad12b1988b2a1adc413bb6b55030e3
parenta2b04717394ff260fc4c388915d5ca7bb085f9f9
eal/windows: fix deadlock when setting alarm

Windows alarms are both armed and executed from the interrupt thread.
rte_eal_alarm_set() dispatched alarm-arming code to that thread and
waited for its completion via a spinlock. However, if called from alarm
callback (i.e. from the interrupt thread), this caused a deadlock,
because arming could not be run until its dispatcher exits, but it could
only exit after it finished waiting for arming to complete.

Call arming code directly when running in the interrupt thread.

Fixes: f4cbdbc7fbd2 ("eal/windows: implement alarm API")

Reported-by: Pallavi Kadam <pallavi.kadam@intel.com>
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Tested-by: Pallavi Kadam <pallavi.kadam@intel.com>
lib/librte_eal/windows/eal_alarm.c