From: Vadim Suraev <vadim.suraev@gmail.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 1/2] rte_timer bug fix: pending timers count is not decremented when going running. Fix: decrement pending when going running, increment if reloaded, do nothing if not reloaded Signed-off-by: Vadim Suraev <vadim.suraev@gmail.com>
Date: Thu, 15 May 2014 21:21:02 -0000 [thread overview]
Message-ID: <1401830433-25071-2-git-send-email-vadim.suraev@gmail.com> (raw)
In-Reply-To: <1401830433-25071-1-git-send-email-vadim.suraev@gmail.com>
Signed-off-by: Vadim Suraev <vadim.suraev@gmail.com>
---
lib/librte_timer/rte_timer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/librte_timer/rte_timer.c b/lib/librte_timer/rte_timer.c
index a3d5cca..f98e904 100755
--- a/lib/librte_timer/rte_timer.c
+++ b/lib/librte_timer/rte_timer.c
@@ -173,7 +173,7 @@ timer_set_running_state(struct rte_timer *tim)
/* timer is not pending anymore */
if (prev_status.state != RTE_TIMER_PENDING)
return -1;
-
+ __TIMER_STAT_ADD(pending, -1);
/* here, we know that timer is stopped or pending,
* mark it atomically as beeing configured */
status.state = RTE_TIMER_RUNNING;
@@ -555,7 +555,6 @@ void rte_timer_manage(void)
if (tim->period == 0) {
/* remove from done list and mark timer as stopped */
- __TIMER_STAT_ADD(pending, -1);
status.state = RTE_TIMER_STOP;
status.owner = RTE_TIMER_NO_OWNER;
rte_wmb();
@@ -564,6 +563,7 @@ void rte_timer_manage(void)
else {
/* keep it in list and mark timer as pending */
status.state = RTE_TIMER_PENDING;
+ __TIMER_STAT_ADD(pending, 1);
status.owner = (int16_t)lcore_id;
rte_wmb();
tim->status.u32 = status.u32;
--
1.7.9.5
next prev parent reply other threads:[~2014-05-15 21:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-15 21:20 [dpdk-dev] [PATCH 0/2] Vadim Suraev
2014-05-15 21:21 ` Vadim Suraev [this message]
2014-05-15 21:21 ` [dpdk-dev] [PATCH 2/2] rte_timer bug fix: when a perdiodic timer's callback manipulates another timer, updated flag prevents reloading the periodic timer. Fix: move updated flag to rte_timer structure (one per core) Signed-off-by: Vadim Suraev <vadim.suraev@gmail.com> Vadim Suraev
2014-05-15 21:33 ` [dpdk-dev] [PATCH 0/2] 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=1401830433-25071-2-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).