From 68b375e05956cdd1ce935fd54939312b75e3a546 Mon Sep 17 00:00:00 2001 From: Mark Stapp Date: Mon, 10 Sep 2018 15:36:30 -0400 Subject: [PATCH] zebra: revise dplane dequeue api Change the dataplane context dequeue api used by zebra to make the purpose a bit clearer. Signed-off-by: Mark Stapp --- zebra/zebra_dplane.c | 4 ++-- zebra/zebra_dplane.h | 2 +- zebra/zebra_rib.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index a387241385..24975697ea 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -324,14 +324,14 @@ void dplane_ctx_list_append(struct dplane_ctx_q *to_list, } /* Dequeue a context block from the head of a list */ -void dplane_ctx_dequeue(struct dplane_ctx_q *q, struct zebra_dplane_ctx **ctxp) +struct zebra_dplane_ctx *dplane_ctx_dequeue(struct dplane_ctx_q *q) { struct zebra_dplane_ctx *ctx = TAILQ_FIRST(q); if (ctx) TAILQ_REMOVE(q, ctx, zd_q_entries); - *ctxp = ctx; + return ctx; } /* diff --git a/zebra/zebra_dplane.h b/zebra/zebra_dplane.h index 60dfb07fed..2e64540d6b 100644 --- a/zebra/zebra_dplane.h +++ b/zebra/zebra_dplane.h @@ -133,7 +133,7 @@ void dplane_ctx_list_append(struct dplane_ctx_q *to_list, struct dplane_ctx_q *from_list); /* Dequeue a context block from the head of caller's tailq */ -void dplane_ctx_dequeue(struct dplane_ctx_q *q, struct zebra_dplane_ctx **ctxp); +struct zebra_dplane_ctx *dplane_ctx_dequeue(struct dplane_ctx_q *q); /* * Accessors for information from the context object diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index f161d5875b..f2d07310ee 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -3266,7 +3266,7 @@ static int rib_process_dplane_results(struct thread *thread) pthread_mutex_lock(&dplane_mutex); { /* Dequeue context block */ - dplane_ctx_dequeue(&rib_dplane_q, &ctx); + ctx = dplane_ctx_dequeue(&rib_dplane_q); } pthread_mutex_unlock(&dplane_mutex); -- 2.39.5