Skip to content
Permalink
Browse files

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 <mjs@voltanet.io>
  • Loading branch information...
mjstapp committed Sep 10, 2018
1 parent 14b0bc8 commit 68b375e05956cdd1ce935fd54939312b75e3a546
Showing with 4 additions and 4 deletions.
  1. +2 −2 zebra/zebra_dplane.c
  2. +1 −1 zebra/zebra_dplane.h
  3. +1 −1 zebra/zebra_rib.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;
}

/*
@@ -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
@@ -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);

0 comments on commit 68b375e

Please sign in to comment.
You can’t perform that action at this time.