Skip to contentSkip to conversation

batman-adv: use eth_hw_addr_set() instead of ether_addr_copy()

PATCH Applied Jakub Kicinski 3 participants 4 messages Oct 19, 2021 – Oct 20, 2021

Subsystems (3)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH 1/1 batman-adv: use eth_hw_addr_set() instead of ether_addr_copy()

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 got through appropriate helpers.

Convert batman from ether_addr_copy() to eth_hw_addr_set():

@@
expression dev, np;
@@
- ether_addr_copy(dev->dev_addr, np)
+ eth_hw_addr_set(dev, np)

---
 net/batman-adv/soft-interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/batman-adv/soft-interface.c +1 -1
index 0604b0279573..7ee09337fc40 100644
@@ -134,7 +134,7 @@ static int batadv_interface_set_mac_addr(struct net_device *dev, void *p)
 		return -EADDRNOTAVAIL;
 
 	ether_addr_copy(old_addr, dev->dev_addr);
-	ether_addr_copy(dev->dev_addr, addr->sa_data);
+	eth_hw_addr_set(dev, addr->sa_data);
 
 	/* only modify transtable if it has been initialized before */
 	if (atomic_read(&bat_priv->mesh_state) != BATADV_MESH_ACTIVE)
Signature · 1 line
2.31.1
author maintainer
#1 lore raw
Quoted 7 lines · On Tue, 19 Oct 2021 09:39:27 -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 got through appropriate helpers.

Convert batman from ether_addr_copy() to eth_hw_addr_set():

Quoted 7 lines

@@
expression dev, np;
@@
- ether_addr_copy(dev->dev_addr, np)
+ eth_hw_addr_set(dev, np)

Extending CC list.

Quoted 13 lines
net/batman-adv/soft-interface.c +1 -1
index 0604b0279573..7ee09337fc40 100644
@@ -134,7 +134,7 @@ static int batadv_interface_set_mac_addr(struct net_device *dev, void *p)
 		return -EADDRNOTAVAIL;
 
 	ether_addr_copy(old_addr, dev->dev_addr);
-	ether_addr_copy(dev->dev_addr, addr->sa_data);
+	eth_hw_addr_set(dev, addr->sa_data);
 
 	/* only modify transtable if it has been initialized before */
 	if (atomic_read(&bat_priv->mesh_state) != BATADV_MESH_ACTIVE)
maintainer Acked-by
#2 lore raw
Quoted 14 lines · On Tuesday, 19 October 2021 21:06:54 CEST Jakub Kicinski wrote:
Quoted 13 lines · On Tue, 19 Oct 2021 09:39:27 -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 got through appropriate helpers.

Convert batman from ether_addr_copy() to eth_hw_addr_set():

@@
expression dev, np;
@@
- ether_addr_copy(dev->dev_addr, np)
+ eth_hw_addr_set(dev, np)

Quoted 3 lines
Quoted 1 line

Extending CC list.

Quoted 15 lines
Quoted 13 lines
net/batman-adv/soft-interface.c +1 -1
index 0604b0279573..7ee09337fc40 100644
@@ -134,7 +134,7 @@ static int batadv_interface_set_mac_addr(struct net_device *dev, void *p)
 		return -EADDRNOTAVAIL;
 
 	ether_addr_copy(old_addr, dev->dev_addr);
-	ether_addr_copy(dev->dev_addr, addr->sa_data);
+	eth_hw_addr_set(dev, addr->sa_data);
 
 	/* only modify transtable if it has been initialized before */
 	if (atomic_read(&bat_priv->mesh_state) != BATADV_MESH_ACTIVE)
#3 lore raw
In reply to Jakub Kicinski
This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:

Quoted 8 lines · On Tue, 19 Oct 2021 09:39:27 -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 got through appropriate helpers.

Convert batman from ether_addr_copy() to eth_hw_addr_set():

[...]

Here is the summary with links:
- batman-adv: use eth_hw_addr_set() instead of ether_addr_copy()

    https://git.kernel.org/netdev/net-next/c/0f00e70ef645

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