mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-09 19:06:07 +00:00
ldpd: be more conservative with labels
On unstable networks, routes can be lost and relearned very often. If we deallocate the input label every time a route is lost and allocate a new one when the route is relearned, a lot of changes are made in vain. This patch introduces a logic in which labels are preserved for at least five minutes before being deallocated by the LIB garbage collector. This is consistent with what other implementations do. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
This commit is contained in:
parent
9b2868bc01
commit
a8e8b86797
@ -383,21 +383,24 @@ lde_kernel_update(struct fec *fec)
|
|||||||
if (LIST_EMPTY(&fn->nexthops)) {
|
if (LIST_EMPTY(&fn->nexthops)) {
|
||||||
RB_FOREACH(ln, nbr_tree, &lde_nbrs)
|
RB_FOREACH(ln, nbr_tree, &lde_nbrs)
|
||||||
lde_send_labelwithdraw(ln, fn, NULL, NULL);
|
lde_send_labelwithdraw(ln, fn, NULL, NULL);
|
||||||
fn->local_label = NO_LABEL;
|
|
||||||
fn->data = NULL;
|
fn->data = NULL;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Do not deallocate the local label now, do that only in the
|
||||||
|
* LIB garbage collector. This will prevent ldpd from changing
|
||||||
|
* the input label of some prefixes too often when running on
|
||||||
|
* an unstable network. Also, restart the garbage collector
|
||||||
|
* timer so that labels are deallocated only when the network
|
||||||
|
* is stabilized.
|
||||||
|
*/
|
||||||
|
lde_gc_start_timer();
|
||||||
} else {
|
} else {
|
||||||
uint32_t previous_label;
|
|
||||||
|
|
||||||
previous_label = fn->local_label;
|
|
||||||
fn->local_label = lde_update_label(fn);
|
fn->local_label = lde_update_label(fn);
|
||||||
|
if (fn->local_label != NO_LABEL && RB_EMPTY(&fn->upstream))
|
||||||
if (fn->local_label != NO_LABEL &&
|
|
||||||
fn->local_label != previous_label) {
|
|
||||||
/* FEC.1: perform lsr label distribution procedure */
|
/* FEC.1: perform lsr label distribution procedure */
|
||||||
RB_FOREACH(ln, nbr_tree, &lde_nbrs)
|
RB_FOREACH(ln, nbr_tree, &lde_nbrs)
|
||||||
lde_send_labelmapping(ln, fn, 1);
|
lde_send_labelmapping(ln, fn, 1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
LIST_FOREACH(fnh, &fn->nexthops, entry) {
|
LIST_FOREACH(fnh, &fn->nexthops, entry) {
|
||||||
lde_send_change_klabel(fn, fnh);
|
lde_send_change_klabel(fn, fnh);
|
||||||
|
Loading…
Reference in New Issue
Block a user