aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs_rlcmac_sched.cpp
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-03-02 14:28:12 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-03-06 19:28:10 +0100
commit0eabffdc35bef3bb678014d4c377ab8a2ac5951f (patch)
treebe7d20732c71ead372d8e06d585ed8a93ed34f84 /src/gprs_rlcmac_sched.cpp
parent1842c921b3ed5c941a092542b922274c535111a9 (diff)
sched: Modify DL scheduling to use different priorities
Currently the DL blocks are scheduled round robin to each TBF that is either in state FLOW or FINISHED and not waiting for an IMM.ASS confirmation. This way, if single blocks has been NACK'ed by the MS and the PCU has already resent the missing packets, the PCU starts retransmitting them until it has received an ACK/NACK even if other TBF have RLC blocks that need to be transmitted. This commit changes sched_select_downlink to select the next TBF with the highest priority, where blocks that are going to be resent again have a lower priority unless the window is stalling. If there is only one TBF the old behaviour is kept, since there is no other TBF that can have a higher priority. If there is much packet loss on a single phone, this modification can lead to a higher latency for that MS. Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/gprs_rlcmac_sched.cpp')
-rw-r--r--src/gprs_rlcmac_sched.cpp29
1 files changed, 23 insertions, 6 deletions
diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp
index 40a183b4..c8977e41 100644
--- a/src/gprs_rlcmac_sched.cpp
+++ b/src/gprs_rlcmac_sched.cpp
@@ -167,8 +167,9 @@ static struct msgb *sched_select_downlink(struct gprs_rlcmac_bts *bts,
uint8_t block_nr, struct gprs_rlcmac_pdch *pdch)
{
struct msgb *msg = NULL;
- struct gprs_rlcmac_dl_tbf *tbf = NULL;
- uint8_t i, tfi;
+ struct gprs_rlcmac_dl_tbf *tbf, *prio_tbf = NULL;
+ int prio, max_prio = -1;
+ uint8_t i, tfi, prio_tfi;
/* select downlink resource */
for (i = 0, tfi = pdch->next_dl_tfi; i < 32;
@@ -189,13 +190,29 @@ static struct msgb *sched_select_downlink(struct gprs_rlcmac_bts *bts,
if (tbf->m_wait_confirm)
continue;
+ /* compute priority */
+ if (tbf->state_is(GPRS_RLCMAC_FINISHED) &&
+ tbf->m_window.resend_needed() < 0)
+ /* would re-retransmit blocks */
+ prio = 1;
+ else
+ prio = 2;
+
+ /* get the TBF with the highest priority */
+ if (prio > max_prio) {
+ prio_tfi = tfi;
+ prio_tbf = tbf;
+ max_prio = prio;
+ }
+ }
+
+ if (prio_tbf) {
LOGP(DRLCMACSCHED, LOGL_DEBUG, "Scheduling data message at "
- "RTS for DL TFI=%d (TRX=%d, TS=%d)\n", tfi, trx, ts);
+ "RTS for DL TFI=%d (TRX=%d, TS=%d)\n", prio_tfi, trx, ts);
/* next TBF to handle resource is the next one */
- pdch->next_dl_tfi = (tfi + 1) & 31;
+ pdch->next_dl_tfi = (prio_tfi + 1) & 31;
/* generate DL data block */
- msg = tbf->create_dl_acked_block(fn, ts);
- break;
+ msg = prio_tbf->create_dl_acked_block(fn, ts);
}
return msg;