From a098c19b5531e175a308fbe4aee39c54cb3c71f1 Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Thu, 28 May 2015 16:11:19 +0200 Subject: tbf: Set MS timeout This commit sets the MS timeout when the MS object is created. The value is taken from the ms_idle_sec field in gprs_rlcmac_bts which can be changed by the VTY commands shown below. The following VTY commands are added to the config-pcu node: - ms-idle-time <1-7200> Set the timeout in seconds - no ms-idle-time Disable the timeout Another timer that is related is T3314 (Ready Timer, default 44s, GSM 24.008, 11.2.2) which requires the SGSN to use paging after its expiry. Longer timeouts can help if adaptive coding scheme selection is used (not yet implemented). On the other hand, measurement values (TA, signal quality) can get invalid after some time, especially with a moving MS. So a value slightly above T3314 is probably a good value to start with. Sponsored-by: On-Waves ehf --- src/bts.h | 1 + src/pcu_vty.c | 27 +++++++++++++++++++++++++++ src/tbf.cpp | 4 +++- 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/bts.h b/src/bts.h index 28ecfc1c..af66dfc8 100644 --- a/src/bts.h +++ b/src/bts.h @@ -141,6 +141,7 @@ struct gprs_rlcmac_bts { uint8_t force_two_phase; uint8_t alpha, gamma; uint32_t dl_tbf_idle_msec; /* hold time for idle DL TBFs */ + uint32_t ms_idle_sec; /* TBF handling, make private or move into TBFController */ /* list of uplink TBFs */ diff --git a/src/pcu_vty.c b/src/pcu_vty.c index a08ec368..9490664f 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -483,6 +483,31 @@ DEFUN(cfg_pcu_no_dl_tbf_idle_time, return CMD_SUCCESS; } +#define MS_IDLE_TIME_STR "keep an idle MS object alive for the time given\n" +DEFUN(cfg_pcu_ms_idle_time, + cfg_pcu_ms_idle_time_cmd, + "ms-idle-time <1-7200>", + MS_IDLE_TIME_STR "idle time in sec") +{ + struct gprs_rlcmac_bts *bts = bts_main_data(); + + bts->ms_idle_sec = atoi(argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_pcu_no_ms_idle_time, + cfg_pcu_no_ms_idle_time_cmd, + "no ms-idle-time", + NO_STR MS_IDLE_TIME_STR) +{ + struct gprs_rlcmac_bts *bts = bts_main_data(); + + bts->ms_idle_sec = 0; + + return CMD_SUCCESS; +} + DEFUN(show_tbf, show_tbf_cmd, "show tbf all", @@ -555,6 +580,8 @@ int pcu_vty_init(const struct log_info *cat) install_element(PCU_NODE, &cfg_pcu_gamma_cmd); install_element(PCU_NODE, &cfg_pcu_dl_tbf_idle_time_cmd); install_element(PCU_NODE, &cfg_pcu_no_dl_tbf_idle_time_cmd); + install_element(PCU_NODE, &cfg_pcu_ms_idle_time_cmd); + install_element(PCU_NODE, &cfg_pcu_no_ms_idle_time_cmd); install_element_ve(&show_bts_stats_cmd); install_element_ve(&show_tbf_cmd); diff --git a/src/tbf.cpp b/src/tbf.cpp index 53f1ae13..8501b161 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -126,8 +126,10 @@ void gprs_rlcmac_tbf::update_ms(uint32_t tlli, enum gprs_rlcmac_tbf_direction di { if (!ms()) { GprsMs *new_ms = bts->ms_store().get_ms(tlli); - if (!new_ms) + if (!new_ms) { new_ms = bts->ms_store().create_ms(tlli, dir); + new_ms->set_timeout(bts->bts_data()->ms_idle_sec); + } if (dir == GPRS_RLCMAC_UL_TBF) new_ms->set_ta(m_ta); -- cgit v1.2.3