All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/ixgbevf: fix stats update after a PF reset
@ 2017-01-11 17:04 Olivier Matz
  2017-02-06 13:58 ` Olivier Matz
  0 siblings, 1 reply; 13+ messages in thread
From: Olivier Matz @ 2017-01-11 17:04 UTC (permalink / raw)
  To: dev, helin.zhang, konstantin.ananyev; +Cc: Guo Fengtian, stable

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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-03-30 11:58 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-11 17:04 [PATCH] net/ixgbevf: fix stats update after a PF reset Olivier Matz
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.