Change in osmo-pcu[master]: ms: clarify delayed MS relase process related code and logging

pespin gerrit-no-reply at lists.osmocom.org
Wed Mar 3 17:06:43 UTC 2021


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


Change subject: ms: clarify delayed MS relase process related code and logging
......................................................................

ms: clarify delayed MS relase process related code and logging

Change-Id: Ieaea6ab07b4b2822bcf394f2d0e9298b9f3c5854
---
M src/gprs_ms.c
M tests/ms/MsTest.err
M tests/tbf/TbfTest.err
3 files changed, 16 insertions(+), 11 deletions(-)



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

diff --git a/src/gprs_ms.c b/src/gprs_ms.c
index ab1a067..8a06e1f 100644
--- a/src/gprs_ms.c
+++ b/src/gprs_ms.c
@@ -79,11 +79,10 @@
 	.ms_active = gprs_default_cb_ms_active,
 };
 
-void ms_timeout(void *data)
+static void ms_release_timer_cb(void *data)
 {
 	struct GprsMs *ms = (struct GprsMs *) data;
-	LOGP(DRLCMAC, LOGL_INFO, "Timeout for MS object, TLLI = 0x%08x\n",
-		ms_tlli(ms));
+	LOGPMS(ms, DRLCMAC, LOGL_INFO, "Release timer timeout\n");
 
 	if (ms->timer.data) {
 		ms->timer.data = NULL;
@@ -116,7 +115,7 @@
 
 	ms->imsi[0] = '\0';
 	memset(&ms->timer, 0, sizeof(ms->timer));
-	ms->timer.cb = ms_timeout;
+	ms->timer.cb = ms_release_timer_cb;
 	llc_queue_init(&ms->llc_queue);
 
 	ms_set_mode(ms, GPRS);
@@ -218,22 +217,26 @@
 		ms_update_status(ms);
 }
 
-void ms_start_timer(struct GprsMs *ms)
+static void ms_release_timer_start(struct GprsMs *ms)
 {
 	if (ms->delay == 0)
 		return;
 
+	LOGPMS(ms, DRLCMAC, LOGL_DEBUG, "Schedule MS release in %u secs\n", ms->delay);
+
 	if (!ms->timer.data)
 		ms->timer.data = ms_ref(ms);
 
 	osmo_timer_schedule(&ms->timer, ms->delay, 0);
 }
 
-void ms_stop_timer(struct GprsMs *ms)
+static void ms_release_timer_stop(struct GprsMs *ms)
 {
 	if (!ms->timer.data)
 		return;
 
+	LOGPMS(ms, DRLCMAC, LOGL_DEBUG, "Cancel scheduled MS release\n");
+
 	osmo_timer_del(&ms->timer);
 	ms->timer.data = NULL;
 	ms_unref(ms);
@@ -306,7 +309,7 @@
 	ms->ul_tbf = tbf;
 
 	if (tbf)
-		ms_stop_timer(ms);
+		ms_release_timer_stop(ms);
 
 	ms_unref(ms);
 }
@@ -327,7 +330,7 @@
 	ms->dl_tbf = tbf;
 
 	if (tbf)
-		ms_stop_timer(ms);
+		ms_release_timer_stop(ms);
 
 	ms_unref(ms);
 }
@@ -374,7 +377,7 @@
 		ms_set_reserved_slots(ms, NULL, 0, 0);
 
 		if (ms_tlli(ms) != 0)
-			ms_start_timer(ms);
+			ms_release_timer_start(ms);
 	}
 
 	ms_update_status(ms);
@@ -386,7 +389,7 @@
 		"Clearing MS object, TLLI: 0x%08x, IMSI: '%s'\n",
 		ms_tlli(ms), ms_imsi(ms));
 
-	ms_stop_timer(ms);
+	ms_release_timer_stop(ms);
 
 	ms->tlli = GSM_RESERVED_TMSI;
 	ms->new_dl_tlli = ms->tlli;
diff --git a/tests/ms/MsTest.err b/tests/ms/MsTest.err
index 51ab68d..0fd56f0 100644
--- a/tests/ms/MsTest.err
+++ b/tests/ms/MsTest.err
@@ -52,7 +52,7 @@
 Attaching TBF to MS object, TLLI = 0xffeeddbb, TBF = TBF(TFI=0 TLLI=0xffeeddbb DIR=DL STATE=NULL)
 Detaching TBF from MS object, TLLI = 0xffeeddbb, TBF = TBF(TFI=0 TLLI=0xffeeddbb DIR=UL STATE=NULL)
 Detaching TBF from MS object, TLLI = 0xffeeddbb, TBF = TBF(TFI=0 TLLI=0xffeeddbb DIR=DL STATE=NULL)
-Timeout for MS object, TLLI = 0xffeeddbb
+MS(TLLI=0xffeeddbb, IMSI=, TA=220, 0/0,) Release timer timeout
 Destroying MS object, TLLI = 0xffeeddbb
 Creating MS object, TLLI = 0xffeeddbb
 Attaching TBF to MS object, TLLI = 0xffeeddbb, TBF = TBF(TFI=0 TLLI=0xffeeddbb DIR=DL STATE=NULL)
diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err
index 0f802a7..5185c7d 100644
--- a/tests/tbf/TbfTest.err
+++ b/tests/tbf/TbfTest.err
@@ -1382,6 +1382,7 @@
 TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=RELEASING) free
 PDCH(bts=0,trx=0,ts=4) Detaching TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=RELEASING), 0 TBFs, USFs = 00, TFIs = 00000000.
 Detaching TBF from MS object, TLLI = 0xc0123456, TBF = TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=RELEASING)
+MS(TLLI=0xc0123456, IMSI=001001000123456, TA=0, 45/0,) Schedule MS release in 10 secs
 ********** DL-TBF ends here **********
 MS(TLLI=0xc0123456, IMSI=001001000123456, TA=0, 45/0,) ********** DL-TBF starts here **********
 MS(TLLI=0xc0123456, IMSI=001001000123456, TA=0, 45/0,) Allocating DL TBF
@@ -1398,6 +1399,7 @@
 TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=NULL) Setting Control TS 4
 TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 10, dl_slots = 10
 Attaching TBF to MS object, TLLI = 0xc0123456, TBF = TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=NULL)
+MS(TLLI=0xc0123456, IMSI=001001000123456, TA=0, 45/0, DL) Cancel scheduled MS release
 TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=NULL) [DOWNLINK] START
 TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=NULL) Send dowlink assignment on PCH, no TBF exist (IMSI=001001000123456)
 TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=NULL) changes state from NULL to ASSIGN

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: Ieaea6ab07b4b2822bcf394f2d0e9298b9f3c5854
Gerrit-Change-Number: 23216
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/20210303/121427e9/attachment.htm>


More information about the gerrit-log mailing list