diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2021-08-06 20:26:00 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2021-08-16 02:13:17 +0200 |
commit | eec43fa5327a15969af158ef53711eabcc0e9695 (patch) | |
tree | f26bd5d8362074a4c73900afcd80eea34f823bdc /src | |
parent | 225af37f4868fdf6857ad29454b9418d2b7512bd (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/osmo-bsc/abis_rsl.c | 1 | ||||
-rw-r--r-- | src/osmo-bsc/lchan_fsm.c | 34 |
2 files changed, 27 insertions, 8 deletions
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index d5b0d532e..df319821d 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -2057,6 +2057,7 @@ void abis_rsl_chan_rqd_queue_poll(struct gsm_bts *bts) .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 68cafb3c8..1eb9505a8 100644 --- a/src/osmo-bsc/lchan_fsm.c +++ b/src/osmo-bsc/lchan_fsm.c @@ -657,6 +657,21 @@ static int lchan_activate_set_ch_mode_rate_and_mr_config(struct gsm_lchan *lchan 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 @@ static void lchan_fsm_wait_activ_ack_onenter(struct osmo_fsm_inst *fi, uint32_t 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_wait_activ_ack(struct osmo_fsm_inst *fi, uint32_t event, v 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 @@ static void lchan_fsm_post_activ_ack(struct osmo_fsm_inst *fi) 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: |