[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aIC944gcYkfFsIRD@pengutronix.de>
Date: Wed, 23 Jul 2025 12:48:03 +0200
From: Oleksij Rempel <o.rempel@...gutronix.de>
To: Horatiu Vultur <horatiu.vultur@...rochip.com>
Cc: andrew@...n.ch, hkallweit1@...il.com, linux@...linux.org.uk,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next] net: phy: micrel: Add support for lan8842
On Wed, Jul 23, 2025 at 11:01:45AM +0200, Horatiu Vultur wrote:
> The 07/23/2025 07:34, Oleksij Rempel wrote:
> >
> > Hi Horatiu,
>
> Hi Olekij,
>
> >
> > On Mon, Jul 21, 2025 at 09:14:05AM +0200, Horatiu Vultur wrote:
> >
> > > +static int lan8842_config_init(struct phy_device *phydev)
> > > +{
> > > + int val;
> > > + int ret;
> > > +
> > > + /* Reset the PHY */
> > > + val = lanphy_read_page_reg(phydev, 4, LAN8814_QSGMII_SOFT_RESET);
> >
> > It would be good to use defines for MMD pages.
>
> Those are extended pages and not MMD pages. Currently in the entire
> source code I can see we used hardcoded values, also in the register
> description it looks like all these extended pages do not have really
> meaningfull names: Extended Page 0, Extended Page 4, Extended Page 5...
I'll be happy with xxxx_EXT_PAGE_0, etc
> > > + val = lanphy_read_page_reg(phydev, 0, LAN8842_FLF);
> > > + if (val < 0)
> > > + return val;
> > > + val |= LAN8842_FLF_ENA | LAN8842_FLF_ENA_LINK_DOWN;
> >
> > If I see it correctly, FLF support will make link fail after ~1ms, while
> > IEEE 802.3 recommends 750ms. Since a link recovery of a PHY with autoneg
> > support usually takes multiple seconds, I see the benefit for FLF
> > support only mostly for SyncE environment at same time it seems to be
> > a disadvantage for other environments.
>
> Why would be a disadvantage?
The disadvantage in a standard network without a backup link (like one
using RSTP) comes from how the system handles recoverable, temporary
errors like a short burst of noise.
# Standard PHY Behavior (Grace Period)
When a standard 1000BASE-T link becomes unstable, the IEEE 802.3
standard requires the PHY to attempt to retrain and recover the
connection on its own. It has a timeout window of up to 750 ms to do
this, which acts as a grace period.
If the link issue was temporary and the PHY recovers within this window,
the operating system never sees a "link down" event. Applications only
experience a brief moment of packet loss, which is often handled
gracefully by protocols like TCP.
# FLF Behavior (Immediate Failure)
An FLF-enabled PHY is designed to report link instability almost
immediately (~1 ms). Instead of trying to recover silently, it
immediately reports a hard link failure to the operating system.
# The Disadvantage in a Single-Link System
For a system with only one link, this "fail-fast" approach can be a
disadvantage. Consider a short, recoverable noise burst:
- Without FLF: The PHY uses its 750 ms grace period to recover. The
link stays up, and the service interruption is limited to brief packet
loss.
- With FLF: The PHY reports "link down" after ~1 ms. The operating
system tears down the network interface. Even if the hardware recovers
quickly, the OS has to bring the interface back up, re-run DHCP, and
re-establish all application connections. This system-level recovery
often takes much longer than the original glitch.
In short, FLF can turn a minor, recoverable physical-layer glitch into a
more disruptive, longer-lasting outage at the application level when
there is no backup link to switch to.
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Powered by blists - more mailing lists