[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5d0b952a-ec07-4ebf-8228-a424fc0de4cd@redhat.com>
Date: Thu, 6 Mar 2025 11:47:22 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: Maxime Chevallier <maxime.chevallier@...tlin.com>
Cc: davem@...emloft.net, Andrew Lunn <andrew@...n.ch>,
Jakub Kicinski <kuba@...nel.org>, Eric Dumazet <edumazet@...gle.com>,
Russell King <linux@...linux.org.uk>, Heiner Kallweit
<hkallweit1@...il.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, thomas.petazzoni@...tlin.com,
linux-arm-kernel@...ts.infradead.org,
Christophe Leroy <christophe.leroy@...roup.eu>,
Herve Codina <herve.codina@...tlin.com>,
Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <vladimir.oltean@....com>,
Köry Maincent <kory.maincent@...tlin.com>,
Oleksij Rempel <o.rempel@...gutronix.de>, Simon Horman <horms@...nel.org>,
Romain Gantois <romain.gantois@...tlin.com>
Subject: Re: [PATCH net-next v4 02/13] net: phy: Use an internal, searchable
storage for the linkmodes
On 3/6/25 9:57 AM, Maxime Chevallier wrote:
> On Thu, 6 Mar 2025 09:30:11 +0100
> Paolo Abeni <pabeni@...hat.com> wrote:
>> On 3/3/25 10:03 AM, Maxime Chevallier wrote:
[...]
>>> +/**
>>> + * phy_caps_init() - Initializes the link_caps array from the link_mode_params.
>>> + */
>>> +void phy_caps_init(void)
>>> +{
>>> + const struct link_mode_info *linkmode;
>>> + int i, capa;
>>> +
>>> + /* Fill the caps array from net/ethtool/common.c */
>>> + for (i = 0; i < __ETHTOOL_LINK_MODE_MASK_NBITS; i++) {
>>> + linkmode = &link_mode_params[i];
>>> + capa = speed_duplex_to_capa(linkmode->speed, linkmode->duplex);
>>> +
>>> + if (capa < 0)
>>> + continue;
>>
>> Or even error-out here.
>
> Good point yes indeed. Russell raised the point for the need of keeping
> this in sync with new SPEED_XXX definitions, I'll add a check that
> errors out.
>
> I hope that's OK though, as higher speeds are introduced and used by
> NICs that usually don't use phylib at all, so there's a good chance
> that the developper introducing the new speed won't have CONFIG_PHYLIB
> enabled.
>
> Is that still good ?
I think so. New linkmodes should be added on net-next. Booting the
kernel with phylib support on any device should catch the error. I think
even the CI should catch this.
Thanks,
Paolo
Powered by blists - more mailing lists