From: Ido Schimmel <idosch@nvidia.com>
To: netdev@vger.kernel.org, bridge@lists.linux-foundation.org
Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
edumazet@google.com, razor@blackwall.org, horms@kernel.org,
Ido Schimmel <idosch@nvidia.com>
Subject: [PATCH net-next] bridge: mcast: Synchronously shutdown port multicast timers
Date: Wed, 3 Jun 2026 13:35:22 +0300 [thread overview]
Message-ID: <20260603103522.622411-1-idosch@nvidia.com> (raw)
Currently, while four timers are set up during port multicast context
initialization, only two are synchronously deleted when the context is
de-initialized, just before being deleted.
This is fine because the structure containing the multicast context
(either a bridge port or a VLAN) is only deleted after an RCU grace
period and it will not pass as long as the timers are executing. These
timers are also not supposed to do any work at this stage. They acquire
the bridge multicast lock, see that the multicast context was disabled
and exit.
Make the code more explicit and symmetric and synchronously shutdown all
four timers when the multicast context is de-initialized. Use
timer_shutdown_sync() to guarantee that the timers will not be re-armed
given that the containing structure is being deleted.
Acked-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
net/bridge/br_multicast.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 5d6fdfb43c04..c2c93c740415 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -2027,9 +2027,11 @@ void br_multicast_port_ctx_deinit(struct net_bridge_mcast_port *pmctx)
bool del = false;
#if IS_ENABLED(CONFIG_IPV6)
- timer_delete_sync(&pmctx->ip6_mc_router_timer);
+ timer_shutdown_sync(&pmctx->ip6_own_query.timer);
+ timer_shutdown_sync(&pmctx->ip6_mc_router_timer);
#endif
- timer_delete_sync(&pmctx->ip4_mc_router_timer);
+ timer_shutdown_sync(&pmctx->ip4_own_query.timer);
+ timer_shutdown_sync(&pmctx->ip4_mc_router_timer);
spin_lock_bh(&br->multicast_lock);
del |= br_ip6_multicast_rport_del(pmctx);
--
2.54.0
next reply other threads:[~2026-06-03 10:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-03 10:35 Ido Schimmel [this message]
2026-06-05 1:20 ` [PATCH net-next] bridge: mcast: Synchronously shutdown port multicast timers patchwork-bot+netdevbpf
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=20260603103522.622411-1-idosch@nvidia.com \
--to=idosch@nvidia.com \
--cc=bridge@lists.linux-foundation.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=razor@blackwall.org \
/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