]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: revise dplane dequeue api
authorMark Stapp <mjs@voltanet.io>
Mon, 10 Sep 2018 19:36:30 +0000 (15:36 -0400)
committerMark Stapp <mjs@voltanet.io>
Wed, 21 Nov 2018 15:38:08 +0000 (10:38 -0500)
Change the dataplane context dequeue api used by zebra to make the
purpose a bit clearer.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
zebra/zebra_dplane.c
zebra/zebra_dplane.h
zebra/zebra_rib.c

index a38724138522a2964095b6cf34c0d1c72d55a90c..24975697ea57f826a97c207ac8bbc422e29eb149 100644 (file)
@@ -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;
 }
 
 /*
index 60dfb07fed942c2752db075a04ad024be7d16a23..2e64540d6b9dd67fef628ea711b2b721fcbb701d 100644 (file)
@@ -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
index f161d5875b1d8fda1cd7f7b73a395affac77d22b..f2d07310eed10914e6bd28d21cc3837f78e99b03 100644 (file)
@@ -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);