diff options
| author | Mark Stapp <mjs@voltanet.io> | 2018-12-10 14:49:12 -0500 |
|---|---|---|
| committer | Mark Stapp <mjs@voltanet.io> | 2019-01-25 10:45:57 -0500 |
| commit | c10a646df422792f6bae679f4d0a8d0cf43bb861 (patch) | |
| tree | 56e7468ade6e1f595452ab642b6eb016ee81e41d | |
| parent | 97d8d05a811eac7b3f39c64f7806f5b9c5bc2004 (diff) | |
zebra: handle pw updates in async dplane
Add kernel 'provider' support for pseudowire updates.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
| -rw-r--r-- | zebra/zebra_dplane.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index 4020cbeb47..47ee67d46c 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -1702,6 +1702,32 @@ kernel_dplane_lsp_update(struct zebra_dplane_ctx *ctx) } /* + * Handler for kernel pseudowire updates + */ +static enum zebra_dplane_result +kernel_dplane_pw_update(struct zebra_dplane_ctx *ctx) +{ + enum zebra_dplane_result res; + + if (IS_ZEBRA_DEBUG_DPLANE_DETAIL) + zlog_debug("Dplane pw %s: op %s af %d loc: %u rem: %u", + dplane_ctx_get_pw_ifname(ctx), + dplane_op2str(ctx->zd_op), + dplane_ctx_get_pw_af(ctx), + dplane_ctx_get_pw_local_label(ctx), + dplane_ctx_get_pw_remote_label(ctx)); + + res = kernel_pw_update(ctx); + + if (res != ZEBRA_DPLANE_REQUEST_SUCCESS) + atomic_fetch_add_explicit( + &zdplane_info.dg_pw_errors, 1, + memory_order_relaxed); + + return res; +} + +/* * Handler for kernel route updates */ static enum zebra_dplane_result @@ -1767,6 +1793,11 @@ static int kernel_dplane_process_func(struct zebra_dplane_provider *prov) res = kernel_dplane_lsp_update(ctx); break; + case DPLANE_OP_PW_INSTALL: + case DPLANE_OP_PW_UNINSTALL: + res = kernel_dplane_pw_update(ctx); + break; + default: atomic_fetch_add_explicit( &zdplane_info.dg_other_errors, 1, |
