DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jingjing Wu <jingjing.wu@intel.com>
To: bruce.richardson@intel.com
Cc: dev@dpdk.org, jingjing.wu@intel.com, helin.zhang@intel.com
Subject: [dpdk-dev] [PATCH] i40e: fix packet stats getting
Date: Tue, 19 Apr 2016 14:11:13 +0800	[thread overview]
Message-ID: <1461046273-16755-1-git-send-email-jingjing.wu@intel.com> (raw)

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 of
offset_loaded flag is not set correctly after device started.
This patch fixes this issue by resetting statistics at initialization
time, at the meanwhile the resetting process will set offset_loaded
flag.

Fixes: 4861cde46116 ("i40e: new poll mode driver")
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
---
 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 bc28d3c..3aaef07 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.4.0

             reply	other threads:[~2016-04-19  6:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-19  6:11 Jingjing Wu [this message]
2016-04-19  6:21 ` Zhang, Helin
2016-04-21 14:14   ` Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1461046273-16755-1-git-send-email-jingjing.wu@intel.com \
    --to=jingjing.wu@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=helin.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).