From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D159AA0528; Sat, 11 Jul 2020 16:02:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 64D181D99A; Sat, 11 Jul 2020 16:02:51 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id F02CF1D95A for ; Sat, 11 Jul 2020 16:02:49 +0200 (CEST) IronPort-SDR: 9qMuYH3Z5AKBpazWTA6rcEnbZsKt9YUFrdeapW2uMY5hhufTZk343ONZ1F19kc+93agCVjyHFn BFTUDspFKzug== X-IronPort-AV: E=McAfee;i="6000,8403,9679"; a="233257012" X-IronPort-AV: E=Sophos;i="5.75,339,1589266800"; d="scan'208";a="233257012" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jul 2020 07:02:42 -0700 IronPort-SDR: yEoadTi4fgHCUC3RzV4r2MIIEEK5Du5siKwZf1fF5zFSG7x5kOxv4kJnJ93dYvjVN0PWJ2/fAw Bpmg5GzQy5NA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,339,1589266800"; d="scan'208";a="284815732" Received: from npg-dpdk-cvl-simeisu-118d193.sh.intel.com ([10.67.110.178]) by orsmga006.jf.intel.com with ESMTP; 11 Jul 2020 07:02:41 -0700 From: Simei Su To: qi.z.zhang@intel.com Cc: dev@dpdk.org, junfeng.guo@intel.com, ting.xu@intel.com, jia.guo@intel.com, Simei Su Date: Sat, 11 Jul 2020 22:01:04 +0800 Message-Id: <1594476064-366701-1-git-send-email-simei.su@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1594281020-457174-1-git-send-email-simei.su@intel.com> References: <1594281020-457174-1-git-send-email-simei.su@intel.com> Subject: [dpdk-dev] [PATCH v3] net/ice: fix invalid RSS type X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When a RSS rule with only SRC/DST_ONLY or IPV6 prefix RSS type, it should return failure. Besides, when a RSS rule with symmetric hash function, the RSS type shouldn't carry with SRC/DST_ONLY or IPV6 prefix. This patch adds invalid RSS type check for the two cases. Fixes: dfdc589f6ee0 ("net/ice: refactor PF hash flow") Signed-off-by: Simei Su --- v3: * Add invalid RSS type check for symmetric case. * Consider IPV6 prefix. * Refine commit log. v2: * Add specific macro value in check rather than hard code. --- drivers/net/ice/ice_hash.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c index e57feff..01311b4 100644 --- a/drivers/net/ice/ice_hash.c +++ b/drivers/net/ice/ice_hash.c @@ -1049,13 +1049,36 @@ struct ice_hash_match_type ice_hash_type_list[] = { combine_type = ETH_RSS_L2_SRC_ONLY | ETH_RSS_L2_DST_ONLY | RTE_ETH_RSS_L3_PRE32 | + RTE_ETH_RSS_L3_PRE40 | RTE_ETH_RSS_L3_PRE48 | + RTE_ETH_RSS_L3_PRE56 | RTE_ETH_RSS_L3_PRE64 | + RTE_ETH_RSS_L3_PRE96 | ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY; + /* Check if only SRC/DST_ONLY or ipv6 prefix exists. */ + if ((rss_type & ~combine_type) == 0) + return rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ACTION, action, + "invalid rss types"); + + /** + * Check if SRC/DST_ONLY or ipv6 prefix 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, + "invalid rss types"); + } + /* Check if rss types match pattern. */ if (rss_type & ~combine_type & ~m->eth_rss_hint) { return rte_flow_error_set(error, -- 1.8.3.1