From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-we0-f173.google.com (mail-we0-f173.google.com [74.125.82.173]) by dpdk.org (Postfix) with ESMTP id 8586868AE for ; Fri, 23 May 2014 21:43:05 +0200 (CEST) Received: by mail-we0-f173.google.com with SMTP id u57so5331408wes.4 for ; Fri, 23 May 2014 12:43:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=km+H33ypjCAk2hbsOuOWwxUWJxvgsKMjz83xytI21N0=; b=Zlmpd8lUupEOLZoJKVYVAiO2O0Gd1Y4MuwyZZ14RXM+NUiZOHFz+s4PC52kM6yK8BN xQkJ5MfI3OYKzOY0Hys2E4P9io+mDCtakBJMemxQemI9XWgRlHErEKjxAOGmGM7sFe6O ALMP2BUzzg58pA3MSUFDcIoFx7ihsaEEAJBCOVd+p4LK8LSz5Ng75EQaD05FvUHflSQe ALjIvpeqiCDT0vqKy/07qRA42CE0ubFojhZmJOm0+GcwN4k5Vl/944PYuPV+jicvCZ+s 9+w5zAqZMLgtV/60dumqeyvjm6JkzzDatACxIFUBcGoe1L61XhG6WKEpaTRfkyG+5jvp sA6g== X-Received: by 10.194.250.68 with SMTP id za4mr3904455wjc.89.1400874195423; Fri, 23 May 2014 12:43:15 -0700 (PDT) Received: from ubuntu.ubuntu-domain ([109.66.146.135]) by mx.google.com with ESMTPSA id m5sm4464707wie.23.2014.05.23.12.43.14 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 12:43:14 -0700 (PDT) From: Vadim Suraev To: dev@dpdk.org Date: Fri, 23 May 2014 22:43:03 +0300 Message-Id: <1400874184-15818-2-git-send-email-vadim.suraev@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1400874184-15818-1-git-send-email-vadim.suraev@gmail.com> References: <1400874184-15818-1-git-send-email-vadim.suraev@gmail.com> Subject: [dpdk-dev] [PATCH 1/2] timer bug fix X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 19:43:05 -0000 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 --- 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..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) { -- 1.7.9.5