From c8647cd7f3260eec8d55ee392240dcc10f7c0a4b Mon Sep 17 00:00:00 2001 From: Satheesh Paul Date: Tue, 19 Apr 2022 12:04:38 +0530 Subject: [PATCH] net/cnxk: add message on flow parsing failure Set the error message with rte_flow_error_set() API when flow parsing fails. Fixes: 8c009b4505e ("net/cnxk: support flow API") Cc: stable@dpdk.org Signed-off-by: Satheesh Paul Reviewed-by: Kiran Kumar K --- drivers/net/cnxk/cnxk_flow.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/cnxk/cnxk_flow.c b/drivers/net/cnxk/cnxk_flow.c index ff962c141d..1034a2c5a4 100644 --- a/drivers/net/cnxk/cnxk_flow.c +++ b/drivers/net/cnxk/cnxk_flow.c @@ -299,7 +299,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.20.1