* [PATCH net-next] net: bridge: mcast: remove only S,G port groups from sg_port hash
@ 2020-09-25 10:25 Nikolay Aleksandrov
2020-09-25 23:50 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Nikolay Aleksandrov @ 2020-09-25 10:25 UTC (permalink / raw)
To: netdev; +Cc: roopa, bridge, davem, Nikolay Aleksandrov
From: Nikolay Aleksandrov <nikolay@nvidia.com>
We should remove a group from the sg_port hash only if it's an S,G
entry. This makes it correct and more symmetric with group add. Also
since *,G groups are not added to that hash we can hide a bug.
Fixes: 085b53c8beab ("net: bridge: mcast: add sg_port rhashtable")
Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
---
net/bridge/br_multicast.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 66eb62ded192..eae898c3cff7 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -590,17 +590,18 @@ void br_multicast_del_pg(struct net_bridge_mdb_entry *mp,
struct net_bridge_group_src *ent;
struct hlist_node *tmp;
- rhashtable_remove_fast(&br->sg_port_tbl, &pg->rhnode,
- br_sg_port_rht_params);
rcu_assign_pointer(*pp, pg->next);
hlist_del_init(&pg->mglist);
hlist_for_each_entry_safe(ent, tmp, &pg->src_list, node)
br_multicast_del_group_src(ent);
br_mdb_notify(br->dev, mp, pg, RTM_DELMDB);
- if (!br_multicast_is_star_g(&mp->addr))
+ if (!br_multicast_is_star_g(&mp->addr)) {
+ rhashtable_remove_fast(&br->sg_port_tbl, &pg->rhnode,
+ br_sg_port_rht_params);
br_multicast_sg_del_exclude_ports(mp);
- else
+ } else {
br_multicast_star_g_handle_mode(pg, MCAST_INCLUDE);
+ }
hlist_add_head(&pg->mcast_gc.gc_node, &br->mcast_gc_list);
queue_work(system_long_wq, &br->mcast_gc_work);
--
2.25.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: bridge: mcast: remove only S,G port groups from sg_port hash
2020-09-25 10:25 [PATCH net-next] net: bridge: mcast: remove only S,G port groups from sg_port hash Nikolay Aleksandrov
@ 2020-09-25 23:50 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-09-25 23:50 UTC (permalink / raw)
To: razor; +Cc: netdev, roopa, bridge, nikolay
From: Nikolay Aleksandrov <razor@blackwall.org>
Date: Fri, 25 Sep 2020 13:25:49 +0300
> From: Nikolay Aleksandrov <nikolay@nvidia.com>
>
> We should remove a group from the sg_port hash only if it's an S,G
> entry. This makes it correct and more symmetric with group add. Also
> since *,G groups are not added to that hash we can hide a bug.
>
> Fixes: 085b53c8beab ("net: bridge: mcast: add sg_port rhashtable")
> Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-09-25 23:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-25 10:25 [PATCH net-next] net: bridge: mcast: remove only S,G port groups from sg_port hash Nikolay Aleksandrov
2020-09-25 23:50 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).