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 636E2A034F; Wed, 13 May 2020 01:20:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4CCB51BFA6; Wed, 13 May 2020 01:20:31 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 23D081BFA4 for ; Wed, 13 May 2020 01:20:29 +0200 (CEST) IronPort-SDR: cQyW9JyPGR7k6Wc009ReQB3xMcKMWcY5LjQ5j0927tvOpzrvZ4lz6pH6/miDJyGPOIIUUk7NTJ susFTAA+KP+w== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2020 16:20:29 -0700 IronPort-SDR: DmE6FTO7yTaAkiXs7O3edt1B7aeQi1CxXhfKqScoob71iWCf+EvhIUKdL1cD2RNsvEM1zaE/zA XfQDsPYftKqQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,385,1583222400"; d="scan'208";a="463722711" Received: from jguo15x-mobl.ccr.corp.intel.com (HELO [10.255.30.16]) ([10.255.30.16]) by fmsmga005.fm.intel.com with ESMTP; 12 May 2020 16:20:27 -0700 To: "Zhang, Qi Z" , "Xing, Beilei" , "Wu, Jingjing" Cc: "Ye, Xiaolong" , "dev@dpdk.org" References: <20200509202730.70367-1-jia.guo@intel.com> <039ED4275CED7440929022BC67E70611548142B9@SHSMSX103.ccr.corp.intel.com> <039ED4275CED7440929022BC67E70611548142DF@SHSMSX103.ccr.corp.intel.com> From: Jeff Guo Message-ID: <87415d09-5743-07b8-00e0-bc28e298be4b@intel.com> Date: Wed, 13 May 2020 07:20:26 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <039ED4275CED7440929022BC67E70611548142DF@SHSMSX103.ccr.corp.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Subject: Re: [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" hi, qi On 5/12/2020 10:21 AM, Zhang, Qi Z wrote: > >> -----Original Message----- >> From: Zhang, Qi Z >> Sent: Tuesday, May 12, 2020 10:18 AM >> To: Guo, Jia ; Xing, Beilei ; Wu, >> Jingjing >> Cc: Ye, Xiaolong ; dev@dpdk.org >> Subject: RE: [dpdk-dev] net/iavf: fix rss algorithm configure issue >> >> >> >>> -----Original Message----- >>> From: Guo, Jia >>> Sent: Sunday, May 10, 2020 4:28 AM >>> To: Xing, Beilei ; Zhang, Qi Z >>> ; Wu, Jingjing >>> Cc: Ye, Xiaolong ; dev@dpdk.org; Guo, Jia >>> >>> Subject: [dpdk-dev] net/iavf: fix rss algorithm configure issue >>> >>> 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; >> RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ --> >> VIRTCHNL_RSS_ALG_R_ASYMMETRIC > A typo, it is > RTE_ETH_HASH_FUNCTION_SIMPLE_XOR --> VIRTCHNL_RSS_ALG_R_ASYMMETRIC which looks not correct. >> Is it should be VIRTCHNL_RSS_ALG_XOR_SYMMETRIC? >> >> At currently driver,  VIRTCHNL_RSS_ALG_R_ASYMMETRIC is used to identify simple XOR. >>> + 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