Commit d106f6f8 authored by Robert Schmidt's avatar Robert Schmidt

Schedule UEs when they have a SR

parent 93be3017
...@@ -512,7 +512,6 @@ int next_list_entry_looped(NR_list_t *list, int UE_id) ...@@ -512,7 +512,6 @@ int next_list_entry_looped(NR_list_t *list, int UE_id)
} }
float ul_thr_ue[MAX_MOBILES_PER_GNB]; float ul_thr_ue[MAX_MOBILES_PER_GNB];
int bsr0ue = -1;
void pf_ul(module_id_t module_id, void pf_ul(module_id_t module_id,
frame_t frame, frame_t frame,
sub_frame_t slot, sub_frame_t slot,
...@@ -532,12 +531,6 @@ void pf_ul(module_id_t module_id, ...@@ -532,12 +531,6 @@ void pf_ul(module_id_t module_id,
int ue_array[MAX_MOBILES_PER_GNB]; int ue_array[MAX_MOBILES_PER_GNB];
NR_list_t UE_sched = { .head = -1, .next = ue_array, .tail = -1, .len = MAX_MOBILES_PER_GNB }; NR_list_t UE_sched = { .head = -1, .next = ue_array, .tail = -1, .len = MAX_MOBILES_PER_GNB };
/* Hack: currently, we do not have SR, and need to schedule UEs continuously.
* To keep the wasted resources low, we switch UEs to be scheduled in a
* round-robin fashion below, and only schedule a UE with BSR=0 if it is the
* selected one */
bsr0ue = next_list_entry_looped(UE_list, bsr0ue);
/* Loop UE_list to calculate throughput and coeff */ /* Loop UE_list to calculate throughput and coeff */
for (int UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) { for (int UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) {
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
...@@ -621,11 +614,10 @@ void pf_ul(module_id_t module_id, ...@@ -621,11 +614,10 @@ void pf_ul(module_id_t module_id,
sched_pusch->Qm <<= 1; sched_pusch->Qm <<= 1;
} }
/* Check BSR and schedule UE if it is zero to avoid starvation, since we do /* Schedule UE if there is a SR and no data (otherwise, will be scheduled
* not have SR (yet) */ * baded on data to transmit) */
if (sched_ctrl->estimated_ul_buffer - sched_ctrl->sched_ul_bytes <= 0) { if (sched_ctrl->estimated_ul_buffer - sched_ctrl->sched_ul_bytes <= 0
if (UE_id != bsr0ue) && sched_ctrl->SR) {
continue;
/* if no data, pre-allocate 5RB */ /* if no data, pre-allocate 5RB */
bool freeCCE = find_free_CCE(module_id, slot, UE_id); bool freeCCE = find_free_CCE(module_id, slot, UE_id);
if (!freeCCE) { if (!freeCCE) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment