From 16c6ecc3657f62728845764731c189b3cb8daca2 Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Tue, 30 Jun 2015 13:40:18 +0200 Subject: alloc: Skip common TS without free USF when rating Currently the search of the "best" slot combination is done separately from the UL slot selection, which can lead to an allocation failure due to USF exhaustion even if another combination had been possible. This commit reduces the probability for this event by skipping UL slots without free USF while calculation the capacity. Note that the implementation is rather inefficient which will be fixed by the following commits. Sponsored-by: On-Waves ehf --- src/gprs_rlcmac_ts_alloc.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 338362c6..1819b5b5 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; + } } } -- cgit v1.2.3