[PATCH 23.11 2/2] net/nfp: forbid offload flow rules with empty action list

Chaoyong He chaoyong.he at corigine.com
Wed Aug 14 04:50:38 CEST 2024


[ upstream commit 78bbab16282a2b6b8b3983677b7b1a32543b909b ]

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")

Signed-off-by: Chaoyong He <chaoyong.he at corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 9ad434affb..91ebee5db4 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -3741,6 +3741,11 @@ nfp_flow_compile_action(struct nfp_flower_representor *representor,
 		total_actions++;
 	}
 
+	if (nfp_flow->install_flag && total_actions == 0) {
+		PMD_DRV_LOG(ERR, "The action list is empty");
+		return -ENOTSUP;
+	}
+
 	if (drop_flag)
 		nfp_flow_meta->shortcut = rte_cpu_to_be_32(NFP_FL_SC_ACT_DROP);
 	else if (total_actions > 1)
-- 
2.39.1



More information about the stable mailing list