diff options
author | Neale Ranns <nranns@cisco.com> | 2018-06-10 18:01:49 -0700 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2018-06-10 18:01:49 -0700 |
commit | 43add7ff90526f807f3bcf1e8859d900a665e266 (patch) | |
tree | 83a43e09da83977f5cb601b8119a8dfc7b57b29b /src/plugins/igmp/igmp.c | |
parent | 01dc6b968aa1bfa9deea9917b3b45b89c80f6a24 (diff) |
IGMP: use simple u32 bit hash key
some IGMP hashse use only a u32 key, which is not stored in the object, so don't use memory based hash
Change-Id: Iaa4eddf568ea0164bc2a812da4cc502f1811b93c
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/plugins/igmp/igmp.c')
-rw-r--r-- | src/plugins/igmp/igmp.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/plugins/igmp/igmp.c b/src/plugins/igmp/igmp.c index 6499b5be466..15f6317c93c 100644 --- a/src/plugins/igmp/igmp.c +++ b/src/plugins/igmp/igmp.c @@ -74,7 +74,7 @@ igmp_clear_config (igmp_config_t * config) pool_free (config->groups); hash_free (config->igmp_group_by_key); - hash_unset_mem (im->igmp_config_by_sw_if_index, &config->sw_if_index); + hash_unset (im->igmp_config_by_sw_if_index, config->sw_if_index); pool_put (im->configs, config); } @@ -635,7 +635,7 @@ igmp_send_state_changed (vlib_main_t * vm, vlib_node_runtime_t * rt, igmp_clear_group (config, group); if (pool_elts (config->groups) == 0) { - hash_unset_mem (im->igmp_config_by_sw_if_index, &config->sw_if_index); + hash_unset (im->igmp_config_by_sw_if_index, config->sw_if_index); pool_put (im->configs, config); } } @@ -784,8 +784,8 @@ igmp_listen (vlib_main_t * vm, u8 enable, u32 sw_if_index, config->adj_index = adj_mcast_add_or_lock (FIB_PROTOCOL_IP4, VNET_LINK_IP4, config->sw_if_index); - hash_set_mem (im->igmp_config_by_sw_if_index, - &config->sw_if_index, config - im->configs); + hash_set (im->igmp_config_by_sw_if_index, + config->sw_if_index, config - im->configs); } else if (config->cli_api_configured != cli_api_configured) { @@ -979,10 +979,8 @@ igmp_init (vlib_main_t * vm) int i; if ((error = vlib_call_init_function (vm, ip4_lookup_init))) return error; - im->igmp_config_by_sw_if_index = - hash_create_mem (0, sizeof (u32), sizeof (uword)); - im->igmp_api_client_by_client_index = - hash_create_mem (0, sizeof (u32), sizeof (uword)); + im->igmp_config_by_sw_if_index = hash_create (0, sizeof (u32)); + im->igmp_api_client_by_client_index = hash_create (0, sizeof (u32)); vec_validate_aligned (im->buffers, tm->n_vlib_mains - 1, CLIB_CACHE_LINE_BYTES); ip4_register_protocol (IP_PROTOCOL_IGMP, igmp_input_node.index); |