pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/18133 )
Change subject: Expect ms object to exist before calling tbf_alloc_ul_tbf() ...................................................................... Expect ms object to exist before calling tbf_alloc_ul_tbf() It's really non-sense from architectural point of view to pass an optional pointer to the MS holding the TBF and creating it otherwise. TBFs shouldn't be creating MS they belong too. This simple change requiring so many code line changes really exhibits how badly entangled the object relationship is. Another commit will follow doing the same for dl tbf. Change-Id: I010aa5877902816ae246e09ad5ad87946f96855c --- M src/bts.cpp M src/pdch.cpp M src/tbf.cpp M src/tbf.h M tests/alloc/AllocTest.cpp M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err M tests/types/TypesTest.cpp 8 files changed, 105 insertions(+), 103 deletions(-) Approvals: laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bts.cpp b/src/bts.cpp index 1d073aa..2916ee7 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -753,6 +753,7 @@ uint8_t tsc = 0, ta = qta2ta(qta); uint8_t egprs_ms_class = egprs_mslot_class_from_ra(ra, is_11bit); bool failure = false; + GprsMs *ms; rach_frame(); @@ -792,9 +793,10 @@ "Uplink (AGCH)\n"); } } else { + ms = ms_alloc(0, egprs_ms_class); // Create new TBF /* FIXME: Copy and paste with other routines.. */ - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, egprs_ms_class, true); + tbf = tbf_alloc_ul_tbf(&m_bts, ms, -1, true); if (!tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource sending " diff --git a/src/pdch.cpp b/src/pdch.cpp index 77be1b5..149ca1f 100644 --- a/src/pdch.cpp +++ b/src/pdch.cpp @@ -118,8 +118,7 @@ bts->channel_request_description(); /* This call will register the new TBF with the MS on success */ - gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data, tbf->trx->trx_no, tbf->ms_class(), - tbf->ms()->egprs_ms_class(), tbf->tlli(), tbf->ta(), tbf->ms()); + gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data, tbf->ms(), tbf->trx->trx_no, tbf->tlli(), tbf->ta()); /* schedule uplink assignment or reject */ if (ul_tbf) { @@ -552,19 +551,17 @@ struct gprs_rlcmac_ul_tbf *ul_tbf = NULL; struct gprs_rlcmac_dl_tbf *dl_tbf = NULL; uint32_t tlli = request->ID.u.TLLI; - uint8_t ms_class = 0; - uint8_t egprs_ms_class = 0; uint8_t ta = GSM48_TA_INVALID; GprsMs *ms = bts()->ms_by_tlli(tlli); + if (!ms) + ms = bts()->ms_alloc(0, 0); /* ms class updated later */ + /* Keep the ms, even if it gets idle temporarily */ GprsMs::Guard guard(ms); - - if (ms) { - ul_tbf = ms->ul_tbf(); - dl_tbf = ms->dl_tbf(); - ta = ms->ta(); - } + ul_tbf = ms->ul_tbf(); + dl_tbf = ms->dl_tbf(); + ta = ms->ta(); /* We got a RACH so the MS was in packet idle mode and thus * didn't have any active TBFs */ @@ -597,20 +594,23 @@ bts()->sba()->free_sba(sba); } if (request->Exist_MS_Radio_Access_capability2) { + uint8_t ms_class, egprs_ms_class; ms_class = Decoding::get_ms_class_by_capability( &request->MS_Radio_Access_capability2); + ms->set_ms_class(ms_class); egprs_ms_class = Decoding::get_egprs_ms_class_by_capability( &request->MS_Radio_Access_capability2); + ms->set_egprs_ms_class(egprs_ms_class); } - if (!ms_class) + if (!ms->ms_class()) LOGP(DRLCMAC, LOGL_NOTICE, "MS does not give us a class.\n"); - if (egprs_ms_class) + if (ms->egprs_ms_class()) LOGP(DRLCMAC, LOGL_NOTICE, "MS supports EGPRS multislot class %d.\n", - egprs_ms_class); - ul_tbf = tbf_alloc_ul(bts_data(), trx_no(), ms_class, - egprs_ms_class, tlli, ta, ms); + ms->egprs_ms_class()); + + ul_tbf = tbf_alloc_ul(bts_data(), ms, trx_no(), tlli, ta); if (!ul_tbf) { handle_tbf_reject(bts_data(), ms, tlli, @@ -626,10 +626,6 @@ /* schedule uplink assignment */ TBF_SET_ASS_STATE_UL(ul_tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); - /* get capabilities */ - if (ul_tbf->ms()) - ul_tbf->ms()->set_egprs_ms_class(egprs_ms_class); - /* get measurements */ if (ul_tbf->ms()) { get_meas(meas, request); diff --git a/src/tbf.cpp b/src/tbf.cpp index fb985d4..e41ed9f 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -415,17 +415,15 @@ ms()->confirm_tlli(tlli); } -gprs_rlcmac_ul_tbf *tbf_alloc_ul(struct gprs_rlcmac_bts *bts, - int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, - uint32_t tlli, uint8_t ta, GprsMs *ms) +gprs_rlcmac_ul_tbf *tbf_alloc_ul(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, + uint32_t tlli, uint8_t ta) { struct gprs_rlcmac_ul_tbf *tbf; /* FIXME: Copy and paste with tbf_new_dl_assignment */ /* create new TBF, use same TRX as DL TBF */ /* use multislot class of downlink TBF */ - tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, - false); + tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, false); if (!tbf) { LOGP(DTBF, LOGL_NOTICE, "No PDCH resource\n"); /* FIXME: send reject */ @@ -979,13 +977,14 @@ } } -struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, - uint8_t egprs_ms_class, bool single_slot) +struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, bool single_slot) { struct gprs_rlcmac_ul_tbf *tbf; int rc; - if (egprs_ms_class == 0 && bts->egprs_enabled) { + OSMO_ASSERT(ms != NULL); + + if (ms->egprs_ms_class() == 0 && bts->egprs_enabled) { LOGP(DTBF, LOGL_NOTICE, "Not accepting non-EGPRS phone in EGPRS-only mode\n"); bts->bts->tbf_failed_egprs_only(); return NULL; @@ -993,26 +992,21 @@ LOGP(DTBF, LOGL_DEBUG, "********** UL-TBF starts here **********\n"); LOGP(DTBF, LOGL_INFO, "Allocating UL TBF: MS_CLASS=%d/%d\n", - ms_class, egprs_ms_class); + ms->ms_class(), ms->egprs_ms_class()); tbf = talloc(tall_pcu_ctx, struct gprs_rlcmac_ul_tbf); - if (!tbf) return NULL; - talloc_set_destructor(tbf, ul_tbf_dtor); new (tbf) gprs_rlcmac_ul_tbf(bts->bts); - if (!ms) - ms = bts->bts->ms_alloc(ms_class, egprs_ms_class); - - if (egprs_ms_class > 0 && bts->egprs_enabled) { + if (ms->egprs_ms_class() > 0 && bts->egprs_enabled) { tbf->enable_egprs(); setup_egprs_mode(bts, ms); LOGPTBF(tbf, LOGL_INFO, "Enabled EGPRS, mode %s\n", mode_name(ms->mode())); } - rc = setup_tbf(tbf, ms, use_trx, ms_class, egprs_ms_class, single_slot); + rc = setup_tbf(tbf, ms, use_trx, ms->ms_class(), ms->egprs_ms_class(), single_slot); /* if no resource */ if (rc < 0) { diff --git a/src/tbf.h b/src/tbf.h index 9545385..33d996f 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -346,12 +346,10 @@ }; -struct gprs_rlcmac_ul_tbf *tbf_alloc_ul(struct gprs_rlcmac_bts *bts, - int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, - uint32_t tlli, uint8_t ta, GprsMs *ms); +struct gprs_rlcmac_ul_tbf *tbf_alloc_ul(struct gprs_rlcmac_bts *bts, GprsMs *ms, + int8_t use_trx, uint32_t tlli, uint8_t ta); -struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, - uint8_t egprs_ms_class, bool single_slot); +struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, bool single_slot); struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, bool single_slot); diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 2fdee3f..abd5d22 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -44,9 +44,11 @@ uint8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, bool single_slot) { + if (dir == GPRS_RLCMAC_UL_TBF && !ms) + ms = bts->bts->ms_alloc(ms_class, egprs_ms_class); + if (dir == GPRS_RLCMAC_UL_TBF) - return tbf_alloc_ul_tbf(bts, ms, use_trx, - ms_class, egprs_ms_class, single_slot); + return tbf_alloc_ul_tbf(bts, ms, use_trx, single_slot); else return tbf_alloc_dl_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, single_slot); @@ -205,6 +207,7 @@ { BTS the_bts; struct gprs_rlcmac_bts *bts = the_bts.bts_data(); + GprsMs *ms; gprs_rlcmac_ul_tbf *ul_tbf; gprs_rlcmac_dl_tbf *dl_tbf; @@ -215,7 +218,8 @@ enable_ts_on_bts(bts, ts0, ts1, ts2, ts3, ts4, ts5, ts6, ts7); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true); + ms = the_bts.ms_alloc(ms_class, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, ms, -1, true); if (!ul_tbf) return false; @@ -247,6 +251,7 @@ { BTS the_bts; struct gprs_rlcmac_bts *bts = the_bts.bts_data(); + GprsMs *ms; gprs_rlcmac_ul_tbf *ul_tbf; gprs_rlcmac_dl_tbf *dl_tbf; @@ -262,14 +267,14 @@ return false; dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF); - + ms = dl_tbf->ms(); OSMO_ASSERT(dl_tbf->ms()); OSMO_ASSERT(dl_tbf->ms()->current_trx()); + ms->set_ms_class(ms_class); dump_assignment(dl_tbf, "DL", verbose); - ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), dl_tbf->ms()->current_trx()->trx_no, ms_class, 0, - false); + ul_tbf = tbf_alloc_ul_tbf(bts, ms, ms->current_trx()->trx_no, false); if (!ul_tbf) return false; @@ -297,6 +302,7 @@ { BTS the_bts; struct gprs_rlcmac_bts *bts = the_bts.bts_data(); + GprsMs *ms; int tfi; uint8_t trx_no; gprs_rlcmac_tbf *ul_tbf, *dl_tbf; @@ -309,7 +315,8 @@ tfi = the_bts.tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, false); + ms = the_bts.ms_alloc(ms_class, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, ms, -1, false); if (!ul_tbf) return false; @@ -455,6 +462,8 @@ struct gprs_rlcmac_bts *bts; uint8_t trx_no = -1; + OSMO_ASSERT(ms != NULL); + bts = the_bts->bts_data(); gprs_rlcmac_tbf *tbf = NULL; @@ -471,7 +480,8 @@ case TEST_MODE_UL_AND_DL: if (ms && ms->ul_tbf()) tbf_free(ms->ul_tbf()); - tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, false); + ms->set_ms_class(ms_class); + tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, false); if (tbf == NULL) return NULL; break; @@ -549,6 +559,8 @@ uint32_t tlli = counter + 0xc0000000; ms = the_bts->ms_by_tlli(tlli); + if (!ms) + ms = the_bts->ms_alloc(0, 0); ms = alloc_tbfs(the_bts, ms, ms_class, mode); if (!ms) diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 6420aca..0a979e5 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -95,8 +95,7 @@ dl_tbf->set_ta(4); gprs_rlcmac_tbf *ul_tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), - dl_tbf->ms(), - 0, 0, 0, false); + dl_tbf->ms(), 0, false); OSMO_ASSERT(ul_tbf != NULL); ul_tbf->update_ms(0x2342, GPRS_RLCMAC_UL_TBF); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 47146dd..3f72266 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -1444,9 +1444,9 @@ Searching for first unallocated TFI: TRX=0 Found TFI=0. MS requests UL TBF on RACH, so we provide one: ra=0x03 Fn=2654167 qta=31 is_11bit=0: +Creating MS object, TLLI = 0x00000000 ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 -Creating MS object, TLLI = 0x00000000 [UL] Slot Allocation (Algorithm A) for class 0 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled @@ -1524,11 +1524,11 @@ Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +Creating MS object, TLLI = 0x00000000 MS requests UL TBF in packet resource request of single block, so we provide one: +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=1/0 -Creating MS object, TLLI = 0x00000000 -Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 [UL] Slot Allocation (Algorithm A) for class 1 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled @@ -1606,11 +1606,11 @@ Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +Creating MS object, TLLI = 0x00000000 MS requests UL TBF in packet resource request of single block, so we provide one: +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=1/0 -Creating MS object, TLLI = 0x00000000 -Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 [UL] Slot Allocation (Algorithm A) for class 1 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled @@ -1736,11 +1736,11 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) No downlink ACK received yet +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +Creating MS object, TLLI = 0x00000000 MS requests UL TBF in packet resource request of single block, so we provide one: +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=1/0 -Creating MS object, TLLI = 0x00000000 -Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 [UL] Slot Allocation (Algorithm A) for class 1 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled @@ -1803,11 +1803,11 @@ Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +Creating MS object, TLLI = 0x00000000 MS requests UL TBF in packet resource request of single block, so we provide one: +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=1/0 -Creating MS object, TLLI = 0x00000000 -Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 [UL] Slot Allocation (Algorithm A) for class 1 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled @@ -1975,11 +1975,11 @@ Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +Creating MS object, TLLI = 0x00000000 MS requests UL TBF in packet resource request of single block, so we provide one: +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=1/0 -Creating MS object, TLLI = 0x00000000 -Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 [UL] Slot Allocation (Algorithm A) for class 1 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled @@ -2059,9 +2059,9 @@ Searching for first unallocated TFI: TRX=0 Found TFI=0. MS requests UL TBF on RACH, so we provide one: ra=0x03 Fn=2654275 qta=31 is_11bit=0: +Creating MS object, TLLI = 0x00000000 ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 -Creating MS object, TLLI = 0x00000000 [UL] Slot Allocation (Algorithm A) for class 0 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled @@ -2126,11 +2126,11 @@ Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +Creating MS object, TLLI = 0x00000000 MS requests UL TBF in packet resource request of single block, so we provide one: +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=1/0 -Creating MS object, TLLI = 0x00000000 -Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 [UL] Slot Allocation (Algorithm A) for class 1 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled @@ -3146,13 +3146,13 @@ Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +Creating MS object, TLLI = 0x00000000 MS requests UL TBF in packet resource request of single block, so we provide one: +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 +Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 MS supports EGPRS multislot class 1. ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=1/1 -Creating MS object, TLLI = 0x00000000 -Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS [UL] Slot Allocation (Algorithm A) for class 1 - Skipping TS 0, because not enabled @@ -3238,13 +3238,13 @@ Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +Creating MS object, TLLI = 0x00000000 MS requests UL TBF in packet resource request of single block, so we provide one: +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 +Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 MS supports EGPRS multislot class 1. ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=1/1 -Creating MS object, TLLI = 0x00000000 -Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS [UL] Slot Allocation (Algorithm A) for class 1 - Skipping TS 0, because not enabled @@ -5877,13 +5877,13 @@ Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +Creating MS object, TLLI = 0x00000000 MS requests UL TBF in packet resource request of single block, so we provide one: +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 +Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 MS supports EGPRS multislot class 1. ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=1/1 -Creating MS object, TLLI = 0x00000000 -Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS [UL] Slot Allocation (Algorithm A) for class 1 - Skipping TS 0, because not enabled @@ -6042,13 +6042,13 @@ Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +Creating MS object, TLLI = 0x00000000 MS requests UL TBF in packet resource request of single block, so we provide one: +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 +Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 MS supports EGPRS multislot class 1. ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=1/1 -Creating MS object, TLLI = 0x00000000 -Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS [UL] Slot Allocation (Algorithm A) for class 1 - Skipping TS 0, because not enabled @@ -6180,9 +6180,9 @@ === end test_tbf_epdan_out_of_rx_window === === start test_immediate_assign_rej_multi_block === MS requests UL TBF on RACH, so we provide one: ra=0x78 Fn=2654167 qta=31 is_11bit=0: +Creating MS object, TLLI = 0x00000000 ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 -Creating MS object, TLLI = 0x00000000 [UL] Slot Allocation (Algorithm A) for class 0 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled @@ -6205,9 +6205,9 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 MS requests UL TBF on RACH, so we provide one: ra=0x79 Fn=2654167 qta=31 is_11bit=0: +Creating MS object, TLLI = 0x00000000 ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 -Creating MS object, TLLI = 0x00000000 [UL] Slot Allocation (Algorithm A) for class 0 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled @@ -6230,9 +6230,9 @@ TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=1 USF=1 MS requests UL TBF on RACH, so we provide one: ra=0x7a Fn=2654167 qta=31 is_11bit=0: +Creating MS object, TLLI = 0x00000000 ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 -Creating MS object, TLLI = 0x00000000 [UL] Slot Allocation (Algorithm A) for class 0 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled @@ -6255,9 +6255,9 @@ TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=2 USF=2 MS requests UL TBF on RACH, so we provide one: ra=0x7b Fn=2654167 qta=31 is_11bit=0: +Creating MS object, TLLI = 0x00000000 ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 -Creating MS object, TLLI = 0x00000000 [UL] Slot Allocation (Algorithm A) for class 0 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled @@ -6280,9 +6280,9 @@ TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=3 USF=3 MS requests UL TBF on RACH, so we provide one: ra=0x7c Fn=2654167 qta=31 is_11bit=0: +Creating MS object, TLLI = 0x00000000 ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 -Creating MS object, TLLI = 0x00000000 [UL] Slot Allocation (Algorithm A) for class 0 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled @@ -6305,9 +6305,9 @@ TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=4 USF=4 MS requests UL TBF on RACH, so we provide one: ra=0x7d Fn=2654167 qta=31 is_11bit=0: +Creating MS object, TLLI = 0x00000000 ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 -Creating MS object, TLLI = 0x00000000 [UL] Slot Allocation (Algorithm A) for class 0 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled @@ -6330,9 +6330,9 @@ TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=5 USF=5 MS requests UL TBF on RACH, so we provide one: ra=0x7e Fn=2654167 qta=31 is_11bit=0: +Creating MS object, TLLI = 0x00000000 ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 -Creating MS object, TLLI = 0x00000000 [UL] Slot Allocation (Algorithm A) for class 0 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled @@ -6355,9 +6355,9 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=6 USF=6 MS requests UL TBF on RACH, so we provide one: ra=0x7f Fn=2654167 qta=31 is_11bit=0: +Creating MS object, TLLI = 0x00000000 ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 -Creating MS object, TLLI = 0x00000000 [UL] Slot Allocation (Algorithm A) for class 0 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled @@ -6387,13 +6387,13 @@ Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +Creating MS object, TLLI = 0x00000000 MS requests UL TBF in packet resource request of single block, so we provide one: +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 +Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 MS supports EGPRS multislot class 1. ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=1/1 -Creating MS object, TLLI = 0x00000000 -Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS [UL] Slot Allocation (Algorithm A) for class 1 - Skipping TS 0, because not enabled @@ -7810,9 +7810,9 @@ === end test_packet_access_rej_epdan === === start test_packet_access_rej_prr === MS requests UL TBF on RACH, so we provide one: ra=0x78 Fn=2654167 qta=31 is_11bit=0: +Creating MS object, TLLI = 0x00000000 ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 -Creating MS object, TLLI = 0x00000000 [UL] Slot Allocation (Algorithm A) for class 0 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled @@ -7835,9 +7835,9 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 MS requests UL TBF on RACH, so we provide one: ra=0x79 Fn=2654167 qta=31 is_11bit=0: +Creating MS object, TLLI = 0x00000000 ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 -Creating MS object, TLLI = 0x00000000 [UL] Slot Allocation (Algorithm A) for class 0 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled @@ -7860,9 +7860,9 @@ TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=1 USF=1 MS requests UL TBF on RACH, so we provide one: ra=0x7a Fn=2654167 qta=31 is_11bit=0: +Creating MS object, TLLI = 0x00000000 ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 -Creating MS object, TLLI = 0x00000000 [UL] Slot Allocation (Algorithm A) for class 0 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled @@ -7885,9 +7885,9 @@ TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=2 USF=2 MS requests UL TBF on RACH, so we provide one: ra=0x7b Fn=2654167 qta=31 is_11bit=0: +Creating MS object, TLLI = 0x00000000 ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 -Creating MS object, TLLI = 0x00000000 [UL] Slot Allocation (Algorithm A) for class 0 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled @@ -7910,9 +7910,9 @@ TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=3 USF=3 MS requests UL TBF on RACH, so we provide one: ra=0x7c Fn=2654167 qta=31 is_11bit=0: +Creating MS object, TLLI = 0x00000000 ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 -Creating MS object, TLLI = 0x00000000 [UL] Slot Allocation (Algorithm A) for class 0 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled @@ -7935,9 +7935,9 @@ TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=4 USF=4 MS requests UL TBF on RACH, so we provide one: ra=0x7d Fn=2654167 qta=31 is_11bit=0: +Creating MS object, TLLI = 0x00000000 ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 -Creating MS object, TLLI = 0x00000000 [UL] Slot Allocation (Algorithm A) for class 0 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled @@ -7960,9 +7960,9 @@ TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=5 USF=5 MS requests UL TBF on RACH, so we provide one: ra=0x7e Fn=2654167 qta=31 is_11bit=0: +Creating MS object, TLLI = 0x00000000 ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 -Creating MS object, TLLI = 0x00000000 [UL] Slot Allocation (Algorithm A) for class 0 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled @@ -7986,14 +7986,14 @@ - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=6 USF=6 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +Creating MS object, TLLI = 0x00000000 MS requests UL TBF in packet resource request of single block, so we provide one: MS requests UL TBF in packet resource request of single block, but there is no resource request scheduled! +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 +Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 MS supports EGPRS multislot class 11. ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=11/11 -Creating MS object, TLLI = 0x00000000 -Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 -Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 [UL] Slot Allocation (Algorithm A) for class 11 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled @@ -8005,7 +8005,6 @@ - Skipping TS 7, because no USF available [UL] algo A <single> (suggested TRX: 0): failed to allocate a TS, no USF available No PDCH resource -Creating MS object, TLLI = 0x00000000 Modifying MS object, UL TLLI: 0x00000000 -> 0xffeeddcc, not yet confirmed TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to ASSIGN Attaching TBF to MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) @@ -8014,7 +8013,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) starting timer T0 [reject (PACCH)] with 0 sec. 2000 microsec, cur_fn=0 Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) (TRX=0, TS=7) === end test_packet_access_rej_prr === -Destroying MS object, TLLI = 0x00000000 === start test_packet_access_rej_prr_no_other_tbfs === Creating MS object, TLLI = 0x00000000 Modifying MS object, UL TLLI: 0x00000000 -> 0xffeeddcc, not yet confirmed diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp index aa0a366..8469d60 100644 --- a/tests/types/TypesTest.cpp +++ b/tests/types/TypesTest.cpp @@ -674,7 +674,8 @@ the_bts.bts_data()->alloc_algorithm = alloc_algorithm_a; the_bts.bts_data()->trx[0].pdch[4].enable(); - struct gprs_rlcmac_ul_tbf *tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), NULL, 0, 1, 1, true); + GprsMs *ms = the_bts.ms_alloc(1, 1); + struct gprs_rlcmac_ul_tbf *tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), ms, 0, true); struct crbb_test crbb_test = {0}; bitvec *rbb = NULL; unsigned int rbb_size; @@ -779,7 +780,8 @@ the_bts.bts_data()->trx[0].pdch[4].enable(); the_bts.bts_data()->trx[0].pdch[5].enable(); - struct gprs_rlcmac_tbf *tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), NULL, 0, 1, 1, false); + GprsMs *ms = the_bts.ms_alloc(1, 1); + struct gprs_rlcmac_tbf *tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), ms, 0, false); static uint8_t res[] = { 0x06, 0x3f, /* Immediate Assignment Message Type */ 0x10, /* §10.5.2.26 Page Mode and §10.5.2.25b Dedicated mode/TBF */ @@ -819,7 +821,8 @@ the_bts.bts_data()->trx[0].pdch[1].enable(); the_bts.bts_data()->trx[0].pdch[2].enable(); - struct gprs_rlcmac_tbf *tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), NULL, 0, 1, 1, false); + GprsMs *ms = the_bts.ms_alloc(1, 1); + struct gprs_rlcmac_tbf *tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), ms, 0, false); static uint8_t res[] = { 0x06, 0x3f, /* Immediate Assignment Message Type */ 0x10, /* §10.5.2.26 Page Mode and §10.5.2.25b Dedicated mode/TBF */ -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/18133 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: I010aa5877902816ae246e09ad5ad87946f96855c Gerrit-Change-Number: 18133 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pes...@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <axilira...@gmail.com> Gerrit-Reviewer: laforge <lafo...@osmocom.org> Gerrit-Reviewer: pespin <pes...@sysmocom.de> Gerrit-MessageType: merged