diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-06-30 10:24:37 +0200 |
---|---|---|
committer | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-07-03 15:37:16 +0200 |
commit | 5cd496d2083bef03d9f2425cabec9ec51c8e9254 (patch) | |
tree | d57421fed40f1783e145fd66af692c365b1d610c /src | |
parent | 83426b20a30832cbacd8165f5b757910e98f5417 (diff) |
alloc: Base algo A on reserved PDCHs
Currently algorithm A bases its time slots selection on the number of
TBF actively using the PDCHs. This statistically prefers the first
time slots, especially with short living TBFs. So when the first TBF
is triggered by an uplink transfer (which generally results in a
short-lived TBF) the potentially longer living DL TBF will be bound
to the same slot. When another MS then requests an uplink TBF, it
will get the same slot (no UL TBF currently active).
This commit changes the algorithm to base its selection on reserved
slots instead.
Sponsored-by: On-Waves ehf
Diffstat (limited to 'src')
-rw-r--r-- | src/gprs_rlcmac_ts_alloc.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 116cabe0..8d4357e7 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -241,25 +241,26 @@ int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, { struct gprs_rlcmac_pdch *pdch; int ts = -1; + uint8_t ul_slots, dl_slots; int usf = -1; int mask = 0xff; const char *mask_reason = NULL; - struct gprs_rlcmac_tbf *ref_tbf; LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm A) for class " "%d\n", tbf->ms_class()); - if ((ref_tbf = ms->tbf(tbf->direction))) - mask_reason = "need to reuse TS"; - else if ((ref_tbf = ms->tbf(reverse(tbf->direction)))) - mask_reason = ref_tbf->direction == GPRS_RLCMAC_UL_TBF ? - "not an uplink TBF" : "not a downlink TBF"; + dl_slots = ms->reserved_dl_slots(); + ul_slots = ms->reserved_ul_slots(); - if (ref_tbf) - ts = ref_tbf->first_common_ts; + ts = ms->first_common_ts(); - if (ts >= 0) + if (ts >= 0) { + mask_reason = "need to reuse TS"; mask = 1 << ts; + } else if (dl_slots || ul_slots) { + mask_reason = "need to use a reserved common TS"; + mask = dl_slots & ul_slots; + } mask = find_possible_pdchs(tbf->trx, 1, mask, mask_reason); if (!mask) @@ -296,6 +297,7 @@ int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, } /* the only one TS is the common TS */ tbf->first_ts = tbf->first_common_ts = ts; + ms->set_reserved_slots(tbf->trx, 1 << ts, 1 << ts); tbf->upgrade_to_multislot = 0; |