diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-09-03 18:50:35 -0400 | 
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-09-05 14:33:01 -0400 | 
| commit | bd74dc610a2069f8549a26668940ef655f51598d (patch) | |
| tree | c22aae3216f8c6ac50466ab8ce83fd58b7f9d77c /lib/if_rmap.c | |
| parent | f24fdd9921b98f99d63b1299029d177954090243 (diff) | |
lib: Hash creation cleanup
1) Some hash key functions where converting pointers
directly to a 32 bit value via downcasting.  Pointers
are 64 bit on a majority of our platforms.
2) Some hashes were being created with 256 entries,
downsize the hash creation size to more appropriate
values.
3) Add hash names to hash creation so we can watch
the hash via 'show debugging hashtable'
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/if_rmap.c')
| -rw-r--r-- | lib/if_rmap.c | 5 | 
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/if_rmap.c b/lib/if_rmap.c index 968c087c3c..53c2824a99 100644 --- a/lib/if_rmap.c +++ b/lib/if_rmap.c @@ -294,7 +294,10 @@ void if_rmap_reset()  void if_rmap_init(int node)  { -	ifrmaphash = hash_create(if_rmap_hash_make, if_rmap_hash_cmp, NULL); +	ifrmaphash = hash_create_size(4, +				      if_rmap_hash_make, +				      if_rmap_hash_cmp, +				      "Interface Route-Map Hash");  	if (node == RIPNG_NODE) {  	} else if (node == RIP_NODE) {  		install_element(RIP_NODE, &if_rmap_cmd);  | 
