Change in ...osmo-pcu[master]: Use osmo_tdef to implement ms-idle-time

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Mon Sep 9 12:20:07 UTC 2019


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/15453


Change subject: Use osmo_tdef to implement ms-idle-time
......................................................................

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
---
M src/bts.cpp
M src/bts.h
M src/pcu_main.cpp
M src/pcu_vty.c
M tests/tbf/TbfTest.cpp
5 files changed, 15 insertions(+), 10 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/53/15453/1

diff --git a/src/bts.cpp b/src/bts.cpp
index 73db8b3..4fce468 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -83,6 +83,7 @@
 	{ .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) */
 	{}
 };
 
@@ -860,7 +861,7 @@
 	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);
 
diff --git a/src/bts.h b/src/bts.h
index ac909a7..7cc5279 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -139,7 +139,6 @@
 	/* 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;
diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp
index 6f71ca5..e423718 100644
--- a/src/pcu_main.cpp
+++ b/src/pcu_main.cpp
@@ -207,7 +207,6 @@
 	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 */
diff --git a/src/pcu_vty.c b/src/pcu_vty.c
index 1185a8c..98d29b6 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -873,27 +873,31 @@
 }
 
 #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;
 }
 
diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index 5bf94b5..7241a35 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -155,6 +155,7 @@
 	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 @@
 
 	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);
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/15453
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: Id8e70b0f44ef2f7e20ecdb3fd8ca93ae2a05b9a3
Gerrit-Change-Number: 15453
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190909/c677219d/attachment.htm>


More information about the gerrit-log mailing list