pimd: add caller string prefix to pim_rpf_update logs

No functional change; log enhancements only.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
This commit is contained in:
Anuradha Karuppiah 2019-11-15 11:37:31 -08:00
parent 0688d6033a
commit 8c55c1325a
6 changed files with 16 additions and 15 deletions

View File

@ -446,7 +446,7 @@ static int pim_update_upstream_nh_helper(struct hash_bucket *bucket, void *arg)
struct pim_rpf old;
old.source_nexthop.interface = up->rpf.source_nexthop.interface;
rpf_result = pim_rpf_update(pim, up, &old);
rpf_result = pim_rpf_update(pim, up, &old, __func__);
if (rpf_result == PIM_RPF_FAILURE) {
pim_upstream_rpf_clear(pim, up);
return HASHWALK_CONTINUE;

View File

@ -382,7 +382,7 @@ void pim_upstream_update(struct pim_instance *pim, struct pim_upstream *up)
old_rpf.source_nexthop.interface = up->rpf.source_nexthop.interface;
rpf_result = pim_rpf_update(pim, up, &old_rpf);
rpf_result = pim_rpf_update(pim, up, &old_rpf, __func__);
if (rpf_result == PIM_RPF_FAILURE)
pim_mroute_del(up->channel_oil, __PRETTY_FUNCTION__);

View File

@ -195,7 +195,8 @@ static int nexthop_mismatch(const struct pim_nexthop *nh1,
}
enum pim_rpf_result pim_rpf_update(struct pim_instance *pim,
struct pim_upstream *up, struct pim_rpf *old)
struct pim_upstream *up, struct pim_rpf *old,
const char *caller)
{
struct pim_rpf *rpf = &up->rpf;
struct pim_rpf saved;
@ -207,8 +208,8 @@ enum pim_rpf_result pim_rpf_update(struct pim_instance *pim,
return PIM_RPF_OK;
if (up->upstream_addr.s_addr == INADDR_ANY) {
zlog_debug("%s: RP is not configured yet for %s",
__PRETTY_FUNCTION__, up->sg_str);
zlog_debug("%s(%s): RP is not configured yet for %s",
__func__, caller, up->sg_str);
return PIM_RPF_OK;
}
@ -238,8 +239,8 @@ enum pim_rpf_result pim_rpf_update(struct pim_instance *pim,
rpf->rpf_addr.u.prefix4 = pim_rpf_find_rpf_addr(up);
if (pim_rpf_addr_is_inaddr_any(rpf) && PIM_DEBUG_ZEBRA) {
/* RPF'(S,G) not found */
zlog_debug("%s %s: RPF'%s not found: won't send join upstream",
__FILE__, __PRETTY_FUNCTION__, up->sg_str);
zlog_debug("%s(%s): RPF'%s not found: won't send join upstream",
__func__, caller, up->sg_str);
/* warning only */
}
@ -251,8 +252,8 @@ enum pim_rpf_result pim_rpf_update(struct pim_instance *pim,
pim_addr_dump("<addr?>",
&rpf->source_nexthop.mrib_nexthop_addr,
nhaddr_str, sizeof(nhaddr_str));
zlog_debug("%s %s: (S,G)=%s source nexthop now is: interface=%s address=%s pref=%d metric=%d",
__FILE__, __PRETTY_FUNCTION__,
zlog_debug("%s(%s): (S,G)=%s source nexthop now is: interface=%s address=%s pref=%d metric=%d",
__func__, caller,
up->sg_str,
rpf->source_nexthop.interface ? rpf->source_nexthop.interface->name : "<ifname?>",
nhaddr_str,
@ -269,8 +270,8 @@ enum pim_rpf_result pim_rpf_update(struct pim_instance *pim,
if (saved.source_nexthop.interface != rpf->source_nexthop.interface) {
if (PIM_DEBUG_ZEBRA) {
zlog_debug("%s %s: (S,G)=%s RPF_interface(S) changed from %s to %s",
__FILE__, __PRETTY_FUNCTION__,
zlog_debug("%s(%s): (S,G)=%s RPF_interface(S) changed from %s to %s",
__func__, caller,
up->sg_str,
saved.source_nexthop.interface ? saved.source_nexthop.interface->name : "<oldif?>",
rpf->source_nexthop.interface ? rpf->source_nexthop.interface->name : "<newif?>");

View File

@ -63,7 +63,7 @@ bool pim_nexthop_lookup(struct pim_instance *pim, struct pim_nexthop *nexthop,
struct in_addr addr, int neighbor_needed);
enum pim_rpf_result pim_rpf_update(struct pim_instance *pim,
struct pim_upstream *up,
struct pim_rpf *old);
struct pim_rpf *old, const char *caller);
void pim_upstream_rpf_clear(struct pim_instance *pim,
struct pim_upstream *up);
int pim_rpf_addr_is_inaddr_none(struct pim_rpf *rpf);

View File

@ -845,7 +845,7 @@ static struct pim_upstream *pim_upstream_new(struct pim_instance *pim,
pim_upstream_keep_alive_timer_start(
up, pim->keep_alive_time);
} else if (up->upstream_addr.s_addr != INADDR_ANY) {
rpf_result = pim_rpf_update(pim, up, NULL);
rpf_result = pim_rpf_update(pim, up, NULL, __func__);
if (rpf_result == PIM_RPF_FAILURE) {
if (PIM_DEBUG_PIM_TRACE)
zlog_debug(
@ -1768,7 +1768,7 @@ void pim_upstream_find_new_rpf(struct pim_instance *pim)
zlog_debug(
"%s: Upstream %s without a path to send join, checking",
__PRETTY_FUNCTION__, up->sg_str);
pim_rpf_update(pim, up, NULL);
pim_rpf_update(pim, up, NULL, __func__);
}
}
}

View File

@ -245,7 +245,7 @@ static void pim_vxlan_orig_mr_up_del(struct pim_vxlan_sg *vxlan_sg)
* for nht
*/
if (up)
pim_rpf_update(vxlan_sg->pim, up, NULL);
pim_rpf_update(vxlan_sg->pim, up, NULL, __func__);
}
}