lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Sun, 28 Apr 2019 20:10:43 +0200 From: Heiner Kallweit <hkallweit1@...il.com> To: Andrew Lunn <andrew@...n.ch> Cc: Florian Fainelli <f.fainelli@...il.com>, David Miller <davem@...emloft.net>, "netdev@...r.kernel.org" <netdev@...r.kernel.org> Subject: Re: [PATCH net-next] net: phy: improve setting advertised modes in phy_probe On 28.04.2019 19:04, Andrew Lunn wrote: > On Sun, Apr 28, 2019 at 03:03:37PM +0200, Heiner Kallweit wrote: >> So far we set the advertising bitmap before setting the pause flags >> in the supported bitmap. This may cause pause not being advertised. > > Hi Heiner > > Pause requires that the PHY can advertise the pause bits, and that the > MAC supports pause. So by default, we don't advertise pause. The MAC > needs to say it supports pause, by calling one of > > void phy_support_sym_pause(struct phy_device *phydev); > void phy_support_asym_pause(struct phy_device *phydev); > > These two then copy supported into advertising. > Right, missed that. After checking the code a little bit more I think we still may have few issues with pause settings. 1. We have functions that copy supported -> advertising, e.g. phy_set_max_speed(). If such a function is called pause gets advertised even w/o the MAC calling one of the two functions. 2. We have PHY's (e.g. KSZ9031) that support sym pause only due to a hw erratum. If the MAC now calls phy_support_asym_pause() it sets the asym pause flag in phydev->supported even though the PHY intentionally disabled it. That's not nice .. Maybe we should do it differently: Apply my patch, then both pause modes are initially advertised. (This also avoids point 3 below) - remove phy_support_asym_pause() - phy_support_sym_pause() clears the asym pause bit and doesn't touch sym pause bit. - and we may need something like phy_support_no_pause(). 3. What's with all the existing drivers where the MAC supports pause but drivers call neither of the two functions? 4. Calling either of the two functions will be effective after an autoneg restart only. Do we have to consider this? > Andrew > Heiner
Powered by blists - more mailing lists