DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: fix the flow list breakage
@ 2026-11-23  7:30 Bing Zhao
  0 siblings, 0 replies; only message in thread
From: Bing Zhao @ 2026-11-23  7:30 UTC (permalink / raw)
  To: rasland, dsosnowski, viacheslavo, orika, suanmingm, matan; +Cc: dev, stable

When using synchronous API in HWS mode, the implicit flow splitting
will also be done as that in the SWS mode.

Now the RSS expansion and metadata copy are done in order. The RSS
expansion will create a jump flow to the RSS table and all L3 / L4
RSS flows will be created then. The metadata copy will create a jump
flow to copy the metadata and set the prefix flow ID and then the RSS
part.

Due to the incorrect usage of SLIST_INSERT_AFTER macro, the sle_next
was wrongly cleared to zero since the prefix flow of metadata copy
didn't have the next flow. The RSS flows were missed in the flow
list and would not be destroyed when deleting the flow list. The
Rx queues that were referenced by the RSS flows will not be released
and some resource leak occurred.

By directly assigning the prefix flow's next pointer the list will
not be broken and all the flow rules can be destroyed.

Fixes: 821a6a5cc495 ("net/mlx5: add metadata split for compatibility")
Cc: stable@dpdk.org

Suggested-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 6e6bf07799..f4720e0858 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -14594,7 +14594,12 @@ static uintptr_t flow_hw_list_create(struct rte_eth_dev *dev,
 	if (prfx_flow) {
 		prfx_flow->nt2hws->rix_mreg_copy = flow->nt2hws->rix_mreg_copy;
 		flow->nt2hws->chaned_flow = 1;
-		SLIST_INSERT_AFTER(prfx_flow, flow, nt2hws->next);
+		/*
+		 * Prefix flow is a single, newly created flow. Preserve any RSS
+		 * expansion flows already linked after the suffix.
+		 */
+		MLX5_ASSERT(SLIST_NEXT(prfx_flow, nt2hws->next) == NULL);
+		SLIST_NEXT(prfx_flow, nt2hws->next) = flow;
 		mlx5_flow_nta_split_resource_free(dev, &resource);
 		mlx5_free(copied_items);
 		return (uintptr_t)prfx_flow;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-23  7:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23  7:30 [PATCH] net/mlx5: fix the flow list breakage Bing Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox