]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Remove repeated enqueueing of system routes for rethinking
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 29 Jul 2019 15:36:03 +0000 (11:36 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 29 Jul 2019 15:39:06 +0000 (11:39 -0400)
The code as written before this code change point would enqueue
every system route type to be refigured when we have an
interface event.  I believe this was to originally handle bugs
in the way nexthop tracking was handled, mainly that if you keep
asking the question you'll eventually get the right answer.

Modify the code to not do this, we have fixed nexthop tracking
to not be so brain dead and to know when it needs to refigure
a route that it is tracking.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/connected.c
zebra/interface.c
zebra/rib.h
zebra/zebra_rib.c

index bba221c2cf13dbc0204ba06dbc09d280efb8e8f0..4101a4bf2430647313e7d1cee6ef9a0e42315057 100644 (file)
@@ -260,16 +260,6 @@ void connected_up(struct interface *ifp, struct connected *ifc)
        rib_add(afi, SAFI_MULTICAST, zvrf->vrf->vrf_id, ZEBRA_ROUTE_CONNECT,
                0, 0, &p, NULL, &nh, zvrf->table_id, metric, 0, 0, 0);
 
-       if (IS_ZEBRA_DEBUG_RIB_DETAILED) {
-               char buf[PREFIX_STRLEN];
-
-               zlog_debug(
-                       "%u: IF %s address %s add/up, scheduling RIB processing",
-                       ifp->vrf_id, ifp->name,
-                       prefix2str(&p, buf, sizeof(buf)));
-       }
-       rib_update(zvrf->vrf->vrf_id, RIB_UPDATE_IF_CHANGE);
-
        /* Schedule LSP forwarding entries for processing, if appropriate. */
        if (zvrf->vrf->vrf_id == VRF_DEFAULT) {
                if (IS_ZEBRA_DEBUG_MPLS) {
@@ -433,17 +423,6 @@ void connected_down(struct interface *ifp, struct connected *ifc)
        rib_delete(afi, SAFI_MULTICAST, zvrf->vrf->vrf_id, ZEBRA_ROUTE_CONNECT,
                   0, 0, &p, NULL, &nh, zvrf->table_id, 0, 0, false);
 
-       if (IS_ZEBRA_DEBUG_RIB_DETAILED) {
-               char buf[PREFIX_STRLEN];
-
-               zlog_debug(
-                       "%u: IF %s IP %s address down, scheduling RIB processing",
-                       zvrf->vrf->vrf_id, ifp->name,
-                       prefix2str(&p, buf, sizeof(buf)));
-       }
-
-       rib_update(zvrf->vrf->vrf_id, RIB_UPDATE_IF_CHANGE);
-
        /* Schedule LSP forwarding entries for processing, if appropriate. */
        if (zvrf->vrf->vrf_id == VRF_DEFAULT) {
                if (IS_ZEBRA_DEBUG_MPLS) {
@@ -468,16 +447,6 @@ static void connected_delete_helper(struct connected *ifc, struct prefix *p)
 
        connected_withdraw(ifc);
 
-       if (IS_ZEBRA_DEBUG_RIB_DETAILED) {
-               char buf[PREFIX_STRLEN];
-
-               zlog_debug(
-                       "%u: IF %s IP %s address del, scheduling RIB processing",
-                       ifp->vrf_id, ifp->name,
-                       prefix2str(p, buf, sizeof(buf)));
-       }
-       rib_update(ifp->vrf_id, RIB_UPDATE_IF_CHANGE);
-
        /* Schedule LSP forwarding entries for processing, if appropriate. */
        if (ifp->vrf_id == VRF_DEFAULT) {
                if (IS_ZEBRA_DEBUG_MPLS) {
index 4eec435f1cc7eb483a476d25cca057de8393744f..732e900bbdee9280f17d7c76ba86b524f8666ccd 100644 (file)
@@ -799,15 +799,6 @@ void if_handle_vrf_change(struct interface *ifp, vrf_id_t vrf_id)
        /* Install connected routes (in new VRF). */
        if (if_is_operative(ifp))
                if_install_connected(ifp);
-
-       /* Due to connected route change, schedule RIB processing for both old
-        * and new VRF.
-        */
-       if (IS_ZEBRA_DEBUG_RIB_DETAILED)
-               zlog_debug("%u: IF %s VRF change, scheduling RIB processing",
-                          ifp->vrf_id, ifp->name);
-       rib_update(old_vrf_id, RIB_UPDATE_IF_CHANGE);
-       rib_update(ifp->vrf_id, RIB_UPDATE_IF_CHANGE);
 }
 
 static void ipv6_ll_address_to_mac(struct in6_addr *address, uint8_t *mac)
@@ -950,11 +941,6 @@ void if_up(struct interface *ifp)
        /* Install connected routes to the kernel. */
        if_install_connected(ifp);
 
-       if (IS_ZEBRA_DEBUG_RIB_DETAILED)
-               zlog_debug("%u: IF %s up, scheduling RIB processing",
-                          ifp->vrf_id, ifp->name);
-       rib_update(ifp->vrf_id, RIB_UPDATE_IF_CHANGE);
-
        /* Handle interface up for specific types for EVPN. Non-VxLAN interfaces
         * are checked to see if (remote) neighbor entries need to be installed
         * on them for ARP suppression.
@@ -1008,11 +994,6 @@ void if_down(struct interface *ifp)
        /* Uninstall connected routes from the kernel. */
        if_uninstall_connected(ifp);
 
-       if (IS_ZEBRA_DEBUG_RIB_DETAILED)
-               zlog_debug("%u: IF %s down, scheduling RIB processing",
-                          ifp->vrf_id, ifp->name);
-       rib_update(ifp->vrf_id, RIB_UPDATE_IF_CHANGE);
-
        if_nbr_ipv6ll_to_ipv4ll_neigh_del_all(ifp);
 
        /* Delete all neighbor addresses learnt through IPv6 RA */
index 9d8cee8bf787a43631144bbb48e9ad0b6c30a2c6..181286a904947eff0613a53282c2f4a579787576 100644 (file)
@@ -303,7 +303,6 @@ typedef struct rib_tables_iter_t_ {
 
 /* Events/reasons triggering a RIB update. */
 typedef enum {
-       RIB_UPDATE_IF_CHANGE,
        RIB_UPDATE_RMAP_CHANGE,
        RIB_UPDATE_OTHER
 } rib_update_event_t;
index afe59b95933483f081ed831abf76203b6e5d078b..5dcf21f561fccd2c89b1152c563748634cd4940b 100644 (file)
@@ -2967,50 +2967,6 @@ void rib_update_table(struct route_table *table, rib_update_event_t event)
                                           RIB_ROUTE_ANY_QUEUED))
                        continue;
                switch (event) {
-               case RIB_UPDATE_IF_CHANGE:
-                       /* Examine all routes that won't get processed by the
-                        * protocol or
-                        * triggered by nexthop evaluation (NHT). This would be
-                        * system,
-                        * kernel and certain static routes. Note that NHT will
-                        * get
-                        * triggered upon an interface event as connected routes
-                        * always
-                        * get queued for processing.
-                        */
-                       RNODE_FOREACH_RE_SAFE (rn, re, next) {
-                               struct nexthop *nh;
-
-                               if (re->type != ZEBRA_ROUTE_SYSTEM
-                                   && re->type != ZEBRA_ROUTE_KERNEL
-                                   && re->type != ZEBRA_ROUTE_CONNECT
-                                   && re->type != ZEBRA_ROUTE_STATIC)
-                                       continue;
-
-                               if (re->type != ZEBRA_ROUTE_STATIC) {
-                                       SET_FLAG(re->status,
-                                                ROUTE_ENTRY_CHANGED);
-                                       rib_queue_add(rn);
-                                       continue;
-                               }
-
-                               for (nh = re->ng.nexthop; nh; nh = nh->next)
-                                       if (!(nh->type == NEXTHOP_TYPE_IPV4
-                                             || nh->type == NEXTHOP_TYPE_IPV6))
-                                               break;
-
-                               /* If we only have nexthops to a
-                                * gateway, NHT will
-                                * take care.
-                                */
-                               if (nh) {
-                                       SET_FLAG(re->status,
-                                                ROUTE_ENTRY_CHANGED);
-                                       rib_queue_add(rn);
-                               }
-                       }
-                       break;
-
                case RIB_UPDATE_RMAP_CHANGE:
                case RIB_UPDATE_OTHER:
                        /* Right now, examine all routes. Can restrict to a