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

Kevin Traynor ktraynor at redhat.com
Wed Aug 28 15:42:22 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/04/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/7ce0d3877090030eaeb6ed339ca73d6b9d9450ee

Thanks.

Kevin Traynor

---
>From 7ce0d3877090030eaeb6ed339ca73d6b9d9450ee Mon Sep 17 00:00:00 2001
From: Lance Richardson <lance.richardson at broadcom.com>
Date: Thu, 18 Jul 2019 09:06:13 +0530
Subject: [PATCH] net/bnxt: fix getting statistics

[ upstream commit 75306ee088915446c50e5525fc657fad28ee6935 ]

Avoid overrun in rte_eth_stats struct when the number of tx/rx
rings in use is greater than RTE_ETHDEV_QUEUE_STAT_CNTRS.

Fixes: 57d5e5bc86e4 ("net/bnxt: add statistics")

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

diff --git a/drivers/net/bnxt/bnxt_stats.c b/drivers/net/bnxt/bnxt_stats.c
index 73e909691..aa1ab805d 100644
--- a/drivers/net/bnxt/bnxt_stats.c
+++ b/drivers/net/bnxt/bnxt_stats.c
@@ -351,4 +351,5 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
 	unsigned int i;
 	struct bnxt *bp = eth_dev->data->dev_private;
+	unsigned int num_q_stats;
 
 	memset(bnxt_stats, 0, sizeof(*bnxt_stats));
@@ -358,5 +359,8 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
 	}
 
-	for (i = 0; i < bp->rx_cp_nr_rings; i++) {
+	num_q_stats = RTE_MIN(bp->rx_cp_nr_rings,
+			      (unsigned int)RTE_ETHDEV_QUEUE_STAT_CNTRS);
+
+	for (i = 0; i < num_q_stats; i++) {
 		struct bnxt_rx_queue *rxq = bp->rx_queues[i];
 		struct bnxt_cp_ring_info *cpr = rxq->cp_ring;
@@ -370,5 +374,8 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
 	}
 
-	for (i = 0; i < bp->tx_cp_nr_rings; i++) {
+	num_q_stats = RTE_MIN(bp->tx_cp_nr_rings,
+			      (unsigned int)RTE_ETHDEV_QUEUE_STAT_CNTRS);
+
+	for (i = 0; i < num_q_stats; i++) {
 		struct bnxt_tx_queue *txq = bp->tx_queues[i];
 		struct bnxt_cp_ring_info *cpr = txq->cp_ring;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-08-28 14:32:34.592561062 +0100
+++ 0047-net-bnxt-fix-getting-statistics.patch	2019-08-28 14:32:31.711955800 +0100
@@ -1 +1 @@
-From 75306ee088915446c50e5525fc657fad28ee6935 Mon Sep 17 00:00:00 2001
+From 7ce0d3877090030eaeb6ed339ca73d6b9d9450ee Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 75306ee088915446c50e5525fc657fad28ee6935 ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -20 +21 @@
-index 3cd5144ec..4e74f8a27 100644
+index 73e909691..aa1ab805d 100644
@@ -23 +24 @@
-@@ -352,4 +352,5 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
+@@ -351,4 +351,5 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
@@ -29 +30 @@
-@@ -359,5 +360,8 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
+@@ -358,5 +359,8 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
@@ -39 +40 @@
-@@ -371,5 +375,8 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
+@@ -370,5 +374,8 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,


More information about the stable mailing list