From: Vadim Suraev Date: Wed, 21 May 2014 19:53:45 +0000 (+0300) Subject: timer: fix reloading after changes X-Git-Tag: spdx-start~10793 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=83cb53f3a2630fc39e6d87372aefe6950df4b144;p=dpdk.git 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 Acked-by: Olivier Matz --- diff --git a/lib/librte_timer/rte_timer.c b/lib/librte_timer/rte_timer.c index 884ee0e9c8..d07232b8ef 100755 --- a/lib/librte_timer/rte_timer.c +++ b/lib/librte_timer/rte_timer.c @@ -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) {