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 2F5A0A04B5; Mon, 2 Dec 2019 09:01:11 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E50CE1BFD1; Mon, 2 Dec 2019 08:58:28 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 9F5241BFB5 for ; Mon, 2 Dec 2019 08:58:21 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Dec 2019 23:58:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,268,1571727600"; d="scan'208";a="207993443" Received: from dpdk_yexl_af_xdp.sh.intel.com ([10.67.119.186]) by fmsmga008.fm.intel.com with ESMTP; 01 Dec 2019 23:58:20 -0800 From: Xiaolong Ye To: Beilei Xing , Qi Zhang Cc: dev@dpdk.org, Xiaolong Ye , Krzysztof Galazka Date: Mon, 2 Dec 2019 15:48:47 +0800 Message-Id: <20191202074935.97629-22-xiaolong.ye@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191202074935.97629-1-xiaolong.ye@intel.com> References: <20191202074935.97629-1-xiaolong.ye@intel.com> Subject: [dpdk-dev] [PATCH 21/69] net/i40e/base: change reading LPI state 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" Special method of reading LPI state from BCM PHY has to be used only when 2.5 or 5G speed is used. For other speeds the state should be read from MAC register as on other devices. Signed-off-by: Krzysztof Galazka Reviewed-by: Pietruszewski Piotr Reviewed-by: Aleksandr Loktionov Reviewed-by: Joyner Eric Reviewed-by: Kirsher Jeffrey T Signed-off-by: Xiaolong Ye --- drivers/net/i40e/base/i40e_common.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c index 51ab0c4b8..02187da24 100644 --- a/drivers/net/i40e/base/i40e_common.c +++ b/drivers/net/i40e/base/i40e_common.c @@ -7049,24 +7049,26 @@ enum i40e_status_code i40e_led_set_phy(struct i40e_hw *hw, bool on, #ifdef CARLSVILLE_HW /** - * i40e_get_phy_lpi_status - read LPI status from external PHY or MAC + * i40e_get_phy_lpi_status - read LPI status from PHY or MAC register * @hw: pointer to the hw struct * @stat: pointer to structure with status of rx and tx lpi * - * Read LPI state directly from external PHY or MAC, depending on device ID. + * Read LPI state directly from external PHY register or from MAC + * register, depending on device ID and current link speed. */ #else /** - * i40e_get_phy_lpi_status - read LPI status from MAC + * i40e_get_phy_lpi_status - read LPI status using MAC register * @hw: pointer to the hw struct * @stat: pointer to structure with status of rx and tx lpi * - * Read LPI state directly from MAC. + * Read LPI state from MAC register. */ #endif #ifndef EXTERNAL_RELEASE /* * Implemented for Broadcom Orca PHY used in Carlsville. + * It requires special handling when 2.5 or 5G speed is used. * Refer to FVL DCR335 for details. */ #endif @@ -7080,7 +7082,9 @@ enum i40e_status_code i40e_get_phy_lpi_status(struct i40e_hw *hw, stat->tx_lpi_status = 0; #ifdef CARLSVILLE_HW - if (hw->device_id == I40E_DEV_ID_10G_BASE_T_BC) { + if (hw->device_id == I40E_DEV_ID_10G_BASE_T_BC && + (hw->phy.link_info.link_speed == I40E_LINK_SPEED_2_5GB || + hw->phy.link_info.link_speed == I40E_LINK_SPEED_5GB)) { #ifndef EXTERNAL_RELEASE /* For accessing LPI status in Broadcom PHY we're using AQ command only. * Broadcom PHY supports API >= 1.7, so there is no need for supporting -- 2.17.1