diff options
| author | Mark Stapp <mjs@labn.net> | 2023-01-20 17:24:17 -0500 | 
|---|---|---|
| committer | Mark Stapp <mjs@labn.net> | 2023-01-23 08:55:44 -0500 | 
| commit | ac96497ccc1def035bbb63f260605ab3b5097232 (patch) | |
| tree | 200bfb2e2aff27cec8aaa8d60565740dbccb34dd /zebra/kernel_netlink.c | |
| parent | de2e2d5ef09477ff03c17c18eeb1b2cb8da80f84 (diff) | |
zebra: use typesafe lib lists in zebra dplane
Replace some of the old queue/DLIST macros with typesafe
dlists.
Signed-off-by: Mark Stapp <mjs@labn.net>
Diffstat (limited to 'zebra/kernel_netlink.c')
| -rw-r--r-- | zebra/kernel_netlink.c | 17 | 
1 files changed, 9 insertions, 8 deletions
diff --git a/zebra/kernel_netlink.c b/zebra/kernel_netlink.c index 54d9561e2b..42afe61469 100644 --- a/zebra/kernel_netlink.c +++ b/zebra/kernel_netlink.c @@ -202,13 +202,13 @@ struct nl_batch {  	const struct zebra_dplane_info *zns; -	struct dplane_ctx_q ctx_list; +	struct dplane_ctx_list_head ctx_list;  	/*  	 * Pointer to the queue of completed contexts outbound back  	 * towards the dataplane module.  	 */ -	struct dplane_ctx_q *ctx_out_q; +	struct dplane_ctx_list_head *ctx_out_q;  };  int netlink_config_write_helper(struct vty *vty) @@ -1446,10 +1446,11 @@ static void nl_batch_reset(struct nl_batch *bth)  	bth->msgcnt = 0;  	bth->zns = NULL; -	TAILQ_INIT(&(bth->ctx_list)); +	dplane_ctx_q_init(&(bth->ctx_list));  } -static void nl_batch_init(struct nl_batch *bth, struct dplane_ctx_q *ctx_out_q) +static void nl_batch_init(struct nl_batch *bth, +			  struct dplane_ctx_list_head *ctx_out_q)  {  	/*  	 * If the size of the buffer has changed, free and then allocate a new @@ -1665,14 +1666,14 @@ static enum netlink_msg_status nl_put_msg(struct nl_batch *bth,  	return FRR_NETLINK_ERROR;  } -void kernel_update_multi(struct dplane_ctx_q *ctx_list) +void kernel_update_multi(struct dplane_ctx_list_head *ctx_list)  {  	struct nl_batch batch;  	struct zebra_dplane_ctx *ctx; -	struct dplane_ctx_q handled_list; +	struct dplane_ctx_list_head handled_list;  	enum netlink_msg_status res; -	TAILQ_INIT(&handled_list); +	dplane_ctx_q_init(&handled_list);  	nl_batch_init(&batch, &handled_list);  	while (true) { @@ -1703,7 +1704,7 @@ void kernel_update_multi(struct dplane_ctx_q *ctx_list)  	nl_batch_send(&batch); -	TAILQ_INIT(ctx_list); +	dplane_ctx_q_init(ctx_list);  	dplane_ctx_list_append(ctx_list, &handled_list);  }  | 
