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 17CECA0528; Fri, 17 Jul 2020 07:29:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E2AD01BED2; Fri, 17 Jul 2020 07:29:02 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 270DA1BED1 for ; Fri, 17 Jul 2020 07:29:00 +0200 (CEST) IronPort-SDR: 3MsVvh27z+vwMZl2rJYByA7og39ALOi4xrCoMBVV5hjnul7p6y2PboydY0i9kY1GXDNxSryuDb DFVcWfCR3ORA== X-IronPort-AV: E=McAfee;i="6000,8403,9684"; a="129623890" X-IronPort-AV: E=Sophos;i="5.75,361,1589266800"; d="scan'208";a="129623890" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2020 22:28:58 -0700 IronPort-SDR: qg3mtCd0T3qnL4c7AbTt1Yhr0QGG8PeO/ZoG/aJGWnYdYi5sLEf7jg621eyyXuA/km+gvZ4kSo VnJjM7m8X//w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,361,1589266800"; d="scan'208";a="308898921" Received: from npg-dpdk-cvl-jeffguo-01.sh.intel.com ([10.67.111.128]) by fmsmga004.fm.intel.com with ESMTP; 16 Jul 2020 22:28:55 -0700 From: Jeff Guo To: qi.z.zhang@intel.com, beilei.xing@intel.com, jingjing.wu@intel.com Cc: dev@dpdk.org, junfeng.guo@intel.com, simei.su@intel.com, jia.guo@intel.com Date: Fri, 17 Jul 2020 13:26:52 +0800 Message-Id: <20200717052652.36973-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/iavf: fix simple xor hash 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" Simple xor hash should be global congfigured in VFs. Fixes: 215a247b5f33 ("net/iavf: refactor hash flow") Signed-off-by: Jeff Guo --- drivers/net/iavf/iavf_hash.c | 46 +++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index 967e6b64b..4b69e5c30 100644 --- a/drivers/net/iavf/iavf_hash.c +++ b/drivers/net/iavf/iavf_hash.c @@ -3803,7 +3803,8 @@ iavf_hash_parse_pattern(struct iavf_pattern_match_item *pattern_match_item, } static int -iavf_hash_parse_action(const struct rte_flow_action actions[], +iavf_hash_parse_action(struct iavf_pattern_match_item *pattern_match_item, + const struct rte_flow_action actions[], uint64_t pattern_hint, void **meta, struct rte_flow_error *error) { @@ -3826,19 +3827,6 @@ iavf_hash_parse_action(const struct rte_flow_action actions[], rss = action->conf; rss_type = rss->types; - if (rss->func == - RTE_ETH_HASH_FUNCTION_SIMPLE_XOR){ - rss_meta->rss_algorithm = - VIRTCHNL_RSS_ALG_XOR_ASYMMETRIC; - } else if (rss->func == - RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ) { - rss_meta->rss_algorithm = - VIRTCHNL_RSS_ALG_TOEPLITZ_SYMMETRIC; - } else { - rss_meta->rss_algorithm = - VIRTCHNL_RSS_ALG_TOEPLITZ_ASYMMETRIC; - } - if (rss->level) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION, action, @@ -3854,6 +3842,29 @@ iavf_hash_parse_action(const struct rte_flow_action actions[], RTE_FLOW_ERROR_TYPE_ACTION, action, "a non-NULL RSS queue is not supported"); + /* Check hash function and save it to rss_meta, + * the pattern should be empty for simple_xor. + */ + if (pattern_match_item->pattern_list != + iavf_pattern_empty && rss->func == + RTE_ETH_HASH_FUNCTION_SIMPLE_XOR) { + return rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ACTION, action, + "Not supported flow"); + } else if (rss->func == + RTE_ETH_HASH_FUNCTION_SIMPLE_XOR){ + rss_meta->rss_algorithm = + VIRTCHNL_RSS_ALG_XOR_ASYMMETRIC; + break; + } else if (rss->func == + RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ) { + rss_meta->rss_algorithm = + VIRTCHNL_RSS_ALG_TOEPLITZ_SYMMETRIC; + } else { + rss_meta->rss_algorithm = + VIRTCHNL_RSS_ALG_TOEPLITZ_ASYMMETRIC; + } + /** * Check simultaneous use of SRC_ONLY and DST_ONLY * of the same level. @@ -3944,7 +3955,7 @@ iavf_hash_parse_pattern_action(__rte_unused struct iavf_adapter *ad, if (ret) goto error; - ret = iavf_hash_parse_action(actions, phint, + ret = iavf_hash_parse_action(pattern_match_item, actions, phint, (void **)&rss_meta_ptr, error); error: @@ -3976,7 +3987,10 @@ iavf_hash_create(__rte_unused struct iavf_adapter *ad, return -ENOMEM; } - rss_cfg->proto_hdrs = *rss_meta->proto_hdrs; + /* Simle_xor is globle configured, no need to set protocol hdrs */ + if (rss_meta->rss_algorithm != VIRTCHNL_RSS_ALG_XOR_ASYMMETRIC) + rss_cfg->proto_hdrs = *rss_meta->proto_hdrs; + rss_cfg->rss_algorithm = rss_meta->rss_algorithm; ret = iavf_add_del_rss_cfg(ad, rss_cfg, true); -- 2.20.1