From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id B0B908E6A for ; Mon, 12 Oct 2015 15:34:18 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 12 Oct 2015 06:34:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,673,1437462000"; d="scan'208";a="824944518" Received: from sie-lab-212-222.ir.intel.com (HELO silpixa00366884.ir.intel.com) ([10.237.212.222]) by fmsmga002.fm.intel.com with ESMTP; 12 Oct 2015 06:33:50 -0700 From: Harry van Haaren To: dev@dpdk.org Date: Mon, 12 Oct 2015 14:33:43 +0100 Message-Id: <1444656823-717-3-git-send-email-harry.van.haaren@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1444656823-717-1-git-send-email-harry.van.haaren@intel.com> References: <1444656823-717-1-git-send-email-harry.van.haaren@intel.com> Subject: [dpdk-dev] [PATCH 2/2] igb: fix VF statistic wraparound handling macro 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, 12 Oct 2015 13:34:19 -0000 Fix a misinterpreatation of VF statistic macro in e1000/igb. Signed-off-by: Harry van Haaren --- drivers/net/e1000/igb_ethdev.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index 848ef6e..e3f7402 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -246,7 +246,11 @@ static void eth_igb_configure_msix_intr(struct rte_eth_dev *dev); #define UPDATE_VF_STAT(reg, last, cur) \ { \ u32 latest = E1000_READ_REG(hw, reg); \ - cur += latest - last; \ + if(likely(latest > last)) { \ + cur += latest - last; \ + } else { \ + cur += (UINT_MAX - last) + latest;\ + } \ last = latest; \ } -- 1.9.1