net/mlx5: fix the flow list breakage
PATCH 1/1 net/mlx5: fix the flow list breakage
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.
--- drivers/net/mlx5/mlx5_flow_hw.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/mlx5/mlx5_flow_hw.c +6 -1
@@ -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;
Signature · 1 line
2.34.1