Skip to contentSkip to conversation

net/mlx5: fix the return value of vport action

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 4/7 net/mlx5: fix the return value of vport action

The "rte_flow_error" should be set in case a invalid pointer access to the message member.

Fixes 1939eb6f660c ("net/mlx5: support flow port action with HWS")
---
 drivers/net/mlx5/mlx5_flow_hw.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/mlx5/mlx5_flow_hw.c +2 -1
index 6683bcbc7f..87584c1e94 100644
@@ -7830,7 +7830,8 @@ flow_hw_configure(struct rte_eth_dev *dev,
 	if (is_proxy) {
 		ret = flow_hw_create_vport_actions(priv);
 		if (ret) {
-			rte_errno = -ret;
+			rte_flow_error_set(error, -ret, RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
+					   NULL, "Failed to create vport actions.");
 			goto err;
 		}
 		ret = flow_hw_create_ctrl_tables(dev);
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH v2 1/1 net/mlx5: fix the return value of vport action

The "rte_flow_error" should be set in case a invalid pointer access to the message member.

Fixes 1939eb6f660c ("net/mlx5: support flow port action with HWS")

---
v2: add CC stable

---
 drivers/net/mlx5/mlx5_flow_hw.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/mlx5/mlx5_flow_hw.c +2 -1
index 6683bcbc7f..87584c1e94 100644
@@ -7830,7 +7830,8 @@ flow_hw_configure(struct rte_eth_dev *dev,
 	if (is_proxy) {
 		ret = flow_hw_create_vport_actions(priv);
 		if (ret) {
-			rte_errno = -ret;
+			rte_flow_error_set(error, -ret, RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
+					   NULL, "Failed to create vport actions.");
 			goto err;
 		}
 		ret = flow_hw_create_ctrl_tables(dev);
Signature · 1 line
2.34.1
#2 lore raw

Hi,

Quoted 13 lines

-----Original Message-----
From: Bing Zhao <[email protected]>
Sent: Friday, June 30, 2023 12:22 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]; Dariusz Sosnowski <[email protected]>; [email protected]
Subject: [PATCH v2] net/mlx5: fix the return value of vport action

The "rte_flow_error" should be set in case a invalid pointer access to the message member.

Quoted 8 lines
Fixes 1939eb6f660c ("net/mlx5: support flow port action with HWS")

---
v2: add CC stable

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh