Re: [PATCH net v1 1/1] r8169: disable EEE on RTL8168h/8111h
From: Maxime Chevallier
Date: Sun Dec 06 2026 - 05:52:20 EST
Hey,
On 12/6/26 11:27, Oleksij Rempel wrote:
> Hi Maxime,
>
> On Sun, Dec 06, 2026 at 08:09:02AM +0100, Maxime Chevallier wrote:
>> Hi Oleskij, Dennis,
>>
>> On 9/25/26 09:10, Oleksij Rempel wrote:
>>> Force EEE off on the RTL8168h/8111h (RTL_GIGA_MAC_VER_46) at PHY connect
>>> with phy_disable_eee().
>>>
>>> Commit 202fef9bbbf5 ("net: phy: realtek: fix EEE advertisement write on
>>> the internal PHY MMD path") made EEE actually advertise on the generic
>>> Realtek PHY; the write had been a no-op before. On the RTL8168h that
>>> un-masks a latent defect: once EEE negotiates, RX silently stalls after
>>> ~7-20 minutes. The carrier stays up, no counter or dmesg moves, and only
>>> "ip link set down/up" recovers it; disabling EEE keeps the link stable.
>>>
>>> Root-causing the RTL8168h LPI/RX path needs hardware not available now, so
>>> disable EEE for this version. Use phy_disable_eee() rather than dropping
>>> the version from rtl_supports_eee(): the latter also skips
>>> rtl_enable_tx_lpi(), whose disable branch clears the MAC TX-LPI bits (ERI
>>> 0x1b0[1:0]) on link up. rtl_hw_start_8168h_1() does not clear them (the
>>> RTL8402/RTL8106e init does), so a warm reboot from an EEE-active state
>>> could otherwise leave TX-LPI asserted while the PHY no longer negotiates
>>> EEE. Keeping the version EEE-capable preserves that clear path. This also
>>> covers the RTL8168M, which shares RTL_GIGA_MAC_VER_46.
>>
>> I recently got a bunch of quad-ports RTL8168h/8111h cards with the same version
>> info that you report, and I'm using these to test EEE kselftests I'm planning
>> to upstream next week.
>
> Thx for diving into it!
>
>> I tried to reproduce this issue with multiple peers :
>> - Intel i350 (igb driver)
>> - mvpp2 + marvell 88e1510 PHY
>> - mvneta + 88e6341 switch and its internal PHY
>> - mvneta + 88e6176 switch and its PHY
>
> I would recommend to use some device having a LPI counter, which report
> amount of transactions to the Low Power Idle mode (and/or reporting time
> spent in the LPI). For example LAN7850 support it.
It does enter LPI, running with devices that have counters show that we're
basically entering LPI after every frame
> Otherwise, you will need to attach oscilloscope and measure signal on
> the MDI side. Active EEE will be visible without any advanced equipment.
>
> See:
> https://youtu.be/jfm0GoPu3jM?si=wHtlgta6Qt2zeJM3&t=1185
>
>> I tested multiple loads: just pings, high-throughput tests with iperf3, mix of
>> UDP + TCP + random delays, this has been running for multiple hours each with
>> this patch reverted, and I didn't reproduce any of these stalls.
>
> The combination of tx-timer configurations and link-speed should be correct.
> In the 1000Mbit mode, the link will be switched to the LPI , only if
> both timers on both link sides are agree. Means, if peer A has short
> tx-timer and other side has long or infinite timer, then LPI well be
> never activated. Active EEE do not mean active LPI.
Yeah in my case I have 12µs on the realtek side, and 0 on the other end
>
> In 100Mbit mode, we will get separate LPI behavior on each pair. And
> may be higher chance to trigger something.
Ah, haven't tried at 100M, maybe it will show a different behaviour !
>
>> Any chance the original problem was on the link-partner side maybe ?
>
> It can be very high chance.
>
> Other questions is, if the system has external or internal PHY. If
> external, do it has active SmartEEE?
good question, I haven't considered these phy-side EEE with SmartEEE
or grEEEn stuff.
>
>> What was the partner's HW (PHY + MAC) in that case, and what kind of traffic
>> did you use to trigger that ?
>
> I guess, any traffic with measurable LPI effects. If you can measure
> MAC+PHY power consumption (or at leas system wide power) it will be
> great.
>
> Except of this, I can imagine that cable length and/or injected noise
> can trigger some of issues.
>
>> It's not very urgent on my side, I have enough i350 ports to run the stmmac CI and
>> the eee tests when they land, but TBH the realtek cards are cheaper, and if I could
>> use these in my setup to test EEE that'd be awesome :)
>>
>> In the meantime, I'll keep running long tests with this patch reverted, see if I can
>> reproduce that...
>
> Probably you will need to monitor link drop counts and any kind of
> packet drops (corruptions too).
I'll test with even more peers, speeds, LPI timer configs and see if I can
see anything then, thanks a lot for the tips,
Maxime
>
> Best Regards,
> Oleksij