From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] timer bug fix. Date: Mon, 26 May 2014 18:25:49 +0200 Message-ID: <1462523.elkQdoiaBG@xps13> References: <1400704555-18818-1-git-send-email-vadim.suraev@gmail.com> <537F5EC8.70109@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Vadim Suraev Return-path: In-Reply-To: <537F5EC8.70109-pdR9zngts4EAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" > > Bug: When a timer is running > > > > - if rte_timer_stop is called, the pending decrement is > > skipped (decremented only if the timer is pending) and due > > to the update flag the future processing is skipped so the > > timer is counted as pending while it is stopped. - the same > > applies when rte_timer_reset is called but then the pending > > statistics is additionally incremented so the timer is > > counted pending twice. > > > > Solution: decrement the pending > > > > statistics after returning from the callback. If > > rte_timer_stop was called, it skipped decrementing the > > pending statistics. If rte_time_reset was called, the > > pending statistics was incremented. If neither was called > > and the timer is periodic, the pending statistics is > > incremented when it is reloaded > > > > Signed-off-by: Vadim Suraev > > Acked-by: Olivier Matz Applied for version 1.7.0 with title: timer: fix pending counter Thanks -- Thomas