]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Add some basic flags to the zebra nexthop group
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 24 Jan 2019 02:32:49 +0000 (21:32 -0500)
committerStephen Worley <sworley@cumulusnetworks.com>
Fri, 25 Oct 2019 15:13:35 +0000 (11:13 -0400)
We need to track if a nexthop group is valid and installed,
so create some basic flags to track this.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/zebra_nhg.h
zebra/zebra_vty.c

index 58f8e18b739c2eb1ec6bef414f1cec6d0bfbaac3..ce3d2ed6c37f5e0f6da2dcfd9e6f4e0fd4046f05 100644 (file)
@@ -36,6 +36,21 @@ struct nhg_hash_entry {
 
        uint32_t refcnt;
        uint32_t dplane_ref;
+
+       uint32_t flags;
+/*
+ * Is this nexthop group valid, ie all nexthops are fully resolved.
+ * What is fully resolved?  It's a nexthop that is either self contained
+ * and correct( ie no recursive pointer ) or a nexthop that is recursively
+ * resolved and correct.
+ */
+#define NEXTHOP_GROUP_VALID 0x1
+/*
+ * Has this nexthop group been installed?  At this point in time, this
+ * means that the data-plane has been told about this nexthop group
+ * and it's possible usage by a route entry.
+ */
+#define NEXTHOP_GROUP_INSTALLED 0x2
 };
 
 void zebra_nhg_init(void);
index 13a51ca831f4eb4e08d946b743344f5e54a2f2d2..d9e8c6f968612f0ed84a47130190d29014444d69 100644 (file)
@@ -1118,8 +1118,11 @@ static void show_nexthop_group_cmd_helper(struct vty *vty,
                if (nhe->vrf_id != zvrf->vrf->vrf_id)
                        continue;
 
-               vty_out(vty, "Group: %u RefCnt: %u afi: %d\n", nhe->dplane_ref,
-                       nhe->refcnt, nhe->afi);
+               vty_out(vty,
+                       "Group: %u RefCnt: %u afi: %d Valid: %d Installed: %d\n",
+                       nhe->dplane_ref, nhe->refcnt, nhe->afi,
+                       nhe->flags & NEXTHOP_GROUP_VALID,
+                       nhe->flags & NEXTHOP_GROUP_INSTALLED);
 
                for (ALL_NEXTHOPS(nhe->nhg, nhop)) {
                        vty_out(vty, "  ");