]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: provide an api to force stop kat on an upstream entry
authorAnuradha Karuppiah <anuradhak@cumulusnetworks.com>
Thu, 21 Mar 2019 17:00:54 +0000 (10:00 -0700)
committerAnuradha Karuppiah <anuradhak@cumulusnetworks.com>
Sat, 20 Apr 2019 15:33:21 +0000 (08:33 -0700)
In the case of pim vxlan we create and keep upstream entries alive
in the abscence of traffic. So we need a mechanism to purge entries
abruptly on vxlan SG delete without having to wait for the entry
to age out.

These are again just the infrastructure changes needed for it.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
pimd/pim_upstream.c
pimd/pim_upstream.h

index eb4f1a5ca76272489af23269c2be67e42f20e0f8..85f58555eba8fd021d23220f56ad18a834389279 100644 (file)
@@ -1117,12 +1117,11 @@ static void pim_upstream_fhr_kat_start(struct pim_upstream *up)
  * KAT expiry indicates that flow is inactive. If the flow was created or
  * maintained by activity now is the time to deref it.
  */
-static int pim_upstream_keep_alive_timer(struct thread *t)
+struct pim_upstream *pim_upstream_keep_alive_timer_proc(
+               struct pim_upstream *up)
 {
-       struct pim_upstream *up;
        struct pim_instance *pim;
 
-       up = THREAD_ARG(t);
        pim = up->channel_oil->pim;
 
        if (PIM_UPSTREAM_FLAG_TEST_DISABLE_KAT_EXPIRY(up->flags)) {
@@ -1130,7 +1129,7 @@ static int pim_upstream_keep_alive_timer(struct thread *t)
                 * of KAT as the mroute is pre-setup without any traffic
                 */
                pim_upstream_keep_alive_timer_start(up, pim->keep_alive_time);
-               return 0;
+               return up;
        }
 
        if (I_am_RP(pim, up->sg.grp)) {
@@ -1152,12 +1151,12 @@ static int pim_upstream_keep_alive_timer(struct thread *t)
                                "kat expired on %s[%s]; remove stream reference",
                                up->sg_str, pim->vrf->name);
                PIM_UPSTREAM_FLAG_UNSET_SRC_STREAM(up->flags);
-               pim_upstream_del(pim, up, __PRETTY_FUNCTION__);
+               up = pim_upstream_del(pim, up, __PRETTY_FUNCTION__);
        } else if (PIM_UPSTREAM_FLAG_TEST_SRC_LHR(up->flags)) {
                struct pim_upstream *parent = up->parent;
 
                PIM_UPSTREAM_FLAG_UNSET_SRC_LHR(up->flags);
-               pim_upstream_del(pim, up, __PRETTY_FUNCTION__);
+               up = pim_upstream_del(pim, up, __PRETTY_FUNCTION__);
 
                if (parent) {
                        pim_jp_agg_single_upstream_send(&parent->rpf, parent,
@@ -1165,6 +1164,15 @@ static int pim_upstream_keep_alive_timer(struct thread *t)
                }
        }
 
+       return up;
+}
+static int pim_upstream_keep_alive_timer(struct thread *t)
+{
+       struct pim_upstream *up;
+
+       up = THREAD_ARG(t);
+
+       pim_upstream_keep_alive_timer_proc(up);
        return 0;
 }
 
index 1e769a62d973af64b3ea3c50ce59c0c0c4a94523..5eb230a76331ccc5e42777e7a8ca059d35e7700e 100644 (file)
@@ -254,4 +254,6 @@ void pim_upstream_spt_prefix_list_update(struct pim_instance *pim,
 
 unsigned int pim_upstream_hash_key(void *arg);
 bool pim_upstream_equal(const void *arg1, const void *arg2);
+struct pim_upstream *pim_upstream_keep_alive_timer_proc(
+               struct pim_upstream *up);
 #endif /* PIM_UPSTREAM_H */