[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e4f3eefa-9a01-413d-9ba6-ec9ebc381061@lunn.ch>
Date: Fri, 28 Nov 2025 15:57:07 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc: netdev@...r.kernel.org, Yehezkel Bernat <YehezkelShB@...il.com>,
Ian MacDonald <ian@...statz.com>,
Salvatore Bonaccorso <carnil@...ian.org>,
Andrew Lunn <andrew+netdev@...n.ch>,
"David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH net-next 3/3] net: thunderbolt: Allow reading link
settings
On Fri, Nov 28, 2025 at 08:23:51AM +0100, Mika Westerberg wrote:
> On Thu, Nov 27, 2025 at 08:20:53PM +0100, Andrew Lunn wrote:
> > > +static int tbnet_get_link_ksettings(struct net_device *dev,
> > > + struct ethtool_link_ksettings *cmd)
> > > +{
> > > + const struct tbnet *net = netdev_priv(dev);
> > > + const struct tb_xdomain *xd = net->xd;
> > > + int speed;
> > > +
> > > + ethtool_link_ksettings_zero_link_mode(cmd, supported);
> > > + ethtool_link_ksettings_zero_link_mode(cmd, advertising);
> > > +
> > > + /* Figure out the current link speed and width */
> > > + switch (xd->link_speed) {
> > > + case 40:
> > > + /* For Gen 4 80G symmetric link the closest one
> > > + * available is 56G so we report that.
> > > + */
> > > + ethtool_link_ksettings_add_link_mode(cmd, supported,
> > > + 56000baseKR4_Full);
> > > + ethtool_link_ksettings_add_link_mode(cmd, advertising,
> > > + 56000baseKR4_Full);
> > > + speed = SPEED_56000;
> >
> > Please add SPEED_80000.
>
> Sure. One additional question though. Comment on top of SPEED_ definitions
> suggest changing __get_link_speed() of the bonding driver accordingly but
> it basically converts from SPEED_ to AD_LINK_SPEED_ which I think we need
> to add too. However, these are user-facing values so should I add the
> AD_LINK_SPEED_80000 entry to the end of that enum to avoid any possible
> breakage?
Are they user facing? They should be define in include/uapi if they
were. I would keep the list sorted, and Cc: the bonding driver
Maintainer, Jay Vosburgh <jv@...sburgh.net> (maintainer:BONDING DRIVER).
Also:
cb8dda90c28e2 (Jianhua Xie 2014-11-19 16:48:58 +0800 61) enum ad_link_speed_type {
cb8dda90c28e2 (Jianhua Xie 2014-11-19 16:48:58 +0800 62) AD_LINK_SPEED_1MBPS = 1,
cb8dda90c28e2 (Jianhua Xie 2014-11-19 16:48:58 +0800 63) AD_LINK_SPEED_10MBPS,
cb8dda90c28e2 (Jianhua Xie 2014-11-19 16:48:58 +0800 64) AD_LINK_SPEED_100MBPS,
cb8dda90c28e2 (Jianhua Xie 2014-11-19 16:48:58 +0800 65) AD_LINK_SPEED_1000MBPS,
424c3232b04ac (Jianhua Xie 2014-11-19 16:48:59 +0800 66) AD_LINK_SPEED_2500MBPS,
c7c550670afda (Thibaut Collet 2017-06-08 11:18:11 +0200 67) AD_LINK_SPEED_5000MBPS,
424c3232b04ac (Jianhua Xie 2014-11-19 16:48:59 +0800 68) AD_LINK_SPEED_10000MBPS,
3fcd64cfa0e9c (Nicolas Dichtel 2017-06-08 11:18:12 +0200 69) AD_LINK_SPEED_14000MBPS,
424c3232b04ac (Jianhua Xie 2014-11-19 16:48:59 +0800 70) AD_LINK_SPEED_20000MBPS,
19ddde1eeca1e (Jarod Wilson 2017-03-14 11:48:32 -0400 71) AD_LINK_SPEED_25000MBPS,
424c3232b04ac (Jianhua Xie 2014-11-19 16:48:59 +0800 72) AD_LINK_SPEED_40000MBPS,
c7c550670afda (Thibaut Collet 2017-06-08 11:18:11 +0200 73) AD_LINK_SPEED_50000MBPS,
3952af4d50343 (Jiri Pirko 2015-12-03 12:12:05 +0100 74) AD_LINK_SPEED_56000MBPS,
3952af4d50343 (Jiri Pirko 2015-12-03 12:12:05 +0100 75) AD_LINK_SPEED_100000MBPS,
ab73447c38e4f (Nikolay Aleksandrov 2021-02-10 22:43:31 +0200 76) AD_LINK_SPEED_200000MBPS,
138e3b3cc0bbb (Nikolay Aleksandrov 2021-02-10 22:43:32 +0200 77) AD_LINK_SPEED_400000MBPS,
41305d3781d70 (Amit Cohen 2022-10-20 17:20:05 +0200 78) AD_LINK_SPEED_800000MBPS,
cb8dda90c28e2 (Jianhua Xie 2014-11-19 16:48:58 +0800 79) };
suggests you can insert in the middle:
commit c7c550670afda2e16f9e2d06a1473885312eb6b5
Author: Thibaut Collet <thibaut.collet@...nd.com>
Date: Thu Jun 8 11:18:11 2017 +0200
bonding: fix 802.3ad support for 5G and 50G speeds
This patch adds [5|50] Gbps enum definition, and fixes
aggregated bandwidth calculation based on above slave links.
Fixes: c9a70d43461d ("net-next: ethtool: Added port speed macros.")
Signed-off-by: Thibaut Collet <thibaut.collet@...nd.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@...nd.com>
Acked-by: Andy Gospodarek <andy@...yhouse.net>
Signed-off-by: David S. Miller <davem@...emloft.net>
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index b44a6aeb346d..d1b09be63ba4 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -90,10 +90,12 @@ enum ad_link_speed_type {
AD_LINK_SPEED_100MBPS,
AD_LINK_SPEED_1000MBPS,
AD_LINK_SPEED_2500MBPS,
+ AD_LINK_SPEED_5000MBPS,
AD_LINK_SPEED_10000MBPS,
AD_LINK_SPEED_20000MBPS,
AD_LINK_SPEED_25000MBPS,
AD_LINK_SPEED_40000MBPS,
+ AD_LINK_SPEED_50000MBPS,
AD_LINK_SPEED_56000MBPS,
AD_LINK_SPEED_100000MBPS,
Andrew
Powered by blists - more mailing lists