Skip to contentSkip to conversation

net: hsr: emit notification for PRP slave2 changed hw addr on port deletion

PATCH Applied Fernando Fernandez Mancera 4 participants 6 messages Apr 3 – Apr 7

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: hsr: emit notification for PRP slave2 changed hw addr on port deletion

On PRP protocol, when deleting the port the MAC address change notification was missing. In addition to that, make sure to only perform the MAC address change on slave2 deletion and PRP protocol as the operation isn't necessary for HSR nor slave1.

Note that the eth_hw_addr_set() is correct on PRP context as the slaves are either in promiscuous mode or forward offload enabled.

Fixes b65999e7238e ("net: hsr: sync hw addr of slave2 according to slave1 hw addr on PRP")

---
Note: routed through net-next tree as the next net tree as rc6 batch is already out and I do not think this is worth to be included in a last call batch. Anyway, if maintainer thinks it is, feel free to apply it to net tree.

---
 net/hsr/hsr_slave.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
net/hsr/hsr_slave.c +5 -1
index 44f83c8c56a7..d9af9e65f72f 100644
@@ -243,7 +243,11 @@ void hsr_del_port(struct hsr_port *port)
 		if (!port->hsr->fwd_offloaded)
 			dev_set_promiscuity(port->dev, -1);
 		netdev_upper_dev_unlink(port->dev, master->dev);
-		eth_hw_addr_set(port->dev, port->original_macaddress);
+		if (hsr->prot_version == PRP_V1 &&
+		    port->type == HSR_PT_SLAVE_B) {
+			eth_hw_addr_set(port->dev, port->original_macaddress);
+			call_netdevice_notifiers(NETDEV_CHANGEADDR, port->dev);
+		}
 	}
 
 	kfree_rcu(port, rcu);
Signature · 1 line
2.53.0
maintainer
#1 lore raw
Quoted 12 lines · Fernando Fernandez Mancera

On PRP protocol, when deleting the port the MAC address change notification was missing. In addition to that, make sure to only perform the MAC address change on slave2 deletion and PRP protocol as the operation isn't necessary for HSR nor slave1.

Note that the eth_hw_addr_set() is correct on PRP context as the slaves are either in promiscuous mode or forward offload enabled.

Fixes b65999e7238e ("net: hsr: sync hw addr of slave2 according to slave1 hw addr on PRP")
Quoted 5 lines

---
Note: routed through net-next tree as the next net tree as rc6 batch is already out and I do not think this is worth to be included in a last call batch. Anyway, if maintainer thinks it is, feel free to apply it to net tree.

The general guidance is to avoid fixes tag for net-next patches that do not fix net-next specific code. In this case I assume you want the patch landing into stable right?

I think a net target would be better, please LMK.

/P

#2 lore raw
Quoted 19 lines · Paolo Abeni
Quoted 12 lines · Fernando Fernandez Mancera

On PRP protocol, when deleting the port the MAC address change notification was missing. In addition to that, make sure to only perform the MAC address change on slave2 deletion and PRP protocol as the operation isn't necessary for HSR nor slave1.

Note that the eth_hw_addr_set() is correct on PRP context as the slaves are either in promiscuous mode or forward offload enabled.

Fixes b65999e7238e ("net: hsr: sync hw addr of slave2 according to slave1 hw addr on PRP")
Quoted 5 lines

---
Note: routed through net-next tree as the next net tree as rc6 batch is already out and I do not think this is worth to be included in a last call batch. Anyway, if maintainer thinks it is, feel free to apply it to net tree.

Quoted 4 lines

The general guidance is to avoid fixes tag for net-next patches that do not fix net-next specific code. In this case I assume you want the patch landing into stable right?

Hi Paolo,

Noted. I wanted to reduce the number of patches on net tree given we are at the end of the development cycle. To be honest, the stable backport isn't that important here, this is a trivial fix that I doubt it was breaking anyone.

Maybe drop Fixes tag and get it into net-next then? Fine for me anyway, I trust your judgement on this.

Thanks,
Fernando.

Quoted 4 lines

I think a net target would be better, please LMK.

/P

maintainer
#3 lore raw
Quoted 27 lines · Fernando Fernandez Mancera
Quoted 19 lines · Paolo Abeni
Quoted 12 lines · Fernando Fernandez Mancera

On PRP protocol, when deleting the port the MAC address change notification was missing. In addition to that, make sure to only perform the MAC address change on slave2 deletion and PRP protocol as the operation isn't necessary for HSR nor slave1.

Note that the eth_hw_addr_set() is correct on PRP context as the slaves are either in promiscuous mode or forward offload enabled.

Fixes b65999e7238e ("net: hsr: sync hw addr of slave2 according to slave1 hw addr on PRP")
Quoted 5 lines

---
Note: routed through net-next tree as the next net tree as rc6 batch is already out and I do not think this is worth to be included in a last call batch. Anyway, if maintainer thinks it is, feel free to apply it to net tree.

Quoted 4 lines

The general guidance is to avoid fixes tag for net-next patches that do not fix net-next specific code. In this case I assume you want the patch landing into stable right?

Hi Paolo,

Quoted 7 lines

Noted. I wanted to reduce the number of patches on net tree given we are at the end of the development cycle. To be honest, the stable backport isn't that important here, this is a trivial fix that I doubt it was breaking anyone.

Maybe drop Fixes tag and get it into net-next then? Fine for me anyway, I trust your judgement on this.

I'm seconding such option, as I think too much stuff is already landing into stable.

/P

Reviewed-by on v1 1/1
#4 lore raw
In reply to Fernando Fernandez Mancera
Quoted 5 lines · Fernando Fernandez Mancera

On PRP protocol, when deleting the port the MAC address change notification was missing. In addition to that, make sure to only perform the MAC address change on slave2 deletion and PRP protocol as the operation isn't necessary for HSR nor slave1.

Quoted 7 lines

Note that the eth_hw_addr_set() is correct on PRP context as the slaves are either in promiscuous mode or forward offload enabled.

Fixes b65999e7238e ("net: hsr: sync hw addr of slave2 according to slave1 hw addr on PRP")

I don't have a preference for the tree, but:

Quoted 29 lines

---
Note: routed through net-next tree as the next net tree as rc6 batch is already out and I do not think this is worth to be included in a last call batch. Anyway, if maintainer thinks it is, feel free to apply it to net tree.

---
 net/hsr/hsr_slave.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
net/hsr/hsr_slave.c +5 -2
index 44f83c8c56a7..d9af9e65f72f 100644
@@ -243,7 +243,11 @@ void hsr_del_port(struct hsr_port *port)
 		if (!port->hsr->fwd_offloaded)
 			dev_set_promiscuity(port->dev, -1);
 		netdev_upper_dev_unlink(port->dev, master->dev);
-		eth_hw_addr_set(port->dev, port->original_macaddress);
+		if (hsr->prot_version == PRP_V1 &&
+		    port->type == HSR_PT_SLAVE_B) {
+			eth_hw_addr_set(port->dev, port->original_macaddress);
+			call_netdevice_notifiers(NETDEV_CHANGEADDR, port->dev);
+		}
 	}
 
 	kfree_rcu(port, rcu);
--

2.53.0

#5 lore raw
In reply to Fernando Fernandez Mancera
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Quoted 9 lines · On Fri, 3 Apr 2026 14:39:29 +0200 you wrote:

On PRP protocol, when deleting the port the MAC address change notification was missing. In addition to that, make sure to only perform the MAC address change on slave2 deletion and PRP protocol as the operation isn't necessary for HSR nor slave1.

Note that the eth_hw_addr_set() is correct on PRP context as the slaves are either in promiscuous mode or forward offload enabled.

[...]

Here is the summary with links:
- [net-next] net: hsr: emit notification for PRP slave2 changed hw addr on port deletion

    https://git.kernel.org/netdev/net-next/c/2ce8a41113ed

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html