[dpdk-dev,v2] ixgbe: reset hardware stat when initialize

Message ID 1434007792-7898-1-git-send-email-michael.qiu@intel.com (mailing list archive)
State Accepted, archived
Headers

Commit Message

Michael Qiu June 11, 2015, 7:29 a.m. UTC
  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>
---
Change log:
	v2 --> v1:
	change the folder of driver

 drivers/net/ixgbe/ixgbe_ethdev.c | 6 ++++++
 1 file changed, 6 insertions(+)
  

Comments

Iremonger, Bernard June 22, 2015, 12:47 p.m. UTC | #1
> -----Original Message-----
> From: Qiu, Michael
> Sent: Thursday, June 11, 2015 8:30 AM
> To: dev@dpdk.org
> Cc: Iremonger, Bernard; thomas.monjalon@6wind.com; Qiu, Michael
> Subject: [PATCH v2] ixgbe: reset hardware stat when initialize
> 
> 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>
  
Michael Qiu July 2, 2015, 11:54 a.m. UTC | #2
Hi, all

Any comments  on this patch?

Thanks,
Michael

On 6/22/2015 8:47 PM, Iremonger, Bernard wrote:
>> -----Original Message-----
>> From: Qiu, Michael
>> Sent: Thursday, June 11, 2015 8:30 AM
>> To: dev@dpdk.org
>> Cc: Iremonger, Bernard; thomas.monjalon@6wind.com; Qiu, Michael
>> Subject: [PATCH v2] ixgbe: reset hardware stat when initialize
>>
>> 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>
>
>
  
Thomas Monjalon July 10, 2015, 3:52 p.m. UTC | #3
> > 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>

Applied, thanks
  

Patch

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);