From: Daniel Golle <daniel@makrotopia.org>
To: Andrew Lunn <andrew@lunn.ch>, Vladimir Oltean <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Russell King <linux@armlinux.org.uk>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH net-next] net: dsa: unsync host addresses when destroying user port
Date: Wed, 22 Jul 2026 01:12:47 +0100 [thread overview]
Message-ID: <34a027de7d860796d37de2f2108337eb82110144.1784679091.git.daniel@makrotopia.org> (raw)
When a user port is destroyed while addresses are still synced to it,
e.g. multicast addresses synced by a bridge the port is a member of,
the host FDB/MDB entries these addresses installed on the CPU port are
never removed: the only removal path is dsa_user_unsync_uc()/_mc() via
ndo_set_rx_mode, and __dev_set_rx_mode() does not call the ndo on a
device which is down. By the time the bridge unsyncs its addresses in
del_nbp() during unregistration, the netdev has already been closed,
so the unsync never reaches DSA and the entries linger until
dsa_switch_release_ports() reports them:
Cleaning up multicast address 33:33:00:00:00:01 vid 0 from port 9
This happens on every unbind of a DSA driver supporting host address
filtering while its ports are up.
Unsync the host addresses in dsa_user_destroy() before unregistering
the netdev, at a point where the driver can still process the
deletion, just like dsa_user_change_conduit() already does when
migrating host addresses to a new conduit.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
net/dsa/user.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/dsa/user.c b/net/dsa/user.c
index 03c7af6abe18..a7dabb645036 100644
--- a/net/dsa/user.c
+++ b/net/dsa/user.c
@@ -2885,6 +2885,7 @@ void dsa_user_destroy(struct net_device *user_dev)
netif_carrier_off(user_dev);
rtnl_lock();
+ dsa_user_unsync_ha(user_dev);
netdev_upper_dev_unlink(conduit, user_dev);
unregister_netdevice(user_dev);
phylink_disconnect_phy(dp->pl);
--
2.55.0
next reply other threads:[~2026-07-22 0:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-22 0:12 Daniel Golle [this message]
2026-07-23 22:57 ` Vladimir Oltean
2026-07-24 12:41 ` Vladimir Oltean
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=34a027de7d860796d37de2f2108337eb82110144.1784679091.git.daniel@makrotopia.org \
--to=daniel@makrotopia.org \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®