After the recent refactor, global RSS configuration started rejecting the
RSS types parameter because it was not used for anything.

However, because testpmd will specify RSS types by default if omitted from
the flow command (i.e. `actions rss queues 0 1 end` vs `actions rss queues
0 1 end types end`), RSS action based flows that are created without
mentioning RSS types will still have RSS types as non-zero, causing flow
creation failures not directly related to the pattern.

Fix it by printing a warning but allowing spurious RSS types as opposed to
rejecting it outright.

Fixes: 0185303c2e24 ("net/i40e: refactor RSS flow parameter checks")

Signed-off-by: Anatoly Burakov <[email protected]>
---
 drivers/net/intel/i40e/i40e_hash.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/net/intel/i40e/i40e_hash.c 
b/drivers/net/intel/i40e/i40e_hash.c
index 8b80d0a91c..5a6543a9ec 100644
--- a/drivers/net/intel/i40e/i40e_hash.c
+++ b/drivers/net/intel/i40e/i40e_hash.c
@@ -1089,12 +1089,18 @@ i40e_hash_validate_rss_common(const struct 
rte_flow_action_rss *rss_act,
                                "Symmetric hash function not supported without 
specific patterns");
        }
 
-       /* hash types are not supported for global RSS configuration */
-       if (rss_act->types != 0) {
-               return rte_flow_error_set(error, EINVAL,
-                               RTE_FLOW_ERROR_TYPE_ACTION_CONF, rss_act,
-                               "RSS types not supported without a pattern");
-       }
+       /*
+        * When RSS types is not specified in testpmd, it will set up a default
+        * RSS types value for the flow. Even though no hash engine part calling
+        * this particular function will use RSS types parameter for anything,
+        * we cannot reject having it because it is extra effort for testpmd
+        * user to avoid specifying it.
+        *
+        * So, instead, accept types value even though we are not using it for
+        * anything, but produce a warning for the user.
+        */
+       if (rss_act->types != 0)
+               PMD_DRV_LOG(WARNING, "RSS types specified but will not be 
used");
 
        /* check RSS key length if it is specified */
        if (rss_act->key_len != 0 && rss_act->key_len != I40E_RSS_KEY_LEN) {
-- 
2.47.3

Reply via email to