[dpdk-stable] patch 'net/bnxt: clear cached statistics' has been queued to stable release 19.11.10

christian.ehrhardt at canonical.com christian.ehrhardt at canonical.com
Tue Aug 10 17:39:50 CEST 2021


Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/a0776bdb0995d658f4c9793b70b56fe7f4118e5f

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From a0776bdb0995d658f4c9793b70b56fe7f4118e5f Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
Date: Tue, 13 Jul 2021 19:04:13 +0530
Subject: [PATCH] net/bnxt: clear cached statistics

[ upstream commit 84fd852caac19795d0a05af8dabce8f011fe61a4 ]

As part of the workaround put in the commit "219842b9990c",
driver caches the last read stats values from the hardware.
But this is not cleared during the clear stats operation. This
results in showing up stale stats values while reading the stats
after the clear operation.

Fixes: 219842b9990c ("net/bnxt: workaround spurious zero stats in Thor")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson at broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur at broadcom.com>
---
 drivers/net/bnxt/bnxt_stats.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_stats.c b/drivers/net/bnxt/bnxt_stats.c
index 692b0967eb..a30e2b465d 100644
--- a/drivers/net/bnxt/bnxt_stats.c
+++ b/drivers/net/bnxt/bnxt_stats.c
@@ -424,6 +424,16 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
 	return rc;
 }
 
+static void bnxt_clear_prev_stat(struct bnxt *bp)
+{
+	/*
+	 * Clear the cached values of stats returned by HW in the previous
+	 * get operation.
+	 */
+	memset(bp->prev_rx_ring_stats, 0, sizeof(struct bnxt_ring_stats) * bp->rx_cp_nr_rings);
+	memset(bp->prev_tx_ring_stats, 0, sizeof(struct bnxt_ring_stats) * bp->tx_cp_nr_rings);
+}
+
 int bnxt_stats_reset_op(struct rte_eth_dev *eth_dev)
 {
 	struct bnxt *bp = eth_dev->data->dev_private;
@@ -446,6 +456,8 @@ int bnxt_stats_reset_op(struct rte_eth_dev *eth_dev)
 		rte_atomic64_clear(&rxq->rx_mbuf_alloc_fail);
 	}
 
+	bnxt_clear_prev_stat(bp);
+
 	return ret;
 }
 
@@ -611,5 +623,7 @@ int bnxt_dev_xstats_reset_op(struct rte_eth_dev *eth_dev)
 		PMD_DRV_LOG(ERR, "Failed to reset xstats: %s\n",
 			    strerror(-ret));
 
+	bnxt_clear_prev_stat(bp);
+
 	return ret;
 }
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:15.728060604 +0200
+++ 0070-net-bnxt-clear-cached-statistics.patch	2021-08-10 15:11:13.074638504 +0200
@@ -1 +1 @@
-From 84fd852caac19795d0a05af8dabce8f011fe61a4 Mon Sep 17 00:00:00 2001
+From a0776bdb0995d658f4c9793b70b56fe7f4118e5f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 84fd852caac19795d0a05af8dabce8f011fe61a4 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -24 +25 @@
-index c7b23f46a1..991eafc644 100644
+index 692b0967eb..a30e2b465d 100644
@@ -27 +28 @@
-@@ -603,6 +603,16 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
+@@ -424,6 +424,16 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
@@ -44 +45 @@
-@@ -625,6 +635,8 @@ int bnxt_stats_reset_op(struct rte_eth_dev *eth_dev)
+@@ -446,6 +456,8 @@ int bnxt_stats_reset_op(struct rte_eth_dev *eth_dev)
@@ -53 +54 @@
-@@ -933,6 +945,8 @@ int bnxt_dev_xstats_reset_op(struct rte_eth_dev *eth_dev)
+@@ -611,5 +623,7 @@ int bnxt_dev_xstats_reset_op(struct rte_eth_dev *eth_dev)
@@ -61 +61,0 @@
- 


More information about the stable mailing list