From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5F88E45895; Thu, 29 Aug 2024 11:01:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4BC5742DA7; Thu, 29 Aug 2024 11:00:39 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) by mails.dpdk.org (Postfix) with ESMTP id 8669042D2B for ; Thu, 29 Aug 2024 11:00:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724922035; x=1756458035; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=Yef30BhyLW1W4JtiYuCjxka3JmwjfDG5aKC6CfAMyJg=; b=E/jLc0AW8tAlckYr+YjPH6GFEaEMbdRj6ZhQxIw8/7OUHUWuYL6OUQdk OwxwKaA2iMx4x9lu07UJNZqXFzg+7krFPjRFcJ8Ur3Iac9iPfwrCXVql4 BJzMrzogfeLt7sGUy/Bs2wQtc6xrfYdgZ49jwjfo7nP3PaFankvJcT9XK QWO9ke+ACrjoBk5jqD0FawphO2o4dy4Qe0elSlQx0agW+/vSh358Xbg9W pB8T508946J3iUOlFg0c6BN0u7idV7IR8lORTxlWamjikgCRU5lKgv7w+ 0X0KVUbIIOQjWOeT48taWVwjoiwsTdZXtAq3Jxwq6cwpcxstTNwKwtFPv Q==; X-CSE-ConnectionGUID: 02HMBz6KQ/y/HtXRMuMMGA== X-CSE-MsgGUID: 4jr8GYDHSsCL7WLtWKfdjw== X-IronPort-AV: E=McAfee;i="6700,10204,11178"; a="23663444" X-IronPort-AV: E=Sophos;i="6.10,185,1719903600"; d="scan'208";a="23663444" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2024 02:00:34 -0700 X-CSE-ConnectionGUID: 3RbSn7dFQomu9KwezcAdPw== X-CSE-MsgGUID: jYppGFViRES8tZ1gP06a2g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,185,1719903600"; d="scan'208";a="64202946" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by orviesa008.jf.intel.com with ESMTP; 29 Aug 2024 02:00:33 -0700 From: Anatoly Burakov To: dev@dpdk.org Subject: [PATCH v1 07/15] net/ixgbe/base: fix media type handling for E610 Date: Thu, 29 Aug 2024 10:00:12 +0100 Message-ID: X-Mailer: git-send-email 2.43.5 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Krzysztof Galazka Media type information should not be updated by ixgbe_aci_get_link_info function because it will be incorrectly set as unknown when link is down. Do it only in ixgbe_get_media_type_E610. Signed-off-by: Krzysztof Galazka Signed-off-by: Anatoly Burakov --- drivers/net/ixgbe/base/ixgbe_e610.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/ixgbe/base/ixgbe_e610.c b/drivers/net/ixgbe/base/ixgbe_e610.c index 1f3a4532da..b9b1ba32c3 100644 --- a/drivers/net/ixgbe/base/ixgbe_e610.c +++ b/drivers/net/ixgbe/base/ixgbe_e610.c @@ -1683,7 +1683,6 @@ s32 ixgbe_aci_get_link_info(struct ixgbe_hw *hw, bool ena_lse, struct ixgbe_aci_cmd_get_link_status *resp; struct ixgbe_link_status *li_old, *li; struct ixgbe_fc_info *hw_fc_info; - enum ixgbe_media_type *hw_media_type; struct ixgbe_aci_desc desc; bool tx_pause, rx_pause; u8 cmd_flags; @@ -1693,7 +1692,6 @@ s32 ixgbe_aci_get_link_info(struct ixgbe_hw *hw, bool ena_lse, return IXGBE_ERR_PARAM; li_old = &hw->link.link_info_old; - hw_media_type = &hw->phy.media_type; li = &hw->link.link_info; hw_fc_info = &hw->fc; @@ -1714,7 +1712,6 @@ s32 ixgbe_aci_get_link_info(struct ixgbe_hw *hw, bool ena_lse, li->link_speed = IXGBE_LE16_TO_CPU(link_data.link_speed); li->phy_type_low = IXGBE_LE64_TO_CPU(link_data.phy_type_low); li->phy_type_high = IXGBE_LE64_TO_CPU(link_data.phy_type_high); - *hw_media_type = ixgbe_get_media_type_from_phy_type(hw); li->link_info = link_data.link_info; li->link_cfg_err = link_data.link_cfg_err; li->an_info = link_data.an_info; @@ -3664,10 +3661,11 @@ enum ixgbe_media_type ixgbe_get_media_type_E610(struct ixgbe_hw *hw) } } - /* Based on search above try to discover media type */ - hw->phy.media_type = ixgbe_get_media_type_from_phy_type(hw); } + /* Based on link status or search above try to discover media type */ + hw->phy.media_type = ixgbe_get_media_type_from_phy_type(hw); + return hw->phy.media_type; } -- 2.43.5