[PATCH 05/17] net/nfp: forbid offload flow rules with empty action list
Chaoyong He
chaoyong.he at corigine.com
Mon Jun 24 03:57:11 CEST 2024
The original logic allow offload flow rules with empty action list, but
the matched packets will be drop by the flower firmware.
Fix this by forbidding offload this type flow rules.
Fixes: 4d946034bf9c ("net/nfp: support basic flow actions")
Cc: stable at dpdk.org
Signed-off-by: Chaoyong He <chaoyong.he at corigine.com>
Reviewed-by: Long Wu <long.wu at corigine.com>
Reviewed-by: Peng Zhang <peng.zhang at corigine.com>
---
drivers/net/nfp/flower/nfp_flower_flow.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/nfp/flower/nfp_flower_flow.c b/drivers/net/nfp/flower/nfp_flower_flow.c
index 9f410515e6..d127171fdb 100644
--- a/drivers/net/nfp/flower/nfp_flower_flow.c
+++ b/drivers/net/nfp/flower/nfp_flower_flow.c
@@ -4757,6 +4757,11 @@ nfp_flow_compile_action(struct nfp_flower_representor *representor,
total_actions++;
}
+ if (total_actions == 0 || param.position == param.action_data) {
+ PMD_DRV_LOG(ERR, "The action list is empty");
+ return -ENOTSUP;
+ }
+
nfp_flow_meta = nfp_flow->payload.meta;
if (flag.drop_flag)
nfp_flow_meta->shortcut = rte_cpu_to_be_32(NFP_FL_SC_ACT_DROP);
--
2.39.1
More information about the dev
mailing list