Commit 50a713045c for frr
commit 50a713045c9a89740d2e2b6db01604a499e58a5f
Author: Donald Sharp <sharpd@nvidia.com>
Date: Tue Oct 20 10:57:37 2026 -0400
isisd: Standardize prefix output, %pFX, in debugs
Currently there are two problems with using %pFX in isisd
debugs:
a) The vrf name, vrf id and table were not being output for
every debug. When a prefix is used in multiple vrf's it
is difficult to know if the debug being looked at is for
the instance of interest.
b) The output was not standardized. Solidify on
"(%s:%u:%u)%pFX", vrf_name, vrf_id, table_id, prefix. This
allows very easy grepping.
Add ISIS_DEBUG_VRF() and ISIS_DEBUG_VRF_ID() to generate the
vrf name, vrf id and table id arguments. The Traffic
Engineering code has no instance to look at and only operates
on the default vrf so use that for those debugs.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c
index c6e8185056..da24264d6a 100644
--- a/isisd/isis_circuit.c
+++ b/isisd/isis_circuit.c
@@ -334,9 +334,9 @@ void isis_circuit_add_addr(struct isis_circuit *circuit,
#ifdef EXTREME_DEBUG
if (IS_DEBUG_EVENTS)
- zlog_debug("Added IP address %pFX to circuit %s",
- connected->address,
- circuit->interface->name);
+ zlog_debug("Added IP address (%s:%u:%u)%pFX to circuit %s",
+ ISIS_DEBUG_VRF_ID(circuit->interface->vrf->vrf_id),
+ connected->address, circuit->interface->name);
#endif /* EXTREME_DEBUG */
}
if (connected->address->family == AF_INET6) {
@@ -372,9 +372,9 @@ void isis_circuit_add_addr(struct isis_circuit *circuit,
#ifdef EXTREME_DEBUG
if (IS_DEBUG_EVENTS)
- zlog_debug("Added IPv6 address %pFX to circuit %s",
- connected->address,
- circuit->interface->name);
+ zlog_debug("Added IPv6 address (%s:%u:%u)%pFX to circuit %s",
+ ISIS_DEBUG_VRF_ID(circuit->interface->vrf->vrf_id),
+ connected->address, circuit->interface->name);
#endif /* EXTREME_DEBUG */
}
@@ -406,14 +406,15 @@ void isis_circuit_del_addr(struct isis_circuit *circuit,
prefix_ipv4_free(&ip);
isis_circuit_ip_addr_change_update(circuit);
} else {
- zlog_warn(
- "Nonexistent ip address %pFX removal attempt from circuit %s",
- connected->address, circuit->interface->name);
+ zlog_warn("Nonexistent ip address (%s:%u:%u)%pFX removal attempt from circuit %s",
+ ISIS_DEBUG_VRF_ID(circuit->interface->vrf->vrf_id),
+ connected->address, circuit->interface->name);
zlog_warn("Current ip addresses on %s:",
circuit->interface->name);
for (ALL_LIST_ELEMENTS_RO(circuit->ip_addrs, node,
ip)) {
- zlog_warn(" %pFX", ip);
+ zlog_warn(" (%s:%u:%u)%pFX",
+ ISIS_DEBUG_VRF_ID(circuit->interface->vrf->vrf_id), ip);
}
zlog_warn("End of addresses");
}
@@ -452,18 +453,22 @@ void isis_circuit_del_addr(struct isis_circuit *circuit,
}
if (!found) {
- zlog_warn(
- "Nonexistent ip address %pFX removal attempt from circuit %s",
- connected->address, circuit->interface->name);
+ zlog_warn("Nonexistent ip address (%s:%u:%u)%pFX removal attempt from circuit %s",
+ ISIS_DEBUG_VRF_ID(circuit->interface->vrf->vrf_id),
+ connected->address, circuit->interface->name);
zlog_warn("Current ip addresses on %s:",
circuit->interface->name);
for (ALL_LIST_ELEMENTS_RO(circuit->ipv6_link, node,
ip6))
- zlog_warn(" %pFX", (struct prefix *)ip6);
+ zlog_warn(" (%s:%u:%u)%pFX",
+ ISIS_DEBUG_VRF_ID(circuit->interface->vrf->vrf_id),
+ (struct prefix *)ip6);
zlog_warn(" -----");
for (ALL_LIST_ELEMENTS_RO(circuit->ipv6_non_link, node,
ip6))
- zlog_warn(" %pFX", (struct prefix *)ip6);
+ zlog_warn(" (%s:%u:%u)%pFX",
+ ISIS_DEBUG_VRF_ID(circuit->interface->vrf->vrf_id),
+ (struct prefix *)ip6);
zlog_warn("End of addresses");
} else
isis_circuit_ip_addr_change_update(circuit);
diff --git a/isisd/isis_lfa.c b/isisd/isis_lfa.c
index b81c1e4b76..ba1b9ad96e 100644
--- a/isisd/isis_lfa.c
+++ b/isisd/isis_lfa.c
@@ -601,8 +601,9 @@ static int tilfa_build_repair_list(struct isis_spftree *spftree_pc, struct isis_
sid_index = vertex->N.ip.sr.sid.value;
if (IS_DEBUG_LFA)
- zlog_debug("ISIS-LFA: pushing Prefix-SID to %pFX (index %u)",
- &vertex->N.ip.p.dest, sid_index);
+ zlog_debug("ISIS-LFA: pushing Prefix-SID to (%s:%u:%u)%pFX (index %u)",
+ ISIS_DEBUG_VRF(spftree_pc->area->isis), &vertex->N.ip.p.dest,
+ sid_index);
sid_dest.type = TILFA_SID_PREFIX;
sid_dest.value.index.value = sid_index;
sid_dest.value.index.remote = true;
@@ -1473,20 +1474,22 @@ void isis_rlfa_process_ldp_response(struct zapi_rlfa_response *response)
rlfa = rlfa_lookup(spftree, &response->destination);
if (!rlfa) {
- zlog_warn("ISIS-LFA: couldn't find Remote-LFA %pFX received from LDP",
- &response->destination);
+ zlog_warn("ISIS-LFA: couldn't find Remote-LFA (%s:%u:%u)%pFX received from LDP",
+ ISIS_DEBUG_VRF(isis), &response->destination);
return;
}
if (response->pq_label != MPLS_INVALID_LABEL) {
if (IS_DEBUG_LFA)
- zlog_debug("ISIS-LFA: activating/updating RLFA for %pFX", &rlfa->prefix);
+ zlog_debug("ISIS-LFA: activating/updating RLFA for (%s:%u:%u)%pFX",
+ ISIS_DEBUG_VRF(isis), &rlfa->prefix);
if (isis_rlfa_activate(spftree, rlfa, response) != 0)
isis_rlfa_deactivate(spftree, rlfa);
} else {
if (IS_DEBUG_LFA)
- zlog_debug("ISIS-LFA: deactivating RLFA for %pFX", &rlfa->prefix);
+ zlog_debug("ISIS-LFA: deactivating RLFA for (%s:%u:%u)%pFX",
+ ISIS_DEBUG_VRF(isis), &rlfa->prefix);
isis_rlfa_deactivate(spftree, rlfa);
}
diff --git a/isisd/isis_lsp.c b/isisd/isis_lsp.c
index ba79566169..62fce43618 100644
--- a/isisd/isis_lsp.c
+++ b/isisd/isis_lsp.c
@@ -874,15 +874,14 @@ static void lsp_build_internal_reach_ipv4(struct isis_lsp *lsp,
struct sr_prefix_cfg *pcfgs[SR_ALGORITHM_COUNT] = {NULL};
if (area->oldmetric) {
- lsp_debug(
- "ISIS (%s): Adding old-style IP reachability for %pFX",
- area->area_tag, ipv4);
+ lsp_debug("ISIS (%s): Adding old-style IP reachability for (%s:%u:%u)%pFX",
+ area->area_tag, ISIS_DEBUG_VRF(area->isis), ipv4);
isis_tlvs_add_oldstyle_ip_reach(lsp->tlvs, ipv4, metric);
}
if (area->newmetric) {
- lsp_debug("ISIS (%s): Adding te-style IP reachability for %pFX",
- area->area_tag, ipv4);
+ lsp_debug("ISIS (%s): Adding te-style IP reachability for (%s:%u:%u)%pFX",
+ area->area_tag, ISIS_DEBUG_VRF(area->isis), ipv4);
if (area->srdb.enabled)
for (int i = 0; i < SR_ALGORITHM_COUNT; i++) {
@@ -907,8 +906,8 @@ static void lsp_build_internal_reach_ipv6(struct isis_lsp *lsp,
{
struct sr_prefix_cfg *pcfgs[SR_ALGORITHM_COUNT] = {NULL};
- lsp_debug("ISIS (%s): Adding IPv6 reachability for %pFX",
- area->area_tag, ipv6);
+ lsp_debug("ISIS (%s): Adding IPv6 reachability for (%s:%u:%u)%pFX", area->area_tag,
+ ISIS_DEBUG_VRF(area->isis), ipv6);
if (area->srdb.enabled)
for (int i = 0; i < SR_ALGORITHM_COUNT; i++) {
diff --git a/isisd/isis_redist.c b/isisd/isis_redist.c
index 7884b2a750..dad5f16edb 100644
--- a/isisd/isis_redist.c
+++ b/isisd/isis_redist.c
@@ -318,7 +318,8 @@ void isis_redist_add(struct isis *isis, int type, struct prefix *p,
/* DEFAULT_ROUTE is not a zebra route type: isis_redist_delete() re-adds a
* removed default under it for "default-information originate always".
*/
- zlog_debug("%s: New route %pFX from %s: distance %d.", __func__, p,
+ zlog_debug("%s: New route (%s:%u:%u)%pFX from %s: distance %d.", __func__,
+ ISIS_DEBUG_VRF(isis), p,
type == DEFAULT_ROUTE ? "default-information" : zebra_route_string(type),
distance);
@@ -384,7 +385,7 @@ void isis_redist_delete(struct isis *isis, int type, struct prefix *p,
int level;
struct isis_redist *redist;
- zlog_debug("%s: Removing route %pFX from %s.", __func__, p,
+ zlog_debug("%s: Removing route (%s:%u:%u)%pFX from %s.", __func__, ISIS_DEBUG_VRF(isis), p,
zebra_route_string(type));
if (!ei_table) {
@@ -395,16 +396,15 @@ void isis_redist_delete(struct isis *isis, int type, struct prefix *p,
ei_node = srcdest_rnode_lookup(ei_table, p, src_p);
if (!ei_node || !ei_node->info) {
- zlog_warn(
- "%s: Got a delete for %s route %pFX, but that route was never added.",
- __func__, zebra_route_string(type), p);
+ zlog_warn("%s: Got a delete for %s route (%s:%u:%u)%pFX, but that route was never added.",
+ __func__, zebra_route_string(type), ISIS_DEBUG_VRF(isis), p);
if (ei_node)
route_unlock_node(ei_node);
return;
}
if (!isis_redist_info_matches(ei_node->info, type, table)) {
- zlog_debug("%s: Ignoring delete for replaced %s route %pFX table %u.", __func__,
- zebra_route_string(type), p, table);
+ zlog_debug("%s: Ignoring delete for replaced %s route (%s:%u:%u)%pFX table %u.",
+ __func__, zebra_route_string(type), ISIS_DEBUG_VRF(isis), p, table);
route_unlock_node(ei_node);
return;
}
diff --git a/isisd/isis_route.c b/isisd/isis_route.c
index 79e650103f..f2244f9edf 100644
--- a/isisd/isis_route.c
+++ b/isisd/isis_route.c
@@ -433,28 +433,30 @@ struct isis_route_info *isis_route_create(struct prefix *prefix, struct prefix_i
rinfo_old = route_node->info;
if (!rinfo_old) {
if (IS_DEBUG_RTE_EVENTS)
- zlog_debug("ISIS-Rte (%s) route created: %pFX", area->area_tag, prefix);
+ zlog_debug("ISIS-Rte (%s) route created: (%s:%u:%u)%pFX", area->area_tag,
+ ISIS_DEBUG_VRF(area->isis), prefix);
route_info = rinfo_new;
UNSET_FLAG(route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNCED);
} else {
route_unlock_node(route_node);
#ifdef EXTREME_DEBUG
if (IS_DEBUG_RTE_EVENTS)
- zlog_debug("ISIS-Rte (%s) route already exists: %pFX", area->area_tag,
- prefix);
+ zlog_debug("ISIS-Rte (%s) route already exists: (%s:%u:%u)%pFX",
+ area->area_tag, ISIS_DEBUG_VRF(area->isis), prefix);
#endif /* EXTREME_DEBUG */
if (isis_route_info_same(rinfo_new, rinfo_old, change_buf, sizeof(change_buf))) {
#ifdef EXTREME_DEBUG
if (IS_DEBUG_RTE_EVENTS)
- zlog_debug("ISIS-Rte (%s) route unchanged: %pFX", area->area_tag,
- prefix);
+ zlog_debug("ISIS-Rte (%s) route unchanged: (%s:%u:%u)%pFX",
+ area->area_tag, ISIS_DEBUG_VRF(area->isis), prefix);
#endif /* EXTREME_DEBUG */
isis_route_info_delete(rinfo_new);
route_info = rinfo_old;
} else {
if (IS_DEBUG_RTE_EVENTS)
- zlog_debug("ISIS-Rte (%s): route changed: %pFX, change: %s",
- area->area_tag, prefix, change_buf);
+ zlog_debug("ISIS-Rte (%s): route changed: (%s:%u:%u)%pFX, change: %s",
+ area->area_tag, ISIS_DEBUG_VRF(area->isis), prefix,
+ change_buf);
for (int i = 0; i < SR_ALGORITHM_COUNT; i++)
rinfo_new->sr_algo_previous[i] = rinfo_old->sr_algo[i];
isis_route_info_delete(rinfo_old);
diff --git a/isisd/isis_spf.c b/isisd/isis_spf.c
index b7d371871e..f1d6f66bfd 100644
--- a/isisd/isis_spf.c
+++ b/isisd/isis_spf.c
@@ -268,8 +268,8 @@ struct isis_vertex_adj *isis_vertex_adj_add(struct isis_spftree *spftree,
vadj->sadj = sadj;
if (spftree->area->srdb.enabled && psid) {
if (vertex->N.ip.sr.present && vertex->N.ip.sr.sid.value != psid->value)
- zlog_warn("ISIS-SPF: ignoring different Prefix-SID for route %pFX",
- &vertex->N.ip.p.dest);
+ zlog_warn("ISIS-SPF: ignoring different Prefix-SID for route (%s:%u:%u)%pFX",
+ ISIS_DEBUG_VRF(spftree->area->isis), &vertex->N.ip.p.dest);
else {
vadj->sr.sid = *psid;
vadj->sr.label = sr_prefix_out_label(spftree->lspdb,
@@ -590,8 +590,10 @@ static struct isis_vertex *isis_spf_add2tent(struct isis_spftree *spftree, enum
vertex_psid = isis_spf_prefix_sid_lookup(spftree, psid);
if (vertex_psid && !prefix_same(&vertex_psid->N.ip.p.dest, &vertex->N.ip.p.dest)) {
flog_warn(EC_ISIS_SID_COLLISION,
- "ISIS-Sr (%s): collision detected, prefixes %pFX and %pFX share the same SID %s (%u)",
- area->area_tag, &vertex->N.ip.p.dest, &vertex_psid->N.ip.p.dest,
+ "ISIS-Sr (%s): collision detected, prefixes (%s:%u:%u)%pFX and (%s:%u:%u)%pFX share the same SID %s (%u)",
+ area->area_tag, ISIS_DEBUG_VRF(spftree->area->isis),
+ &vertex->N.ip.p.dest, ISIS_DEBUG_VRF(spftree->area->isis),
+ &vertex_psid->N.ip.p.dest,
CHECK_FLAG(psid->flags, ISIS_PREFIX_SID_VALUE) ? "label"
: "index",
psid->value);
@@ -1684,9 +1686,10 @@ static void spf_path_process(struct isis_spftree *spftree, struct isis_vertex *v
vertex->Adj_N, allow_ecmp, area, route_table);
#ifdef EXTREME_DEBUG
- zlog_debug("ISIS-SPF: A:%hhu create route pfx %pFX dist %d, sr.algo %d, table %p, rv %p",
- spftree->algorithm, &vertex->N.ip.p.dest, vertex->d_N,
- vertex->N.ip.sr.algorithm, route_table, ri);
+ zlog_debug("ISIS-SPF: A:%hhu create route pfx (%s:%u:%u)%pFX dist %d, sr.algo %d, table %p, rv %p",
+ spftree->algorithm, ISIS_DEBUG_VRF(spftree->area->isis),
+ &vertex->N.ip.p.dest, vertex->d_N, vertex->N.ip.sr.algorithm,
+ route_table, ri);
#endif /* EXTREME_DEBUG */
} else if (IS_DEBUG_SPF_EVENTS)
zlog_debug("ISIS-SPF: no adjacencies, do not install route for %s depth %d dist %d",
diff --git a/isisd/isis_sr.c b/isisd/isis_sr.c
index 70c9a1139e..3b3e2f8be7 100644
--- a/isisd/isis_sr.c
+++ b/isisd/isis_sr.c
@@ -342,7 +342,8 @@ struct sr_prefix_cfg *isis_sr_cfg_prefix_add(struct isis_area *area, const struc
struct sr_prefix_cfg *pcfg;
struct interface *ifp;
- sr_debug("ISIS-Sr (%s): Add local prefix %pFX", area->area_tag, prefix);
+ sr_debug("ISIS-Sr (%s): Add local prefix (%s:%u:%u)%pFX", area->area_tag,
+ ISIS_DEBUG_VRF(area->isis), prefix);
pcfg = XCALLOC(MTYPE_ISIS_SR_INFO, sizeof(*pcfg));
pcfg->prefix = *prefix;
@@ -375,7 +376,8 @@ void isis_sr_cfg_prefix_del(struct sr_prefix_cfg *pcfg)
{
struct isis_area *area = pcfg->area;
- sr_debug("ISIS-Sr (%s): Delete local Prefix-SID %pFX %s %u", area->area_tag, &pcfg->prefix,
+ sr_debug("ISIS-Sr (%s): Delete local Prefix-SID (%s:%u:%u)%pFX %s %u", area->area_tag,
+ ISIS_DEBUG_VRF(area->isis), &pcfg->prefix,
pcfg->sid_type == SR_SID_VALUE_TYPE_INDEX ? "index" : "label", pcfg->sid);
srdb_prefix_cfg_del(&area->srdb.config.prefix_sids, pcfg);
diff --git a/isisd/isis_srv6.c b/isisd/isis_srv6.c
index b968c16c40..d87a459da5 100644
--- a/isisd/isis_srv6.c
+++ b/isisd/isis_srv6.c
@@ -198,8 +198,9 @@ bool isis_srv6_locator_unset(struct isis_area *area)
/* Delete chunks */
for (ALL_LIST_ELEMENTS(area->srv6db.srv6_locator_chunks, node, nnode, chunk)) {
- sr_debug("Releasing chunk of locator %s (prefix %pFX) for IS-IS area %s",
- area->srv6db.config.srv6_locator_name, &chunk->prefix, area->area_tag);
+ sr_debug("Releasing chunk of locator %s (prefix (%s:%u:%u)%pFX) for IS-IS area %s",
+ area->srv6db.config.srv6_locator_name, ISIS_DEBUG_VRF(area->isis),
+ &chunk->prefix, area->area_tag);
listnode_delete(area->srv6db.srv6_locator_chunks, chunk);
srv6_locator_chunk_free(&chunk);
diff --git a/isisd/isis_te.c b/isisd/isis_te.c
index b931a332a6..c6f80f5312 100644
--- a/isisd/isis_te.c
+++ b/isisd/isis_te.c
@@ -1260,10 +1260,12 @@ static int lsp_to_subnet_cb(const struct prefix *prefix, uint32_t metric, bool e
return LSP_ITER_CONTINUE;
if (args->srv6_locator)
- te_debug(" |- Process SRv6 Locator %pFX", prefix);
+ te_debug(" |- Process SRv6 Locator (%s:%u:%u)%pFX",
+ ISIS_DEBUG_VRF_ID(VRF_DEFAULT), prefix);
else
- te_debug(" |- Process Extended %s Reachability %pFX",
- prefix->family == AF_INET ? "IP" : "IPv6", prefix);
+ te_debug(" |- Process Extended %s Reachability (%s:%u:%u)%pFX",
+ prefix->family == AF_INET ? "IP" : "IPv6", ISIS_DEBUG_VRF_ID(VRF_DEFAULT),
+ prefix);
vertex = args->vertex;
@@ -1321,10 +1323,13 @@ static int lsp_to_subnet_cb(const struct prefix *prefix, uint32_t metric, bool e
subnet->status = DELETE;
isis_te_export(LS_MSG_TYPE_PREFIX, subnet);
}
- te_debug(" |- Remove subnet with prefix %pFX", &subnet->key);
+ te_debug(" |- Remove subnet with prefix (%s:%u:%u)%pFX",
+ ISIS_DEBUG_VRF_ID(VRF_DEFAULT), &subnet->key);
ls_subnet_del_all(args->ted, subnet);
}
- te_debug(" |- Adjust prefix %pFX with local address to: %pFX", prefix, &p);
+ te_debug(" |- Adjust prefix (%s:%u:%u)%pFX with local address to: (%s:%u:%u)%pFX",
+ ISIS_DEBUG_VRF_ID(VRF_DEFAULT), prefix, ISIS_DEBUG_VRF_ID(VRF_DEFAULT),
+ &p);
}
/* Search existing Subnet in TED ... */
@@ -1339,8 +1344,8 @@ static int lsp_to_subnet_cb(const struct prefix *prefix, uint32_t metric, bool e
}
ls_pref = subnet->ls_pref;
- te_debug(" |- %s Subnet from prefix %pFX", subnet->status == NEW ? "Create" : "Found",
- &p);
+ te_debug(" |- %s Subnet from prefix (%s:%u:%u)%pFX",
+ subnet->status == NEW ? "Create" : "Found", ISIS_DEBUG_VRF_ID(VRF_DEFAULT), &p);
/* Update Metric */
if (!CHECK_FLAG(ls_pref->flags, LS_PREF_METRIC) || (ls_pref->metric != metric)) {
diff --git a/isisd/isis_zebra.c b/isisd/isis_zebra.c
index 9020a9228f..bf0e776d83 100644
--- a/isisd/isis_zebra.c
+++ b/isisd/isis_zebra.c
@@ -109,9 +109,11 @@ static int isis_zebra_if_address_add(ZAPI_CALLBACK_ARGS)
#ifdef EXTREME_DEBUG
if (c->address->family == AF_INET)
- zlog_debug("connected IP address %pFX", c->address);
+ zlog_debug("connected IP address (%s:%u:%u)%pFX", ISIS_DEBUG_VRF_ID(vrf_id),
+ c->address);
if (c->address->family == AF_INET6)
- zlog_debug("connected IPv6 address %pFX", c->address);
+ zlog_debug("connected IPv6 address (%s:%u:%u)%pFX", ISIS_DEBUG_VRF_ID(vrf_id),
+ c->address);
#endif /* EXTREME_DEBUG */
if (if_is_operative(c->ifp)) {
@@ -138,9 +140,11 @@ static int isis_zebra_if_address_del(ZAPI_CALLBACK_ARGS)
#ifdef EXTREME_DEBUG
if (c->address->family == AF_INET)
- zlog_debug("disconnected IP address %pFX", c->address);
+ zlog_debug("disconnected IP address (%s:%u:%u)%pFX", ISIS_DEBUG_VRF_ID(vrf_id),
+ c->address);
if (c->address->family == AF_INET6)
- zlog_debug("disconnected IPv6 address %pFX", c->address);
+ zlog_debug("disconnected IPv6 address (%s:%u:%u)%pFX", ISIS_DEBUG_VRF_ID(vrf_id),
+ c->address);
#endif /* EXTREME_DEBUG */
if (if_is_operative(c->ifp)) {
@@ -364,8 +368,8 @@ void isis_zebra_prefix_sid_install(struct isis_area *area,
struct zapi_labels zl;
int count = 0;
- sr_debug("ISIS-Sr (%s): update label %u for prefix %pFX algorithm %u",
- area->area_tag, psid->label, prefix, psid->algorithm);
+ sr_debug("ISIS-Sr (%s): update label %u for prefix (%s:%u:%u)%pFX algorithm %u",
+ area->area_tag, psid->label, ISIS_DEBUG_VRF(area->isis), prefix, psid->algorithm);
/* Prepare message. */
memset(&zl, 0, sizeof(zl));
@@ -379,9 +383,8 @@ void isis_zebra_prefix_sid_install(struct isis_area *area,
ifp = if_lookup_by_name("lo", VRF_DEFAULT);
if (!ifp) {
- zlog_warn(
- "%s: couldn't install Prefix-SID %pFX: loopback interface not found",
- __func__, prefix);
+ zlog_warn("%s: couldn't install Prefix-SID (%s:%u:%u)%pFX: loopback interface not found",
+ __func__, ISIS_DEBUG_VRF(area->isis), prefix);
return;
}
@@ -431,8 +434,8 @@ void isis_zebra_prefix_sid_uninstall(struct isis_area *area,
{
struct zapi_labels zl;
- sr_debug("ISIS-Sr (%s): delete label %u for prefix %pFX algorithm %u",
- area->area_tag, psid->label, prefix, psid->algorithm);
+ sr_debug("ISIS-Sr (%s): delete label %u for prefix (%s:%u:%u)%pFX algorithm %u",
+ area->area_tag, psid->label, ISIS_DEBUG_VRF(area->isis), prefix, psid->algorithm);
/* Prepare message. */
memset(&zl, 0, sizeof(zl));
@@ -587,8 +590,8 @@ int isis_zebra_rlfa_register(struct isis_spftree *spftree, struct rlfa *rlfa)
zr.destination = rlfa->prefix;
zr.pq_address = rlfa->pq_address;
- zlog_debug("ISIS-LFA: registering RLFA %pFX@%pI4 with LDP",
- &rlfa->prefix, &rlfa->pq_address);
+ zlog_debug("ISIS-LFA: registering RLFA (%s:%u:%u)%pFX@%pI4 with LDP",
+ ISIS_DEBUG_VRF(area->isis), &rlfa->prefix, &rlfa->pq_address);
ret = zclient_send_opaque_unicast(isis_zclient, LDP_RLFA_REGISTER,
ZEBRA_ROUTE_LDP, 0, 0,
@@ -1270,8 +1273,8 @@ static int isis_zebra_process_srv6_locator_internal(struct srv6_locator *locator
if (!isis || !locator)
return -1;
- zlog_info("%s: Received SRv6 locator %s %pFX, loc-block-len=%u, loc-node-len=%u func-len=%u, arg-len=%u",
- __func__, locator->name, &locator->prefix,
+ zlog_info("%s: Received SRv6 locator %s (%s:%u:%u)%pFX, loc-block-len=%u, loc-node-len=%u func-len=%u, arg-len=%u",
+ __func__, locator->name, ISIS_DEBUG_VRF(isis), &locator->prefix,
locator->block_bits_length, locator->node_bits_length,
locator->function_bits_length, locator->argument_bits_length);
@@ -1289,8 +1292,8 @@ static int isis_zebra_process_srv6_locator_internal(struct srv6_locator *locator
continue;
}
- sr_debug("SRv6 locator (locator %s, prefix %pFX) set for IS-IS area %s",
- locator->name, &locator->prefix, area->area_tag);
+ sr_debug("SRv6 locator (locator %s, prefix (%s:%u:%u)%pFX) set for IS-IS area %s",
+ locator->name, ISIS_DEBUG_VRF(isis), &locator->prefix, area->area_tag);
if (area->srv6db.srv6_locator)
srv6_locator_free(area->srv6db.srv6_locator);
@@ -1349,12 +1352,10 @@ static int isis_zebra_process_srv6_locator_delete(ZAPI_CALLBACK_ARGS)
if (zapi_srv6_locator_decode(zclient->ibuf, &loc) < 0)
return -1;
- sr_debug(
- "SRv6 locator deleted in zebra: name %s, "
- "prefix %pFX, block_len %u, node_len %u, func_len %u, arg_len %u",
- loc.name, &loc.prefix, loc.block_bits_length,
- loc.node_bits_length, loc.function_bits_length,
- loc.argument_bits_length);
+ sr_debug("SRv6 locator deleted in zebra: name %s, "
+ "prefix (%s:%u:%u)%pFX, block_len %u, node_len %u, func_len %u, arg_len %u",
+ loc.name, ISIS_DEBUG_VRF(isis), &loc.prefix, loc.block_bits_length,
+ loc.node_bits_length, loc.function_bits_length, loc.argument_bits_length);
/* Walk through all areas of the ISIS instance */
frr_each (isis_area_list, &isis->area_list, area) {
diff --git a/isisd/isisd.c b/isisd/isisd.c
index 826e6ce99b..8497698d4a 100644
--- a/isisd/isisd.c
+++ b/isisd/isisd.c
@@ -164,6 +164,20 @@ struct isis *isis_lookup_by_vrfid(vrf_id_t vrf_id)
return NULL;
}
+const char *isis_vrf_id_to_name(vrf_id_t vrf_id)
+{
+ struct vrf *vrf = vrf_lookup_by_id(vrf_id);
+
+ return vrf ? vrf->name : "NIL";
+}
+
+uint32_t isis_vrf_id_to_table_id(vrf_id_t vrf_id)
+{
+ struct vrf *vrf = vrf_lookup_by_id(vrf_id);
+
+ return vrf ? vrf->data.l.table_id : 0;
+}
+
struct isis *isis_lookup_by_vrfname(const char *vrfname)
{
struct isis *isis;
diff --git a/isisd/isisd.h b/isisd/isisd.h
index 8547e1aa6a..d4fa3c6a98 100644
--- a/isisd/isisd.h
+++ b/isisd/isisd.h
@@ -302,6 +302,22 @@ void isis_vrf_link(struct isis *isis, struct vrf *vrf);
void isis_vrf_unlink(struct isis *isis, struct vrf *vrf);
struct isis *isis_lookup_by_vrfid(vrf_id_t vrf_id);
struct isis *isis_lookup_by_vrfname(const char *vrfname);
+const char *isis_vrf_id_to_name(vrf_id_t vrf_id);
+uint32_t isis_vrf_id_to_table_id(vrf_id_t vrf_id);
+
+/*
+ * Arguments for the "(%s:%u:%u)" vrf name, vrf id, table id prefix
+ * used in front of a prefix in debugs. For example:
+ *
+ * zlog_debug("route (%s:%u:%u)%pFX", ISIS_DEBUG_VRF(isis), p);
+ *
+ * Note that the argument is evaluated more than once.
+ */
+#define ISIS_DEBUG_VRF(isis) ISIS_DEBUG_VRF_ID((isis)->vrf_id)
+
+/* Same as above, but for when only the vrf id is available. */
+#define ISIS_DEBUG_VRF_ID(vrf_id) \
+ isis_vrf_id_to_name(vrf_id), (vrf_id), isis_vrf_id_to_table_id(vrf_id)
struct isis *isis_lookup_by_sysid(const uint8_t *sysid);
void isis_init(void);