From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 11 Jun 2015 00:30:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,593,1427785200"; d="scan'208";a="744775673" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga002.jf.intel.com with ESMTP; 11 Jun 2015 00:30:02 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t5B7U0Ww011470; Thu, 11 Jun 2015 15:30:00 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t5B7TvWH007932; Thu, 11 Jun 2015 15:29:59 +0800 Received: (from dayuqiu@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t5B7TvW4007928; Thu, 11 Jun 2015 15:29:57 +0800 From: Michael Qiu To: dev@dpdk.org Date: Thu, 11 Jun 2015 15:29:52 +0800 Message-Id: <1434007792-7898-1-git-send-email-michael.qiu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1431072861-28565-1-git-send-email-qiudayu@cn.ibm.com> References: <1431072861-28565-1-git-send-email-qiudayu@cn.ibm.com> Subject: [dpdk-dev] [PATCH v2] ixgbe: reset hardware stat when initialize X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2015 07:30:04 -0000 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