diff options
-rw-r--r-- | src/vnet/lisp-cp/control.c | 22 | ||||
-rw-r--r-- | src/vnet/lisp-cp/control.h | 3 | ||||
-rw-r--r-- | src/vnet/lisp-cp/lisp_types.h | 1 |
3 files changed, 11 insertions, 15 deletions
diff --git a/src/vnet/lisp-cp/control.c b/src/vnet/lisp-cp/control.c index 0eb7b1d7eed..4dc6836ae7e 100644 --- a/src/vnet/lisp-cp/control.c +++ b/src/vnet/lisp-cp/control.c @@ -1238,12 +1238,6 @@ remove_overlapping_sub_prefixes (lisp_cp_main_t * lcm, gid_address_t * eid, vec_free (a.eids_to_be_deleted); } -static void -mapping_delete_timer (lisp_cp_main_t * lcm, u32 mi) -{ - timing_wheel_delete (&lcm->wheel, mi); -} - static int is_local_ip (lisp_cp_main_t * lcm, ip_address_t * addr) { @@ -1409,7 +1403,7 @@ vnet_lisp_del_mapping (gid_address_t * eid, u32 * res_map_index) /* delete timer associated to the mapping if any */ if (old_map->timer_set) - mapping_delete_timer (lcm, mi); + TW (tw_timer_stop) (&lcm->wheel, old_map->timer_handle); /* delete locator set */ vnet_lisp_add_del_locator_set (ls_args, 0); @@ -3777,8 +3771,8 @@ remove_expired_mapping (lisp_cp_main_t * lcm, u32 mi) if (vnet_lisp_add_del_adjacency (adj_args)) clib_warning ("failed to del adjacency!"); + TW (tw_timer_stop) (&lcm->wheel, m->timer_handle); vnet_lisp_del_mapping (&m->eid, NULL); - mapping_delete_timer (lcm, mi); } static void @@ -3793,7 +3787,7 @@ mapping_start_expiration_timer (lisp_cp_main_t * lcm, u32 mi, m = pool_elt_at_index (lcm->mapping_pool, mi); m->timer_set = 1; - timing_wheel_insert (&lcm->wheel, exp_clock_time, mi); + m->timer_handle = TW (tw_timer_start) (&lcm->wheel, mi, 0, exp_clock_time); } static void @@ -4546,8 +4540,9 @@ lisp_cp_init (vlib_main_t * vm) hash_set (lcm->table_id_by_vni, 0, 0); hash_set (lcm->vni_by_table_id, 0, 0); - u64 now = clib_cpu_time_now (); - timing_wheel_init (&lcm->wheel, now, vm->clib_time.clocks_per_second); + TW (tw_timer_wheel_init) (&lcm->wheel, 0 /* no callback */ , + 1e-3 /* timer period 1ms */ , + ~0 /* max expirations per call */ ); lcm->nsh_map_index = ~0; lcm->map_register_ttl = MAP_REGISTER_DEFAULT_TTL; lcm->max_expired_map_registers = MAX_EXPIRED_MAP_REGISTERS_DEFAULT; @@ -4869,9 +4864,8 @@ send_map_resolver_service (vlib_main_t * vm, update_map_register (lcm, period); update_rloc_probing (lcm, period); - u64 now = clib_cpu_time_now (); - - expired = timing_wheel_advance (&lcm->wheel, now, expired, 0); + expired = TW (tw_timer_expire_timers_vec) (&lcm->wheel, + vlib_time_now (vm), expired); if (vec_len (expired) > 0) { u32 *mi = 0; diff --git a/src/vnet/lisp-cp/control.h b/src/vnet/lisp-cp/control.h index d3d320abb3e..78d1ffe5e70 100644 --- a/src/vnet/lisp-cp/control.h +++ b/src/vnet/lisp-cp/control.h @@ -20,6 +20,7 @@ #include <vnet/lisp-cp/gid_dictionary.h> #include <vnet/lisp-cp/lisp_types.h> #include <vppinfra/timing_wheel.h> +#include <vppinfra/tw_timer_1t_3w_1024sl_ov.h> #define NUMBER_OF_RETRIES 1 #define PENDING_MREQ_EXPIRATION_TIME 3.0 /* seconds */ @@ -266,7 +267,7 @@ typedef struct u8 rloc_probing; /* timing wheel for mapping timeouts */ - timing_wheel_t wheel; + TWT (tw_timer_wheel) wheel; /** Per thread pool of records shared with thread0 */ map_records_arg_t **map_records_args_pool; diff --git a/src/vnet/lisp-cp/lisp_types.h b/src/vnet/lisp-cp/lisp_types.h index f041e0f3b4a..e08ba15dfd3 100644 --- a/src/vnet/lisp-cp/lisp_types.h +++ b/src/vnet/lisp-cp/lisp_types.h @@ -315,6 +315,7 @@ typedef struct u8 *key; lisp_key_type_t key_id; u8 timer_set; + u32 timer_handle; counter_t packets; } mapping_t; |