Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pimd: re-evaluated S,G OILs upon RP changes and empty SG upstream oils (backport #15327) #15345

Merged
merged 1 commit into from
Feb 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pimd/pim_mroute.c
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,7 @@ int pim_upstream_mroute_add(struct channel_oil *c_oil, const char *name)
return pim_upstream_mroute_update(c_oil, name);
}

/* Look for IIF changes and update the dateplane entry only if the IIF
/* Look for IIF changes and update the dataplane entry only if the IIF
* has changed.
*/
int pim_upstream_mroute_iif_update(struct channel_oil *c_oil, const char *name)
Expand Down
36 changes: 35 additions & 1 deletion pimd/pim_upstream.c
Original file line number Diff line number Diff line change
Expand Up @@ -1943,6 +1943,40 @@ void pim_upstream_terminate(struct pim_instance *pim)
wheel_delete(pim->upstream_sg_wheel);
pim->upstream_sg_wheel = NULL;
}
bool pim_sg_is_reevaluate_oil_req(struct pim_instance *pim,
struct pim_upstream *up)
{
struct pim_interface *pim_ifp = NULL;

/*
* Attempt to retrieve the PIM interface information if the RPF
* interface is present
*/
if (up->rpf.source_nexthop.interface) {
pim_ifp = up->rpf.source_nexthop.interface->info;
} else {
if (PIM_DEBUG_PIM_TRACE) {
zlog_debug("%s: up %s RPF is not present", __func__,
up->sg_str);
}
}

/*
* Determine if a reevaluation of the outgoing interface list (OIL) is
* required. This may be necessary in scenarios such as MSDP where the
* RP role for a group changes from secondary to primary. In such cases,
* SGRpt may receive a prune, resulting in an S,G entry with a NULL OIL.
* The S,G upstream should then inherit the OIL from *,G, which is
* particularly important for VXLAN setups.
*/
if (up->channel_oil->oil_inherited_rescan ||
(pim_ifp && I_am_RP(pim_ifp->pim, up->sg.grp)) ||
pim_upstream_empty_inherited_olist(up)) {
return true;
}

return false;
}

bool pim_upstream_equal(const void *arg1, const void *arg2)
{
Expand Down Expand Up @@ -2078,7 +2112,7 @@ static void pim_upstream_sg_running(void *arg)
* only doing this at this point in time
* to get us up and working for the moment
*/
if (up->channel_oil->oil_inherited_rescan) {
if (pim_sg_is_reevaluate_oil_req(pim, up)) {
if (PIM_DEBUG_TRACE)
zlog_debug(
"%s: Handling unscanned inherited_olist for %s[%s]",
Expand Down
2 changes: 2 additions & 0 deletions pimd/pim_upstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -383,4 +383,6 @@ uint32_t pim_up_mlag_local_cost(struct pim_upstream *up);
uint32_t pim_up_mlag_peer_cost(struct pim_upstream *up);
void pim_upstream_reeval_use_rpt(struct pim_instance *pim);
int pim_upstream_could_register(struct pim_upstream *up);
bool pim_sg_is_reevaluate_oil_req(struct pim_instance *pim,
struct pim_upstream *up);
#endif /* PIM_UPSTREAM_H */
Loading