From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1FE2FF8867 for ; Wed, 29 Apr 2026 10:27:58 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3842140B99; Wed, 29 Apr 2026 12:27:03 +0200 (CEST) Received: from smtpbgbr1.qq.com (smtpbgbr1.qq.com [54.207.19.206]) by mails.dpdk.org (Postfix) with ESMTP id C6A5640661; Wed, 29 Apr 2026 12:26:49 +0200 (CEST) X-QQ-mid: esmtpgz10t1777458406tca99dbba X-QQ-Originating-IP: a0f2XCdakGbTfPfse1oYs8R3Xq3thGmGIYI3FGpIZPo= Received: from DSK-zaiyuwang.trustnetic.com ( [36.24.191.108]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 29 Apr 2026 18:26:44 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 1789250619230630237 EX-QQ-RecipientCnt: 4 From: Zaiyu Wang To: dev@dpdk.org Cc: Zaiyu Wang , stable@dpdk.org, Jiawen Wu Subject: [PATCH v2 15/20] net/txgbe: fix FEC mode configuration on 25G NIC Date: Wed, 29 Apr 2026 18:25:09 +0800 Message-Id: <20260429102515.58880-16-zaiyuwang@trustnetic.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20260429102515.58880-1-zaiyuwang@trustnetic.com> References: <20260423034024.14404-1-zaiyuwang@trustnetic.com> <20260429102515.58880-1-zaiyuwang@trustnetic.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: esmtpgz:trustnetic.com:qybglogicsvrsz:qybglogicsvrsz3b-0 X-QQ-XMAILINFO: MrY0q4FYDxnuyy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ucGG0bXE6HnBlGpLglvFnYWaqFuqZa/nKOdG+y+vI1HfFEUz g5RIe+6hlzdLdZckbi6I5U= X-QQ-XMRINFO: MPJ6Tf5t3I/ylTmHUqvI8+Wpn+Gzalws3A== X-QQ-RECHKSPAM: 0 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 The 25G NIC offers off, RS, Base-R, and auto FEC modes. When reconfiguring the PHY, the FEC mode must match on both sides; otherwise, the link cannot come up. The current driver fails to maintain this requirement, causing link instability. Add proper FEC mode handling during PHY reconfiguration to guarantee link establishment. Fixes: fb6eb170dfa2 ("net/txgbe: add basic link configuration for Amber-Lite") Cc: stable@dpdk.org Signed-off-by: Zaiyu Wang --- drivers/net/txgbe/base/txgbe_aml.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/txgbe/base/txgbe_aml.c b/drivers/net/txgbe/base/txgbe_aml.c index 5cc8741f10..72a894c4ae 100644 --- a/drivers/net/txgbe/base/txgbe_aml.c +++ b/drivers/net/txgbe/base/txgbe_aml.c @@ -282,6 +282,14 @@ s32 txgbe_setup_phy_link_aml(struct txgbe_hw *hw, !(hw->fec_mode & hw->cur_fec_link))) goto out; + if (speed == TXGBE_LINK_SPEED_25GB_FULL && + link_speed == TXGBE_LINK_SPEED_25GB_FULL) { + txgbe_e56_fec_polling(hw, &link_up); + + if (link_up) + goto out; + } + rte_spinlock_lock(&hw->phy_lock); ret_status = txgbe_set_link_to_amlite(hw, speed); rte_spinlock_unlock(&hw->phy_lock); @@ -360,7 +368,10 @@ static s32 txgbe_setup_mac_link_multispeed_fiber_aml(struct txgbe_hw *hw, /* If we already have link at this speed, just jump out */ txgbe_e56_check_phy_link(hw, &link_speed, &link_up); - if (link_speed == TXGBE_LINK_SPEED_25GB_FULL && link_up) + hw->cur_fec_link = txgbe_phy_fec_get(hw); + + if (link_speed == TXGBE_LINK_SPEED_25GB_FULL && link_up && + hw->fec_mode & hw->cur_fec_link) goto out; /* Allow module to change analog characteristics (10G -> 25G) */ -- 2.21.0.windows.1