[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250123103534.1ca273af@kmaincent-XPS-13-7390>
Date: Thu, 23 Jan 2025 10:35:34 +0100
From: Kory Maincent <kory.maincent@...tlin.com>
To: Maxime Chevallier <maxime.chevallier@...tlin.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
thomas.petazzoni@...tlin.com, Andrew Lunn <andrew@...n.ch>, Jakub Kicinski
<kuba@...nel.org>, Eric Dumazet <edumazet@...gle.com>, Paolo Abeni
<pabeni@...hat.com>, Russell King <linux@...linux.org.uk>,
linux-arm-kernel@...ts.infradead.org, Christophe Leroy
<christophe.leroy@...roup.eu>, Herve Codina <herve.codina@...tlin.com>,
Florian Fainelli <f.fainelli@...il.com>, Heiner Kallweit
<hkallweit1@...il.com>, Vladimir Oltean <vladimir.oltean@....com>, Marek
Behún <kabel@...nel.org>, Oleksij Rempel
<o.rempel@...gutronix.de>, Nicolò Veronese
<nicveronese@...il.com>, Simon Horman <horms@...nel.org>,
mwojtas@...omium.org, Antoine Tenart <atenart@...nel.org>, Rob Herring
<robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
<conor+dt@...nel.org>
Subject: Re: [PATCH net-next RFC v2 2/6] net: ethtool: Introduce
ETHTOOL_LINK_MEDIUM_* values
On Wed, 22 Jan 2025 18:42:47 +0100
Maxime Chevallier <maxime.chevallier@...tlin.com> wrote:
> In an effort to have a better representation of Ethernet ports,
> introduce enumeration values representing the various ethernet Mediums.
>
> This is part of the 802.3 naming convention, for example :
>
> 1000 Base T 4
> | | | |
> | | | \_ lanes (4)
> | | \___ Medium (T == Twisted Copper Pairs)
> | \_______ Baseband transmission
> \____________ Speed
>
> Other example :
>
> 10000 Base K X 4
> | | \_ lanes (4)
> | \___ encoding (BaseX is 8b/10b while BaseR is 66b/64b)
> \_____ Medium (K is backplane ethernet)
>
> In the case of representing a physical port, only the medium and number
> of lanes should be relevant. One exception would be 1000BaseX, which is
> currently also used as a medium in what appears to be any of
> 1000BaseSX, 1000BaseFX, 1000BaseCX and 1000BaseLX.
> - __DEFINE_LINK_MODE_PARAMS(100, T, Half),
> - __DEFINE_LINK_MODE_PARAMS(100, T, Full),
> - __DEFINE_LINK_MODE_PARAMS(1000, T, Half),
> - __DEFINE_LINK_MODE_PARAMS(1000, T, Full),
> + __DEFINE_LINK_MODE_PARAMS_LANES(10, T, 2, 4, Half, T),
> + __DEFINE_LINK_MODE_PARAMS_LANES(10, T, 2, 4, Full, T),
> + __DEFINE_LINK_MODE_PARAMS_LANES(100, T, 2, 4, Half, T),
> + __DEFINE_LINK_MODE_PARAMS_LANES(100, T, 2, 4, Full, T),
> - __DEFINE_LINK_MODE_PARAMS(1000, KX, Full),
> - __DEFINE_LINK_MODE_PARAMS(10000, KX4, Full),
> - __DEFINE_LINK_MODE_PARAMS(10000, KR, Full),
> + __DEFINE_LINK_MODE_PARAMS(1000, KX, Full, K),
> + __DEFINE_LINK_MODE_PARAMS(10000, KX4, Full, K),
> + __DEFINE_LINK_MODE_PARAMS(10000, KR, Full, K),
The medium information is used twice.
Maybe we could redefine the __DEFINE_LINK_MODE_PARAMS like this to avoid
redundant information:
#define __DEFINE_LINK_MODE_PARAMS(_speed, _medium, _encoding, _lanes, _duplex)
And something like this when the lanes are not a fix number:
#define __DEFINE_LINK_MODE_PARAMS_LANES_RANGE(_speed, _medium, _encoding,
_min_lanes, _max_lanes, _duplex)
Then we can remove all the __LINK_MODE_LANES_XX defines which may be
wrong as you have spotted in patch 1.
Regards,
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
Powered by blists - more mailing lists