Skip to content

Commit

Permalink
Merge pull request #15130 from donaldsharp/pim_vxlan_issues
Browse files Browse the repository at this point in the history
Pim vxlan issues
  • Loading branch information
ton31337 authored Jan 12, 2024
2 parents d2c275a + 8e85c8b commit ef85d4f
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 8 deletions.
6 changes: 3 additions & 3 deletions pimd/pim_join.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static void recv_join(struct interface *ifp, struct pim_neighbor *neigh,
{
struct pim_interface *pim_ifp = NULL;

if (PIM_DEBUG_PIM_TRACE)
if (PIM_DEBUG_PIM_J_P)
zlog_debug(
"%s: join (S,G)=%pSG rpt=%d wc=%d upstream=%pPAs holdtime=%d from %pPA on %s",
__func__, sg, !!(source_flags & PIM_RPT_BIT_MASK),
Expand Down Expand Up @@ -115,7 +115,7 @@ static void recv_prune(struct interface *ifp, struct pim_neighbor *neigh,
{
struct pim_interface *pim_ifp = NULL;

if (PIM_DEBUG_PIM_TRACE)
if (PIM_DEBUG_PIM_J_P)
zlog_debug(
"%s: prune (S,G)=%pSG rpt=%d wc=%d upstream=%pPAs holdtime=%d from %pPA on %s",
__func__, sg, source_flags & PIM_RPT_BIT_MASK,
Expand Down Expand Up @@ -147,7 +147,7 @@ static void recv_prune(struct interface *ifp, struct pim_neighbor *neigh,
* Received Prune(*,G) messages are processed even if the
* RP in the message does not match RP(G).
*/
if (PIM_DEBUG_PIM_TRACE)
if (PIM_DEBUG_PIM_J_P)
zlog_debug("%s: Prune received with RP(%pPAs) for %pSG",
__func__, &sg->src, sg);

Expand Down
2 changes: 1 addition & 1 deletion pimd/pim_rp.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ struct rp_info *pim_rp_find_match_group(struct pim_instance *pim,
}

rp_info = rn->info;
if (PIM_DEBUG_PIM_TRACE) {
if (PIM_DEBUG_PIM_TRACE_DETAIL) {
if (best)
zlog_debug(
"Lookedup(%pFX): prefix_list match %s, rn %p found: %pFX",
Expand Down
2 changes: 1 addition & 1 deletion pimd/pim_rpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static pim_addr pim_rpf_find_rpf_addr(struct pim_upstream *up);
void pim_rpf_set_refresh_time(struct pim_instance *pim)
{
pim->last_route_change_time = pim_time_monotonic_usec();
if (PIM_DEBUG_PIM_TRACE)
if (PIM_DEBUG_PIM_TRACE_DETAIL)
zlog_debug("%s: vrf(%s) New last route change time: %" PRId64,
__func__, pim->vrf->name,
pim->last_route_change_time);
Expand Down
46 changes: 43 additions & 3 deletions pimd/pim_vxlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,30 @@ static void pim_vxlan_work_timer_setup(bool start);
static void pim_vxlan_set_peerlink_rif(struct pim_instance *pim,
struct interface *ifp);

#define PIM_VXLAN_STARTUP_NULL_REGISTERS 10

static void pim_vxlan_rp_send_null_register_startup(struct event *e)
{
struct pim_vxlan_sg *vxlan_sg = EVENT_ARG(e);

vxlan_sg->null_register_sent++;

if (vxlan_sg->null_register_sent > PIM_VXLAN_STARTUP_NULL_REGISTERS) {
if (PIM_DEBUG_VXLAN)
zlog_debug("Null registering stopping for %s",
vxlan_sg->sg_str);
return;
}

pim_null_register_send(vxlan_sg->up);

if (PIM_DEBUG_VXLAN)
zlog_debug("Sent null register for %s", vxlan_sg->sg_str);

event_add_timer(router->master, pim_vxlan_rp_send_null_register_startup,
vxlan_sg, PIM_VXLAN_WORK_TIME, &vxlan_sg->null_register);
}

/*
* The rp info has gone from no path to having a
* path. Let's immediately send out the null pim register
Expand Down Expand Up @@ -61,8 +85,13 @@ void pim_vxlan_rp_info_is_alive(struct pim_instance *pim,
* If the rp is the same we should send
*/
if (rpg == rpg_changed) {
zlog_debug("VXLAN RP INFO is alive sending");
pim_null_register_send(vxlan_sg->up);
if (PIM_DEBUG_VXLAN)
zlog_debug("VXLAN RP info for %s alive sending",
vxlan_sg->sg_str);
vxlan_sg->null_register_sent = 0;
event_add_event(router->master,
pim_vxlan_rp_send_null_register_startup,
vxlan_sg, 0, &vxlan_sg->null_register);
}
}
}
Expand Down Expand Up @@ -201,8 +230,18 @@ void pim_vxlan_update_sg_reg_state(struct pim_instance *pim,
*/
if (reg_join)
pim_vxlan_add_work(vxlan_sg);
else
else {
/*
* Stop the event that is sending NULL Registers on startup
* there is no need to keep spamming it
*/
if (PIM_DEBUG_VXLAN)
zlog_debug("Received Register stop for %s",
vxlan_sg->sg_str);

EVENT_OFF(vxlan_sg->null_register);
pim_vxlan_del_work(vxlan_sg);
}
}

static void pim_vxlan_work_timer_cb(struct event *t)
Expand Down Expand Up @@ -804,6 +843,7 @@ static void pim_vxlan_sg_del_item(struct pim_vxlan_sg *vxlan_sg)
{
vxlan_sg->flags |= PIM_VXLAN_SGF_DEL_IN_PROG;

EVENT_OFF(vxlan_sg->null_register);
pim_vxlan_del_work(vxlan_sg);

if (pim_vxlan_is_orig_mroute(vxlan_sg))
Expand Down
3 changes: 3 additions & 0 deletions pimd/pim_vxlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ struct pim_vxlan_sg {
struct interface *iif;
/* on a MLAG setup the peerlink is added as a static OIF */
struct interface *orig_oif;

struct event *null_register;
uint32_t null_register_sent;
};

enum pim_vxlan_mlag_flags {
Expand Down

0 comments on commit ef85d4f

Please sign in to comment.