From b911281be641ff3822bf9983a7cd68f3bbaa291b Mon Sep 17 00:00:00 2001 From: Michael Qiu Date: Thu, 11 Jun 2015 15:29:52 +0800 Subject: [PATCH] ixgbe: reset hardware stats on initialization 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 Acked-by: Bernard Iremonger --- drivers/net/ixgbe/ixgbe_ethdev.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 4015febcfa..aa6074fda2 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -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); -- 2.20.1