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 3222CA04EF; Sun, 24 May 2020 07:46:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 72A801D55E; Sun, 24 May 2020 07:46:32 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id EA1D31D558 for ; Sun, 24 May 2020 07:46:30 +0200 (CEST) IronPort-SDR: FEH4GxkxFBnCEuEA+BYX62x4A+Lvgw4OFnZwZYG8LnS9kI7VOPBuqscp8rO/NdHv8cMY8nIRkR VtOJVf7A/NUw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 May 2020 22:46:29 -0700 IronPort-SDR: 7VL8GBL81ZmFY5fO9QmP4Hczvt1K2RnD8LWg0z3GXGq+INOYxDXDlNOAroyl8ozWAvd2JBBa54 ft4XvDauiauA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,428,1583222400"; d="scan'208";a="290534520" Received: from jguo15x-mobl.ccr.corp.intel.com (HELO [10.249.174.183]) ([10.249.174.183]) by fmsmga004.fm.intel.com with ESMTP; 23 May 2020 22:46:27 -0700 To: "Zhang, Qi Z" , "Xing, Beilei" , "Wu, Jingjing" Cc: "Ye, Xiaolong" , "dev@dpdk.org" References: <20200522231731.40803-1-jia.guo@intel.com> <039ED4275CED7440929022BC67E70611548250BC@SHSMSX103.ccr.corp.intel.com> From: Jeff Guo Message-ID: Date: Sun, 24 May 2020 13:46: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: <039ED4275CED7440929022BC67E70611548250BC@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 protocol field selector configure 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/23/2020 10:03 AM, Zhang, Qi Z wrote: > >> -----Original Message----- >> From: Guo, Jia >> Sent: Saturday, May 23, 2020 7:18 AM >> To: Xing, Beilei ; Zhang, Qi Z ; >> Wu, Jingjing >> Cc: Ye, Xiaolong ; dev@dpdk.org; Guo, Jia >> >> Subject: [dpdk-dev] net/iavf: fix protocol field selector configure >> >> When VFs configure the rss rule by virtchnl, it need to set bit mask into the >> field selector for the protocol, then PF got the configure massage and parse >> the field selector to the corresponding protocol field. >> >> Fixes: 7be10c3004be ("net/iavf: add RSS configuration for VF") >> >> Signed-off-by: Jeff Guo >> --- >> drivers/net/iavf/iavf_hash.c | 474 +++++++++++++++++++++-------------- >> 1 file changed, 280 insertions(+), 194 deletions(-) >> >> diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index >> af528863b..1e0ffad4c 100644 >> --- a/drivers/net/iavf/iavf_hash.c >> +++ b/drivers/net/iavf/iavf_hash.c >> @@ -43,6 +43,7 @@ struct iavf_hash_match_type { >> enum iavf_pattern_hint_type phint_type; >> uint64_t hash_type; >> struct virtchnl_proto_hdrs *proto_hdrs; >> + uint32_t link_type; > If this is just a hint for gtpu link type. > Better to rename to "gtpu_hint" > And use the already defined enum but not uint32_t. > ok. >> }; >> >> struct iavf_rss_meta { >> @@ -147,8 +148,11 @@ static struct iavf_pattern_match_item >> iavf_hash_pattern_list[] = { >> {iavf_pattern_empty, IAVF_INSET_NONE, &phint_empty}, }; >> >> -#define GTP_EH_PDU_LINK_UP 1 >> -#define GTP_EH_PDU_LINK_DWN 0 >> +enum iavf_pattern_link_type { > Rename to iavf_gtpu_hint. seem it is better. >> + IAVF_PATTERN_LINK_DOWN, >> + IAVF_PATTERN_LINK_UP, >> + IAVF_PATTERN_LINK_NONE, >> +}; > The configure is for GTP down/up link, > The name "xxx_LINK_DOWN", and "xxx_LINK_UP" is a little bit misleading. > Could be > IAVF_GTPU_HINT_UPLINK. > IAVF_GTPU_HINT_DOWNLINK. > IAVF_GTPU_HINT_N/A ok, but i will choose  IAVF_GTPU_HINT_NONE but not IAVF_GTPU_HINT_N/A for common and it should also knowledgeable. >> #define TUNNEL_LEVEL_OUTER 0 >> #define TUNNEL_LEVEL_FIRST_INNER 1 >> @@ -160,103 +164,112 @@ static struct iavf_pattern_match_item >> iavf_hash_pattern_list[] = { >> #define BUFF_NOUSED 0 >> #define FIELD_FOR_PROTO_ONLY 0 >> >> +#define FIELD_SELECTOR(proto_hdr_field) (1UL << ((proto_hdr_field) % \ >> + (1UL << PROTO_HDR_SHIFT))) > Could be simplified to. > #define FIELD_SELECTOR(proto_hdr_field) \ > (1UL << (proto_hdr_field & PROTO_HDR_FIELD_MASK)) Use the currently macro to make it simple, sounds good. Thanks. > ...... > > Regards > Qi