X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fgbp%2Fgbp_endpoint.c;h=9cae2ab9421508ed35ba9fcdfe89ee5b9608b410;hb=32f6d8e0c;hp=f32a8820238b14a8b4d03ebaa1cc30096a55c887;hpb=37029305c671f4e2d091d6f6c22142634e409043;p=vpp.git 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) {