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 1CAFAA034F; Wed, 13 May 2020 05:13:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1A2E71C1D9; Wed, 13 May 2020 05:13:04 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 5189D1C1C0 for ; Wed, 13 May 2020 05:13:02 +0200 (CEST) IronPort-SDR: JySau6ur3M9ffwp7hbOPSiNRq1buWWesGQcgBrCAQF5gUgg4E5VXyq4+JW/f7M2XSHD8chsWHr muCiDIkrnXsQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2020 20:13:01 -0700 IronPort-SDR: V5tzlsy5anVAIIIsgt9AOtgbVYhPPT0Hx46Y6y+bhUX2WnivuIgBgLI7fmoj6xjHVbolAXQsoG rvOW75RC4NOg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,385,1583222400"; d="scan'208";a="265721990" Received: from jguo15x-mobl.ccr.corp.intel.com (HELO [10.67.68.157]) ([10.67.68.157]) by orsmga006.jf.intel.com with ESMTP; 12 May 2020 20:12:59 -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> <87415d09-5743-07b8-00e0-bc28e298be4b@intel.com> <039ED4275CED7440929022BC67E70611548151FE@SHSMSX103.ccr.corp.intel.com> From: Jeff Guo Message-ID: Date: Wed, 13 May 2020 11:12:58 +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: <039ED4275CED7440929022BC67E70611548151FE@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/13/2020 10:17 AM, Zhang, Qi Z wrote: > >> -----Original Message----- >> From: Guo, Jia >> Sent: Wednesday, May 13, 2020 7:20 AM >> To: Zhang, Qi Z ; Xing, Beilei ; >> Wu, Jingjing >> Cc: Ye, Xiaolong ; dev@dpdk.org >> Subject: Re: [dpdk-dev] net/iavf: fix rss algorithm configure issue >> >> 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. > I didn't get it.. > After apply your patch, we have below code which does not make sense, > > /* Check hash function and save it to rss_meta. */ > if (rss->func == RTE_ETH_HASH_FUNCTION_SIMPLE_XOR) > rss_meta->rss_algorithm = > VIRTCHNL_RSS_ALG_R_ASYMMETRIC; > else if... > > ASYMMETRIC is not kind of symmetric hash and should not be mapped to simple xor. > This is a typo, VIRTCHNL_RSS_ALG_R_ASYMMETRIC should be VIRTCHNL_RSS_ALG_XOR_ASYMMETRIC and it should means simple XOR, but VIRTCHNL_RSS_ALG_XOR_SYMMETRIC means symmetric xor. A type fix will send by v2 to make it clear. >> >>>>> + 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