net/ice: fix RSS types check
authorSimei Su <simei.su@intel.com>
Wed, 30 Oct 2019 02:49:30 +0000 (10:49 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 8 Nov 2019 22:15:04 +0000 (23:15 +0100)
This patch corrects logic error for checking rss->types to match
pattern in RSS action parser.

Fixes: 5ad3db8d4bdd ("net/ice: enable advanced RSS")

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
drivers/net/ice/ice_hash.c

index f710b97..346d6cf 100644 (file)
@@ -315,13 +315,13 @@ ice_hash_parse_action(struct ice_pattern_match_item *pattern_match_item,
 
                        /* Check if rss types match pattern. */
                        if (rss->func != RTE_ETH_HASH_FUNCTION_SIMPLE_XOR) {
-                               if (((rss_hf & ETH_RSS_IPV4) != m->eth_rss_hint) ||
-                               ((rss_hf & ETH_RSS_NONFRAG_IPV4_UDP) != m->eth_rss_hint) ||
-                               ((rss_hf & ETH_RSS_NONFRAG_IPV4_TCP) != m->eth_rss_hint) ||
-                               ((rss_hf & ETH_RSS_NONFRAG_IPV4_SCTP) != m->eth_rss_hint) ||
-                               ((rss_hf & ETH_RSS_IPV6) != m->eth_rss_hint) ||
-                               ((rss_hf & ETH_RSS_NONFRAG_IPV6_UDP) != m->eth_rss_hint) ||
-                               ((rss_hf & ETH_RSS_NONFRAG_IPV6_TCP) != m->eth_rss_hint) ||
+                               if (((rss_hf & ETH_RSS_IPV4) != m->eth_rss_hint) &&
+                               ((rss_hf & ETH_RSS_NONFRAG_IPV4_UDP) != m->eth_rss_hint) &&
+                               ((rss_hf & ETH_RSS_NONFRAG_IPV4_TCP) != m->eth_rss_hint) &&
+                               ((rss_hf & ETH_RSS_NONFRAG_IPV4_SCTP) != m->eth_rss_hint) &&
+                               ((rss_hf & ETH_RSS_IPV6) != m->eth_rss_hint) &&
+                               ((rss_hf & ETH_RSS_NONFRAG_IPV6_UDP) != m->eth_rss_hint) &&
+                               ((rss_hf & ETH_RSS_NONFRAG_IPV6_TCP) != m->eth_rss_hint) &&
                                ((rss_hf & ETH_RSS_NONFRAG_IPV6_SCTP) != m->eth_rss_hint))
                                        return rte_flow_error_set(error,
                                        ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION,