@@ -942,3 +942,34 @@ mcast_snooping_wait(struct mcast_snooping *ms)
mcast_snooping_wait__(ms);
ovs_rwlock_unlock(&ms->rwlock);
}
+
+void
+mcast_snooping_flush_bundle(struct mcast_snooping *ms, void *port)
+{
+ struct mcast_group *g, *next_g;
+ struct mcast_mrouter_bundle *m, *next_m;
+
+ if (!mcast_snooping_enabled(ms)) {
+ return;
+ }
+
+ ovs_rwlock_wrlock(&ms->rwlock);
+ LIST_FOR_EACH_SAFE (g, next_g, group_node, &ms->group_lru) {
+ if (mcast_group_delete_bundle(ms, g, port)) {
+ ms->need_revalidate = true;
+
+ if (!mcast_group_has_bundles(g)) {
+ mcast_snooping_flush_group__(ms, g);
+ }
+ }
+ }
+
+ LIST_FOR_EACH_SAFE (m, next_m, mrouter_node, &ms->mrouter_lru) {
+ if (m->port == port) {
+ mcast_snooping_flush_mrouter(m);
+ ms->need_revalidate = true;
+ }
+ }
+
+ ovs_rwlock_unlock(&ms->rwlock);
+}
@@ -214,5 +214,6 @@ bool mcast_snooping_is_membership(ovs_be16 igmp_type);
/* Flush. */
void mcast_snooping_mdb_flush(struct mcast_snooping *ms);
void mcast_snooping_flush(struct mcast_snooping *ms);
+void mcast_snooping_flush_bundle(struct mcast_snooping *ms, void *port);
#endif /* mcast-snooping.h */
@@ -2948,6 +2948,7 @@ bundle_set(struct ofproto *ofproto_, void *aux,
* everything on this port and force flow revalidation. */
if (need_flush) {
bundle_flush_macs(bundle, false);
+ mcast_snooping_flush_bundle(ofproto->ms, bundle);
}
return 0;
If VLAN configuration(e.g. id, mode) change occurs, the IGMP snooping-learned multicast groups from this port on the VLAN are deleted. This avoids a MCAST_ENTRY_DEFAULT_IDLE_TIME delay before mdb is updated again. Hardware switches (e.g. cisco) also do that. Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech> --- lib/mcast-snooping.c | 31 +++++++++++++++++++++++++++++++ lib/mcast-snooping.h | 1 + ofproto/ofproto-dpif.c | 1 + 3 files changed, 33 insertions(+)