diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-02-15 03:32:16 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-03-02 14:13:03 +0100 |
commit | 982bff8972e0b387a1c3e466d584d2880175a5e3 (patch) | |
tree | f1fe009e73fd377006bbebb2ff7b279c6ba0d7ff /pimd/pim_neighbor.c | |
parent | pimd: Track oil list totals a bit better. (diff) | |
download | frr-982bff8972e0b387a1c3e466d584d2880175a5e3.tar.xz frr-982bff8972e0b387a1c3e466d584d2880175a5e3.zip |
pimd: Join/Prune Aggregation
Add the ability for PIM to send Join/Prunes as an
aggregated message instead of individual messages
for each S,G.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_neighbor.c')
-rw-r--r-- | pimd/pim_neighbor.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/pimd/pim_neighbor.c b/pimd/pim_neighbor.c index 346b91115..c1325df26 100644 --- a/pimd/pim_neighbor.c +++ b/pimd/pim_neighbor.c @@ -37,6 +37,8 @@ #include "pim_ifchannel.h" #include "pim_rp.h" #include "pim_zebra.h" +#include "pim_join.h" +#include "pim_jp_agg.h" static void dr_election_by_addr(struct interface *ifp) { @@ -265,6 +267,41 @@ void pim_neighbor_timer_reset(struct pim_neighbor *neigh, uint16_t holdtime) neigh, neigh->holdtime); } +static int +on_neighbor_jp_timer (struct thread *t) +{ + struct pim_neighbor *neigh = THREAD_ARG(t); + struct pim_rpf rpf; + + if (PIM_DEBUG_PIM_TRACE) + { + char src_str[INET_ADDRSTRLEN]; + pim_inet4_dump("<src?>", neigh->source_addr, src_str, sizeof(src_str)); + zlog_debug("%s:Sending JP Agg to %s on %s with %d groups", __PRETTY_FUNCTION__, + src_str, neigh->interface->name, neigh->upstream_jp_agg->count); + } + neigh->jp_timer = NULL; + + rpf.source_nexthop.interface = neigh->interface; + rpf.rpf_addr.u.prefix4 = neigh->source_addr; + pim_joinprune_send(&rpf, neigh->upstream_jp_agg); + + THREAD_TIMER_ON(master, neigh->jp_timer, + on_neighbor_jp_timer, + neigh, qpim_t_periodic); + + return 0; +} + +static void +pim_neighbor_start_jp_timer (struct pim_neighbor *neigh) +{ + THREAD_TIMER_OFF(neigh->jp_timer); + THREAD_TIMER_ON(master, neigh->jp_timer, + on_neighbor_jp_timer, + neigh, qpim_t_periodic); +} + static struct pim_neighbor *pim_neighbor_new(struct interface *ifp, struct in_addr source_addr, pim_hello_options hello_options, @@ -301,6 +338,11 @@ static struct pim_neighbor *pim_neighbor_new(struct interface *ifp, neigh->t_expire_timer = NULL; neigh->interface = ifp; + neigh->upstream_jp_agg = list_new(); + neigh->upstream_jp_agg->cmp = pim_jp_agg_group_list_cmp; + neigh->upstream_jp_agg->del = (void (*)(void *))pim_jp_agg_group_list_free; + pim_neighbor_start_jp_timer(neigh); + pim_neighbor_timer_reset(neigh, holdtime); /* * The pim_ifstat_hello_sent variable is used to decide if @@ -375,6 +417,9 @@ void pim_neighbor_free(struct pim_neighbor *neigh) delete_prefix_list(neigh); + list_delete(neigh->upstream_jp_agg); + THREAD_OFF(neigh->jp_timer); + XFREE(MTYPE_PIM_NEIGHBOR, neigh); } |