HV: check to avoid interrupt delay timer add twice

to edge interrupt, like eth device, it can triger the interrupt again
when its IRQ in softirq entry queue or in timer list.

in current design, for sofrirq entry, it calls "list_del" before
"list_add_tail", to avoid the entry added twice.

so for interrupt delay timer, add to check if it is started
then just drop the next one; to avoid it enqueue twice.

Tracked-On: #2365
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Reviewed-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
Minggui Cao
2019-01-17 18:00:01 +08:00
committed by wenlingz
parent d9c38bafa5
commit 808d0af2c8
2 changed files with 29 additions and 15 deletions

View File

@@ -86,6 +86,18 @@ static inline bool timer_expired(const struct hv_timer *timer)
return ((timer->fire_tsc == 0UL) || (rdtsc() >= timer->fire_tsc));
}
/**
* @brief Check a timer whether in timer list.
*
* @param[in] timer Pointer to timer.
*
* @retval true if the timer is in timer list, false otherwise.
*/
static inline bool timer_is_started(const struct hv_timer *timer)
{
return (!list_empty(&timer->node));
}
/**
* @brief Add a timer.
*