From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: netdev@vger.kernel.org
Cc: Ian MacDonald <ian@netstatz.com>, Jay Vosburgh <jv@jvosburgh.net>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
Yehezkel Bernat <YehezkelShB@gmail.com>,
Simon Horman <horms@kernel.org>,
Salvatore Bonaccorso <carnil@debian.org>,
Nikolay Aleksandrov <razor@blackwall.org>,
Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: [PATCH net-next v3 1/4] net: thunderbolt: Allow changing MAC address of the device
Date: Thu, 15 Jan 2026 12:56:43 +0100 [thread overview]
Message-ID: <20260115115646.328898-2-mika.westerberg@linux.intel.com> (raw)
In-Reply-To: <20260115115646.328898-1-mika.westerberg@linux.intel.com>
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/
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
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
next prev parent reply other threads:[~2026-01-15 11:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-15 11:56 [PATCH net-next v3 0/4] net: thunderbolt: Various improvements Mika Westerberg
2026-01-15 11:56 ` Mika Westerberg [this message]
2026-01-15 11:56 ` [PATCH net-next v3 2/4] net: ethtool: Add support for 80Gbps speed Mika Westerberg
2026-01-15 17:44 ` Andrew Lunn
2026-01-15 11:56 ` [PATCH net-next v3 3/4] bonding: 3ad: Add support for SPEED_80000 Mika Westerberg
2026-01-15 17:09 ` Nikolay Aleksandrov
2026-01-15 11:56 ` [PATCH net-next v3 4/4] net: thunderbolt: Allow reading link settings Mika Westerberg
2026-01-19 20:30 ` [PATCH net-next v3 0/4] net: thunderbolt: Various improvements patchwork-bot+netdevbpf
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=20260115115646.328898-2-mika.westerberg@linux.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=YehezkelShB@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=carnil@debian.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=horms@kernel.org \
--cc=ian@netstatz.com \
--cc=jv@jvosburgh.net \
--cc=kuba@kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=razor@blackwall.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