[dpdk-stable] patch 'net/bnxt: fix extended port counter statistics' has been queued to LTS release 18.11.3

Kevin Traynor ktraynor at redhat.com
Thu Sep 5 12:17:10 CEST 2019


Hi,

FYI, your patch has been queued to LTS release 18.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 09/12/19. 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/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/1c90b45f091380e985231d80b1d5a1de8bb364c3

Thanks.

Kevin Traynor

---
>From 1c90b45f091380e985231d80b1d5a1de8bb364c3 Mon Sep 17 00:00:00 2001
From: Santoshkumar Karanappa Rastapur <santosh.rastapur at broadcom.com>
Date: Thu, 25 Jul 2019 10:29:46 +0530
Subject: [PATCH] net/bnxt: fix extended port counter statistics

[ upstream commit b02a39ba3ba043827fb91c175900aed0eddf0d2d ]

We were trying to fill in more rx extended stats than the size allocated
for stats causing segfault. Fixed this by adding an explicit check.
Rearranged the code to return statistic values in xstats_get as per the
names returned in xstats_get_names.

Fixes: f55e12f33416 ("net/bnxt: support extended port counters")

Signed-off-by: Rahul Gupta <rahul.gupta at broadcom.com>
Signed-off-by: Santoshkumar Karanappa Rastapur <santosh.rastapur at broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur at broadcom.com>
---
 drivers/net/bnxt/bnxt_stats.c | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_stats.c b/drivers/net/bnxt/bnxt_stats.c
index aa1ab805d..e0f70781a 100644
--- a/drivers/net/bnxt/bnxt_stats.c
+++ b/drivers/net/bnxt/bnxt_stats.c
@@ -427,6 +427,10 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,
 	bnxt_hwrm_func_qstats_tx_drop(bp, 0xffff, &tx_drop_pkts);
 	bnxt_hwrm_ext_port_qstats(bp);
-	rx_port_stats_ext_cnt = bp->fw_rx_port_stats_ext_size / stat_size;
-	tx_port_stats_ext_cnt = bp->fw_tx_port_stats_ext_size / stat_size;
+	rx_port_stats_ext_cnt = RTE_MIN(RTE_DIM(bnxt_rx_ext_stats_strings),
+					(bp->fw_rx_port_stats_ext_size /
+					 stat_size));
+	tx_port_stats_ext_cnt = RTE_MIN(RTE_DIM(bnxt_tx_ext_stats_strings),
+					(bp->fw_tx_port_stats_ext_size /
+					 stat_size));
 
 	count = RTE_DIM(bnxt_rx_stats_strings) +
@@ -463,14 +467,4 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,
 	count++;
 
-	for (i = 0; i < tx_port_stats_ext_cnt; i++) {
-		uint64_t *tx_stats_ext = (uint64_t *)bp->hw_tx_port_stats_ext;
-
-		xstats[count].value = rte_le_to_cpu_64
-					(*(uint64_t *)((char *)tx_stats_ext +
-					 bnxt_tx_ext_stats_strings[i].offset));
-
-		count++;
-	}
-
 	for (i = 0; i < rx_port_stats_ext_cnt; i++) {
 		uint64_t *rx_stats_ext = (uint64_t *)bp->hw_rx_port_stats_ext;
@@ -483,4 +477,14 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,
 	}
 
+	for (i = 0; i < tx_port_stats_ext_cnt; i++) {
+		uint64_t *tx_stats_ext = (uint64_t *)bp->hw_tx_port_stats_ext;
+
+		xstats[count].value = rte_le_to_cpu_64
+					(*(uint64_t *)((char *)tx_stats_ext +
+					 bnxt_tx_ext_stats_strings[i].offset));
+
+		count++;
+	}
+
 	return stat_count;
 }
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-09-05 10:36:48.121254501 +0100
+++ 0010-net-bnxt-fix-extended-port-counter-statistics.patch	2019-09-05 10:36:47.474701384 +0100
@@ -1 +1 @@
-From b02a39ba3ba043827fb91c175900aed0eddf0d2d Mon Sep 17 00:00:00 2001
+From 1c90b45f091380e985231d80b1d5a1de8bb364c3 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b02a39ba3ba043827fb91c175900aed0eddf0d2d ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -22 +23 @@
-index 4e74f8a27..69ac2dd91 100644
+index aa1ab805d..e0f70781a 100644
@@ -25 +26 @@
-@@ -428,6 +428,10 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,
+@@ -427,6 +427,10 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,
@@ -38 +39 @@
-@@ -464,14 +468,4 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,
+@@ -463,14 +467,4 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,
@@ -53 +54 @@
-@@ -484,4 +478,14 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,
+@@ -483,4 +477,14 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,


More information about the stable mailing list