diff options
author | Donald Sharp <sharpd@nvidia.com> | 2021-10-29 14:16:13 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2022-06-16 20:47:19 +0200 |
commit | 35729f38fa5713b923782ca9921c893bb8d3bc25 (patch) | |
tree | d3e5dc01ad463c7ceede2cacf5b53c0a130cbafb /zebra/zebra_vty.c | |
parent | zebra: Move where zebra marks a nhg as uninstalled in fib (diff) | |
download | frr-35729f38fa5713b923782ca9921c893bb8d3bc25.tar.xz frr-35729f38fa5713b923782ca9921c893bb8d3bc25.zip |
zebra: Add a timer to nexthop group deletion
Before deleting nexthop groups, that are installed,
from the system, start a timer and hold the nexthop
group for that time.
Suppose you have this scenario
a) create a static route with 1 x ecmp
creates a nhg with 1 x ecmp
b) create a static route with 2 x ecmp
creates a nhg with 2 x ecmp
deletes a's nhg
c) create a static route with 3 x ecmp
creates a nhg with 3 x ecmp
deletes b's nhg
d) create a different route with 1 x ecmp
creates another 1 x ecmp ( since a's ecmp was deleted )
e) create a different route with 2 x ecmp
creates another 2 x ecmp ( since b's ecmp was deleted )
If you don't delete the nhg, start a timer, the nhg's used
in steps a and b can be reused for steps d and e. This reduces
overhead work with zebra <-> kernel interactions and improves
the speed of the system.
So modify the code to note that an installed nexthop group should
be kept around a bit and hopefully reused.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra/zebra_vty.c')
-rw-r--r-- | zebra/zebra_vty.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index be19b07d9..88752edb9 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -1433,14 +1433,22 @@ static void show_nexthop_group_out(struct vty *vty, struct nhg_hash_entry *nhe) struct nhg_connected *rb_node_dep = NULL; struct nexthop_group *backup_nhg; char up_str[MONOTIME_STRLEN]; + char time_left[MONOTIME_STRLEN]; uptime2str(nhe->uptime, up_str, sizeof(up_str)); vty_out(vty, "ID: %u (%s)\n", nhe->id, zebra_route_string(nhe->type)); - vty_out(vty, " RefCnt: %u\n", nhe->refcnt); + vty_out(vty, " RefCnt: %u", nhe->refcnt); + if (thread_is_scheduled(nhe->timer)) + vty_out(vty, " Time to Deletion: %s", + thread_timer_to_hhmmss(time_left, sizeof(time_left), + nhe->timer)); + vty_out(vty, "\n"); + vty_out(vty, " Uptime: %s\n", up_str); vty_out(vty, " VRF: %s\n", vrf_id_to_name(nhe->vrf_id)); + if (CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_VALID)) { vty_out(vty, " Valid"); if (CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_INSTALLED)) |