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 03FB5A00E6 for ; Thu, 8 Aug 2019 10:23:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 492912B9E; 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 02B862082 for ; Thu, 8 Aug 2019 10:22:53 +0200 (CEST) Received: by mail-wm1-f67.google.com with SMTP id u25so1481905wmc.4 for ; Thu, 08 Aug 2019 01:22:53 -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=FBOcQ0w1ufNv1o+EV689cXKxoq4P1bInFQ6d0Y/nwYcwCKYR1B1/qegGXw/oUmcP+3 PSk61X26PADArXdt5HV3fiKcVuS+vk3l9NxST+izmP5/krjoSuZlZz0fKXg6zl/8Uw6w 3MZceYrJxsXnFbrDnmztXYysiG8VU/581X2WAlxx2wsSzQnqOQbPV++KGFI/678vsA6X 79Xn264OEZvFEhpbwm2HWMatJE8e0+TkBCyEpHvTKmStuEJPguV7OWl08/baOmEvIjsG kpQ1iCji4b57wc5MU3RfXoO2S63GBj2mv9B/ccq2YbFxYlMU1G4HCfJcdjq1ejDQDA8f S0lQ== X-Gm-Message-State: APjAAAW9qNUmTtKZzuGyRHJ4rQBJXhZo84w4MfBw2sie9vS4UhlrWV/o RL1SokCUMEGJWF+bOpTR9fG+a5417g== 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-dev] [PATCH 19.11 V3 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