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 02AAEA046B; Sat, 9 May 2020 10:27:55 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A57F11D705; Sat, 9 May 2020 10:27:54 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id DC16C1D63A for ; Sat, 9 May 2020 10:27:52 +0200 (CEST) IronPort-SDR: Y7Cpslxgu8MwqfEcaeE9hwi0Z3HTgOldcN7x0JGSDLAvWqrggeOlddvlpSFyfiAFwJOqLsSGo1 JX/Gs8j0hwVg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 May 2020 01:27:51 -0700 IronPort-SDR: OnGQHT4HDwZSM9v7VpGW/wzifhU4pq1Nq8IAZ12ZUgTB2CPzKyEfNnmAFcF8MAsGzmRwS95W2O se91/sAl53JA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,371,1583222400"; d="scan'208";a="279269261" Received: from npg-dpdk-cvl-jeffguo-01.sh.intel.com ([10.67.111.128]) by orsmga002.jf.intel.com with ESMTP; 09 May 2020 01:27:48 -0700 From: Jeff Guo To: beilei.xing@intel.com, qi.z.zhang@intel.com, jingjing.wu@intel.com Cc: xiaolong.ye@intel.com, dev@dpdk.org, jia.guo@intel.com Date: Sat, 9 May 2020 16:27:30 -0400 Message-Id: <20200509202730.70367-1-jia.guo@intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] 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 --- 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..173b7633f 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_R_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