[dpdk-stable] patch 'net/bnxt: fix xstats by id' has been queued to stable release 19.11.6

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Nov 9 19:40:16 CET 2020


Hi,

FYI, your patch has been queued to stable release 19.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/f9f235f69970211bff39a39f6a7753f622d34bc1

Thanks.

Luca Boccassi

---
>From f9f235f69970211bff39a39f6a7753f622d34bc1 Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit at intel.com>
Date: Tue, 16 Jun 2020 16:36:13 +0100
Subject: [PATCH] net/bnxt: fix xstats by id

[ upstream commit 0b42b92ae42953e6984622afe91c76a43b59ab69 ]

The xstat by id device operation seems wrong, it fills 'xstats' struct
via 'bnxt_dev_xstats_get_op()' call, but the retrieved values are not
transferred to user input 'values' array.

ethdev layer 'rte_eth_xstats_get_by_id()' &
'rte_eth_xstats_get_names_by_id' already provides "by id" support when
device operations are missing.
It is good for PMD to provide these device operations if it has a more
performant way to get by id. But current implementation in PMD already
does same thing with the ethdev APIs, so removing them provides same
functionality.

Fixes: 88920136688c ("net/bnxt: support xstats get by id")

Signed-off-by: Ferruh Yigit <ferruh.yigit at intel.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c |  2 -
 drivers/net/bnxt/bnxt_stats.c  | 67 ----------------------------------
 2 files changed, 69 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 1b1f130ed3..65527a0637 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -3811,8 +3811,6 @@ static const struct eth_dev_ops bnxt_dev_ops = {
 	.txq_info_get = bnxt_txq_info_get_op,
 	.dev_led_on = bnxt_dev_led_on_op,
 	.dev_led_off = bnxt_dev_led_off_op,
-	.xstats_get_by_id = bnxt_dev_xstats_get_by_id_op,
-	.xstats_get_names_by_id = bnxt_dev_xstats_get_names_by_id_op,
 	.rx_queue_count = bnxt_rx_queue_count_op,
 	.rx_descriptor_status = bnxt_rx_descriptor_status_op,
 	.tx_descriptor_status = bnxt_tx_descriptor_status_op,
diff --git a/drivers/net/bnxt/bnxt_stats.c b/drivers/net/bnxt/bnxt_stats.c
index be5b514f49..84011fc3ea 100644
--- a/drivers/net/bnxt/bnxt_stats.c
+++ b/drivers/net/bnxt/bnxt_stats.c
@@ -617,70 +617,3 @@ int bnxt_dev_xstats_reset_op(struct rte_eth_dev *eth_dev)
 
 	return ret;
 }
-
-int bnxt_dev_xstats_get_by_id_op(struct rte_eth_dev *dev, const uint64_t *ids,
-		uint64_t *values, unsigned int limit)
-{
-	/* Account for the Tx drop pkts aka the Anti spoof counter */
-	const unsigned int stat_cnt = RTE_DIM(bnxt_rx_stats_strings) +
-				RTE_DIM(bnxt_tx_stats_strings) + 1 +
-				RTE_DIM(bnxt_rx_ext_stats_strings) +
-				RTE_DIM(bnxt_tx_ext_stats_strings);
-	struct bnxt *bp = dev->data->dev_private;
-	struct rte_eth_xstat xstats[stat_cnt];
-	uint64_t values_copy[stat_cnt];
-	uint16_t i;
-	int rc;
-
-	rc = is_bnxt_in_error(bp);
-	if (rc)
-		return rc;
-
-	if (!ids)
-		return bnxt_dev_xstats_get_op(dev, xstats, stat_cnt);
-
-	bnxt_dev_xstats_get_by_id_op(dev, NULL, values_copy, stat_cnt);
-	for (i = 0; i < limit; i++) {
-		if (ids[i] >= stat_cnt) {
-			PMD_DRV_LOG(ERR, "id value isn't valid");
-			return -EINVAL;
-		}
-		values[i] = values_copy[ids[i]];
-	}
-	return stat_cnt;
-}
-
-int bnxt_dev_xstats_get_names_by_id_op(struct rte_eth_dev *dev,
-				struct rte_eth_xstat_name *xstats_names,
-				const uint64_t *ids, unsigned int limit)
-{
-	/* Account for the Tx drop pkts aka the Anti spoof counter */
-	const unsigned int stat_cnt = RTE_DIM(bnxt_rx_stats_strings) +
-				RTE_DIM(bnxt_tx_stats_strings) + 1 +
-				RTE_DIM(bnxt_rx_ext_stats_strings) +
-				RTE_DIM(bnxt_tx_ext_stats_strings);
-	struct rte_eth_xstat_name xstats_names_copy[stat_cnt];
-	struct bnxt *bp = dev->data->dev_private;
-	uint16_t i;
-	int rc;
-
-	rc = is_bnxt_in_error(bp);
-	if (rc)
-		return rc;
-
-	if (!ids)
-		return bnxt_dev_xstats_get_names_op(dev, xstats_names,
-						    stat_cnt);
-	bnxt_dev_xstats_get_names_by_id_op(dev, xstats_names_copy, NULL,
-			stat_cnt);
-
-	for (i = 0; i < limit; i++) {
-		if (ids[i] >= stat_cnt) {
-			PMD_DRV_LOG(ERR, "id value isn't valid");
-			return -EINVAL;
-		}
-		strcpy(xstats_names[i].name,
-				xstats_names_copy[ids[i]].name);
-	}
-	return stat_cnt;
-}
-- 
2.27.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-11-09 18:40:12.339225409 +0000
+++ 0028-net-bnxt-fix-xstats-by-id.patch	2020-11-09 18:40:11.131311282 +0000
@@ -1 +1 @@
-From 0b42b92ae42953e6984622afe91c76a43b59ab69 Mon Sep 17 00:00:00 2001
+From f9f235f69970211bff39a39f6a7753f622d34bc1 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 0b42b92ae42953e6984622afe91c76a43b59ab69 ]
+
@@ -19 +20,0 @@
-Cc: stable at dpdk.org
@@ -25,2 +26,2 @@
- drivers/net/bnxt/bnxt_stats.c  | 69 ----------------------------------
- 2 files changed, 71 deletions(-)
+ drivers/net/bnxt/bnxt_stats.c  | 67 ----------------------------------
+ 2 files changed, 69 deletions(-)
@@ -29 +30 @@
-index f1350d39da..e2b66c4712 100644
+index 1b1f130ed3..65527a0637 100644
@@ -32,2 +33,2 @@
-@@ -4344,8 +4344,6 @@ static const struct eth_dev_ops bnxt_dev_ops = {
- 	.tx_burst_mode_get = bnxt_tx_burst_mode_get,
+@@ -3811,8 +3811,6 @@ static const struct eth_dev_ops bnxt_dev_ops = {
+ 	.txq_info_get = bnxt_txq_info_get_op,
@@ -38,3 +39,3 @@
- 	.rx_queue_start = bnxt_rx_queue_start,
- 	.rx_queue_stop = bnxt_rx_queue_stop,
- 	.tx_queue_start = bnxt_tx_queue_start,
+ 	.rx_queue_count = bnxt_rx_queue_count_op,
+ 	.rx_descriptor_status = bnxt_rx_descriptor_status_op,
+ 	.tx_descriptor_status = bnxt_tx_descriptor_status_op,
@@ -42 +43 @@
-index cb7756d54f..3c9715f5fa 100644
+index be5b514f49..84011fc3ea 100644
@@ -45 +46,2 @@
-@@ -828,75 +828,6 @@ int bnxt_dev_xstats_reset_op(struct rte_eth_dev *eth_dev)
+@@ -617,70 +617,3 @@ int bnxt_dev_xstats_reset_op(struct rte_eth_dev *eth_dev)
+ 
@@ -48 +50 @@
- 
+-
@@ -52 +54 @@
--	struct bnxt *bp = dev->data->dev_private;
+-	/* Account for the Tx drop pkts aka the Anti spoof counter */
@@ -54,2 +56 @@
--				RTE_DIM(bnxt_tx_stats_strings) +
--				RTE_DIM(bnxt_func_stats_strings) +
+-				RTE_DIM(bnxt_tx_stats_strings) + 1 +
@@ -57,2 +58,2 @@
--				RTE_DIM(bnxt_tx_ext_stats_strings) +
--				bnxt_flow_stats_cnt(bp);
+-				RTE_DIM(bnxt_tx_ext_stats_strings);
+-	struct bnxt *bp = dev->data->dev_private;
@@ -86 +87 @@
--	struct bnxt *bp = dev->data->dev_private;
+-	/* Account for the Tx drop pkts aka the Anti spoof counter */
@@ -88,2 +89 @@
--				RTE_DIM(bnxt_tx_stats_strings) +
--				RTE_DIM(bnxt_func_stats_strings) +
+-				RTE_DIM(bnxt_tx_stats_strings) + 1 +
@@ -91,2 +91 @@
--				RTE_DIM(bnxt_tx_ext_stats_strings) +
--				bnxt_flow_stats_cnt(bp);
+-				RTE_DIM(bnxt_tx_ext_stats_strings);
@@ -93,0 +93 @@
+-	struct bnxt *bp = dev->data->dev_private;
@@ -117,4 +116,0 @@
--
- /* Update the input context memory with the flow counter IDs
-  * of the flows that we are interested in.
-  * Also, update the output tables with the current local values


More information about the stable mailing list