diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-02-05 18:41:12 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-02-05 18:41:12 -0500 |
| commit | 4634d02cfd86685156b29c8084a979749efe15e2 (patch) | |
| tree | 877368695bf3484d632785d040eab21ac2aa802e /zebra/zebra_rib.c | |
| parent | c0a0dbb01b7186dddfa5320d12f26efc761da3b0 (diff) | |
| parent | 9bd9717bb28195bb2f0a874993f7bc89cbc47e1b (diff) | |
Merge pull request #3684 from mjstapp/dplane_pw
zebra: async dataplane for pseudowires
Diffstat (limited to 'zebra/zebra_rib.c')
| -rw-r--r-- | zebra/zebra_rib.c | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 73e4b981b5..b78fe76761 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -3226,6 +3226,34 @@ void rib_close_table(struct route_table *table) } /* + * Handler for async dataplane results after a pseudowire installation + */ +static int handle_pw_result(struct zebra_dplane_ctx *ctx) +{ + int ret = 0; + struct zebra_pw *pw; + struct zebra_vrf *vrf; + + /* The pseudowire code assumes success - we act on an error + * result for installation attempts here. + */ + if (dplane_ctx_get_op(ctx) != DPLANE_OP_PW_INSTALL) + goto done; + + if (dplane_ctx_get_status(ctx) != ZEBRA_DPLANE_REQUEST_SUCCESS) { + vrf = zebra_vrf_lookup_by_id(dplane_ctx_get_vrf(ctx)); + pw = zebra_pw_find(vrf, dplane_ctx_get_pw_ifname(ctx)); + if (pw) + zebra_pw_install_failure(pw); + } + +done: + + return ret; +} + + +/* * Handle results from the dataplane system. Dequeue update context * structs, dispatch to appropriate internal handlers. */ @@ -3236,8 +3264,6 @@ static int rib_process_dplane_results(struct thread *thread) /* Dequeue a list of completed updates with one lock/unlock cycle */ - /* TODO -- dequeue a list with one lock/unlock cycle? */ - do { TAILQ_INIT(&ctxlist); @@ -3270,6 +3296,11 @@ static int rib_process_dplane_results(struct thread *thread) zebra_mpls_lsp_dplane_result(ctx); break; + case DPLANE_OP_PW_INSTALL: + case DPLANE_OP_PW_UNINSTALL: + handle_pw_result(ctx); + break; + default: /* Don't expect this: just return the struct? */ dplane_ctx_fini(&ctx); |
