diff options
author | Donald Sharp <sharpd@nvidia.com> | 2022-12-11 14:06:25 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2023-03-24 13:32:17 +0100 |
commit | 8c1186d38e9226e29bb6eed0745a7638a7f66e5b (patch) | |
tree | fba237046e948542dc33ed9db73d12b35f4e9581 | |
parent | lib: Convert THREAD_YIELD_TIME_SLOT to EVENT_YIELD_TIME_SLOT (diff) | |
download | frr-8c1186d38e9226e29bb6eed0745a7638a7f66e5b.tar.xz frr-8c1186d38e9226e29bb6eed0745a7638a7f66e5b.zip |
*: Convert thread_execute to event_execute
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
-rw-r--r-- | bgpd/bgp_route.c | 4 | ||||
-rw-r--r-- | bgpd/bgp_vty.c | 4 | ||||
-rw-r--r-- | doc/developer/path-internals-pcep.rst | 2 | ||||
-rw-r--r-- | eigrpd/eigrp_hello.c | 4 | ||||
-rw-r--r-- | eigrpd/eigrp_update.c | 4 | ||||
-rw-r--r-- | lib/bfd.c | 4 | ||||
-rw-r--r-- | lib/event.c | 6 | ||||
-rw-r--r-- | lib/event.h | 10 | ||||
-rw-r--r-- | lib/wheel.c | 2 | ||||
-rw-r--r-- | ospf6d/ospf6_interface.c | 18 | ||||
-rw-r--r-- | ospf6d/ospf6_intra.h | 18 | ||||
-rw-r--r-- | ospf6d/ospf6_lsa.c | 2 | ||||
-rw-r--r-- | ospf6d/ospf6_lsdb.c | 2 | ||||
-rw-r--r-- | ospf6d/ospf6_message.c | 18 | ||||
-rw-r--r-- | ospf6d/ospf6_nssa.c | 2 | ||||
-rw-r--r-- | ospfd/ospf_ism.h | 2 | ||||
-rw-r--r-- | ospfd/ospf_lsa.c | 2 | ||||
-rw-r--r-- | ospfd/ospf_nsm.h | 2 | ||||
-rw-r--r-- | pimd/pim6_mld.c | 6 | ||||
-rw-r--r-- | tests/lib/test_segv.c | 2 | ||||
-rw-r--r-- | tools/frr-llvm-cg.c | 2 | ||||
-rw-r--r-- | zebra/zebra_gr.c | 14 |
22 files changed, 65 insertions, 65 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 5a94da2f4..8b56d04e6 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -13441,7 +13441,7 @@ static int bgp_table_stats_single(struct vty *vty, struct bgp *bgp, afi_t afi, memset(&ts, 0, sizeof(ts)); ts.table = bgp->rib[afi][safi]; - thread_execute(bm->master, bgp_table_stats_walker, &ts, 0); + event_execute(bm->master, bgp_table_stats_walker, &ts, 0); for (i = 0; i < BGP_STATS_MAX; i++) { if ((!json && !table_stats_strs[i][TABLE_STATS_IDX_VTY]) @@ -13798,7 +13798,7 @@ static int bgp_peer_counts(struct vty *vty, struct peer *peer, afi_t afi, * stats for the thread-walk (i.e. ensure this can't be blamed on * on just vty_read()). */ - thread_execute(bm->master, bgp_peer_count_walker, &pcounts, 0); + event_execute(bm->master, bgp_peer_count_walker, &pcounts, 0); if (use_json) { json_object_string_add(json, "prefixCountsFor", peer->host); diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 95f2b82e9..e0476c0ce 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -7519,8 +7519,8 @@ DEFUN (bgp_set_route_map_delay_timer, */ if (!rmap_delay_timer && bm->t_rmap_update) { THREAD_OFF(bm->t_rmap_update); - thread_execute(bm->master, bgp_route_map_update_timer, - NULL, 0); + event_execute(bm->master, bgp_route_map_update_timer, + NULL, 0); } return CMD_SUCCESS; } else { diff --git a/doc/developer/path-internals-pcep.rst b/doc/developer/path-internals-pcep.rst index ca318314f..a6b22204c 100644 --- a/doc/developer/path-internals-pcep.rst +++ b/doc/developer/path-internals-pcep.rst @@ -182,7 +182,7 @@ The controller is defined and implemented in `path_pcep_controller.[hc]`. Part of the controller code runs in FRR main thread and part runs in its own FRR pthread started to isolate the main thread from the PCCs' event loop. To communicate between the threads it uses FRR events, timers and -`thread_execute` calls. +`event_execute` calls. PCC diff --git a/eigrpd/eigrp_hello.c b/eigrpd/eigrp_hello.c index 02807dd31..12de6d4a1 100644 --- a/eigrpd/eigrp_hello.c +++ b/eigrpd/eigrp_hello.c @@ -771,8 +771,8 @@ void eigrp_hello_send(struct eigrp_interface *ei, uint8_t flags, if (ei->eigrp->t_write == NULL) { if (flags & EIGRP_HELLO_GRACEFUL_SHUTDOWN) { - thread_execute(master, eigrp_write, ei->eigrp, - ei->eigrp->fd); + event_execute(master, eigrp_write, ei->eigrp, + ei->eigrp->fd); } else { event_add_write(master, eigrp_write, ei->eigrp, ei->eigrp->fd, diff --git a/eigrpd/eigrp_update.c b/eigrpd/eigrp_update.c index 5fa469531..1a0729d32 100644 --- a/eigrpd/eigrp_update.c +++ b/eigrpd/eigrp_update.c @@ -916,7 +916,7 @@ void eigrp_update_send_GR_thread(struct event *thread) /* if it wasn't last chunk, schedule this thread again */ if (nbr->nbr_gr_packet_type != EIGRP_PACKET_PART_LAST) { - thread_execute(master, eigrp_update_send_GR_thread, nbr, 0); + event_execute(master, eigrp_update_send_GR_thread, nbr, 0); } } @@ -982,7 +982,7 @@ void eigrp_update_send_GR(struct eigrp_neighbor *nbr, enum GR_type gr_type, /* indicate, that this is first GR Update packet chunk */ nbr->nbr_gr_packet_type = EIGRP_PACKET_PART_FIRST; /* execute packet sending in thread */ - thread_execute(master, eigrp_update_send_GR_thread, nbr, 0); + event_execute(master, eigrp_update_send_GR_thread, nbr, 0); } /** @@ -541,7 +541,7 @@ static void _bfd_sess_remove(struct bfd_session_params *bsp) /* Send request to remove any session. */ bsp->lastev = BSE_UNINSTALL; - thread_execute(bsglobal.tm, _bfd_sess_send, bsp, 0); + event_execute(bsglobal.tm, _bfd_sess_send, bsp, 0); } void bfd_sess_free(struct bfd_session_params **bsp) @@ -894,7 +894,7 @@ int zclient_bfd_session_replay(ZAPI_CALLBACK_ARGS) /* Ask for installation. */ bsp->lastev = BSE_INSTALL; - thread_execute(bsglobal.tm, _bfd_sess_send, bsp, 0); + event_execute(bsglobal.tm, _bfd_sess_send, bsp, 0); } return 0; diff --git a/lib/event.c b/lib/event.c index 5aea78186..12b40e112 100644 --- a/lib/event.c +++ b/lib/event.c @@ -2058,9 +2058,9 @@ void event_call(struct event *thread) } /* Execute thread */ -void _thread_execute(const struct xref_threadsched *xref, - struct thread_master *m, void (*func)(struct event *), - void *arg, int val) +void _event_execute(const struct xref_threadsched *xref, + struct thread_master *m, void (*func)(struct event *), + void *arg, int val) { struct event *thread; diff --git a/lib/event.h b/lib/event.h index c38b7b6c3..cdb228481 100644 --- a/lib/event.h +++ b/lib/event.h @@ -195,7 +195,7 @@ struct cpu_thread_history { _xref_t_a(timer_tv, TIMER, m, f, a, v, t) #define event_add_event(m, f, a, v, t) _xref_t_a(event, EVENT, m, f, a, v, t) -#define thread_execute(m, f, a, v) \ +#define event_execute(m, f, a, v) \ ({ \ static const struct xref_threadsched _xref __attribute__( \ (used)) = { \ @@ -205,7 +205,7 @@ struct cpu_thread_history { .event_type = EVENT_EXECUTE, \ }; \ XREF_LINK(_xref.xref); \ - _thread_execute(&_xref, m, f, a, v); \ + _event_execute(&_xref, m, f, a, v); \ }) /* end */ /* Prototypes. */ @@ -239,9 +239,9 @@ extern void _event_add_event(const struct xref_threadsched *xref, void (*fn)(struct event *), void *arg, int val, struct event **tref); -extern void _thread_execute(const struct xref_threadsched *xref, - struct thread_master *master, - void (*fn)(struct event *), void *arg, int val); +extern void _event_execute(const struct xref_threadsched *xref, + struct thread_master *master, + void (*fn)(struct event *), void *arg, int val); extern void event_cancel(struct event **event); extern void event_cancel_async(struct thread_master *, struct event **, void *); diff --git a/lib/wheel.c b/lib/wheel.c index 27e087efc..9ba122e82 100644 --- a/lib/wheel.c +++ b/lib/wheel.c @@ -57,7 +57,7 @@ static void wheel_timer_thread(struct event *t) wheel = THREAD_ARG(t); - thread_execute(wheel->master, wheel_timer_thread_helper, wheel, 0); + event_execute(wheel->master, wheel_timer_thread_helper, wheel, 0); } struct timer_wheel *wheel_init(struct thread_master *master, int period, diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index 7828f35d5..2c8d168e0 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -307,7 +307,7 @@ void ospf6_interface_disable(struct ospf6_interface *oi) { SET_FLAG(oi->flag, OSPF6_INTERFACE_DISABLE); - thread_execute(master, interface_down, oi, 0); + event_execute(master, interface_down, oi, 0); ospf6_lsdb_remove_all(oi->lsdb); ospf6_lsdb_remove_all(oi->lsdb_self); @@ -382,9 +382,9 @@ void ospf6_interface_state_update(struct interface *ifp) if (if_is_operative(ifp) && (ospf6_interface_get_linklocal_address(oi->interface) || if_is_loopback(oi->interface))) - thread_execute(master, interface_up, oi, 0); + event_execute(master, interface_up, oi, 0); else - thread_execute(master, interface_down, oi, 0); + event_execute(master, interface_down, oi, 0); return; } @@ -2520,8 +2520,8 @@ DEFUN (ipv6_ospf6_network, } /* Reset the interface */ - thread_execute(master, interface_down, oi, 0); - thread_execute(master, interface_up, oi, 0); + event_execute(master, interface_down, oi, 0); + event_execute(master, interface_up, oi, 0); return CMD_SUCCESS; } @@ -2556,8 +2556,8 @@ DEFUN (no_ipv6_ospf6_network, oi->type = type; /* Reset the interface */ - thread_execute(master, interface_down, oi, 0); - thread_execute(master, interface_up, oi, 0); + event_execute(master, interface_down, oi, 0); + event_execute(master, interface_up, oi, 0); return CMD_SUCCESS; } @@ -2773,8 +2773,8 @@ void ospf6_interface_clear(struct interface *ifp) zlog_debug("Interface %s: clear by reset", ifp->name); /* Reset the interface */ - thread_execute(master, interface_down, oi, 0); - thread_execute(master, interface_up, oi, 0); + event_execute(master, interface_down, oi, 0); + event_execute(master, interface_up, oi, 0); } /* Clear interface */ diff --git a/ospf6d/ospf6_intra.h b/ospf6d/ospf6_intra.h index b09c4163f..62e877eb5 100644 --- a/ospf6d/ospf6_intra.h +++ b/ospf6d/ospf6_intra.h @@ -180,35 +180,35 @@ struct ospf6_intra_prefix_lsa { #define OSPF6_ROUTER_LSA_EXECUTE(oa) \ do { \ if (CHECK_FLAG((oa)->flag, OSPF6_AREA_ENABLE)) \ - thread_execute(master, ospf6_router_lsa_originate, oa, \ - 0); \ + event_execute(master, ospf6_router_lsa_originate, oa, \ + 0); \ } while (0) #define OSPF6_NETWORK_LSA_EXECUTE(oi) \ do { \ THREAD_OFF((oi)->thread_network_lsa); \ - thread_execute(master, ospf6_network_lsa_originate, oi, 0); \ + event_execute(master, ospf6_network_lsa_originate, oi, 0); \ } while (0) #define OSPF6_LINK_LSA_EXECUTE(oi) \ do { \ if (!CHECK_FLAG((oi)->flag, OSPF6_INTERFACE_DISABLE)) \ - thread_execute(master, ospf6_link_lsa_originate, oi, \ - 0); \ + event_execute(master, ospf6_link_lsa_originate, oi, \ + 0); \ } while (0) #define OSPF6_INTRA_PREFIX_LSA_EXECUTE_TRANSIT(oi) \ do { \ THREAD_OFF((oi)->thread_intra_prefix_lsa); \ - thread_execute(master, \ - ospf6_intra_prefix_lsa_originate_transit, oi, \ - 0); \ + event_execute(master, \ + ospf6_intra_prefix_lsa_originate_transit, oi, \ + 0); \ } while (0) #define OSPF6_AS_EXTERN_LSA_EXECUTE(oi) \ do { \ THREAD_OFF((oi)->thread_as_extern_lsa); \ - thread_execute(master, ospf6_orig_as_external_lsa, oi, 0); \ + event_execute(master, ospf6_orig_as_external_lsa, oi, 0); \ } while (0) /* Function Prototypes */ diff --git a/ospf6d/ospf6_lsa.c b/ospf6d/ospf6_lsa.c index a9dd7aa28..be0cc3442 100644 --- a/ospf6d/ospf6_lsa.c +++ b/ospf6d/ospf6_lsa.c @@ -333,7 +333,7 @@ void ospf6_lsa_premature_aging(struct ospf6_lsa *lsa) ospf6_flood_clear(lsa); lsa->header->age = htons(OSPF_LSA_MAXAGE); - thread_execute(master, ospf6_lsa_expire, lsa, 0); + event_execute(master, ospf6_lsa_expire, lsa, 0); } /* check which is more recent. if a is more recent, return -1; diff --git a/ospf6d/ospf6_lsdb.c b/ospf6d/ospf6_lsdb.c index 586183731..817949f01 100644 --- a/ospf6d/ospf6_lsdb.c +++ b/ospf6d/ospf6_lsdb.c @@ -396,7 +396,7 @@ int ospf6_lsdb_maxage_remover(struct ospf6_lsdb *lsdb) ospf6_lsa_checksum(lsa->header); THREAD_OFF(lsa->refresh); - thread_execute(master, ospf6_lsa_refresh, lsa, 0); + event_execute(master, ospf6_lsa_refresh, lsa, 0); } else { zlog_debug("calling ospf6_lsdb_remove %s", lsa->name); ospf6_lsdb_remove(lsa, lsdb); diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c index ff7395874..99c33facc 100644 --- a/ospf6d/ospf6_message.c +++ b/ospf6d/ospf6_message.c @@ -535,9 +535,9 @@ static void ospf6_hello_recv(struct in6_addr *src, struct in6_addr *dst, oi->hello_in++; /* Execute neighbor events */ - thread_execute(master, hello_received, on, 0); + event_execute(master, hello_received, on, 0); if (twoway) - thread_execute(master, twoway_received, on, 0); + event_execute(master, twoway_received, on, 0); else { if (OSPF6_GR_IS_ACTIVE_HELPER(on)) { if (IS_DEBUG_OSPF6_GR) @@ -553,7 +553,7 @@ static void ospf6_hello_recv(struct in6_addr *src, struct in6_addr *dst, * receives one_way hellow when it acts as HELPER for * that specific neighbor. */ - thread_execute(master, oneway_received, on, 0); + event_execute(master, oneway_received, on, 0); } } @@ -624,7 +624,7 @@ static void ospf6_dbdesc_recv_master(struct ospf6_header *oh, return; case OSPF6_NEIGHBOR_INIT: - thread_execute(master, twoway_received, on, 0); + event_execute(master, twoway_received, on, 0); if (on->state != OSPF6_NEIGHBOR_EXSTART) { if (IS_OSPF6_DEBUG_MESSAGE(oh->type, RECV_HDR)) zlog_debug( @@ -640,7 +640,7 @@ static void ospf6_dbdesc_recv_master(struct ospf6_header *oh, && !CHECK_FLAG(dbdesc->bits, OSPF6_DBDESC_IBIT) && ntohl(dbdesc->seqnum) == on->dbdesc_seqnum) { /* execute NegotiationDone */ - thread_execute(master, negotiation_done, on, 0); + event_execute(master, negotiation_done, on, 0); /* Record neighbor options */ memcpy(on->options, dbdesc->options, @@ -828,7 +828,7 @@ static void ospf6_dbdesc_recv_slave(struct ospf6_header *oh, return; case OSPF6_NEIGHBOR_INIT: - thread_execute(master, twoway_received, on, 0); + event_execute(master, twoway_received, on, 0); if (on->state != OSPF6_NEIGHBOR_EXSTART) { if (IS_OSPF6_DEBUG_MESSAGE(oh->type, RECV_HDR)) zlog_debug( @@ -855,7 +855,7 @@ static void ospf6_dbdesc_recv_slave(struct ospf6_header *oh, on->dbdesc_seqnum = ntohl(dbdesc->seqnum); /* schedule NegotiationDone */ - thread_execute(master, negotiation_done, on, 0); + event_execute(master, negotiation_done, on, 0); /* Record neighbor options */ memcpy(on->options, dbdesc->options, @@ -2421,7 +2421,7 @@ void ospf6_dbdesc_send_newone(struct event *thread) event_add_event(master, exchange_done, on, 0, &on->thread_exchange_done); - thread_execute(master, ospf6_dbdesc_send, on, 0); + event_execute(master, ospf6_dbdesc_send, on, 0); } static uint16_t ospf6_make_lsreq(struct ospf6_neighbor *on, struct stream *s) @@ -2592,7 +2592,7 @@ static void ospf6_send_lsupdate(struct ospf6_neighbor *on, listnode_add(oi->area->ospf6->oi_write_q, oi); oi->on_write_q = 1; } - thread_execute(master, ospf6_write, oi->area->ospf6, 0); + event_execute(master, ospf6_write, oi->area->ospf6, 0); } else OSPF6_MESSAGE_WRITE_ON(oi); } diff --git a/ospf6d/ospf6_nssa.c b/ospf6d/ospf6_nssa.c index ca48b25d6..87754a59a 100644 --- a/ospf6d/ospf6_nssa.c +++ b/ospf6d/ospf6_nssa.c @@ -1436,7 +1436,7 @@ DEFPY (no_area_nssa_range, SET_FLAG(range->flag, OSPF6_ROUTE_REMOVE); /* Redo summaries if required */ - thread_execute(master, ospf6_abr_task_timer, ospf6, 0); + event_execute(master, ospf6_abr_task_timer, ospf6, 0); } ospf6_route_remove(range, oa->nssa_range_table); diff --git a/ospfd/ospf_ism.h b/ospfd/ospf_ism.h index d5261546e..426dda773 100644 --- a/ospfd/ospf_ism.h +++ b/ospfd/ospf_ism.h @@ -69,7 +69,7 @@ /* Macro for OSPF execute event. */ #define OSPF_ISM_EVENT_EXECUTE(I, E) \ - thread_execute(master, ospf_ism_event, (I), (E)) + event_execute(master, ospf_ism_event, (I), (E)) /* Prototypes. */ extern void ospf_ism_event(struct event *thread); diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c index aa113b087..ea5dc651a 100644 --- a/ospfd/ospf_lsa.c +++ b/ospfd/ospf_lsa.c @@ -3653,7 +3653,7 @@ void ospf_flush_self_originated_lsas_now(struct ospf *ospf) */ if (ospf->t_maxage != NULL) { THREAD_OFF(ospf->t_maxage); - thread_execute(master, ospf_maxage_lsa_remover, ospf, 0); + event_execute(master, ospf_maxage_lsa_remover, ospf, 0); } return; diff --git a/ospfd/ospf_nsm.h b/ospfd/ospf_nsm.h index 140e8533f..3b8d4215f 100644 --- a/ospfd/ospf_nsm.h +++ b/ospfd/ospf_nsm.h @@ -49,7 +49,7 @@ /* Macro for OSPF NSM execute event. */ #define OSPF_NSM_EVENT_EXECUTE(N, E) \ - thread_execute(master, ospf_nsm_event, (N), (E)) + event_execute(master, ospf_nsm_event, (N), (E)) /* Prototypes. */ extern void ospf_nsm_event(struct event *); diff --git a/pimd/pim6_mld.c b/pimd/pim6_mld.c index 98b311f60..52dbfddd9 100644 --- a/pimd/pim6_mld.c +++ b/pimd/pim6_mld.c @@ -1350,7 +1350,7 @@ static void gm_bump_querier(struct gm_if *gm_ifp) gm_ifp->n_startup = gm_ifp->cur_qrv; - thread_execute(router->master, gm_t_query, gm_ifp, 0); + event_execute(router->master, gm_t_query, gm_ifp, 0); } static void gm_t_other_querier(struct event *t) @@ -1363,7 +1363,7 @@ static void gm_t_other_querier(struct event *t) gm_ifp->querier = pim_ifp->ll_lowest; gm_ifp->n_startup = gm_ifp->cur_qrv; - thread_execute(router->master, gm_t_query, gm_ifp, 0); + event_execute(router->master, gm_t_query, gm_ifp, 0); } static void gm_handle_query(struct gm_if *gm_ifp, @@ -2230,7 +2230,7 @@ static void gm_update_ll(struct interface *ifp) return; gm_ifp->n_startup = gm_ifp->cur_qrv; - thread_execute(router->master, gm_t_query, gm_ifp, 0); + event_execute(router->master, gm_t_query, gm_ifp, 0); } void gm_ifp_update(struct interface *ifp) diff --git a/tests/lib/test_segv.c b/tests/lib/test_segv.c index f4a22930b..3cf4cbad2 100644 --- a/tests/lib/test_segv.c +++ b/tests/lib/test_segv.c @@ -61,7 +61,7 @@ int main(void) zlog_aux_init("NONE: ", LOG_DEBUG); - thread_execute(master, threadfunc, 0, 0); + event_execute(master, threadfunc, 0, 0); exit(0); } diff --git a/tools/frr-llvm-cg.c b/tools/frr-llvm-cg.c index 634474fe4..3a7222e42 100644 --- a/tools/frr-llvm-cg.c +++ b/tools/frr-llvm-cg.c @@ -276,7 +276,7 @@ static bool is_thread_sched(const char *name, size_t len) thread_prefix "event_add_timer_msec", thread_prefix "event_add_timer_tv", thread_prefix "event_add_event", - thread_prefix "thread_execute", + thread_prefix "event_execute", }; size_t i; diff --git a/zebra/zebra_gr.c b/zebra/zebra_gr.c index e055eae7e..4d0caba89 100644 --- a/zebra/zebra_gr.c +++ b/zebra/zebra_gr.c @@ -83,10 +83,10 @@ void zebra_gr_stale_client_cleanup(struct list *client_list) THREAD_OFF(info->t_stale_removal); info->t_stale_removal = NULL; /* Process the stale routes */ - thread_execute( - zrouter.master, - zebra_gr_route_stale_delete_timer_expiry, - info, 1); + event_execute( + zrouter.master, + zebra_gr_route_stale_delete_timer_expiry, + info, 1); } } } @@ -693,8 +693,8 @@ static void zebra_gr_process_client_stale_routes(struct zserv *client, __func__, zebra_route_string(client->proto), VRF_LOGNAME(vrf), info->vrf_id); THREAD_OFF(info->t_stale_removal); - thread_execute(zrouter.master, - zebra_gr_route_stale_delete_timer_expiry, info, - 0); + event_execute(zrouter.master, + zebra_gr_route_stale_delete_timer_expiry, info, + 0); } } |