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 A8303A00E6 for ; Wed, 7 Aug 2019 17:09:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D3F3E2BF1; Wed, 7 Aug 2019 17:09:44 +0200 (CEST) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id 5D44F2BAC for ; Wed, 7 Aug 2019 17:09:39 +0200 (CEST) Received: by mail-wr1-f66.google.com with SMTP id t16so1629108wra.6 for ; Wed, 07 Aug 2019 08:09:39 -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=abPn8zI4NB0a/BVB1JUcXoGY0aOz5OIhETanZrx0bg1yROTOGIj+O9JP0JemPLOxfw 5S5U6CRlV/uNrM/SRlCKN4syd0gN4w3Gf+NvUp8jNZ+DZZ/LK8YK4svzrwYvZRBYN/uW 7zIFtebdqOepfOCSFcHFKfu6Sq6rTEA1Wh+Ie/0YsVZlOfLEeNxn9++BO3X0Ip+DbTu5 VQ3XKGhzuA5tynWLIeMD7gm628dkP1WQ+Yu2fBqTDJpgwgZ/gQgy4ARQMuv9v++LwO25 2TFGoBrhOdJYxxGpMoSh4Fs+S/XssdcszgMItxo6JjCovABuiXgYa+Nw6k8nlSOM8kG9 P3bw== X-Gm-Message-State: APjAAAXSdSLroFxF+wN9p4kRPr/Kbe4iZcYVt0lDe7OEINhQ9QKN/4O/ nZ3/+vcP4IEuxEZ55CGuh9u86VQRug== 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-dev] [PATCH 19.11 V2 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@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