diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-06-30 13:40:18 +0200 |
---|---|---|
committer | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-07-01 13:22:30 +0200 |
commit | 4d4fb6597592dc16795868ab24cb9063765c5fb9 (patch) | |
tree | 5c9caced02dfdf64c6fec87a1a0cf62da7bc143d | |
parent | 8cee5c6d06ebc743414df3b3d8ea4af462db0851 (diff) |
alloc: Skip common TS without free USF when rating (TODO)
-rw-r--r-- | src/gprs_rlcmac_ts_alloc.cpp | 8 | ||||
-rw-r--r-- | tests/alloc/AllocTest.cpp | 6 | ||||
-rw-r--r-- | tests/alloc/AllocTest.err | 6 | ||||
-rw-r--r-- | tests/alloc/AllocTest.ok | 29 |
4 files changed, 30 insertions, 19 deletions
diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 5f8bb28d..b9311ed0 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -551,9 +551,11 @@ static int find_multi_slots(struct gprs_rlcmac_bts *bts, } /* Only consider common slots for UL */ if (tx_window & rx_window & (1 << ts)) { - c = 32 - pdch->num_reserved(GPRS_RLCMAC_UL_TBF); - c = OSMO_MAX(c, 1); - capacity += c; + if (find_free_usf(pdch) >= 0) { + c = 32 - pdch->num_reserved(GPRS_RLCMAC_UL_TBF); + c = OSMO_MAX(c, 1); + capacity += c; + } } } diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 931a273c..eefa3b69 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -494,10 +494,10 @@ int main(int argc, char **argv) test_alloc_a(); test_alloc_b(); test_successive_allocation(alloc_algorithm_a, 1, 1, 32, "algorithm A"); - test_successive_allocation(alloc_algorithm_b, 10, 10, 30, "algorithm B class 10"); - test_successive_allocation(alloc_algorithm_b, 12, 12, 30, "algorithm B class 12"); + test_successive_allocation(alloc_algorithm_b, 10, 10, 32, "algorithm B class 10"); + test_successive_allocation(alloc_algorithm_b, 12, 12, 32, "algorithm B class 12"); test_successive_allocation(alloc_algorithm_b, 1, 12, 32, "algorithm B class 1-12"); - test_successive_allocation(alloc_algorithm_b, 1, 29, 27, "algorithm B class 1-29"); + test_successive_allocation(alloc_algorithm_b, 1, 29, 32, "algorithm B class 1-29"); return EXIT_SUCCESS; } diff --git a/tests/alloc/AllocTest.err b/tests/alloc/AllocTest.err index f1c30239..3ab0b225 100644 --- a/tests/alloc/AllocTest.err +++ b/tests/alloc/AllocTest.err @@ -3,7 +3,7 @@ No TFI available. No TFI available. - Failed to allocate a TS, no USF available No TFI available. -No USF available -No USF available No TFI available. -No USF available +No TFI available. +No TFI available. +No TFI available. diff --git a/tests/alloc/AllocTest.ok b/tests/alloc/AllocTest.ok index ec45d802..a9db018b 100644 --- a/tests/alloc/AllocTest.ok +++ b/tests/alloc/AllocTest.ok @@ -8649,11 +8649,13 @@ Going to test assignment with many TBF, algorithm B class 10 TBF[23] class 10 reserves .....DDC TBF[24] class 10 reserves ...DCD.. TBF[25] class 10 reserves .....DCD - TBF[26] class 10 reserves ...CD... - TBF[27] class 10 reserves .....DDC - TBF[28] class 10 reserves ...CD... - TBF[29] class 10 reserves ...DDC.. - Successfully allocated 30 UL TBFs + TBF[26] class 10 reserves ...DDCD. + TBF[27] class 10 reserves ...CD... + TBF[28] class 10 reserves .....DDC + TBF[29] class 10 reserves ...CD... + TBF[30] class 10 reserves ...CD... + TBF[31] class 10 reserves ...CD... + Successfully allocated 32 UL TBFs Going to test assignment with many TBF, algorithm B class 12 TBF[0] class 12 reserves ...DDCD. TBF[1] class 12 reserves .....DCD @@ -8681,11 +8683,13 @@ Going to test assignment with many TBF, algorithm B class 12 TBF[23] class 12 reserves .....DDC TBF[24] class 12 reserves ...DCD.. TBF[25] class 12 reserves .....DCD - TBF[26] class 12 reserves ...CD... - TBF[27] class 12 reserves .....DDC + TBF[26] class 12 reserves ...DDCD. + TBF[27] class 12 reserves ....DDDC TBF[28] class 12 reserves ...CD... - TBF[29] class 12 reserves ...DDC.. - Successfully allocated 30 UL TBFs + TBF[29] class 12 reserves ...CD... + TBF[30] class 12 reserves ...CD... + TBF[31] class 12 reserves ...CD... + Successfully allocated 32 UL TBFs Going to test assignment with many TBF, algorithm B class 1-12 TBF[0] class 1 reserves ...C.... TBF[1] class 2 reserves ....DC.. @@ -8748,4 +8752,9 @@ Going to test assignment with many TBF, algorithm B class 1-29 TBF[24] class 25 reserves ....DDCD TBF[25] class 26 reserves ...DCDD. TBF[26] class 27 reserves ....DCDD - Successfully allocated 27 UL TBFs + TBF[27] class 28 reserves ...DDDDC + TBF[28] class 29 reserves ...DDDDC + TBF[29] class 1 reserves ...C.... + TBF[30] class 2 reserves ......DC + TBF[31] class 3 reserves ...C.... + Successfully allocated 32 UL TBFs |