diff options
Diffstat (limited to 'zebra/zebra_dplane.c')
| -rw-r--r-- | zebra/zebra_dplane.c | 237 |
1 files changed, 109 insertions, 128 deletions
diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index 739f6adce9..ef4cef65ca 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -26,7 +26,6 @@ #include "lib/frratomic.h" #include "lib/frr_pthread.h" #include "lib/memory.h" -#include "lib/queue.h" #include "lib/zebra.h" #include "zebra/netconf_netlink.h" #include "zebra/zebra_router.h" @@ -103,7 +102,7 @@ struct dplane_intf_extra { uint32_t flags; uint32_t status; - TAILQ_ENTRY(dplane_intf_extra) link; + struct dplane_intf_extra_list_item dlink; }; /* @@ -152,7 +151,7 @@ struct dplane_route_info { struct nexthop_group old_backup_ng; /* Optional list of extra interface info */ - TAILQ_HEAD(dp_intf_extra_q, dplane_intf_extra) intf_extra_q; + struct dplane_intf_extra_list_head intf_extra_list; }; /* @@ -415,7 +414,7 @@ struct zebra_dplane_ctx { struct zebra_dplane_info zd_ns_info; /* Embedded list linkage */ - TAILQ_ENTRY(zebra_dplane_ctx) zd_q_entries; + struct dplane_ctx_list_item zd_entries; }; /* Flag that can be set by a pre-kernel provider as a signal that an update @@ -423,6 +422,12 @@ struct zebra_dplane_ctx { */ #define DPLANE_CTX_FLAG_NO_KERNEL 0x01 +/* List types declared now that the structs involved are defined. */ +DECLARE_DLIST(dplane_ctx_list, struct zebra_dplane_ctx, zd_entries); +DECLARE_DLIST(dplane_intf_extra_list, struct dplane_intf_extra, dlink); + +/* List for dplane plugins/providers */ +PREDECL_DLIST(dplane_prov_list); /* * Registration block for one dataplane provider. @@ -461,17 +466,20 @@ struct zebra_dplane_provider { _Atomic uint32_t dp_error_counter; /* Queue of contexts inbound to the provider */ - struct dplane_ctx_q dp_ctx_in_q; + struct dplane_ctx_list_head dp_ctx_in_list; /* Queue of completed contexts outbound from the provider back * towards the dataplane module. */ - struct dplane_ctx_q dp_ctx_out_q; + struct dplane_ctx_list_head dp_ctx_out_list; /* Embedded list linkage for provider objects */ - TAILQ_ENTRY(zebra_dplane_provider) dp_prov_link; + struct dplane_prov_list_item dp_link; }; +/* Declare list of providers/plugins */ +DECLARE_DLIST(dplane_prov_list, struct zebra_dplane_provider, dp_link); + /* Declare types for list of zns info objects */ PREDECL_DLIST(zns_info_list); @@ -496,7 +504,7 @@ static struct zebra_dplane_globals { pthread_mutex_t dg_mutex; /* Results callback registered by zebra 'core' */ - int (*dg_results_cb)(struct dplane_ctx_q *ctxlist); + int (*dg_results_cb)(struct dplane_ctx_list_head *ctxlist); /* Sentinel for beginning of shutdown */ volatile bool dg_is_shutdown; @@ -505,10 +513,10 @@ static struct zebra_dplane_globals { volatile bool dg_run; /* Update context queue inbound to the dataplane */ - TAILQ_HEAD(zdg_ctx_q, zebra_dplane_ctx) dg_update_ctx_q; + struct dplane_ctx_list_head dg_update_list; /* Ordered list of providers */ - TAILQ_HEAD(zdg_prov_q, zebra_dplane_provider) dg_providers_q; + struct dplane_prov_list_head dg_providers; /* List of info about each zns */ struct zns_info_list_head dg_zns_list; @@ -668,7 +676,7 @@ void dplane_enable_sys_route_notifs(void) */ static void dplane_ctx_free_internal(struct zebra_dplane_ctx *ctx) { - struct dplane_intf_extra *if_extra, *if_tmp; + struct dplane_intf_extra *if_extra; /* * Some internal allocations may need to be freed, depending on @@ -713,12 +721,9 @@ static void dplane_ctx_free_internal(struct zebra_dplane_ctx *ctx) } /* Optional extra interface info */ - TAILQ_FOREACH_SAFE(if_extra, &ctx->u.rinfo.intf_extra_q, - link, if_tmp) { - TAILQ_REMOVE(&ctx->u.rinfo.intf_extra_q, if_extra, - link); + while ((if_extra = dplane_intf_extra_list_pop( + &ctx->u.rinfo.intf_extra_list))) XFREE(MTYPE_DP_INTF, if_extra); - } break; @@ -885,39 +890,40 @@ void dplane_ctx_fini(struct zebra_dplane_ctx **pctx) dplane_ctx_free(pctx); } +/* Init a list of contexts */ +void dplane_ctx_q_init(struct dplane_ctx_list_head *q) +{ + dplane_ctx_list_init(q); +} + /* Enqueue a context block */ -void dplane_ctx_enqueue_tail(struct dplane_ctx_q *q, +void dplane_ctx_enqueue_tail(struct dplane_ctx_list_head *list, const struct zebra_dplane_ctx *ctx) { - TAILQ_INSERT_TAIL(q, (struct zebra_dplane_ctx *)ctx, zd_q_entries); + dplane_ctx_list_add_tail(list, (struct zebra_dplane_ctx *)ctx); } /* Append a list of context blocks to another list */ -void dplane_ctx_list_append(struct dplane_ctx_q *to_list, - struct dplane_ctx_q *from_list) +void dplane_ctx_list_append(struct dplane_ctx_list_head *to_list, + struct dplane_ctx_list_head *from_list) { - if (TAILQ_FIRST(from_list)) { - TAILQ_CONCAT(to_list, from_list, zd_q_entries); + struct zebra_dplane_ctx *ctx; - /* And clear 'from' list */ - TAILQ_INIT(from_list); - } + while ((ctx = dplane_ctx_list_pop(from_list)) != NULL) + dplane_ctx_list_add_tail(to_list, ctx); } -struct zebra_dplane_ctx *dplane_ctx_get_head(struct dplane_ctx_q *q) +struct zebra_dplane_ctx *dplane_ctx_get_head(struct dplane_ctx_list_head *q) { - struct zebra_dplane_ctx *ctx = TAILQ_FIRST(q); + struct zebra_dplane_ctx *ctx = dplane_ctx_list_first(q); return ctx; } /* Dequeue a context block from the head of a list */ -struct zebra_dplane_ctx *dplane_ctx_dequeue(struct dplane_ctx_q *q) +struct zebra_dplane_ctx *dplane_ctx_dequeue(struct dplane_ctx_list_head *q) { - struct zebra_dplane_ctx *ctx = TAILQ_FIRST(q); - - if (ctx) - TAILQ_REMOVE(q, ctx, zd_q_entries); + struct zebra_dplane_ctx *ctx = dplane_ctx_list_pop(q); return ctx; } @@ -2597,14 +2603,16 @@ void dplane_ctx_rule_set_dp_flow_ptr(struct zebra_dplane_ctx *ctx, const struct dplane_intf_extra * dplane_ctx_get_intf_extra(const struct zebra_dplane_ctx *ctx) { - return TAILQ_FIRST(&ctx->u.rinfo.intf_extra_q); + return dplane_intf_extra_list_const_first( + &ctx->u.rinfo.intf_extra_list); } const struct dplane_intf_extra * dplane_ctx_intf_extra_next(const struct zebra_dplane_ctx *ctx, const struct dplane_intf_extra *ptr) { - return TAILQ_NEXT(ptr, link); + return dplane_intf_extra_list_const_next(&ctx->u.rinfo.intf_extra_list, + ptr); } vrf_id_t dplane_intf_extra_get_vrfid(const struct dplane_intf_extra *ptr) @@ -2793,7 +2801,7 @@ int dplane_ctx_route_init_basic(struct zebra_dplane_ctx *ctx, if (!ctx || !re) return ret; - TAILQ_INIT(&ctx->u.rinfo.intf_extra_q); + dplane_intf_extra_list_init(&ctx->u.rinfo.intf_extra_list); ctx->zd_op = op; ctx->zd_status = ZEBRA_DPLANE_REQUEST_SUCCESS; @@ -2896,8 +2904,9 @@ int dplane_ctx_route_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op, if_extra->flags = ifp->flags; if_extra->status = ifp->status; - TAILQ_INSERT_TAIL(&ctx->u.rinfo.intf_extra_q, - if_extra, link); + dplane_intf_extra_list_add_tail( + &ctx->u.rinfo.intf_extra_list, + if_extra); } } @@ -3622,8 +3631,7 @@ static int dplane_update_enqueue(struct zebra_dplane_ctx *ctx) /* Enqueue for processing by the dataplane pthread */ DPLANE_LOCK(); { - TAILQ_INSERT_TAIL(&zdplane_info.dg_update_ctx_q, ctx, - zd_q_entries); + dplane_ctx_list_add_tail(&zdplane_info.dg_update_list, ctx); } DPLANE_UNLOCK(); @@ -5520,7 +5528,7 @@ int dplane_show_provs_helper(struct vty *vty, bool detailed) vty_out(vty, "Zebra dataplane providers:\n"); DPLANE_LOCK(); - prov = TAILQ_FIRST(&zdplane_info.dg_providers_q); + prov = dplane_prov_list_first(&zdplane_info.dg_providers); DPLANE_UNLOCK(); /* Show counters, useful info from each registered provider */ @@ -5543,9 +5551,7 @@ int dplane_show_provs_helper(struct vty *vty, bool detailed) prov->dp_name, prov->dp_id, in, in_q, in_max, out, out_q, out_max); - DPLANE_LOCK(); - prov = TAILQ_NEXT(prov, dp_prov_link); - DPLANE_UNLOCK(); + prov = dplane_prov_list_next(&zdplane_info.dg_providers, prov); } return CMD_SUCCESS; @@ -5595,8 +5601,8 @@ int dplane_provider_register(const char *name, p = XCALLOC(MTYPE_DP_PROV, sizeof(struct zebra_dplane_provider)); pthread_mutex_init(&(p->dp_mutex), NULL); - TAILQ_INIT(&(p->dp_ctx_in_q)); - TAILQ_INIT(&(p->dp_ctx_out_q)); + dplane_ctx_list_init(&p->dp_ctx_in_list); + dplane_ctx_list_init(&p->dp_ctx_out_list); p->dp_flags = flags; p->dp_priority = prio; @@ -5617,16 +5623,15 @@ int dplane_provider_register(const char *name, "provider-%u", p->dp_id); /* Insert into list ordered by priority */ - TAILQ_FOREACH(last, &zdplane_info.dg_providers_q, dp_prov_link) { + frr_each (dplane_prov_list, &zdplane_info.dg_providers, last) { if (last->dp_priority > p->dp_priority) break; } if (last) - TAILQ_INSERT_BEFORE(last, p, dp_prov_link); + dplane_prov_list_add_after(&zdplane_info.dg_providers, last, p); else - TAILQ_INSERT_TAIL(&zdplane_info.dg_providers_q, p, - dp_prov_link); + dplane_prov_list_add_tail(&zdplane_info.dg_providers, p); /* And unlock */ DPLANE_UNLOCK(); @@ -5688,10 +5693,8 @@ struct zebra_dplane_ctx *dplane_provider_dequeue_in_ctx( dplane_provider_lock(prov); - ctx = TAILQ_FIRST(&(prov->dp_ctx_in_q)); + ctx = dplane_ctx_list_pop(&(prov->dp_ctx_in_list)); if (ctx) { - TAILQ_REMOVE(&(prov->dp_ctx_in_q), ctx, zd_q_entries); - atomic_fetch_sub_explicit(&prov->dp_in_queued, 1, memory_order_relaxed); } @@ -5705,7 +5708,7 @@ struct zebra_dplane_ctx *dplane_provider_dequeue_in_ctx( * Dequeue work to a list, return count */ int dplane_provider_dequeue_in_list(struct zebra_dplane_provider *prov, - struct dplane_ctx_q *listp) + struct dplane_ctx_list_head *listp) { int limit, ret; struct zebra_dplane_ctx *ctx; @@ -5715,14 +5718,11 @@ int dplane_provider_dequeue_in_list(struct zebra_dplane_provider *prov, dplane_provider_lock(prov); for (ret = 0; ret < limit; ret++) { - ctx = TAILQ_FIRST(&(prov->dp_ctx_in_q)); - if (ctx) { - TAILQ_REMOVE(&(prov->dp_ctx_in_q), ctx, zd_q_entries); - - TAILQ_INSERT_TAIL(listp, ctx, zd_q_entries); - } else { + ctx = dplane_ctx_list_pop(&(prov->dp_ctx_in_list)); + if (ctx) + dplane_ctx_list_add_tail(listp, ctx); + else break; - } } if (ret > 0) @@ -5750,8 +5750,7 @@ void dplane_provider_enqueue_out_ctx(struct zebra_dplane_provider *prov, dplane_provider_lock(prov); - TAILQ_INSERT_TAIL(&(prov->dp_ctx_out_q), ctx, - zd_q_entries); + dplane_ctx_list_add_tail(&(prov->dp_ctx_out_list), ctx); /* Maintain out-queue counters */ atomic_fetch_add_explicit(&(prov->dp_out_queued), 1, @@ -5921,12 +5920,12 @@ int dplane_provider_work_ready(void) */ void dplane_provider_enqueue_to_zebra(struct zebra_dplane_ctx *ctx) { - struct dplane_ctx_q temp_list; + struct dplane_ctx_list_head temp_list; /* Zebra's api takes a list, so we need to use a temporary list */ - TAILQ_INIT(&temp_list); + dplane_ctx_list_init(&temp_list); - TAILQ_INSERT_TAIL(&temp_list, ctx, zd_q_entries); + dplane_ctx_list_add_tail(&temp_list, ctx); (zdplane_info.dg_results_cb)(&temp_list); } @@ -6321,11 +6320,11 @@ void dplane_rib_add_multipath(afi_t afi, safi_t safi, struct prefix *p, */ static int kernel_dplane_process_func(struct zebra_dplane_provider *prov) { - struct zebra_dplane_ctx *ctx, *tctx; - struct dplane_ctx_q work_list; + struct zebra_dplane_ctx *ctx; + struct dplane_ctx_list_head work_list; int counter, limit; - TAILQ_INIT(&work_list); + dplane_ctx_list_init(&work_list); limit = dplane_provider_get_work_limit(prov); @@ -6351,15 +6350,14 @@ static int kernel_dplane_process_func(struct zebra_dplane_provider *prov) == DPLANE_OP_IPSET_ENTRY_DELETE)) kernel_dplane_process_ipset_entry(prov, ctx); else - TAILQ_INSERT_TAIL(&work_list, ctx, zd_q_entries); + dplane_ctx_list_add_tail(&work_list, ctx); } kernel_update_multi(&work_list); - TAILQ_FOREACH_SAFE (ctx, &work_list, zd_q_entries, tctx) { + while ((ctx = dplane_ctx_list_pop(&work_list)) != NULL) { kernel_dplane_handle_result(ctx); - TAILQ_REMOVE(&work_list, ctx, zd_q_entries); dplane_provider_enqueue_out_ctx(prov, ctx); } @@ -6486,10 +6484,10 @@ static void dplane_provider_init(void) int dplane_clean_ctx_queue(bool (*context_cb)(struct zebra_dplane_ctx *ctx, void *arg), void *val) { - struct zebra_dplane_ctx *ctx, *temp; - struct dplane_ctx_q work_list; + struct zebra_dplane_ctx *ctx; + struct dplane_ctx_list_head work_list; - TAILQ_INIT(&work_list); + dplane_ctx_list_init(&work_list); if (context_cb == NULL) return AOK; @@ -6497,12 +6495,10 @@ int dplane_clean_ctx_queue(bool (*context_cb)(struct zebra_dplane_ctx *ctx, /* Walk the pending context queue under the dplane lock. */ DPLANE_LOCK(); - TAILQ_FOREACH_SAFE(ctx, &zdplane_info.dg_update_ctx_q, zd_q_entries, - temp) { + frr_each_safe (dplane_ctx_list, &zdplane_info.dg_update_list, ctx) { if (context_cb(ctx, val)) { - TAILQ_REMOVE(&zdplane_info.dg_update_ctx_q, ctx, - zd_q_entries); - TAILQ_INSERT_TAIL(&work_list, ctx, zd_q_entries); + dplane_ctx_list_del(&zdplane_info.dg_update_list, ctx); + dplane_ctx_list_add_tail(&work_list, ctx); } } @@ -6511,10 +6507,8 @@ int dplane_clean_ctx_queue(bool (*context_cb)(struct zebra_dplane_ctx *ctx, /* Now free any contexts selected by the caller, without holding * the lock. */ - TAILQ_FOREACH_SAFE(ctx, &work_list, zd_q_entries, temp) { - TAILQ_REMOVE(&work_list, ctx, zd_q_entries); + while ((ctx = dplane_ctx_list_pop(&work_list)) != NULL) dplane_ctx_fini(&ctx); - } return AOK; } @@ -6552,7 +6546,7 @@ void zebra_dplane_pre_finish(void) zdplane_info.dg_is_shutdown = true; /* Notify provider(s) of pending shutdown. */ - TAILQ_FOREACH(prov, &zdplane_info.dg_providers_q, dp_prov_link) { + frr_each (dplane_prov_list, &zdplane_info.dg_providers, prov) { if (prov->dp_fini == NULL) continue; @@ -6575,8 +6569,8 @@ static bool dplane_work_pending(void) */ DPLANE_LOCK(); { - ctx = TAILQ_FIRST(&zdplane_info.dg_update_ctx_q); - prov = TAILQ_FIRST(&zdplane_info.dg_providers_q); + ctx = dplane_ctx_list_first(&zdplane_info.dg_update_list); + prov = dplane_prov_list_first(&zdplane_info.dg_providers); } DPLANE_UNLOCK(); @@ -6587,18 +6581,16 @@ static bool dplane_work_pending(void) dplane_provider_lock(prov); - ctx = TAILQ_FIRST(&(prov->dp_ctx_in_q)); + ctx = dplane_ctx_list_first(&(prov->dp_ctx_in_list)); if (ctx == NULL) - ctx = TAILQ_FIRST(&(prov->dp_ctx_out_q)); + ctx = dplane_ctx_list_first(&(prov->dp_ctx_out_list)); dplane_provider_unlock(prov); if (ctx != NULL) break; - DPLANE_LOCK(); - prov = TAILQ_NEXT(prov, dp_prov_link); - DPLANE_UNLOCK(); + prov = dplane_prov_list_next(&zdplane_info.dg_providers, prov); } if (ctx != NULL) @@ -6683,10 +6675,10 @@ void zebra_dplane_finish(void) */ static void dplane_thread_loop(struct thread *event) { - struct dplane_ctx_q work_list; - struct dplane_ctx_q error_list; + struct dplane_ctx_list_head work_list; + struct dplane_ctx_list_head error_list; struct zebra_dplane_provider *prov; - struct zebra_dplane_ctx *ctx, *tctx; + struct zebra_dplane_ctx *ctx; int limit, counter, error_counter; uint64_t curr, high; bool reschedule = false; @@ -6695,8 +6687,9 @@ static void dplane_thread_loop(struct thread *event) limit = zdplane_info.dg_updates_per_cycle; /* Init temporary lists used to move contexts among providers */ - TAILQ_INIT(&work_list); - TAILQ_INIT(&error_list); + dplane_ctx_list_init(&work_list); + dplane_ctx_list_init(&error_list); + error_counter = 0; /* Check for zebra shutdown */ @@ -6709,18 +6702,15 @@ static void dplane_thread_loop(struct thread *event) DPLANE_LOCK(); /* Locate initial registered provider */ - prov = TAILQ_FIRST(&zdplane_info.dg_providers_q); + prov = dplane_prov_list_first(&zdplane_info.dg_providers); /* Move new work from incoming list to temp list */ for (counter = 0; counter < limit; counter++) { - ctx = TAILQ_FIRST(&zdplane_info.dg_update_ctx_q); + ctx = dplane_ctx_list_pop(&zdplane_info.dg_update_list); if (ctx) { - TAILQ_REMOVE(&zdplane_info.dg_update_ctx_q, ctx, - zd_q_entries); - ctx->zd_provider = prov->dp_id; - TAILQ_INSERT_TAIL(&work_list, ctx, zd_q_entries); + dplane_ctx_list_add_tail(&work_list, ctx); } else { break; } @@ -6750,7 +6740,7 @@ static void dplane_thread_loop(struct thread *event) /* Capture current provider id in each context; check for * error status. */ - TAILQ_FOREACH_SAFE(ctx, &work_list, zd_q_entries, tctx) { + frr_each_safe (dplane_ctx_list, &work_list, ctx) { if (dplane_ctx_get_status(ctx) == ZEBRA_DPLANE_REQUEST_SUCCESS) { ctx->zd_provider = prov->dp_id; @@ -6764,9 +6754,8 @@ static void dplane_thread_loop(struct thread *event) /* Move to error list; will be returned * zebra main. */ - TAILQ_REMOVE(&work_list, ctx, zd_q_entries); - TAILQ_INSERT_TAIL(&error_list, - ctx, zd_q_entries); + dplane_ctx_list_del(&work_list, ctx); + dplane_ctx_list_add_tail(&error_list, ctx); error_counter++; } } @@ -6774,9 +6763,8 @@ static void dplane_thread_loop(struct thread *event) /* Enqueue new work to the provider */ dplane_provider_lock(prov); - if (TAILQ_FIRST(&work_list)) - TAILQ_CONCAT(&(prov->dp_ctx_in_q), &work_list, - zd_q_entries); + while ((ctx = dplane_ctx_list_pop(&work_list)) != NULL) + dplane_ctx_list_add_tail(&(prov->dp_ctx_in_list), ctx); atomic_fetch_add_explicit(&prov->dp_in_counter, counter, memory_order_relaxed); @@ -6795,7 +6783,7 @@ static void dplane_thread_loop(struct thread *event) /* Reset the temp list (though the 'concat' may have done this * already), and the counter */ - TAILQ_INIT(&work_list); + dplane_ctx_list_init(&work_list); counter = 0; /* Call into the provider code. Note that this is @@ -6812,13 +6800,9 @@ static void dplane_thread_loop(struct thread *event) dplane_provider_lock(prov); while (counter < limit) { - ctx = TAILQ_FIRST(&(prov->dp_ctx_out_q)); + ctx = dplane_ctx_list_pop(&(prov->dp_ctx_out_list)); if (ctx) { - TAILQ_REMOVE(&(prov->dp_ctx_out_q), ctx, - zd_q_entries); - - TAILQ_INSERT_TAIL(&work_list, - ctx, zd_q_entries); + dplane_ctx_list_add_tail(&work_list, ctx); counter++; } else break; @@ -6834,9 +6818,7 @@ static void dplane_thread_loop(struct thread *event) counter, dplane_provider_get_name(prov)); /* Locate next provider */ - DPLANE_LOCK(); - prov = TAILQ_NEXT(prov, dp_prov_link); - DPLANE_UNLOCK(); + prov = dplane_prov_list_next(&zdplane_info.dg_providers, prov); } /* @@ -6861,12 +6843,12 @@ static void dplane_thread_loop(struct thread *event) /* Call through to zebra main */ (zdplane_info.dg_results_cb)(&error_list); - TAILQ_INIT(&error_list); + dplane_ctx_list_init(&error_list); /* Call through to zebra main */ (zdplane_info.dg_results_cb)(&work_list); - TAILQ_INIT(&work_list); + dplane_ctx_list_init(&work_list); } /* @@ -6899,7 +6881,7 @@ void zebra_dplane_shutdown(void) * Note that this call is in the main pthread, so providers must * be prepared for that. */ - TAILQ_FOREACH(dp, &zdplane_info.dg_providers_q, dp_prov_link) { + frr_each (dplane_prov_list, &zdplane_info.dg_providers, dp) { if (dp->dp_fini == NULL) continue; @@ -6920,8 +6902,9 @@ static void zebra_dplane_init_internal(void) pthread_mutex_init(&zdplane_info.dg_mutex, NULL); - TAILQ_INIT(&zdplane_info.dg_update_ctx_q); - TAILQ_INIT(&zdplane_info.dg_providers_q); + dplane_prov_list_init(&zdplane_info.dg_providers); + + dplane_ctx_list_init(&zdplane_info.dg_update_list); zns_info_list_init(&zdplane_info.dg_zns_list); zdplane_info.dg_updates_per_cycle = DPLANE_DEFAULT_NEW_WORK; @@ -6970,7 +6953,7 @@ void zebra_dplane_start(void) /* Call start callbacks for registered providers */ DPLANE_LOCK(); - prov = TAILQ_FIRST(&zdplane_info.dg_providers_q); + prov = dplane_prov_list_first(&zdplane_info.dg_providers); DPLANE_UNLOCK(); while (prov) { @@ -6979,9 +6962,7 @@ void zebra_dplane_start(void) (prov->dp_start)(prov); /* Locate next provider */ - DPLANE_LOCK(); - prov = TAILQ_NEXT(prov, dp_prov_link); - DPLANE_UNLOCK(); + prov = dplane_prov_list_next(&zdplane_info.dg_providers, prov); } frr_pthread_run(zdplane_info.dg_pthread, NULL); @@ -6990,7 +6971,7 @@ void zebra_dplane_start(void) /* * Initialize the dataplane module at startup; called by zebra rib_init() */ -void zebra_dplane_init(int (*results_fp)(struct dplane_ctx_q *)) +void zebra_dplane_init(int (*results_fp)(struct dplane_ctx_list_head *)) { zebra_dplane_init_internal(); zdplane_info.dg_results_cb = results_fp; |
