]> git.puffer.fish Git - mirror/frr.git/commitdiff
pim-nexthop: mroute and pim-upstream rpf are falling out of sync.
authoranuradhak <anuradhak@cumulusnetworks.com>
Mon, 28 Nov 2016 18:12:21 +0000 (10:12 -0800)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:17 +0000 (20:26 -0500)
Currently the mroute-IIF and upstream RPF-IIF/neigh are resolved separately.
This must change i.e. be merged together for a couple of reasons -
1. In the case of ECMP we will use a load-share mechanism (based on G or
SG) to pick an RPF neighbor in 3.2.1 (to use the load-sharing cap of
anycast-RP). Using a different resolution mechanism for mroute-IIF will
simply not work.
2. In a non-CLOS topology it is actually possible to have routers that
do not participate in PIM. In this case the tree will be set up using
different routers than the ones chosen for the mroute IIF. And traffic
will not be forwarded.

This change is however too big for 3.2.0. So to handle CM-13714 I have
simply forced rpf update on neigh add which fixes the specific problem
seen on link flap in a clos (it is not very efficient but traffic
recovers).
In problem state -
(jessie-30-dev-switch-amd64-sbuild)root@spine-1:/home/cumulus# ip mr
(0.0.0.0, 225.1.1.1)             Iif: lo         Oifs: swp3 lo
(20.0.11.253, 225.1.1.1)         Iif: swp1       Oifs: swp3
(jessie-30-dev-switch-amd64-sbuild)root@spine-1:/home/cumulus# vtysh -c
"show ip pim upstream"
Iif       Source          Group           State       Uptime   JoinTimer
RSTimer   KATimer   RefCnt
lo        *               225.1.1.1       Joined      00:08:44 00:00:15
--:--:--  --:--:--       1
swp2      20.0.11.253     225.1.1.1       Joined      00:08:35 00:00:56
--:--:--  00:02:59       1
(jessie-30-dev-switch-amd64-sbuild)root@spine-1:/home/cumulus#

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_neighbor.c
pimd/pim_zebra.c
pimd/pim_zebra.h

index 1b58b9850279f3ab0cd001f250383933173fea67..a8a60f6f38e3ddc5452b2c31485632551067ced1 100644 (file)
@@ -37,6 +37,7 @@
 #include "pim_upstream.h"
 #include "pim_ifchannel.h"
 #include "pim_rp.h"
+#include "pim_zebra.h"
 
 static void dr_election_by_addr(struct interface *ifp)
 {
@@ -421,6 +422,18 @@ pim_neighbor_find_if (struct interface *ifp)
   return listnode_head (pim_ifp->pim_neighbor_list);
 }
 
+/* rpf info associated with an upstream entry needs to be re-evaluated
+ * when an RPF neighbor comes or goes */
+static void
+pim_neighbor_rpf_update(void)
+{
+  /* XXX: for the time being piggyback on the timer used on rib changes
+   * to scan and update the rpf nexthop. This is expensive processing
+   * and we should be able to optimize neighbor changes differently than
+   * nexthop changes. */
+  sched_rpf_cache_refresh();
+}
+
 struct pim_neighbor *pim_neighbor_add(struct interface *ifp,
                                      struct in_addr source_addr,
                                      pim_hello_options hello_options,
@@ -483,6 +496,8 @@ struct pim_neighbor *pim_neighbor_add(struct interface *ifp,
   pim_upstream_find_new_rpf();
 
   pim_rp_setup ();
+
+  pim_neighbor_rpf_update();
   return neigh;
 }
 
@@ -595,6 +610,8 @@ void pim_neighbor_delete(struct interface *ifp,
   listnode_delete(pim_ifp->pim_neighbor_list, neigh);
 
   pim_neighbor_free(neigh);
+
+  pim_neighbor_rpf_update();
 }
 
 void pim_neighbor_delete_all(struct interface *ifp,
index 294d8bba25a422b4d033b81829afd921c6daa31b..9239f875c458b118e178fd2d40c43cde0b349b7e 100644 (file)
@@ -545,7 +545,7 @@ static int on_rpf_cache_refresh(struct thread *t)
   return 0;
 }
 
-static void sched_rpf_cache_refresh()
+void sched_rpf_cache_refresh(void)
 {
   ++qpim_rpf_cache_refresh_requests;
 
index ae79ed815a3cf10500b63a12bf3839275c823c59..767cdf054122b5d06ccbd4ea7196e5f06ad2aa1a 100644 (file)
@@ -39,4 +39,5 @@ void igmp_source_forward_stop(struct igmp_source *source);
 void pim_forward_start(struct pim_ifchannel *ch);
 void pim_forward_stop(struct pim_ifchannel *ch);
 
+void sched_rpf_cache_refresh(void);
 #endif /* PIM_ZEBRA_H */