DPDK patches and discussions
 help / color / mirror / Atom feed
From: Olivier Matz <olivier.matz@6wind.com>
To: dev@dpdk.org, helin.zhang@intel.com, konstantin.ananyev@intel.com
Cc: Guo Fengtian <fengtian.guo@6wind.com>, stable@dpdk.org
Subject: [dpdk-dev] [PATCH] net/ixgbevf: fix stats update after a PF reset
Date: Wed, 11 Jan 2017 18:04:14 +0100	[thread overview]
Message-ID: <1484154254-31387-1-git-send-email-olivier.matz@6wind.com> (raw)

From: Guo Fengtian <fengtian.guo@6wind.com>

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 <fengtian.guo@6wind.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
 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 2d8641a..455a0c9 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -389,7 +389,8 @@ static int ixgbe_dev_udp_tunnel_port_del(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 != 0)					\
+		cur += (latest - last) & UINT_MAX;              \
 	last = latest;                                          \
 }
 
@@ -398,7 +399,8 @@ static int ixgbe_dev_udp_tunnel_port_del(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 != 0)					 \
+		cur += (0x1000000000LL + latest - last) & 0xFFFFFFFFFLL; \
 	last = latest;                                           \
 }
 
-- 
2.8.1

             reply	other threads:[~2017-01-11 17:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-11 17:04 Olivier Matz [this message]
2017-02-06 13:58 ` Olivier Matz
2017-02-09 14:37   ` Dai, Wei
2017-02-09 14:50   ` Dai, Wei
2017-02-16 16:49     ` Olivier Matz
2017-03-14  9:46       ` Olivier Matz
2017-03-24 14:11         ` Olivier Matz
2017-03-28 15:22           ` Thomas Monjalon
2017-03-29  9:22             ` Dai, Wei
2017-03-29 10:08               ` Olivier Matz
2017-03-30 10:46                 ` Dai, Wei
2017-03-30 11:58                   ` Olivier Matz
2017-03-29  9:37             ` Dai, Wei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1484154254-31387-1-git-send-email-olivier.matz@6wind.com \
    --to=olivier.matz@6wind.com \
    --cc=dev@dpdk.org \
    --cc=fengtian.guo@6wind.com \
    --cc=helin.zhang@intel.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).