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 88E11A00E6 for ; Wed, 12 Jun 2019 03:17:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 495051D0B8; Wed, 12 Jun 2019 03:17:41 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 093661D0B6 for ; Wed, 12 Jun 2019 03:17:38 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Jun 2019 18:17:38 -0700 X-ExtLoop1: 1 Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga008.jf.intel.com with ESMTP; 11 Jun 2019 18:17:37 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 11 Jun 2019 18:17:37 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 11 Jun 2019 18:17:37 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.185]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.156]) with mapi id 14.03.0439.000; Wed, 12 Jun 2019 09:17:35 +0800 From: "Xu, Rosen" To: "Pei, Andy" , "dev@dpdk.org" Thread-Topic: [PATCH v2 3/4] net/ipn3ke: clear statistics when init and start dev Thread-Index: AQHVIDvF6ctDuXZwBUOOs8uCioyXpKaXOLnA Date: Wed, 12 Jun 2019 01:17:34 +0000 Message-ID: <0E78D399C70DA940A335608C6ED296D73A7EF53D@SHSMSX104.ccr.corp.intel.com> References: <1559543493-215042-2-git-send-email-andy.pei@intel.com> <1560246526-264797-1-git-send-email-andy.pei@intel.com> <1560246526-264797-3-git-send-email-andy.pei@intel.com> In-Reply-To: <1560246526-264797-3-git-send-email-andy.pei@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzY1NzVlYmMtMGE3My00YmVmLWFhMDktOTQzYThhNzBiNTA1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiM1Z4MmEwYXdTRkRLZkhnM2ZWcHJZMjZWVmdMR2MrRWVZNE1zVmgyd0RmY1c2WEVWRnNNQk5ETUpxS2lDVlpqbiJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 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 3/4] net/ipn3ke: clear statistics when init and start dev 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: Pei, Andy > Sent: Tuesday, June 11, 2019 17:49 > To: dev@dpdk.org > Cc: Pei, Andy ; Xu, Rosen > Subject: [PATCH v2 3/4] net/ipn3ke: clear statistics when init and start = dev >=20 > clear line side and NIC side statistics registers when HW init and uinit,= and > when dev start. >=20 > Fixes: c01c748e4ae6 ("net/ipn3ke: add new driver") > Cc: rosen.xu@intel.com >=20 > Signed-off-by: Andy Pei > --- > drivers/net/ipn3ke/ipn3ke_ethdev.c | 59 > ++++++++++++++++++++++++++++----- > drivers/net/ipn3ke/ipn3ke_representor.c | 27 ++++++++++++--- > 2 files changed, 74 insertions(+), 12 deletions(-) >=20 > diff --git a/drivers/net/ipn3ke/ipn3ke_ethdev.c > b/drivers/net/ipn3ke/ipn3ke_ethdev.c > index 8d3084d..27ebfb5 100644 > --- a/drivers/net/ipn3ke/ipn3ke_ethdev.c > +++ b/drivers/net/ipn3ke/ipn3ke_ethdev.c > @@ -244,11 +244,33 @@ > /* Enable the RX path */ > ipn3ke_xmac_rx_enable(hw, i, 1); >=20 > - /* Clear all TX statistics counters */ > - ipn3ke_xmac_tx_clr_stcs(hw, i, 1); > + /* Clear NIC side TX statistics counters */ > + ipn3ke_xmac_tx_clr_10G_stcs(hw, i, 1); >=20 > - /* Clear all RX statistics counters */ > - ipn3ke_xmac_rx_clr_stcs(hw, i, 1); > + /* Clear NIC side RX statistics counters */ > + ipn3ke_xmac_rx_clr_10G_stcs(hw, i, 1); > + > + /* Clear line side TX statistics counters */ > + ipn3ke_xmac_tx_clr_10G_stcs(hw, i, 0); > + > + /* Clear line RX statistics counters */ > + ipn3ke_xmac_rx_clr_10G_stcs(hw, i, 0); > + } > + } else if (hw->retimer.mac_type =3D=3D > + IFPGA_RAWDEV_RETIMER_MAC_TYPE_25GE_25GAUI) > { > + /* Enable inter connect channel */ > + for (i =3D 0; i < hw->port_num; i++) { > + /* Clear NIC side TX statistics counters */ > + ipn3ke_xmac_tx_clr_25G_stcs(hw, i, 1); > + > + /* Clear NIC side RX statistics counters */ > + ipn3ke_xmac_rx_clr_25G_stcs(hw, i, 1); > + > + /* Clear line side TX statistics counters */ > + ipn3ke_xmac_tx_clr_25G_stcs(hw, i, 0); > + > + /* Clear line side RX statistics counters */ > + ipn3ke_xmac_rx_clr_25G_stcs(hw, i, 0); > } > } >=20 > @@ -291,11 +313,32 @@ > /* Disable the RX path */ > ipn3ke_xmac_rx_disable(hw, i, 1); >=20 > - /* Clear all TX statistics counters */ > - ipn3ke_xmac_tx_clr_stcs(hw, i, 1); > + /* Clear NIC side TX statistics counters */ > + ipn3ke_xmac_tx_clr_10G_stcs(hw, i, 1); > + > + /* Clear NIC side RX statistics counters */ > + ipn3ke_xmac_rx_clr_10G_stcs(hw, i, 1); > + > + /* Clear line side TX statistics counters */ > + ipn3ke_xmac_tx_clr_10G_stcs(hw, i, 0); > + > + /* Clear line side RX statistics counters */ > + ipn3ke_xmac_rx_clr_10G_stcs(hw, i, 0); > + } > + } else if (hw->retimer.mac_type =3D=3D > + IFPGA_RAWDEV_RETIMER_MAC_TYPE_25GE_25GAUI) > { > + for (i =3D 0; i < hw->port_num; i++) { > + /* Clear NIC side TX statistics counters */ > + ipn3ke_xmac_tx_clr_25G_stcs(hw, i, 1); > + > + /* Clear NIC side RX statistics counters */ > + ipn3ke_xmac_rx_clr_25G_stcs(hw, i, 1); > + > + /* Clear line side TX statistics counters */ > + ipn3ke_xmac_tx_clr_25G_stcs(hw, i, 0); >=20 > - /* Clear all RX statistics counters */ > - ipn3ke_xmac_rx_clr_stcs(hw, i, 1); > + /* Clear line side RX statistics counters */ > + ipn3ke_xmac_rx_clr_25G_stcs(hw, i, 0); > } > } > } > diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c > b/drivers/net/ipn3ke/ipn3ke_representor.c > index f4529f6..b166b8f 100644 > --- a/drivers/net/ipn3ke/ipn3ke_representor.c > +++ b/drivers/net/ipn3ke/ipn3ke_representor.c > @@ -159,11 +159,30 @@ > /* Enable the RX path */ > ipn3ke_xmac_rx_enable(hw, rpst->port_id, 0); >=20 > - /* Clear all TX statistics counters */ > - ipn3ke_xmac_tx_clr_stcs(hw, rpst->port_id, 0); > + /* Clear line side TX statistics counters */ > + ipn3ke_xmac_tx_clr_10G_stcs(hw, rpst->port_id, 0); >=20 > - /* Clear all RX statistics counters */ > - ipn3ke_xmac_rx_clr_stcs(hw, rpst->port_id, 0); > + /* Clear line side RX statistics counters */ > + ipn3ke_xmac_rx_clr_10G_stcs(hw, rpst->port_id, 0); > + > + /* Clear NIC side TX statistics counters */ > + ipn3ke_xmac_tx_clr_10G_stcs(hw, rpst->port_id, 1); > + > + /* Clear NIC side RX statistics counters */ > + ipn3ke_xmac_rx_clr_10G_stcs(hw, rpst->port_id, 1); > + } else if (hw->retimer.mac_type =3D=3D > + > IFPGA_RAWDEV_RETIMER_MAC_TYPE_25GE_25GAUI) { > + /* Clear line side TX statistics counters */ > + ipn3ke_xmac_tx_clr_25G_stcs(hw, rpst->port_id, 0); > + > + /* Clear line side RX statistics counters */ > + ipn3ke_xmac_rx_clr_25G_stcs(hw, rpst->port_id, 0); > + > + /* Clear NIC side TX statistics counters */ > + ipn3ke_xmac_tx_clr_25G_stcs(hw, rpst->port_id, 1); > + > + /* Clear NIC side RX statistics counters */ > + ipn3ke_xmac_rx_clr_25G_stcs(hw, rpst->port_id, 1); > } >=20 > ipn3ke_rpst_link_update(dev, 0); > -- > 1.8.3.1 Acked-by: Rosen Xu