[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251127131521.2580237-2-mika.westerberg@linux.intel.com>
Date: Thu, 27 Nov 2025 14:15:19 +0100
From: Mika Westerberg <mika.westerberg@...ux.intel.com>
To: netdev@...r.kernel.org
Cc: 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>,
Mika Westerberg <mika.westerberg@...ux.intel.com>
Subject: [PATCH net-next 1/3] net: thunderbolt: Allow changing MAC address of the device
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@...statz.com>
Closes: https://lore.kernel.org/netdev/CAFJzfF9N4Hak23sc-zh0jMobbkjK7rg4odhic1DQ1cC+=MoQoA@mail.gmail.com/
Signed-off-by: Mika Westerberg <mika.westerberg@...ux.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
Powered by blists - more mailing lists