aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEthan Jackson <ethan@nicira.com>2011-07-21 17:58:47 -0700
committerEthan Jackson <ethan@nicira.com>2011-07-21 18:01:27 -0700
commit7bbe0453f5c6321c410149755de60324c186a71a (patch)
tree4f0a9883b34021d0d2f7cae651ae635d28ad8efd
parent3a27375ead10be81e7122aaff8bb2a17c7c202a7 (diff)
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.
-rw-r--r--lib/mac-learning.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/mac-learning.c b/lib/mac-learning.c
index f9f4db3d..ff240e97 100644
--- a/lib/mac-learning.c
+++ b/lib/mac-learning.c
@@ -74,7 +74,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;
}