[PATCH v3 01/15] net/txgbe: fix failure to configure 10G on dual-speed DAC
Zaiyu Wang
zaiyuwang at trustnetic.com
Tue Sep 8 15:25:46 CEST 2026
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.
Three 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.
3. setup_phy_link_aml40() on the AN path passed a hardcoded 40 to
txgbe_e56_set_phy_link_mode(), ignoring the caller speed.
Remove each of these 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 at dpdk.org
Signed-off-by: Zaiyu Wang <zaiyuwang at trustnetic.com>
---
drivers/net/txgbe/base/txgbe_aml40.c | 17 ++++++++++++-----
drivers/net/txgbe/txgbe_ethdev.c | 2 +-
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/drivers/net/txgbe/base/txgbe_aml40.c b/drivers/net/txgbe/base/txgbe_aml40.c
index 1098efe5e6..7476759d4d 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
@@ -171,11 +172,17 @@ s32 txgbe_setup_phy_link_aml40(struct txgbe_hw *hw,
if (link_up && hw->an_done && !autoneg_wait_to_complete)
return status;
rte_spinlock_lock(&hw->phy_lock);
- txgbe_e56_set_phy_link_mode(hw, 40, autoneg_wait_to_complete);
+ txgbe_e56_set_phy_link_mode(hw, speed, autoneg_wait_to_complete);
rte_spinlock_unlock(&hw->phy_lock);
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
More information about the stable
mailing list