Commit 22b0afa7e8 for frr
commit 22b0afa7e8e50a56d70c0e9495dbea8349d8c4f1
Author: Donald Sharp <sharpd@nvidia.com>
Date: Fri Oct 2 12:25:15 2026 -0400
zebra: Modify %pRN in debugs to be standardized
Modify the usage of %pRN to do this:
"(%s:%u:%u)%pRN", vrf_name, vrf_id, table_id, rn
This is so that it is consistent in usage throughout zebra
as well as finding all the debugs where it was missed and
to start doing that now.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
diff --git a/zebra/redistribute.c b/zebra/redistribute.c
index 31bdfd2526..ccd1143486 100644
--- a/zebra/redistribute.c
+++ b/zebra/redistribute.c
@@ -133,10 +133,9 @@ static void zebra_redistribute(struct zserv *client, int type,
RNODE_FOREACH_RE (rn, newre) {
if (IS_ZEBRA_DEBUG_RIB)
zlog_debug(
- "%s: client %s %pRN(%u:%u) checking: selected=%d, type=%s, instance=%u, distance=%d, metric=%d zebra_check_addr=%d",
- __func__,
- zebra_route_string(client->proto), rn,
- vrf_id, newre->instance,
+ "%s: client %s (%s:%u:%u)%pRN checking: selected=%d, type=%s, instance=%u, distance=%d, metric=%d zebra_check_addr=%d",
+ __func__, zebra_route_string(client->proto),
+ zvrf_name(zvrf), vrf_id, newre->table, rn,
!!CHECK_FLAG(newre->flags,
ZEBRA_FLAG_SELECTED),
zebra_route_string(newre->type),
@@ -247,14 +246,17 @@ void redistribute_update(const struct route_node *rn,
if (IS_ZEBRA_DEBUG_RIB)
zlog_debug(
- "(%u:%u):%pRN(%u): Redist update re %p (%s), old %p (%s)",
- re->vrf_id, re->table, rn, re->instance, re,
+ "(%s:%u:%u)%pRN instance %u: Redist update re %p (%s), old %p (%s)",
+ vrf_id_to_name(re->vrf_id), re->vrf_id, re->table, rn,
+ re->instance, re,
zebra_route_string(re->type), prev_re,
prev_re ? zebra_route_string(prev_re->type) : "None");
if (!zebra_check_addr(&rn->p)) {
if (IS_ZEBRA_DEBUG_RIB)
- zlog_debug("Redist update filter prefix %pRN", rn);
+ zlog_debug("Redist update filter prefix (%s:%u:%u)%pRN",
+ vrf_id_to_name(re->vrf_id), re->vrf_id, re->table,
+ rn);
return;
}
@@ -262,10 +264,10 @@ void redistribute_update(const struct route_node *rn,
if (zebra_redistribute_check(rn, re, client)) {
if (IS_ZEBRA_DEBUG_RIB) {
zlog_debug(
- "%s: client %s %pRN(%u:%u), type=%d, distance=%d, metric=%d",
- __func__,
- zebra_route_string(client->proto), rn,
- re->vrf_id, re->table, re->type,
+ "%s: client %s (%s:%u:%u)%pRN, type=%d, distance=%d, metric=%d",
+ __func__, zebra_route_string(client->proto),
+ vrf_id_to_name(re->vrf_id), re->vrf_id, re->table,
+ rn, re->type,
re->distance, re->metric);
}
if (zebra_redistribute_is_table_direct(re))
@@ -323,8 +325,8 @@ void redistribute_delete(const struct route_node *rn,
table = new_re->table;
}
- zlog_debug("(%s:%u):%pRN: Redist del: re %p (%u:%s), new re %p (%u:%s)",
- VRF_LOGNAME(vrf), table, rn, old_re, old_inst,
+ zlog_debug("(%s:%u:%u)%pRN: Redist del: re %p (%u:%s), new re %p (%u:%s)",
+ VRF_LOGNAME(vrf), vrfid, table, rn, old_re, old_inst,
old_re ? zebra_route_string(old_re->type) : "None",
new_re, new_inst,
new_re ? zebra_route_string(new_re->type) : "None");
@@ -334,8 +336,9 @@ void redistribute_delete(const struct route_node *rn,
if (!zebra_check_addr(&rn->p)) {
if (IS_ZEBRA_DEBUG_RIB) {
zlog_debug(
- "%u:%pRN: Redist del old: skipping invalid prefix",
- vrfid, rn);
+ "(%s:%u:%u)%pRN: Redist del old: skipping invalid prefix",
+ vrf_id_to_name(vrfid), vrfid,
+ old_re ? old_re->table : new_re->table, rn);
}
return;
}
diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c
index 8853f7c90d..4455e9652d 100644
--- a/zebra/zebra_dplane.c
+++ b/zebra/zebra_dplane.c
@@ -4528,8 +4528,9 @@ int dplane_ctx_route_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op,
frrtrace(4, frr_zebra, dplane_ctx_route_kernel_nhg_not_ready, op, nhe->id,
nhe->flags, re->vrf_id);
if (IS_ZEBRA_DEBUG_DPLANE_DETAIL || IS_ZEBRA_DEBUG_RIB_DETAILED)
- zlog_debug("%s route %pRN op %s nhg id %u flags 0x%x nh %pNHs not installed nor queued",
- __func__, rn, dplane_op2str(op), nhe->id, nhe->flags,
+ zlog_debug("%s (%s:%u:%u)%pRN op %s nhg id %u flags 0x%x nh %pNHs not installed nor queued",
+ __func__, zvrf_name(zvrf), re->vrf_id, re->table, rn,
+ dplane_op2str(op), nhe->id, nhe->flags,
nhe->nhg.nexthop);
return ENOENT;
diff --git a/zebra/zebra_fpm.c b/zebra/zebra_fpm.c
index b183d7fad0..4ea3b4827b 100644
--- a/zebra/zebra_fpm.c
+++ b/zebra/zebra_fpm.c
@@ -1005,7 +1005,10 @@ static int zfpm_build_route_updates(void)
zfpm_g->stats.route_dels++;
} else {
flog_err(EC_ZEBRA_FPM_ENCODE_FAIL,
- "%s: Encoding Prefix: %pRN No valid nexthops", __func__,
+ "%s: Encoding Prefix: (%s:%u:%u)%pRN No valid nexthops",
+ __func__, zvrf_name(rib_dest_vrf(dest)),
+ zvrf_id(rib_dest_vrf(dest)),
+ rib_table_info(rib_dest_table(dest))->table_id,
dest->rnode);
}
}
@@ -1487,7 +1490,9 @@ static int zfpm_trigger_remove(struct route_node *rn)
if (!CHECK_FLAG(dest->flags, RIB_DEST_UPDATE_FPM))
return 0;
- zfpm_debug("%pRN Removing from update queue shutting down", rn);
+ zfpm_debug("(%s:%u:%u)%pRN Removing from update queue shutting down",
+ zvrf_name(rib_dest_vrf(dest)), zvrf_id(rib_dest_vrf(dest)),
+ rib_table_info(rib_dest_table(dest))->table_id, rn);
UNSET_FLAG(dest->flags, RIB_DEST_UPDATE_FPM);
TAILQ_REMOVE(&zfpm_g->dest_q, dest, fpm_q_entries);
diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c
index 1d7746a19e..9478d31e9d 100644
--- a/zebra/zebra_mpls.c
+++ b/zebra/zebra_mpls.c
@@ -53,7 +53,8 @@ static int fec_change_update_lsp(struct zebra_vrf *zvrf, struct zebra_fec *fec,
mpls_label_t old_label, bool uninstall);
static int fec_send(struct zebra_fec *fec, struct zserv *client);
static void fec_update_clients(struct zebra_fec *fec);
-static void fec_print(struct zebra_fec *fec, struct vty *vty);
+static void fec_print(struct zebra_fec *fec, struct vty *vty,
+ struct zebra_vrf *zvrf);
static struct zebra_fec *fec_find(struct route_table *table, struct prefix *p);
static struct zebra_fec *fec_add(struct route_table *table, struct prefix *p,
mpls_label_t label, uint32_t flags,
@@ -370,8 +371,9 @@ static void fec_evaluate(struct zebra_vrf *zvrf)
if (IS_ZEBRA_DEBUG_MPLS)
zlog_debug(
- "Update fec %pRN new label %u upon label block",
- rn, new_label);
+ "Update fec (%s:%u:%u)%pRN new label %u upon label block",
+ zvrf_name(zvrf), zvrf_id(zvrf), zvrf->table_id, rn,
+ new_label);
fec->label = new_label;
fec_update_clients(fec);
@@ -522,7 +524,8 @@ static void fec_update_clients(struct zebra_fec *fec)
/*
* Print a FEC-label binding entry.
*/
-static void fec_print(struct zebra_fec *fec, struct vty *vty)
+static void fec_print(struct zebra_fec *fec, struct vty *vty,
+ struct zebra_vrf *zvrf)
{
struct route_node *rn;
struct listnode *node;
@@ -2720,7 +2723,7 @@ void zebra_mpls_print_fec_table(struct vty *vty, struct zebra_vrf *zvrf)
rn = route_next(rn)) {
if (!rn->info)
continue;
- fec_print(rn->info, vty);
+ fec_print(rn->info, vty, zvrf);
}
}
}
@@ -2747,7 +2750,7 @@ void zebra_mpls_print_fec(struct vty *vty, struct zebra_vrf *zvrf,
if (!rn->info)
return;
- fec_print(rn->info, vty);
+ fec_print(rn->info, vty, zvrf);
}
static void mpls_zebra_nhe_update(struct route_entry *re, afi_t afi,
diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c
index ce76dc4075..3c052f4d8e 100644
--- a/zebra/zebra_nhg.c
+++ b/zebra/zebra_nhg.c
@@ -2828,16 +2828,18 @@ done_with_match:
} else {
if (IS_ZEBRA_DEBUG_RIB_DETAILED)
zlog_debug(
- " %s: Recursion failed to find while looking at %pRN",
- __func__, rn);
+ " %s: Recursion failed to find while looking at (%s:%u:%u)%pRN",
+ __func__, zvrf_name(zvrf), nexthop->vrf_id,
+ zvrf->table_id, rn);
goto continue_up_tree;
}
return 1;
} else if (IS_ZEBRA_DEBUG_RIB_DETAILED) {
zlog_debug(
- " %s: Route Type %s has not turned on recursion %pRN failed to match",
- __func__, zebra_route_string(type), rn);
+ " %s: Route Type %s has not turned on recursion (%s:%u:%u)%pRN failed to match",
+ __func__, zebra_route_string(type), zvrf_name(zvrf),
+ nexthop->vrf_id, zvrf->table_id, rn);
if (type == ZEBRA_ROUTE_BGP
&& !CHECK_FLAG(flags, ZEBRA_FLAG_IBGP))
zlog_debug(
@@ -3004,8 +3006,8 @@ skip_check:
if (ret == RMAP_DENYMATCH) {
if (IS_ZEBRA_DEBUG_RIB) {
zlog_debug(
- "%u:%pRN: Filtering out with NH %pNHv due to route map",
- re->vrf_id, rn, nexthop);
+ "(%s:%u:%u)%pRN: Filtering out with NH %pNHv due to route map",
+ zvrf_name(zvrf), re->vrf_id, re->table, rn, nexthop);
}
UNSET_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE);
}
@@ -3262,18 +3264,31 @@ static bool zebra_nhg_nexthop_compare(const struct nexthop *nhop,
const struct route_node *rn)
{
bool same = true;
+ const char *vrf_name = "Unknown";
+ vrf_id_t vrf_id = VRF_UNKNOWN;
+ uint32_t table_id = 0;
+
+ if (IS_ZEBRA_DEBUG_NHG_DETAIL) {
+ struct rib_table_info *info =
+ srcdest_rnode_table_info((struct route_node *)rn);
+
+ vrf_name = info ? zvrf_name(info->zvrf) : "Unknown";
+ vrf_id = info ? zvrf_id(info->zvrf) : VRF_UNKNOWN;
+ table_id = info ? info->table_id : 0;
+ }
while (nhop && old_nhop) {
if (IS_ZEBRA_DEBUG_NHG_DETAIL)
- zlog_debug("%s: %pRN Comparing %pNHvv(%u) ACTIVE: %d to old: %pNHvv(%u) ACTIVE: %d nexthop same: %d",
- __func__, rn, nhop, nhop->flags,
+ zlog_debug("%s: (%s:%u:%u)%pRN Comparing %pNHvv(%u) ACTIVE: %d to old: %pNHvv(%u) ACTIVE: %d nexthop same: %d",
+ __func__, vrf_name, vrf_id, table_id, rn, nhop,
+ nhop->flags,
CHECK_FLAG(nhop->flags, NEXTHOP_FLAG_ACTIVE), old_nhop,
old_nhop->flags, CHECK_FLAG(old_nhop->flags, NEXTHOP_FLAG_ACTIVE),
nexthop_same_no_ifindex(nhop, old_nhop));
if (!CHECK_FLAG(old_nhop->flags, NEXTHOP_FLAG_ACTIVE)) {
if (IS_ZEBRA_DEBUG_NHG_DETAIL)
- zlog_debug("%s: %pRN Old is not active going to the next one",
- __func__, rn);
+ zlog_debug("%s: (%s:%u:%u)%pRN Old is not active going to the next one",
+ __func__, vrf_name, vrf_id, table_id, rn);
/*
* If the new nexthop is not active and the old nexthop is also not active,
@@ -3282,8 +3297,8 @@ static bool zebra_nhg_nexthop_compare(const struct nexthop *nhop,
if (!CHECK_FLAG(nhop->flags, NEXTHOP_FLAG_ACTIVE) &&
nexthop_same_no_ifindex(nhop, old_nhop)) {
if (IS_ZEBRA_DEBUG_NHG_DETAIL)
- zlog_debug("%s: %pRN new is not active going to the next one",
- __func__, rn);
+ zlog_debug("%s: (%s:%u:%u)%pRN new is not active going to the next one",
+ __func__, vrf_name, vrf_id, table_id, rn);
nhop = nhop->next;
}
old_nhop = old_nhop->next;
@@ -3294,8 +3309,8 @@ static bool zebra_nhg_nexthop_compare(const struct nexthop *nhop,
struct nexthop *new_recursive, *old_recursive;
if (IS_ZEBRA_DEBUG_NHG_DETAIL)
- zlog_debug("%s: %pRN New and old are same, continuing search",
- __func__, rn);
+ zlog_debug("%s: (%s:%u:%u)%pRN New and old are same, continuing search",
+ __func__, vrf_name, vrf_id, table_id, rn);
new_recursive = nhop->resolved;
old_recursive = old_nhop->resolved;
@@ -3331,8 +3346,8 @@ static bool zebra_nhg_nexthop_compare(const struct nexthop *nhop,
old_nhop = old_nhop->next;
} else {
if (IS_ZEBRA_DEBUG_NHG_DETAIL)
- zlog_debug("%s:%pRN They are not the same, stopping using new nexthop entry",
- __func__, rn);
+ zlog_debug("%s: (%s:%u:%u)%pRN They are not the same, stopping using new nexthop entry",
+ __func__, vrf_name, vrf_id, table_id, rn);
same = false;
break;
}
@@ -3366,13 +3381,16 @@ static struct nhg_hash_entry *zebra_nhg_rib_compare_old_nhe(
char straddr[PREFIX_STRLEN];
prefix2str(&rn->p, straddr, sizeof(straddr));
- zlog_debug("%s: %pRN new id: %u old id: %u", __func__, rn,
- new_nhe->id, old_nhe->id);
- zlog_debug("%s: %pRN NEW", __func__, rn);
+ zlog_debug("%s: (%s:%u:%u)%pRN new id: %u old id: %u", __func__,
+ VRF_LOGNAME(vrf), re->vrf_id, re->table, rn, new_nhe->id,
+ old_nhe->id);
+ zlog_debug("%s: (%s:%u:%u)%pRN NEW", __func__, VRF_LOGNAME(vrf),
+ re->vrf_id, re->table, rn);
for (ALL_NEXTHOPS(new_nhe->nhg, nhop))
route_entry_dump_nh(re, straddr, vrf, nhop);
- zlog_debug("%s: %pRN OLD", __func__, rn);
+ zlog_debug("%s: (%s:%u:%u)%pRN OLD", __func__, VRF_LOGNAME(vrf),
+ re->vrf_id, re->table, rn);
for (ALL_NEXTHOPS(old_nhe->nhg, nhop))
route_entry_dump_nh(re, straddr, vrf, nhop);
}
@@ -3401,9 +3419,9 @@ static struct nhg_hash_entry *zebra_nhg_rib_compare_old_nhe(
}
if (IS_ZEBRA_DEBUG_NHG_DETAIL)
- zlog_debug("%s:%pRN They are %sthe same, using the %s nhg entry",
- __func__, rn, same ? "" : "not ",
- same ? "old" : "new");
+ zlog_debug("%s: (%s:%u:%u)%pRN They are %sthe same, using the %s nhg entry",
+ __func__, VRF_LOGNAME(vrf), re->vrf_id, re->table, rn,
+ same ? "" : "not ", same ? "old" : "new");
if (same)
return old_nhe;
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index f850d9a42f..186a879072 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -736,8 +736,8 @@ void rib_install_kernel(struct route_node *rn, struct route_entry *re,
case ZEBRA_DPLANE_REQUEST_FAILURE:
{
flog_err(EC_ZEBRA_DP_INSTALL_FAIL,
- "%u:%u:%pRN: Failed to enqueue dataplane install",
- re->vrf_id, re->table, rn);
+ "(%s:%u:%u)%pRN: Failed to enqueue dataplane install",
+ zvrf_name(zvrf), re->vrf_id, re->table, rn);
break;
}
case ZEBRA_DPLANE_REQUEST_SUCCESS:
@@ -774,8 +774,8 @@ void rib_uninstall_kernel(struct route_node *rn, struct route_entry *re)
break;
case ZEBRA_DPLANE_REQUEST_FAILURE:
flog_err(EC_ZEBRA_DP_INSTALL_FAIL,
- "%u:%pRN: Failed to enqueue dataplane uninstall",
- re->vrf_id, rn);
+ "(%s:%u:%u)%pRN: Failed to enqueue dataplane uninstall",
+ zvrf_name(zvrf), re->vrf_id, re->table, rn);
break;
case ZEBRA_DPLANE_REQUEST_SUCCESS:
if (zvrf)
@@ -822,6 +822,7 @@ void zebra_rib_evaluate_rn_nexthops(struct route_node *rn, uint32_t seq,
bool rt_delete)
{
rib_dest_t *dest = rib_dest_from_rnode(rn);
+ struct rib_table_info *info = srcdest_rnode_table_info(rn);
struct rnh *rnh;
/*
@@ -900,14 +901,16 @@ void zebra_rib_evaluate_rn_nexthops(struct route_node *rn, uint32_t seq,
while (rn) {
if (IS_ZEBRA_DEBUG_NHT_DETAILED)
zlog_debug(
- "%s: %pRN Being examined for Nexthop Tracking Count: %zd",
- __func__, rn,
+ "%s: (%s:%u:%u)%pRN Being examined for Nexthop Tracking Count: %zd",
+ __func__, zvrf_name(info->zvrf), zvrf_id(info->zvrf),
+ info->table_id, rn,
dest ? rnh_list_count(&dest->nht) : 0);
if (rt_delete && (!dest || !rnh_list_count(&dest->nht))) {
if (IS_ZEBRA_DEBUG_NHT_DETAILED)
- zlog_debug("%pRN has no tracking NHTs. Bailing",
- rn);
+ zlog_debug("(%s:%u:%u)%pRN has no tracking NHTs. Bailing",
+ zvrf_name(info->zvrf), zvrf_id(info->zvrf),
+ info->table_id, rn);
break;
}
if (!dest) {
@@ -929,9 +932,11 @@ void zebra_rib_evaluate_rn_nexthops(struct route_node *rn, uint32_t seq,
if (IS_ZEBRA_DEBUG_NHT_DETAILED)
zlog_debug(
- "%s(%u):%pRN has Nexthop(%pRN) depending on it, evaluating %u:%u",
- zvrf_name(zvrf), zvrf_id(zvrf), rn,
- rnh->node, seq, rnh->seqno);
+ "(%s:%u:%u)%pRN has Nexthop (%s:%u:%u)%pRN depending on it, evaluating %u:%u",
+ zvrf_name(info->zvrf), zvrf_id(info->zvrf),
+ info->table_id, rn, zvrf_name(zvrf),
+ zvrf_id(zvrf), zvrf->table_id, rnh->node,
+ seq, rnh->seqno);
/*
* If we have evaluated this node on this pass
@@ -1042,7 +1047,7 @@ static void rib_process_add_fib(struct zebra_vrf *zvrf, struct route_node *rn,
}
if (IS_ZEBRA_DEBUG_RIB)
- zlog_debug("%s(%u:%u):%pRN: Adding route rn %p, re %p (%s)",
+ zlog_debug("(%s:%u:%u)%pRN: Adding route rn %p, re %p (%s)",
zvrf_name(zvrf), zvrf_id(zvrf), new->table, rn, rn,
new, zebra_route_string(new->type));
@@ -1062,7 +1067,7 @@ static void rib_process_del_fib(struct zebra_vrf *zvrf, struct route_node *rn,
/* Uninstall from kernel. */
if (IS_ZEBRA_DEBUG_RIB)
- zlog_debug("%s(%u:%u):%pRN: Deleting route rn %p, re %p (%s)",
+ zlog_debug("(%s:%u:%u)%pRN: Deleting route rn %p, re %p (%s)",
zvrf_name(zvrf), zvrf_id(zvrf), old->table, rn, rn,
old, zebra_route_string(old->type));
@@ -1112,7 +1117,7 @@ static void rib_process_update_fib(struct zebra_vrf *zvrf,
if (IS_ZEBRA_DEBUG_RIB) {
if (new != old)
zlog_debug(
- "%s(%u:%u):%pRN: Updating route rn %p, re %p (%s) old %p (%s)",
+ "(%s:%u:%u)%pRN: Updating route rn %p, re %p (%s) old %p (%s)",
zvrf_name(zvrf), zvrf_id(zvrf),
new->table, rn, rn, new,
zebra_route_string(new->type),
@@ -1120,7 +1125,7 @@ static void rib_process_update_fib(struct zebra_vrf *zvrf,
zebra_route_string(old->type));
else
zlog_debug(
- "%s(%u:%u):%pRN: Updating route rn %p, re %p (%s)",
+ "(%s:%u:%u)%pRN: Updating route rn %p, re %p (%s)",
zvrf_name(zvrf), zvrf_id(zvrf),
new->table, rn, rn, new,
zebra_route_string(new->type));
@@ -1150,7 +1155,7 @@ static void rib_process_update_fib(struct zebra_vrf *zvrf,
if (IS_ZEBRA_DEBUG_RIB) {
if (new != old)
zlog_debug(
- "%s(%u:%u):%pRN: Deleting route rn %p, re %p (%s) old %p (%s) - nexthop inactive",
+ "(%s:%u:%u)%pRN: Deleting route rn %p, re %p (%s) old %p (%s) - nexthop inactive",
zvrf_name(zvrf), zvrf_id(zvrf),
new->table, rn, rn, new,
zebra_route_string(new->type),
@@ -1158,7 +1163,7 @@ static void rib_process_update_fib(struct zebra_vrf *zvrf,
zebra_route_string(old->type));
else
zlog_debug(
- "%s(%u:%u):%pRN: Deleting route rn %p, re %p (%s) - nexthop inactive",
+ "(%s:%u:%u)%pRN: Deleting route rn %p, re %p (%s) - nexthop inactive",
zvrf_name(zvrf), zvrf_id(zvrf),
new->table, rn, rn, new,
zebra_route_string(new->type));
@@ -1337,8 +1342,8 @@ static void rib_process(struct route_node *rn)
if (IS_ZEBRA_DEBUG_RIB_DETAILED) {
struct route_entry *rent = re_list_first(&dest->routes);
- zlog_debug("%s(%u:%u:%u):%pRN: Processing rn %p", VRF_LOGNAME(vrf), vrf_id,
- rent->table, safi, rn, rn);
+ zlog_debug("(%s:%u:%u)%pRN safi %u: Processing rn %p",
+ VRF_LOGNAME(vrf), vrf_id, rent->table, rn, safi, rn);
}
old_fib = dest->selected_fib;
@@ -1348,8 +1353,8 @@ static void rib_process(struct route_node *rn)
char flags_buf[128];
char status_buf[128];
- zlog_debug("%s(%u:%u:%u):%pRN: Examine re %p (%s) status: %sflags: %sdist %d metric %d",
- VRF_LOGNAME(vrf), vrf_id, re->table, safi, rn, re,
+ zlog_debug("(%s:%u:%u)%pRN safi %u: Examine re %p (%s) status: %sflags: %sdist %d metric %d",
+ VRF_LOGNAME(vrf), vrf_id, re->table, rn, safi, re,
zebra_route_string(re->type),
zebra_rib_dump_re_status(re, status_buf, sizeof(status_buf)),
zclient_dump_route_flags(re->flags, flags_buf,
@@ -1398,11 +1403,9 @@ static void rib_process(struct route_node *rn)
if (re != old_selected) {
if (IS_ZEBRA_DEBUG_RIB)
zlog_debug(
- "%s: %s(%u):%pRN: imported via import-table but denied by the ip protocol table route-map",
- __func__,
- VRF_LOGNAME(
- vrf),
- vrf_id, rn);
+ "%s: (%s:%u:%u)%pRN: imported via import-table but denied by the ip protocol table route-map",
+ __func__, VRF_LOGNAME(vrf),
+ vrf_id, re->table, rn);
rib_unlink(rn, re);
continue;
} else
@@ -1478,8 +1481,8 @@ static void rib_process(struct route_node *rn)
: old_fib ? old_fib
: new_fib ? new_fib : NULL;
- zlog_debug("%s(%u:%u:%u):%pRN: After processing: old_selected %p new_selected %p old_fib %p new_fib %p",
- VRF_LOGNAME(vrf), vrf_id, entry ? entry->table : 0, safi, rn,
+ zlog_debug("(%s:%u:%u)%pRN safi %u: After processing: old_selected %p new_selected %p old_fib %p new_fib %p",
+ VRF_LOGNAME(vrf), vrf_id, entry ? entry->table : 0, rn, safi,
(void *)old_selected, (void *)new_selected, (void *)old_fib,
(void *)new_fib);
}
@@ -1832,7 +1835,7 @@ static bool rib_update_re_from_ctx(struct route_entry *re,
is_selected = (re == dest->selected_fib);
if (IS_ZEBRA_DEBUG_RIB_DETAILED)
- zlog_debug("update_from_ctx: %s(%u:%u):%pRN: %sSELECTED, re %p",
+ zlog_debug("update_from_ctx: (%s:%u:%u)%pRN: %sSELECTED, re %p",
VRF_LOGNAME(vrf), re->vrf_id, re->table, rn,
(is_selected ? "" : "NOT "), re);
@@ -1844,7 +1847,7 @@ static bool rib_update_re_from_ctx(struct route_entry *re,
ctxnhg = dplane_ctx_get_ng(ctx);
if (IS_ZEBRA_DEBUG_RIB)
- zlog_debug("%s(%u:%u):%pRN update_from_ctx()", VRF_LOGNAME(vrf), re->vrf_id,
+ zlog_debug("(%s:%u:%u)%pRN update_from_ctx()", VRF_LOGNAME(vrf), re->vrf_id,
re->table, rn);
if (ctxnhg->nexthop == NULL)
@@ -1855,7 +1858,7 @@ static bool rib_update_re_from_ctx(struct route_entry *re,
if (matched) {
if (IS_ZEBRA_DEBUG_RIB)
zlog_debug(
- "%s(%u:%u):%pRN update_from_ctx(): rib nhg matched, changed '%s'",
+ "(%s:%u:%u)%pRN update_from_ctx(): rib nhg matched, changed '%s'",
VRF_LOGNAME(vrf), re->vrf_id, re->table, rn,
(changed_p ? "true" : "false"));
}
@@ -1998,9 +2001,11 @@ static void rib_process_result(struct zebra_dplane_ctx *ctx)
rn = rib_find_rn_from_ctx(ctx);
if (rn == NULL) {
if (IS_ZEBRA_DEBUG_DPLANE) {
- zlog_debug("Failed to process dplane results: no route for %pRN (%s:%u:%u)%pFX",
- rn, VRF_LOGNAME(vrf), dplane_ctx_get_vrf(ctx),
- dplane_ctx_get_table(ctx), dplane_ctx_get_dest(ctx));
+ zlog_debug("Failed to process dplane results: no route for (%s:%u:%u)%pRN (%s:%u:%u)%pFX",
+ VRF_LOGNAME(vrf), dplane_ctx_get_vrf(ctx),
+ dplane_ctx_get_table(ctx), rn, VRF_LOGNAME(vrf),
+ dplane_ctx_get_vrf(ctx), dplane_ctx_get_table(ctx),
+ dplane_ctx_get_dest(ctx));
}
goto done;
}
@@ -2013,7 +2018,7 @@ static void rib_process_result(struct zebra_dplane_ctx *ctx)
if (IS_ZEBRA_DEBUG_DPLANE_DETAIL)
zlog_debug(
- "%s(%u:%u):%pRN Processing dplane result ctx %p, op %s result %s",
+ "(%s:%u:%u)%pRN Processing dplane result ctx %p, op %s result %s",
VRF_LOGNAME(vrf), dplane_ctx_get_vrf(ctx),
dplane_ctx_get_table(ctx), rn, ctx, dplane_op2str(op),
dplane_res2str(status));
@@ -2076,7 +2081,7 @@ static void rib_process_result(struct zebra_dplane_ctx *ctx)
}
} else {
if (IS_ZEBRA_DEBUG_DPLANE_DETAIL)
- zlog_debug("%s(%u:%u):%pRN No entry owns dplane result, op %s result %s seq %u old_seq %u: superseded or unlinked",
+ zlog_debug("(%s:%u:%u):%pRN No entry owns dplane result, op %s result %s seq %u old_seq %u: superseded or unlinked",
VRF_LOGNAME(vrf), dplane_ctx_get_vrf(ctx),
dplane_ctx_get_table(ctx), rn, dplane_op2str(op),
dplane_res2str(status), seq, old_seq);
@@ -2090,7 +2095,7 @@ static void rib_process_result(struct zebra_dplane_ctx *ctx)
* for an install old_re is legitimately NULL.
*/
if (is_update && old_seq != 0 && IS_ZEBRA_DEBUG_DPLANE_DETAIL)
- zlog_debug("%s(%u:%u):%pRN No entry owns the old side of dplane result, op %s old_seq %u: unlinked while in flight",
+ zlog_debug("(%s:%u:%u):%pRN No entry owns the old side of dplane result, op %s old_seq %u: unlinked while in flight",
VRF_LOGNAME(vrf), dplane_ctx_get_vrf(ctx),
dplane_ctx_get_table(ctx), rn, dplane_op2str(op), old_seq);
}
@@ -2126,7 +2131,7 @@ static void rib_process_result(struct zebra_dplane_ctx *ctx)
if (!fib_changed) {
if (IS_ZEBRA_DEBUG_DPLANE_DETAIL)
zlog_debug(
- "%s(%u:%u):%pRN no fib change for re",
+ "(%s:%u:%u)%pRN no fib change for re",
VRF_LOGNAME(vrf),
dplane_ctx_get_vrf(ctx),
dplane_ctx_get_table(
@@ -2206,7 +2211,7 @@ static void rib_process_result(struct zebra_dplane_ctx *ctx)
rn, re, ZAPI_ROUTE_FAIL_INSTALL,
info->afi, info->safi);
- zlog_warn("%s(%u:%u):%pRN: Route install failed",
+ zlog_warn("(%s:%u:%u)%pRN: Route install failed",
VRF_LOGNAME(vrf), dplane_ctx_get_vrf(ctx),
dplane_ctx_get_table(ctx), rn);
}
@@ -2235,7 +2240,7 @@ static void rib_process_result(struct zebra_dplane_ctx *ctx)
zsend_route_notify_owner_ctx(ctx,
ZAPI_ROUTE_REMOVE_FAIL);
- zlog_warn("%s(%u:%u):%pRN: Route Deletion failure",
+ zlog_warn("(%s:%u:%u)%pRN: Route Deletion failure",
VRF_LOGNAME(vrf), dplane_ctx_get_vrf(ctx),
dplane_ctx_get_table(ctx), rn);
}
@@ -2284,8 +2289,9 @@ static void rib_process_dplane_notify(struct zebra_dplane_ctx *ctx)
rn = rib_find_rn_from_ctx(ctx);
if (rn == NULL) {
if (debug_p) {
- zlog_debug("Failed to process dplane notification: no routes for %pRN (%s:%u:%u)%pFX",
- rn, VRF_LOGNAME(vrf), dplane_ctx_get_vrf(ctx), tableid,
+ zlog_debug("Failed to process dplane notification: no routes for (%s:%u:%u)%pRN (%s:%u:%u)%pFX",
+ VRF_LOGNAME(vrf), dplane_ctx_get_vrf(ctx), tableid, rn,
+ VRF_LOGNAME(vrf), dplane_ctx_get_vrf(ctx), tableid,
dplane_ctx_get_dest(ctx));
}
goto done;
@@ -2294,7 +2300,7 @@ static void rib_process_dplane_notify(struct zebra_dplane_ctx *ctx)
dest = rib_dest_from_rnode(rn);
if (debug_p)
- zlog_debug("%s(%u:%u):%pRN Processing dplane notif ctx %p",
+ zlog_debug("(%s:%u:%u)%pRN Processing dplane notif ctx %p",
VRF_LOGNAME(vrf), dplane_ctx_get_vrf(ctx),
tableid, rn, ctx);
@@ -2311,7 +2317,7 @@ static void rib_process_dplane_notify(struct zebra_dplane_ctx *ctx)
if (re == NULL) {
if (debug_p)
zlog_debug(
- "%s(%u:%u):%pRN Unable to process dplane notification: no entry for type %s",
+ "(%s:%u:%u)%pRN Unable to process dplane notification: no entry for type %s",
VRF_LOGNAME(vrf), dplane_ctx_get_vrf(ctx),
tableid, rn,
zebra_route_string(dplane_ctx_get_type(ctx)));
@@ -2346,7 +2352,7 @@ static void rib_process_dplane_notify(struct zebra_dplane_ctx *ctx)
UNSET_FLAG(re->status, ROUTE_ENTRY_INSTALLED);
if (debug_p)
zlog_debug(
- "%s(%u:%u):%pRN dplane notif, uninstalled type %s route",
+ "(%s:%u:%u)%pRN dplane notif, uninstalled type %s route",
VRF_LOGNAME(vrf),
dplane_ctx_get_vrf(ctx),
tableid, rn,
@@ -2356,7 +2362,7 @@ static void rib_process_dplane_notify(struct zebra_dplane_ctx *ctx)
/* At least report on the event. */
if (debug_p)
zlog_debug(
- "%s(%u:%u):%pRN dplane notif, but type %s not selected_fib",
+ "(%s:%u:%u)%pRN dplane notif, but type %s not selected_fib",
VRF_LOGNAME(vrf),
dplane_ctx_get_vrf(ctx),
tableid, rn,
@@ -2387,7 +2393,7 @@ static void rib_process_dplane_notify(struct zebra_dplane_ctx *ctx)
if (!fib_changed) {
if (debug_p)
zlog_debug(
- "%s(%u:%u):%pRN dplane notification: rib_update returns FALSE",
+ "(%s:%u:%u)%pRN dplane notification: rib_update returns FALSE",
VRF_LOGNAME(vrf), dplane_ctx_get_vrf(ctx),
tableid, rn);
}
@@ -2588,7 +2594,7 @@ static void process_subq_route(struct listnode *lnode, uint8_t qindex)
if (dest)
re = re_list_first(&dest->routes);
- zlog_debug("%s(%u:%u):%pRN rn %p dequeued from sub-queue %s",
+ zlog_debug("(%s:%u:%u)%pRN rn %p dequeued from sub-queue %s",
zvrf_name(zvrf), zvrf_id(zvrf), re ? re->table : 0,
rnode, rnode, subqueue2str(qindex));
}
@@ -2777,8 +2783,8 @@ static void process_subq_early_route_add(struct zebra_early_route *ere)
if (!same) {
if (IS_ZEBRA_DEBUG_RIB)
zlog_debug(
- "prefix: %pRN is a self route where we do not have an entry for it. Dropping this update, it's useless",
- rn);
+ "prefix: (%s:%u:%u)%pRN is a self route where we do not have an entry for it. Dropping this update, it's useless",
+ vrf_id_to_name(re->vrf_id), re->vrf_id, re->table, rn);
/*
* We are not on startup, this is a self route
* and we have asic offload. Which means
@@ -2946,8 +2952,9 @@ static void process_subq_early_route_delete(struct zebra_early_route *ere)
else
src_buf[0] = '\0';
- zlog_debug("%s[%d]:%pRN%s%s doesn't exist in rib",
- vrf ? vrf->name : "Unknown", ere->re->table, rn,
+ zlog_debug("(%s:%u:%u)%pRN%s%s doesn't exist in rib",
+ vrf ? vrf->name : "Unknown", ere->re->vrf_id,
+ ere->re->table, rn,
(src_buf[0] != '\0') ? " from " : "", src_buf);
}
early_route_memory_free(ere);
diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c
index d2a78d0397..e53d5595b8 100644
--- a/zebra/zebra_rnh.c
+++ b/zebra/zebra_rnh.c
@@ -127,9 +127,10 @@ static void zebra_rnh_remove_from_routing_table(struct rnh *rnh)
return;
if (IS_ZEBRA_DEBUG_NHT_DETAILED)
- zlog_debug("%s: %s(%u):%pRN removed from tracking on %pRN",
- __func__, VRF_LOGNAME(zvrf->vrf), rnh->vrf_id,
- rnh->node, rn);
+ zlog_debug("%s: (%s:%u:%u)%pRN removed from tracking on (%s:%u:%u)%pRN",
+ __func__, zvrf_name(zvrf), rnh->vrf_id, zvrf->table_id,
+ rnh->node, zvrf_name(zvrf), rnh->vrf_id, zvrf->table_id,
+ rn);
dest = rib_dest_from_rnode(rn);
rnh_list_del(&dest->nht, rnh);
@@ -155,9 +156,10 @@ static void zebra_rnh_store_in_routing_table(struct rnh *rnh)
return;
if (IS_ZEBRA_DEBUG_NHT_DETAILED)
- zlog_debug("%s: %s(%u):%pRN added for tracking on %pRN",
- __func__, VRF_LOGNAME(zvrf->vrf), rnh->vrf_id,
- rnh->node, rn);
+ zlog_debug("%s: (%s:%u:%u)%pRN added for tracking on (%s:%u:%u)%pRN",
+ __func__, zvrf_name(zvrf), rnh->vrf_id, zvrf->table_id,
+ rnh->node, zvrf_name(zvrf), rnh->vrf_id, zvrf->table_id,
+ rn);
dest = rib_dest_from_rnode(rn);
rnh_list_add_tail(&dest->nht, rnh);
@@ -327,9 +329,10 @@ static void zebra_delete_rnh(struct rnh *rnh)
if (IS_ZEBRA_DEBUG_NHT) {
struct vrf *vrf = vrf_lookup_by_id(rnh->vrf_id);
+ struct zebra_vrf *zvrf = vrf ? vrf->info : NULL;
- zlog_debug("%s(%u): Del RNH %pRN for client %s", VRF_LOGNAME(vrf), rnh->vrf_id,
- rnh->node,
+ zlog_debug("(%s:%u:%u)%pRN: Del RNH for client %s", VRF_LOGNAME(vrf),
+ rnh->vrf_id, zvrf ? zvrf->table_id : 0, rnh->node,
rnh->client ? zebra_route_string(rnh->client->proto) : "pseudowire");
}
@@ -363,10 +366,11 @@ void zebra_add_rnh_client(struct rnh *rnh, struct zserv *client,
{
if (IS_ZEBRA_DEBUG_NHT) {
struct vrf *vrf = vrf_lookup_by_id(vrf_id);
+ struct zebra_vrf *zvrf = vrf ? vrf->info : NULL;
- zlog_debug("%s(%u): Client %s registers for RNH %pRN",
- VRF_LOGNAME(vrf), vrf_id,
- zebra_route_string(client->proto), rnh->node);
+ zlog_debug("(%s:%u:%u)%pRN: Client %s registers for RNH",
+ VRF_LOGNAME(vrf), vrf_id, zvrf ? zvrf->table_id : 0,
+ rnh->node, zebra_route_string(client->proto));
}
/* Each rnh now has a single client, so just verify it matches */
@@ -383,10 +387,12 @@ void zebra_remove_rnh_client(struct rnh *rnh, struct zserv *client)
{
if (IS_ZEBRA_DEBUG_NHT) {
struct vrf *vrf = vrf_lookup_by_id(rnh->vrf_id);
+ struct zebra_vrf *zvrf = vrf ? vrf->info : NULL;
- zlog_debug("Client %s unregisters for RNH %s(%u)%pRN",
+ zlog_debug("Client %s unregisters for RNH (%s:%u:%u)%pRN",
zebra_route_string(client->proto), VRF_LOGNAME(vrf),
- vrf ? vrf->vrf_id : rnh->vrf_id, rnh->node);
+ vrf ? vrf->vrf_id : rnh->vrf_id,
+ zvrf ? zvrf->table_id : 0, rnh->node);
}
/* Verify this is the right client */
@@ -557,12 +563,15 @@ static void zebra_rnh_notify_protocol_clients(struct zebra_vrf *zvrf, afi_t afi,
if (IS_ZEBRA_DEBUG_NHT) {
if (prn && re) {
- zlog_debug("%s(%u):%pRN: NH resolved over route %pRN for client %s",
- VRF_LOGNAME(zvrf->vrf), zvrf->vrf->vrf_id, nrn, prn,
+ zlog_debug("(%s:%u:%u)%pRN: NH resolved over route (%s:%u:%u)%pRN for client %s",
+ VRF_LOGNAME(zvrf->vrf), zvrf->vrf->vrf_id,
+ zvrf->table_id, nrn, VRF_LOGNAME(zvrf->vrf),
+ zvrf->vrf->vrf_id, zvrf->table_id, prn,
zebra_route_string(client->proto));
} else
- zlog_debug("%s(%u):%pRN: NH has become unresolved for client %s",
- VRF_LOGNAME(zvrf->vrf), zvrf->vrf->vrf_id, nrn,
+ zlog_debug("(%s:%u:%u)%pRN: NH has become unresolved for client %s",
+ VRF_LOGNAME(zvrf->vrf), zvrf->vrf->vrf_id,
+ zvrf->table_id, nrn,
zebra_route_string(client->proto));
}
@@ -578,15 +587,17 @@ static void zebra_rnh_notify_protocol_clients(struct zebra_vrf *zvrf, afi_t afi,
rnh->filtered = true;
if (IS_ZEBRA_DEBUG_NHT)
- zlog_debug("%s(%u):%pRN: Notifying client %s about NH %s",
- VRF_LOGNAME(zvrf->vrf), zvrf->vrf->vrf_id, nrn,
+ zlog_debug("(%s:%u:%u)%pRN: Notifying client %s about NH %s",
+ VRF_LOGNAME(zvrf->vrf), zvrf->vrf->vrf_id,
+ zvrf->table_id, nrn,
zebra_route_string(client->proto),
num_resolving_nh ? "" : "(filtered by route-map)");
} else {
rnh->filtered = false;
if (IS_ZEBRA_DEBUG_NHT)
- zlog_debug("%s(%u):%pRN: Notifying client %s about NH (unreachable)",
- VRF_LOGNAME(zvrf->vrf), zvrf->vrf->vrf_id, nrn,
+ zlog_debug("(%s:%u:%u)%pRN: Notifying client %s about NH (unreachable)",
+ VRF_LOGNAME(zvrf->vrf), zvrf->vrf->vrf_id,
+ zvrf->table_id, nrn,
zebra_route_string(client->proto));
}
@@ -777,9 +788,10 @@ zebra_rnh_resolve_nexthop_entry(struct zebra_vrf *zvrf, afi_t afi,
*/
while (rn) {
if (IS_ZEBRA_DEBUG_NHT_DETAILED)
- zlog_debug("%s: %s(%u):%pRN Possible Match to %pRN",
- __func__, VRF_LOGNAME(zvrf->vrf),
- rnh->vrf_id, rnh->node, rn);
+ zlog_debug("%s: (%s:%u:%u)%pRN Possible Match to (%s:%u:%u)%pRN",
+ __func__, VRF_LOGNAME(zvrf->vrf), rnh->vrf_id,
+ zvrf->table_id, rnh->node, VRF_LOGNAME(zvrf->vrf),
+ rnh->vrf_id, zvrf->table_id, rn);
/* Do not resolve over default route unless allowed &&
* match route to be exact if so specified
@@ -927,8 +939,9 @@ static void zebra_rnh_evaluate_entry(struct zebra_vrf *zvrf, afi_t afi,
struct route_node *prn;
if (IS_ZEBRA_DEBUG_NHT) {
- zlog_debug("%s(%u):%pRN: Evaluate RNH, %s", VRF_LOGNAME(zvrf->vrf),
- zvrf->vrf ? zvrf->vrf->vrf_id : 0, nrn, force ? "(force)" : "");
+ zlog_debug("(%s:%u:%u)%pRN: Evaluate RNH, %s", VRF_LOGNAME(zvrf->vrf),
+ zvrf->vrf ? zvrf->vrf->vrf_id : 0, zvrf->table_id, nrn,
+ force ? "(force)" : "");
}
rnhc = nrn->info;