diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2022-12-11 10:51:58 -0500 | 
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2023-03-24 08:32:17 -0400 | 
| commit | 5f6eaa9b9668f3f09fbf6b1dc4e0645e07f641c9 (patch) | |
| tree | d8639a3f042a0de1e66bad71d330205619052b6e /zebra | |
| parent | 70c35c11f2af5f169db446ef02ac0dda7b2822fc (diff) | |
*: Convert a bunch of thread_XX to event_XX
Convert these functions:
thread_getrusage
thread_cmd_init
thread_consumed_time
thread_timer_to_hhmmss
thread_is_scheduled
thread_ignore_late_timer
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra')
| -rw-r--r-- | zebra/interface.c | 6 | ||||
| -rw-r--r-- | zebra/zebra_evpn_mac.c | 12 | ||||
| -rw-r--r-- | zebra/zebra_evpn_mh.c | 20 | ||||
| -rw-r--r-- | zebra/zebra_evpn_neigh.c | 12 | ||||
| -rw-r--r-- | zebra/zebra_nhg.c | 2 | ||||
| -rw-r--r-- | zebra/zebra_rib.c | 2 | ||||
| -rw-r--r-- | zebra/zebra_vty.c | 16 | 
7 files changed, 35 insertions, 35 deletions
diff --git a/zebra/interface.c b/zebra/interface.c index 8e4d15aa84..9f05a8d117 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -98,7 +98,7 @@ static void if_zebra_speed_update(struct event *thread)  		zif->speed_update_count++;  		event_add_timer(zrouter.master, if_zebra_speed_update, ifp,  				SPEED_UPDATE_SLEEP_TIME, &zif->speed_update); -		thread_ignore_late_timer(zif->speed_update); +		event_ignore_late_timer(zif->speed_update);  	}  } @@ -163,7 +163,7 @@ static int if_zebra_new_hook(struct interface *ifp)  	zebra_if->speed_update_count = 0;  	event_add_timer(zrouter.master, if_zebra_speed_update, ifp, 15,  			&zebra_if->speed_update); -	thread_ignore_late_timer(zebra_if->speed_update); +	event_ignore_late_timer(zebra_if->speed_update);  	return 0;  } @@ -1040,7 +1040,7 @@ void if_up(struct interface *ifp, bool install_connected)  	event_add_timer(zrouter.master, if_zebra_speed_update, ifp, 0,  			&zif->speed_update); -	thread_ignore_late_timer(zif->speed_update); +	event_ignore_late_timer(zif->speed_update);  }  /* Interface goes down.  We have to manage different behavior of based diff --git a/zebra/zebra_evpn_mac.c b/zebra/zebra_evpn_mac.c index c12bfe5bc0..36470af6e3 100644 --- a/zebra/zebra_evpn_mac.c +++ b/zebra/zebra_evpn_mac.c @@ -692,9 +692,9 @@ void zebra_evpn_print_mac(struct zebra_mac *mac, void *ctxt, json_object *json)  		if (mac->hold_timer)  			json_object_string_add(  				json_mac, "peerActiveHold", -				thread_timer_to_hhmmss(thread_buf, -						       sizeof(thread_buf), -						       mac->hold_timer)); +				event_timer_to_hhmmss(thread_buf, +						      sizeof(thread_buf), +						      mac->hold_timer));  		if (mac->es)  			json_object_string_add(json_mac, "esi",  					mac->es->esi_str); @@ -784,9 +784,9 @@ void zebra_evpn_print_mac(struct zebra_mac *mac, void *ctxt, json_object *json)  			vty_out(vty, " peer-active");  		if (mac->hold_timer)  			vty_out(vty, " (ht: %s)", -				thread_timer_to_hhmmss(thread_buf, -						       sizeof(thread_buf), -						       mac->hold_timer)); +				event_timer_to_hhmmss(thread_buf, +						      sizeof(thread_buf), +						      mac->hold_timer));  		vty_out(vty, "\n");  		vty_out(vty, " Local Seq: %u Remote Seq: %u\n", mac->loc_seq,  			mac->rem_seq); diff --git a/zebra/zebra_evpn_mh.c b/zebra/zebra_evpn_mh.c index c5d5046dfc..0e3e3d01fb 100644 --- a/zebra/zebra_evpn_mh.c +++ b/zebra/zebra_evpn_mh.c @@ -3181,9 +3181,9 @@ static void zebra_evpn_es_show_entry_detail(struct vty *vty,  		if (es->df_delay_timer)  			json_object_string_add(  				json, "dfDelayTimer", -				thread_timer_to_hhmmss(thread_buf, -						       sizeof(thread_buf), -						       es->df_delay_timer)); +				event_timer_to_hhmmss(thread_buf, +						      sizeof(thread_buf), +						      es->df_delay_timer));  		json_object_int_add(json, "nexthopGroup", es->nhg_id);  		if (listcount(es->es_vtep_list)) {  			json_vteps = json_object_new_array(); @@ -3226,9 +3226,9 @@ static void zebra_evpn_es_show_entry_detail(struct vty *vty,  								  : "df");  		if (es->df_delay_timer)  			vty_out(vty, " DF delay: %s\n", -				thread_timer_to_hhmmss(thread_buf, -						       sizeof(thread_buf), -						       es->df_delay_timer)); +				event_timer_to_hhmmss(thread_buf, +						      sizeof(thread_buf), +						      es->df_delay_timer));  		vty_out(vty, " DF preference: %u\n", es->df_pref);  		vty_out(vty, " Nexthop group: %u\n", es->nhg_id);  		vty_out(vty, " VTEPs:\n"); @@ -3529,8 +3529,8 @@ void zebra_evpn_mh_json(json_object *json)  	json_object_int_add(json, "startupDelay", zmh_info->startup_delay_time);  	json_object_string_add(  		json, "startupDelayTimer", -		thread_timer_to_hhmmss(thread_buf, sizeof(thread_buf), -				       zmh_info->startup_delay_timer)); +		event_timer_to_hhmmss(thread_buf, sizeof(thread_buf), +				      zmh_info->startup_delay_timer));  	json_object_int_add(json, "uplinkConfigCount",  			    zmh_info->uplink_cfg_cnt);  	json_object_int_add(json, "uplinkActiveCount", @@ -3562,8 +3562,8 @@ void zebra_evpn_mh_print(struct vty *vty)  		zmh_info->mac_hold_time, zmh_info->neigh_hold_time);  	vty_out(vty, "  startup-delay: %ds, start-delay-timer: %s\n",  		zmh_info->startup_delay_time, -		thread_timer_to_hhmmss(thread_buf, sizeof(thread_buf), -				       zmh_info->startup_delay_timer)); +		event_timer_to_hhmmss(thread_buf, sizeof(thread_buf), +				      zmh_info->startup_delay_timer));  	vty_out(vty, "  uplink-cfg-cnt: %u, uplink-active-cnt: %u\n",  		zmh_info->uplink_cfg_cnt, zmh_info->uplink_oper_up_cnt);  	if (zmh_info->protodown_rc) diff --git a/zebra/zebra_evpn_neigh.c b/zebra/zebra_evpn_neigh.c index 11ceae4b5d..393ff3baf4 100644 --- a/zebra/zebra_evpn_neigh.c +++ b/zebra/zebra_evpn_neigh.c @@ -1746,9 +1746,9 @@ void zebra_evpn_print_neigh(struct zebra_neigh *n, void *ctxt,  		}  		if (n->hold_timer) {  			vty_out(vty, " (ht: %s)", -				thread_timer_to_hhmmss(thread_buf, -						       sizeof(thread_buf), -						       n->hold_timer)); +				event_timer_to_hhmmss(thread_buf, +						      sizeof(thread_buf), +						      n->hold_timer));  			sync_info = true;  		}  		if (!sync_info) @@ -1769,9 +1769,9 @@ void zebra_evpn_print_neigh(struct zebra_neigh *n, void *ctxt,  		if (n->hold_timer)  			json_object_string_add(  				json, "peerActiveHold", -				thread_timer_to_hhmmss(thread_buf, -						       sizeof(thread_buf), -						       n->hold_timer)); +				event_timer_to_hhmmss(thread_buf, +						      sizeof(thread_buf), +						      n->hold_timer));  	}  	if (CHECK_FLAG(n->flags, ZEBRA_NEIGH_REMOTE)) {  		if (n->mac->es) { diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c index 7eed209a1d..23156d8bf2 100644 --- a/zebra/zebra_nhg.c +++ b/zebra/zebra_nhg.c @@ -1727,7 +1727,7 @@ void zebra_nhg_increment_ref(struct nhg_hash_entry *nhe)  	nhe->refcnt++; -	if (thread_is_scheduled(nhe->timer)) { +	if (event_is_scheduled(nhe->timer)) {  		THREAD_OFF(nhe->timer);  		nhe->refcnt--;  		UNSET_FLAG(nhe->flags, NEXTHOP_GROUP_KEEP_AROUND); diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 2864b92310..17e71db490 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -4415,7 +4415,7 @@ void rib_update(enum rib_update_event event)  {  	struct rib_update_ctx *ctx; -	if (thread_is_scheduled(t_rib_update_threads[event])) +	if (event_is_scheduled(t_rib_update_threads[event]))  		return;  	ctx = rib_update_ctx_init(0, event); diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 6d61430029..56e7226424 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -1179,12 +1179,12 @@ static void show_nexthop_group_out(struct vty *vty, struct nhg_hash_entry *nhe,  		json_object_string_add(json, "type",  				       zebra_route_string(nhe->type));  		json_object_int_add(json, "refCount", nhe->refcnt); -		if (thread_is_scheduled(nhe->timer)) +		if (event_is_scheduled(nhe->timer))  			json_object_string_add(  				json, "timeToDeletion", -				thread_timer_to_hhmmss(time_left, -						       sizeof(time_left), -						       nhe->timer)); +				event_timer_to_hhmmss(time_left, +						      sizeof(time_left), +						      nhe->timer));  		json_object_string_add(json, "uptime", up_str);  		json_object_string_add(json, "vrf",  				       vrf_id_to_name(nhe->vrf_id)); @@ -1193,11 +1193,11 @@ static void show_nexthop_group_out(struct vty *vty, struct nhg_hash_entry *nhe,  		vty_out(vty, "ID: %u (%s)\n", nhe->id,  			zebra_route_string(nhe->type));  		vty_out(vty, "     RefCnt: %u", nhe->refcnt); -		if (thread_is_scheduled(nhe->timer)) +		if (event_is_scheduled(nhe->timer))  			vty_out(vty, " Time to Deletion: %s", -				thread_timer_to_hhmmss(time_left, -						       sizeof(time_left), -						       nhe->timer)); +				event_timer_to_hhmmss(time_left, +						      sizeof(time_left), +						      nhe->timer));  		vty_out(vty, "\n");  		vty_out(vty, "     Uptime: %s\n", up_str);  | 
