From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id E1505A00E6 for ; Wed, 12 Jun 2019 16:48:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0EA011D07A; Wed, 12 Jun 2019 16:48:17 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 953F31D060 for ; Wed, 12 Jun 2019 16:48:14 +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 orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jun 2019 07:48:13 -0700 X-ExtLoop1: 1 Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga004.fm.intel.com with ESMTP; 12 Jun 2019 07:48:13 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 12 Jun 2019 07:48:13 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 12 Jun 2019 07:48:13 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.83]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.225]) with mapi id 14.03.0439.000; Wed, 12 Jun 2019 22:48:10 +0800 From: "Rong, Leyi" To: "Stillwell Jr, Paul M" , "Zhang, Qi Z" CC: "dev@dpdk.org" , "Keller, Jacob E" Thread-Topic: [PATCH v2 24/66] net/ice/base: add support for reading REPC statistics Thread-Index: AQHVIG3rGF2a7qEgKEu6n6yFbfE+aKaWHmWAgAH7wXA= Date: Wed, 12 Jun 2019 14:48:09 +0000 Message-ID: <47ACC7359E973C41ACB0C2477632BC72518C682A@SHSMSX103.ccr.corp.intel.com> References: <20190604054248.68510-1-leyi.rong@intel.com> <20190611155221.2703-1-leyi.rong@intel.com> <20190611155221.2703-25-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMjQ0NjFjZGYtODJjZi00MmE5LTk1ZjEtMDZmNGMzODM2NDBjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiaXVQOFBFMWNYTHo0N0dvZFhFYUU1NEJvTDFFOEwzXC9ia3QybEhsOTdTRlJXSEhSVnFMbG5MaDJGNHEydEJQbTEifQ== 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 24/66] net/ice/base: add support for reading REPC statistics 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:28 AM > To: Rong, Leyi ; Zhang, Qi Z > Cc: dev@dpdk.org; Keller, Jacob E > Subject: RE: [PATCH v2 24/66] net/ice/base: add support for reading REPC = statistics >=20 > > -----Original Message----- > > From: Rong, Leyi > > Sent: Tuesday, June 11, 2019 8:52 AM > > To: Zhang, Qi Z > > Cc: dev@dpdk.org; Rong, Leyi ; Keller, Jacob E > > ; Stillwell Jr, Paul M > > > > Subject: [PATCH v2 24/66] net/ice/base: add support for reading REPC > > statistics > > > > Add a new ice_stat_update_repc function which will read the register > > and increment the appropriate statistics in the ice_eth_stats structure= . > > > > Signed-off-by: Jacob Keller > > Signed-off-by: Paul M Stillwell Jr > > Signed-off-by: Leyi Rong > > --- > > drivers/net/ice/base/ice_common.c | 51 > > +++++++++++++++++++++++++++++++ > > drivers/net/ice/base/ice_common.h | 3 ++ > > drivers/net/ice/base/ice_type.h | 2 ++ > > 3 files changed, 56 insertions(+) > > > > diff --git a/drivers/net/ice/base/ice_common.c > > b/drivers/net/ice/base/ice_common.c > > index da72434d3..b4a9172b9 100644 > > --- a/drivers/net/ice/base/ice_common.c > > +++ b/drivers/net/ice/base/ice_common.c > > @@ -4138,6 +4138,57 @@ ice_stat_update32(struct ice_hw *hw, u32 reg, > > bool prev_stat_loaded, > > *cur_stat =3D (new_data + BIT_ULL(32)) - *prev_stat; } > > > > +/** > > + * ice_stat_update_repc - read GLV_REPC stats from chip and update > > +stat values > > + * @hw: ptr to the hardware info > > + * @vsi_handle: VSI handle > > + * @prev_stat_loaded: bool to specify if the previous stat values are > > +loaded > > + * @cur_stats: ptr to current stats structure > > + * > > + * The GLV_REPC statistic register actually tracks two 16bit > > +statistics, and > > + * thus cannot be read using the normal ice_stat_update32 function. > > + * > > + * Read the GLV_REPC register associated with the given VSI, and > > +update the > > + * rx_no_desc and rx_error values in the ice_eth_stats structure. > > + * > > + * Because the statistics in GLV_REPC stick at 0xFFFF, the register > > +must be > > + * cleared each time it's read. > > + * > > + * Note that the GLV_RDPC register also counts the causes that would > > +trigger > > + * GLV_REPC. However, it does not give the finer grained detail about > > +why the > > + * packets are being dropped. The GLV_REPC values can be used to > > +distinguish > > + * whether Rx packets are dropped due to errors or due to no > > +available > > + * descriptors. > > + */ > > +void > > +ice_stat_update_repc(struct ice_hw *hw, u16 vsi_handle, bool > > prev_stat_loaded, > > + struct ice_eth_stats *cur_stats) { > > + u16 vsi_num, no_desc, error_cnt; > > + u32 repc; > > + > > + if (!ice_is_vsi_valid(hw, vsi_handle)) > > + return; > > + > > + vsi_num =3D ice_get_hw_vsi_num(hw, vsi_handle); > > + > > + /* If we haven't loaded stats yet, just clear the current value */ > > + if (!prev_stat_loaded) { > > + wr32(hw, GLV_REPC(vsi_num), 0); > > + return; > > + } > > + > > + repc =3D rd32(hw, GLV_REPC(vsi_num)); > > + no_desc =3D (repc & GLV_REPC_NO_DESC_CNT_M) >> > > GLV_REPC_NO_DESC_CNT_S; > > + error_cnt =3D (repc & GLV_REPC_ERROR_CNT_M) >> > > GLV_REPC_ERROR_CNT_S; > > + > > + /* Clear the count by writing to the stats register */ > > + wr32(hw, GLV_REPC(vsi_num), 0); > > + > > + cur_stats->rx_no_desc +=3D no_desc; > > + cur_stats->rx_errors +=3D error_cnt; > > +} > > + > > >=20 > Is there code in DPDK to call these functions? If not then drop this patc= h. >=20 This function will not be called.