mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 22:29:23 +00:00
zebra: Add a configurable knob zebra nexthop-group keep (1-3600)
Allow end operator to set how long a nexthop-group is kept around in the system after it is no-longer being used. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
35729f38fa
commit
c9af62e314
@ -273,6 +273,12 @@ Nexthop tracking doesn't resolve nexthops via the default route by default.
|
|||||||
Allowing this might be useful when e.g. you want to allow BGP to peer across
|
Allowing this might be useful when e.g. you want to allow BGP to peer across
|
||||||
the default route.
|
the default route.
|
||||||
|
|
||||||
|
.. clicmd:: zebra nexthop-group keep (1-3600)
|
||||||
|
|
||||||
|
Set the time that zebra will keep a created and installed nexthop group
|
||||||
|
before removing it from the system if the nexthop group is no longer
|
||||||
|
being used. The default time is 180 seconds.
|
||||||
|
|
||||||
.. clicmd:: ip nht resolve-via-default
|
.. clicmd:: ip nht resolve-via-default
|
||||||
|
|
||||||
Allow IPv4 nexthop tracking to resolve via the default route. This parameter
|
Allow IPv4 nexthop tracking to resolve via the default route. This parameter
|
||||||
|
@ -1649,8 +1649,8 @@ void zebra_nhg_decrement_ref(struct nhg_hash_entry *nhe)
|
|||||||
!CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_KEEP_AROUND)) {
|
!CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_KEEP_AROUND)) {
|
||||||
nhe->refcnt = 1;
|
nhe->refcnt = 1;
|
||||||
SET_FLAG(nhe->flags, NEXTHOP_GROUP_KEEP_AROUND);
|
SET_FLAG(nhe->flags, NEXTHOP_GROUP_KEEP_AROUND);
|
||||||
thread_add_timer(zrouter.master, zebra_nhg_timer, nhe, 180,
|
thread_add_timer(zrouter.master, zebra_nhg_timer, nhe,
|
||||||
&nhe->timer);
|
zrouter.nhg_keep, &nhe->timer);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!zebra_nhg_depends_is_empty(nhe))
|
if (!zebra_nhg_depends_is_empty(nhe))
|
||||||
|
@ -278,6 +278,8 @@ void zebra_router_init(bool asic_offload, bool notify_on_ack)
|
|||||||
|
|
||||||
zrouter.packets_to_process = ZEBRA_ZAPI_PACKETS_TO_PROCESS;
|
zrouter.packets_to_process = ZEBRA_ZAPI_PACKETS_TO_PROCESS;
|
||||||
|
|
||||||
|
zrouter.nhg_keep = ZEBRA_DEFAULT_NHG_KEEP_TIMER;
|
||||||
|
|
||||||
zebra_vxlan_init();
|
zebra_vxlan_init();
|
||||||
zebra_mlag_init();
|
zebra_mlag_init();
|
||||||
|
|
||||||
|
@ -219,6 +219,9 @@ struct zebra_router {
|
|||||||
bool notify_on_ack;
|
bool notify_on_ack;
|
||||||
|
|
||||||
bool supports_nhgs;
|
bool supports_nhgs;
|
||||||
|
|
||||||
|
#define ZEBRA_DEFAULT_NHG_KEEP_TIMER 180
|
||||||
|
uint32_t nhg_keep;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define GRACEFUL_RESTART_TIME 60
|
#define GRACEFUL_RESTART_TIME 60
|
||||||
|
@ -3850,11 +3850,31 @@ DEFUN (no_ip_zebra_import_table,
|
|||||||
return (zebra_import_table(AFI_IP, VRF_DEFAULT, table_id, 0, NULL, 0));
|
return (zebra_import_table(AFI_IP, VRF_DEFAULT, table_id, 0, NULL, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFPY (zebra_nexthop_group_keep,
|
||||||
|
zebra_nexthop_group_keep_cmd,
|
||||||
|
"[no] zebra nexthop-group keep (1-3600)",
|
||||||
|
NO_STR
|
||||||
|
ZEBRA_STR
|
||||||
|
"Nexthop-Group\n"
|
||||||
|
"How long to keep\n"
|
||||||
|
"Time in seconds from 1-3600\n")
|
||||||
|
{
|
||||||
|
if (no)
|
||||||
|
zrouter.nhg_keep = ZEBRA_DEFAULT_NHG_KEEP_TIMER;
|
||||||
|
else
|
||||||
|
zrouter.nhg_keep = keep;
|
||||||
|
|
||||||
|
return CMD_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
static int config_write_protocol(struct vty *vty)
|
static int config_write_protocol(struct vty *vty)
|
||||||
{
|
{
|
||||||
if (allow_delete)
|
if (allow_delete)
|
||||||
vty_out(vty, "allow-external-route-update\n");
|
vty_out(vty, "allow-external-route-update\n");
|
||||||
|
|
||||||
|
if (zrouter.nhg_keep != ZEBRA_DEFAULT_NHG_KEEP_TIMER)
|
||||||
|
vty_out(vty, "zebra nexthop-group keep %u\n", zrouter.nhg_keep);
|
||||||
|
|
||||||
if (zrouter.ribq->spec.hold != ZEBRA_RIB_PROCESS_HOLD_TIME)
|
if (zrouter.ribq->spec.hold != ZEBRA_RIB_PROCESS_HOLD_TIME)
|
||||||
vty_out(vty, "zebra work-queue %u\n", zrouter.ribq->spec.hold);
|
vty_out(vty, "zebra work-queue %u\n", zrouter.ribq->spec.hold);
|
||||||
|
|
||||||
@ -4433,6 +4453,7 @@ void zebra_vty_init(void)
|
|||||||
install_element(CONFIG_NODE, &ip_multicast_mode_cmd);
|
install_element(CONFIG_NODE, &ip_multicast_mode_cmd);
|
||||||
install_element(CONFIG_NODE, &no_ip_multicast_mode_cmd);
|
install_element(CONFIG_NODE, &no_ip_multicast_mode_cmd);
|
||||||
|
|
||||||
|
install_element(CONFIG_NODE, &zebra_nexthop_group_keep_cmd);
|
||||||
install_element(CONFIG_NODE, &ip_zebra_import_table_distance_cmd);
|
install_element(CONFIG_NODE, &ip_zebra_import_table_distance_cmd);
|
||||||
install_element(CONFIG_NODE, &no_ip_zebra_import_table_cmd);
|
install_element(CONFIG_NODE, &no_ip_zebra_import_table_cmd);
|
||||||
install_element(CONFIG_NODE, &zebra_workqueue_timer_cmd);
|
install_element(CONFIG_NODE, &zebra_workqueue_timer_cmd);
|
||||||
|
Loading…
Reference in New Issue
Block a user