patch 'net/mlx5: fix jump ipool entry size' has been queued to stable release 22.11.4

Xueming Li xuemingl at nvidia.com
Sun Oct 22 16:22:10 CEST 2023


Hi,

FYI, your patch has been queued to stable release 22.11.4

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/15/23. 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=22.11-staging

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

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 1c9bab50cca4023aad3f12dfab27a39b5f72fdba Mon Sep 17 00:00:00 2001
From: Dariusz Sosnowski <dsosnowski at nvidia.com>
Date: Fri, 25 Aug 2023 21:43:30 +0300
Subject: [PATCH] net/mlx5: fix jump ipool entry size
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 015a3e811148e9135fba20e5b679989520ab56f6 ]

In mlx5 PMD, MLX5_IPOOL_JUMP ipool configuration is used to initialize
the ipool containing either:

- flow table entry when DV flow engine is chosen or,
- group table entry when HW steering flow engine is chosen.

Default configuration for MLX5_IPOOL_JUMP ipool specified entry size as
size of mlx5_flow_tbl_data_entry struct, used with DV flow engine.
This could lead to memory corruption when mlx5_flow_group struct
(used with HW steering flow engine) would have bigger size than
mlx5_flow_tbl_data_entry.

This patch fixes that. Entry size for MLX5_IPOOL_JUMP ipool is chosen
dynamically based on device configuration.

Fixes: d1559d66ed2d ("net/mlx5: add table management")

Signed-off-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
Acked-by: Suanming Mou <suanmingm at nvidia.com>
---
 drivers/net/mlx5/mlx5.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 8250c94803..f787ae91fe 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -241,7 +241,12 @@ static const struct mlx5_indexed_pool_config mlx5_ipool_cfg[] = {
 		.type = "mlx5_port_id_ipool",
 	},
 	[MLX5_IPOOL_JUMP] = {
-		.size = sizeof(struct mlx5_flow_tbl_data_entry),
+		/*
+		 * MLX5_IPOOL_JUMP ipool entry size depends on selected flow engine.
+		 * When HW steering is enabled mlx5_flow_group struct is used.
+		 * Otherwise mlx5_flow_tbl_data_entry struct is used.
+		 */
+		.size = 0,
 		.trunk_size = 64,
 		.grow_trunk = 3,
 		.grow_shift = 2,
@@ -902,6 +907,14 @@ mlx5_flow_ipool_create(struct mlx5_dev_ctx_shared *sh)
 				sizeof(struct mlx5_flow_handle) :
 				MLX5_FLOW_HANDLE_VERBS_SIZE;
 			break;
+#if defined(HAVE_IBV_FLOW_DV_SUPPORT) || !defined(HAVE_INFINIBAND_VERBS_H)
+		/* Set MLX5_IPOOL_JUMP ipool entry size depending on selected flow engine. */
+		case MLX5_IPOOL_JUMP:
+			cfg.size = sh->config.dv_flow_en == 2 ?
+				sizeof(struct mlx5_flow_group) :
+				sizeof(struct mlx5_flow_tbl_data_entry);
+			break;
+#endif
 		}
 		if (sh->config.reclaim_mode) {
 			cfg.release_mem_en = 1;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-10-22 22:17:38.064060900 +0800
+++ 0101-net-mlx5-fix-jump-ipool-entry-size.patch	2023-10-22 22:17:34.376723700 +0800
@@ -1 +1 @@
-From 015a3e811148e9135fba20e5b679989520ab56f6 Mon Sep 17 00:00:00 2001
+From 1c9bab50cca4023aad3f12dfab27a39b5f72fdba Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 015a3e811148e9135fba20e5b679989520ab56f6 ]
@@ -22 +24,0 @@
-Cc: stable at dpdk.org
@@ -31 +33 @@
-index 6d05de114e..997df595d0 100644
+index 8250c94803..f787ae91fe 100644
@@ -48 +50 @@
-@@ -904,6 +909,14 @@ mlx5_flow_ipool_create(struct mlx5_dev_ctx_shared *sh)
+@@ -902,6 +907,14 @@ mlx5_flow_ipool_create(struct mlx5_dev_ctx_shared *sh)


More information about the stable mailing list