public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND net-next v2 0/5] net: thunderbolt: Various improvements
@ 2026-01-09 12:26 Mika Westerberg
  2026-01-09 12:26 ` [PATCH RESEND net-next v2 1/5] net: thunderbolt: Allow changing MAC address of the device Mika Westerberg
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Mika Westerberg @ 2026-01-09 12:26 UTC (permalink / raw)
  To: netdev
  Cc: Yehezkel Bernat, Ian MacDonald, Salvatore Bonaccorso, Andrew Lunn,
	David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Jay Vosburgh, Simon Horman, Mika Westerberg

[Resending now as the net-next tree should be open again].

Hi all,

This series improves the Thunderbolt networking driver so that it should
work with the bonding driver. I added also possibility of channing MTU
which is sometimes needed, and was part of the original driver.

The discussion that started this patch series can be read below:

  https://lore.kernel.org/netdev/CAFJzfF9N4Hak23sc-zh0jMobbkjK7rg4odhic1DQ1cC+=MoQoA@mail.gmail.com/

The previous version of the series can be seen here:

  v1: https://lore.kernel.org/netdev/20251127131521.2580237-1-mika.westerberg@linux.intel.com/

Changes from the previous version:

  - Add SPEED_80000
  - Add support for SPEED_80000 for ethtool and 3ad bonding driver
  - Use SPEED_80000 with the USB4 v2 symmetric link
  - Fill blank for supported and advertising.

Ian MacDonald (1):
  net: thunderbolt: Allow reading link settings

Mika Westerberg (4):
  net: thunderbolt: Allow changing MAC address of the device
  net: thunderbolt: Allow changing MTU of the device
  net: ethtool: Add define for SPEED_80000
  bonding: 3ad: Add support for SPEED_80000

 drivers/net/bonding/bond_3ad.c |  6 ++++
 drivers/net/thunderbolt/main.c | 64 ++++++++++++++++++++++++++++++++++
 include/uapi/linux/ethtool.h   |  1 +
 3 files changed, 71 insertions(+)

-- 
2.50.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH RESEND net-next v2 1/5] net: thunderbolt: Allow changing MAC address of the device
  2026-01-09 12:26 [PATCH RESEND net-next v2 0/5] net: thunderbolt: Various improvements Mika Westerberg
@ 2026-01-09 12:26 ` Mika Westerberg
  2026-01-10 17:57   ` Andrew Lunn
  2026-01-09 12:26 ` [PATCH RESEND net-next v2 2/5] net: thunderbolt: Allow changing MTU " Mika Westerberg
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Mika Westerberg @ 2026-01-09 12:26 UTC (permalink / raw)
  To: netdev
  Cc: Yehezkel Bernat, Ian MacDonald, Salvatore Bonaccorso, Andrew Lunn,
	David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Jay Vosburgh, Simon Horman, Mika Westerberg

The MAC address we use is based on a suggestion in the USB4 Inter-domain
spec but it is not really used in the USB4NET protocol. It is more
targeted for the upper layers of the network stack. There is no reason
why it should not be changed by the userspace for example if needed for
bonding.

Reported-by: Ian MacDonald <ian@netstatz.com>
Closes: https://lore.kernel.org/netdev/CAFJzfF9N4Hak23sc-zh0jMobbkjK7rg4odhic1DQ1cC+=MoQoA@mail.gmail.com/
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/net/thunderbolt/main.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/thunderbolt/main.c b/drivers/net/thunderbolt/main.c
index dcaa62377808..57b226afeb84 100644
--- a/drivers/net/thunderbolt/main.c
+++ b/drivers/net/thunderbolt/main.c
@@ -1261,6 +1261,7 @@ static const struct net_device_ops tbnet_netdev_ops = {
 	.ndo_open = tbnet_open,
 	.ndo_stop = tbnet_stop,
 	.ndo_start_xmit = tbnet_start_xmit,
+	.ndo_set_mac_address = eth_mac_addr,
 	.ndo_get_stats64 = tbnet_get_stats64,
 };
 
@@ -1281,6 +1282,9 @@ static void tbnet_generate_mac(struct net_device *dev)
 	hash = jhash2((u32 *)xd->local_uuid, 4, hash);
 	addr[5] = hash & 0xff;
 	eth_hw_addr_set(dev, addr);
+
+	/* Allow changing it if needed */
+	dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
 }
 
 static int tbnet_probe(struct tb_service *svc, const struct tb_service_id *id)
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH RESEND net-next v2 2/5] net: thunderbolt: Allow changing MTU of the device
  2026-01-09 12:26 [PATCH RESEND net-next v2 0/5] net: thunderbolt: Various improvements Mika Westerberg
  2026-01-09 12:26 ` [PATCH RESEND net-next v2 1/5] net: thunderbolt: Allow changing MAC address of the device Mika Westerberg
@ 2026-01-09 12:26 ` Mika Westerberg
  2026-01-09 12:35   ` Nikolay Aleksandrov
  2026-01-09 12:26 ` [PATCH RESEND net-next v2 3/5] net: ethtool: Add define for SPEED_80000 Mika Westerberg
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Mika Westerberg @ 2026-01-09 12:26 UTC (permalink / raw)
  To: netdev
  Cc: Yehezkel Bernat, Ian MacDonald, Salvatore Bonaccorso, Andrew Lunn,
	David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Jay Vosburgh, Simon Horman, Mika Westerberg

In some cases it is useful to be able to use different MTU than the
default one. Especially when dealing against non-Linux networking stack.
For this reason add possibility to change the MTU of the device.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/net/thunderbolt/main.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/thunderbolt/main.c b/drivers/net/thunderbolt/main.c
index 57b226afeb84..20bac55a3e20 100644
--- a/drivers/net/thunderbolt/main.c
+++ b/drivers/net/thunderbolt/main.c
@@ -1257,12 +1257,23 @@ static void tbnet_get_stats64(struct net_device *dev,
 	stats->rx_missed_errors = net->stats.rx_missed_errors;
 }
 
+static int tbnet_change_mtu(struct net_device *dev, int new_mtu)
+{
+	/* Keep the MTU within supported range */
+	if (new_mtu < 68 || new_mtu > (TBNET_MAX_MTU - ETH_HLEN))
+		return -EINVAL;
+
+	dev->mtu = new_mtu;
+	return 0;
+}
+
 static const struct net_device_ops tbnet_netdev_ops = {
 	.ndo_open = tbnet_open,
 	.ndo_stop = tbnet_stop,
 	.ndo_start_xmit = tbnet_start_xmit,
 	.ndo_set_mac_address = eth_mac_addr,
 	.ndo_get_stats64 = tbnet_get_stats64,
+	.ndo_change_mtu	= tbnet_change_mtu,
 };
 
 static void tbnet_generate_mac(struct net_device *dev)
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH RESEND net-next v2 3/5] net: ethtool: Add define for SPEED_80000
  2026-01-09 12:26 [PATCH RESEND net-next v2 0/5] net: thunderbolt: Various improvements Mika Westerberg
  2026-01-09 12:26 ` [PATCH RESEND net-next v2 1/5] net: thunderbolt: Allow changing MAC address of the device Mika Westerberg
  2026-01-09 12:26 ` [PATCH RESEND net-next v2 2/5] net: thunderbolt: Allow changing MTU " Mika Westerberg
@ 2026-01-09 12:26 ` Mika Westerberg
  2026-01-10 18:03   ` Andrew Lunn
  2026-01-09 12:26 ` [PATCH RESEND net-next v2 4/5] bonding: 3ad: Add support " Mika Westerberg
  2026-01-09 12:26 ` [PATCH RESEND net-next v2 5/5] net: thunderbolt: Allow reading link settings Mika Westerberg
  4 siblings, 1 reply; 12+ messages in thread
From: Mika Westerberg @ 2026-01-09 12:26 UTC (permalink / raw)
  To: netdev
  Cc: Yehezkel Bernat, Ian MacDonald, Salvatore Bonaccorso, Andrew Lunn,
	David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Jay Vosburgh, Simon Horman, Mika Westerberg

USB4 v2 link used in peer-to-peer networking is symmetric 80 Gbps so in
order to support reading this link speed, add it to ethtool.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 include/uapi/linux/ethtool.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index eb7ff2602fbb..181243a2d700 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -2190,6 +2190,7 @@ enum ethtool_link_mode_bit_indices {
 #define SPEED_40000		40000
 #define SPEED_50000		50000
 #define SPEED_56000		56000
+#define SPEED_80000		80000
 #define SPEED_100000		100000
 #define SPEED_200000		200000
 #define SPEED_400000		400000
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH RESEND net-next v2 4/5] bonding: 3ad: Add support for SPEED_80000
  2026-01-09 12:26 [PATCH RESEND net-next v2 0/5] net: thunderbolt: Various improvements Mika Westerberg
                   ` (2 preceding siblings ...)
  2026-01-09 12:26 ` [PATCH RESEND net-next v2 3/5] net: ethtool: Add define for SPEED_80000 Mika Westerberg
@ 2026-01-09 12:26 ` Mika Westerberg
  2026-01-09 12:37   ` Nikolay Aleksandrov
  2026-01-09 12:26 ` [PATCH RESEND net-next v2 5/5] net: thunderbolt: Allow reading link settings Mika Westerberg
  4 siblings, 1 reply; 12+ messages in thread
From: Mika Westerberg @ 2026-01-09 12:26 UTC (permalink / raw)
  To: netdev
  Cc: Yehezkel Bernat, Ian MacDonald, Salvatore Bonaccorso, Andrew Lunn,
	David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Jay Vosburgh, Simon Horman, Mika Westerberg

Add support for ethtool SPEED_80000. This is needed to allow
Thunderbolt/USB4 networking driver to be used with the bonding driver.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/net/bonding/bond_3ad.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 1a8de2bf8655..e5e9c7207309 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -72,6 +72,7 @@ enum ad_link_speed_type {
 	AD_LINK_SPEED_40000MBPS,
 	AD_LINK_SPEED_50000MBPS,
 	AD_LINK_SPEED_56000MBPS,
+	AD_LINK_SPEED_80000MBPS,
 	AD_LINK_SPEED_100000MBPS,
 	AD_LINK_SPEED_200000MBPS,
 	AD_LINK_SPEED_400000MBPS,
@@ -297,6 +298,7 @@ static inline int __check_agg_selection_timer(struct port *port)
  *     %AD_LINK_SPEED_40000MBPS
  *     %AD_LINK_SPEED_50000MBPS
  *     %AD_LINK_SPEED_56000MBPS
+ *     %AD_LINK_SPEED_80000MBPS
  *     %AD_LINK_SPEED_100000MBPS
  *     %AD_LINK_SPEED_200000MBPS
  *     %AD_LINK_SPEED_400000MBPS
@@ -365,6 +367,10 @@ static u16 __get_link_speed(struct port *port)
 			speed = AD_LINK_SPEED_56000MBPS;
 			break;
 
+		case SPEED_80000:
+			speed = AD_LINK_SPEED_80000MBPS;
+			break;
+
 		case SPEED_100000:
 			speed = AD_LINK_SPEED_100000MBPS;
 			break;
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH RESEND net-next v2 5/5] net: thunderbolt: Allow reading link settings
  2026-01-09 12:26 [PATCH RESEND net-next v2 0/5] net: thunderbolt: Various improvements Mika Westerberg
                   ` (3 preceding siblings ...)
  2026-01-09 12:26 ` [PATCH RESEND net-next v2 4/5] bonding: 3ad: Add support " Mika Westerberg
@ 2026-01-09 12:26 ` Mika Westerberg
  2026-01-10 18:08   ` Andrew Lunn
  4 siblings, 1 reply; 12+ messages in thread
From: Mika Westerberg @ 2026-01-09 12:26 UTC (permalink / raw)
  To: netdev
  Cc: Yehezkel Bernat, Ian MacDonald, Salvatore Bonaccorso, Andrew Lunn,
	David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Jay Vosburgh, Simon Horman, Mika Westerberg

From: Ian MacDonald <ian@netstatz.com>

In order to use Thunderbolt networking as part of bonding device it
needs to support ->get_link_ksettings() ethtool operation, so that the
bonding driver can read the link speed and the related attributes. Add
support for this to the driver.

Signed-off-by: Ian MacDonald <ian@netstatz.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/net/thunderbolt/main.c | 49 ++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/drivers/net/thunderbolt/main.c b/drivers/net/thunderbolt/main.c
index 20bac55a3e20..74160d14cf46 100644
--- a/drivers/net/thunderbolt/main.c
+++ b/drivers/net/thunderbolt/main.c
@@ -10,6 +10,7 @@
  */
 
 #include <linux/atomic.h>
+#include <linux/ethtool.h>
 #include <linux/highmem.h>
 #include <linux/if_vlan.h>
 #include <linux/jhash.h>
@@ -1276,6 +1277,53 @@ static const struct net_device_ops tbnet_netdev_ops = {
 	.ndo_change_mtu	= tbnet_change_mtu,
 };
 
+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:
+		speed = SPEED_80000;
+		break;
+
+	case 20:
+		if (xd->link_width == 2)
+			speed = SPEED_40000;
+		else
+			speed = SPEED_20000;
+		break;
+
+	case 10:
+		if (xd->link_width == 2) {
+			speed = SPEED_20000;
+			break;
+		}
+		fallthrough;
+
+	default:
+		speed = SPEED_10000;
+		break;
+	}
+
+	cmd->base.speed = speed;
+	cmd->base.duplex = DUPLEX_FULL;
+	cmd->base.autoneg = AUTONEG_DISABLE;
+	cmd->base.port = PORT_OTHER;
+
+	return 0;
+}
+
+static const struct ethtool_ops tbnet_ethtool_ops = {
+	.get_link_ksettings = tbnet_get_link_ksettings,
+};
+
 static void tbnet_generate_mac(struct net_device *dev)
 {
 	const struct tbnet *net = netdev_priv(dev);
@@ -1326,6 +1374,7 @@ static int tbnet_probe(struct tb_service *svc, const struct tb_service_id *id)
 
 	strcpy(dev->name, "thunderbolt%d");
 	dev->netdev_ops = &tbnet_netdev_ops;
+	dev->ethtool_ops = &tbnet_ethtool_ops;
 
 	/* ThunderboltIP takes advantage of TSO packets but instead of
 	 * segmenting them we just split the packet into Thunderbolt
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH RESEND net-next v2 2/5] net: thunderbolt: Allow changing MTU of the device
  2026-01-09 12:26 ` [PATCH RESEND net-next v2 2/5] net: thunderbolt: Allow changing MTU " Mika Westerberg
@ 2026-01-09 12:35   ` Nikolay Aleksandrov
  2026-01-09 12:40     ` Nikolay Aleksandrov
  0 siblings, 1 reply; 12+ messages in thread
From: Nikolay Aleksandrov @ 2026-01-09 12:35 UTC (permalink / raw)
  To: Mika Westerberg, netdev
  Cc: Yehezkel Bernat, Ian MacDonald, Salvatore Bonaccorso, Andrew Lunn,
	David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Jay Vosburgh, Simon Horman

On 09/01/2026 14:26, Mika Westerberg wrote:
> In some cases it is useful to be able to use different MTU than the
> default one. Especially when dealing against non-Linux networking stack.
> For this reason add possibility to change the MTU of the device.
> 
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> ---
>   drivers/net/thunderbolt/main.c | 11 +++++++++++
>   1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/net/thunderbolt/main.c b/drivers/net/thunderbolt/main.c
> index 57b226afeb84..20bac55a3e20 100644
> --- a/drivers/net/thunderbolt/main.c
> +++ b/drivers/net/thunderbolt/main.c
> @@ -1257,12 +1257,23 @@ static void tbnet_get_stats64(struct net_device *dev,
>   	stats->rx_missed_errors = net->stats.rx_missed_errors;
>   }
>   
> +static int tbnet_change_mtu(struct net_device *dev, int new_mtu)
> +{
> +	/* Keep the MTU within supported range */
> +	if (new_mtu < 68 || new_mtu > (TBNET_MAX_MTU - ETH_HLEN))
> +		return -EINVAL;
> +
> +	dev->mtu = new_mtu;
> +	return 0;
> +}
> +
>   static const struct net_device_ops tbnet_netdev_ops = {
>   	.ndo_open = tbnet_open,
>   	.ndo_stop = tbnet_stop,
>   	.ndo_start_xmit = tbnet_start_xmit,
>   	.ndo_set_mac_address = eth_mac_addr,
>   	.ndo_get_stats64 = tbnet_get_stats64,
> +	.ndo_change_mtu	= tbnet_change_mtu,
>   };
>   
>   static void tbnet_generate_mac(struct net_device *dev)

You can use struct net_device's min/max_mtu instead of a custom 
ndo_change_mtu.
They will be validated by dev_validate_mtu().

Cheers,
  Nik



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH RESEND net-next v2 4/5] bonding: 3ad: Add support for SPEED_80000
  2026-01-09 12:26 ` [PATCH RESEND net-next v2 4/5] bonding: 3ad: Add support " Mika Westerberg
@ 2026-01-09 12:37   ` Nikolay Aleksandrov
  0 siblings, 0 replies; 12+ messages in thread
From: Nikolay Aleksandrov @ 2026-01-09 12:37 UTC (permalink / raw)
  To: Mika Westerberg, netdev
  Cc: Yehezkel Bernat, Ian MacDonald, Salvatore Bonaccorso, Andrew Lunn,
	David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Jay Vosburgh, Simon Horman

On 09/01/2026 14:26, Mika Westerberg wrote:
> Add support for ethtool SPEED_80000. This is needed to allow
> Thunderbolt/USB4 networking driver to be used with the bonding driver.
> 
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> ---
>   drivers/net/bonding/bond_3ad.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
> index 1a8de2bf8655..e5e9c7207309 100644
> --- a/drivers/net/bonding/bond_3ad.c
> +++ b/drivers/net/bonding/bond_3ad.c
> @@ -72,6 +72,7 @@ enum ad_link_speed_type {
>   	AD_LINK_SPEED_40000MBPS,
>   	AD_LINK_SPEED_50000MBPS,
>   	AD_LINK_SPEED_56000MBPS,
> +	AD_LINK_SPEED_80000MBPS,
>   	AD_LINK_SPEED_100000MBPS,
>   	AD_LINK_SPEED_200000MBPS,
>   	AD_LINK_SPEED_400000MBPS,
> @@ -297,6 +298,7 @@ static inline int __check_agg_selection_timer(struct port *port)
>    *     %AD_LINK_SPEED_40000MBPS
>    *     %AD_LINK_SPEED_50000MBPS
>    *     %AD_LINK_SPEED_56000MBPS
> + *     %AD_LINK_SPEED_80000MBPS
>    *     %AD_LINK_SPEED_100000MBPS
>    *     %AD_LINK_SPEED_200000MBPS
>    *     %AD_LINK_SPEED_400000MBPS
> @@ -365,6 +367,10 @@ static u16 __get_link_speed(struct port *port)
>   			speed = AD_LINK_SPEED_56000MBPS;
>   			break;
>   
> +		case SPEED_80000:
> +			speed = AD_LINK_SPEED_80000MBPS;
> +			break;
> +
>   		case SPEED_100000:
>   			speed = AD_LINK_SPEED_100000MBPS;
>   			break;

You should also update __get_agg_bandwidth(), otherwise the
aggregated bandwidth will be reported as 0.

Cheers,
  Nik


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH RESEND net-next v2 2/5] net: thunderbolt: Allow changing MTU of the device
  2026-01-09 12:35   ` Nikolay Aleksandrov
@ 2026-01-09 12:40     ` Nikolay Aleksandrov
  0 siblings, 0 replies; 12+ messages in thread
From: Nikolay Aleksandrov @ 2026-01-09 12:40 UTC (permalink / raw)
  To: Mika Westerberg, netdev
  Cc: Yehezkel Bernat, Ian MacDonald, Salvatore Bonaccorso, Andrew Lunn,
	David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Jay Vosburgh, Simon Horman

On 09/01/2026 14:35, Nikolay Aleksandrov wrote:
> On 09/01/2026 14:26, Mika Westerberg wrote:
>> In some cases it is useful to be able to use different MTU than the
>> default one. Especially when dealing against non-Linux networking stack.
>> For this reason add possibility to change the MTU of the device.
>>
>> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
>> ---
>>   drivers/net/thunderbolt/main.c | 11 +++++++++++
>>   1 file changed, 11 insertions(+)
>>
>> diff --git a/drivers/net/thunderbolt/main.c b/drivers/net/thunderbolt/ 
>> main.c
>> index 57b226afeb84..20bac55a3e20 100644
>> --- a/drivers/net/thunderbolt/main.c
>> +++ b/drivers/net/thunderbolt/main.c
>> @@ -1257,12 +1257,23 @@ static void tbnet_get_stats64(struct 
>> net_device *dev,
>>       stats->rx_missed_errors = net->stats.rx_missed_errors;
>>   }
>> +static int tbnet_change_mtu(struct net_device *dev, int new_mtu)
>> +{
>> +    /* Keep the MTU within supported range */
>> +    if (new_mtu < 68 || new_mtu > (TBNET_MAX_MTU - ETH_HLEN))
>> +        return -EINVAL;
>> +
>> +    dev->mtu = new_mtu;
>> +    return 0;
>> +}
>> +
>>   static const struct net_device_ops tbnet_netdev_ops = {
>>       .ndo_open = tbnet_open,
>>       .ndo_stop = tbnet_stop,
>>       .ndo_start_xmit = tbnet_start_xmit,
>>       .ndo_set_mac_address = eth_mac_addr,
>>       .ndo_get_stats64 = tbnet_get_stats64,
>> +    .ndo_change_mtu    = tbnet_change_mtu,
>>   };
>>   static void tbnet_generate_mac(struct net_device *dev)
> 
> You can use struct net_device's min/max_mtu instead of a custom 
> ndo_change_mtu.
> They will be validated by dev_validate_mtu().
> 
> Cheers,
>   Nik
> 
> 

In fact it seems they're already set in tbnet_probe(), so you can drop
this patch altogether.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH RESEND net-next v2 1/5] net: thunderbolt: Allow changing MAC address of the device
  2026-01-09 12:26 ` [PATCH RESEND net-next v2 1/5] net: thunderbolt: Allow changing MAC address of the device Mika Westerberg
@ 2026-01-10 17:57   ` Andrew Lunn
  0 siblings, 0 replies; 12+ messages in thread
From: Andrew Lunn @ 2026-01-10 17:57 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: netdev, Yehezkel Bernat, Ian MacDonald, Salvatore Bonaccorso,
	Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Jay Vosburgh, Simon Horman

On Fri, Jan 09, 2026 at 01:26:02PM +0100, Mika Westerberg wrote:
> The MAC address we use is based on a suggestion in the USB4 Inter-domain
> spec but it is not really used in the USB4NET protocol. It is more
> targeted for the upper layers of the network stack. There is no reason
> why it should not be changed by the userspace for example if needed for
> bonding.
> 
> Reported-by: Ian MacDonald <ian@netstatz.com>
> Closes: https://lore.kernel.org/netdev/CAFJzfF9N4Hak23sc-zh0jMobbkjK7rg4odhic1DQ1cC+=MoQoA@mail.gmail.com/
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH RESEND net-next v2 3/5] net: ethtool: Add define for SPEED_80000
  2026-01-09 12:26 ` [PATCH RESEND net-next v2 3/5] net: ethtool: Add define for SPEED_80000 Mika Westerberg
@ 2026-01-10 18:03   ` Andrew Lunn
  0 siblings, 0 replies; 12+ messages in thread
From: Andrew Lunn @ 2026-01-10 18:03 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: netdev, Yehezkel Bernat, Ian MacDonald, Salvatore Bonaccorso,
	Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Jay Vosburgh, Simon Horman

On Fri, Jan 09, 2026 at 01:26:04PM +0100, Mika Westerberg wrote:
> USB4 v2 link used in peer-to-peer networking is symmetric 80 Gbps so in
> order to support reading this link speed, add it to ethtool.
> 
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> ---
>  include/uapi/linux/ethtool.h | 1 +

Hi Mika

There are a few other places which should be updated when a new speed
is added:

https://elixir.bootlin.com/linux/v6.18.4/source/drivers/net/phy/phy-core.c#L18
https://elixir.bootlin.com/linux/v6.18.4/source/drivers/net/phy/phy_caps.c#L9
https://elixir.bootlin.com/linux/v6.18.4/source/drivers/net/phy/phy_caps.c#L30
https://elixir.bootlin.com/linux/v6.18.4/source/drivers/net/phy/phylink.c#L307

    Andrew

---
pw-bot: cr

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH RESEND net-next v2 5/5] net: thunderbolt: Allow reading link settings
  2026-01-09 12:26 ` [PATCH RESEND net-next v2 5/5] net: thunderbolt: Allow reading link settings Mika Westerberg
@ 2026-01-10 18:08   ` Andrew Lunn
  0 siblings, 0 replies; 12+ messages in thread
From: Andrew Lunn @ 2026-01-10 18:08 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: netdev, Yehezkel Bernat, Ian MacDonald, Salvatore Bonaccorso,
	Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Jay Vosburgh, Simon Horman

On Fri, Jan 09, 2026 at 01:26:06PM +0100, Mika Westerberg wrote:
> From: Ian MacDonald <ian@netstatz.com>
> 
> In order to use Thunderbolt networking as part of bonding device it
> needs to support ->get_link_ksettings() ethtool operation, so that the
> bonding driver can read the link speed and the related attributes. Add
> support for this to the driver.
> 
> Signed-off-by: Ian MacDonald <ian@netstatz.com>
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-01-10 18:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-09 12:26 [PATCH RESEND net-next v2 0/5] net: thunderbolt: Various improvements Mika Westerberg
2026-01-09 12:26 ` [PATCH RESEND net-next v2 1/5] net: thunderbolt: Allow changing MAC address of the device Mika Westerberg
2026-01-10 17:57   ` Andrew Lunn
2026-01-09 12:26 ` [PATCH RESEND net-next v2 2/5] net: thunderbolt: Allow changing MTU " Mika Westerberg
2026-01-09 12:35   ` Nikolay Aleksandrov
2026-01-09 12:40     ` Nikolay Aleksandrov
2026-01-09 12:26 ` [PATCH RESEND net-next v2 3/5] net: ethtool: Add define for SPEED_80000 Mika Westerberg
2026-01-10 18:03   ` Andrew Lunn
2026-01-09 12:26 ` [PATCH RESEND net-next v2 4/5] bonding: 3ad: Add support " Mika Westerberg
2026-01-09 12:37   ` Nikolay Aleksandrov
2026-01-09 12:26 ` [PATCH RESEND net-next v2 5/5] net: thunderbolt: Allow reading link settings Mika Westerberg
2026-01-10 18:08   ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox