summaryrefslogtreecommitdiffstats
path: root/src/plugins/igmp/igmp_api.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2018-06-10 18:01:49 -0700
committerNeale Ranns <nranns@cisco.com>2018-06-10 18:01:49 -0700
commit43add7ff90526f807f3bcf1e8859d900a665e266 (patch)
tree83a43e09da83977f5cb601b8119a8dfc7b57b29b /src/plugins/igmp/igmp_api.c
parent01dc6b968aa1bfa9deea9917b3b45b89c80f6a24 (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_api.c')
-rw-r--r--src/plugins/igmp/igmp_api.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/plugins/igmp/igmp_api.c b/src/plugins/igmp/igmp_api.c
index 164779c3e5a..fc5ce1b6431 100644
--- a/src/plugins/igmp/igmp_api.c
+++ b/src/plugins/igmp/igmp_api.c
@@ -204,7 +204,7 @@ igmp_api_client_lookup (igmp_main_t * im, u32 client_index)
uword *p;
vpe_client_registration_t *api_client = NULL;
- p = hash_get_mem (im->igmp_api_client_by_client_index, &client_index);
+ p = hash_get (im->igmp_api_client_by_client_index, client_index);
if (p)
api_client = vec_elt_at_index (im->api_clients, p[0]);
@@ -227,8 +227,8 @@ vl_api_want_igmp_events_t_handler (vl_api_want_igmp_events_t * mp)
rv = VNET_API_ERROR_INVALID_REGISTRATION;
goto done;
}
- hash_unset_mem (im->igmp_api_client_by_client_index,
- &api_client->client_index);
+ hash_unset (im->igmp_api_client_by_client_index,
+ api_client->client_index);
pool_put (im->api_clients, api_client);
goto done;
}
@@ -238,8 +238,8 @@ vl_api_want_igmp_events_t_handler (vl_api_want_igmp_events_t * mp)
memset (api_client, 0, sizeof (vpe_client_registration_t));
api_client->client_index = mp->client_index;
api_client->client_pid = mp->pid;
- hash_set_mem (im->igmp_api_client_by_client_index,
- &mp->client_index, api_client - im->api_clients);
+ hash_set (im->igmp_api_client_by_client_index,
+ mp->client_index, api_client - im->api_clients);
goto done;
}
rv = VNET_API_ERROR_INVALID_REGISTRATION;
@@ -265,13 +265,13 @@ want_igmp_events_reaper (u32 client_index)
vpe_client_registration_t *api_client;
uword *p;
- p = hash_get_mem (im->igmp_api_client_by_client_index, &client_index);
+ p = hash_get (im->igmp_api_client_by_client_index, client_index);
if (p)
{
api_client = pool_elt_at_index (im->api_clients, p[0]);
pool_put (im->api_clients, api_client);
- hash_unset_mem (im->igmp_api_client_by_client_index, &client_index);
+ hash_unset (im->igmp_api_client_by_client_index, client_index);
}
return (NULL);
}
@@ -316,8 +316,7 @@ igmp_event (igmp_main_t * im, igmp_config_t * config, igmp_group_t * group,
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);
}
}