free(e);
}
-/* Expires all the mac-learning entries in 'ml'. The tags in 'ml' are
- * discarded, so the client is responsible for revalidating any flows that
- * depend on 'ml', if necessary. */
+/* Expires all the mac-learning entries in 'ml'. If not NULL, the tags in 'ml'
+ * are added to 'tags'. Otherwise the tags in 'ml' are discarded. The client
+ * is responsible for revalidating any flows that depend on 'ml', if
+ * necessary. */
void
-mac_learning_flush(struct mac_learning *ml)
+mac_learning_flush(struct mac_learning *ml, struct tag_set *tags)
{
struct mac_entry *e;
while (get_lru(ml, &e)){
+ if (tags) {
+ tag_set_add(tags, e->tag);
+ }
mac_learning_expire(ml, e);
}
hmap_shrink(&ml->table);
if (stp_learn_in_state(ofport->stp_state)
!= stp_learn_in_state(state)) {
/* xxx Learning action flows should also be flushed. */
- mac_learning_flush(ofproto->ml);
+ mac_learning_flush(ofproto->ml, &ofproto->revalidate_set);
}
fwd_change = stp_forward_in_state(ofport->stp_state)
!= stp_forward_in_state(state);
}
ofproto->need_revalidate = true;
- mac_learning_flush(ofproto->ml);
+ mac_learning_flush(ofproto->ml, &ofproto->revalidate_set);
mirror_update_dups(ofproto);
return 0;
ofproto = mirror->ofproto;
ofproto->need_revalidate = true;
- mac_learning_flush(ofproto->ml);
+ mac_learning_flush(ofproto->ml, &ofproto->revalidate_set);
mirror_bit = MIRROR_MASK_C(1) << mirror->idx;
HMAP_FOR_EACH (bundle, hmap_node, &ofproto->bundles) {
{
struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofproto_);
if (mac_learning_set_flood_vlans(ofproto->ml, flood_vlans)) {
- ofproto->need_revalidate = true;
- mac_learning_flush(ofproto->ml);
+ mac_learning_flush(ofproto->ml, &ofproto->revalidate_set);
}
return 0;
}
unixctl_command_reply(conn, 501, "no such bridge");
return;
}
- mac_learning_flush(ofproto->ml);
- ofproto->need_revalidate = true;
+ mac_learning_flush(ofproto->ml, &ofproto->revalidate_set);
} else {
HMAP_FOR_EACH (ofproto, all_ofproto_dpifs_node, &all_ofproto_dpifs) {
- mac_learning_flush(ofproto->ml);
- ofproto->need_revalidate = true;
+ mac_learning_flush(ofproto->ml, &ofproto->revalidate_set);
}
}