patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Simei Su <simei.su@intel.com>
To: qabuild@intel.com
Cc: simei <simei.su@intel.com>, stable@dpdk.org
Subject: [dpdk-stable] [DPDK] net/ice: change Rx statistics method
Date: Tue, 16 Apr 2019 19:45:00 +0800	[thread overview]
Message-ID: <1555415100-91270-1-git-send-email-simei.su@intel.com> (raw)

From: simei <simei.su@intel.com>

This patch modify ipackets and ibytes statistic based on vsi
instead of port to avoid statistics error.

Fixes: a37bde56314d ("net/ice: support statistics")
Cc: stable@dpdk.org

Signed-off-by: Simei Su <simei.su@intel.com>
---
 drivers/net/ice/ice_ethdev.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 0946b19..1c851ac 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -3305,15 +3305,14 @@ static int ice_rx_queue_intr_disable(struct rte_eth_dev *dev,
 	/* call read registers - updates values, now write them to struct */
 	ice_read_stats_registers(pf, hw);
 
-	stats->ipackets = ns->eth.rx_unicast +
-			  ns->eth.rx_multicast +
-			  ns->eth.rx_broadcast -
-			  ns->eth.rx_discards -
+	stats->ipackets = pf->main_vsi->eth_stats.rx_unicast +
+			  pf->main_vsi->eth_stats.rx_multicast +
+			  pf->main_vsi->eth_stats.rx_broadcast -
 			  pf->main_vsi->eth_stats.rx_discards;
 	stats->opackets = ns->eth.tx_unicast +
 			  ns->eth.tx_multicast +
 			  ns->eth.tx_broadcast;
-	stats->ibytes   = ns->eth.rx_bytes;
+	stats->ibytes   = pf->main_vsi->eth_stats.rx_bytes;
 	stats->obytes   = ns->eth.tx_bytes;
 	stats->oerrors  = ns->eth.tx_errors +
 			  pf->main_vsi->eth_stats.tx_errors;
-- 
1.8.3.1


                 reply	other threads:[~2019-04-16 12:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1555415100-91270-1-git-send-email-simei.su@intel.com \
    --to=simei.su@intel.com \
    --cc=qabuild@intel.com \
    --cc=stable@dpdk.org \
    /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).