aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gprs_rlcmac_ts_alloc.cpp5
-rw-r--r--tests/alloc/AllocTest.cpp10
-rw-r--r--tests/alloc/AllocTest.err8
-rw-r--r--tests/alloc/AllocTest.ok116
4 files changed, 66 insertions, 73 deletions
diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp
index bfc8c31..338362c 100644
--- a/src/gprs_rlcmac_ts_alloc.cpp
+++ b/src/gprs_rlcmac_ts_alloc.cpp
@@ -732,6 +732,11 @@ int alloc_algorithm_b(struct gprs_rlcmac_bts *bts,
slotcount++;
ul_tbf->first_ts = ts;
+ /* We will stick to that single UL slot, unreserve the others */
+ if (ul_slots != ms->reserved_ul_slots())
+ ms->set_reserved_slots(tbf->trx,
+ ul_slots, ms->reserved_dl_slots());
+
avail_count = bitcount(ms->reserved_ul_slots());
#if 0 /* This code assigns multiple slots for UL (and wastes USFs that way) */
for (ts = 0; ts < 8; ts++) {
diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp
index b804aab..10352cf 100644
--- a/tests/alloc/AllocTest.cpp
+++ b/tests/alloc/AllocTest.cpp
@@ -565,13 +565,13 @@ static void test_successive_allocation()
test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_UL_AND_DL,
32, "algorithm A (UL and DL)");
test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_UL_AND_DL,
- 32, "algorithm B class 10 (UL and DL)");
+ 30, "algorithm B class 10 (UL and DL)");
test_successive_allocation(alloc_algorithm_b, 12, 12, TEST_MODE_UL_AND_DL,
- 32, "algorithm B class 12 (UL and DL)");
+ 30, "algorithm B class 12 (UL and DL)");
test_successive_allocation(alloc_algorithm_b, 1, 12, TEST_MODE_UL_AND_DL,
32, "algorithm B class 1-12 (UL and DL)");
test_successive_allocation(alloc_algorithm_b, 1, 29, TEST_MODE_UL_AND_DL,
- 31, "algorithm B class 1-29 (UL and DL)");
+ 27, "algorithm B class 1-29 (UL and DL)");
test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_DL_AND_UL,
32, "algorithm A (DL and UL)");
@@ -586,12 +586,12 @@ static void test_successive_allocation()
test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_UL_AFTER_DL,
32, "algorithm A (UL after DL)");
test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_UL_AFTER_DL,
- 32, "algorithm B class 10 (UL after DL)");
+ 30, "algorithm B class 10 (UL after DL)");
test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_UL_ONLY,
32, "algorithm A (UL only)");
test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_UL_ONLY,
- 32, "algorithm B class 10 (UL only)");
+ 30, "algorithm B class 10 (UL only)");
test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_DL_ONLY,
32, "algorithm A (DL ONLY)");
diff --git a/tests/alloc/AllocTest.err b/tests/alloc/AllocTest.err
index d38a1ce..49ae154 100644
--- a/tests/alloc/AllocTest.err
+++ b/tests/alloc/AllocTest.err
@@ -3,17 +3,17 @@ No TFI available.
No TFI available.
- Failed to allocate a TS, no USF available
No TFI available.
-No TFI available.
-No TFI available.
-No TFI available.
No USF available
-No TFI available.
No USF available
No TFI available.
+No USF available
No TFI available.
+No USF available
No TFI available.
No TFI available.
No TFI available.
+No USF available
No TFI available.
+No USF available
No TFI available.
No TFI available.
diff --git a/tests/alloc/AllocTest.ok b/tests/alloc/AllocTest.ok
index f8fb485..8e9620a 100644
--- a/tests/alloc/AllocTest.ok
+++ b/tests/alloc/AllocTest.ok
@@ -8645,17 +8645,15 @@ Going to test assignment with many TBF, algorithm B class 10 (UL and DL)
TBF[19] class 10 reserves .....DDC
TBF[20] class 10 reserves ...DCD..
TBF[21] class 10 reserves .....DCD
- TBF[22] class 10 reserves ...CD...
+ TBF[22] class 10 reserves ...DDC..
TBF[23] class 10 reserves .....DDC
- TBF[24] class 10 reserves ...CD...
- TBF[25] class 10 reserves ...CD...
- TBF[26] class 10 reserves .....DCD
- TBF[27] class 10 reserves ...CD...
- TBF[28] class 10 reserves ....DCD.
- TBF[29] class 10 reserves .....DDC
- TBF[30] class 10 reserves ...CD...
- TBF[31] class 10 reserves ...CD...
- Successfully allocated 32 UL TBFs
+ 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
Going to test assignment with many TBF, algorithm B class 12 (UL and DL)
TBF[0] class 12 reserves ...DDCD.
TBF[1] class 12 reserves .....DCD
@@ -8679,17 +8677,15 @@ Going to test assignment with many TBF, algorithm B class 12 (UL and DL)
TBF[19] class 12 reserves .....DDC
TBF[20] class 12 reserves ...DCD..
TBF[21] class 12 reserves .....DCD
- TBF[22] class 12 reserves ...CD...
+ TBF[22] class 12 reserves ...DDC..
TBF[23] class 12 reserves .....DDC
- TBF[24] class 12 reserves ...CD...
- TBF[25] class 12 reserves ...CD...
- TBF[26] class 12 reserves .....DCD
- TBF[27] class 12 reserves ...CD...
- TBF[28] class 12 reserves ....DCD.
- TBF[29] class 12 reserves .....DDC
- TBF[30] class 12 reserves ...CD...
- TBF[31] class 12 reserves ...CD...
- Successfully allocated 32 UL TBFs
+ 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[28] class 12 reserves ...CD...
+ TBF[29] class 12 reserves ...DDC..
+ Successfully allocated 30 UL TBFs
Going to test assignment with many TBF, algorithm B class 1-12 (UL and DL)
TBF[0] class 1 reserves ...C....
TBF[1] class 2 reserves ....DC..
@@ -8707,22 +8703,22 @@ Going to test assignment with many TBF, algorithm B class 1-12 (UL and DL)
TBF[13] class 2 reserves ......DC
TBF[14] class 3 reserves ...DC...
TBF[15] class 4 reserves ....DCD.
- TBF[16] class 5 reserves ...CD...
- TBF[17] class 6 reserves ......CD
- TBF[18] class 7 reserves ...CD...
- TBF[19] class 8 reserves ....DDCD
- TBF[20] class 9 reserves .....DDC
- TBF[21] class 10 reserves ...DDC..
- TBF[22] class 11 reserves .....DDC
- TBF[23] class 12 reserves ...DCD..
+ TBF[16] class 5 reserves ......CD
+ TBF[17] class 6 reserves ...CD...
+ TBF[18] class 7 reserves ......DC
+ TBF[19] class 8 reserves ...DDCD.
+ TBF[20] class 9 reserves ...DCD..
+ TBF[21] class 10 reserves .....DCD
+ TBF[22] class 11 reserves ...DDC..
+ TBF[23] class 12 reserves .....DDC
TBF[24] class 1 reserves ...C....
TBF[25] class 2 reserves ......DC
- TBF[26] class 3 reserves ......DC
- TBF[27] class 4 reserves ...DCD..
+ TBF[26] class 3 reserves ...DC...
+ TBF[27] class 4 reserves .....DCD
TBF[28] class 5 reserves ...CD...
- TBF[29] class 6 reserves .....CD.
- TBF[30] class 7 reserves ...DC...
- TBF[31] class 8 reserves ....DDCD
+ TBF[29] class 6 reserves ......CD
+ TBF[30] class 7 reserves ...CD...
+ TBF[31] class 8 reserves ...DDCD.
Successfully allocated 32 UL TBFs
Going to test assignment with many TBF, algorithm B class 1-29 (UL and DL)
TBF[0] class 1 reserves ...C....
@@ -8744,19 +8740,15 @@ Going to test assignment with many TBF, algorithm B class 1-29 (UL and DL)
TBF[16] class 17 reserves ...DDDCD
TBF[17] class 18 reserves ...DDDDC
TBF[18] class 19 reserves ...DCDD.
- TBF[19] class 20 reserves ...DCDD.
- TBF[20] class 21 reserves ...DDCD.
+ TBF[19] class 20 reserves ....DCDD
+ TBF[20] class 21 reserves ...DCDD.
TBF[21] class 22 reserves ....DDCD
- TBF[22] class 23 reserves ...DDDDC
- TBF[23] class 24 reserves ...DCDD.
- TBF[24] class 25 reserves ....DCDD
+ TBF[22] class 23 reserves ...DCDD.
+ TBF[23] class 24 reserves ....DCDD
+ TBF[24] class 25 reserves ....DDCD
TBF[25] class 26 reserves ...DCDD.
- TBF[26] class 27 reserves ...DDDDC
- TBF[27] class 28 reserves ....DDCD
- TBF[28] class 29 reserves ...CDD..
- TBF[29] class 1 reserves ...C....
- TBF[30] class 2 reserves ......DC
- Successfully allocated 31 UL TBFs
+ TBF[26] class 27 reserves ....DCDD
+ Successfully allocated 27 UL TBFs
Going to test assignment with many TBF, algorithm A (DL and UL)
TBF[0] class 1 reserves ...C....
TBF[1] class 1 reserves ....C...
@@ -8933,17 +8925,15 @@ Going to test assignment with many TBF, algorithm B class 10 (UL after DL)
TBF[19] class 10 reserves .......U
TBF[20] class 10 reserves ....U...
TBF[21] class 10 reserves ......U.
- TBF[22] class 10 reserves ...U....
+ TBF[22] class 10 reserves .....U..
TBF[23] class 10 reserves .......U
- TBF[24] class 10 reserves ...U....
- TBF[25] class 10 reserves ...U....
- TBF[26] class 10 reserves ......U.
- TBF[27] class 10 reserves ...U....
- TBF[28] class 10 reserves .....U..
- TBF[29] class 10 reserves .......U
- TBF[30] class 10 reserves ...U....
- TBF[31] class 10 reserves ...U....
- Successfully allocated 32 UL TBFs
+ TBF[24] class 10 reserves ....U...
+ TBF[25] class 10 reserves ......U.
+ TBF[26] class 10 reserves ...U....
+ TBF[27] class 10 reserves .......U
+ TBF[28] class 10 reserves ...U....
+ TBF[29] class 10 reserves .....U..
+ Successfully allocated 30 UL TBFs
Going to test assignment with many TBF, algorithm A (UL only)
TBF[0] class 1 reserves ...U....
TBF[1] class 1 reserves ....U...
@@ -9001,17 +8991,15 @@ Going to test assignment with many TBF, algorithm B class 10 (UL only)
TBF[19] class 10 reserves .......U
TBF[20] class 10 reserves ....U...
TBF[21] class 10 reserves ......U.
- TBF[22] class 10 reserves ...U....
+ TBF[22] class 10 reserves .....U..
TBF[23] class 10 reserves .......U
- TBF[24] class 10 reserves ...U....
- TBF[25] class 10 reserves ...U....
- TBF[26] class 10 reserves ......U.
- TBF[27] class 10 reserves ...U....
- TBF[28] class 10 reserves .....U..
- TBF[29] class 10 reserves .......U
- TBF[30] class 10 reserves ...U....
- TBF[31] class 10 reserves ...U....
- Successfully allocated 32 UL TBFs
+ TBF[24] class 10 reserves ....U...
+ TBF[25] class 10 reserves ......U.
+ TBF[26] class 10 reserves ...U....
+ TBF[27] class 10 reserves .......U
+ TBF[28] class 10 reserves ...U....
+ TBF[29] class 10 reserves .....U..
+ Successfully allocated 30 UL TBFs
Going to test assignment with many TBF, algorithm A (DL ONLY)
TBF[0] class 1 reserves ...C....
TBF[1] class 1 reserves ....C...