pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmo-pcu/+/37669?usp=email )
Change subject: tbf_ul_ass_fsm: Clarify use of X2000 timer
......................................................................
tbf_ul_ass_fsm: Clarify use of X2000 timer
See 683ce64039bb9192b597e62344f0aa084b4ac4c9 for a complementary
analysis and description of the timer.
Related: OS#3928
Change-Id: Iee27d1b2a8ddac53e14efd20a8c8aec35de58174
---
M src/tbf_ul_ass_fsm.c
M tests/tbf/TbfTest.err
2 files changed, 28 insertions(+), 5 deletions(-)
Approvals:
fixeria: Looks good to me, approved
Jenkins Builder: Verified
laforge: Looks good to me, but someone else must approve
diff --git a/src/tbf_ul_ass_fsm.c b/src/tbf_ul_ass_fsm.c
index 6f88f11..de5b901 100644
--- a/src/tbf_ul_ass_fsm.c
+++ b/src/tbf_ul_ass_fsm.c
@@ -156,16 +156,26 @@
unsigned long val;
unsigned int sec, micro;
- /* Start release after rejecting only if it is UL TBF */
if (prev_state == TBF_UL_ASS_SEND_ASS_REJ &&
tbf_direction(ctx->tbf) == GPRS_RLCMAC_UL_TBF) {
- /* tbf_free() called upon trigger */
+ /* If TBF object doing the UL assignment is also an UL TBF, and
+ * it was just rejected over PACCH, then there's nothing more to do
+ * with this UL TBF other than freeing it and waiting for MS to
+ * retry asking for another UL TBF assignment. But since we are
+ * currently being called from the scheduled (we arrived here
+ * through st_send_ass_rej(TBF_UL_ASS_EV_CREATE_RLCMAC_MSG)),
+ * then we need to delay the tbf_free() to do it asynchrosnouly
+ * in the event loop. Using a fixed 0ms internal fsm timer
+ * number would have been fine here, but since for historical
+ * reasons we have VTY-configurable X2000 for this purpose, keep
+ * using it (it is expected to be 0 usually).
+ */
fi->T = -2000;
val = osmo_tdef_get(the_pcu->T_defs, fi->T, OSMO_TDEF_MS, -1);
sec = val / 1000;
micro = (val % 1000) * 1000;
- LOGPTBF(ctx->tbf, LOGL_DEBUG, "Starting timer X2000 [reject (PACCH)] with %u
sec. %u microsec\n",
- sec, micro);
+ LOGPTBF(ctx->tbf, LOGL_DEBUG, "Starting timer X2000 [delay free after Packet
Access Reject (PACCH)] with %lums\n",
+ val);
osmo_timer_schedule(&fi->timer, sec, micro);
}
diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err
index 062dd23..fdaf917 100644
--- a/tests/tbf/TbfTest.err
+++ b/tests/tbf/TbfTest.err
@@ -11923,7 +11923,7 @@
UL_ASS_TBF(UL:TFI-0-0--1:G:TLLI-0xffeeddcc){NONE}: state_chg to SEND_ASS_REJ
UL_ASS_TBF(UL:TFI-0-0--1:G:TLLI-0xffeeddcc){SEND_ASS_REJ}: Received Event
CREATE_RLCMAC_MSG
UL_ASS_TBF(UL:TFI-0-0--1:G:TLLI-0xffeeddcc){SEND_ASS_REJ}: state_chg to NONE
-TBF(UL:TFI-0-0--1:G:TLLI-0xffeeddcc){ASSIGN} Starting timer X2000 [reject (PACCH)] with 0
sec. 0 microsec
+TBF(UL:TFI-0-0--1:G:TLLI-0xffeeddcc){ASSIGN} Starting timer X2000 [delay free after
Packet Access Reject (PACCH)] with 0ms
PDCH(bts=0,trx=0,ts=7) FN=2654218 Scheduling control message at RTS for
TBF(UL:TFI-0-0--1:G:TLLI-0xffeeddcc){ASSIGN}
UL_ASS_TBF(UL:TFI-0-0--1:G:TLLI-0xffeeddcc){NONE}: Timeout of X2000
TBF(UL:TFI-0-0--1:G:TLLI-0xffeeddcc){ASSIGN} free
--
To view, visit
https://gerrit.osmocom.org/c/osmo-pcu/+/37669?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: Iee27d1b2a8ddac53e14efd20a8c8aec35de58174
Gerrit-Change-Number: 37669
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged