From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-we0-f171.google.com (mail-we0-f171.google.com [74.125.82.171]) by dpdk.org (Postfix) with ESMTP id 0E7F36893 for ; Mon, 26 May 2014 18:25:42 +0200 (CEST) Received: by mail-we0-f171.google.com with SMTP id w62so8363272wes.16 for ; Mon, 26 May 2014 09:25:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=TKRr3/eqeq6HMoihTxbqBEeNrd7Sl6LIAJ962dws6sk=; b=I8UrL4snGDAxUed0ZOALNw+HOZ2MTPwtW1bNZHNoq8TMAnsfoxTtgoUoE7JT2PlS4X qcyCF8tqGY63ibg12Mfhw3HpVYkC6VIreQ3I9hUv+APOsq7dpPwWP7r/sRTUsJl8uZCx vy+9SO4Az7VlC5CqqMRG3TgGL0DtYBlDHn59YZdGzghKIjHntsrSYPKWNH2WTJ3bLYqh e9v1T9JJbSGUndNX7cIo1FvRduRRJISVRepibGnVXrOEKjXo2xwDaYgdX2EeFU5d9Xz4 anVEd38ws4h3zaBXApMcILh0LDhKa47uR/2djf5NmaQaFxaNxM4hETLrN0pdrHyGKWNG z0mQ== X-Gm-Message-State: ALoCoQkYauo27xIc+quuINp43s5CBUiYBJQ1dEdQj8V9z0LhNNsdVw9fg7KNFwG3KXCnfRzO+Kyy X-Received: by 10.194.22.100 with SMTP id c4mr9660848wjf.89.1401121553563; Mon, 26 May 2014 09:25:53 -0700 (PDT) Received: from xps13.localnet (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id b1sm27972952wjb.37.2014.05.26.09.25.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 May 2014 09:25:52 -0700 (PDT) From: Thomas Monjalon To: Vadim Suraev Date: Mon, 26 May 2014 18:25:49 +0200 Message-ID: <1462523.elkQdoiaBG@xps13> Organization: 6WIND User-Agent: KMail/4.13 (Linux/3.14.4-1-ARCH; KDE/4.13.0; x86_64; ; ) In-Reply-To: <537F5EC8.70109@6wind.com> References: <1400704555-18818-1-git-send-email-vadim.suraev@gmail.com> <537F5EC8.70109@6wind.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org 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: Mon, 26 May 2014 16:25:43 -0000 > > 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