Skip to content

Commit

Permalink
Logging enhancement
Browse files Browse the repository at this point in the history
  • Loading branch information
anish-n committed Dec 14, 2020
1 parent 44065d1 commit 9a586c6
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion orchagent/fgnhgorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,9 @@ bool FgNhgOrch::validNextHopInNextHopGroup(const NextHopKey& nexthop)
}

m_neighOrch->increaseNextHopRefCount(nexthop);

SWSS_LOG_INFO("FG nh %s for prefix %s is up",
nexthop.to_string().c_str(), route_table.first.to_string().c_str());
}
}

Expand Down Expand Up @@ -455,6 +458,9 @@ bool FgNhgOrch::invalidNextHopInNextHopGroup(const NextHopKey& nexthop)
}

m_neighOrch->decreaseNextHopRefCount(nexthop);

SWSS_LOG_INFO("FG nh %s for prefix %s is down",
nexthop.to_string().c_str(), route_table.first.to_string().c_str());
}
}

Expand Down Expand Up @@ -730,7 +736,8 @@ bool FgNhgOrch::setInactiveBankToNextAvailableActiveBank(FGNextHopGroupEntry *sy

if (new_bank_idx == bank_member_changes.size())
{
SWSS_LOG_NOTICE("No active next-hop members were found in any bank");
SWSS_LOG_NOTICE("All banks of FG next-hops are down for prefix %s",
ipPrefix.to_string().c_str());
/* Case where there are no active banks */
/* Note: There is no way to set a NULL OID to the now inactive next-hops
* so we leave the next-hops as is in SAI, and future route/neighbor changes
Expand Down Expand Up @@ -780,6 +787,9 @@ bool FgNhgOrch::setInactiveBankHashBucketChanges(FGNextHopGroupEntry *syncd_fg_r
syncd_fg_route_entry->active_nexthops.insert(bank_nh_memb);
}
syncd_fg_route_entry->inactive_to_active_map[bank] = bank;

SWSS_LOG_NOTICE("Bank# %d of FG next-hops is up for prefix %s",
bank, ipPrefix.to_string().c_str());
}
else if (bank_member_changes[bank].nhs_to_del.size() > 0)
{
Expand All @@ -795,6 +805,9 @@ bool FgNhgOrch::setInactiveBankHashBucketChanges(FGNextHopGroupEntry *syncd_fg_r
{
syncd_fg_route_entry->active_nexthops.erase(memb);
}

SWSS_LOG_NOTICE("Bank# %d of FG next-hops is down for prefix %s", bank,
ipPrefix.to_string().c_str());
}
else
{
Expand Down Expand Up @@ -889,6 +902,8 @@ bool FgNhgOrch::setNewNhgMembers(FGNextHopGroupEntry &syncd_fg_route_entry, FgNh
break;
}
}
SWSS_LOG_NOTICE("Bank# %d of FG next-hops is down for prefix %s",
i, ipPrefix.to_string().c_str());
}

if (bank_member_changes[bank].nhs_to_add.size() == 0)
Expand Down Expand Up @@ -1107,11 +1122,15 @@ bool FgNhgOrch::addRoute(sai_object_id_t vrf_id, const IpPrefix &ipPrefix, const
for (auto nh : bank_member_changes[bank_idx].nhs_to_add)
{
m_neighOrch->increaseNextHopRefCount(nh);
SWSS_LOG_INFO("FG nh %s for prefix %s is up",
nh.to_string().c_str(), ipPrefix.to_string().c_str());
}

for (auto nh : bank_member_changes[bank_idx].nhs_to_del)
{
m_neighOrch->decreaseNextHopRefCount(nh);
SWSS_LOG_INFO("FG nh %s for prefix %s is down",
nh.to_string().c_str(), ipPrefix.to_string().c_str());
}
}

Expand Down Expand Up @@ -1184,6 +1203,9 @@ bool FgNhgOrch::removeRoute(sai_object_id_t vrf_id, const IpPrefix &ipPrefix)
m_syncdFGRouteTables.erase(vrf_id);
m_vrfOrch->decreaseVrfRefCount(vrf_id);
}
SWSS_LOG_NOTICE("All banks of FG next-hops are down for prefix %s",
ipPrefix.to_string().c_str());

return true;
}

Expand Down

0 comments on commit 9a586c6

Please sign in to comment.