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 C2F04C4321A for ; Tue, 11 Jun 2019 16:23:53 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 611E02080A for ; Tue, 11 Jun 2019 16:23:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 611E02080A 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 2D7171D09F; Tue, 11 Jun 2019 18:23:52 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 4DDE11D096 for ; Tue, 11 Jun 2019 18:23:51 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Jun 2019 09:23:50 -0700 X-ExtLoop1: 1 Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga004.fm.intel.com with ESMTP; 11 Jun 2019 09:23:50 -0700 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 11 Jun 2019 09:23:50 -0700 Received: from fmsmsx120.amr.corp.intel.com ([169.254.15.191]) by FMSMSX126.amr.corp.intel.com ([169.254.1.74]) with mapi id 14.03.0415.000; Tue, 11 Jun 2019 09:23:49 -0700 From: "Stillwell Jr, Paul M" To: "Rong, Leyi" , "Zhang, Qi Z" CC: "dev@dpdk.org" , "Nowlin, Dan" Thread-Topic: [PATCH v2 17/66] net/ice/base: add API to init FW logging Thread-Index: AQHVIG3mvyYxG9Qub0m7uNks5zMBbKaWoucQ Date: Tue, 11 Jun 2019 16:23:48 +0000 Message-ID: References: <20190604054248.68510-1-leyi.rong@intel.com> <20190611155221.2703-1-leyi.rong@intel.com> <20190611155221.2703-18-leyi.rong@intel.com> In-Reply-To: <20190611155221.2703-18-leyi.rong@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzlmOTNkMTUtZDQ0NC00YzBhLTg3YmYtNWY5ODkzMjgwZDQzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoidExlUkJwMW90bzZhZXRZbkgwWmhrYllEck50RkcxSFpBXC85MUgrTlExNWhMMDhucGlPeEZSVnVSMHFoQ2Q1TmMifQ== x-originating-ip: [10.1.200.108] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 17/66] net/ice/base: add API to init FW logging 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: Rong, Leyi > Sent: Tuesday, June 11, 2019 8:52 AM > To: Zhang, Qi Z > Cc: dev@dpdk.org; Rong, Leyi ; Nowlin, Dan > ; Stillwell Jr, Paul M > Subject: [PATCH v2 17/66] net/ice/base: add API to init FW logging >=20 > In order to initialize the current status of the FW logging, the api > ice_get_fw_log_cfg is added. The function retrieves the current setting o= f > the FW logging from HW and updates the ice_hw structure accordingly. >=20 > Signed-off-by: Dan Nowlin > 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 | 48 > +++++++++++++++++++++++++++ > 2 files changed, 49 insertions(+) >=20 > diff --git a/drivers/net/ice/base/ice_adminq_cmd.h > b/drivers/net/ice/base/ice_adminq_cmd.h > index 7b0aa8aaa..739f79e88 100644 > --- a/drivers/net/ice/base/ice_adminq_cmd.h > +++ b/drivers/net/ice/base/ice_adminq_cmd.h > @@ -2196,6 +2196,7 @@ enum ice_aqc_fw_logging_mod { > ICE_AQC_FW_LOG_ID_WATCHDOG, > ICE_AQC_FW_LOG_ID_TASK_DISPATCH, > ICE_AQC_FW_LOG_ID_MNG, > + ICE_AQC_FW_LOG_ID_SYNCE, > ICE_AQC_FW_LOG_ID_MAX, > }; >=20 > diff --git a/drivers/net/ice/base/ice_common.c > b/drivers/net/ice/base/ice_common.c > index 62c7fad0d..7093ee4f4 100644 > --- a/drivers/net/ice/base/ice_common.c > +++ b/drivers/net/ice/base/ice_common.c > @@ -582,6 +582,49 @@ static void ice_cleanup_fltr_mgmt_struct(struct > ice_hw *hw) > #define ICE_FW_LOG_DESC_SIZE_MAX \ > ICE_FW_LOG_DESC_SIZE(ICE_AQC_FW_LOG_ID_MAX) >=20 > +/** > + * ice_get_fw_log_cfg - get FW logging configuration > + * @hw: pointer to the HW struct > + */ > +static enum ice_status ice_get_fw_log_cfg(struct ice_hw *hw) { > + struct ice_aqc_fw_logging_data *config; > + struct ice_aq_desc desc; > + enum ice_status status; > + u16 size; > + > + size =3D ICE_FW_LOG_DESC_SIZE_MAX; > + config =3D (struct ice_aqc_fw_logging_data *)ice_malloc(hw, size); > + if (!config) > + return ICE_ERR_NO_MEMORY; > + > + ice_fill_dflt_direct_cmd_desc(&desc, > ice_aqc_opc_fw_logging_info); > + > + desc.flags |=3D CPU_TO_LE16(ICE_AQ_FLAG_BUF); > + desc.flags |=3D CPU_TO_LE16(ICE_AQ_FLAG_RD); > + > + status =3D ice_aq_send_cmd(hw, &desc, config, size, NULL); > + if (!status) { > + u16 i; > + > + /* Save fw logging information into the HW structure */ > + for (i =3D 0; i < ICE_AQC_FW_LOG_ID_MAX; i++) { > + u16 v, m, flgs; > + > + v =3D LE16_TO_CPU(config->entry[i]); > + m =3D (v & ICE_AQC_FW_LOG_ID_M) >> > ICE_AQC_FW_LOG_ID_S; > + flgs =3D (v & ICE_AQC_FW_LOG_EN_M) >> > ICE_AQC_FW_LOG_EN_S; > + > + if (m < ICE_AQC_FW_LOG_ID_MAX) > + hw->fw_log.evnts[m].cur =3D flgs; > + } > + } > + > + ice_free(hw, config); > + > + return status; > +} > + > /** > * ice_cfg_fw_log - configure FW logging > * @hw: pointer to the HW struct > @@ -636,6 +679,11 @@ static enum ice_status ice_cfg_fw_log(struct ice_hw > *hw, bool enable) Is there code in DPDK that calls ice_cfg_fw_log()? If not then I would drop= this patch. > (!hw->fw_log.actv_evnts || !ice_check_sq_alive(hw, &hw- > >adminq))) > return ICE_SUCCESS; >=20 > + /* Get current FW log settings */ > + status =3D ice_get_fw_log_cfg(hw); > + if (status) > + return status; > + > ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_fw_logging); > cmd =3D &desc.params.fw_logging; >=20 > -- > 2.17.1