diff options
author | Neale Ranns <nranns@cisco.com> | 2019-03-05 04:22:08 -0800 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2019-03-05 13:51:32 +0000 |
commit | 32f6d8e0ca39483f706dc3a1c28223e9fe028f06 (patch) | |
tree | 4d36a736e12268ca5f4cb937260b3ac037e743c2 /src/plugins/gbp/gbp_endpoint.c | |
parent | 0fce11f23d64eae2f374435b31a77b872d552298 (diff) |
GBP: per-group EP retention policy
Change-Id: I3ed4e2e92f74f15b07fcd3e7fbc3fa8718d5249d
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/plugins/gbp/gbp_endpoint.c')
-rw-r--r-- | src/plugins/gbp/gbp_endpoint.c | 35 |
1 files changed, 9 insertions, 26 deletions
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 @@ -51,13 +51,6 @@ vlib_log_class_t gbp_ep_logger; 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 */ gbp_endpoint_t *gbp_endpoint_pool; @@ -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) { |