netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Ian MacDonald <ian@netstatz.com>
Cc: Mika Westerberg <westeri@kernel.org>,
	Yehezkel Bernat <YehezkelShB@gmail.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	1121032@bugs.debian.org
Subject: Re: net: thunderbolt: missing ndo_set_mac_address breaks 802.3ad bonding
Date: Fri, 21 Nov 2025 09:11:27 +0100	[thread overview]
Message-ID: <20251121081127.GS2912318@black.igk.intel.com> (raw)
In-Reply-To: <20251121060825.GR2912318@black.igk.intel.com>

Hi,

On Fri, Nov 21, 2025 at 07:08:25AM +0100, Mika Westerberg wrote:
> Hi Ian,
> 
> On Thu, Nov 20, 2025 at 03:59:15PM -0500, Ian MacDonald wrote:
> > Hi,
> > 
> > Using two Thunderbolt network interfaces as slaves in a bonding device
> > in mode 802.3ad (LACP) fails because the bonding driver cannot set the
> > MAC address on the thunderbolt_net interfaces. The same setup works in
> > mode active-backup.
> > 
> > Hardware: AMD Strix Halo (Framework connect to Sixunited AXB35 USB4 ports)
> > Kernel:  6.12.57 (also reproduced on 6.16.12 and 6.18~rc6)
> 
> Okay "breaks" is probably too strong word here. It was never even supported
> :)
> 
> > 
> > Steps to reproduce:
> > 1. Create a bond with mode 802.3ad and add thunderbolt0 and thunderbolt1
> >    as slaves.
> > 2. Bring up the bond and slaves.
> 
> Can you describe what are the actual commands you run so I can try to
> setup on my side and see how this could be implemented?

Okay since the MAC address is not really being used in the USB4NET protocol
it should be fine to allow it to be changed.

The below allows me to change it using "ip link set" command. I wonder if
you could try it with the bonding case and see it that makes any
difference?

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.51.0


  reply	other threads:[~2025-11-21  8:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-20 20:59 net: thunderbolt: missing ndo_set_mac_address breaks 802.3ad bonding Ian MacDonald
2025-11-21  6:08 ` Mika Westerberg
2025-11-21  8:11   ` Mika Westerberg [this message]
2025-11-21 16:50   ` Ian MacDonald
2025-11-26  8:16     ` Bug#1121032: " Salvatore Bonaccorso
2025-11-26 23:39     ` Ian MacDonald
2025-11-27  5:33       ` Mika Westerberg
2025-11-27 18:59         ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251121081127.GS2912318@black.igk.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=1121032@bugs.debian.org \
    --cc=YehezkelShB@gmail.com \
    --cc=ian@netstatz.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=westeri@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).