aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2023-04-20 20:20:48 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2023-04-21 14:43:30 +0200
commita42b174beca450ee667d597f87db6a62cdd9d853 (patch)
tree5268ac4ae3ddb1fb47a0e35a20d002fc772fbb41
parenta6a972e11e651ff9e5e0e9ddf25c3c3b0e8eb26e (diff)
alloc_algo: Move printing outside of update_ms_reserved_slots()
-rw-r--r--src/alloc_algo.cpp16
-rw-r--r--tests/tbf/TbfTest.err12
2 files changed, 13 insertions, 15 deletions
diff --git a/src/alloc_algo.cpp b/src/alloc_algo.cpp
index 9d4db4c5..bc44cbf3 100644
--- a/src/alloc_algo.cpp
+++ b/src/alloc_algo.cpp
@@ -773,22 +773,14 @@ static int allocate_usf(const gprs_rlcmac_trx *trx, uint8_t selected_ul_slots, u
* \param[in] tbf_ Pointer to TBF struct
* \param[in] res_ul_slots Newly reserved UL slots
* \param[in] res_dl_slots Newly reserved DL slots
- * \param[in] ul_slots available UL slots (for logging only)
- * \param[in] dl_slots available DL slots (for logging only)
*/
-static void update_ms_reserved_slots(gprs_rlcmac_trx *trx, GprsMs *ms, uint8_t res_ul_slots, uint8_t res_dl_slots,
- uint8_t ul_slots, uint8_t dl_slots)
+static void update_ms_reserved_slots(gprs_rlcmac_trx *trx, GprsMs *ms, uint8_t res_ul_slots, uint8_t res_dl_slots)
{
- char slot_info[9] = { 0 };
-
if (res_ul_slots == ms_reserved_ul_slots(ms) && res_dl_slots == ms_reserved_dl_slots(ms))
return;
/* The reserved slots have changed, update the MS */
ms_set_reserved_slots(ms, trx, res_ul_slots, res_dl_slots);
-
- ts_format(slot_info, dl_slots, ul_slots);
- LOGP(DRLCMAC, LOGL_DEBUG, "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info);
}
/*! Assign given UL timeslots to UL TBF
@@ -857,6 +849,7 @@ int alloc_algorithm_b(const struct alloc_resources_req *req)
int rc;
int tfi;
gprs_rlcmac_trx *trx;
+ char slot_info[9] = { 0 };
struct gprs_rlcmac_pdch *first_common_ts = ms_first_common_ts(req->ms);
LOGPAL(req, "B", LOGL_DEBUG, "Alloc start\n");
@@ -927,12 +920,15 @@ int alloc_algorithm_b(const struct alloc_resources_req *req)
LOGPAL(req, "B", LOGL_INFO, "using %d slots\n", slotcount);
}
+ ts_format(slot_info, dl_slots, ul_slots);
+ LOGP(DRLCMAC, LOGL_DEBUG, "- Available DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info);
+
/* The allocation will be successful, so the system state and tbf/ms
* may be modified from now on. */
/* Step 4: Update MS and TBF and really allocate the resources */
- update_ms_reserved_slots(trx, req->ms, reserved_ul_slots, reserved_dl_slots, ul_slots, dl_slots);
+ update_ms_reserved_slots(trx, req->ms, reserved_ul_slots, reserved_dl_slots);
ms_set_first_common_ts(req->ms, first_common_ts);
req->tbf->trx = trx;
diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err
index 657db59c..2b844db4 100644
--- a/tests/tbf/TbfTest.err
+++ b/tests/tbf/TbfTest.err
@@ -4159,7 +4159,7 @@ Slot Allocation (Algorithm B) for class 12
Rx=4 Tx=4 Sum Rx+Tx=5, Tta=2 Ttb=1, Tra=2 Trb=1, Type=1
Selected DL slots: (TS=0)"..DDDD.."(TS=7), multi
[DL] algo B <multi> (suggested TRX: 0): using 4 slots
-- Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7)
+- Available DL/UL slots: (TS=0)"..DDCD.."(TS=7)
- Assigning DL TS 2
PDCH(bts=0,trx=0,ts=2) Attaching TBF(DL:TFI-0-0-0:STATE-NEW:GPRS), 1 TBFs, USFs = 00, TFIs = 00000001.
- Assigning DL TS 3
@@ -4205,7 +4205,7 @@ Slot Allocation (Algorithm B) for class 12
Rx=4 Tx=4 Sum Rx+Tx=5, Tta=2 Ttb=1, Tra=2 Trb=1, Type=1
Selected DL slots: (TS=0)"..DDDD.."(TS=7), multi
[DL] algo B <multi> (suggested TRX: 0): using 4 slots
-- Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7)
+- Available DL/UL slots: (TS=0)"..DDCD.."(TS=7)
- Assigning DL TS 2
PDCH(bts=0,trx=0,ts=2) Attaching TBF(DL:TFI-0-0-0:STATE-NEW:EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001.
- Assigning DL TS 3
@@ -7551,7 +7551,7 @@ Slot Allocation (Algorithm B) for class 11
Rx=4 Tx=3 Sum Rx+Tx=5, Tta=3 Ttb=1, Tra=2 Trb=1, Type=1
Selected DL slots: (TS=0)"..ddDd.."(TS=7), single
[DL] algo B <single> (suggested TRX: 0): using single slot at TS 4
-- Reserved DL/UL slots: (TS=0)"...DC..."(TS=7)
+- Available DL/UL slots: (TS=0)"...DC..."(TS=7)
- Assigning DL TS 4
PDCH(bts=0,trx=0,ts=4) Attaching TBF(DL:TFI-0-0-0:STATE-NEW:EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001.
TBF(DL:TFI-0-0-0:STATE-NEW:EGPRS) Setting Control TS PDCH(bts=0,trx=0,ts=4)
@@ -7567,6 +7567,7 @@ PDCH(bts=0,trx=0,ts=4) Detaching TBF(DL:TFI-0-0-0:STATE-NEW:EGPRS), 1 TBFs, USFs
Found first unallocated TRX=0 TFI=0
Selected DL slots: (TS=0)"..DDDD.."(TS=7), multi
[DL] algo B <multi> (suggested TRX: -1): using 4 slots
+- Available DL/UL slots: (TS=0)"..DDCD.."(TS=7)
- Assigning DL TS 2
PDCH(bts=0,trx=0,ts=2) Attaching TBF(DL:TFI-0-0-0:STATE-NEW:EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001.
- Assigning DL TS 3
@@ -9976,7 +9977,7 @@ Rx=4 Tx=3 Sum Rx+Tx=5, Tta=3 Ttb=1, Tra=2 Trb=1, Type=1
- Skipping TS 6, because num TBFs 0 >= 0
Selected DL slots: (TS=0)".ddd.D.."(TS=7), single
[DL] algo B <single> (suggested TRX: -1): using single slot at TS 5
-- Reserved DL/UL slots: (TS=0)"..D..CU."(TS=7)
+- Available DL/UL slots: (TS=0)"..D..CU."(TS=7)
- Assigning DL TS 5
PDCH(bts=0,trx=1,ts=5) Attaching TBF(DL:TFI-0-1-0:STATE-NEW:GPRS:IMSI-001001000000001:TLLI-0xa3c2f953), 1 TBFs, USFs = 00, TFIs = 00000001.
TBF(DL:TFI-0-1-0:STATE-NEW:GPRS:IMSI-001001000000001:TLLI-0xa3c2f953) Setting Control TS PDCH(bts=0,trx=1,ts=5)
@@ -10014,7 +10015,7 @@ Rx=4 Tx=4 Sum Rx+Tx=5, Tta=2 Ttb=1, Tra=2 Trb=1, Type=1
- Skipping TS 3, because num TBFs 0 >= 0
Selected UL slots: (TS=0)"..U.uu.."(TS=7), single
[UL] algo B <single> (suggested TRX: 0): using single slot at TS 2
-- Reserved DL/UL slots: (TS=0)"..C.DDD."(TS=7)
+- Available DL/UL slots: (TS=0)"..C.DDD."(TS=7)
- Assigning UL TS 2
PDCH(bts=0,trx=0,ts=2) Attaching TBF(UL:TFI-0-0-0:STATE-NEW:GPRS:TLLI-0xecc1f953), 1 TBFs, USFs = 01, TFIs = 00000001.
TBF(UL:TFI-0-0-0:STATE-NEW:GPRS:TLLI-0xecc1f953) Setting Control TS PDCH(bts=0,trx=0,ts=2)
@@ -10047,6 +10048,7 @@ DL_TBF{NEW}: Allocated
Found first unallocated TRX=0 TFI=0
Selected DL slots: (TS=0)".DDDddd."(TS=7), multi
[DL] algo B <multi> (suggested TRX: 0): using 3 slots
+- Available DL/UL slots: (TS=0)"..C.DDD."(TS=7)
- Assigning DL TS 1
PDCH(bts=0,trx=0,ts=1) Attaching TBF(DL:TFI-0-0-0:STATE-NEW:GPRS:IMSI-001001000000001:TLLI-0xecc1f953), 1 TBFs, USFs = 00, TFIs = 00000001.
- Assigning DL TS 2