patch 'net/mlx5: fix stats query crash in secondary process' has been queued to stable release 23.11.1

Xueming Li xuemingl at nvidia.com
Tue Mar 5 10:47:54 CET 2024


Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. 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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=1f3f99626970b526a0fb9b8dcb1281925d533e90

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 1f3f99626970b526a0fb9b8dcb1281925d533e90 Mon Sep 17 00:00:00 2001
From: Rongwei Liu <rongweil at nvidia.com>
Date: Mon, 22 Jan 2024 09:44:05 +0200
Subject: [PATCH] net/mlx5: fix stats query crash in secondary process
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit d312cab568ecdc8411cb3dc896e7d5020836399b ]

The "outer_of_buffer" counter is owned by the primary process devx
object and it is pointer by pointer in mlx5_priv structure. Actually,
there are 4 levels' pointers in this piece of code.

The secondary process can't access this part directly since it belongs
to another process's heap.

Return ENOTSUP as a workaround.

Fixes: 750e48c7d8c3 ("common/mlx5: add DevX commands for queue counters")

Signed-off-by: Rongwei Liu <rongweil at nvidia.com>
Acked-by: Matan Azrad <matan at nvidia.com>
---
 drivers/net/mlx5/linux/mlx5_os.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index ae82e1e5d8..fd104dabb2 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -2993,9 +2993,15 @@ mlx5_os_read_dev_stat(struct mlx5_priv *priv, const char *ctr_name,

 	if (priv->sh) {
 		if (priv->q_counters != NULL &&
-		    strcmp(ctr_name, "out_of_buffer") == 0)
+		    strcmp(ctr_name, "out_of_buffer") == 0) {
+			if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
+				DRV_LOG(WARNING, "Devx out_of_buffer counter is not supported in the secondary process");
+				rte_errno = ENOTSUP;
+				return 1;
+			}
 			return mlx5_devx_cmd_queue_counter_query
 					(priv->q_counters, 0, (uint32_t *)stat);
+		}
 		MKSTR(path, "%s/ports/%d/hw_counters/%s",
 		      priv->sh->ibdev_path,
 		      priv->dev_port,
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.978176933 +0800
+++ 0133-net-mlx5-fix-stats-query-crash-in-secondary-process.patch	2024-03-05 17:39:31.093566504 +0800
@@ -1 +1 @@
-From d312cab568ecdc8411cb3dc896e7d5020836399b Mon Sep 17 00:00:00 2001
+From 1f3f99626970b526a0fb9b8dcb1281925d533e90 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit d312cab568ecdc8411cb3dc896e7d5020836399b ]
@@ -16 +18,0 @@
-Cc: stable at dpdk.org
@@ -25 +27 @@
-index cc8e1919e8..f10e623953 100644
+index ae82e1e5d8..fd104dabb2 100644
@@ -28 +30 @@
-@@ -2998,9 +2998,15 @@ mlx5_os_read_dev_stat(struct mlx5_priv *priv, const char *ctr_name,
+@@ -2993,9 +2993,15 @@ mlx5_os_read_dev_stat(struct mlx5_priv *priv, const char *ctr_name,


More information about the stable mailing list