From 97d8d05a811eac7b3f39c64f7806f5b9c5bc2004 Mon Sep 17 00:00:00 2001 From: Mark Stapp Date: Mon, 10 Dec 2018 14:34:24 -0500 Subject: zebra: convert PW updates to async dataplane Add accessors for pw attributes; init pw attributes; replace 'hook' calls for pw install/uninstall with dplane apis. Signed-off-by: Mark Stapp --- zebra/zebra_pw.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'zebra/zebra_pw.c') diff --git a/zebra/zebra_pw.c b/zebra/zebra_pw.c index fb9a40fe3..42a451124 100644 --- a/zebra/zebra_pw.c +++ b/zebra/zebra_pw.c @@ -98,9 +98,10 @@ void zebra_pw_del(struct zebra_vrf *zvrf, struct zebra_pw *pw) zebra_deregister_rnh_pseudowire(pw->vrf_id, pw); /* uninstall */ - if (pw->status == PW_STATUS_UP) + if (pw->status == PW_STATUS_UP) { hook_call(pw_uninstall, pw); - else if (pw->install_retry_timer) + dplane_pw_uninstall(pw); + } else if (pw->install_retry_timer) THREAD_TIMER_OFF(pw->install_retry_timer); /* unlink and release memory */ @@ -171,7 +172,8 @@ static void zebra_pw_install(struct zebra_pw *pw) pw->vrf_id, pw->ifname, zebra_route_string(pw->protocol)); - if (hook_call(pw_install, pw)) { + hook_call(pw_install, pw); + if (dplane_pw_install(pw) == ZEBRA_DPLANE_REQUEST_FAILURE) { zebra_pw_install_failure(pw); return; } @@ -192,6 +194,7 @@ static void zebra_pw_uninstall(struct zebra_pw *pw) /* ignore any possible error */ hook_call(pw_uninstall, pw); + dplane_pw_uninstall(pw); if (zebra_pw_enabled(pw)) zebra_pw_update_status(pw, PW_STATUS_DOWN); -- cgit v1.2.3