From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 03897A052F; Sun, 26 Jan 2020 10:42:23 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A4E781B94F; Sun, 26 Jan 2020 10:42:22 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id A45108F96 for ; Sun, 26 Jan 2020 10:42:20 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jan 2020 01:42:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,365,1574150400"; d="scan'208";a="222996348" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.117.17]) by fmsmga008.fm.intel.com with ESMTP; 26 Jan 2020 01:42:18 -0800 Date: Sun, 26 Jan 2020 17:41:43 +0800 From: Ye Xiaolong To: David Harton Cc: dev@dpdk.org, wenzhuo.lu@intel.com Message-ID: <20200126094143.GA54838@intel.com> References: <20191211024802.17978-1-dharton@cisco.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191211024802.17978-1-dharton@cisco.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH] net/e1000: update UPDATE_VF_STAT to handle rollover X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 12/10, David Harton wrote: >Modified UPDATE_VF_STAT to properly handle rollover conditions. > >Signed-off-by: David Harton >--- > drivers/net/e1000/igb_ethdev.c | 14 +++++++++----- > 1 file changed, 9 insertions(+), 5 deletions(-) > >diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c >index a3e30dbe5..825663267 100644 >--- a/drivers/net/e1000/igb_ethdev.c >+++ b/drivers/net/e1000/igb_ethdev.c >@@ -261,11 +261,15 @@ static int igb_filter_restore(struct rte_eth_dev *dev); > /* > * Define VF Stats MACRO for Non "cleared on read" register > */ >-#define UPDATE_VF_STAT(reg, last, cur) \ >-{ \ >- u32 latest = E1000_READ_REG(hw, reg); \ >- cur += (latest - last) & UINT_MAX; \ >- last = latest; \ >+#define UPDATE_VF_STAT(reg, last, cur) \ >+{ \ >+ u32 latest = E1000_READ_REG(hw, reg); \ >+ if (latest >= last) \ >+ cur += (latest - last); \ >+ else \ >+ cur += ((latest + ((uint64_t)1 << 32)) - last); \ >+ cur &= UINT_MAX; \ >+ last = latest; \ > } > > #define IGB_FC_PAUSE_TIME 0x0680 >-- >2.19.1 > Could you provide Fixes: tag and cc stable? Acked-by: Xiaolong Ye