Use osmo_tdef to implement ms-idle-time

This commit would also remove the option from config_write_pcu() since
it's automatically filled in by osmo_tdef, but there was actually a bug
because that param was never printed when saving the config...

Change-Id: Id8e70b0f44ef2f7e20ecdb3fd8ca93ae2a05b9a3
This commit is contained in:
Pau Espin 2019-09-09 13:19:06 +02:00
parent 474dc77894
commit 63700ead34
5 changed files with 15 additions and 10 deletions

View File

@ -83,6 +83,7 @@ static struct osmo_tdef T_defs_pcu[] = {
{ .T=-2000, .default_val=2, .unit=OSMO_TDEF_MS, .desc="Tbf reject for PRR timer (ms)", .val=0 },
{ .T=-2001, .default_val=2, .unit=OSMO_TDEF_S, .desc="PACCH assignment timer (s)", .val=0 },
{ .T=-2002, .default_val=200, .unit=OSMO_TDEF_MS, .desc="Waiting after IMM.ASS confirm timer (ms)", .val=0 },
{ .T=-2030, .default_val=60, .unit=OSMO_TDEF_S, .desc="Time to keep an idle MS object alive (s)", .val=0 }, /* slightly above T3314 (default 44s, 24.008, 11.2.2) */
{ .T=0, .default_val=0, .unit=OSMO_TDEF_S, .desc=NULL, .val=0 } /* empty item at the end */
};
@ -867,7 +868,7 @@ GprsMs *BTS::ms_alloc(uint8_t ms_class, uint8_t egprs_ms_class)
GprsMs *ms;
ms = ms_store().create_ms();
ms->set_timeout(m_bts.ms_idle_sec);
ms->set_timeout(osmo_tdef_get(m_bts.T_defs_pcu, -2030, OSMO_TDEF_S, -1));
ms->set_ms_class(ms_class);
ms->set_egprs_ms_class(egprs_ms_class);

View File

@ -140,7 +140,6 @@ struct gprs_rlcmac_bts {
/* 0 to support resegmentation in DL, 1 for no reseg */
uint8_t dl_arq_type;
uint32_t ms_idle_sec;
uint8_t cs_adj_enabled;
uint8_t cs_adj_upper_limit;
uint8_t cs_adj_lower_limit;

View File

@ -207,7 +207,6 @@ int main(int argc, char *argv[])
bts->n3105 = 8;
bts->alpha = 0; /* a = 0.0 */
bts->si13_is_set = false;
bts->ms_idle_sec = 60; /* slightly above T3314 (default 44s, 24.008, 11.2.2) */
bts->cs_adj_enabled = 1;
bts->cs_adj_upper_limit = 33; /* Decrease CS if the error rate is above */
bts->cs_adj_lower_limit = 10; /* Increase CS if the error rate is below */

View File

@ -901,27 +901,31 @@ DEFUN(cfg_pcu_no_dl_tbf_preemptive_retransmission,
}
#define MS_IDLE_TIME_STR "keep an idle MS object alive for the time given\n"
DEFUN(cfg_pcu_ms_idle_time,
DEFUN_DEPRECATED(cfg_pcu_ms_idle_time,
cfg_pcu_ms_idle_time_cmd,
"ms-idle-time <1-7200>",
MS_IDLE_TIME_STR "idle time in sec")
{
vty_out(vty, "%% 'ms-idle-time' is now deprecated: use 'timer X2030 <val>' instead%s", VTY_NEWLINE);
struct gprs_rlcmac_bts *bts = bts_main_data();
bts->ms_idle_sec = atoi(argv[0]);
if (osmo_tdef_set(bts->T_defs_pcu, -2030, atoi(argv[0]), OSMO_TDEF_S) < 0)
return CMD_WARNING;
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_no_ms_idle_time,
DEFUN_DEPRECATED(cfg_pcu_no_ms_idle_time,
cfg_pcu_no_ms_idle_time_cmd,
"no ms-idle-time",
NO_STR MS_IDLE_TIME_STR)
{
vty_out(vty, "%% 'no ms-idle-time' is now deprecated: use 'timer X2030 0' instead%s", VTY_NEWLINE);
struct gprs_rlcmac_bts *bts = bts_main_data();
bts->ms_idle_sec = 0;
if (osmo_tdef_set(bts->T_defs_pcu, -2030, 0, OSMO_TDEF_S) < 0)
return CMD_WARNING;
return CMD_SUCCESS;
}

View File

@ -155,6 +155,7 @@ static void setup_bts(BTS *the_bts, uint8_t ts_no, uint8_t cs = 1)
bts->alloc_algorithm = alloc_algorithm_a;
bts->initial_cs_dl = cs;
bts->initial_cs_ul = cs;
osmo_tdef_set(bts->T_defs_pcu, -2030, 0, OSMO_TDEF_S);
trx = &bts->trx[0];
trx->pdch[ts_no].enable();
@ -501,7 +502,8 @@ static void test_tbf_dl_llc_loss()
bts = the_bts.bts_data();
setup_bts(&the_bts, ts_no);
bts->ms_idle_sec = 10; /* keep the MS object */
/* keep the MS object 10 seconds */
OSMO_ASSERT(osmo_tdef_set(bts->T_defs_pcu, -2030, 10, OSMO_TDEF_S) == 0);
gprs_bssgp_create_and_connect(bts, 33001, 0, 33001, 2234, 2234, 2234, 1, 1, false, 0, 0, 0);