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 595C9A0613 for ; Wed, 7 Aug 2019 16:37:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 34C7C2BD3; Wed, 7 Aug 2019 16:37:56 +0200 (CEST) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by dpdk.org (Postfix) with ESMTP id 883161D9E for ; Wed, 7 Aug 2019 16:37:52 +0200 (CEST) Received: by mail-wm1-f67.google.com with SMTP id 10so297956wmp.3 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=kqISTTOGeEbR3HD0WKGFJXOLsvwo/8QODdCjmiylyeV/GH+4YJnBfWlhA5oXD6aord FarcHhU7D58Q7TczhHuVuId+IQSmQbuwvDM1oJbVn+tv4s06Eysi/WUXSy480laBvicH 85FSe8Glr7V+QHT/SpWpCJuYVUlsFLCk9TeaCJDnkGwMQq0p95BC9Hy7nlf9h3jcDs4d 4NVzQvSBr7hrTlzQhQyt0p+I9H16KPbCY7ParEnmHNHQAYn1jQrgtMXRkGnKwR/UBFZu a+ZCo0U8aNvbFRXm47I7TgcagbWWkiNzhU+K5kGZE9P9Z9iE7oCe1ddJbrKPFv7m4cuF EeiA== X-Gm-Message-State: APjAAAXrcQrJSDNiKlwAdqSaLeROVL+X3iQ7SYKqppp61Z+VDY291bvI 7WK42/wAgAT+lYSG2EG/Ksax 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-stable] [PATCH 19.11 01/12] net/ixgbevf: fix stats update after a PF reset X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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