From: Ethan Jackson Date: Fri, 22 Jul 2011 00:58:47 +0000 (-0700) Subject: mac-learning: Fix serious performance bug in the learning table. X-Git-Tag: v1.1.2~14 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=44f2560c67fca0d5712a3bec309e4e93e9e63a7b mac-learning: Fix serious performance bug in the learning table. Due to a typo, the mac-learning hash table had dissolved into a linked list. This caused a significant reduction in performance. --- diff --git a/lib/mac-learning.c b/lib/mac-learning.c index 42864ce0b..b010406c7 100644 --- a/lib/mac-learning.c +++ b/lib/mac-learning.c @@ -73,7 +73,7 @@ mac_table_bucket(const struct mac_learning *ml, uint16_t vlan) { uint32_t hash = mac_table_hash(mac, vlan); - const struct list *list = &ml->table[hash & MAC_HASH_BITS]; + const struct list *list = &ml->table[hash & MAC_HASH_MASK]; return (struct list *) list; }