]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Add some debugs to note when we are not talking to zebra
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 5 Oct 2018 13:43:28 +0000 (09:43 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 31 Oct 2018 10:31:41 +0000 (06:31 -0400)
Allow some debug notification when we are unable to talk
to zebra due to the connection not being there yet.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd/bgp_evpn.c
bgpd/bgp_nht.c
bgpd/bgp_zebra.c
bgpd/bgpd.c

index 574ece8cc53b6ae7d21af6edb6c09b10abe96aab..c91a2ab6bd093b3f5fd5fae35a34ff1d4d3f0f0b 100644 (file)
@@ -558,9 +558,12 @@ static int bgp_zebra_send_remote_macip(struct bgp *bgp, struct bgpevpn *vpn,
                return 0;
 
        /* Don't try to register if Zebra doesn't know of this instance. */
-       if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp))
+       if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
+               if (BGP_DEBUG(zebra, ZEBRA))
+                       zlog_debug("%s: No zebra instance to talk to, not installing remote macip",
+                                  __PRETTY_FUNCTION__);
                return 0;
-
+       }
        s = zclient->obuf;
        stream_reset(s);
 
@@ -616,8 +619,12 @@ static int bgp_zebra_send_remote_vtep(struct bgp *bgp, struct bgpevpn *vpn,
                return 0;
 
        /* Don't try to register if Zebra doesn't know of this instance. */
-       if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp))
+       if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
+               if (BGP_DEBUG(zebra, ZEBRA))
+                       zlog_debug("%s: No zebra instance to talk to, not installing remote vtep",
+                                  __PRETTY_FUNCTION__);
                return 0;
+       }
 
        s = zclient->obuf;
        stream_reset(s);
index e764860bccdfb5e387c944fa5129508a5f4e2c8b..2e7f17fdaecebf5a023e9bb487493af74521ecf3 100644 (file)
@@ -587,8 +587,12 @@ static void sendmsg_zebra_rnh(struct bgp_nexthop_cache *bnc, int command)
                return;
 
        /* Don't try to register if Zebra doesn't know of this instance. */
-       if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bnc->bgp))
+       if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bnc->bgp)) {
+               if (BGP_DEBUG(zebra, ZEBRA))
+                       zlog_debug("%s: No zebra instance to talk to, not installing NHT entry",
+                                  __PRETTY_FUNCTION__);
                return;
+       }
 
        p = &(bnc->node->p);
        if ((command == ZEBRA_NEXTHOP_REGISTER
index 81a5be9d0cc5c3b76ab968631b2ac0792e7637cf..0b79a9ee18df30f1c1e370576bcb8d80fd2fe85a 100644 (file)
@@ -68,8 +68,11 @@ static inline int bgp_install_info_to_zebra(struct bgp *bgp)
        if (zclient->sock <= 0)
                return 0;
 
-       if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp))
+       if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
+               zlog_debug("%s: No zebra instance to talk to, not installing information",
+                          __PRETTY_FUNCTION__);
                return 0;
+       }
 
        return 1;
 }
@@ -1895,8 +1898,12 @@ int bgp_zebra_advertise_subnet(struct bgp *bgp, int advertise, vni_t vni)
                return 0;
 
        /* Don't try to register if Zebra doesn't know of this instance. */
-       if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp))
+       if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
+               if (BGP_DEBUG(zebra, ZEBRA))
+                       zlog_debug("%s: No zebra instance to talk to, cannot advertise subnet",
+                                  __PRETTY_FUNCTION__);
                return 0;
+       }
 
        s = zclient->obuf;
        stream_reset(s);
@@ -1918,8 +1925,12 @@ int bgp_zebra_advertise_gw_macip(struct bgp *bgp, int advertise, vni_t vni)
                return 0;
 
        /* Don't try to register if Zebra doesn't know of this instance. */
-       if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp))
+       if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
+               if (BGP_DEBUG(zebra, ZEBRA))
+                       zlog_debug("%s: No zebra instance to talk to, not installing gw_macip",
+                                  __PRETTY_FUNCTION__);
                return 0;
+       }
 
        s = zclient->obuf;
        stream_reset(s);
@@ -1942,8 +1953,12 @@ int bgp_zebra_vxlan_flood_control(struct bgp *bgp,
                return 0;
 
        /* Don't try to register if Zebra doesn't know of this instance. */
-       if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp))
+       if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
+               if (BGP_DEBUG(zebra, ZEBRA))
+                       zlog_debug("%s: No zebra instance to talk to, not installing all vni",
+                                  __PRETTY_FUNCTION__);
                return 0;
+       }
 
        s = zclient->obuf;
        stream_reset(s);
index be092e950116eae420682f7bca1d35d67cba4ad4..19384eec2f4571f7fc1a6d9cbdc10640f2d29c52 100644 (file)
@@ -3072,9 +3072,12 @@ int bgp_get(struct bgp **bgp_val, as_t *as, const char *name,
        bgp_handle_socket(bgp, vrf, VRF_UNKNOWN, true);
        listnode_add(bm->bgp, bgp);
 
-       if (IS_BGP_INST_KNOWN_TO_ZEBRA(bgp))
+       if (IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
+               if (BGP_DEBUG(zebra, ZEBRA))
+                       zlog_debug("%s: Registering BGP instance %s to zebra",
+                                  __PRETTY_FUNCTION__, name);
                bgp_zebra_instance_register(bgp);
-
+       }
 
        return 0;
 }
@@ -3218,8 +3221,12 @@ int bgp_delete(struct bgp *bgp)
        }
 
        /* Deregister from Zebra, if needed */
-       if (IS_BGP_INST_KNOWN_TO_ZEBRA(bgp))
+       if (IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
+               if (BGP_DEBUG(zebra, ZEBRA))
+                       zlog_debug("%s: deregistering this bgp %s instance from zebra",
+                                  __PRETTY_FUNCTION__, bgp->name);
                bgp_zebra_instance_deregister(bgp);
+       }
 
        /* Remove visibility via the master list - there may however still be
         * routes to be processed still referencing the struct bgp.