]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: handle pw updates in async dplane
authorMark Stapp <mjs@voltanet.io>
Mon, 10 Dec 2018 19:49:12 +0000 (14:49 -0500)
committerMark Stapp <mjs@voltanet.io>
Fri, 25 Jan 2019 15:45:57 +0000 (10:45 -0500)
Add kernel 'provider' support for pseudowire updates.

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

index 4020cbeb47997da1f141b6ae13d7b7ec0e7fb0eb..47ee67d46cca5ba715a3fdfda43316a6e955a5bc 100644 (file)
@@ -1701,6 +1701,32 @@ kernel_dplane_lsp_update(struct zebra_dplane_ctx *ctx)
        return res;
 }
 
+/*
+ * 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
  */
@@ -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,