From 82f13612ce63b863d22bc28eaf3dcc25c364fb6c Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Fri, 17 Aug 2018 13:13:27 +0200 Subject: gbproxy: Add new VTY-managed timer: link-list clean-stale-timer This timer allows periodically cleaning up stale links in link-list of each gbproxy_peer. Previous to this patch, this kind of cleanup (gbproxy_remove_stale_link_infos) was being done only as a consequence of external events being triggered, such as a message from that peer being received. It was found in a production network agreggating several BSS that some of them were offline for a longtime but gbproxy was still caching big amounts of really old link_info for the NSEI assigned to those BSS, because since they were probably turned off abruptely, no new messages were received from it which would trigger the cleanup. As a consequence, it has been observed that a timer to periodically clean up old entries (link-list max-age) is requird in case w don't receive messages from that NSEI periodically. Related: SYS#4431 Change-Id: Ic777016f6d4f0e30fb736484774ca46878f17b7a --- include/osmocom/sgsn/gb_proxy.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/osmocom/sgsn/gb_proxy.h b/include/osmocom/sgsn/gb_proxy.h index 16082fcde..7e2ae42fb 100644 --- a/include/osmocom/sgsn/gb_proxy.h +++ b/include/osmocom/sgsn/gb_proxy.h @@ -105,6 +105,8 @@ struct gbproxy_config { struct osmo_plmn_id core_plmn; uint8_t* core_apn; size_t core_apn_size; + /* Frequency (sec) at which timer to clean stale links is fired (0 disabled) */ + unsigned int clean_stale_timer_freq; /* If !0, Max age to consider a struct gbproxy_link_info as stale */ int tlli_max_age; /* If !0, Max len of gbproxy_peer->list (list of struct gbproxy_link_info) */ @@ -151,6 +153,9 @@ struct gbproxy_peer { struct rate_ctr_group *ctrg; struct gbproxy_patch_state patch_state; + + /* Fired periodically to clean up stale links from list */ + struct osmo_timer_list clean_stale_timer; }; struct gbproxy_tlli_state { -- cgit v1.2.3