From ad3bc4f684ec3575044a485049c343148e9c73a9 Mon Sep 17 00:00:00 2001 From: Jingjing Wu Date: Tue, 19 Apr 2016 14:11:13 +0800 Subject: [PATCH] i40e: fix packet count stats The statistics queried by calling rte_eth_stats_get are zero when the API is first called on the port. The root cause is because the offset_loaded flag is not set correctly after device start. This patch fixes this issue by resetting statistics at initialization time. The resetting process will set offset_loaded flag. Fixes: 4861cde46116 ("i40e: new poll mode driver") Signed-off-by: Jingjing Wu Acked-by: Helin Zhang --- drivers/net/i40e/i40e_ethdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 43939ca0b7..24777d5c12 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -934,6 +934,9 @@ eth_i40e_dev_init(struct rte_eth_dev *dev) goto err_setup_pf_switch; } + /* reset all stats of the device, including pf and main vsi */ + i40e_dev_stats_reset(dev); + vsi = pf->main_vsi; /* Disable double vlan by default */ -- 2.20.1