[PATCH net-next] net: thunderbolt: use eth_hw_addr_set()

Subsystems: networking drivers, the rest

STALE1785d LANDED

Landed in mainline as 5a48585d7ec1 on 2021-10-28.

3 messages, 3 authors, 2021-10-28 · open the first message on its own page

[PATCH net-next] net: thunderbolt: use eth_hw_addr_set()

From: Jakub Kicinski <kuba@kernel.org>
Date: 2021-10-26 17:55:51

Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it go through appropriate helpers.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: michael.jamet@intel.com
CC: mika.westerberg@linux.intel.com
CC: YehezkelShB@gmail.com
---
 drivers/net/thunderbolt.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/thunderbolt.c b/drivers/net/thunderbolt.c
index 9a6a8353e192..ff5d0e98a088 100644
--- a/drivers/net/thunderbolt.c
+++ b/drivers/net/thunderbolt.c
@@ -1202,17 +1202,19 @@ static void tbnet_generate_mac(struct net_device *dev)
 {
 	const struct tbnet *net = netdev_priv(dev);
 	const struct tb_xdomain *xd = net->xd;
+	u8 addr[ETH_ALEN];
 	u8 phy_port;
 	u32 hash;
 
 	phy_port = tb_phy_port_from_link(TBNET_L0_PORT_NUM(xd->route));
 
 	/* Unicast and locally administered MAC */
-	dev->dev_addr[0] = phy_port << 4 | 0x02;
+	addr[0] = phy_port << 4 | 0x02;
 	hash = jhash2((u32 *)xd->local_uuid, 4, 0);
-	memcpy(dev->dev_addr + 1, &hash, sizeof(hash));
+	memcpy(addr + 1, &hash, sizeof(hash));
 	hash = jhash2((u32 *)xd->local_uuid, 4, hash);
-	dev->dev_addr[5] = hash & 0xff;
+	addr[5] = hash & 0xff;
+	eth_hw_addr_set(dev, addr);
 }
 
 static int tbnet_probe(struct tb_service *svc, const struct tb_service_id *id)
-- 
2.31.1

Re: [PATCH net-next] net: thunderbolt: use eth_hw_addr_set()

From: Mika Westerberg <mika.westerberg@linux.intel.com>
Date: 2021-10-27 09:10:38

On Tue, Oct 26, 2021 at 10:55:47AM -0700, Jakub Kicinski wrote:
Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it go through appropriate helpers.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: michael.jamet@intel.com
CC: mika.westerberg@linux.intel.com
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>

Re: [PATCH net-next] net: thunderbolt: use eth_hw_addr_set()

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-10-28 01:10:14

Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski [off-list ref]:

On Tue, 26 Oct 2021 10:55:47 -0700 you wrote:
Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it go through appropriate helpers.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>

[...]
Here is the summary with links:
  - [net-next] net: thunderbolt: use eth_hw_addr_set()
    https://git.kernel.org/netdev/net-next/c/5a48585d7ec1

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help