aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2016-02-01 19:42:09 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2016-02-02 17:06:39 +0100
commit2d62a4e8442b4e71f3c07b1188a4fa18b82e79e8 (patch)
tree481e5519621298e1c647b03b849a540f7d3a3e72
parentd325999dc16505b1e618d2f3b047839e164b4dd1 (diff)
sched: Do PACCH assignments for the same direction last
Currently the selection of a pending control message is done round robin. It can possibly happen, that a DL assigment is sent on a DL TBF while an UL assignment is pending. The MS will replace the old DL TBF in that case, so that it can no longer be used for the PACCH so that the UL assignment is lost. Give assigment requests for the same direction a lower priority. Sponsored-by: On-Waves ehf
-rw-r--r--src/gprs_rlcmac_sched.cpp27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp
index e03f84b..313e23f 100644
--- a/src/gprs_rlcmac_sched.cpp
+++ b/src/gprs_rlcmac_sched.cpp
@@ -130,14 +130,18 @@ static struct msgb *sched_select_ctrl_msg(
if (!tbf)
continue;
- if (tbf == ul_ass_tbf)
+ /*
+ * Assignments for the same direction have lower precedence,
+ * because they may kill the TBF when the CONTOL ACK is
+ * received, thus preventing the others from being processed.
+ */
+
+ if (tbf == ul_ass_tbf && tbf->direction == GPRS_RLCMAC_DL_TBF)
msg = ul_ass_tbf->create_ul_ass(fn, ts);
- else if (tbf == dl_ass_tbf)
+ else if (tbf == dl_ass_tbf && tbf->direction == GPRS_RLCMAC_UL_TBF)
msg = dl_ass_tbf->create_dl_ass(fn, ts);
else if (tbf == ul_ack_tbf)
msg = ul_ack_tbf->create_ul_ack(fn, ts);
- else
- abort();
if (!msg) {
tbf = NULL;
@@ -149,6 +153,21 @@ static struct msgb *sched_select_ctrl_msg(
break;
}
+ if (!msg) {
+ /*
+ * If one of these is left, the response (CONTROL ACK) from the
+ * MS will kill the current TBF, only one of them can be
+ * non-NULL
+ */
+ if (dl_ass_tbf) {
+ tbf = dl_ass_tbf;
+ msg = dl_ass_tbf->create_dl_ass(fn, ts);
+ } else if (ul_ass_tbf) {
+ tbf = ul_ass_tbf;
+ msg = ul_ass_tbf->create_ul_ass(fn, ts);
+ }
+ }
+
/* any message */
if (msg) {
tbf->rotate_in_list();