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 9108AA00E6 for ; Thu, 8 Aug 2019 10:22:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2E1022B87; Thu, 8 Aug 2019 10:22: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 E12BE137C for ; Thu, 8 Aug 2019 10:22:52 +0200 (CEST) Received: by mail-wm1-f67.google.com with SMTP id 207so1489072wma.1 for ; Thu, 08 Aug 2019 01:22: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=8Zrz47bKGdm5AKYH7KFpcAgs3fa6BrxTmQEchj0jXOQ=; b=QVsZqWu5n8favSRilxqJ6SkS/QRXKeMFS/cIvOwOSPo3GIr6P/TyJ6pvYi6ufV37l/ oYs5hr/BesCNNEatY/75Z3ZrzUtvL0GYZTUObJK0qIUjChpLCNMQ0/D+mX6Y28/eSal+ MZD/tQmBALxNh1DC1KyyMEe69mtD9sds7I/seM2l+eB3bK1O9nlfz+ZwZte9AuejzXWf eT3Q3V+UxDP9kKPe0mUfBFFlF5xIR04aOSMdnLeD9HlXyGHhqMju7pEB08vFqAz097AD B7ockCIBoqUxAhlvJ0MD7Cbt7OdKlo0IWR5Uzswnk+oHBG2Y3paPqgYd8bKa7NceZ/ZU oHng== 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=Spc/XARHbVr8mBueGWPGDaYvwHrjBQ3u19SDLdy+aUzQUFLuJVThmuzzAZa7StHLFX cesMI3tSni0neLnQlFDJlmDX6ZrmDxoVUM6ITk6aq0P2jpfePjqYJIyibuwwda7wBKue 7RYVU4Pe2PqvKqo4t7zxLsEhx7xOUoj4LVS7uU3WorlWT3Hx9XNRH9XrurxtQ6f09xyc 6zqIA7iTjXD4XM2p5mxwFWhd4EE26K49T1K45ZPGqTinjnuMG4yGh9+UuVuTBgGbgOzA wxOlY9UvNFIMISDQKrUfzp2G1MC42O1BJWaqVWi43Wvtrj1pND7nci/wXvrIRLzodBbY Y5tg== X-Gm-Message-State: APjAAAVJ+9AyuKOlz09WXTysJXS05PANRYLH0Ujd4UL2ppu3q3q2Bb6M o+OrhUEd0mzJgq/Y8p0B55fC X-Google-Smtp-Source: APXvYqyK5w45XnMkVdku61tcOytCQLgI11sy84sJXik3Gk6tgvHfygY3D9F+sFHqT4WAyIUmQ3pSww== X-Received: by 2002:a1c:a101:: with SMTP id k1mr2965386wme.98.1565252572553; Thu, 08 Aug 2019 01:22: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 t13sm111437018wrr.0.2019.08.08.01.22.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Aug 2019 01:22:51 -0700 (PDT) From: Thierry Herbelot To: dev@dpdk.org Cc: Guo Fengtian , stable@dpdk.org, Thomas Monjalon Date: Thu, 8 Aug 2019 10:22:06 +0200 Message-Id: <89560edc429c59b7f79c3633cc5e9e5987bbdd9b.1565252336.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 V3 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