From 32f6d8e0ca39483f706dc3a1c28223e9fe028f06 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Tue, 5 Mar 2019 04:22:08 -0800 Subject: GBP: per-group EP retention policy Change-Id: I3ed4e2e92f74f15b07fcd3e7fbc3fa8718d5249d Signed-off-by: Neale Ranns --- src/plugins/gbp/gbp_endpoint.c | 35 +++++++++-------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) (limited to 'src/plugins/gbp/gbp_endpoint.c') diff --git a/src/plugins/gbp/gbp_endpoint.c b/src/plugins/gbp/gbp_endpoint.c index f32a8820238..9cae2ab9421 100644 --- a/src/plugins/gbp/gbp_endpoint.c +++ b/src/plugins/gbp/gbp_endpoint.c @@ -50,13 +50,6 @@ vlib_log_class_t gbp_ep_logger; #define GBP_ENDPOINT_INFO(...) \ vlib_log_notice (gbp_ep_logger, __VA_ARGS__); -/** - * GBP Endpoint inactive timeout (in seconds) - * If a dynamically learned Endpoint has not been heard from in this - * amount of time it is considered inactive and discarded - */ -static u32 GBP_ENDPOINT_INACTIVE_TIME = 30; - /** * Pool of GBP endpoints */ @@ -1340,16 +1333,22 @@ VLIB_CLI_COMMAND (gbp_endpoint_show_node, static) = { static void gbp_endpoint_check (index_t gei, f64 start_time) { + gbp_endpoint_group_t *gg; gbp_endpoint_loc_t *gel; gbp_endpoint_t *ge; ge = gbp_endpoint_get (gei); gel = gbp_endpoint_loc_find (ge, GBP_ENDPOINT_SRC_DP); - if ((NULL != gel) && - ((start_time - ge->ge_last_time) > GBP_ENDPOINT_INACTIVE_TIME)) + if (NULL != gel) { - gbp_endpoint_unlock (GBP_ENDPOINT_SRC_DP, gei); + gg = gbp_endpoint_group_get (gel->gel_epg); + + if ((start_time - ge->ge_last_time) > + gg->gg_retention.remote_ep_timeout) + { + gbp_endpoint_unlock (GBP_ENDPOINT_SRC_DP, gei); + } } } @@ -1464,22 +1463,6 @@ gbp_endpoint_scan (vlib_main_t * vm) gbp_endpoint_scan_l3 (vm); } -void -gbp_learn_set_inactive_threshold (u32 threshold) -{ - GBP_ENDPOINT_INACTIVE_TIME = threshold; - - vlib_process_signal_event (vlib_get_main (), - gbp_scanner_node.index, - GBP_ENDPOINT_SCAN_SET_TIME, 0); -} - -f64 -gbp_endpoint_scan_threshold (void) -{ - return (GBP_ENDPOINT_INACTIVE_TIME); -} - static fib_node_t * gbp_endpoint_get_node (fib_node_index_t index) { -- cgit 1.2.3-korg