Change in osmo-bsc[master]: early IMM ASS 3/n: implement 'pre-ts-ack'

neels gerrit-no-reply at lists.osmocom.org
Sun Aug 8 01:55:59 UTC 2021


neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/25166 )


Change subject: early IMM ASS 3/n: implement 'pre-ts-ack'
......................................................................

early IMM ASS 3/n: implement 'pre-ts-ack'

Add experimental 'pre-ts-ack' to the 'immediate-assignment' options:
send the IMM ASS even before a dynamic timeslot is switched. This
possibly saves an Abis roundtrip, but may be racy.

When pre-ts-ack is chosen, already do the IMM ASS before the dyn TS
pchan switch is ACKed.

In Immediate Assignment, in case the dyn TS is not ready yet, get the
pchan kind from lchan->type, which already reflects the target type, and
not from ts->pchan_is, which still reflects the previous pchan type.

Related test is in I2ae28cd92910d4bc341a88571599347a64a18fe5

Related: SYS#5559
Change-Id: I19e6a3d614aa5ae24d64eed96caf53e6f0e8bb74
---
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/bts_vty.c
M src/osmo-bsc/lchan_fsm.c
M tests/osmo-bsc.vty
5 files changed, 35 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/66/25166/1

diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index ba3af3b..d6c06de 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -604,6 +604,7 @@
 enum imm_ass_time {
 	IMM_ASS_TIME_POST_CHAN_ACK = 0,
 	IMM_ASS_TIME_PRE_CHAN_ACK,
+	IMM_ASS_TIME_PRE_TS_ACK,
 };
 
 struct lchan_activate_info {
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index df31982..26231ac 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -2072,6 +2072,7 @@
 	struct gsm_bts *bts = lchan->ts->trx->bts;
 	uint8_t buf[GSM_MACBLOCK_LEN];
 	struct gsm48_imm_ass *ia = (struct gsm48_imm_ass *) buf;
+	enum gsm_phys_chan_config pchan;
 
 	/* create IMMEDIATE ASSIGN 04.08 message */
 	memset(ia, 0, sizeof(*ia));
@@ -2079,7 +2080,15 @@
 	ia->proto_discr = GSM48_PDISC_RR;
 	ia->msg_type = GSM48_MT_RR_IMM_ASS;
 	ia->page_mode = GSM48_PM_SAME;
-	rc = gsm48_lchan2chan_desc(&ia->chan_desc, lchan, lchan->tsc, true);
+
+	/* In case the dyn TS is not ready yet, ts->pchan_is still reflects the previous pchan type; so get the pchan
+	 * kind from lchan->type, which already reflects the target type. This only happens for dynamic timeslots.
+	 * gsm_pchan_by_lchan_type() isn't always exact, which is fine for dyn TS with their limited pchan kinds. */
+	if (lchan_state_is(lchan, LCHAN_ST_WAIT_TS_READY))
+		pchan = gsm_pchan_by_lchan_type(lchan->type);
+	else
+		pchan = lchan->ts->pchan_is;
+	rc = gsm48_lchan_and_pchan2chan_desc(&ia->chan_desc, lchan, pchan, lchan->tsc, true);
 	if (rc) {
 		LOG_LCHAN(lchan, LOGL_ERROR, "Error encoding Channel Number\n");
 		return rc;
diff --git a/src/osmo-bsc/bts_vty.c b/src/osmo-bsc/bts_vty.c
index cba0bb0..577feec 100644
--- a/src/osmo-bsc/bts_vty.c
+++ b/src/osmo-bsc/bts_vty.c
@@ -2807,16 +2807,20 @@
 }
 
 DEFUN_ATTR(cfg_bts_immediate_assignment, cfg_bts_immediate_assignment_cmd,
-	   "immediate-assignment (post-chan-ack|pre-chan-ack)",
+	   "immediate-assignment (post-chan-ack|pre-chan-ack|pre-ts-ack)",
 	   "Configure time of Immediate Assignment after ChanRqd RACH (Abis optimization)\n"
 	   "Send the Immediate Assignment after the Channel Activation ACK (normal sequence)\n"
 	   "Send the Immediate Assignment directly after Channel Activation (early), without waiting for the ACK;"
-	   " This may help with double allocations on high latency Abis links\n",
+	   " This may help with double allocations on high latency Abis links\n"
+	   "EXPERIMENTAL: If a dynamic timeslot switch is necessary, send the Immediate Assignment even before the"
+	   " timeslot is switched, i.e. even before the Channel Activation is sent (very early)\n",
 	   CMD_ATTR_IMMEDIATE)
 {
 	struct gsm_bts *bts = vty->index;
 
-	if (!strcmp(argv[0], "pre-chan-ack"))
+	if (!strcmp(argv[0], "pre-ts-ack"))
+		bts->imm_ass_time = IMM_ASS_TIME_PRE_TS_ACK;
+	else if (!strcmp(argv[0], "pre-chan-ack"))
 		bts->imm_ass_time = IMM_ASS_TIME_PRE_CHAN_ACK;
 	else
 		bts->imm_ass_time = IMM_ASS_TIME_POST_CHAN_ACK;
@@ -4005,6 +4009,9 @@
 	case IMM_ASS_TIME_PRE_CHAN_ACK:
 		vty_out(vty, "  immediate-assignment pre-chan-ack%s", VTY_NEWLINE);
 		break;
+	case IMM_ASS_TIME_PRE_TS_ACK:
+		vty_out(vty, "  immediate-assignment pre-ts-ack%s", VTY_NEWLINE);
+		break;
 	}
 
 	/* BS/MS Power Control parameters */
diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c
index 1eb9505..def70de 100644
--- a/src/osmo-bsc/lchan_fsm.c
+++ b/src/osmo-bsc/lchan_fsm.c
@@ -739,6 +739,12 @@
 	/* Prepare an MGW endpoint CI if appropriate. */
 	if (lchan->activate.info.requires_voice_stream)
 		lchan_rtp_fsm_start(lchan);
+
+	if (lchan->activate.info.imm_ass_time == IMM_ASS_TIME_PRE_TS_ACK) {
+		/* Send the Immediate Assignment even before the timeslot is ready, saving a dyn TS timeslot roundtrip
+		 * on Abis (experimental). */
+		lchan_send_imm_ass(fi);
+	}
 }
 
 static void lchan_fsm_wait_ts_ready(struct osmo_fsm_inst *fi, uint32_t event, void *data)
diff --git a/tests/osmo-bsc.vty b/tests/osmo-bsc.vty
index b837d25..4027502 100644
--- a/tests/osmo-bsc.vty
+++ b/tests/osmo-bsc.vty
@@ -210,6 +210,7 @@
 OsmoBSC(config-net-bts)# immediate-assignment ?
   post-chan-ack  Send the Immediate Assignment after the Channel Activation ACK (normal sequence)
   pre-chan-ack   Send the Immediate Assignment directly after Channel Activation (early), without waiting for the ACK; This may help with double allocations on high latency Abis links
+  pre-ts-ack     EXPERIMENTAL: If a dynamic timeslot switch is necessary, send the Immediate Assignment even before the timeslot is switched, i.e. even before the Channel Activation is sent (very early)
 OsmoBSC(config-net-bts)# show running-config
 ... !immediate-assignment
 OsmoBSC(config-net-bts)# immediate-assignment pre-chan-ack
@@ -219,6 +220,13 @@
 ...
   immediate-assignment pre-chan-ack
 ...
+OsmoBSC(config-net-bts)# immediate-assignment pre-ts-ack
+OsmoBSC(config-net-bts)# show running-config
+...
+ bts 0
+...
+  immediate-assignment pre-ts-ack
+...
 OsmoBSC(config-net-bts)# immediate-assignment post-chan-ack
 OsmoBSC(config-net-bts)# show running-config
 ... !immediate-assignment

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I19e6a3d614aa5ae24d64eed96caf53e6f0e8bb74
Gerrit-Change-Number: 25166
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/20210808/ba0e26d8/attachment.htm>


More information about the gerrit-log mailing list