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: [email protected]
Signed-off-by: Chaoyong He <[email protected]>
Reviewed-by: Long Wu <[email protected]>
Reviewed-by: Peng Zhang <[email protected]>
---
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