diff options
Diffstat (limited to 'zebra/zebra_rib.c')
| -rw-r--r-- | zebra/zebra_rib.c | 45 |
1 files changed, 12 insertions, 33 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 81910f68b7..2f71a10d3d 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -72,7 +72,7 @@ DEFINE_MTYPE_STATIC(ZEBRA, WQ_WRAPPER, "WQ wrapper"); */ static pthread_mutex_t dplane_mutex; static struct thread *t_dplane; -static struct dplane_ctx_q rib_dplane_q; +static struct dplane_ctx_list_head rib_dplane_q; DEFINE_HOOK(rib_update, (struct route_node * rn, const char *reason), (rn, reason)); @@ -1788,9 +1788,12 @@ no_nexthops: ctxnhg->nexthop != NULL ? "" : " (empty)"); /* Set the flag about the dedicated fib list */ - SET_FLAG(re->status, ROUTE_ENTRY_USE_FIB_NHG); - if (ctxnhg->nexthop) - copy_nexthops(&(re->fib_ng.nexthop), ctxnhg->nexthop, NULL); + if (zrouter.asic_notification_nexthop_control) { + SET_FLAG(re->status, ROUTE_ENTRY_USE_FIB_NHG); + if (ctxnhg->nexthop) + copy_nexthops(&(re->fib_ng.nexthop), ctxnhg->nexthop, + NULL); + } check_backups: @@ -4337,25 +4340,6 @@ void rib_update_table(struct route_table *table, enum rib_update_event event, } } -static void rib_update_handle_vrf(vrf_id_t vrf_id, enum rib_update_event event, - int rtype) -{ - struct route_table *table; - - if (IS_ZEBRA_DEBUG_EVENT) - zlog_debug("%s: Handling VRF %s event %s", __func__, - vrf_id_to_name(vrf_id), rib_update_event2str(event)); - - /* Process routes of interested address-families. */ - table = zebra_vrf_table(AFI_IP, SAFI_UNICAST, vrf_id); - if (table) - rib_update_table(table, event, rtype); - - table = zebra_vrf_table(AFI_IP6, SAFI_UNICAST, vrf_id); - if (table) - rib_update_table(table, event, rtype); -} - static void rib_update_handle_vrf_all(enum rib_update_event event, int rtype) { struct zebra_router_table *zrt; @@ -4371,7 +4355,6 @@ static void rib_update_handle_vrf_all(enum rib_update_event event, int rtype) struct rib_update_ctx { enum rib_update_event event; - bool vrf_all; vrf_id_t vrf_id; }; @@ -4399,10 +4382,7 @@ static void rib_update_handler(struct thread *thread) ctx = THREAD_ARG(thread); - if (ctx->vrf_all) - rib_update_handle_vrf_all(ctx->event, ZEBRA_ROUTE_ALL); - else - rib_update_handle_vrf(ctx->vrf_id, ctx->event, ZEBRA_ROUTE_ALL); + rib_update_handle_vrf_all(ctx->event, ZEBRA_ROUTE_ALL); rib_update_ctx_fini(&ctx); } @@ -4422,7 +4402,6 @@ void rib_update(enum rib_update_event event) return; ctx = rib_update_ctx_init(0, event); - ctx->vrf_all = true; thread_add_event(zrouter.master, rib_update_handler, ctx, 0, &t_rib_update_threads[event]); @@ -4613,13 +4592,13 @@ static void handle_pw_result(struct zebra_dplane_ctx *ctx) static void rib_process_dplane_results(struct thread *thread) { struct zebra_dplane_ctx *ctx; - struct dplane_ctx_q ctxlist; + struct dplane_ctx_list_head ctxlist; bool shut_p = false; /* Dequeue a list of completed updates with one lock/unlock cycle */ do { - TAILQ_INIT(&ctxlist); + dplane_ctx_q_init(&ctxlist); /* Take lock controlling queue of results */ frr_with_mutex (&dplane_mutex) { @@ -4788,7 +4767,7 @@ static void rib_process_dplane_results(struct thread *thread) * the dataplane pthread. We enqueue the results here for processing by * the main thread later. */ -static int rib_dplane_results(struct dplane_ctx_q *ctxlist) +static int rib_dplane_results(struct dplane_ctx_list_head *ctxlist) { /* Take lock controlling queue of results */ frr_with_mutex (&dplane_mutex) { @@ -4833,7 +4812,7 @@ void rib_init(void) /* Init dataplane, and register for results */ pthread_mutex_init(&dplane_mutex, NULL); - TAILQ_INIT(&rib_dplane_q); + dplane_ctx_q_init(&rib_dplane_q); zebra_dplane_init(rib_dplane_results); } |
