Change in osmo-bts[master]: early IMM ASS: add configurable delay for RR IMM ASS

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/.

neels gerrit-no-reply at lists.osmocom.org
Sat Sep 11 13:10:33 UTC 2021


neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/25201 )

Change subject: early IMM ASS: add configurable delay for RR IMM ASS
......................................................................

early IMM ASS: add configurable delay for RR IMM ASS

During live testing, it has become apparent that some IMM ASS still fail
when sending the RR IMM ASS directly upon the target channel becoming
active.

Add a bit of delay after activation, to give some time for the channel
to light up for the MS. Default is 50ms.

Related: OS#5559
Change-Id: Ia1e63b98944dc840cde212fc732e20277cdc5585
---
M include/osmo-bts/gsm_data.h
M src/common/bts.c
M src/common/gsm_data.c
M src/common/lchan.c
M tests/osmo-bts.vty
5 files changed, 64 insertions(+), 14 deletions(-)

Approvals:
  neels: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h
index 33cb2af..fa6ea02 100644
--- a/include/osmo-bts/gsm_data.h
+++ b/include/osmo-bts/gsm_data.h
@@ -428,6 +428,7 @@
 	 * confirmed active, then cache it here and send it once the channel is confirmed to be active. This is related
 	 * to the Early IA feature, see OsmoBSC config option 'immediate-assignment pre-chan-ack'. */
 	struct msgb *early_rr_ia;
+	struct osmo_timer_list early_rr_ia_delay;
 };
 
 extern const struct value_string lchan_ciph_state_names[];
@@ -534,6 +535,7 @@
 
 extern struct osmo_tdef_group bts_tdef_groups[];
 extern struct osmo_tdef bts_T_defs[];
+extern struct osmo_tdef abis_T_defs[];
 
 extern const struct value_string gsm_pchant_names[13];
 extern const struct value_string gsm_pchant_descs[13];
diff --git a/src/common/bts.c b/src/common/bts.c
index b6af4c6..a8a23f1 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -143,6 +143,11 @@
 	{}
 };
 
+struct osmo_tdef abis_T_defs[] = {
+	{ .T=-15, .default_val=50, .unit=OSMO_TDEF_MS, .desc="Time to wait between Channel Activation and dispatching a cached early Immediate Assignment" },
+	{}
+};
+
 static const uint8_t bts_nse_timer_default[] = { 3, 3, 3, 3, 30, 3, 10 };
 static const uint8_t bts_cell_timer_default[] =
 				{ 3, 3, 3, 3, 3, 10, 3, 10, 3, 10, 3 };
@@ -234,6 +239,7 @@
 
 	bts->T_defs = bts_T_defs;
 	osmo_tdefs_reset(bts->T_defs);
+	osmo_tdefs_reset(abis_T_defs);
 	bts->shutdown_fi = osmo_fsm_inst_alloc(&bts_shutdown_fsm, bts, bts,
 					       LOGL_INFO, NULL);
 	osmo_fsm_inst_update_id_f(bts->shutdown_fi, "bts%d", bts->nr);
diff --git a/src/common/gsm_data.c b/src/common/gsm_data.c
index 721bb45..76292f7 100644
--- a/src/common/gsm_data.c
+++ b/src/common/gsm_data.c
@@ -42,6 +42,7 @@
 
 struct osmo_tdef_group bts_tdef_groups[] = {
 	{ .name = "bts", .tdefs = bts_T_defs, .desc = "BTS process timers" },
+	{ .name = "abis", .tdefs = abis_T_defs, .desc = "Abis (RSL) related timers" },
 	{}
 };
 
diff --git a/src/common/lchan.c b/src/common/lchan.c
index 987f78a..dcec0a3 100644
--- a/src/common/lchan.c
+++ b/src/common/lchan.c
@@ -25,6 +25,33 @@
 #include <osmo-bts/bts.h>
 #include <osmo-bts/rsl.h>
 
+void early_rr_ia_delay_cb(void *data)
+{
+	struct gsm_lchan *lchan = data;
+	struct gsm_bts *bts = lchan->ts->trx->bts;
+
+	if (!lchan->early_rr_ia) {
+		/* The IA message has disappeared since the timer was started. */
+		return;
+	}
+
+	if (lchan->state != LCHAN_S_ACTIVE) {
+		/* Release has happened since the timer was started. */
+		msgb_free(lchan->early_rr_ia);
+		lchan->early_rr_ia = NULL;
+		return;
+	}
+
+	/* Activation is done, send the RR IA now. Put RR IA msg into the AGCH queue of the BTS. */
+	if (bts_agch_enqueue(bts, lchan->early_rr_ia) < 0) {
+		/* if there is no space in the queue: send DELETE IND */
+		rsl_tx_delete_ind(bts, lchan->early_rr_ia->data, lchan->early_rr_ia->len);
+		rate_ctr_inc2(bts->ctrs, BTS_CTR_AGCH_DELETED);
+		msgb_free(lchan->early_rr_ia);
+	}
+	lchan->early_rr_ia = NULL;
+}
+
 void lchan_set_state(struct gsm_lchan *lchan, enum gsm_lchan_state state)
 {
 	DEBUGP(DL1C, "%s state %s -> %s\n",
@@ -36,25 +63,23 @@
 	/* Early Immediate Assignment: if we have a cached early IA pending, send it upon becoming active, or discard it
 	 * when releasing. */
 	if (lchan->early_rr_ia) {
-		struct gsm_bts *bts = lchan->ts->trx->bts;
 		switch (lchan->state) {
 		case LCHAN_S_ACT_REQ:
 			/* Activation is requested, keep the early IA until active. This allows the BSC to send the IA
 			 * even before a dynamic timeslot is done switching to a different pchan kind (experimental). */
 			break;
 		case LCHAN_S_ACTIVE:
-			/* Activation is done, send the RR IA now. Put RR IA msg into the AGCH queue of the BTS. */
-			if (bts_agch_enqueue(bts, lchan->early_rr_ia) < 0) {
-				/* if there is no space in the queue: send DELETE IND */
-				rsl_tx_delete_ind(bts, lchan->early_rr_ia->data, lchan->early_rr_ia->len);
-				rate_ctr_inc2(bts->ctrs, BTS_CTR_AGCH_DELETED);
-				msgb_free(lchan->early_rr_ia);
-			}
-			lchan->early_rr_ia = NULL;
+			/* Activation is done, send the RR IA now. Delay a bit more to give Um time to let the lchan
+			 * light up for the MS */
+			osmo_timer_del(&lchan->early_rr_ia_delay);
+			osmo_timer_setup(&lchan->early_rr_ia_delay, early_rr_ia_delay_cb, lchan);
+			osmo_timer_schedule(&lchan->early_rr_ia_delay, 0,
+					    osmo_tdef_get(abis_T_defs, -15, OSMO_TDEF_US, -1));
 			break;
 		default:
 			/* Transition to any other state means whatever IA the BSC has sent shall now not be relevant
 			 * anymore. */
+			osmo_timer_del(&lchan->early_rr_ia_delay);
 			msgb_free(lchan->early_rr_ia);
 			lchan->early_rr_ia = NULL;
 			break;
diff --git a/tests/osmo-bts.vty b/tests/osmo-bts.vty
index 12a0c77..e39d304 100644
--- a/tests/osmo-bts.vty
+++ b/tests/osmo-bts.vty
@@ -7,7 +7,7 @@
   show lchan summary [<0-255>] [<0-255>] [<0-7>] [<0-7>]
   show bts <0-255> gprs
 ...
-  show timer [(bts)] [TNNNN]
+  show timer [(bts|abis)] [TNNNN]
   show e1_driver
   show e1_line [<0-255>] [stats]
   show e1_timeslot [<0-255>] [<0-31>]
@@ -63,10 +63,12 @@
   [<0-7>]  Logical Channel Number
 
 OsmoBTS> show timer ?
-  [bts]  BTS process timers
+  [bts]   BTS process timers
+  [abis]  Abis (RSL) related timers
 OsmoBTS> show timer
 bts: X1 = 300 s	Time after which osmo-bts exits if regular ramp down during shut down process does not finish (s) (default: 300 s)
 bts: X2 = 3 s	Time after which osmo-bts exits if requesting transceivers to stop during shut down process does not finish (s) (default: 3 s)
+abis: X15 = 50 ms	Time to wait between Channel Activation and dispatching a cached early Immediate Assignment (default: 50 ms)
 OsmoBTS> show timer bts ?
   [TNNNN]  T- or X-timer-number -- 3GPP compliant timer number of the format '1234' or 'T1234' or 't1234'; Osmocom-specific timer number of the format: 'X1234' or 'x1234'.
 OsmoBTS> show timer bts
@@ -76,6 +78,10 @@
 bts: X1 = 300 s	Time after which osmo-bts exits if regular ramp down during shut down process does not finish (s) (default: 300 s)
 OsmoBTS> show timer bts X2
 bts: X2 = 3 s	Time after which osmo-bts exits if requesting transceivers to stop during shut down process does not finish (s) (default: 3 s)
+OsmoBTS> show timer abis ?
+  [TNNNN]  T- or X-timer-number -- 3GPP compliant timer number of the format '1234' or 'T1234' or 't1234'; Osmocom-specific timer number of the format: 'X1234' or 'x1234'.
+OsmoBTS> show timer abis X15
+abis: X15 = 50 ms	Time to wait between Channel Activation and dispatching a cached early Immediate Assignment (default: 50 ms)
 
 OsmoBTS> show e1_driver ?
   <cr>  
@@ -98,7 +104,7 @@
   show lchan summary [<0-255>] [<0-255>] [<0-7>] [<0-7>]
   show bts <0-255> gprs
 ...
-  show timer [(bts)] [TNNNN]
+  show timer [(bts|abis)] [TNNNN]
   bts <0-0> trx <0-255> ts <0-7> (lchan|shadow-lchan) <0-7> rtp jitter-buffer <0-10000>
   test send-failure-event-report <0-255>
   bts <0-255> c0-power-red <0-6>
@@ -172,7 +178,7 @@
 ...
   bts BTS_NR
 ...
-  timer [(bts)] [TNNNN] [(<0-2147483647>|default)]
+  timer [(bts|abis)] [TNNNN] [(<0-2147483647>|default)]
   phy <0-255>
   e1_input
 ...
@@ -190,7 +196,8 @@
   <0-255>  PHY number
 
 OsmoBTS(config)# timer ?
-  [bts]  BTS process timers
+  [bts]   BTS process timers
+  [abis]  Abis (RSL) related timers
 OsmoBTS(config)# timer bts ?
   [TNNNN]  T- or X-timer-number -- 3GPP compliant timer number of the format '1234' or 'T1234' or 't1234'; Osmocom-specific timer number of the format: 'X1234' or 'x1234'.
 OsmoBTS(config)# timer bts X1
@@ -207,6 +214,15 @@
 OsmoBTS(config)# timer bts X1
 bts: X1 = 300 s	Time after which osmo-bts exits if regular ramp down during shut down process does not finish (s) (default: 300 s)
 
+OsmoBTS(config)# timer abis X15
+abis: X15 = 50 ms	Time to wait between Channel Activation and dispatching a cached early Immediate Assignment (default: 50 ms)
+OsmoBTS(config)# timer abis X15 123
+OsmoBTS(config)# timer abis X15
+abis: X15 = 123 ms	Time to wait between Channel Activation and dispatching a cached early Immediate Assignment (default: 50 ms)
+OsmoBTS(config)# timer abis X15 default
+OsmoBTS(config)# timer abis X15
+abis: X15 = 50 ms	Time to wait between Channel Activation and dispatching a cached early Immediate Assignment (default: 50 ms)
+
 OsmoBTS(config)# bts 0
 OsmoBTS(bts)# list
 ...

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ia1e63b98944dc840cde212fc732e20277cdc5585
Gerrit-Change-Number: 25201
Gerrit-PatchSet: 7
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-CC: Hoernchen <ewild at sysmocom.de>
Gerrit-CC: fixeria <vyanitskiy at sysmocom.de>
Gerrit-CC: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210911/74cc8a82/attachment.htm>


More information about the gerrit-log mailing list