summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Franke <chris@opensourcerouting.org>2018-11-23 04:26:19 +0100
committerRodny Molina <rmolina@linkedin.com>2018-12-07 20:45:14 +0100
commite923107c7b25c26b07e47153e2f1042748390f96 (patch)
tree6b22a8654d2383468b7219ecac317514a413dab4
parentfabricd: Improve LSP flooding log (diff)
downloadfrr-e923107c7b25c26b07e47153e2f1042748390f96.tar.xz
frr-e923107c7b25c26b07e47153e2f1042748390f96.zip
fabricd: make triggered csnp delay configurable
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
-rw-r--r--isisd/fabricd.c30
-rw-r--r--isisd/fabricd.h6
-rw-r--r--isisd/isis_pdu.c4
-rw-r--r--isisd/isis_vty_fabricd.c33
4 files changed, 67 insertions, 6 deletions
diff --git a/isisd/fabricd.c b/isisd/fabricd.c
index 537dc9966..e1d838429 100644
--- a/isisd/fabricd.c
+++ b/isisd/fabricd.c
@@ -65,6 +65,9 @@ struct fabricd {
uint8_t tier_pending;
struct thread *tier_calculation_timer;
struct thread *tier_set_timer;
+
+ int csnp_delay;
+ bool always_send_csnp;
};
/* Code related to maintaining the neighbor lists */
@@ -211,6 +214,8 @@ struct fabricd *fabricd_new(struct isis_area *area)
"Fabricd Neighbors");
rv->tier = rv->tier_config = ISIS_TIER_UNDEFINED;
+
+ rv->csnp_delay = FABRICD_DEFAULT_CSNP_DELAY;
return rv;
};
@@ -506,6 +511,12 @@ int fabricd_write_settings(struct isis_area *area, struct vty *vty)
written++;
}
+ if (f->csnp_delay != FABRICD_DEFAULT_CSNP_DELAY
+ || f->always_send_csnp) {
+ vty_out(vty, " triggered-csnp-delay %d%s\n", f->csnp_delay,
+ f->always_send_csnp ? " always" : "");
+ }
+
return written;
}
@@ -707,13 +718,16 @@ void fabricd_lsp_flood(struct isis_lsp *lsp, struct isis_circuit *circuit)
}
}
-void fabricd_trigger_csnp(struct isis_area *area)
+void fabricd_trigger_csnp(struct isis_area *area, bool circuit_scoped)
{
struct fabricd *f = area->fabricd;
if (!f)
return;
+ if (!circuit_scoped && !f->always_send_csnp)
+ return;
+
struct listnode *node;
struct isis_circuit *circuit;
@@ -723,7 +737,7 @@ void fabricd_trigger_csnp(struct isis_area *area)
thread_cancel(circuit->t_send_csnp[ISIS_LEVEL2 - 1]);
thread_add_timer_msec(master, send_l2_csnp, circuit,
- isis_jitter(500, CSNP_JITTER),
+ isis_jitter(f->csnp_delay, CSNP_JITTER),
&circuit->t_send_csnp[ISIS_LEVEL2 - 1]);
}
}
@@ -773,3 +787,15 @@ void fabricd_update_lsp_no_flood(struct isis_lsp *lsp,
fabricd_lsp_reset_flooding_info(lsp, circuit);
lsp->flooding_circuit_scoped = true;
}
+
+void fabricd_configure_triggered_csnp(struct isis_area *area, int delay,
+ bool always_send_csnp)
+{
+ struct fabricd *f = area->fabricd;
+
+ if (!f)
+ return;
+
+ f->csnp_delay = delay;
+ f->always_send_csnp = always_send_csnp;
+}
diff --git a/isisd/fabricd.h b/isisd/fabricd.h
index 6b55cce38..8c850c628 100644
--- a/isisd/fabricd.h
+++ b/isisd/fabricd.h
@@ -22,6 +22,8 @@
#ifndef FABRICD_H
#define FABRICD_H
+#define FABRICD_DEFAULT_CSNP_DELAY 500
+
struct fabricd;
struct isis_circuit;
@@ -43,10 +45,12 @@ void fabricd_configure_tier(struct isis_area *area, uint8_t tier);
uint8_t fabricd_tier(struct isis_area *area);
int fabricd_write_settings(struct isis_area *area, struct vty *vty);
void fabricd_lsp_flood(struct isis_lsp *lsp, struct isis_circuit *circuit);
-void fabricd_trigger_csnp(struct isis_area *area);
+void fabricd_trigger_csnp(struct isis_area *area, bool circuit_scoped);
struct list *fabricd_ip_addrs(struct isis_circuit *circuit);
void fabricd_lsp_free(struct isis_lsp *lsp);
void fabricd_update_lsp_no_flood(struct isis_lsp *lsp,
struct isis_circuit *circuit);
+void fabricd_configure_triggered_csnp(struct isis_area *area, int delay,
+ bool always_send_csnp);
#endif
diff --git a/isisd/isis_pdu.c b/isisd/isis_pdu.c
index 0c352422b..53cd142da 100644
--- a/isisd/isis_pdu.c
+++ b/isisd/isis_pdu.c
@@ -1105,9 +1105,7 @@ dontcheckadj:
retval = ISIS_OK;
out:
- if (circuit_scoped) {
- fabricd_trigger_csnp(circuit->area);
- }
+ fabricd_trigger_csnp(circuit->area, circuit_scoped);
isis_free_tlvs(tlvs);
return retval;
diff --git a/isisd/isis_vty_fabricd.c b/isisd/isis_vty_fabricd.c
index bd4020104..aa4ccdd07 100644
--- a/isisd/isis_vty_fabricd.c
+++ b/isisd/isis_vty_fabricd.c
@@ -57,6 +57,37 @@ DEFUN (no_fabric_tier,
return CMD_SUCCESS;
}
+DEFUN (triggered_csnp,
+ triggered_csnp_cmd,
+ "triggered-csnp-delay (100-10000) [always]",
+ "Configure the delay for triggered CSNPs\n"
+ "Delay in milliseconds\n"
+ "Trigger CSNP for all LSPs, not only circuit-scoped\n")
+{
+ VTY_DECLVAR_CONTEXT(isis_area, area);
+
+ int csnp_delay = atoi(argv[1]->arg);
+ bool always_send_csnp = (argc == 3);
+
+ fabricd_configure_triggered_csnp(area, csnp_delay, always_send_csnp);
+ return CMD_SUCCESS;
+}
+
+DEFUN (no_triggered_csnp,
+ no_triggered_csnp_cmd,
+ "no triggered-csnp-delay [(100-10000) [always]]",
+ NO_STR
+ "Configure the delay for triggered CSNPs\n"
+ "Delay in milliseconds\n"
+ "Trigger CSNP for all LSPs, not only circuit-scoped\n")
+{
+ VTY_DECLVAR_CONTEXT(isis_area, area);
+
+ fabricd_configure_triggered_csnp(area, FABRICD_DEFAULT_CSNP_DELAY,
+ false);
+ return CMD_SUCCESS;
+}
+
static void lsp_print_flooding(struct vty *vty, struct isis_lsp *lsp)
{
char lspid[255];
@@ -154,6 +185,8 @@ void isis_vty_daemon_init(void)
{
install_element(ROUTER_NODE, &fabric_tier_cmd);
install_element(ROUTER_NODE, &no_fabric_tier_cmd);
+ install_element(ROUTER_NODE, &triggered_csnp_cmd);
+ install_element(ROUTER_NODE, &no_triggered_csnp_cmd);
install_element(ENABLE_NODE, &show_lsp_flooding_cmd);
}