Hi Nicolai,
On 9/10/26 20:50, Nicolai Buchwitz wrote:
quoted
+ max_duration = usecs_to_jiffies(2 * priv->tx_lpi_timer);
tx_lpi_timer comes direct from ethtool as an unvalidated u32. So if a (arguable privileged
user) does 'ethtool --set-eee eth0 tx-lpi-timer 1000000000', the code will sleep ~2000 seconds
under rtnl_lock. Tge old code capped it at 900 ms regardless of the timer.
Thus I think we should clamp it at some sane value. Feel free to keep my R-b with the clamp.
I was wondering if 802.3 said anything about the LPI timer value, but
Clause 78 says :
78.1.2.1.3 When generated
Specification of the time when this primitive is generated by the LPI
client is out of the scope of this standard.
I'll clamp that as a safety precaution.
As a side-note, there are other limitations, that apply to both eee
and flow control. Even though we're in MAC loopback mode, the link
MUST be up for the selftests to run, and both EEE and Pause are
affected by the autoneg results, and this will affect the selftest
outcome.
I'll address that in another series though, but I'll send a V3 for the
clamping still :)
Thanks for taking a look,
Maxime