From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CAA8CC433E0 for ; Sat, 23 May 2020 02:03:14 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 041DE2072C for ; Sat, 23 May 2020 02:03:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 041DE2072C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DFB1E1D989; Sat, 23 May 2020 04:03:12 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id BEB8B1D8D7 for ; Sat, 23 May 2020 04:03:10 +0200 (CEST) IronPort-SDR: s5da+9PHnH1IsGBb3jTwXrceAU0ukPOAMvlNbhIXRGzvfVc1q0M1siWOIMY2hUgZmqhA927Paz 82PVzw2HiYMw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2020 19:03:09 -0700 IronPort-SDR: ytPsvZugagr9Mpl+xPRwFquvjdDvJeKOeqQGiX15cHdKwswoR02FANgNBLW14nccHdafq5n2DL EAsRlQLzXU8g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,423,1583222400"; d="scan'208";a="265601556" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga003.jf.intel.com with ESMTP; 22 May 2020 19:03:09 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 22 May 2020 19:03:09 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 22 May 2020 19:03:08 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.241]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.177]) with mapi id 14.03.0439.000; Sat, 23 May 2020 10:03:05 +0800 From: "Zhang, Qi Z" To: "Guo, Jia" , "Xing, Beilei" , "Wu, Jingjing" CC: "Ye, Xiaolong" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] net/iavf: fix protocol field selector configure Thread-Index: AQHWMI8zjfXrsy/NcUupger+VK1xg6i04kzw Date: Sat, 23 May 2020 02:03:04 +0000 Message-ID: <039ED4275CED7440929022BC67E70611548250BC@SHSMSX103.ccr.corp.intel.com> References: <20200522231731.40803-1-jia.guo@intel.com> In-Reply-To: <20200522231731.40803-1-jia.guo@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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" > -----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 >=20 > 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 pa= rse > the field selector to the corresponding protocol field. >=20 > Fixes: 7be10c3004be ("net/iavf: add RSS configuration for VF") >=20 > Signed-off-by: Jeff Guo > --- > drivers/net/iavf/iavf_hash.c | 474 +++++++++++++++++++++-------------- > 1 file changed, 280 insertions(+), 194 deletions(-) >=20 > 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. =20 > }; >=20 > struct iavf_rss_meta { > @@ -147,8 +148,11 @@ static struct iavf_pattern_match_item > iavf_hash_pattern_list[] =3D { > {iavf_pattern_empty, IAVF_INSET_NONE, &phint_empty}, }; >=20 > -#define GTP_EH_PDU_LINK_UP 1 > -#define GTP_EH_PDU_LINK_DWN 0 > +enum iavf_pattern_link_type { Rename to iavf_gtpu_hint. > + IAVF_PATTERN_LINK_DOWN, > + IAVF_PATTERN_LINK_UP, > + IAVF_PATTERN_LINK_NONE, > +}; The configure is for GTP down/up link,=20 The name "xxx_LINK_DOWN", and "xxx_LINK_UP" is a little bit misleading. Could be=20 IAVF_GTPU_HINT_UPLINK. IAVF_GTPU_HINT_DOWNLINK. IAVF_GTPU_HINT_N/A >=20 > #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[] =3D { > #define BUFF_NOUSED 0 > #define FIELD_FOR_PROTO_ONLY 0 >=20 > +#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)) ...... Regards Qi