sched: Attempt to improve the fairness and schedule UL/AL ACK/ASS
It is possible that certain UL ACK messages are not sent when there are many many uplink and downlink assignments. Try to be more fair and schedule them round-robin. This way no starvation should occur.
This commit is contained in:
parent
aadfc2e121
commit
705653b2d7
|
@ -67,6 +67,7 @@ struct gprs_rlcmac_pdch {
|
||||||
uint8_t tsc; /* TSC of this slot */
|
uint8_t tsc; /* TSC of this slot */
|
||||||
uint8_t next_ul_tfi; /* next uplink TBF/TFI to schedule (0..31) */
|
uint8_t next_ul_tfi; /* next uplink TBF/TFI to schedule (0..31) */
|
||||||
uint8_t next_dl_tfi; /* next downlink TBF/TFI to schedule (0..31) */
|
uint8_t next_dl_tfi; /* next downlink TBF/TFI to schedule (0..31) */
|
||||||
|
uint8_t next_ctrl_prio; /* next kind of ctrl message to schedule */
|
||||||
struct gprs_rlcmac_tbf *ul_tbf[32]; /* array of UL TBF, by UL TFI */
|
struct gprs_rlcmac_tbf *ul_tbf[32]; /* array of UL TBF, by UL TFI */
|
||||||
struct gprs_rlcmac_tbf *dl_tbf[32]; /* array of DL TBF, by DL TFI */
|
struct gprs_rlcmac_tbf *dl_tbf[32]; /* array of DL TBF, by DL TFI */
|
||||||
struct llist_head paging_list; /* list of paging messages */
|
struct llist_head paging_list; /* list of paging messages */
|
||||||
|
|
|
@ -115,22 +115,30 @@ static struct msgb *sched_select_ctrl_msg(
|
||||||
{
|
{
|
||||||
struct msgb *msg = NULL;
|
struct msgb *msg = NULL;
|
||||||
struct gprs_rlcmac_tbf *tbf = NULL;
|
struct gprs_rlcmac_tbf *tbf = NULL;
|
||||||
|
struct gprs_rlcmac_tbf *next_list[3] = { ul_ass_tbf, dl_ass_tbf, ul_ack_tbf };
|
||||||
|
|
||||||
/* schedule PACKET UPLINK ASSIGNMENT (1st priority) */
|
for (size_t i = 0; i < ARRAY_SIZE(next_list); ++i) {
|
||||||
if (ul_ass_tbf) {
|
tbf = next_list[(pdch->next_ctrl_prio + i) % 3];
|
||||||
tbf = ul_ass_tbf;
|
if (!tbf)
|
||||||
msg = tbf->create_ul_ass(fn);
|
continue;
|
||||||
}
|
|
||||||
/* schedule PACKET DOWNLINK ASSIGNMENT (2nd priotiry) */
|
if (tbf == ul_ass_tbf)
|
||||||
if (!msg && dl_ass_tbf) {
|
msg = tbf->create_ul_ass(fn);
|
||||||
tbf = dl_ass_tbf;
|
else if (tbf == dl_ass_tbf)
|
||||||
msg = tbf->create_dl_ass(fn);
|
msg = tbf->create_dl_ass(fn);
|
||||||
}
|
else
|
||||||
/* schedule PACKET UPLINK ACK (3rd priority) */
|
msg = tbf->create_ul_ack(fn);
|
||||||
if (!msg && ul_ack_tbf) {
|
|
||||||
tbf = ul_ack_tbf;
|
if (!msg) {
|
||||||
msg = tbf->create_ul_ack(fn);
|
tbf = NULL;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
pdch->next_ctrl_prio += i + 1;
|
||||||
|
pdch->next_ctrl_prio %= 3;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* any message */
|
/* any message */
|
||||||
if (msg) {
|
if (msg) {
|
||||||
tbf->rotate_in_list();
|
tbf->rotate_in_list();
|
||||||
|
|
Loading…
Reference in New Issue