Re: [PATCH net v2] net: hsr: clean up synced addresses and allmulti in hsr_del_port()
From: Hangbin Liu
Date: Fri Nov 13 2026 - 06:39:03 EST
Hi Wenbo,
On Fri, Nov 13, 2026 at 02:06:23PM +0800, Wenbo Sun wrote:
> Hi Hangbin,
>
> I sincerely apologize for sending out v2 too quickly yesterday before
> giving you enough time to review the previous discussion. I really appreciate
> your patience and thoughtful guidance.
>
> Regarding your question on whether dev_uc_unsync()/dev_mc_unsync() could be
> called from hsr_dev_close(), and whether they should be removed:
>
> I traced the function calls and verified the behavior in a User-Mode Linux
> (UML) environment across different lifecycle events:
>
> 1. Can they be called from hsr_dev_close()?
> Yes. When an administrator administratively brings down the HSR interface
> without deleting it (e.g. running "ip link set hsr0 down"):
> - hsr_dellink() is NOT called, and ports remain in hsr->ports.
> - dev_close() triggers ndo_stop (hsr_dev_close()), where hsr_for_each_port_rtnl()
> successfully iterates over SLAVE_A and SLAVE_B.
> - Both dev_uc_unsync() and dev_mc_unsync() ARE actively called here to unsync
> addresses, ensuring physical slaves stop filtering for HSR multicast while
> hsr0 is DOWN (and re-synced by hsr_set_rx_mode() once brought back UP).
> Therefore, they are NOT dead code in hsr_dev_close() and should NOT be removed.
Thanks, this looks good to me. We don’t need to clear the IFF_ALLMULTI flag
because the interface is only being brought down, we still need this flag
after it comes back up.
When the interface is brought up, `hsr_set_rx_mode` is also called to ensure
`dev_mc/uc_sync_multiple` runs. So the patch looks good to me.
Thanks
Hangbin