Skip to contentSkip to conversation

net/mlx5: improve error on completing table resize

PATCH In review Dariusz Sosnowski 3 participants 3 messages Nov 14, 2025 – Nov 18, 2025 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5: improve error on completing table resize

If flow template table was created with resizable attribute, then completing table resize could fail for 2 user-related reasons:

- not all flow rules were yet updated to use the resized table,
- resize was not started.

Both of these were reported with the same error message i.e., "cannot complete table resize".

Since PMD can distinguish these 2 cases, this patch improves the error reporting to report these 2 errors separately.

Also, this patch removes redundant __rte_unused on device parameter.

---
 drivers/net/mlx5/mlx5_flow_hw.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/net/mlx5/mlx5_flow_hw.c +7 -3
index 208f50fbfd..8f3c84dec5 100644
@@ -15384,7 +15384,7 @@ flow_hw_table_resize(struct rte_eth_dev *dev,
 }
 
 static int
-flow_hw_table_resize_complete(__rte_unused struct rte_eth_dev *dev,
+flow_hw_table_resize_complete(struct rte_eth_dev *dev,
 			      struct rte_flow_template_table *table,
 			      struct rte_flow_error *error)
 {
@@ -15398,12 +15398,16 @@ flow_hw_table_resize_complete(__rte_unused struct rte_eth_dev *dev,
 		return rte_flow_error_set(error, EINVAL,
 					  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
 					  table, "no resizable attribute");
+	if (matcher_info->matcher == NULL)
+		return rte_flow_error_set(error, EINVAL,
+					  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
+					  table, "table resize was not started");
 	matcher_refcnt = rte_atomic_load_explicit(&matcher_info->refcnt,
 						  rte_memory_order_relaxed);
-	if (!matcher_info->matcher || matcher_refcnt)
+	if (matcher_refcnt > 0)
 		return rte_flow_error_set(error, EBUSY,
 					  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
-					  table, "cannot complete table resize");
+					  table, "all rules not yet updated");
 	if (matcher_info->jump)
 		mlx5dr_action_destroy(matcher_info->jump);
 	ret = mlx5dr_matcher_destroy(matcher_info->matcher);

--
2.39.5

Acked-by on v1 1/1
#1 lore raw

Hi,

Quoted 60 lines

-----Original Message-----
From: Dariusz Sosnowski <[email protected]>
Sent: Saturday, November 15, 2025 3:27 AM
To: Slava Ovsiienko <[email protected]>; Bing Zhao <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>; Matan Azrad <[email protected]>
Cc: [email protected]; Gregory Etelson <[email protected]>
Subject: [PATCH] net/mlx5: improve error on completing table resize

If flow template table was created with resizable attribute, then completing table resize could fail for 2 user-related reasons:

- not all flow rules were yet updated to use the resized table,
- resize was not started.

Both of these were reported with the same error message i.e., "cannot complete table resize".

Since PMD can distinguish these 2 cases, this patch improves the error reporting to report these 2 errors separately.

Also, this patch removes redundant __rte_unused on device parameter.

---
 drivers/net/mlx5/mlx5_flow_hw.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
(quoted diff) +0 -0

b/drivers/net/mlx5/mlx5_flow_hw.c index 208f50fbfd..8f3c84dec5 100644

drivers/net/mlx5/mlx5_flow_hw.c +7 -3
@@ -15384,7 +15384,7 @@ flow_hw_table_resize(struct rte_eth_dev *dev,  }
 
 static int
-flow_hw_table_resize_complete(__rte_unused struct rte_eth_dev *dev,
+flow_hw_table_resize_complete(struct rte_eth_dev *dev,
 			      struct rte_flow_template_table *table,
 			      struct rte_flow_error *error)
 {
@@ -15398,12 +15398,16 @@ flow_hw_table_resize_complete(__rte_unused
 struct rte_eth_dev *dev,
 		return rte_flow_error_set(error, EINVAL,
 					  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
 					  table, "no resizable attribute");
+	if (matcher_info->matcher == NULL)
+		return rte_flow_error_set(error, EINVAL,
+					  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
+					  table, "table resize was not started");
 	matcher_refcnt = rte_atomic_load_explicit(&matcher_info->refcnt,
 						  rte_memory_order_relaxed);
-	if (!matcher_info->matcher || matcher_refcnt)
+	if (matcher_refcnt > 0)
 		return rte_flow_error_set(error, EBUSY,
 					  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
-					  table, "cannot complete table resize");
+					  table, "all rules not yet updated");
 	if (matcher_info->jump)
 		mlx5dr_action_destroy(matcher_info->jump);
Quoted 3 lines

ret = mlx5dr_matcher_destroy(matcher_info->matcher);
--
2.39.5

#2 lore raw
In reply to Dariusz Sosnowski

Hi,

Quoted 9 lines · Dariusz Sosnowski

If flow template table was created with resizable attribute, then completing table resize could fail for 2 user-related reasons:

- not all flow rules were yet updated to use the resized table,
- resize was not started.

Both of these were reported with the same error message i.e., "cannot complete table resize".

Quoted 7 lines

Since PMD can distinguish these 2 cases, this patch improves the error reporting to report these 2 errors separately.

Also, this patch removes redundant __rte_unused on device parameter.

Patch applied to next-net-mlx,

Kindest regards
Raslan Darawsheh