From: Renato Westphal Date: Fri, 20 Nov 2020 21:59:35 +0000 (-0300) Subject: isisd: rename the "debug isis ti-lfa" command to make it more generic X-Git-Tag: base_7.6~170^2~6 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=2866b119112ea6e8485ce8a6dcbb2c167eca3cd1;p=matthieu%2Ffrr.git isisd: rename the "debug isis ti-lfa" command to make it more generic Rename "debug isis ti-lfa" to "debug isis lfa". Having different debug guards for different kinds of LFA (classic, remote and TI-LFA) doesn't make sense since all LFA solutions share code to certain extent. Signed-off-by: Renato Westphal --- diff --git a/doc/user/isisd.rst b/doc/user/isisd.rst index 81333a2167..0bdc8121aa 100644 --- a/doc/user/isisd.rst +++ b/doc/user/isisd.rst @@ -641,13 +641,13 @@ Debugging ISIS IS-IS Segment Routing events. -.. index:: debug isis ti-lfa -.. clicmd:: debug isis ti-lfa +.. index:: debug isis lfa +.. clicmd:: debug isis lfa -.. index:: debug isis ti-lfa -.. clicmd:: no debug isis ti-lfa +.. index:: debug isis lfa +.. clicmd:: no debug isis lfa - IS-IS TI-LFA events. + IS-IS LFA events. .. index:: show debugging isis .. clicmd:: show debugging isis diff --git a/isisd/isis_lfa.c b/isisd/isis_lfa.c index 66572d0a0b..13822a9170 100644 --- a/isisd/isis_lfa.c +++ b/isisd/isis_lfa.c @@ -438,10 +438,10 @@ static int tilfa_build_repair_list(struct isis_spftree *spftree_pc, uint32_t sid_index; mpls_label_t label_qnode; - if (IS_DEBUG_TILFA) { + if (IS_DEBUG_LFA) { vid2string(vertex, buf, sizeof(buf)); - zlog_debug("ISIS-TI-LFA: vertex %s %s", - vtype2string(vertex->type), buf); + zlog_debug("ISIS-LFA: vertex %s %s", vtype2string(vertex->type), + buf); } /* Push original Prefix-SID label when necessary. */ @@ -450,9 +450,9 @@ static int tilfa_build_repair_list(struct isis_spftree *spftree_pc, assert(pvertex); sid_index = vertex->N.ip.sr.sid.value; - if (IS_DEBUG_TILFA) + if (IS_DEBUG_LFA) zlog_debug( - "ISIS-TI-LFA: pushing Prefix-SID to %pFX (index %u)", + "ISIS-LFA: pushing Prefix-SID to %pFX (index %u)", &vertex->N.ip.p.dest, sid_index); sid_dest.type = TILFA_SID_PREFIX; sid_dest.value.index.value = sid_index; @@ -481,14 +481,14 @@ static int tilfa_build_repair_list(struct isis_spftree *spftree_pc, label_qnode = tilfa_find_qnode_adj_sid(spftree_pc, vertex->N.id, vertex_child->N.id); if (label_qnode == MPLS_INVALID_LABEL) { - zlog_warn("ISIS-TI-LFA: failed to find %s->%s Adj-SID", + zlog_warn("ISIS-LFA: failed to find %s->%s Adj-SID", print_sys_hostname(vertex->N.id), print_sys_hostname(vertex_child->N.id)); return -1; } - if (IS_DEBUG_TILFA) + if (IS_DEBUG_LFA) zlog_debug( - "ISIS-TI-LFA: pushing %s->%s Adj-SID (label %u)", + "ISIS-LFA: pushing %s->%s Adj-SID (label %u)", print_sys_hostname(vertex->N.id), print_sys_hostname(vertex_child->N.id), label_qnode); @@ -501,17 +501,17 @@ static int tilfa_build_repair_list(struct isis_spftree *spftree_pc, if (is_pnode) { /* The same P-node can't be used more than once. */ if (isis_spf_node_find(used_pnodes, vertex->N.id)) { - if (IS_DEBUG_TILFA) + if (IS_DEBUG_LFA) zlog_debug( - "ISIS-TI-LFA: skipping already used P-node"); + "ISIS-LFA: skipping already used P-node"); return 0; } isis_spf_node_new(used_pnodes, vertex->N.id); if (!vertex_child) { - if (IS_DEBUG_TILFA) + if (IS_DEBUG_LFA) zlog_debug( - "ISIS-TI-LFA: destination is within Ext-P-Space"); + "ISIS-LFA: destination is within Ext-P-Space"); return 0; } @@ -519,14 +519,14 @@ static int tilfa_build_repair_list(struct isis_spftree *spftree_pc, tilfa_find_pnode_prefix_sid(spftree_pc, vertex->N.id); if (sid_index == UINT32_MAX) { zlog_warn( - "ISIS-TI-LFA: failed to find Prefix-SID corresponding to PQ-node %s", + "ISIS-LFA: failed to find Prefix-SID corresponding to PQ-node %s", print_sys_hostname(vertex->N.id)); return -1; } - if (IS_DEBUG_TILFA) + if (IS_DEBUG_LFA) zlog_debug( - "ISIS-TI-LFA: pushing Node-SID to %s (index %u)", + "ISIS-LFA: pushing Node-SID to %s (index %u)", print_sys_hostname(vertex->N.id), sid_index); sid_pnode.type = TILFA_SID_PREFIX; sid_pnode.value.index.value = sid_index; @@ -536,7 +536,7 @@ static int tilfa_build_repair_list(struct isis_spftree *spftree_pc, if (listcount(repair_list) > spftree_pc->area->srdb.config.msd) { zlog_warn( - "ISIS-TI-LFA: list of repair segments exceeds locally configured MSD (%u > %u)", + "ISIS-LFA: list of repair segments exceeds locally configured MSD (%u > %u)", listcount(repair_list), spftree_pc->area->srdb.config.msd); return -1; @@ -680,13 +680,13 @@ int isis_lfa_check(struct isis_spftree *spftree_pc, struct isis_vertex *vertex) if (!spftree_pc->area->srdb.enabled) return -1; - if (IS_DEBUG_TILFA) + if (IS_DEBUG_LFA) vid2string(vertex, buf, sizeof(buf)); if (!lfa_check_needs_protection(spftree_pc, vertex)) { - if (IS_DEBUG_TILFA) + if (IS_DEBUG_LFA) zlog_debug( - "ISIS-TI-LFA: %s %s unaffected by %s", + "ISIS-LFA: %s %s unaffected by %s", vtype2string(vertex->type), buf, lfa_protected_resource2str( &spftree_pc->lfa.protected_resource)); @@ -705,9 +705,9 @@ int isis_lfa_check(struct isis_spftree *spftree_pc, struct isis_vertex *vertex) if (adj && isis_sr_adj_sid_find(adj, spftree_pc->family, ISIS_SR_LAN_BACKUP)) { - if (IS_DEBUG_TILFA) + if (IS_DEBUG_LFA) zlog_debug( - "ISIS-TI-LFA: %s %s already covered by node protection", + "ISIS-LFA: %s %s already covered by node protection", vtype2string(vertex->type), buf); return -1; @@ -718,18 +718,18 @@ int isis_lfa_check(struct isis_spftree *spftree_pc, struct isis_vertex *vertex) route_table = spftree_pc->lfa.old.spftree->route_table_backup; if (route_node_lookup(route_table, &vertex->N.ip.p.dest)) { - if (IS_DEBUG_TILFA) + if (IS_DEBUG_LFA) zlog_debug( - "ISIS-TI-LFA: %s %s already covered by node protection", + "ISIS-LFA: %s %s already covered by node protection", vtype2string(vertex->type), buf); return -1; } } - if (IS_DEBUG_TILFA) + if (IS_DEBUG_LFA) zlog_debug( - "ISIS-TI-LFA: computing repair path(s) of %s %s w.r.t %s", + "ISIS-LFA: computing repair path(s) of %s %s w.r.t %s", vtype2string(vertex->type), buf, lfa_protected_resource2str( &spftree_pc->lfa.protected_resource)); @@ -744,7 +744,7 @@ int isis_lfa_check(struct isis_spftree *spftree_pc, struct isis_vertex *vertex) list_delete(&repair_list); if (ret != 0) zlog_warn( - "ISIS-TI-LFA: failed to compute repair path(s) of %s %s w.r.t %s", + "ISIS-LFA: failed to compute repair path(s) of %s %s w.r.t %s", vtype2string(vertex->type), buf, lfa_protected_resource2str( &spftree_pc->lfa.protected_resource)); @@ -787,8 +787,8 @@ static bool vertex_is_affected(struct isis_spftree *spftree_root, char buf1[VID2STR_BUFFER]; char buf2[VID2STR_BUFFER]; - if (IS_DEBUG_TILFA) - zlog_debug("ISIS-TI-LFA: vertex %s parent %s", + if (IS_DEBUG_LFA) + zlog_debug("ISIS-LFA: vertex %s parent %s", vid2string(vertex, buf1, sizeof(buf1)), vid2string(pvertex, buf2, sizeof(buf2))); @@ -865,15 +865,15 @@ static void lfa_calc_reach_nodes(struct isis_spftree *spftree, if (isis_spf_node_find(nodes, vertex->N.id)) continue; - if (IS_DEBUG_TILFA) - zlog_debug("ISIS-TI-LFA: checking %s", + if (IS_DEBUG_LFA) + zlog_debug("ISIS-LFA: checking %s", vid2string(vertex, buf, sizeof(buf))); if (!vertex_is_affected(spftree_root, adj_nodes, p_space, vertex, resource)) { - if (IS_DEBUG_TILFA) + if (IS_DEBUG_LFA) zlog_debug( - "ISIS-TI-LFA: adding %s", + "ISIS-LFA: adding %s", vid2string(vertex, buf, sizeof(buf))); isis_spf_node_new(nodes, vertex->N.id); @@ -887,7 +887,7 @@ static void lfa_calc_reach_nodes(struct isis_spftree *spftree, * * @param spftree IS-IS SPF tree * - * @return Pointer to new SPF tree structure. + * @return Pointer to new SPF tree structure. */ struct isis_spftree *isis_spf_reverse_run(const struct isis_spftree *spftree) { @@ -919,18 +919,17 @@ static void lfa_calc_pq_spaces(struct isis_spftree *spftree_pc, spftree_reverse = spftree_pc->lfa.old.spftree_reverse; adj_nodes = &spftree->adj_nodes; - if (IS_DEBUG_TILFA) - zlog_debug("ISIS-TI-LFA: computing P-space (self)"); + if (IS_DEBUG_LFA) + zlog_debug("ISIS-LFA: computing P-space (self)"); lfa_calc_reach_nodes(spftree, spftree, adj_nodes, true, resource, &spftree_pc->lfa.p_space); RB_FOREACH (adj_node, isis_spf_nodes, adj_nodes) { if (spf_adj_node_is_affected(adj_node, resource, spftree->sysid)) { - if (IS_DEBUG_TILFA) - zlog_debug( - "ISIS-TI-LFA: computing Q-space (%s)", - print_sys_hostname(adj_node->sysid)); + if (IS_DEBUG_LFA) + zlog_debug("ISIS-LFA: computing Q-space (%s)", + print_sys_hostname(adj_node->sysid)); /* * Compute the reverse SPF in the behalf of the node @@ -944,10 +943,9 @@ static void lfa_calc_pq_spaces(struct isis_spftree *spftree_pc, resource, &spftree_pc->lfa.q_space); } else { - if (IS_DEBUG_TILFA) - zlog_debug( - "ISIS-TI-LFA: computing P-space (%s)", - print_sys_hostname(adj_node->sysid)); + if (IS_DEBUG_LFA) + zlog_debug("ISIS-LFA: computing P-space (%s)", + print_sys_hostname(adj_node->sysid)); lfa_calc_reach_nodes(adj_node->lfa.spftree, spftree, adj_nodes, true, resource, &adj_node->lfa.p_space); @@ -973,8 +971,8 @@ struct isis_spftree *isis_tilfa_compute(struct isis_area *area, struct isis_spftree *spftree_pc; struct isis_spf_node *adj_node; - if (IS_DEBUG_TILFA) - zlog_debug("ISIS-TI-LFA: computing the P/Q spaces w.r.t. %s", + if (IS_DEBUG_LFA) + zlog_debug("ISIS-LFA: computing the P/Q spaces w.r.t. %s", lfa_protected_resource2str(resource)); /* Populate list of nodes affected by link failure. */ @@ -999,9 +997,9 @@ struct isis_spftree *isis_tilfa_compute(struct isis_area *area, /* Compute the extended P-space and Q-space. */ lfa_calc_pq_spaces(spftree_pc, resource); - if (IS_DEBUG_TILFA) + if (IS_DEBUG_LFA) zlog_debug( - "ISIS-TI-LFA: computing the post convergence SPT w.r.t. %s", + "ISIS-LFA: computing the post convergence SPT w.r.t. %s", lfa_protected_resource2str(resource)); /* Re-run SPF in the local node to find the post-convergence paths. */ @@ -1031,8 +1029,8 @@ int isis_spf_run_neighbors(struct isis_spftree *spftree) return -1; RB_FOREACH (adj_node, isis_spf_nodes, &spftree->adj_nodes) { - if (IS_DEBUG_TILFA) - zlog_debug("ISIS-TI-LFA: running SPF on neighbor %s", + if (IS_DEBUG_LFA) + zlog_debug("ISIS-LFA: running SPF on neighbor %s", print_sys_hostname(adj_node->sysid)); /* Compute the SPT on behalf of the neighbor. */ diff --git a/isisd/isis_spf.c b/isisd/isis_spf.c index 19cacde4fe..592804f41c 100644 --- a/isisd/isis_spf.c +++ b/isisd/isis_spf.c @@ -771,7 +771,7 @@ static int isis_spf_process_lsp(struct isis_spftree *spftree, bool has_valid_psid; if (isis_lfa_excise_node_check(spftree, lsp->hdr.lsp_id)) { - if (IS_DEBUG_TILFA) + if (IS_DEBUG_LFA) zlog_debug("ISIS-LFA: excising node %s", print_sys_hostname(lsp->hdr.lsp_id)); return ISIS_OK; @@ -1140,7 +1140,7 @@ static void isis_spf_preload_tent(struct isis_spftree *spftree, adj_id = sadj->id; if (isis_lfa_excise_adj_check(spftree, adj_id)) { - if (IS_DEBUG_TILFA) + if (IS_DEBUG_LFA) zlog_debug("ISIS-SPF: excising adjacency %s", isis_format_id(sadj->id, ISIS_SYS_ID_LEN + 1)); diff --git a/isisd/isisd.c b/isisd/isisd.c index 950cdc281f..42edd1d541 100644 --- a/isisd/isisd.c +++ b/isisd/isisd.c @@ -77,7 +77,7 @@ unsigned long debug_bfd; unsigned long debug_tx_queue; unsigned long debug_sr; unsigned long debug_ldp_sync; -unsigned long debug_tilfa; +unsigned long debug_lfa; DEFINE_QOBJ_TYPE(isis_area) @@ -1199,8 +1199,8 @@ void print_debug(struct vty *vty, int flags, int onoff) if (flags & DEBUG_SR) vty_out(vty, "IS-IS Segment Routing events debugging is %s\n", onoffs); - if (flags & DEBUG_TILFA) - vty_out(vty, "IS-IS TI-LFA events debugging is %s\n", onoffs); + if (flags & DEBUG_LFA) + vty_out(vty, "IS-IS LFA events debugging is %s\n", onoffs); if (flags & DEBUG_UPDATE_PACKETS) vty_out(vty, "IS-IS Update related packet debugging is %s\n", onoffs); @@ -1295,8 +1295,8 @@ static int config_write_debug(struct vty *vty) vty_out(vty, "debug " PROTO_NAME " sr-events\n"); write++; } - if (IS_DEBUG_TILFA) { - vty_out(vty, "debug " PROTO_NAME " ti-lfa\n"); + if (IS_DEBUG_LFA) { + vty_out(vty, "debug " PROTO_NAME " lfa\n"); write++; } if (IS_DEBUG_UPDATE_PACKETS) { @@ -1529,29 +1529,29 @@ DEFUN (no_debug_isis_srevents, return CMD_SUCCESS; } -DEFUN (debug_isis_tilfa, - debug_isis_tilfa_cmd, - "debug " PROTO_NAME " ti-lfa", +DEFUN (debug_isis_lfa, + debug_isis_lfa_cmd, + "debug " PROTO_NAME " lfa", DEBUG_STR PROTO_HELP - "IS-IS TI-LFA Events\n") + "IS-IS LFA Events\n") { - debug_tilfa |= DEBUG_TILFA; - print_debug(vty, DEBUG_TILFA, 1); + debug_lfa |= DEBUG_LFA; + print_debug(vty, DEBUG_LFA, 1); return CMD_SUCCESS; } -DEFUN (no_debug_isis_tilfa, - no_debug_isis_tilfa_cmd, - "no debug " PROTO_NAME " ti-lfa", +DEFUN (no_debug_isis_lfa, + no_debug_isis_lfa_cmd, + "no debug " PROTO_NAME " lfa", NO_STR UNDEBUG_STR PROTO_HELP - "IS-IS TI-LFA Events\n") + "IS-IS LFA Events\n") { - debug_tilfa &= ~DEBUG_TILFA; - print_debug(vty, DEBUG_TILFA, 0); + debug_lfa &= ~DEBUG_LFA; + print_debug(vty, DEBUG_LFA, 0); return CMD_SUCCESS; } @@ -2892,8 +2892,8 @@ void isis_init(void) install_element(ENABLE_NODE, &no_debug_isis_spfevents_cmd); install_element(ENABLE_NODE, &debug_isis_srevents_cmd); install_element(ENABLE_NODE, &no_debug_isis_srevents_cmd); - install_element(ENABLE_NODE, &debug_isis_tilfa_cmd); - install_element(ENABLE_NODE, &no_debug_isis_tilfa_cmd); + install_element(ENABLE_NODE, &debug_isis_lfa_cmd); + install_element(ENABLE_NODE, &no_debug_isis_lfa_cmd); install_element(ENABLE_NODE, &debug_isis_rtevents_cmd); install_element(ENABLE_NODE, &no_debug_isis_rtevents_cmd); install_element(ENABLE_NODE, &debug_isis_events_cmd); @@ -2923,8 +2923,8 @@ void isis_init(void) install_element(CONFIG_NODE, &no_debug_isis_spfevents_cmd); install_element(CONFIG_NODE, &debug_isis_srevents_cmd); install_element(CONFIG_NODE, &no_debug_isis_srevents_cmd); - install_element(CONFIG_NODE, &debug_isis_tilfa_cmd); - install_element(CONFIG_NODE, &no_debug_isis_tilfa_cmd); + install_element(CONFIG_NODE, &debug_isis_lfa_cmd); + install_element(CONFIG_NODE, &no_debug_isis_lfa_cmd); install_element(CONFIG_NODE, &debug_isis_rtevents_cmd); install_element(CONFIG_NODE, &no_debug_isis_rtevents_cmd); install_element(CONFIG_NODE, &debug_isis_events_cmd); diff --git a/isisd/isisd.h b/isisd/isisd.h index 921df4d7ef..0690d3e10c 100644 --- a/isisd/isisd.h +++ b/isisd/isisd.h @@ -280,7 +280,7 @@ extern unsigned long debug_bfd; extern unsigned long debug_tx_queue; extern unsigned long debug_sr; extern unsigned long debug_ldp_sync; -extern unsigned long debug_tilfa; +extern unsigned long debug_lfa; #define DEBUG_ADJ_PACKETS (1<<0) #define DEBUG_SNP_PACKETS (1<<1) @@ -296,7 +296,7 @@ extern unsigned long debug_tilfa; #define DEBUG_TX_QUEUE (1<<11) #define DEBUG_SR (1<<12) #define DEBUG_LDP_SYNC (1<<13) -#define DEBUG_TILFA (1<<14) +#define DEBUG_LFA (1<<14) /* Debug related macro. */ #define IS_DEBUG_ADJ_PACKETS (debug_adj_pkt & DEBUG_ADJ_PACKETS) @@ -313,7 +313,7 @@ extern unsigned long debug_tilfa; #define IS_DEBUG_TX_QUEUE (debug_tx_queue & DEBUG_TX_QUEUE) #define IS_DEBUG_SR (debug_sr & DEBUG_SR) #define IS_DEBUG_LDP_SYNC (debug_ldp_sync & DEBUG_LDP_SYNC) -#define IS_DEBUG_TILFA (debug_tilfa & DEBUG_TILFA) +#define IS_DEBUG_LFA (debug_lfa & DEBUG_LFA) #define lsp_debug(...) \ do { \