timer: fix reloading after changes

Bug: when a periodic timer's callback is running, if another
 timer is manipulated, the periodic timer is not reloaded.
Solution: set the update flag only if the modified timer is
 in RUNNING state

Signed-off-by: Vadim Suraev <vadim.suraev@gmail.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
This commit is contained in:
Vadim Suraev 2014-05-21 22:53:45 +03:00 committed by Thomas Monjalon
parent cd64eeac11
commit 83cb53f3a2

View File

@ -378,7 +378,9 @@ __rte_timer_reset(struct rte_timer *tim, uint64_t expire,
return -1;
__TIMER_STAT_ADD(reset, 1);
priv_timer[lcore_id].updated = 1;
if (prev_status.state == RTE_TIMER_RUNNING) {
priv_timer[lcore_id].updated = 1;
}
/* remove it from list */
if (prev_status.state == RTE_TIMER_PENDING) {
@ -453,7 +455,9 @@ rte_timer_stop(struct rte_timer *tim)
return -1;
__TIMER_STAT_ADD(stop, 1);
priv_timer[lcore_id].updated = 1;
if (prev_status.state == RTE_TIMER_RUNNING) {
priv_timer[lcore_id].updated = 1;
}
/* remove it from list */
if (prev_status.state == RTE_TIMER_PENDING) {