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 84433A00E6 for ; Wed, 7 Aug 2019 16:38:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4B0432BF3; Wed, 7 Aug 2019 16:37:56 +0200 (CEST) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by dpdk.org (Postfix) with ESMTP id DAEE41D9E for ; Wed, 7 Aug 2019 16:37:52 +0200 (CEST) Received: by mail-wm1-f66.google.com with SMTP id f17so294315wme.2 for ; Wed, 07 Aug 2019 07:37:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=YAMdscZwW/7ziVKICBq95Vg5MVMQb+M895gf1t1BSlU=; b=GvH14bGgrUP54qD+GZbPg3I6wC0sq0eRy8KAccSmP2jWChSgErzDoDr8Icixqxa6+y YCgSdjL5pDr/TxMrgu/NEjO+vwm4uA1kgXIk/vMENcBKU3OCqI85nChJmnLL4htZqnVX Nsp57SpNdmeQ5x2h+mQc7OBru6isPMSzPg8xv9L2L2ElixlHx0vWHowAQHL469M3WEZg pNo4ZHYAGVbRlo0oF7i4ATdAT/DT4MoGjzZiCtrcx8eqN85SiPpbQ8GTPKL37ItBOzBL a+lq4sTcUv3aYtmHybYX+ezTJ4VrUF8tW+aBLOiFnGIbdvnw/d43s3oTY3NPPeys/b+i kLNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=YAMdscZwW/7ziVKICBq95Vg5MVMQb+M895gf1t1BSlU=; b=YyYz+FJhIDaZTL+pteHu5535uH1Rmdb9nSR9oQLxd53nFh8Ez0JKWdYAEhVCxPkcga Y5wfWj/x9DDGDhHNQMTu1UWcxgFF6v7Ou+hiSouerPRGPab28EqBwyblEmDvFNpOhatw HiRQJePMKnrNdnp5he6aYLLZIs3nwF6i8uswbRET9VXOT2ka0oh1j4av2Fe4C5LFYrCG cTnORkBiIm8wJbi+M/D5/lyWDShZDtDFZhFnJ4RPpVmRHpm2GgsLUCnDCE4WzU1YPftu r1mkxnVECDoD4E+WEsddPb88LP2on+xv2ejXpLs9LXHspXa/nav/0ZGns7HYvrMM4t4I Yo6w== X-Gm-Message-State: APjAAAX8Qjbwt5ll8mc9gwCiUVBpWr9QBOze0wVJ3oxBLNivAFDPATf6 PblrWsLIFUlFmdwjgoO1d1JTPpbVwg== X-Google-Smtp-Source: APXvYqxu1Ul9Dx4BnaF4J9sKMHxDInkXB1GRPGPGkwptuVOOIEXbMR2tiwG3MoyaGGboAqOVRGFQdw== X-Received: by 2002:a1c:968c:: with SMTP id y134mr288149wmd.122.1565188672346; Wed, 07 Aug 2019 07:37:52 -0700 (PDT) Received: from ascain.dev.6wind.com. (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id 2sm133441211wrn.29.2019.08.07.07.37.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Aug 2019 07:37:51 -0700 (PDT) From: Thierry Herbelot To: dev@dpdk.org Cc: Guo Fengtian , stable@dpdk.org, Thomas Monjalon Date: Wed, 7 Aug 2019 16:37:20 +0200 Message-Id: <33c9e6014e6f4ebd5c980b1ab9c411cde1d61671.1565188248.git.thierry.herbelot@6wind.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH 19.11 01/12] net/ixgbevf: fix stats update after a PF reset 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" From: Guo Fengtian When PF is set down, in VF, the value of stats register is zero. So only increase stats when it's non zero. Fixes: af75078fece3 ('first public release') Cc: stable at dpdk.org Signed-off-by: Guo Fengtian --- drivers/net/ixgbe/ixgbe_ethdev.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 03fc1f71799c..57f5bfa219c1 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -385,7 +385,8 @@ static void ixgbe_l2_tunnel_conf(struct rte_eth_dev *dev); #define UPDATE_VF_STAT(reg, last, cur) \ { \ uint32_t latest = IXGBE_READ_REG(hw, reg); \ - cur += (latest - last) & UINT_MAX; \ + if (latest) \ + cur += (latest - last) & UINT_MAX; \ last = latest; \ } @@ -394,7 +395,8 @@ static void ixgbe_l2_tunnel_conf(struct rte_eth_dev *dev); u64 new_lsb = IXGBE_READ_REG(hw, lsb); \ u64 new_msb = IXGBE_READ_REG(hw, msb); \ u64 latest = ((new_msb << 32) | new_lsb); \ - cur += (0x1000000000LL + latest - last) & 0xFFFFFFFFFLL; \ + if (latest) \ + cur += (0x1000000000LL + latest - last) & 0xFFFFFFFFFLL;\ last = latest; \ } -- 2.11.0