RTL8168h (r8169) silent RX stall on 18.3 / 6.18.52 without VLANs — EEE now active after Realtek PHY fix
Describe the issue you are experiencing
Since 18.3 (kernel 6.18.52-haos) the onboard RTL8168h of my NUC stops receiving every ~7–20 minutes. 18.2 (6.18.39-haos) is stable on the same hardware, cable and switch port.
This looks related to, but distinct from, #5019:
| #5019 reports | this issue | |
|---|---|---|
| VLANs | 802.1Q on the Realtek port | none |
| what dies | TX (NETDEV WATCHDOG: transmit queue 0 timed out) |
RX — rx_packets freezes, TX keeps working |
| kernel log | watchdog every ~5 s | nothing at all |
ethtool.feature-tx off |
fixes it | no effect (tested twice, also with MTU pinned to 1500) |
What the counters show during a hang (sampled every 1–2 s on the host, 23:08:34 → recovery):
time rx_packets tx_packets irq bql_inflight tx_timeout gw
23:08:29 626373 188818 201071 0 0 ok
23:08:31 626458 188908 201236 0 0 ok
23:08:34 626513 189037 201394 0 0 FAIL
23:08:37 626513 189126 201473 0 0 FAIL
23:08:44 626513 189284 201606 0 0 FAIL
23:08:51 626513 189517 201788 0 0 FAILrx_packetsfrozen;tx_packetsand the MSI-X interrupt count keep increasing- BQL
inflight=0,stall_cnt=0,tx_timeout=0→ TX completions are fine - rx_errors / rx_missed / rx_dropped / fifo / overrun all unchanged at 0
- carrier=1, operstate=up the whole time
- ASPM already off on the device (
l1_aspm=0, L1 substates 0; LnkCtl ASPM bits 0)
Recovery: ip neigh flush does not help. ip link set eno1 down && ip link set eno1 up restores traffic within 3 s. Without intervention it never recovers (before I had the monitor, only a cable re-plug helped).
Suspected cause: EEE is now effectively enabled on the internal PHY
There are no changes to drivers/net/ethernet/realtek/r8169_main.c between v6.18.39 and v6.18.52. There is however this backport in the Realtek PHY driver, which is the driver bound here (Generic FE-GE Realtek PHY r8169-0-200:00):
0af3afd054e7"net: phy: realtek: fix EEE advertisement write on the internal PHY MMD path" (upstream202fef9bbbf5)
Before the fix, rtlgen_write_mmd() wrote the EEE advertisement to the wrong register. With it, the advertisement actually lands. On 18.3 EEE is negotiated with my FRITZ!Box 6690:
EEE supported=0x28 advertised=0x28 lp_advertised=0x28 eee_active=1 eee_enabled=1 tx_lpi_enabled=1 tx_lpi_timer=12A silent RX stall is consistent with the MAC not waking from LPI on the receive side. (I have not yet read the EEE state on 18.2 for comparison — will add it when I'm back on that slot.)
EEE-off test: disabled EEE at runtime via ETHTOOL_SEEE at 23:12:43 (eee_active=0 afterwards) on the same 18.3 boot that had hung at 22:57 and 23:08.
Result: no hang for 60 minutes (23:12:43 → 00:11:34+, still running), vs. hangs ~7 minutes apart before on the same boot. Nothing else was changed; tx off and MTU 1500 were already in place during the failing runs.
So disabling EEE is a working workaround here, and the PHY EEE fix above looks like the trigger. The fix itself is correct, of course — it just exposes that RTL8168h + EEE (at least with this link partner) stalls RX. Maybe r8169 should keep EEE off for this chip version, or there's a missing LPI-related setup step in r8169 for RTL8168h.
(ethtool isn't shipped on HAOS; I used the SIOCETHTOOL ioctl from the SSH add-on, which shares the host network namespace. Script available if useful.)
What operating system image do you use?
generic-x86-64 (Generic UEFI capable x86-64 systems)
What version of Home Assistant Operating System is installed?
18.3 (broken) — 18.2 works
Did the problem occur after upgrading the Operating System?
Yes
Hardware details
- Intel NUC11ATKPE (board NUC11ATBPE, BIOS ATJSLCPX.0039.2023.0221.1502)
- Realtek RTL8168h/8111h, PCI
10ec:8168(subsys8086:3027), XID 541, driverr8169, ifaceeno1, 1 Gbps full duplex, flow control off - PHY driver:
Generic FE-GE Realtek PHY - Link partner: FRITZ!Box 6690 Cable LAN port
- No VLANs, no bonding
Steps to reproduce the issue
- Boot HAOS 18.3 on an RTL8168h connected to an EEE-capable link partner
- Wait 7–20 minutes under normal HA traffic
- Host becomes unreachable (ARP fails from other hosts);
rx_packetsstops increasing while TX continues
Anything in the Supervisor logs that might be useful for us?
Nothing relevant — only follow-up connection errors.
Anything in the Host logs that might be useful for us?
Nothing is logged by the driver at the moment of the hang. The only r8169 lines are from boot and from manual recovery:
r8169 0000:02:00.0 eth0: RTL8168h/8111h, 88:ae:dd:xx:xx:xx, XID 541, IRQ 125
r8169 0000:02:00.0 eth0: jumbo features [frames: 9194 bytes, tx checksumming: ko]
Generic FE-GE Realtek PHY r8169-0-200:00: attached PHY driver (mii_bus:phy_addr=r8169-0-200:00, irq=MAC)
r8169 0000:02:00.0 eno1: Link is Up - 1Gbps/Full - flow control offAdditional information
Earlier reports from this machine in #5019: https://github.com/home-assistant/operating-system/issues/5019#issuecomment-5758671575 and https://github.com/home-assistant/operating-system/issues/5019#issuecomment-5822191437
Happy to test a kernel with 0af3afd054e7 reverted, or collect anything else.
Source: home-assistant/operating-system