[v2] net/ice: fix invalid RSS type
diff mbox series

Message ID 1594281020-457174-1-git-send-email-simei.su@intel.com
State Changes Requested
Delegated to: Qi Zhang
Headers show
Series
  • [v2] net/ice: fix invalid RSS type
Related show

Checks

Context Check Description
ci/iol-intel-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/checkpatch success coding style OK

Commit Message

Simei Su July 9, 2020, 7:50 a.m. UTC
When a RSS rule with only RSS type modifier L2/L3/L4 SRC/DST_ONLY,
it should return failure. This patch adds invalid RSS type check.

Fixes: dfaedcf20170 ("net/ice: refactor PF hash flow")

Signed-off-by: Simei Su <simei.su@intel.com>
---

v2:
* Add specific macro value in check rather than hard code.
---
 drivers/net/ice/ice_hash.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Patch
diff mbox series

diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c
index cbd6116..2c79458 100644
--- a/drivers/net/ice/ice_hash.c
+++ b/drivers/net/ice/ice_hash.c
@@ -722,6 +722,17 @@  struct ice_hash_match_type ice_hash_type_list[] = {
 			 */
 			rss_type = rte_eth_rss_hf_refine(rss_type);
 
+			/* Check if only L2/L3/L4 SRC/DST_ONLY exists. */
+			if ((rss_type & ~(ETH_RSS_L2_SRC_ONLY |
+					  ETH_RSS_L2_DST_ONLY |
+					  ETH_RSS_L3_SRC_ONLY |
+					  ETH_RSS_L3_DST_ONLY |
+					  ETH_RSS_L4_SRC_ONLY |
+					  ETH_RSS_L4_DST_ONLY)) == 0)
+				return rte_flow_error_set(error, ENOTSUP,
+					RTE_FLOW_ERROR_TYPE_ACTION, action,
+					"rss type with only L2/L3/L4 src/dst only is invalid");
+
 			combine_type = ETH_RSS_L2_SRC_ONLY |
 					ETH_RSS_L2_DST_ONLY |
 					ETH_RSS_L3_SRC_ONLY |