Thanks for the review, I incorporated your comments and pushed this.

Ethan

On Fri, Jul 22, 2011 at 15:45, Ben Pfaff <[email protected]> wrote:
> On Fri, Jul 22, 2011 at 01:36:26PM -0700, Ethan Jackson wrote:
>> The mac-learning implementation used a free list to keep track of
>> statically allocated table entries.  This made the code slightly
>> more difficult to understand than the more straightforward heap
>> based strategy implemented by this patch.
>
> This should also update the comment on the declaration of lru_node in
> struct mac_entry (it's never a member of a free list anymore).
>
> I'd add a call to hmap_shrink() into mac_learning_flush().
>
> In mac_learning_insert(), instead of trying to avoid a free() and
> malloc() if the table is full, I'd just do
>
>        if (hmap_count(&ml->table) >= MAC_MAX) {
>            get_lru(ml, &e);
>            mac_learning_expire(ml, e);
>        }
>
> The comment on mac_learning_expire() still mentions a free list.
>
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to