net/failsafe: fix hotplug alarm cancel
authorMatan Azrad <matan@mellanox.com>
Mon, 12 Feb 2018 20:51:40 +0000 (20:51 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 13 Feb 2018 17:17:30 +0000 (18:17 +0100)
commit64f1a631d0a139347e1df2babaf0ef82f92ca4b6
tree52ab5b667f4f9b61477ba6d14350f960b3a666d2
parent3382eb3a3ae2866a2e59fecdd5c3ca2926f59f57
net/failsafe: fix hotplug alarm cancel

The hot-plug alarm mechanism of fail-safe PMD is responsible for
handling removed devices during a plug-out event and to restore them
back to activity following a plug-in event.

Fail-safe sets a flag called "pending_alarm" to validate that only one
alarm callback is pending at any time. While this flag is required to
avoid simultaneous initiations of the alarm thread - it should not be
considered during alarm thread cancellation.

So, when failsafe_hotplug_alarm_cancel() was called while the alarm
callback was being executed the alarm mechanism was not stopped.

Skip checking the "pending_alarm" flag to allow alarm thread
cancellation all the times.

Fixes: ebea83f899d8 ("net/failsafe: add plug-in support")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
drivers/net/failsafe/failsafe.c