net/iavf: fix symmetric flow rule creation
authorXuan Ding <xuan.ding@intel.com>
Fri, 22 Jan 2021 03:19:22 +0000 (03:19 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 29 Jan 2021 17:16:08 +0000 (18:16 +0100)
Only allow to create symmetric rule for L3/L4.

Fixes: 91f27b2e39ab ("net/iavf: refactor RSS")
Cc: stable@dpdk.org
Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
drivers/net/iavf/iavf_hash.c

index f437fc3..d8d22f8 100644 (file)
@@ -927,6 +927,13 @@ iavf_any_invalid_rss_type(enum rte_eth_hash_function rss_func,
                if (rss_type & (ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY |
                    ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY))
                        return true;
+
+               if (!(rss_type &
+                  (ETH_RSS_IPV4 | ETH_RSS_IPV6 |
+                   ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_NONFRAG_IPV6_UDP |
+                   ETH_RSS_NONFRAG_IPV4_TCP | ETH_RSS_NONFRAG_IPV6_TCP |
+                   ETH_RSS_NONFRAG_IPV4_SCTP | ETH_RSS_NONFRAG_IPV6_SCTP)))
+                       return true;
        }
 
        /* check invalid combination */