patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Min Hu (Connor)" <humin29@huawei.com>
To: <stable@dpdk.org>
Cc: <suanmingm@nvidia.com>, <ferruh.yigit@intel.com>
Subject: [dpdk-stable] [PATCH 19.11 1/2] net/hns3: fix Rx/Tx errors stats
Date: Tue, 9 Feb 2021 11:14:06 +0800
Message-ID: <1612840447-56296-2-git-send-email-humin29@huawei.com> (raw)
In-Reply-To: <1612840447-56296-1-git-send-email-humin29@huawei.com>

From: Huisong Li <lihuisong@huawei.com>

[ upstream commit ec12dc5a554ab4f8dd8a90cab54426dfa685ba80 ]

Abnormal errors stats in Rx/Tx datapath are statistics
items in driver, and displayed in xstats. They should
be cleared by the rte_eth_xstats_reset api, instead of
the rte_eth_stats_reset.

Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations")
Cc: stable@dpdk.org
---
 drivers/net/hns3/hns3_stats.c | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/drivers/net/hns3/hns3_stats.c b/drivers/net/hns3/hns3_stats.c
index 10cc757..4cf5e8f 100644
--- a/drivers/net/hns3/hns3_stats.c
+++ b/drivers/net/hns3/hns3_stats.c
@@ -505,16 +505,15 @@ hns3_stats_reset(struct rte_eth_dev *eth_dev)
 		}
 	}
 
-	/* Clear Rx BD and Tx error stats */
+	/*
+	 * Clear soft stats of rx error packet which will be dropped
+	 * in driver.
+	 */
 	for (i = 0; i != eth_dev->data->nb_rx_queues; ++i) {
 		rxq = eth_dev->data->rx_queues[i];
 		if (rxq) {
 			rxq->pkt_len_errors = 0;
 			rxq->l2_errors = 0;
-			rxq->l3_csum_erros = 0;
-			rxq->l4_csum_erros = 0;
-			rxq->ol3_csum_erros = 0;
-			rxq->ol4_csum_erros = 0;
 		}
 	}
 
@@ -914,7 +913,9 @@ hns3_dev_xstats_reset(struct rte_eth_dev *dev)
 {
 	struct hns3_adapter *hns = dev->data->dev_private;
 	struct hns3_pf *pf = &hns->pf;
+	struct hns3_rx_queue *rxq;
 	int ret;
+	int i;
 
 	/* Clear tqp stats */
 	ret = hns3_stats_reset(dev);
@@ -924,6 +925,17 @@ hns3_dev_xstats_reset(struct rte_eth_dev *dev)
 	/* Clear reset stats */
 	memset(&hns->hw.reset.stats, 0, sizeof(struct hns3_reset_stats));
 
+	/* Clear Rx checksum error stats */
+	for (i = 0; i < dev->data->nb_rx_queues; ++i) {
+		rxq = dev->data->rx_queues[i];
+		if (rxq) {
+			rxq->l3_csum_erros = 0;
+			rxq->l4_csum_erros = 0;
+			rxq->ol3_csum_erros = 0;
+			rxq->ol4_csum_erros = 0;
+		}
+	}
+
 	if (hns->is_vf)
 		return 0;
 
-- 
2.7.4


  reply	other threads:[~2021-02-09  3:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-09  3:14 [dpdk-stable] [PATCH 19.11 0/2] backport stats fix Min Hu (Connor)
2021-02-09  3:14 ` Min Hu (Connor) [this message]
2021-02-09  3:14 ` [dpdk-stable] [[PATCH 19.11 2/2] net/hns3: fix xstats with id and names Min Hu (Connor)

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=1612840447-56296-2-git-send-email-humin29@huawei.com \
    --to=humin29@huawei.com \
    --cc=ferruh.yigit@intel.com \
    --cc=stable@dpdk.org \
    --cc=suanmingm@nvidia.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

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git