]> git.proxmox.com Git - mirror_frr.git/commitdiff
*: Convert thread_execute to event_execute
authorDonald Sharp <sharpd@nvidia.com>
Sun, 11 Dec 2022 13:06:25 +0000 (08:06 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Fri, 24 Mar 2023 12:32:17 +0000 (08:32 -0400)
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
22 files changed:
bgpd/bgp_route.c
bgpd/bgp_vty.c
doc/developer/path-internals-pcep.rst
eigrpd/eigrp_hello.c
eigrpd/eigrp_update.c
lib/bfd.c
lib/event.c
lib/event.h
lib/wheel.c
ospf6d/ospf6_interface.c
ospf6d/ospf6_intra.h
ospf6d/ospf6_lsa.c
ospf6d/ospf6_lsdb.c
ospf6d/ospf6_message.c
ospf6d/ospf6_nssa.c
ospfd/ospf_ism.h
ospfd/ospf_lsa.c
ospfd/ospf_nsm.h
pimd/pim6_mld.c
tests/lib/test_segv.c
tools/frr-llvm-cg.c
zebra/zebra_gr.c

index 5a94da2f47dcdef14d8e0f00dd6095b09664436a..8b56d04e64351778d5c25dc7a8b1fae4f84410c0 100644 (file)
@@ -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);
index 95f2b82e934f67257a2f0fca5d07e3f10340cfd6..e0476c0cef4571adb5c7f37fc279f2e5bee89f1e 100644 (file)
@@ -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 {
index ca318314f1f310b43203fb2b4906de3d9a75598d..a6b22204c2dfc0668b83f89b56a9844c71bf80a4 100644 (file)
@@ -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
index 02807dd31db63b098db143d806343c563fbe0d62..12de6d4a135ac053fa1a071ba768dd4b8ee18fac 100644 (file)
@@ -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,
index 5fa469531730d6bc984cfdb85ae387a114d97c8b..1a0729d32b1aa6bb865520e54ec0c70fcafc156e 100644 (file)
@@ -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);
 }
 
 /**
index e1aa45f097157822b903ac665ed364a5bdec5f77..b92c34656546a853392e5855ba9721144202ce7b 100644 (file)
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -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;
index 5aea78186cb0c59500b835a302de64b9c4c9e32e..12b40e112160df0c550dd11e749439dba10ff856 100644 (file)
@@ -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;
 
index c38b7b6c32414a66da1fe6f44e1a9592186586f8..cdb22848150c5b139ffbd4666c807265e0f65258 100644 (file)
@@ -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 *);
index 27e087efc6b5c5f8c7fe8a6146e7d888379d9072..9ba122e826a76dd47001c1a93adc84ca4df8f9ac 100644 (file)
@@ -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,
index 7828f35d54c8fe97cca5a2aefe9bcbd2d58a07b4..2c8d168e09634e4d6309578c9d83be4f571795d5 100644 (file)
@@ -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 */
index b09c4163f9e763b0f704de915df5702f5b9b84ae..62e877eb59de08aedc2c83b8997a8f57c624fa84 100644 (file)
@@ -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 */
index a9dd7aa28ca15b07887d29d18be760622905c075..be0cc344245c3bad5202cee15cb83342e7c9aec1 100644 (file)
@@ -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;
index 586183731c4ec7bdbc24ae78710ddec4387247ce..817949f0199b0799ecafeb831fe33429db15bb25 100644 (file)
@@ -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);
index ff739587429a6e07a7764cc8028b2c09e470ff56..99c33faccff6da1900cb0a3ad1c3650b87fe2048 100644 (file)
@@ -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);
        }
index ca48b25d680b533794889c199bb1d1576ef3be95..87754a59a8e0625935fd6c1a430aeb63c4556abe 100644 (file)
@@ -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);
index d5261546e13501776121e0bd1a877cbb0926aa73..426dda77336a0aa698f9d271df8f51cba98e0a20 100644 (file)
@@ -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);
index aa113b087a342e906be53d303f512321a9c5e35d..ea5dc651acd0646611b44b88002bb5f480d6b41f 100644 (file)
@@ -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;
index 140e8533fc9b518e851ed662a92fe6e0645d1869..3b8d4215f70a11f8de4d1e6c3e883a97c3b71263 100644 (file)
@@ -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 *);
index 98b311f6040571d38140f3964e7457e8a2cb6ff4..52dbfddd9ad296db0ffe2dd62f6bebe3228dd2d1 100644 (file)
@@ -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)
index f4a22930bf359aee5f4cc2af2d6f675d989fb377..3cf4cbad24edea5ed0b0e77a1f241eebc45fd7c0 100644 (file)
@@ -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);
 }
index 634474fe492b273d40d8d7235723de539d9da491..3a7222e421fc772edf03c86dff8f977353d13332 100644 (file)
@@ -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;
 
index e055eae7e1d9511fe4e46e0049d585f3c0132831..4d0caba89e97f003cbab0fe9b77ec9832b71db97 100644 (file)
@@ -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);
        }
 }