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 02ADAA034F; Wed, 13 May 2020 10:22:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 737871C435; Wed, 13 May 2020 10:22:04 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 546711C246 for ; Wed, 13 May 2020 10:22:01 +0200 (CEST) IronPort-SDR: udBvb3OP34y29LFE1EcEtUP3G+XUzEGC71RrdimzCBcfq+Ns7qQRWyBj0pcWhKG4VOcBB6AJdw ZaaifmRV6klQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2020 01:22:00 -0700 IronPort-SDR: o6gWGiccnNr21l6E/A2fijGiZyQyu9AsB55FG09GNnUj/eTTMktl159vfOt39A+N6j4xLuY1Vx zjOZg1GXQhuA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,387,1583222400"; d="scan'208";a="464052861" Received: from npg-dpdk-cvl-jeffguo-01.sh.intel.com ([10.67.111.128]) by fmsmga006.fm.intel.com with ESMTP; 13 May 2020 01:21:59 -0700 From: Jeff Guo To: beilei.xing@intel.com, xiaolong.ye@intel.com, qi.z.zhang@intel.com, jingjing.wu@intel.com Cc: dev@dpdk.org, jia.guo@intel.com Date: Wed, 13 May 2020 16:21:28 -0400 Message-Id: <20200513202128.112290-2-jia.guo@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200513202128.112290-1-jia.guo@intel.com> References: <20200509202730.70367-1-jia.guo@intel.com> <20200513202128.112290-1-jia.guo@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [dpdk-dev v2 2/2] net/iavf: fix rss algorithm configure issue 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 configure rss rule, the etherdev rss hash function type should be mapped to the corresponding virtchnl rss algorithm type. Fixes: 7be10c3004be ("net/iavf: add RSS configuration for VF") Signed-off-by: Jeff Guo --- v2->v1: fix a type for xor. --- drivers/net/iavf/iavf_hash.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index 6359ead76..975c84556 100644 --- a/drivers/net/iavf/iavf_hash.c +++ b/drivers/net/iavf/iavf_hash.c @@ -47,7 +47,7 @@ struct iavf_hash_match_type { struct iavf_rss_meta { struct virtchnl_proto_hdrs *proto_hdrs; - uint32_t hash_function; + enum virtchnl_rss_algorithm rss_algorithm; }; struct iavf_hash_flow_cfg { @@ -1001,13 +1001,15 @@ iavf_hash_parse_action(struct iavf_pattern_match_item *pattern_match_item, /* Check hash function and save it to rss_meta. */ if (rss->func == RTE_ETH_HASH_FUNCTION_SIMPLE_XOR) - rss_meta->hash_function = - RTE_ETH_HASH_FUNCTION_SIMPLE_XOR; - - if (rss->func == - RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ) - rss_meta->hash_function = - RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ; + 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; type_match_item = rte_zmalloc("iavf_type_match_item", @@ -1126,7 +1128,7 @@ iavf_hash_create(__rte_unused struct iavf_adapter *ad, } rss_cfg->proto_hdrs = *rss_meta->proto_hdrs; - rss_cfg->rss_algorithm = rss_meta->hash_function; + rss_cfg->rss_algorithm = rss_meta->rss_algorithm; ret = iavf_add_del_rss_cfg(ad, rss_cfg, true); if (!ret) { -- 2.20.1