ixgbe: reset hardware stats on initialization
authorMichael Qiu <michael.qiu@intel.com>
Thu, 11 Jun 2015 07:29:52 +0000 (15:29 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 10 Jul 2015 15:51:20 +0000 (17:51 +0200)
When initialize the hardware, the stat should be reset.
Otherwise when detach then attach port, the stat will not
be re-init to zero.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
drivers/net/ixgbe/ixgbe_ethdev.c

index 4015feb..aa6074f 100644 (file)
@@ -866,6 +866,9 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev)
                return -EIO;
        }
 
+       /* Reset the hw statistics */
+       ixgbe_dev_stats_reset(eth_dev);
+
        /* disable interrupt */
        ixgbe_disable_intr(hw);
 
@@ -1038,6 +1041,9 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev)
        /* init_mailbox_params */
        hw->mbx.ops.init_params(hw);
 
+       /* Reset the hw statistics */
+       ixgbevf_dev_stats_reset(eth_dev);
+
        /* Disable the interrupts for VF */
        ixgbevf_intr_disable(hw);