From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Qiu Subject: [PATCH v2] ixgbe: reset hardware stat when initialize Date: Thu, 11 Jun 2015 15:29:52 +0800 Message-ID: <1434007792-7898-1-git-send-email-michael.qiu@intel.com> References: <1431072861-28565-1-git-send-email-qiudayu@cn.ibm.com> To: dev@dpdk.org Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 436A9CE7 for ; Thu, 11 Jun 2015 09:30:04 +0200 (CEST) In-Reply-To: <1431072861-28565-1-git-send-email-qiudayu@cn.ibm.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- Change log: v2 --> v1: change the folder of driver 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 0d9f9b2..e0415a7 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -840,6 +840,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); @@ -1012,6 +1015,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); -- 1.9.3