public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: hsr: emit notification for PRP slave2 changed hw addr on port deletion
@ 2026-04-03 12:39 Fernando Fernandez Mancera
  2026-04-07 13:29 ` Paolo Abeni
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Fernando Fernandez Mancera @ 2026-04-03 12:39 UTC (permalink / raw)
  To: netdev
  Cc: acsjakub, liuhangbin, kees, horms, pabeni, kuba, edumazet, davem,
	fmaurer, Fernando Fernandez Mancera, Luka Gejak

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")
Reported-by: Luka Gejak <luka.gejak@linux.dev>
Closes: https://lore.kernel.org/netdev/DHFCZEM93FTT.1RWFBIE32K7OT@linux.dev/
Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
---
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(-)

diff --git a/net/hsr/hsr_slave.c b/net/hsr/hsr_slave.c
index 44f83c8c56a7..d9af9e65f72f 100644
--- a/net/hsr/hsr_slave.c
+++ b/net/hsr/hsr_slave.c
@@ -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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] net: hsr: emit notification for PRP slave2 changed hw addr on port deletion
  2026-04-03 12:39 [PATCH net-next] net: hsr: emit notification for PRP slave2 changed hw addr on port deletion Fernando Fernandez Mancera
@ 2026-04-07 13:29 ` Paolo Abeni
  2026-04-07 13:37   ` Fernando Fernandez Mancera
  2026-04-07 14:08 ` Felix Maurer
  2026-04-07 15:10 ` patchwork-bot+netdevbpf
  2 siblings, 1 reply; 6+ messages in thread
From: Paolo Abeni @ 2026-04-07 13:29 UTC (permalink / raw)
  To: Fernando Fernandez Mancera, netdev
  Cc: acsjakub, liuhangbin, kees, horms, kuba, edumazet, davem, fmaurer,
	Luka Gejak

On 4/3/26 2:39 PM, Fernando Fernandez Mancera 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.
> 
> Fixes: b65999e7238e ("net: hsr: sync hw addr of slave2 according to slave1 hw addr on PRP")
> Reported-by: Luka Gejak <luka.gejak@linux.dev>
> Closes: https://lore.kernel.org/netdev/DHFCZEM93FTT.1RWFBIE32K7OT@linux.dev/
> Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
> ---
> 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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] net: hsr: emit notification for PRP slave2 changed hw addr on port deletion
  2026-04-07 13:29 ` Paolo Abeni
@ 2026-04-07 13:37   ` Fernando Fernandez Mancera
  2026-04-07 15:08     ` Paolo Abeni
  0 siblings, 1 reply; 6+ messages in thread
From: Fernando Fernandez Mancera @ 2026-04-07 13:37 UTC (permalink / raw)
  To: Paolo Abeni, netdev
  Cc: acsjakub, liuhangbin, kees, horms, kuba, edumazet, davem, fmaurer,
	Luka Gejak

On 4/7/26 3:29 PM, Paolo Abeni wrote:
> On 4/3/26 2:39 PM, Fernando Fernandez Mancera 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.
>>
>> Fixes: b65999e7238e ("net: hsr: sync hw addr of slave2 according to slave1 hw addr on PRP")
>> Reported-by: Luka Gejak <luka.gejak@linux.dev>
>> Closes: https://lore.kernel.org/netdev/DHFCZEM93FTT.1RWFBIE32K7OT@linux.dev/
>> Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
>> ---
>> 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?
> 

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.

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] net: hsr: emit notification for PRP slave2 changed hw addr on port deletion
  2026-04-03 12:39 [PATCH net-next] net: hsr: emit notification for PRP slave2 changed hw addr on port deletion Fernando Fernandez Mancera
  2026-04-07 13:29 ` Paolo Abeni
@ 2026-04-07 14:08 ` Felix Maurer
  2026-04-07 15:10 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 6+ messages in thread
From: Felix Maurer @ 2026-04-07 14:08 UTC (permalink / raw)
  To: Fernando Fernandez Mancera
  Cc: netdev, acsjakub, liuhangbin, kees, horms, pabeni, kuba, edumazet,
	davem, Luka Gejak

On Fri, Apr 03, 2026 at 02:39:29PM +0200, Fernando Fernandez Mancera 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.
>
> Fixes: b65999e7238e ("net: hsr: sync hw addr of slave2 according to slave1 hw addr on PRP")
> Reported-by: Luka Gejak <luka.gejak@linux.dev>
> Closes: https://lore.kernel.org/netdev/DHFCZEM93FTT.1RWFBIE32K7OT@linux.dev/
> Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>

I don't have a preference for the tree, but:
Reviewed-by: Felix Maurer <fmaurer@redhat.com>

> ---
> 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(-)
>
> diff --git a/net/hsr/hsr_slave.c b/net/hsr/hsr_slave.c
> index 44f83c8c56a7..d9af9e65f72f 100644
> --- a/net/hsr/hsr_slave.c
> +++ b/net/hsr/hsr_slave.c
> @@ -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
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] net: hsr: emit notification for PRP slave2 changed hw addr on port deletion
  2026-04-07 13:37   ` Fernando Fernandez Mancera
@ 2026-04-07 15:08     ` Paolo Abeni
  0 siblings, 0 replies; 6+ messages in thread
From: Paolo Abeni @ 2026-04-07 15:08 UTC (permalink / raw)
  To: Fernando Fernandez Mancera, netdev
  Cc: acsjakub, liuhangbin, kees, horms, kuba, edumazet, davem, fmaurer,
	Luka Gejak

On 4/7/26 3:37 PM, Fernando Fernandez Mancera wrote:
> On 4/7/26 3:29 PM, Paolo Abeni wrote:
>> On 4/3/26 2:39 PM, Fernando Fernandez Mancera 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.
>>>
>>> Fixes: b65999e7238e ("net: hsr: sync hw addr of slave2 according to slave1 hw addr on PRP")
>>> Reported-by: Luka Gejak <luka.gejak@linux.dev>
>>> Closes: https://lore.kernel.org/netdev/DHFCZEM93FTT.1RWFBIE32K7OT@linux.dev/
>>> Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
>>> ---
>>> 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?
>>
> 
> 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.

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

/P


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] net: hsr: emit notification for PRP slave2 changed hw addr on port deletion
  2026-04-03 12:39 [PATCH net-next] net: hsr: emit notification for PRP slave2 changed hw addr on port deletion Fernando Fernandez Mancera
  2026-04-07 13:29 ` Paolo Abeni
  2026-04-07 14:08 ` Felix Maurer
@ 2026-04-07 15:10 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-04-07 15:10 UTC (permalink / raw)
  To: Fernando Fernandez Mancera
  Cc: netdev, acsjakub, liuhangbin, kees, horms, pabeni, kuba, edumazet,
	davem, fmaurer, luka.gejak

Hello:

This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-04-07 15:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-03 12:39 [PATCH net-next] net: hsr: emit notification for PRP slave2 changed hw addr on port deletion Fernando Fernandez Mancera
2026-04-07 13:29 ` Paolo Abeni
2026-04-07 13:37   ` Fernando Fernandez Mancera
2026-04-07 15:08     ` Paolo Abeni
2026-04-07 14:08 ` Felix Maurer
2026-04-07 15:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox