diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-08-04 15:04:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-04 15:04:12 +0200 |
commit | 6b367962158aba5567b7f01a3cad39b2de53828b (patch) | |
tree | 59fc066ead7cf750b0e8e9adae8fc2063a3533af /lib/table.c | |
parent | Merge pull request #891 from Jafaral/portability (diff) | |
parent | isisd: Use a hashtable to speed up lookups during SPF (diff) | |
download | frr-6b367962158aba5567b7f01a3cad39b2de53828b.tar.xz frr-6b367962158aba5567b7f01a3cad39b2de53828b.zip |
Merge pull request #909 from opensourcerouting/isis-perf
IS-IS: improve spf performance
Diffstat (limited to 'lib/table.c')
-rw-r--r-- | lib/table.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/lib/table.c b/lib/table.c index 007d41778..833adb9a3 100644 --- a/lib/table.c +++ b/lib/table.c @@ -27,7 +27,6 @@ #include "table.h" #include "memory.h" #include "sockunion.h" -#include "jhash.h" DEFINE_MTYPE(LIB, ROUTE_TABLE, "Route table") DEFINE_MTYPE(LIB, ROUTE_NODE, "Route node") @@ -35,18 +34,6 @@ DEFINE_MTYPE(LIB, ROUTE_NODE, "Route node") static void route_node_delete(struct route_node *); static void route_table_free(struct route_table *); -static unsigned route_table_hash_key(void *pp) -{ - struct prefix copy; - - /* make sure *all* unused bits are zero, particularly including - * alignment / - * padding and unused prefix bytes. */ - memset(©, 0, sizeof(copy)); - prefix_copy(©, (struct prefix *)pp); - return jhash(©, sizeof(copy), 0x55aa5a5a); -} - static int route_table_hash_cmp(const void *a, const void *b) { const struct prefix *pa = a, *pb = b; @@ -63,7 +50,7 @@ route_table_init_with_delegate(route_table_delegate_t *delegate) rt = XCALLOC(MTYPE_ROUTE_TABLE, sizeof(struct route_table)); rt->delegate = delegate; - rt->hash = hash_create(route_table_hash_key, route_table_hash_cmp, + rt->hash = hash_create(prefix_hash_key, route_table_hash_cmp, "route table hash"); return rt; } |