GL-SFT1200 (Opal): random Ethernet link drops fixed by disabling EEE (802.3az) on the uplink PHY
Symptoms
- Three SFT1200s on firmware 4.8.5, used as wired access points (uplink cable in the WAN port) on Netgear GS205 unmanaged switches.
- Each AP dropped its uplink for about 4 seconds, 2 to 3 times a day, mostly when the link was idle.
- The AP log showed
netifd: sf_eth_event port 0 updown 0thenupdown 1, followed by a DHCP release/renew. - Changing the cable, switch port, PSU, location, or firmware made no difference. The drops weren't simultaneous across APs.
Cause
Energy-Efficient Ethernet (EEE / 802.3az). Both the SFT1200's uplink PHY and the switch advertise EEE at 1000 Mbps, and the link occasionally loses sync when it goes into low-power idle. I confirmed this by putting one AP behind a Linux bridge with EEE turned off on the AP-facing port. That AP stopped dropping while the others carried on.
ethtool --set-eee does not work on the SFT1200: eth0 is the CPU's link to the internal switch and returns "Not supported". The port PHYs sit behind the Siflower switch driver (sf_eswitch). That driver has a debug interface that can read and write PHY registers, including the standard EEE advertisement register (MMD 7.60 / 0x3C).
Fix: tested on firmware 4.8.5 (OpenWrt 18.06 base), at your own risk
-
Enable SSH. In the LuCI view on the SFT1200 (Advanced Settings), go to System → Startup and Enable + Start
dropbear. If you connect via the WAN port, add a firewall rule allowing TCP 22 from your PC. Newer Windows OpenSSH needsssh -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa root@<AP-IP>. -
Check the uplink PHY. Results appear in
dmesg, not in the file:
D=/sys/kernel/debug/esw_debug
echo rwPHYReg 0 1 > $D; echo rwPHYReg 0 0 > $D; echo rwMMDReg 0 0x7003c > $D
dmesg | grep -E "intel (mmd )?read" | tail -3
On mine, the uplink/WAN port was PHY 0. Expected values:
- reg 1 =
0x796d(link up) - reg 0 =
0x1040 - MMD
0x7003c=0x0004(EEE advertised at 1000BASE-T)
cat /sys/kernel/debug/esw_debug should show switch_type 2. In the driver, rwMMDReg only works for that (Intel) switch type.
If your values differ, don't continue. In particular, the 0x1240 below assumes reg 0 is 0x1040.
- Test it live. This clears the EEE advertisement, then restarts autonegotiation. The link drops for about 3 seconds:
echo rwMMDReg 0 0x7003c 0 > $D
echo rwPHYReg 0 0 0x1240 > $D
After a few seconds, echo rwMMDReg 0 0x7003c > $D; dmesg | tail -1 should read 0x00000000. The link comes back at 1000 Mbps without EEE.
- Make it persistent. In System → Startup → Local Startup, add this above
exit 0:
# Stop advertising EEE on the uplink (PHY 0) - fixes link drops
(
sleep 30
D=/sys/kernel/debug/esw_debug
[ -w "$D" ] || exit 0
echo rwMMDReg 0 0x7003c 0 > "$D"
echo rwPHYReg 0 0 0x1240 > "$D"
logger -t eee-off "EEE advert cleared on PHY0, autoneg restarted"
) &
GL's boot is slow: Local Startup runs about 90 seconds in, so the change applies about 2 minutes after power-on. Check it 2.5 minutes or more after boot (0x7003c should read 0x0000). Expect one short link drop at that point.
- Optionally, disable SSH again afterwards. The startup script doesn't need it.
Result
The three APs were dropping about 9 times a day between them. After the change, they've had zero drops. To revert, remove the block from Local Startup and reboot.
Notes
esw_debugcommands (from strings insf_eswitch.ko):rwPHYReg [phy] [reg] [value]andrwMMDReg [phy] [(devad<<16)|reg] [value]. Leave out the value to read.- If your switch is managed, turning EEE off on the switch port does the same job without touching the AP.
- Similar root cause on the MT3000: GL-MT3000: 2.5G WAN link drops every few minutes – root cause (EEE/802.3az) and fix via rc.local