pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/32339 )
Change subject: Fix DL_TBF PACCH ass done on UL_TBF already scheduled to tx last PKT CTRL ACK ......................................................................
Fix DL_TBF PACCH ass done on UL_TBF already scheduled to tx last PKT CTRL ACK
Change-Id: I62ae91b494e4fd0ade3f4a3ba3817bcaedbdebf5 --- M src/tbf_ul_ack_fsm.c M tests/tbf/TbfTest.err 2 files changed, 34 insertions(+), 18 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/39/32339/1
diff --git a/src/tbf_ul_ack_fsm.c b/src/tbf_ul_ack_fsm.c index 5e5586b..76a1cad 100644 --- a/src/tbf_ul_ack_fsm.c +++ b/src/tbf_ul_ack_fsm.c @@ -65,7 +65,6 @@ unsigned int rrbp = 0; uint32_t new_poll_fn = 0; struct gprs_rlcmac_ul_tbf *tbf = ctx->tbf; - struct GprsMs *ms = tbf_ms(ul_tbf_as_tbf(tbf));
if (final) { rc = tbf_check_polling(ul_tbf_as_tbf(tbf), d->pdch, d->fn, &new_poll_fn, &rrbp); @@ -86,21 +85,6 @@ bitvec_pack(ack_vec, msgb_put(msg, 23)); bitvec_free(ack_vec);
- /* TS 44.060 7a.2.1.1: "The contention resolution is completed on - * the network side when the network receives an RLC data block that - * comprises the TLLI value that identifies the mobile station and the - * TFI value associated with the TBF." (see TBF_EV_FIRST_UL_DATA_RECVD). - * - * However, it's handier for us to mark contention resolution success here - * since upon rx UL ACK is the time at which MS realizes contention resolution - * succeeds: - * TS 44.060 7.1.2.3: "The contention resolution is successfully completed - * on the mobile station side when the mobile station receives a - * PACKET UPLINK ACK/NACK" - */ - if (ms_tlli(ms) != GSM_RESERVED_TMSI && !ul_tbf_contention_resolution_done(ctx->tbf)) - osmo_fsm_inst_dispatch(tbf_state_fi(ul_tbf_as_tbf(ctx->tbf)), TBF_EV_CONTENTION_RESOLUTION_MS_SUCCESS, NULL); - if (final) { tbf_set_polling(ul_tbf_as_tbf(tbf), d->pdch, new_poll_fn, PDCH_ULC_POLL_UL_ACK); LOGPTBFUL(tbf, LOGL_DEBUG, @@ -126,6 +110,7 @@ { struct tbf_ul_ack_fsm_ctx *ctx = (struct tbf_ul_ack_fsm_ctx *)fi->priv; struct gprs_rlcmac_ul_tbf *tbf = ctx->tbf; + struct GprsMs *ms = tbf_ms(ul_tbf_as_tbf(tbf)); struct tbf_ul_ack_ev_create_rlcmac_msg_ctx *data_ctx; bool final;
@@ -144,6 +129,28 @@ tbf_ul_ack_fsm_state_chg(fi, TBF_UL_ACK_ST_WAIT_ACK); else tbf_ul_ack_fsm_state_chg(fi, TBF_UL_ACK_ST_NONE); + + /* TS 44.060 7a.2.1.1: "The contention resolution is completed on + * the network side when the network receives an RLC data block that + * comprises the TLLI value that identifies the mobile station and the + * TFI value associated with the TBF." (see TBF_EV_FIRST_UL_DATA_RECVD). + * + * However, it's handier for us to mark contention resolution success here + * since upon rx UL ACK is the time at which MS realizes contention resolution + * succeeds: + * TS 44.060 7.1.2.3: "The contention resolution is successfully completed + * on the mobile station side when the mobile station receives a + * PACKET UPLINK ACK/NACK" + * + * This event must be triggered here *after* potentially transitioning + * to ST_WAIT_ACK above, so that gprs_ms knows whether it can create a + * DL TBF on PACCH of the UL_TBF or not (not possible if we are in + * ST_WAIT_ACK, since UL TBF is terminating sending the final PKT CTRL + * ACK). + */ + if (ms_tlli(ms) != GSM_RESERVED_TMSI && !ul_tbf_contention_resolution_done(ctx->tbf)) + osmo_fsm_inst_dispatch(tbf_state_fi(ul_tbf_as_tbf(ctx->tbf)), TBF_EV_CONTENTION_RESOLUTION_MS_SUCCESS, NULL); + break; default: OSMO_ASSERT(0); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 2598cdf..9410fd4 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -1921,11 +1921,11 @@ Got MS: TLLI = 0xf1223344, TA = 7 UL_ACK_TBF(UL:TFI-0-0-0:STATE-NEW:GPRS){SCHED_UL_ACK}: Received Event CREATE_RLCMAC_MSG PDCH(bts=0,trx=0,ts=7) POLL scheduled at FN 2654167 + 17 = 2654184 -UL_TBF(UL:TFI-0-0-0:STATE-NEW:GPRS){FINISHED}: Received Event CONTENTION_RESOLUTION_MS_SUCCESS -TBF(UL:TFI-0-0-0:STATE-FINISHED:GPRS:TLLI-0xf1223344) stopping timer T3141 [Contention resolution success (UL-TBF, CCCH)] PDCH(bts=0,trx=0,ts=7) Reserving FN 2654184 for type POLL TBF(UL:TFI-0-0-0:STATE-FINISHED:GPRS:TLLI-0xf1223344) Scheduled UL Acknowledgement polling on PACCH (FN=2654184, TS=7) UL_ACK_TBF(UL:TFI-0-0-0:STATE-NEW:GPRS){SCHED_UL_ACK}: state_chg to WAIT_ACK +UL_TBF(UL:TFI-0-0-0:STATE-NEW:GPRS){FINISHED}: Received Event CONTENTION_RESOLUTION_MS_SUCCESS +TBF(UL:TFI-0-0-0:STATE-FINISHED:GPRS:TLLI-0xf1223344) stopping timer T3141 [Contention resolution success (UL-TBF, CCCH)] PDCH(bts=0,trx=0,ts=7) FN=2654167 Scheduling control message at RTS for TBF(UL:TFI-0-0-0:STATE-FINISHED:GPRS:TLLI-0xf1223344) Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344' Modifying MS object, TLLI: 0xf1223344 confirmed