From patchwork Tue Jun 11 09:48:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Pei, Andy" X-Patchwork-Id: 54650 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D64FE1C37F; Tue, 11 Jun 2019 11:55:12 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 98B471C2F8 for ; Tue, 11 Jun 2019 11:55:05 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Jun 2019 02:55:05 -0700 X-ExtLoop1: 1 Received: from dipei-st-npg.sh.intel.com ([10.67.110.220]) by FMSMGA003.fm.intel.com with ESMTP; 11 Jun 2019 02:55:04 -0700 From: Andy Pei To: dev@dpdk.org Cc: andy.pei@intel.com, rosen.xu@intel.com Date: Tue, 11 Jun 2019 17:48:45 +0800 Message-Id: <1560246526-264797-3-git-send-email-andy.pei@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1560246526-264797-1-git-send-email-andy.pei@intel.com> References: <1559543493-215042-2-git-send-email-andy.pei@intel.com> <1560246526-264797-1-git-send-email-andy.pei@intel.com> Subject: [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" clear line side and NIC side statistics registers when HW init and uinit, and when dev start. Fixes: c01c748e4ae6 ("net/ipn3ke: add new driver") Cc: rosen.xu@intel.com Signed-off-by: Andy Pei Acked-by: Rosen Xu --- drivers/net/ipn3ke/ipn3ke_ethdev.c | 59 ++++++++++++++++++++++++++++----- drivers/net/ipn3ke/ipn3ke_representor.c | 27 ++++++++++++--- 2 files changed, 74 insertions(+), 12 deletions(-) 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); - /* 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 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 == + IFPGA_RAWDEV_RETIMER_MAC_TYPE_25GE_25GAUI) { + /* Enable inter connect channel */ + for (i = 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); } } @@ -291,11 +313,32 @@ /* Disable the RX path */ ipn3ke_xmac_rx_disable(hw, i, 1); - /* 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 == + IFPGA_RAWDEV_RETIMER_MAC_TYPE_25GE_25GAUI) { + for (i = 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 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); - /* 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); - /* 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 == + 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); } ipn3ke_rpst_link_update(dev, 0);