Skip to contentSkip to conversation

net/mlx5: fix the error set for age pool initialization

PATCH Superseded Bing Zhao 2 participants 3 messages Jun 30, 2023 – Jul 3, 2023 Network drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Bing Zhao

author
#0 lore raw

PATCH 6/7 net/mlx5: fix the error set for age pool initialization

The rte_flow_error needs to be set when the age pool initialization has a failure. Or else the application will crash due to the access of the invalid "message" field.

Fixes 04a4de756e14 ("net/mlx5: support flow age action with HWS")
---
 drivers/net/mlx5/mlx5_flow_hw.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/mlx5/mlx5_flow_hw.c +4 -1
index 4163fe23e6..20941b4fc7 100644
@@ -7913,8 +7913,11 @@ flow_hw_configure(struct rte_eth_dev *dev,
 			goto err;
 		}
 		ret = mlx5_hws_age_pool_init(dev, port_attr, nb_queue);
-		if (ret < 0)
+		if (ret < 0) {
+			rte_flow_error_set(error, -ret, RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
+					   NULL, "Failed to init age pool.");
 			goto err;
+		}
 	}
 	ret = flow_hw_create_vlan(dev);
 	if (ret)
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH v2 1/1 net/mlx5: fix the error set for age pool initialization

The rte_flow_error needs to be set when the age pool initialization has a failure. Or else the application will crash due to the access of the invalid "message" field.

Fixes 04a4de756e14 ("net/mlx5: support flow age action with HWS")

---
v2: add CC stable

---
 drivers/net/mlx5/mlx5_flow_hw.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/mlx5/mlx5_flow_hw.c +4 -1
index 4163fe23e6..20941b4fc7 100644
@@ -7913,8 +7913,11 @@ flow_hw_configure(struct rte_eth_dev *dev,
 			goto err;
 		}
 		ret = mlx5_hws_age_pool_init(dev, port_attr, nb_queue);
-		if (ret < 0)
+		if (ret < 0) {
+			rte_flow_error_set(error, -ret, RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
+					   NULL, "Failed to init age pool.");
 			goto err;
+		}
 	}
 	ret = flow_hw_create_vlan(dev);
 	if (ret)
Signature · 1 line
2.34.1
#2 lore raw

Hi,

Quoted 14 lines

-----Original Message-----
From: Bing Zhao <[email protected]>
Sent: Friday, June 30, 2023 1:27 PM
To: Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>; Raslan Darawsheh <[email protected]>
Cc: [email protected]; Michael Baum <[email protected]>; [email protected]
Subject: [PATCH v2] net/mlx5: fix the error set for age pool initialization

The rte_flow_error needs to be set when the age pool initialization has a failure. Or else the application will crash due to the access of the invalid "message" field.

Quoted 6 lines
Fixes 04a4de756e14 ("net/mlx5: support flow age action with HWS")

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh