From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: netdev@vger.kernel.org
Cc: Yehezkel Bernat <YehezkelShB@gmail.com>,
Ian MacDonald <ian@netstatz.com>,
Salvatore Bonaccorso <carnil@debian.org>,
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>,
Jay Vosburgh <jv@jvosburgh.net>, Simon Horman <horms@kernel.org>,
Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: [PATCH RESEND net-next v2 1/5] net: thunderbolt: Allow changing MAC address of the device
Date: Fri, 9 Jan 2026 13:26:02 +0100 [thread overview]
Message-ID: <20260109122606.3586895-2-mika.westerberg@linux.intel.com> (raw)
In-Reply-To: <20260109122606.3586895-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/
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-09 12:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2026-01-10 17:57 ` [PATCH RESEND net-next v2 1/5] net: thunderbolt: Allow changing MAC address of the device 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
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=20260109122606.3586895-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=horms@kernel.org \
--cc=ian@netstatz.com \
--cc=jv@jvosburgh.net \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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