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

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
Sun Aug 8 01:55:59 UTC 2021


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


Change subject: early IMM ASS 2/n: implement 'pre-chan-ack'
......................................................................

early IMM ASS 2/n: implement 'pre-chan-ack'

When 'immediate-assignment pre-chan-ack' is set, send the Immediate
Assignment directly after the Channel Activation, not waiting for the
Activation ACK, to save an Abis roundtrip.

Related test is in If71f4562d532b6c5faf55f5fd073449a8a137ebf

Related: SYS#5559
Change-Id: I56c25cde152040fb66bdba44399bd37671ae3df2
---
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/lchan_fsm.c
3 files changed, 32 insertions(+), 8 deletions(-)



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

diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 4411555..ba3af3b 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -628,6 +628,11 @@
 	int tsc;
 
 	bool vamos;
+
+	/* A copy of bts->imm_ass_time at the time where Channel Activation was requested. A change in the VTY
+	 * configuration has immediate effect on the value, so make sure we don't get mixed up when it gets changed
+	 * while a channel activation is in progress. */
+	enum imm_ass_time imm_ass_time;
 };
 
 enum lchan_modify_for {
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index d5b0d53..df31982 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -2057,6 +2057,7 @@
 		.ta_known = true,
 		.tsc_set = -1,
 		.tsc = -1,
+		.imm_ass_time = bts->imm_ass_time,
 	};
 
 	lchan_activate(lchan, &info);
diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c
index 68cafb3..1eb9505 100644
--- a/src/osmo-bsc/lchan_fsm.c
+++ b/src/osmo-bsc/lchan_fsm.c
@@ -657,6 +657,21 @@
 	return 0;
 }
 
+static int lchan_send_imm_ass(struct osmo_fsm_inst *fi)
+{
+	int rc;
+	struct gsm_lchan *lchan = lchan_fi_lchan(fi);
+	rc = rsl_tx_imm_assignment(lchan);
+	if (rc) {
+		lchan_fail("Failed to Tx RR Immediate Assignment message (rc=%d %s)",
+			   rc, strerror(-rc));
+		return rc;
+	}
+	LOG_LCHAN(lchan, LOGL_DEBUG, "Tx RR Immediate Assignment\n");
+	lchan->activate.immediate_assignment_sent = true;
+	return rc;
+}
+
 static void lchan_fsm_wait_ts_ready_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state)
 {
 	struct gsm_lchan *lchan = lchan_fi_lchan(fi);
@@ -801,6 +816,12 @@
 
 	if (lchan->activate.info.ta_known)
 		lchan->last_ta = lchan->activate.info.ta;
+
+	if (lchan->activate.info.imm_ass_time == IMM_ASS_TIME_PRE_CHAN_ACK) {
+		/* Send the Immediate Assignment directly after the Channel Activation request, saving one Abis
+		 * roundtrip between ChanRqd and Imm Ass. */
+		lchan_send_imm_ass(fi);
+	}
 }
 
 static void lchan_fsm_post_activ_ack(struct osmo_fsm_inst *fi);
@@ -861,7 +882,6 @@
 
 static void lchan_fsm_post_activ_ack(struct osmo_fsm_inst *fi)
 {
-	int rc;
 	struct gsm_lchan *lchan = lchan_fi_lchan(fi);
 
 	lchan->current_ch_mode_rate = lchan->activate.ch_mode_rate;
@@ -880,14 +900,12 @@
 	switch (lchan->activate.info.activ_for) {
 
 	case ACTIVATE_FOR_MS_CHANNEL_REQUEST:
-		rc = rsl_tx_imm_assignment(lchan);
-		if (rc) {
-			lchan_fail("Failed to Tx RR Immediate Assignment message (rc=%d %s)",
-				   rc, strerror(-rc));
-			return;
+		if (lchan->activate.info.imm_ass_time == IMM_ASS_TIME_POST_CHAN_ACK) {
+			if (lchan_send_imm_ass(fi)) {
+				/* lchan_fail() was already called in lchan_send_imm_ass() */
+				return;
+			}
 		}
-		LOG_LCHAN(lchan, LOGL_DEBUG, "Tx RR Immediate Assignment\n");
-		lchan->activate.immediate_assignment_sent = true;
 		break;
 
 	case ACTIVATE_FOR_ASSIGNMENT:

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I56c25cde152040fb66bdba44399bd37671ae3df2
Gerrit-Change-Number: 25165
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/826deedf/attachment.htm>


More information about the gerrit-log mailing list