From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-we0-f169.google.com (mail-we0-f169.google.com [74.125.82.169]) by dpdk.org (Postfix) with ESMTP id A2D31AB06 for ; Wed, 21 May 2014 21:53:17 +0200 (CEST) Received: by mail-we0-f169.google.com with SMTP id u56so2545945wes.14 for ; Wed, 21 May 2014 12:53:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=oIcS04qWeELkS1LWkbERwIAi2uQrAc4NSjWk+2gDizs=; b=0Wr6o+zoG1n3eySsMFi5u4pUIE6HAO1qZf3sMx/VqDxM/rtvufaEzP2jbvVW3myBOD 63VvrpvsIXedBy/WtfGksD8UvWlnrrcNTaIeTYXeT08l0sRaQV9Wxilz4GdAezH2Y63B g9dvH8NRlIAcJND61ZC4qiKNdDYamU0nQ2F0L0Ko7ZeSxBpuebfdzffN1sIr5UHelyxA uJWoJaZaO8+MVnM4HCBwDqWZal6vukDSI2c71t6pHKEqY0uThvrG6g8ziTKYCAAGXlCm n4D0P2KNpfiDmEqiZ5Kq+HLVi3h2Xa2zwhUZaa/45vjDKwlJXS1kMY6mjOzE4MRd+ZDj tg8A== X-Received: by 10.194.84.101 with SMTP id x5mr33853195wjy.52.1400702006838; Wed, 21 May 2014 12:53:26 -0700 (PDT) Received: from ubuntu.ubuntu-domain ([109.66.146.135]) by mx.google.com with ESMTPSA id ch16sm23767257wjb.43.2014.05.21.12.53.25 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 May 2014 12:53:26 -0700 (PDT) From: Vadim Suraev To: dev@dpdk.org Date: Wed, 21 May 2014 22:53:45 +0300 Message-Id: <1400702025-11139-1-git-send-email-vadim.suraev@gmail.com> X-Mailer: git-send-email 1.7.9.5 Subject: [dpdk-dev] [PATCH] 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: Wed, 21 May 2014 19:53:17 -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 is 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..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