From: Kalesh A P <kalesh-anakkur.purayil@broadcom.com>
To: dev@dpdk.org
Cc: ferruh.yigit@amd.com, ajit.khaparde@broadcom.com
Subject: [dpdk-dev] [PATCH 1/3] net/bnxt: fix Tx queue stats after queue stop and start
Date: Wed, 1 Feb 2023 09:50:12 +0530 [thread overview]
Message-ID: <20230201042014.23526-2-kalesh-anakkur.purayil@broadcom.com> (raw)
In-Reply-To: <20230201042014.23526-1-kalesh-anakkur.purayil@broadcom.com>
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
The Tx queue stats are being reported incorrectly due to a workaround
for ring counters sometimes being reported as zero. When a queue is
stopped and started, the ring counter is reset to zero. The workaround
interprets the zero as incorrect, and sets the reported ring count as
the previously read value (from before the queue being restared). This
shows up as negative counters in testpmd's "show fwd stats" command.
The fix clears the prev counter for the queue when the queue is started.
Fixes: 219842b9990c ("net/bnxt: workaround spurious zero stats in Thor")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_txr.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
index 67e0167..21c2217 100644
--- a/drivers/net/bnxt/bnxt_txr.c
+++ b/drivers/net/bnxt/bnxt_txr.c
@@ -560,6 +560,12 @@ int bnxt_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)
if (rc)
return rc;
+ /* reset the previous stats for the tx_queue since the counters
+ * will be cleared when the queue is started.
+ */
+ memset(&bp->prev_tx_ring_stats[tx_queue_id], 0,
+ sizeof(struct bnxt_ring_stats));
+
bnxt_free_hwrm_tx_ring(bp, tx_queue_id);
rc = bnxt_alloc_hwrm_tx_ring(bp, tx_queue_id);
if (rc)
--
2.10.1
next prev parent reply other threads:[~2023-02-01 4:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-01 4:20 [dpdk-dev] [PATCH 0/3] bnxt PMD fixes Kalesh A P
2023-02-01 4:20 ` Kalesh A P [this message]
2023-02-01 4:20 ` [dpdk-dev] [PATCH 2/3] net/bnxt: fix Rx queue stats after queue stop and start Kalesh A P
2023-02-01 4:20 ` [dpdk-dev] [PATCH 3/3] net/bnxt: do not corrupt RSS hash value in the mbuf Kalesh A P
2023-02-06 17:29 ` [dpdk-dev] [PATCH 0/3] bnxt PMD fixes Ajit Khaparde
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=20230201042014.23526-2-kalesh-anakkur.purayil@broadcom.com \
--to=kalesh-anakkur.purayil@broadcom.com \
--cc=ajit.khaparde@broadcom.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.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).