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

neels gerrit-no-reply at lists.osmocom.org
Mon Aug 16 18:43:47 UTC 2021


neels has uploaded this change for review. ( 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, 53 insertions(+), 11 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/01/25201/1

diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h
index 80f1833..215b9d8 100644
--- a/include/osmo-bts/gsm_data.h
+++ b/include/osmo-bts/gsm_data.h
@@ -418,6 +418,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[];
@@ -524,6 +525,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 b1f695b..9c8d6f3 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..a5863a0 100644
--- a/src/common/lchan.c
+++ b/src/common/lchan.c
@@ -25,6 +25,34 @@
 #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;
+	}
+
+	/* Put RR IA msg into the AGCH queue of the BTS. */
+	/* 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",
@@ -43,18 +71,17 @@
 			 * 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 eb10d4d..336dc1b 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>

-- 
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: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210816/2fb10625/attachment.htm>


More information about the gerrit-log mailing list