summaryrefslogtreecommitdiff
path: root/lib/librte_timer
diff options
context:
space:
mode:
authorVadim Suraev <vadim.suraev@gmail.com>2014-05-21 22:53:45 +0300
committerThomas Monjalon <thomas.monjalon@6wind.com>2014-05-26 18:22:03 +0200
commit83cb53f3a2630fc39e6d87372aefe6950df4b144 (patch)
tree8101e4836444e99e4c866ad68a52c6ed3f780b1f /lib/librte_timer
parentcd64eeac116d3bb4871d114b105440b4dd11b8e0 (diff)
downloaddpdk-83cb53f3a2630fc39e6d87372aefe6950df4b144.zip
dpdk-83cb53f3a2630fc39e6d87372aefe6950df4b144.tar.gz
dpdk-83cb53f3a2630fc39e6d87372aefe6950df4b144.tar.xz
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>
Diffstat (limited to 'lib/librte_timer')
-rwxr-xr-xlib/librte_timer/rte_timer.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/librte_timer/rte_timer.c b/lib/librte_timer/rte_timer.c
index 884ee0e..d07232b 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) {