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 E097CA00E6 for ; Wed, 7 Aug 2019 17:09:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A1F142BD3; Wed, 7 Aug 2019 17:09:44 +0200 (CEST) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id E622F2B9C for ; Wed, 7 Aug 2019 17:09:38 +0200 (CEST) Received: by mail-wr1-f65.google.com with SMTP id t16so1629091wra.6 for ; Wed, 07 Aug 2019 08:09:38 -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=8Zrz47bKGdm5AKYH7KFpcAgs3fa6BrxTmQEchj0jXOQ=; b=WmAm4dIjyCt8LdfYacerQVXEPZv3248VM5axiVIVWZzODPdHT9OfRibYuLA6njs8pA XlIq2LBWdLetNhtFlAwlzDGao5Q8gX6UNx48+TyFUXyAV8B2ErBAGNCwyWxCSSM+S7F7 a7bACVayL0+j4Y5VEd/PA+Q+QFl76+A3vjA0eEaPzv88msVnzauJmzTdHTd1YvHVtq0O aAK4H864z3jdjwvgna6gUvnvtImFkjaKklbRrHjQO7ZXbX1sJCDnjlSLsqbhMSZnEuuu XkWvp6XTlDoTaNC8l7k7vcSog+wsSRviABQ0tFwlvRGm3gE0aeXo+KE47c61P4mVLfMG qoXQ== 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=8Zrz47bKGdm5AKYH7KFpcAgs3fa6BrxTmQEchj0jXOQ=; b=QqJSUT8fvV0M7nmgfcdYWNGomxaLiF4gLsfi+5rcREEQXEfSaJIrW2DmVc02ksNuYL S6x7mthqlAnjBjZuxAb97nm8Lt+RZofiZn5Q8y564TvElmW5Dsmb0YuOj2AK5d73p1G8 HKqiy9vdGqLPU6nCU5K6gtCszyUkTH5VZPhAA7ohhFlJliNnP97lyNIAMtShGp7qdqkH Wd42F8ufkUxE8qrvYzH1Dw4L/yIAJnH3lZ02PExWlwB7d099p/kLyBI5Hk/GoruOTioF XcEJN8IGTBG3rjq/+8ByU6zdQRKCd7OazLQoVFpmGgPeMsbzJ6x+HZ87VHFCYM4gFvIN IVDw== X-Gm-Message-State: APjAAAUxTBYO4RTSlf4Gz8E3OamCfIPKZCHsG1p8ZqSyVI+DWSo18bNK Vs4btZQ2HDOBT9PhoQWDw7JY X-Google-Smtp-Source: APXvYqwk/kJGwmlYEXd8Vbt38NXrEC7x2QRwbN9b4849aUryTD4hG/vUqVYzoAP2opCjYvY2cujHLQ== X-Received: by 2002:adf:b1d0:: with SMTP id r16mr11747930wra.332.1565190578739; Wed, 07 Aug 2019 08:09:38 -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 r5sm382862wmh.35.2019.08.07.08.09.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Aug 2019 08:09:37 -0700 (PDT) From: Thierry Herbelot To: dev@dpdk.org Cc: Guo Fengtian , stable@dpdk.org, Thomas Monjalon Date: Wed, 7 Aug 2019 17:09:10 +0200 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-stable] [PATCH 19.11 V2 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@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