From: Vadim Suraev <vadim.suraev@gmail.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] timer bug fix
Date: Wed, 21 May 2014 22:53:45 +0300 [thread overview]
Message-ID: <1400702025-11139-1-git-send-email-vadim.suraev@gmail.com> (raw)
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 is the modified timer is
in RUNNING state
Signed-off-by: Vadim Suraev <vadim.suraev@gmail.com>
---
lib/librte_timer/rte_timer.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/lib/librte_timer/rte_timer.c b/lib/librte_timer/rte_timer.c
index 884ee0e..1ebd223 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) {
--
1.7.9.5
next reply other threads:[~2014-05-21 19:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-21 19:53 Vadim Suraev [this message]
2014-05-23 14:52 ` Olivier MATZ
2014-05-26 16:24 ` Thomas Monjalon
2014-05-21 20:35 Vadim Suraev
2014-05-23 14:44 ` Olivier MATZ
2014-05-26 16:25 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1400702025-11139-1-git-send-email-vadim.suraev@gmail.com \
--to=vadim.suraev@gmail.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).