From 2a7ac81b0b92d1471a0bf0651d83b7ace7da94d2 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Wed, 6 Nov 2019 12:30:50 +0100 Subject: [PATCH 1/5] 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; } From c4255f0dd4cc5f60386514104dc6ad44dd9dcd1a Mon Sep 17 00:00:00 2001 From: "masayuki.harada" Date: Thu, 7 Nov 2019 16:54:08 +0900 Subject: [PATCH 2/5] Fix cqi_req clear timing, and schedule PUSCH when CQI has not been received for a long time in fairRR scheduler. --- openair2/LAYER2/MAC/eNB_scheduler_fairRR.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c index 5b4eca635c..2006059d15 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c @@ -2092,7 +2092,8 @@ void ulsch_scheduler_pre_ue_select_fairRR( UE_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; if ( ((UE_sched_ctl->ul_inactivity_timer>20)&&(UE_sched_ctl->ul_scheduled==0)) || - ((UE_sched_ctl->ul_inactivity_timer>10)&&(UE_sched_ctl->ul_scheduled==0)&&(mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP,UE_id)) < RRC_CONNECTED))) { + ((UE_sched_ctl->ul_inactivity_timer>10)&&(UE_sched_ctl->ul_scheduled==0)&&(mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP,UE_id)) < RRC_CONNECTED)) || + ((UE_sched_ctl->cqi_req_timer>300)&&(UE_sched_ctl->ul_scheduled==0)) ) { first_ue_id[CC_id][ue_first_num[CC_id]]= UE_id; first_ue_total[CC_id] [ue_first_num[CC_id]] = 0; ue_first_num[CC_id]++; @@ -2200,7 +2201,8 @@ void ulsch_scheduler_pre_ue_select_fairRR( if ( (bytes_to_schedule > 0) || (UE_list->UE_template[CC_id][UE_id].ul_SR > 0) || ((UE_sched_ctl->ul_inactivity_timer>20)&&(UE_sched_ctl->ul_scheduled==0)) || - ((UE_sched_ctl->ul_inactivity_timer>10)&&(UE_sched_ctl->ul_scheduled==0)&&(mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP,UE_id)) < RRC_CONNECTED)) ) { + ((UE_sched_ctl->ul_inactivity_timer>10)&&(UE_sched_ctl->ul_scheduled==0)&&(mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP,UE_id)) < RRC_CONNECTED)) || + ((UE_sched_ctl->cqi_req_timer>300)&&(UE_sched_ctl->ul_scheduled==0)) ) { hi_dci0_pdu = &HI_DCI0_req->hi_dci0_pdu_list[HI_DCI0_req->number_of_dci+HI_DCI0_req->number_of_hi]; format_flag = 2; aggregation=get_aggregation(get_bw_index(module_idP,CC_id),UE_list->UE_sched_ctrl[UE_id].dl_cqi[CC_id],format0); @@ -2782,19 +2784,25 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP, if (status < RRC_CONNECTED) cqi_req = 0; - else if (UE_sched_ctrl->cqi_req_timer>30) { + else if (UE_sched_ctrl->cqi_received == 1){ + LOG_D(MAC,"Clearing CQI request timer\n"); + UE_sched_ctrl->cqi_req_flag = 0; + UE_sched_ctrl->cqi_received = 0; + UE_sched_ctrl->cqi_req_timer = 0; + cqi_req = 0; + }else if (UE_sched_ctrl->cqi_req_timer>30) { cqi_req = 1; // To be safe , do not ask CQI in special SFs:36.213/7.2.3 CQI definition if (cc->tdd_Config) { switch (cc->tdd_Config->subframeAssignment) { case 1: - if( sched_subframeP == 1 || sched_subframeP == 6 ) cqi_req=0; + if( subframeP == 1 || subframeP == 6 ) cqi_req=0; break; case 3: - if( sched_subframeP == 1 ) cqi_req=0; + if( subframeP == 1 ) cqi_req=0; break; @@ -2805,7 +2813,6 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP, } if(cqi_req == 1) { - UE_sched_ctrl->cqi_req_timer=0; UE_sched_ctrl->cqi_req_flag |= 1 << sched_subframeP; } } else @@ -2884,6 +2891,7 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP, //store for possible retransmission UE_template->nb_rb_ul[harq_pid] = rb_table[rb_table_index]; UE_template->first_rb_ul[harq_pid] = first_rb[CC_id]; + UE_template->cqi_req[harq_pid] = cqi_req; UE_sched_ctrl->ul_scheduled |= (1<head) @@ -3054,6 +3062,7 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP, //store for possible retransmission UE_template->nb_rb_ul[harq_pid] = ulsch_ue_select[CC_id].list[ulsch_ue_num].nb_rb; UE_template->first_rb_ul[harq_pid] = ulsch_ue_select[CC_id].list[ulsch_ue_num].start_rb; + cqi_req = UE_template->cqi_req[harq_pid]; UE_sched_ctrl->ul_scheduled |= (1< Date: Thu, 7 Nov 2019 21:57:57 +0900 Subject: [PATCH 3/5] Fix scheduling PUSCH when CQI has not been received for a long time in fairRR scheduler. --- openair2/LAYER2/MAC/eNB_scheduler_fairRR.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c index 2006059d15..98d1ffb576 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c @@ -1995,6 +1995,7 @@ void ulsch_scheduler_pre_ue_select_fairRR( int format_flag; nfapi_hi_dci0_request_body_t *HI_DCI0_req; nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu; + int rrc_status; for ( CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++ ) { //save ulsch dci number @@ -2090,10 +2091,11 @@ void ulsch_scheduler_pre_ue_select_fairRR( } UE_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; + rrc_status = mac_eNB_get_rrc_status(module_idP, rnti); if ( ((UE_sched_ctl->ul_inactivity_timer>20)&&(UE_sched_ctl->ul_scheduled==0)) || - ((UE_sched_ctl->ul_inactivity_timer>10)&&(UE_sched_ctl->ul_scheduled==0)&&(mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP,UE_id)) < RRC_CONNECTED)) || - ((UE_sched_ctl->cqi_req_timer>300)&&(UE_sched_ctl->ul_scheduled==0)) ) { + ((UE_sched_ctl->ul_inactivity_timer>10)&&(UE_sched_ctl->ul_scheduled==0)&&(rrc_status < RRC_CONNECTED)) || + ((UE_sched_ctl->cqi_req_timer>300)&&((rrc_status >= RRC_CONNECTED))) ) { first_ue_id[CC_id][ue_first_num[CC_id]]= UE_id; first_ue_total[CC_id] [ue_first_num[CC_id]] = 0; ue_first_num[CC_id]++; @@ -2198,11 +2200,12 @@ void ulsch_scheduler_pre_ue_select_fairRR( int bytes_to_schedule = UE_list->UE_template[CC_id][UE_id].estimated_ul_buffer - UE_list->UE_template[CC_id][UE_id].scheduled_ul_bytes; if (bytes_to_schedule < 0) bytes_to_schedule = 0; + rrc_status = mac_eNB_get_rrc_status(module_idP, rnti); if ( (bytes_to_schedule > 0) || (UE_list->UE_template[CC_id][UE_id].ul_SR > 0) || ((UE_sched_ctl->ul_inactivity_timer>20)&&(UE_sched_ctl->ul_scheduled==0)) || - ((UE_sched_ctl->ul_inactivity_timer>10)&&(UE_sched_ctl->ul_scheduled==0)&&(mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP,UE_id)) < RRC_CONNECTED)) || - ((UE_sched_ctl->cqi_req_timer>300)&&(UE_sched_ctl->ul_scheduled==0)) ) { + ((UE_sched_ctl->ul_inactivity_timer>10)&&(UE_sched_ctl->ul_scheduled==0)&&(rrc_status < RRC_CONNECTED)) || + ((UE_sched_ctl->cqi_req_timer>300)&&((rrc_status >= RRC_CONNECTED))) ) { hi_dci0_pdu = &HI_DCI0_req->hi_dci0_pdu_list[HI_DCI0_req->number_of_dci+HI_DCI0_req->number_of_hi]; format_flag = 2; aggregation=get_aggregation(get_bw_index(module_idP,CC_id),UE_list->UE_sched_ctrl[UE_id].dl_cqi[CC_id],format0); From ccd1b3be53d13bde798245e1efac3715db5eb616 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 7 Nov 2019 17:58:48 +0100 Subject: [PATCH 4/5] CI: preparing release notes for patch --> also adding TDD monolithic test at 20MHz with default scheduler --> putting IF4.p5 TDD scenarios with default scheduler Signed-off-by: Raphael Defosseux --- README.txt | 1 + ...and40_test_20mhz_tm1_default_scheduler.xml | 150 ++++++++++++++++++ .../if4p5_usrp210_band40_test_20mhz.xml | 2 +- 3 files changed, 152 insertions(+), 1 deletion(-) create mode 100644 ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1_default_scheduler.xml diff --git a/README.txt b/README.txt index c65502325f..59f48445e2 100644 --- a/README.txt +++ b/README.txt @@ -43,6 +43,7 @@ openairinterface5g RELEASE NOTES: +v1.1.1 -> November 2019. Bug fix in the TDD Fair Round-Robin scheduler v1.1.0 -> July 2019. This version adds the following implemented features: * Experimental support of LTE-M - Single LTE-M UE attachment, legacy-LTE UE attachment is disabled diff --git a/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1_default_scheduler.xml b/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1_default_scheduler.xml new file mode 100644 index 0000000000..fd018f7a9c --- /dev/null +++ b/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1_default_scheduler.xml @@ -0,0 +1,150 @@ + + + test-20-tm1-defSched + Test-20MHz-TM1-default-scheduler + tasks + + 030201 + 040101 + 030125 040301 040522 040627 040626 040628 040629 040630 040667 040666 040668 040669 040670 040401 040201 030201 + + + + + Initialize_eNB + Initialize eNB (TDD/Band40/20MHz/info) + -O ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf --MACRLCs.[0].scheduler_mode default + + + + Terminate_eNB + Terminate eNB + + + + Initialize_UE + Initialize UE + + + + Terminate_UE + Terminate UE + + + + Attach_UE + Attach UE + + + + Detach_UE + Detach UE + + + + Ping + ping (20MHz - 20 sec) + -c 20 + 25 + + + + Iperf + iperf (20MHz - DL/27.5Mbps/UDP)(30 sec)(balanced) + -u -b 27.5M -t 30 -i 1 + 50 + balanced + + + + Iperf + iperf (20MHz - DL/27.5Mbps/UDP)(30 sec)(single-ue) + -u -b 27.5M -t 30 -i 1 + 50 + single-ue + + + + Iperf + iperf (20MHz - DL/27.5Mbps/UDP)(30 sec)(unbalanced) + -u -b 27.5M -t 30 -i 1 + 50 + unbalanced + + + + Iperf + iperf (20MHz - DL/TCP)(30 sec)(single-ue) + -t 30 -i 1 -fm + 50 + single-ue + + + + Iperf + iperf (20MHz - DL/TCP)(30 sec) + -t 30 -i 1 -fm + 50 + + + + Iperf + iperf (20MHz - UL/7Mbps/UDP)(30 sec)(balanced) + -u -b 7M -t 30 -i 1 -R + 50 + balanced + + + + Iperf + iperf (20MHz - UL/7Mbps/UDP)(30 sec)(single-ue) + -u -b 7M -t 30 -i 1 -R + 50 + single-ue + + + + Iperf + iperf (20MHz - UL/7Mbps/UDP)(30 sec)(unbalanced) + -u -b 7M -t 30 -i 1 -R + 50 + unbalanced + + + + Iperf + iperf (20MHz - UL/TCP)(30 sec)(single-ue) + -t 30 -i 1 -fm -R + 50 + single-ue + + + + Iperf + iperf (20MHz - UL/TCP)(30 sec) + -t 30 -i 1 -fm -R + 50 + + + diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml index 15d641efeb..cb54ba31ee 100644 --- a/ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml +++ b/ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml @@ -43,7 +43,7 @@ Initialize_eNB Initialize RCC (TDD/Band40/20MHz/info) - -O ci-scripts/conf_files/rcc.band40.tm1.100PRB.FairScheduler.usrpb210.conf + -O ci-scripts/conf_files/rcc.band40.tm1.100PRB.FairScheduler.usrpb210.conf --MACRLCs.[0].scheduler_mode default 1 From ca2e8d3553484f16adeb9fb871bb209932b1ca34 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 7 Nov 2019 23:10:17 +0100 Subject: [PATCH 5/5] CI: tuning on TDD scenarios Signed-off-by: Raphael Defosseux --- ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm2.xml | 4 ++-- ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm2.xml b/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm2.xml index 9c98ba4a8e..2a035396c5 100644 --- a/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm2.xml +++ b/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm2.xml @@ -25,7 +25,7 @@ test-05-tm2 Test-05MHz-TM2 tasks - 2 + 3 030201 040101 @@ -36,7 +36,7 @@ Initialize_eNB Initialize eNB (TDD/Band40/5MHz) - -O ci-scripts/conf_files/enb.band40.tm2.25PRB.FairScheduler.usrpb210.conf + -O ci-scripts/conf_files/enb.band40.tm2.25PRB.FairScheduler.usrpb210.conf --MACRLCs.[0].scheduler_mode default diff --git a/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml index 79fc0b305c..648be0bfb5 100644 --- a/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml @@ -27,7 +27,7 @@ 030201 040101 - 030124 040301 040521 040622 040621 040623 040624 040625 040662 040661 040663 040664 040665 040401 040201 030201 + 030124 040301 040521 040622 040621 040623 040662 040401 040201 030201