igbvf: fix statistic wraparound
authorHarry van Haaren <harry.van.haaren@intel.com>
Mon, 12 Oct 2015 16:45:33 +0000 (17:45 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 28 Oct 2015 13:41:11 +0000 (14:41 +0100)
Fix a misinterpreatation of VF statistic macro in e1000/igb.

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

index 422d718..3ab082e 100644 (file)
@@ -246,11 +246,10 @@ static void eth_igb_configure_msix_intr(struct rte_eth_dev *dev);
 #define UPDATE_VF_STAT(reg, last, cur)            \
 {                                                 \
        u32 latest = E1000_READ_REG(hw, reg);     \
 #define UPDATE_VF_STAT(reg, last, cur)            \
 {                                                 \
        u32 latest = E1000_READ_REG(hw, reg);     \
-       cur += latest - last;                     \
+       cur += (latest - last) & UINT_MAX;        \
        last = latest;                            \
 }
 
        last = latest;                            \
 }
 
-
 #define IGB_FC_PAUSE_TIME 0x0680
 #define IGB_LINK_UPDATE_CHECK_TIMEOUT  90  /* 9s */
 #define IGB_LINK_UPDATE_CHECK_INTERVAL 100 /* ms */
 #define IGB_FC_PAUSE_TIME 0x0680
 #define IGB_LINK_UPDATE_CHECK_TIMEOUT  90  /* 9s */
 #define IGB_LINK_UPDATE_CHECK_INTERVAL 100 /* ms */