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 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 37328C31E46 for ; Wed, 12 Jun 2019 14:45:41 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id CB61F208CA for ; Wed, 12 Jun 2019 14:45:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CB61F208CA 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 165DE1D060; Wed, 12 Jun 2019 16:45:40 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id AFFBD1C1C6 for ; Wed, 12 Jun 2019 16:45:38 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jun 2019 07:45:37 -0700 X-ExtLoop1: 1 Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga001.jf.intel.com with ESMTP; 12 Jun 2019 07:45:37 -0700 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 12 Jun 2019 07:45:37 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 12 Jun 2019 07:45:36 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.83]) by shsmsx102.ccr.corp.intel.com ([169.254.2.33]) with mapi id 14.03.0439.000; Wed, 12 Jun 2019 22:45:34 +0800 From: "Rong, Leyi" To: "Stillwell Jr, Paul M" , "Zhang, Qi Z" CC: "dev@dpdk.org" , "Nguyen, Anthony L" Thread-Topic: [PATCH v2 21/66] net/ice/base: add helper functions for PHY caching Thread-Index: AQHVIG3px6pAxyhCRk2TIw/9h/c+DqaWHgAAgAH6jYA= Date: Wed, 12 Jun 2019 14:45:33 +0000 Message-ID: <47ACC7359E973C41ACB0C2477632BC72518C6805@SHSMSX103.ccr.corp.intel.com> References: <20190604054248.68510-1-leyi.rong@intel.com> <20190611155221.2703-1-leyi.rong@intel.com> <20190611155221.2703-22-leyi.rong@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYWY5N2RiOTQtNTEzNS00M2EwLWE4NGYtNjdhMDNjNjY4NmM3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZDVhejl0TUx5Sm5KaHhWYzVWZHJnOEVjTzdTUlZWUTBhV29cL051T3JENXZNTEtQYmlLb2VpK3ZNSzNaMDg5cVkifQ== 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] [PATCH v2 21/66] net/ice/base: add helper functions for PHY caching 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: Stillwell Jr, Paul M > Sent: Wednesday, June 12, 2019 12:27 AM > To: Rong, Leyi ; Zhang, Qi Z > Cc: dev@dpdk.org; Nguyen, Anthony L > Subject: RE: [PATCH v2 21/66] net/ice/base: add helper functions for PHY = caching >=20 > > -----Original Message----- > > From: Rong, Leyi > > Sent: Tuesday, June 11, 2019 8:52 AM > > To: Zhang, Qi Z > > Cc: dev@dpdk.org; Rong, Leyi ; Nguyen, Anthony L > > ; Stillwell Jr, Paul M > > > > Subject: [PATCH v2 21/66] net/ice/base: add helper functions for PHY > > caching > > > > Add additional functions to aide in caching PHY configuration. > > In order to cache the initial modes, we need to determine the > > operating mode based on capabilities. Add helper functions for flow > > control and FEC to take a set of capabilities and return the operating > > mode matching those capabilities. Also add a helper function to > > determine whether a PHY capability matches a PHY configuration. > > > > Signed-off-by: Tony Nguyen > > Signed-off-by: Paul M Stillwell Jr > > Signed-off-by: Leyi Rong > > --- > > drivers/net/ice/base/ice_adminq_cmd.h | 1 + > > drivers/net/ice/base/ice_common.c | 83 > > +++++++++++++++++++++++++++ > > drivers/net/ice/base/ice_common.h | 9 ++- > > 3 files changed, 91 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/net/ice/base/ice_adminq_cmd.h > > b/drivers/net/ice/base/ice_adminq_cmd.h > > index 739f79e88..77f93b950 100644 > > --- a/drivers/net/ice/base/ice_adminq_cmd.h > > +++ b/drivers/net/ice/base/ice_adminq_cmd.h > > @@ -1594,6 +1594,7 @@ struct ice_aqc_get_link_status_data { > > #define ICE_AQ_LINK_PWR_QSFP_CLASS_3 2 > > #define ICE_AQ_LINK_PWR_QSFP_CLASS_4 3 > > __le16 link_speed; > > +#define ICE_AQ_LINK_SPEED_M 0x7FF > > #define ICE_AQ_LINK_SPEED_10MB BIT(0) > > #define ICE_AQ_LINK_SPEED_100MB BIT(1) > > #define ICE_AQ_LINK_SPEED_1000MB BIT(2) > > diff --git a/drivers/net/ice/base/ice_common.c > > b/drivers/net/ice/base/ice_common.c > > index 5b4a13a41..7f7f4dad0 100644 > > --- a/drivers/net/ice/base/ice_common.c > > +++ b/drivers/net/ice/base/ice_common.c > > @@ -2552,6 +2552,53 @@ ice_cache_phy_user_req(struct ice_port_info *pi, > > } > > } > > > > +/** > > + * ice_caps_to_fc_mode > > + * @caps: PHY capabilities > > + * > > + * Convert PHY FC capabilities to ice FC mode */ enum ice_fc_mode > > +ice_caps_to_fc_mode(u8 caps) { > > + if (caps & ICE_AQC_PHY_EN_TX_LINK_PAUSE && > > + caps & ICE_AQC_PHY_EN_RX_LINK_PAUSE) > > + return ICE_FC_FULL; > > + > > + if (caps & ICE_AQC_PHY_EN_TX_LINK_PAUSE) > > + return ICE_FC_TX_PAUSE; > > + > > + if (caps & ICE_AQC_PHY_EN_RX_LINK_PAUSE) > > + return ICE_FC_RX_PAUSE; > > + > > + return ICE_FC_NONE; > > +} > > + > > +/** > > + * ice_caps_to_fec_mode > > + * @caps: PHY capabilities > > + * @fec_options: Link FEC options > > + * > > + * Convert PHY FEC capabilities to ice FEC mode */ enum ice_fec_mode > > +ice_caps_to_fec_mode(u8 caps, u8 fec_options) { > > + if (caps & ICE_AQC_PHY_EN_AUTO_FEC) > > + return ICE_FEC_AUTO; > > + > > + if (fec_options & (ICE_AQC_PHY_FEC_10G_KR_40G_KR4_EN | > > + ICE_AQC_PHY_FEC_10G_KR_40G_KR4_REQ | > > + ICE_AQC_PHY_FEC_25G_KR_CLAUSE74_EN | > > + ICE_AQC_PHY_FEC_25G_KR_REQ)) > > + return ICE_FEC_BASER; > > + > > + if (fec_options & (ICE_AQC_PHY_FEC_25G_RS_528_REQ | > > + ICE_AQC_PHY_FEC_25G_RS_544_REQ | > > + ICE_AQC_PHY_FEC_25G_RS_CLAUSE91_EN)) > > + return ICE_FEC_RS; > > + > > + return ICE_FEC_NONE; > > +} > > + >=20 > Is there DPDK code to call the above functions? If not, then drop this pa= tch. >=20 They will not be called.