ixgbevf: fix statistic wraparound
authorHarry van Haaren <harry.van.haaren@intel.com>
Mon, 12 Oct 2015 16:45:32 +0000 (17:45 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 28 Oct 2015 13:41:11 +0000 (14:41 +0100)
Fix a misinterpretation of VF stats in ixgbe

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Roger Melton <rmelton@cisco.com>
drivers/net/ixgbe/ixgbe_ethdev.c

index ec2918c..74239a4 100644 (file)
@@ -329,10 +329,10 @@ static int ixgbe_timesync_read_tx_timestamp(struct rte_eth_dev *dev,
 /*
  * Define VF Stats MACRO for Non "cleared on read" register
  */
-#define UPDATE_VF_STAT(reg, last, cur)                         \
+#define UPDATE_VF_STAT(reg, last, cur)                          \
 {                                                               \
        uint32_t latest = IXGBE_READ_REG(hw, reg);              \
-       cur += latest - last;                                   \
+       cur += (latest - last) & UINT_MAX;                      \
        last = latest;                                          \
 }