Looks Good.
On Mon, Mar 21, 2011 at 10:59 AM, Ben Pfaff <[email protected]> wrote: > The bridge will soon use this for expiring only the MAC learning entries > associated with a given port at port deletion time. > --- > lib/mac-learning.c | 24 ++++++++++++------------ > lib/mac-learning.h | 1 + > 2 files changed, 13 insertions(+), 12 deletions(-) > > diff --git a/lib/mac-learning.c b/lib/mac-learning.c > index 681a7db..4b4da19 100644 > --- a/lib/mac-learning.c > +++ b/lib/mac-learning.c > @@ -105,16 +105,6 @@ get_lru(struct mac_learning *ml, struct mac_entry **e) > } > } > > -/* Removes 'e' from the 'ml' hash table. 'e' must not already be on the free > - * list. */ > -static void > -free_mac_entry(struct mac_learning *ml, struct mac_entry *e) > -{ > - list_remove(&e->hash_node); > - list_remove(&e->lru_node); > - list_push_front(&ml->free, &e->lru_node); > -} > - > /* Creates and returns a new MAC learning table. */ > struct mac_learning * > mac_learning_create(void) > @@ -270,6 +260,16 @@ mac_learning_lookup(const struct mac_learning *ml, > } > } > > +/* Expires 'e' from the 'ml' hash table. 'e' must not already be on the free > + * list. */ > +void > +mac_learning_expire(struct mac_learning *ml, struct mac_entry *e) > +{ > + list_remove(&e->hash_node); > + list_remove(&e->lru_node); > + list_push_front(&ml->free, &e->lru_node); > +} > + > /* 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. */ > @@ -278,7 +278,7 @@ mac_learning_flush(struct mac_learning *ml) > { > struct mac_entry *e; > while (get_lru(ml, &e)){ > - free_mac_entry(ml, e); > + mac_learning_expire(ml, e); > } > } > > @@ -291,7 +291,7 @@ mac_learning_run(struct mac_learning *ml, struct tag_set > *set) > if (set) { > tag_set_add(set, e->tag); > } > - free_mac_entry(ml, e); > + mac_learning_expire(ml, e); > } > } > > diff --git a/lib/mac-learning.h b/lib/mac-learning.h > index 7343cbc..0fb3ce4 100644 > --- a/lib/mac-learning.h > +++ b/lib/mac-learning.h > @@ -113,6 +113,7 @@ struct mac_entry *mac_learning_lookup(const struct > mac_learning *, > uint16_t vlan, tag_type *); > > /* Flushing. */ > +void mac_learning_expire(struct mac_learning *, struct mac_entry *); > void mac_learning_flush(struct mac_learning *); > > #endif /* mac-learning.h */ > -- > 1.7.1 > > _______________________________________________ > dev mailing list > [email protected] > http://openvswitch.org/mailman/listinfo/dev > _______________________________________________ dev mailing list [email protected] http://openvswitch.org/mailman/listinfo/dev
