Skip to contentSkip to conversation

net/ice: fix invalid symmetric RSS rule created

PATCH New Ting Xu 1 participant 1 message Jul 8, 2020 Network drivers

lore
Share & tools
lore

Ting Xu

author
#0 lore raw

PATCH 1/1 net/ice: fix invalid symmetric RSS rule created

The flow rule with symmetric toeplitz hash function and SRC_ONLY or DST_ONLY RSS type together should not be created successfully. Fix the RSS action parse function to stop the rule creation in this situation.

Fixes 5ad3db8d4bdd ("net/ice: enable advanced RSS")
---
 drivers/net/ice/ice_hash.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
drivers/net/ice/ice_hash.c +13 -0
index 3433cab28c..3c84a6a73f 100644
@@ -1044,6 +1044,19 @@ ice_hash_parse_action(struct ice_pattern_match_item *pattern_match_item,
 					ETH_RSS_L4_SRC_ONLY |
 					ETH_RSS_L4_DST_ONLY;
 
+			/**
+			 * Check if SRC_ONLY or DST_ONLY is set for
+			 * SYMMETRIC_TOEPLITZ hash function.
+			 */
+			if (rss->func ==
+				RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ) {
+				if (rss_type & combine_type)
+					return rte_flow_error_set(error,
+					ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION,
+					action, "Not supported RSS types for "
+					"symmetric toeplitz hash");
+			}
+
 			/* Check if rss types match pattern. */
 			if (rss_type & ~combine_type & ~m->eth_rss_hint) {
 				return rte_flow_error_set(error,
Signature · 1 line
2.17.1