From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rcdn-iport-2.cisco.com (rcdn-iport-2.cisco.com [173.37.86.73]) by dpdk.org (Postfix) with ESMTP id F125A8E79 for ; Mon, 12 Oct 2015 17:02:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2242; q=dns/txt; s=iport; t=1444662175; x=1445871775; h=subject:to:references:from:message-id:date:mime-version: in-reply-to:content-transfer-encoding; bh=fmDBcDxMpRNtYwFd3u26I7A6qiYp3Kuk+TyvIn4tGg8=; b=M8gfbKk2Y/btBFvWl7sUzaAwAFUlLcL6pKVcLvK+VzJaWs3706YToc4Y zBjMyuF2w9HCJ6PcL1zVP4m7Wda4DjGHaI717Jq/T3+DWvle8mbh0KfSh 3AEKVb9goG2fq0PwfxZNOadmq1cOL+c9JqMx07px3E0tD6D8a+fMCa6ih g=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AOAgB+yhtW/4cNJK1aA4MmVG65YIQiAQ2BWiGCHlSCCn8CgTI4FAEBAQEBAQGBCoQnAQEEIxUdIxELGAICBRYLAgIJAwIBAgFFEwYCAQGIKg2qb5MtAQEBAQEFAQEBAQEdgSKFUYR+hCgCEQErFhcSBYJSgUUBBJYTAY0ZgViEOoMBknAfAQFCghEdgXAiMwGGIAkXgSkBAQE X-IronPort-AV: E=Sophos;i="5.17,673,1437436800"; d="scan'208";a="39921089" Received: from alln-core-2.cisco.com ([173.36.13.135]) by rcdn-iport-2.cisco.com with ESMTP; 12 Oct 2015 15:02:53 +0000 Received: from [10.82.221.63] (rtp-vpn3-1337.cisco.com [10.82.221.63]) by alln-core-2.cisco.com (8.14.5/8.14.5) with ESMTP id t9CF2rmf022060 for ; Mon, 12 Oct 2015 15:02:53 GMT To: dev@dpdk.org References: <1444656823-717-1-git-send-email-harry.van.haaren@intel.com> <1444656823-717-3-git-send-email-harry.van.haaren@intel.com> From: "Roger B. Melton" Message-ID: <561BCBA0.6080507@cisco.com> Date: Mon, 12 Oct 2015 11:02:56 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1444656823-717-3-git-send-email-harry.van.haaren@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [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 15:02:55 -0000 ack On 10/12/15 9:33 AM, Harry van Haaren wrote: > 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; \ > } > -- ____________________________________________________________________ |Roger B. Melton | | Cisco Systems | |CPP Software :|: :|: 7100 Kit Creek Rd | |+1.919.476.2332 phone :|||: :|||: RTP, NC 27709-4987 | |+1.919.392.1094 fax .:|||||||:..:|||||||:. rmelton@cisco.com | | | | This email may contain confidential and privileged material for the| | sole use of the intended recipient. Any review, use, distribution | | or disclosure by others is strictly prohibited. If you are not the | | intended recipient (or authorized to receive for the recipient), | | please contact the sender by reply email and delete all copies of | | this message. | | | | For corporate legal information go to: | | http://www.cisco.com/web/about/doing_business/legal/cri/index.html | |__________________________ http://www.cisco.com ____________________|