Skip to content

Commit

Permalink
pimd: add MSDP statistic counters
Browse files Browse the repository at this point in the history
Allow MSDP peers to hold the following new information:
- Amount of RPF look up failures
- Amount of incoming SAs filtered
- Amount of outgoing SAs filtered

Signed-off-by: Rafael Zalamena <[email protected]>
  • Loading branch information
rzalamena committed Dec 23, 2024
1 parent a8817e0 commit 08d8964
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pimd/pim_msdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,8 @@ bool pim_msdp_peer_rpf_check(struct pim_msdp_peer *mp, struct in_addr rp)
if (pim_msdp_log_sa_events(mp->pim))
zlog_info("MSDP peer %pI4 RPF failure for %pI4", &mp->peer, &rp);

mp->rpf_lookup_failure_count++;

return false;
}

Expand Down
8 changes: 8 additions & 0 deletions pimd/pim_msdp.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,18 @@ struct pim_msdp_peer {
/* timestamps */
int64_t uptime;

/** RPF lookup failures count. */
uint32_t rpf_lookup_failure_count;

/** SA input access list name. */
char *acl_in;
/** Number of input filtered SAs. */
uint32_t acl_in_count;

/** SA output access list name. */
char *acl_out;
/** Number of output filtered SAs. */
uint32_t acl_out_count;

/** SA maximum amount. */
uint32_t sa_limit;
Expand Down
5 changes: 5 additions & 0 deletions pimd/pim_msdp_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ static void pim_msdp_pkt_sa_gen(struct pim_instance *pim,
if (pim_msdp_log_sa_events(pim))
zlog_info("MSDP peer %pI4 filter SA out %s", &mp->peer, sa->sg_str);

mp->acl_out_count++;
continue;
}

Expand Down Expand Up @@ -498,6 +499,7 @@ void pim_msdp_pkt_sa_tx_one(struct pim_msdp_sa *sa)
if (pim_msdp_log_sa_events(sa->pim))
zlog_info("MSDP peer %pI4 filter SA out %s", &mp->peer, sa->sg_str);

mp->acl_out_count++;
continue;
}

Expand Down Expand Up @@ -531,6 +533,7 @@ void pim_msdp_pkt_sa_tx_one_to_one_peer(struct pim_msdp_peer *mp,
zlog_info("MSDP peer %pI4 filter SA out (%pI4, %pI4)", &mp->peer,
&sa.sg.src, &sa.sg.grp);

mp->acl_out_count++;
return;
}

Expand Down Expand Up @@ -590,6 +593,8 @@ static void pim_msdp_pkt_sa_rx_one(struct pim_msdp_peer *mp, struct in_addr rp)
if (pim_msdp_log_sa_events(mp->pim))
zlog_info("MSDP peer %pI4 filter SA in (%pI4, %pI4)", &mp->peer,
&sg.src, &sg.grp);

mp->acl_in_count++;
return;
}
}
Expand Down

0 comments on commit 08d8964

Please sign in to comment.