DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Zaiyu Wang <zaiyuwang@trustnetic.com>
To: dev@dpdk.org
Cc: Zaiyu Wang <zaiyuwang@trustnetic.com>,
	stable@dpdk.org, Jiawen Wu <jiawenwu@trustnetic.com>
Subject: [PATCH v5 01/15] net/txgbe: fix failure to configure 10G on dual-speed DAC
Date: Tue, 29 Sep 2026 19:18:01 +0800	[thread overview]
Message-ID: <C08CC1B0DBD3B009+20260929112119.4516-2-zaiyuwang@trustnetic.com> (raw)
In-Reply-To: <20260929112119.4516-1-zaiyuwang@trustnetic.com>

Setting "port config speed 10000" on a 10G/40G dual-speed DAC cable
fails with LINK_SETUP_ERR, and the AN base page always advertises
only 40G.

Two checks independently blocked 10G:

1. allowed_speeds in dev_start was restricted to 40G, so the user
   request was rejected before reaching setup_link.
2. get_link_capabilities_aml40() returned only 40G for all DAC
   cables, so the link_capabilities mask in setup_phy_link_aml40()
   stripped any 10G bit from the caller speed.

Remove both restrictions so 10G flows through from user
configuration to the AN base page advertisement. On DAC cables the
capability is read from hw->phy.fiber_suppport_speed, which reflects
the actual SFP module.

Fixes: fb6eb170dfa2 ("net/txgbe: add basic link configuration for Amber-Lite")
Cc: stable@dpdk.org

Signed-off-by: Zaiyu Wang <zaiyuwang@trustnetic.com>
---
 drivers/net/txgbe/base/txgbe_aml40.c | 15 +++++++++++----
 drivers/net/txgbe/txgbe_ethdev.c     |  2 +-
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/net/txgbe/base/txgbe_aml40.c b/drivers/net/txgbe/base/txgbe_aml40.c
index 1098efe5e6..7c72b53f64 100644
--- a/drivers/net/txgbe/base/txgbe_aml40.c
+++ b/drivers/net/txgbe/base/txgbe_aml40.c
@@ -98,11 +98,12 @@ s32 txgbe_get_link_capabilities_aml40(struct txgbe_hw *hw,
 {
 	if (hw->phy.sfp_type == txgbe_qsfp_type_40g_cu_core0 ||
 	    hw->phy.sfp_type == txgbe_qsfp_type_40g_cu_core1) {
-		*speed = TXGBE_LINK_SPEED_40GB_FULL;
-		*autoneg = true;
+		*speed = hw->phy.fiber_suppport_speed;
+		*autoneg = hw->devarg.auto_neg;
 	} else if (txgbe_is_backplane(hw)) {
-		*speed = TXGBE_LINK_SPEED_40GB_FULL;
-		*autoneg = true;
+		*speed = TXGBE_LINK_SPEED_40GB_FULL |
+			 TXGBE_LINK_SPEED_10GB_FULL;
+		*autoneg = hw->devarg.auto_neg;
 	} else {
 		/*
 		 * Temporary workaround: set speed to 40G even if sfp not present
@@ -176,6 +177,12 @@ s32 txgbe_setup_phy_link_aml40(struct txgbe_hw *hw,
 		return status;
 	}
 
+	/* setup the highest link when no autoneg */
+	if (speed & TXGBE_LINK_SPEED_40GB_FULL)
+		speed = TXGBE_LINK_SPEED_40GB_FULL;
+	else if (speed & TXGBE_LINK_SPEED_10GB_FULL)
+		speed = TXGBE_LINK_SPEED_10GB_FULL;
+
 	if (txgbe_is_backplane(hw) || txgbe_is_dac_cable(hw) ||
 	    hw->phy.ffe_set) {
 		rte_spinlock_lock(&hw->phy_lock);
diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
index 4d2746371b..bc2e11e801 100644
--- a/drivers/net/txgbe/txgbe_ethdev.c
+++ b/drivers/net/txgbe/txgbe_ethdev.c
@@ -1896,7 +1896,7 @@ txgbe_dev_start(struct rte_eth_dev *dev)
 		goto error;
 
 	if (hw->mac.type == txgbe_mac_aml40)
-		allowed_speeds = RTE_ETH_LINK_SPEED_40G;
+		allowed_speeds = RTE_ETH_LINK_SPEED_10G | RTE_ETH_LINK_SPEED_40G;
 	else if (hw->mac.type == txgbe_mac_aml)
 		allowed_speeds = RTE_ETH_LINK_SPEED_10G | RTE_ETH_LINK_SPEED_25G;
 	else
-- 
2.55.0.windows.2


  parent reply	other threads:[~2026-09-29 11:22 UTC|newest]

Thread overview: 116+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260827114309.10530-1-zaiyuwang@trustnetic.com>
2026-08-27 11:41 ` [PATCH 01/13] net/txgbe: fix e56 PHY configuration error Zaiyu Wang
2026-08-27 11:41 ` [PATCH 02/13] net/txgbe: fix incorrect link state in 10G forced mode Zaiyu Wang
2026-08-27 11:41 ` [PATCH 03/13] net/txgbe: do not force reconfig on link retry Zaiyu Wang
2026-08-27 11:41 ` [PATCH 04/13] net/txgbe: set i2c sda hold time Zaiyu Wang
2026-08-27 11:41 ` [PATCH 05/13] net/txgbe: fix link speed display info for 10G mode Zaiyu Wang
2026-08-27 11:41 ` [PATCH 06/13] net/txgbe: remove stale outer UDP checksum offload flag Zaiyu Wang
2026-08-27 11:41 ` [PATCH 07/13] net/txgbe: add offload support for tunnel type UDP Zaiyu Wang
2026-08-27 11:42 ` [PATCH 08/13] net/txgbe: fix SFP hot-plug when auto-negotiation is on Zaiyu Wang
2026-08-27 11:42 ` [PATCH 09/13] net/txgbe: fix DAC hot-plug on 40G NIC with auto-negotiation Zaiyu Wang
2026-08-27 11:42 ` [PATCH 10/13] net/txgbe: add backplane FFE and capability devargs Zaiyu Wang
2026-08-27 11:42 ` [PATCH 11/13] net/txgbe: add devarg to turn off Tx laser for 40G NIC Zaiyu Wang
2026-08-27 11:42 ` [PATCH 12/13] net/txgbe: fix CR/KR link training and recovery Zaiyu Wang
2026-08-27 11:42 ` [PATCH 13/13] net/txgbe: align link capabilities and DAC classification Zaiyu Wang
2026-09-08 12:38 ` [PATCH v2 00/15] Wangxun fixes and new features Zaiyu Wang
     [not found] ` <20260908124047.2284-1-zaiyuwang@trustnetic.com>
2026-09-08 12:38   ` [PATCH v2 01/15] net/txgbe: fix failure to configure 10G on dual-speed DAC Zaiyu Wang
2026-09-08 12:38   ` [PATCH v2 02/15] net/txgbe: fix e56 PHY configuration error Zaiyu Wang
2026-09-08 12:38   ` [PATCH v2 03/15] net/txgbe: fix incorrect link state in 10G forced mode Zaiyu Wang
2026-09-08 12:38   ` [PATCH v2 04/15] net/txgbe: do not force reconfig on link retry Zaiyu Wang
2026-09-08 12:38   ` [PATCH v2 05/15] net/txgbe: set i2c sda hold time Zaiyu Wang
2026-09-08 12:38   ` [PATCH v2 06/15] net/txgbe: fix link speed display info for 10G mode Zaiyu Wang
2026-09-08 12:38   ` [PATCH v2 07/15] net/txgbe: remove stale outer UDP checksum offload flag Zaiyu Wang
2026-09-08 12:38   ` [PATCH v2 08/15] net/txgbe: add offload support for tunnel type UDP Zaiyu Wang
2026-09-08 12:38   ` [PATCH v2 09/15] net/txgbe: fix SFP hot-plug when auto-negotiation is on Zaiyu Wang
2026-09-08 12:38   ` [PATCH v2 10/15] net/txgbe: fix DAC hot-plug on 40G NIC with auto-negotiation Zaiyu Wang
2026-09-08 12:38   ` [PATCH v2 11/15] net/txgbe: fix 40G FFE tuning applied to first lane only Zaiyu Wang
2026-09-08 12:38   ` [PATCH v2 12/15] net/txgbe: add pre2 and backplane capability devargs Zaiyu Wang
2026-09-08 12:38   ` [PATCH v2 13/15] net/txgbe: add devarg to turn off Tx laser for 40G NIC Zaiyu Wang
2026-09-08 12:38   ` [PATCH v2 14/15] net/txgbe: fix CR/KR link training and recovery Zaiyu Wang
2026-09-08 12:39   ` [PATCH v2 15/15] net/txgbe: align link capabilities and DAC classification Zaiyu Wang
2026-09-08 13:25 ` [PATCH v3 00/15] Wangxun fixes and new features Zaiyu Wang
2026-09-08 14:20   ` Stephen Hemminger
     [not found] ` <20260908132742.2661-1-zaiyuwang@trustnetic.com>
2026-09-08 13:25   ` [PATCH v3 01/15] net/txgbe: fix failure to configure 10G on dual-speed DAC Zaiyu Wang
2026-09-08 13:25   ` [PATCH v3 02/15] net/txgbe: fix e56 PHY configuration error Zaiyu Wang
2026-09-08 13:25   ` [PATCH v3 03/15] net/txgbe: fix incorrect link state in 10G forced mode Zaiyu Wang
2026-09-08 13:25   ` [PATCH v3 04/15] net/txgbe: do not force reconfig on link retry Zaiyu Wang
2026-09-08 13:25   ` [PATCH v3 05/15] net/txgbe: set i2c sda hold time Zaiyu Wang
2026-09-08 13:25   ` [PATCH v3 06/15] net/txgbe: fix link speed display info for 10G mode Zaiyu Wang
2026-09-08 13:25   ` [PATCH v3 07/15] net/txgbe: remove stale outer UDP checksum offload flag Zaiyu Wang
2026-09-08 13:25   ` [PATCH v3 08/15] net/txgbe: add offload support for tunnel type UDP Zaiyu Wang
2026-09-08 13:25   ` [PATCH v3 09/15] net/txgbe: fix SFP hot-plug when auto-negotiation is on Zaiyu Wang
2026-09-08 13:25   ` [PATCH v3 10/15] net/txgbe: fix DAC hot-plug on 40G NIC with auto-negotiation Zaiyu Wang
2026-09-08 13:25   ` [PATCH v3 11/15] net/txgbe: fix 40G FFE tuning applied to first lane only Zaiyu Wang
2026-09-08 13:25   ` [PATCH v3 12/15] net/txgbe: add pre2 and backplane capability devargs Zaiyu Wang
2026-09-08 13:25   ` [PATCH v3 13/15] net/txgbe: add devarg to turn off Tx laser for 40G NIC Zaiyu Wang
2026-09-08 13:25   ` [PATCH v3 14/15] net/txgbe: fix CR/KR link training and recovery Zaiyu Wang
2026-09-08 13:26   ` [PATCH v3 15/15] net/txgbe: align link capabilities and DAC classification Zaiyu Wang
2026-09-22 12:37 ` [PATCH v4 00/16] Wangxun fixes and new features Zaiyu Wang
2026-09-22 13:35   ` Stephen Hemminger
2026-09-29 11:21     ` Zaiyu Wang
     [not found] ` <20260922125414.3638-1-zaiyuwang@trustnetic.com>
2026-09-22 12:37   ` [PATCH v4 01/16] net/txgbe: fix failure to configure 10G on dual-speed DAC Zaiyu Wang
2026-09-22 12:37   ` [PATCH v4 02/16] net/txgbe: use the requested speed in E56 AN setup Zaiyu Wang
2026-09-22 12:37   ` [PATCH v4 03/16] net/txgbe: fix e56 PHY configuration error Zaiyu Wang
2026-09-22 12:37   ` [PATCH v4 04/16] net/txgbe: fix incorrect link state in 10G forced mode Zaiyu Wang
2026-09-22 12:37   ` [PATCH v4 05/16] net/txgbe: do not force reconfig on link retry Zaiyu Wang
2026-09-22 12:37   ` [PATCH v4 06/16] net/txgbe: set i2c sda hold time Zaiyu Wang
2026-09-22 12:37   ` [PATCH v4 07/16] net/txgbe: fix link speed display info for 10G mode Zaiyu Wang
2026-09-22 12:37   ` [PATCH v4 08/16] net/txgbe: remove stale outer UDP checksum offload flag Zaiyu Wang
2026-09-22 12:37   ` [PATCH v4 09/16] net/txgbe: add offload support for tunnel type UDP Zaiyu Wang
2026-09-22 12:37   ` [PATCH v4 10/16] net/txgbe: fix SFP hot-plug when auto-negotiation is on Zaiyu Wang
2026-09-22 12:37   ` [PATCH v4 11/16] net/txgbe: fix DAC hot-plug on 40G NIC with auto-negotiation Zaiyu Wang
2026-09-22 12:37   ` [PATCH v4 12/16] net/txgbe: fix 40G FFE tuning applied to first lane only Zaiyu Wang
2026-09-22 12:37   ` [PATCH v4 13/16] net/txgbe: fix unset pre2 FFE tap and backplane capability Zaiyu Wang
2026-09-22 12:37   ` [PATCH v4 14/16] net/txgbe: add devarg to turn off Tx laser for 40G NIC Zaiyu Wang
2026-09-22 12:37   ` [PATCH v4 15/16] net/txgbe: fix CR/KR link training and recovery Zaiyu Wang
2026-09-22 12:37   ` [PATCH v4 16/16] net/txgbe: align link capabilities and DAC classification Zaiyu Wang
2026-09-29 11:18 ` [PATCH v5 00/15] Wangxun fixes and new features Zaiyu Wang
     [not found] ` <20260929112119.4516-1-zaiyuwang@trustnetic.com>
2026-09-29 11:18   ` Zaiyu Wang [this message]
2026-09-29 11:18   ` [PATCH v5 02/15] net/txgbe: use the requested speed in E56 AN setup Zaiyu Wang
2026-09-29 11:18   ` [PATCH v5 03/15] net/txgbe: fix e56 PHY configuration error Zaiyu Wang
2026-09-29 11:18   ` [PATCH v5 04/15] net/txgbe: fix incorrect link state in 10G forced mode Zaiyu Wang
2026-09-29 11:18   ` [PATCH v5 05/15] net/txgbe: do not force reconfig on link retry Zaiyu Wang
2026-09-29 11:18   ` [PATCH v5 06/15] net/txgbe: set i2c sda hold time Zaiyu Wang
2026-09-29 11:18   ` [PATCH v5 07/15] net/txgbe: fix link speed display info for 10G mode Zaiyu Wang
2026-09-29 11:18   ` [PATCH v5 08/15] net/txgbe: remove stale outer UDP checksum offload flag Zaiyu Wang
2026-09-29 11:18   ` [PATCH v5 09/15] net/txgbe: fix SFP hot-plug when auto-negotiation is on Zaiyu Wang
2026-09-29 11:18   ` [PATCH v5 10/15] net/txgbe: fix DAC hot-plug on 40G NIC with auto-negotiation Zaiyu Wang
2026-09-29 11:18   ` [PATCH v5 11/15] net/txgbe: fix 40G FFE tuning applied to first lane only Zaiyu Wang
2026-09-29 11:18   ` [PATCH v5 12/15] net/txgbe: add pre2 FFE tap and backplane capability devargs Zaiyu Wang
2026-09-29 11:18   ` [PATCH v5 13/15] net/txgbe: add devarg to turn off Tx laser for 40G NIC Zaiyu Wang
2026-09-29 11:18   ` [PATCH v5 14/15] net/txgbe: fix CR/KR link training and recovery Zaiyu Wang
2026-09-29 11:18   ` [PATCH v5 15/15] net/txgbe: align link capabilities and DAC classification Zaiyu Wang
2026-09-29 13:04 ` [PATCH v6 00/15] Wangxun fixes and new features Zaiyu Wang
2026-09-29 16:05   ` Stephen Hemminger
2026-09-30 10:22     ` Zaiyu Wang
     [not found] ` <20260929130611.4871-1-zaiyuwang@trustnetic.com>
2026-09-29 13:04   ` [PATCH v6 01/15] net/txgbe: fix failure to configure 10G on dual-speed DAC Zaiyu Wang
2026-09-29 13:04   ` [PATCH v6 02/15] net/txgbe: use the requested speed in E56 AN setup Zaiyu Wang
2026-09-29 13:04   ` [PATCH v6 03/15] net/txgbe: fix e56 PHY configuration error Zaiyu Wang
2026-09-29 13:04   ` [PATCH v6 04/15] net/txgbe: fix incorrect link state in 10G forced mode Zaiyu Wang
2026-09-29 13:04   ` [PATCH v6 05/15] net/txgbe: do not force reconfig on link retry Zaiyu Wang
2026-09-29 13:04   ` [PATCH v6 06/15] net/txgbe: set i2c sda hold time Zaiyu Wang
2026-09-29 13:04   ` [PATCH v6 07/15] net/txgbe: fix link speed display info for 10G mode Zaiyu Wang
2026-09-29 13:04   ` [PATCH v6 08/15] net/txgbe: remove stale outer UDP checksum offload flag Zaiyu Wang
2026-09-29 13:04   ` [PATCH v6 09/15] net/txgbe: fix SFP hot-plug when auto-negotiation is on Zaiyu Wang
2026-09-29 13:04   ` [PATCH v6 10/15] net/txgbe: fix DAC hot-plug on 40G NIC with auto-negotiation Zaiyu Wang
2026-09-29 13:04   ` [PATCH v6 11/15] net/txgbe: fix 40G FFE tuning applied to first lane only Zaiyu Wang
2026-09-29 13:04   ` [PATCH v6 12/15] net/txgbe: add pre2 FFE tap and backplane capability devargs Zaiyu Wang
2026-09-29 13:04   ` [PATCH v6 13/15] net/txgbe: add devarg to turn off Tx laser for 40G NIC Zaiyu Wang
2026-09-29 13:04   ` [PATCH v6 14/15] net/txgbe: fix CR/KR link training and recovery Zaiyu Wang
2026-09-29 13:04   ` [PATCH v6 15/15] net/txgbe: align link capabilities and DAC classification Zaiyu Wang
2026-09-30 10:17 ` [PATCH v7 00/15] Wangxun fixes and new features Zaiyu Wang
2026-09-30 16:18   ` Stephen Hemminger
     [not found] ` <20260930102042.2214-1-zaiyuwang@trustnetic.com>
2026-09-30 10:17   ` [PATCH v7 01/15] net/txgbe: fix failure to configure 10G on dual-speed DAC Zaiyu Wang
2026-09-30 10:17   ` [PATCH v7 02/15] net/txgbe: use the requested speed in E56 AN setup Zaiyu Wang
2026-09-30 10:17   ` [PATCH v7 03/15] net/txgbe: fix e56 PHY configuration error Zaiyu Wang
2026-09-30 10:17   ` [PATCH v7 04/15] net/txgbe: fix incorrect link state in 10G forced mode Zaiyu Wang
2026-09-30 10:17   ` [PATCH v7 05/15] net/txgbe: do not force reconfig on link retry Zaiyu Wang
2026-09-30 10:17   ` [PATCH v7 06/15] net/txgbe: set i2c sda hold time Zaiyu Wang
2026-09-30 10:17   ` [PATCH v7 07/15] net/txgbe: fix link speed display info for 10G mode Zaiyu Wang
2026-09-30 10:17   ` [PATCH v7 08/15] net/txgbe: remove stale outer UDP checksum offload flag Zaiyu Wang
2026-09-30 10:17   ` [PATCH v7 09/15] net/txgbe: fix SFP hot-plug when auto-negotiation is on Zaiyu Wang
2026-09-30 10:17   ` [PATCH v7 10/15] net/txgbe: fix DAC hot-plug on 40G NIC with auto-negotiation Zaiyu Wang
2026-09-30 10:17   ` [PATCH v7 11/15] net/txgbe: fix 40G FFE tuning applied to first lane only Zaiyu Wang
2026-09-30 10:17   ` [PATCH v7 12/15] net/txgbe: add pre2 FFE tap and backplane capability devargs Zaiyu Wang
2026-09-30 10:18   ` [PATCH v7 13/15] net/txgbe: add devarg to turn off Tx laser for 40G NIC Zaiyu Wang
2026-09-30 10:18   ` [PATCH v7 14/15] net/txgbe: fix CR/KR link training and recovery Zaiyu Wang
2026-09-30 10:18   ` [PATCH v7 15/15] net/txgbe: align link capabilities and DAC classification Zaiyu Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C08CC1B0DBD3B009+20260929112119.4516-2-zaiyuwang@trustnetic.com \
    --to=zaiyuwang@trustnetic.com \
    --cc=dev@dpdk.org \
    --cc=jiawenwu@trustnetic.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox