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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 18 Jul 2022 12:38:37 -0400
From:   Sean Anderson <sean.anderson@...o.com>
To:     "Russell King (Oracle)" <linux@...linux.org.uk>,
        Andrew Lunn <andrew@...n.ch>
Cc:     "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Madalin Bucur <madalin.bucur@....com>, netdev@...r.kernel.org,
        Paolo Abeni <pabeni@...hat.com>,
        Eric Dumazet <edumazet@...gle.com>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Alexandru Marginean <alexandru.marginean@....com>,
        Heiner Kallweit <hkallweit1@...il.com>,
        Vladimir Oltean <olteanv@...il.com>
Subject: Re: [PATCH net-next v3 08/47] net: phylink: Support differing link
 speeds and interface speeds



On 7/18/22 12:06 PM, Russell King (Oracle) wrote:
> On Sat, Jul 16, 2022 at 10:06:01PM +0200, Andrew Lunn wrote:
>> This seem error prone when new PHY_INTERFACE_MODES are added. I would
>> prefer a WARN_ON_ONCE() in the default: so we get to know about such
>> problems.
>> 
>> I'm also wondering if we need a sanity check here. I've seen quite a
>> few boards a Fast Ethernet MAC, but a 1G PHY because they are
>> cheap. In such cases, the MAC is supposed to call phy_set_max_speed()
>> to indicate it can only do 100Mbs. PHY_INTERFACE_MODE_MII but a
>> link_speed of 1G is clearly wrong. Are there other cases where we
>> could have a link speed faster than what the interface mode allows?
> 
> Currently, phylink will deal with that situation - the MAC will report
> that it only supports 10/100, and when the PHY is brought up, the
> supported/advertisement masks will be restricted to those speeds.
> 
>> Bike shedding a bit, but would it be better to use host_side_speed and
>> line_side_speed? When you say link_speed, which link are your
>> referring to? Since we are talking about the different sides of the
>> PHY doing different speeds, the naming does need to be clear.
> 
> Yes, we definitely need that clarification.
> 
> I am rather worried that we have drivers using ->speed today in their
> mac_config and we're redefining what that means in this patch.

Well, kind of. Previously, interface speed was defined to be link speed,
and both were just "speed". The MAC driver doesn't really care what the
link speed is if there is a phy, just how fast the phy interface mode
speed is.

> Also,
> the value that we pass to the *_link_up() calls appears to be the
> phy <-> (pcs|mac) speed not the media speed.

This is by design, to avoid breaking existing drivers.

> It's also ->speed and
> ->duplex that we report to the user in the "Link is Up" message,
> which will be confusing if it always says 10G despite the media link
> being e.g. 100M.
> 

Ah, I should probably change that message as well. The ethtool stuff
is already updated by this patch to report the link speed.

--Sean

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ