From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CDAADA04C5; Sat, 5 Sep 2020 05:00:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BFD681C129; Sat, 5 Sep 2020 04:59:56 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 3BE901C0CD for ; Sat, 5 Sep 2020 04:59:54 +0200 (CEST) IronPort-SDR: OdLNMaqjhjDtsSZ8vF8x0N8wUdKQZT2vUUcajcFUS/QeRV+s5O0ut9HJBVeuGMkRdD2lRd5KTp qQHSdyj11ZcA== X-IronPort-AV: E=McAfee;i="6000,8403,9734"; a="137886698" X-IronPort-AV: E=Sophos;i="5.76,392,1592895600"; d="scan'208";a="137886698" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Sep 2020 19:59:53 -0700 IronPort-SDR: zv0ndZnJcsn20Gjwd+xqGRLp1dIvKG+wVd+uJMBAdBCKO6MMPKgwIiUipwo070oWzw2Spo8ozj /JltNY6Nw/uw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,392,1592895600"; d="scan'208";a="406052739" Received: from unknown (HELO localhost.localdomain) ([10.239.255.52]) by fmsmga001.fm.intel.com with ESMTP; 04 Sep 2020 19:59:52 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Beilei Xing , Qi Zhang , Qiming Yang , Guinan Sun , Dawid Lukwinski Date: Sat, 5 Sep 2020 02:49:36 +0000 Message-Id: <20200905024938.14609-8-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200905024938.14609-1-guinanx.sun@intel.com> References: <20200905024938.14609-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH 7/9] net/i40e/base: add EEE LPI status check for X722 adapters 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" Add reading LPI (low power idle) status for supported X722 devices. If adapter's PHY supports EEE in current mode (device ID + link speed), LPI status is read from PHY Clause 45 PCS status register. Signed-off-by: Dawid Lukwinski Signed-off-by: Guinan Sun --- drivers/net/i40e/base/i40e_common.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c index cd8b27e40..073634278 100644 --- a/drivers/net/i40e/base/i40e_common.c +++ b/drivers/net/i40e/base/i40e_common.c @@ -7098,15 +7098,23 @@ enum i40e_status_code i40e_get_phy_lpi_status(struct i40e_hw *hw, struct i40e_hw_port_stats *stat) { enum i40e_status_code ret = I40E_SUCCESS; + bool eee_mrvl_phy; + bool eee_bcm_phy; u32 val; stat->rx_lpi_status = 0; stat->tx_lpi_status = 0; - if ((hw->device_id == I40E_DEV_ID_10G_BASE_T_BC || - hw->device_id == I40E_DEV_ID_5G_BASE_T_BC) && - (hw->phy.link_info.link_speed == I40E_LINK_SPEED_2_5GB || - hw->phy.link_info.link_speed == I40E_LINK_SPEED_5GB)) { + eee_bcm_phy = + (hw->device_id == I40E_DEV_ID_10G_BASE_T_BC || + hw->device_id == I40E_DEV_ID_5G_BASE_T_BC) && + (hw->phy.link_info.link_speed == I40E_LINK_SPEED_2_5GB || + hw->phy.link_info.link_speed == I40E_LINK_SPEED_5GB); + eee_mrvl_phy = + hw->device_id == I40E_DEV_ID_1G_BASE_T_X722; + + if (eee_bcm_phy || eee_mrvl_phy) { + // read Clause 45 PCS Status 1 register ret = i40e_aq_get_phy_register(hw, I40E_AQ_PHY_REG_ACCESS_EXTERNAL, I40E_BCM_PHY_PCS_STATUS1_PAGE, -- 2.17.1