[PATCH v7 00/15] Wangxun fixes and new features
Stephen Hemminger
stephen at networkplumber.org
Wed Sep 30 18:18:14 CEST 2026
On Wed, 30 Sep 2026 18:17:47 +0800
Zaiyu Wang <zaiyuwang at trustnetic.com> wrote:
> This series addresses link-related issues on Wangxun Amber-lite 25G/40G NICs
> (CR/KR training, hot-plug, 10G link state).
>
> ---
> v7:
> - P14: fix a TRAINING log-string typo.
> move the variable declarations in txgbe_e56_get_txffe().
> clarify the comment of page-exchange timeout budget.
> ---
> v6:
> - fix the apply failure.
> ---
> v5:
> - drop the UDP tunnel patch: the generic UDP tunnel flag covers any UDP
> tunnel, so the tunnel type cannot be resolved from the destination port.
> - P02: advertise 10G, 25G, and 40G from the requested speed mask instead
> of the device ID, so the 25G and 40G parts advertise 10G by
> default as well.
> - P07: keep the patch limited to decoding the 10G link speed from PORTSTAT;
> the AML40 default 10G|40G advertisement change is now in P02.
> - P09: gate the SFP detection alarm and the AN73 watchdog on a new per-port
> flag that dev_stop clears before the first cancel.
> cancel SFP detection before the watchdog.
> - P10: re-arm the 40G module poll only while the SFP/AN73 alarm flag is set.
> - P12: treat the ffe_pre2 and bp_capa devargs as a feature rather than a fix;
> drop the Fixes tags and stable Cc, and document the 25G/40G Amber-Lite
> FFE defaults.
> - P14: bound the AN page exchange, propagate its timeout to the watchdog h
> andler, and avoid register reads used only by disabled BP debug logs.
> - P15: stop clearing the auto_neg devarg when a 10G-only DAC disables AN;
> derive the effective AN73 state from the current module capabilities
> instead. Classify 40G active cables through the optical path, unify
> DAC checks on txgbe_is_dac_cable().
>
> Not handled in this revision:
>
> - P12: bp_capa is not range-checked. Devarg validation will be added in a
> separate change so all txgbe devargs can be handled consistently.
> - P14: the AN page exchange still busy-waits on the alarm thread and can
> delay handling for other ports. A later change will decouple negotiation
> from the alarm callback and run per-port negotiations in parallel.
> ---
>
> Zaiyu Wang (15):
> net/txgbe: fix failure to configure 10G on dual-speed DAC
> net/txgbe: use the requested speed in E56 AN setup
> net/txgbe: fix e56 PHY configuration error
> net/txgbe: fix incorrect link state in 10G forced mode
> net/txgbe: do not force reconfig on link retry
> net/txgbe: set i2c sda hold time
> net/txgbe: fix link speed display info for 10G mode
> net/txgbe: remove stale outer UDP checksum offload flag
> net/txgbe: fix SFP hot-plug when auto-negotiation is on
> net/txgbe: fix DAC hot-plug on 40G NIC with auto-negotiation
> net/txgbe: fix 40G FFE tuning applied to first lane only
> net/txgbe: add pre2 FFE tap and backplane capability devargs
> net/txgbe: add devarg to turn off Tx laser for 40G NIC
> net/txgbe: fix CR/KR link training and recovery
> net/txgbe: align link capabilities and DAC classification
>
> doc/guides/nics/txgbe.rst | 25 +++-
> doc/guides/rel_notes/release_26_11.rst | 11 ++
> drivers/net/txgbe/base/txgbe_aml.c | 4 +-
> drivers/net/txgbe/base/txgbe_aml40.c | 92 ++++++++++--
> drivers/net/txgbe/base/txgbe_e56.c | 14 +-
> drivers/net/txgbe/base/txgbe_e56.h | 6 +
> drivers/net/txgbe/base/txgbe_e56_bp.c | 196 +++++++++++++++----------
> drivers/net/txgbe/base/txgbe_e56_bp.h | 4 +-
> drivers/net/txgbe/base/txgbe_hw.c | 33 +++++
> drivers/net/txgbe/base/txgbe_osdep.h | 12 +-
> drivers/net/txgbe/base/txgbe_phy.c | 25 +++-
> drivers/net/txgbe/base/txgbe_phy.h | 7 +
> drivers/net/txgbe/base/txgbe_regs.h | 3 +
> drivers/net/txgbe/base/txgbe_type.h | 17 ++-
> drivers/net/txgbe/txgbe_ethdev.c | 178 ++++++++++++++++++++--
> drivers/net/txgbe/txgbe_ethdev.h | 2 +
> drivers/net/txgbe/txgbe_rxtx.c | 1 -
> 17 files changed, 502 insertions(+), 128 deletions(-)
>
There are several more things to address:
Review: [PATCH v7 00/15] net/txgbe: Amber-Lite link and offload fixes
The series applies to main (04d091f) except for the release notes
hunks in 12/15 and 13/15. Every commit builds with -Dwerror=true
(gcc 13.3, x86_64). All Fixes: tags resolve; the Amber-Lite commits
are in 25.11 and 26.07, so Cc: stable is appropriate.
Resolved since earlier rounds:
- 09/15: AN73 watchdog can no longer be re-armed after dev_stop
- 12/15: no longer tagged as a fix; the new FFE defaults are
documented
- 02/15: states the 10GBASE-KR advertisement change
- 15/15: no longer clears devarg.auto_neg
- 14/15: txgbe_e56_exchange_page() is bounded at 200 ms, and
BP_LOG arguments are only evaluated when the log is enabled
- 13/15: the commit message explains why the SFF-8636 Tx enable
write is not gated on laser_off. That holds: the byte survives
across runs while the module stays powered.
The generic UDP tunnel patch is gone.
Patch 15/15: net/txgbe: align link capabilities and DAC
classification
Error: 10G active limiting DAC on the 25G NIC fails to start
txgbe_is_dac_cable() includes txgbe_sfp_type_da_act_lmt_core0/1.
get_link_capabilities_aml() now takes the DAC branch for such a
cable and reports *speed = hw->phy.fiber_suppport_speed.
txgbe_identify_sfp_module() only assigns that field in the
passive DA branch (and the QSFP path only for CR4); the DA_ACTIVE
branch never does. On a fresh port it is 0. setup_phy_link_aml()
masks the requested speed to nothing and returns
TXGBE_ERR_LINK_SETUP, so dev_start fails. If a 25G passive DAC
was in the cage earlier, the field is 25G|10G instead and AN73 is
enabled on an active limiting cable.
Before this patch, this cable took the fiber branch (10G|25G, no
autoneg). Set fiber_suppport_speed to 10G in the DA_ACTIVE
limiting branch.
The passive branch has a related problem: it uses |= for the
10G-only case, which keeps the 25G bit from a previously inserted
25G DAC. The hot-plug support in 09/15 makes that reachable.
Assign the value instead of OR-ing it.
Info: txgbe_is_10g_fiber_sfp() cannot match on aml40. The srlr
types are only set by txgbe_identify_sfp_module(), and aml40
identifies through txgbe_identify_qsfp_module(). Drop the branch.
Patch 05/15: net/txgbe: do not force reconfig on link retry
Warning: passing false also turns off need_restart
autoneg_wait_to_complete is passed through to
txgbe_e56_set_phy_link_mode() as need_restart. That function
returns early when curbp_link_mode == 10. set_phy_link_mode()
itself calls txgbe_set_phy_link_mode(hw, 10), so curbp_link_mode
stays at 10 until training selects 25 or 40.
As a result, a retry while the link is down and AN73 has not
trained is now a no-op. The xpcs branch never sets need_reset,
so the retry is not re-armed either, and recovery is left to the
check_bp_event watchdog alone. Either say so in the commit
message, or keep need_restart true when the link is down and
rely on the link_up && an_done check for the case being fixed.
Patch 10/15: net/txgbe: fix DAC hot-plug on 40G NIC with
auto-negotiation
Warning: the poll repeats identify for modules it cannot classify
The poll skips identify when sfp_type != not_present. On aml40,
txgbe_identify_qsfp_module() leaves sfp_type at not_present in
two cases:
- the identifier is not QSFP/QSFP+; it returns
TXGBE_ERR_SFP_NOT_SUPPORTED
- byte 131 has none of the CR4/SR4/LR4/active bits (extended
compliance only, e.g. ER4); it returns 0
Both cases now repeat every 2 seconds on the EAL interrupt
thread. Each repeat costs a 200 ms msec_delay() busy-wait plus
I2C traffic.
In the first case, each poll also logs two ERR lines.
In the second case, each poll runs setup_sfp() and
txgbe_dev_setup_link_alarm_handler(), which calls
setup_link(hw, speed, true). On a down link that reaches
txgbe_set_link_to_amlite(), with up to 2 s of msleep().
Without the poll, these paths ran only on a GPIO event. Record
the last sampled module-present level in the adapter and run
identify only on an absent-to-present transition. Alternatively,
set sfp_type to txgbe_sfp_type_unknown when a module cannot be
classified.
Info: on optical modules, a module swapped between two polls
keeps the old sfp_type. check_bp_event only samples the present
pin while AN73 is enabled.
Patch 13/15: net/txgbe: add devarg to turn off Tx laser for 40G NIC
Warning: set_link_up does not undo the DAC disable
With laser_off=1, txgbe_disable_tx_laser_multispeed_fiber()
clears RX_EN, the Tx enable bits and PMD enable in PMD_CFG0 for
DAC, unknown and absent modules. The enable path,
txgbe_enable_tx_laser_multispeed_fiber(), has no counterpart; it
only restores the SFF-8636 byte for optical modules.
dev_start recovers because setup_link reprograms the PHY.
rte_eth_dev_set_link_down() followed by rte_eth_dev_set_link_up()
does not: set_link_up only calls enable_tx_laser() and
link_update. The link thread is only started for
txgbe_media_type_fiber, and aml40 is fiber_qsfp. With the Rx
lanes off, check_bp_event sees no AN pages either, so a DAC link
stays down.
Either restore PMD_CFG0 in the enable path, or reconfigure the
link in set_link_up. The documentation also says the laser is
turned off "on port stop"; it applies to set_link_down as well.
Patch 14/15: net/txgbe: fix CR/KR link training and recovery
Warning: there is a stray "1" line after Signed-off-by, above the
"---". git am keeps it as the last paragraph of the commit log,
so git no longer finds any trailers in this commit. Drop it.
Info: the commit message says the poll waits for 0x78010 == 0x9,
but the code tests (rdata & 0x9) == 0x9, which also matches
0xb, 0xd and 0xf. If 0x78010[3:0] is an encoded FSM state,
compare the field instead of masking it.
Info: check_bp_event still busy-waits on the EAL interrupt thread:
up to 200 ms in the page exchange, plus 400 ms in the CL72 poll,
plus the RXS sequences (same as v4).
Patch 11/15: net/txgbe: fix 40G FFE tuning applied to first lane
only
Info: S40G_TX_FFE_4LANE() masks the value to 8 bits. On aml40, any
ffe_* value above 255 is silently truncated, while the parameter
string still says uint16. Reject such values in
txgbe_parse_devargs().
Patch 12/15: net/txgbe: add pre2 FFE tap and backplane capability
devargs
Info: bp_capa is still not range checked. On the 40G backplane, a
value above 2 advertises no 40G ability at all (same as v4).
Info: the release notes hunk no longer applies to main. Put
"Updated Wangxun txgbe driver" between Solarflare and ZTE.
More information about the dev
mailing list