From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id 43FB36946 for ; Fri, 23 May 2014 16:52:24 +0200 (CEST) Received: from was59-1-82-226-113-214.fbx.proxad.net ([82.226.113.214] helo=[192.168.0.10]) by mail.droids-corp.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1WnqrP-0005rT-M4; Fri, 23 May 2014 16:54:23 +0200 Message-ID: <537F60B6.6060409@6wind.com> Date: Fri, 23 May 2014 16:52:38 +0200 From: Olivier MATZ User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.4.0 MIME-Version: 1.0 To: Vadim Suraev , dev@dpdk.org References: <1400702025-11139-1-git-send-email-vadim.suraev@gmail.com> In-Reply-To: <1400702025-11139-1-git-send-email-vadim.suraev@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [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: Fri, 23 May 2014 14:52:24 -0000 Hi Vadim, It's even more simple that what I've suggested. It should work since the only case where state is RTE_TIMER_RUNNING is that we are modifying the timer currently running on the same lcore. Indeed, timer_set_config_state() prevents us to modify a running timer belonging to another lcore. Just 3 small typos: On 05/21/2014 09:53 PM, Vadim Suraev wrote: > 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 s/is the modified/if the modified > - priv_timer[lcore_id].updated = 1; > + if(prev_status.state == RTE_TIMER_RUNNING) { > + priv_timer[lcore_id].updated = 1; > + } missing a space after the if. > - priv_timer[lcore_id].updated = 1; > + if(prev_status.state == RTE_TIMER_RUNNING) { > + priv_timer[lcore_id].updated = 1; > + } same here. Acked-by: Olivier Matz