From: Bing Zhao <bingz@nvidia.com>
To: <rasland@nvidia.com>, <dsosnowski@nvidia.com>,
<viacheslavo@nvidia.com>, <orika@nvidia.com>,
<suanmingm@nvidia.com>, <matan@nvidia.com>
Cc: <dev@dpdk.org>, <stable@dpdk.org>
Subject: [PATCH] net/mlx5: fix the flow list breakage
Date: Mon, 23 Nov 2026 07:30:07 +0000 [thread overview]
Message-ID: <20261123073007.450065-1-bingz@nvidia.com> (raw)
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
reply other threads:[~2026-11-23 7:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261123073007.450065-1-bingz@nvidia.com \
--to=bingz@nvidia.com \
--cc=dev@dpdk.org \
--cc=dsosnowski@nvidia.com \
--cc=matan@nvidia.com \
--cc=orika@nvidia.com \
--cc=rasland@nvidia.com \
--cc=stable@dpdk.org \
--cc=suanmingm@nvidia.com \
--cc=viacheslavo@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox