From 2a7ac81b0b92d1471a0bf0651d83b7ace7da94d2 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Wed, 6 Nov 2019 12:30:50 +0100 Subject: [PATCH] hotfix: better CQI requests, especially for TDD In TDD mode, CQI requests are not possible in special subframes (at least for some TDD configurations, see 36.213 7.2.3 that says "a DL subframe is valid if it does not contain a DwPTS field if the length is less than 7680 Ts"). In the code, we simply disable CQI requests in special subframes, no matter what the length of DwPTS. A problem can arise if the DCI0 for a given UE are sent only in those special subframes. In this case the UE will never report CQI and the eNB will use low MCS for this UE, impacting performances. Another, related, problem is when there are several UEs. There again one UE might always get its DCI0 in special subframes and thus never report CQI. There again, performance issues. This commit is an attempt to improve the situation. It does two things. 1 - tag the UE as schedulable in the function UE_is_to_be_scheduled if the cqi_req_timer is expired 2 - use cqi_req_timer as a criterium when ordering UEs for UL scheduling The value chosen for the expiration of the cqi_req_timer in UE_is_to_be_scheduled is quite high (300) because as the code is today we may overschedule the UE for short bursts until we receive a CQI from the UE. [TODO: fix the code properly to avoid this behavior.] Note: the fairRR scheduler has not been analyzed and this commit may not fix anything in case the fairRR scheduler is used. --- openair2/LAYER2/MAC/eNB_scheduler_primitives.c | 8 +++++--- openair2/LAYER2/MAC/pre_processor.c | 8 ++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 63f838f652..6750998b9f 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -2523,6 +2523,7 @@ UE_is_to_be_scheduled(module_id_t module_idP, { UE_TEMPLATE *UE_template = &RC.mac[module_idP]->UE_list.UE_template[CC_id][UE_id]; UE_sched_ctrl_t *UE_sched_ctl = &RC.mac[module_idP]->UE_list.UE_sched_ctrl[UE_id]; + int rrc_status; // do not schedule UE if UL is not working if (UE_sched_ctl->ul_failure_timer > 0 || UE_sched_ctl->ul_out_of_sync > 0) @@ -2535,13 +2536,14 @@ UE_is_to_be_scheduled(module_id_t module_idP, UE_id, ue_rnti); + rrc_status = mac_eNB_get_rrc_status(module_idP, ue_rnti); + if (UE_template->scheduled_ul_bytes < UE_template->estimated_ul_buffer || UE_template->ul_SR > 0 || // uplink scheduling request (UE_sched_ctl->ul_inactivity_timer > 19 && UE_sched_ctl->ul_scheduled == 0) || // every 2 frames when RRC_CONNECTED (UE_sched_ctl->ul_inactivity_timer > 10 && - UE_sched_ctl->ul_scheduled == 0 && - mac_eNB_get_rrc_status(module_idP, - ue_rnti) < RRC_CONNECTED)) { // every Frame when not RRC_CONNECTED + UE_sched_ctl->ul_scheduled == 0 && rrc_status < RRC_CONNECTED) || // every Frame when not RRC_CONNECTED + (UE_sched_ctl->cqi_req_timer > 300 && rrc_status >= RRC_CONNECTED)) { // cqi req timer expired long ago (do not put too low value) LOG_D(MAC, "[eNB %d][PUSCH] UE %d/%x should be scheduled (BSR0 estimated size %d, SR %d)\n", module_idP, UE_id, diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index 0dc11b0e45..40f9334bfa 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -2024,6 +2024,14 @@ static int ue_ul_compare(const void *_a, const void *_b, void *_params) { UE_list->UE_template[pCCid2][UE_id2].pre_assigned_mcs_ul) return 1; + if (UE_list->UE_sched_ctrl[UE_id1].cqi_req_timer > + UE_list->UE_sched_ctrl[UE_id2].cqi_req_timer) + return -1; + + if (UE_list->UE_sched_ctrl[UE_id1].cqi_req_timer < + UE_list->UE_sched_ctrl[UE_id2].cqi_req_timer) + return 1; + return 0; } -- 2.26.2