net/ice: fix flow engines order

Message ID 20250301205327.569853-1-vladimir.medvedkin@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Bruce Richardson
Headers
Series net/ice: fix flow engines order |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS

Commit Message

Medvedkin, Vladimir March 1, 2025, 8:53 p.m. UTC
Reorder flow engine evaluation for RTE flow rule installation.
Currently, the driver evaluates rules with engines in the order they are
executed in the hardware. However, in this situation, some wildcarded flows
that are also supported by the ACL engine are installed as switch engine
rules, which scales poorly with each distinct wildcard mask configuration.

Fixes: fabc9e1322e2 ("net/ice: fix flows handling")
Cc: stable@dpdk.org

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
---
 drivers/net/intel/ice/ice_generic_flow.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
  

Patch

diff --git a/drivers/net/intel/ice/ice_generic_flow.c b/drivers/net/intel/ice/ice_generic_flow.c
index 5c34e0385f..f7a44223ac 100644
--- a/drivers/net/intel/ice/ice_generic_flow.c
+++ b/drivers/net/intel/ice/ice_generic_flow.c
@@ -2239,11 +2239,11 @@  static struct ice_flow_parser *get_flow_parser(uint32_t group)
 {
 	switch (group) {
 	case 0:
-		return &ice_switch_parser;
+		return &ice_fdir_parser;
 	case 1:
 		return &ice_acl_parser;
 	case 2:
-		return &ice_fdir_parser;
+		return &ice_switch_parser;
 	default:
 		return NULL;
 	}
@@ -2298,6 +2298,13 @@  ice_flow_process_filter(struct rte_eth_dev *dev,
 	}
 
 	for (int i = 0; i < ICE_FLOW_ENGINE_NB; i++) {
+		/**
+		 * Evaluate parsers in the following order:
+		 * FDIR - for exact match rules
+		 * ACL - for some subset of wildcard matching rules
+		 * Switch - for the rest. This engine is placed after ACL
+		 * because it scales worse than ACL for different wildcard masks.
+		 **/
 		parser = get_flow_parser(i);
 		if (parser == NULL) {
 			rte_flow_error_set(error, EINVAL,