diff options
author | Jerome Tollet <jtollet@cisco.com> | 2021-01-07 12:44:17 +0100 |
---|---|---|
committer | John Lo <loj@cisco.com> | 2021-01-08 21:46:37 +0000 |
commit | 0f8d100354ec71ba4e9e6c0e5b018eb379aca216 (patch) | |
tree | d343b8ba4832cbdf495d3c9e043a074454cf6bf6 /src/vnet/l2/l2_fib.c | |
parent | 23f41d789c54bd8d9b87db8cf43d0235c5699da4 (diff) |
l2: Separating scan-delay and learn-limit into a separate API from want_l2_macs_events
Type: feature
Signed-off-by: Jerome Tollet <jtollet@cisco.com>
Change-Id: I6de6dae7da4ec1001e2811975a9b67acfc1a148c
Diffstat (limited to 'src/vnet/l2/l2_fib.c')
-rw-r--r-- | src/vnet/l2/l2_fib.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/vnet/l2/l2_fib.c b/src/vnet/l2/l2_fib.c index 82be6bc0341..4407cb5bc4c 100644 --- a/src/vnet/l2/l2_fib.c +++ b/src/vnet/l2/l2_fib.c @@ -845,6 +845,36 @@ VLIB_CLI_COMMAND (l2fib_del_cli, static) = { }; /* *INDENT-ON* */ +static clib_error_t * +l2fib_set_scan_delay (vlib_main_t *vm, unformat_input_t *input, + vlib_cli_command_t *cmd) +{ + clib_error_t *error = 0; + u32 scan_delay; + l2fib_main_t *fm = &l2fib_main; + + if (!unformat (input, "%d", &scan_delay)) + { + error = clib_error_return (0, "expecting delay but got `%U'", + format_unformat_error, input); + goto done; + } + fm->event_scan_delay = (f64) (scan_delay) *10e-3; + l2fib_flush_all_mac (vlib_get_main ()); +done: + return error; +} + +/*? + * This command set scan delay (in 1/10s unit) + * +?*/ +VLIB_CLI_COMMAND (l2fib_set_scan_delay_cli, static) = { + .path = "set l2fib scan-delay", + .short_help = "set l2fib scan-delay <delay>", + .function = l2fib_set_scan_delay, +}; + /** Kick off ager to scan MACs to age/delete MAC entries */ |