Skip to contentSkip to conversation

net/cnxk: fix error message setting on failure

PATCH Applied [email protected] 2 participants 2 messages Apr 19, 2022 – May 3, 2022 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/cnxk: fix error message setting on failure

From: Satheesh Paul <[email protected]>

Set the error message with rte_flow_error_set() api when flow parsing fails.

Fixes 8c009b4505e ("net/cnxk: support flow API")
---
 drivers/net/cnxk/cnxk_flow.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/net/cnxk/cnxk_flow.c +8 -1
index 8763ca63d6..2b13352312 100644
@@ -297,7 +297,14 @@ cnxk_flow_validate(struct rte_eth_dev *eth_dev,
 		return rc;
 	}
 
-	return roc_npc_flow_parse(npc, &in_attr, in_pattern, in_actions, &flow);
+	rc = roc_npc_flow_parse(npc, &in_attr, in_pattern, in_actions, &flow);
+
+	if (rc) {
+		rte_flow_error_set(error, 0, rc, NULL,
+				   "Flow validation failed");
+		return rc;
+	}
+	return 0;
 }
 
 struct roc_npc_flow *
Signature · 1 line
2.25.4
Applied
#1 lore raw
Quoted 11 lines · On Tue, Apr 19, 2022 at 12:04 PM <[email protected]> wrote:

From: Satheesh Paul <[email protected]>

Set the error message with rte_flow_error_set() api when flow parsing fails.

Fixes 8c009b4505e ("net/cnxk: support flow API")

Applied to dpdk-next-net-mrvl/for-next-net. Thanks

Quoted 27 lines
---
 drivers/net/cnxk/cnxk_flow.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/net/cnxk/cnxk_flow.c +8 -2
index 8763ca63d6..2b13352312 100644
@@ -297,7 +297,14 @@ cnxk_flow_validate(struct rte_eth_dev *eth_dev,
                return rc;
        }
 
-       return roc_npc_flow_parse(npc, &in_attr, in_pattern, in_actions, &flow);
+       rc = roc_npc_flow_parse(npc, &in_attr, in_pattern, in_actions, &flow);
+
+       if (rc) {
+               rte_flow_error_set(error, 0, rc, NULL,
+                                  "Flow validation failed");
+               return rc;
+       }
+       return 0;
 }
 
 struct roc_npc_flow *
--

2.25.4