zebra: Add some basic flags to the zebra nexthop group

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>
This commit is contained in:
Donald Sharp 2019-01-23 21:32:49 -05:00 committed by Stephen Worley
parent 21be136402
commit c8ee3cdb39
2 changed files with 20 additions and 2 deletions

View 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);

View 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, " ");