lkml.org 
[lkml]   [2022]   [Jul]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH net-next v3 08/47] net: phylink: Support differing link speeds and interface speeds
From
Date


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

\
 
 \ /
  Last update: 2022-07-18 18:40    [W:0.025 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site