summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_mpls.c
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2018-06-08 12:52:01 +0200
committerGitHub <noreply@github.com>2018-06-08 12:52:01 +0200
commit71343b85d69fe6c250e155b33f1e7e9fd3786e13 (patch)
treeb4617ba6ab48c48554638603879c2953a55c0b9c /zebra/zebra_mpls.c
parentMerge pull request #2123 from qlyoung/zserv-mt (diff)
parentzebra: Add `enum dp_req_result` to lsp install/deletes (diff)
downloadfrr-71343b85d69fe6c250e155b33f1e7e9fd3786e13.tar.xz
frr-71343b85d69fe6c250e155b33f1e7e9fd3786e13.zip
Merge pull request #2292 from donaldsharp/fixup_sb_stuff
Fixup sb stuff
Diffstat (limited to 'zebra/zebra_mpls.c')
-rw-r--r--zebra/zebra_mpls.c51
1 files changed, 36 insertions, 15 deletions
diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c
index e040808e0..fe0837a63 100644
--- a/zebra/zebra_mpls.c
+++ b/zebra/zebra_mpls.c
@@ -860,7 +860,7 @@ static void lsp_uninstall_from_kernel(struct hash_backet *backet, void *ctxt)
lsp = (zebra_lsp_t *)backet->data;
if (CHECK_FLAG(lsp->flags, LSP_FLAG_INSTALLED))
- kernel_del_lsp(lsp);
+ (void)kernel_del_lsp(lsp);
}
/*
@@ -914,17 +914,31 @@ static wq_item_status lsp_process(struct work_queue *wq, void *data)
if (newbest) {
UNSET_FLAG(lsp->flags, LSP_FLAG_CHANGED);
- kernel_add_lsp(lsp);
-
- zvrf->lsp_installs++;
+ switch (kernel_add_lsp(lsp)) {
+ case DP_REQUEST_QUEUED:
+ zlog_err("No current DataPlane interfaces can return this, please fix");
+ break;
+ case DP_REQUEST_FAILURE:
+ break;
+ case DP_REQUEST_SUCCESS:
+ zvrf->lsp_installs++;
+ break;
+ }
}
} else {
/* Installed, may need an update and/or delete. */
if (!newbest) {
- kernel_del_lsp(lsp);
-
- zvrf->lsp_removals++;
+ switch (kernel_del_lsp(lsp)) {
+ case DP_REQUEST_QUEUED:
+ zlog_err("No current DataPlane interfaces can return this, please fix");
+ break;
+ case DP_REQUEST_FAILURE:
+ break;
+ case DP_REQUEST_SUCCESS:
+ zvrf->lsp_removals++;
+ break;
+ }
} else if (CHECK_FLAG(lsp->flags, LSP_FLAG_CHANGED)) {
zebra_nhlfe_t *nhlfe;
struct nexthop *nexthop;
@@ -953,9 +967,16 @@ static wq_item_status lsp_process(struct work_queue *wq, void *data)
}
}
- kernel_upd_lsp(lsp);
-
- zvrf->lsp_installs++;
+ switch (kernel_upd_lsp(lsp)) {
+ case DP_REQUEST_QUEUED:
+ zlog_err("No current DataPlane interfaces can return this, please fix");
+ break;
+ case DP_REQUEST_FAILURE:
+ break;
+ case DP_REQUEST_SUCCESS:
+ zvrf->lsp_installs++;
+ break;
+ }
}
}
@@ -1687,7 +1708,7 @@ static int mpls_processq_init(struct zebra_t *zebra)
/* Public functions */
-void kernel_lsp_pass_fail(zebra_lsp_t *lsp, enum southbound_results res)
+void kernel_lsp_pass_fail(zebra_lsp_t *lsp, enum dp_results res)
{
struct nexthop *nexthop;
zebra_nhlfe_t *nhlfe;
@@ -1696,12 +1717,12 @@ void kernel_lsp_pass_fail(zebra_lsp_t *lsp, enum southbound_results res)
return;
switch (res) {
- case SOUTHBOUND_INSTALL_FAILURE:
+ case DP_INSTALL_FAILURE:
UNSET_FLAG(lsp->flags, LSP_FLAG_INSTALLED);
clear_nhlfe_installed(lsp);
zlog_warn("LSP Install Failure: %u", lsp->ile.in_label);
break;
- case SOUTHBOUND_INSTALL_SUCCESS:
+ case DP_INSTALL_SUCCESS:
SET_FLAG(lsp->flags, LSP_FLAG_INSTALLED);
for (nhlfe = lsp->nhlfe_list; nhlfe; nhlfe = nhlfe->next) {
nexthop = nhlfe->nexthop;
@@ -1712,11 +1733,11 @@ void kernel_lsp_pass_fail(zebra_lsp_t *lsp, enum southbound_results res)
SET_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB);
}
break;
- case SOUTHBOUND_DELETE_SUCCESS:
+ case DP_DELETE_SUCCESS:
UNSET_FLAG(lsp->flags, LSP_FLAG_INSTALLED);
clear_nhlfe_installed(lsp);
break;
- case SOUTHBOUND_DELETE_FAILURE:
+ case DP_DELETE_FAILURE:
zlog_warn("LSP Deletion Failure: %u", lsp->ile.in_label);
break;
}