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 6C5A6A0540; Mon, 20 Jul 2020 11:16:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3CD7E2AA6; Mon, 20 Jul 2020 11:16:28 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id EF5C91DBB for ; Mon, 20 Jul 2020 11:16:26 +0200 (CEST) IronPort-SDR: tp8D6VaBBpWOaBgnYqMmPE+dNTCzMDjS/y8u8NgBuX2aiKfPvJjQ78LYsdULTxIMKuWT0p9DCZ 7r4Ysi8GRmxA== X-IronPort-AV: E=McAfee;i="6000,8403,9687"; a="149033301" X-IronPort-AV: E=Sophos;i="5.75,374,1589266800"; d="scan'208";a="149033301" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2020 02:16:26 -0700 IronPort-SDR: J/CtS0AcjW8WwNC2u0w91qiJu2s+drFW3wgZY1qW4pPK4sKYtJKATrfrtcr+daf68itF2/gTDN PfhLizKNc3jQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,374,1589266800"; d="scan'208";a="317957357" Received: from npg-dpdk-cvl-jeffguo-01.sh.intel.com ([10.67.111.128]) by orsmga008.jf.intel.com with ESMTP; 20 Jul 2020 02:16:24 -0700 From: Jeff Guo To: qi.z.zhang@intel.com, qiming.yang@intel.com Cc: dev@dpdk.org, simei.su@intel.com, jia.guo@intel.com Date: Mon, 20 Jul 2020 17:13:56 +0800 Message-Id: <20200720091356.59144-1-jia.guo@intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [dpdk-dev v1] net/ice: fix symmetric hash configuration 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" Some protocol don't support symmetric hash, need to handle these cases. When set an invalid symmetric hash rule, just return failed. Fixes: 7d0824387e63 ("net/ice: fix invalid RSS type") Signed-off-by: Jeff Guo --- drivers/net/ice/ice_hash.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c index 13f88d37c..e535e4b95 100644 --- a/drivers/net/ice/ice_hash.c +++ b/drivers/net/ice/ice_hash.c @@ -1026,6 +1026,7 @@ ice_hash_parse_action(struct ice_pattern_match_item *pattern_match_item, const struct rte_flow_action *action; uint64_t rss_attr_src_dst; uint64_t rss_attr_l3_pre; + uint64_t rss_attr_symm; uint64_t rss_attr_all; uint64_t rss_type; uint16_t i; @@ -1089,6 +1090,15 @@ ice_hash_parse_action(struct ice_pattern_match_item *pattern_match_item, RTE_ETH_RSS_L3_PRE48 | RTE_ETH_RSS_L3_PRE64; + rss_attr_symm = ETH_RSS_IPV4 | + ETH_RSS_NONFRAG_IPV4_UDP | + ETH_RSS_NONFRAG_IPV4_TCP | + ETH_RSS_NONFRAG_IPV4_SCTP | + ETH_RSS_IPV6 | + ETH_RSS_NONFRAG_IPV6_UDP | + ETH_RSS_NONFRAG_IPV6_TCP | + ETH_RSS_NONFRAG_IPV6_SCTP; + rss_attr_all = rss_attr_src_dst | rss_attr_l3_pre; /* Check if only SRC/DST_ONLY or ipv6 prefix exists. */ @@ -1103,7 +1113,8 @@ ice_hash_parse_action(struct ice_pattern_match_item *pattern_match_item, */ if (rss->func == RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ) { - if (rss_type & rss_attr_src_dst) + if (rss_type & (rss_attr_src_dst | + ~rss_attr_symm)) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION, -- 2.20.1