mac-learning: Fix serious performance bug in the learning table.
authorEthan Jackson <ethan@nicira.com>
Fri, 22 Jul 2011 00:58:47 +0000 (17:58 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 25 Jul 2011 19:20:41 +0000 (12:20 -0700)
Due to a typo, the mac-learning hash table had dissolved into a
linked list.  This caused a significant reduction in performance.

lib/mac-learning.c

index af46e3c..b7320e8 100644 (file)
@@ -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;
 }