diff --git a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c index 774fac80eb..78f837884f 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c @@ -3192,6 +3192,17 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP, UE_template->mcs_UL[harq_pid]=10;//cmin (10, openair_daq_vars.target_ue_ul_mcs); rb_table_index=5; // for PHR } + if( (UE_sched_ctrl->ul_scheduled | (1<0 ){ + UE_template->scheduled_ul_bytes -= UE_template->TBS_UL[harq_pid]; + + if (UE_template->scheduled_ul_bytes < 0) { + UE_template->scheduled_ul_bytes = 0; + } + UE_template->estimated_ul_buffer -= UE_template->TBS_UL[harq_pid]; + if (UE_template->estimated_ul_buffer < 0) { + UE_template->estimated_ul_buffer = 0; + } + } UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2=UE_template->mcs_UL[harq_pid]; UE_template->TBS_UL[harq_pid] = get_TBS_UL(UE_template->mcs_UL[harq_pid],rb_table[rb_table_index]); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 73e3465817..ee9e002803 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -200,6 +200,10 @@ rx_sdu(const module_id_t enb_mod_idP, if (UE_template_ptr->scheduled_ul_bytes < 0) { UE_template_ptr->scheduled_ul_bytes = 0; } + UE_template_ptr->estimated_ul_buffer -= UE_template_ptr->TBS_UL[harq_pid]; + if (UE_template_ptr->estimated_ul_buffer < 0) { + UE_template_ptr->estimated_ul_buffer = 0; + } } else { // sduP == NULL => error UE_scheduling_control->pusch_rx_error_num[CC_idP]++; LOG_W(MAC, "[eNB %d][PUSCH %d] CC_id %d %d.%d ULSCH in error in round %d, ul_cqi %d, UE_id %d, RNTI %x (len %d)\n", @@ -233,6 +237,10 @@ rx_sdu(const module_id_t enb_mod_idP, if (UE_template_ptr->scheduled_ul_bytes < 0) { UE_template_ptr->scheduled_ul_bytes = 0; } + UE_template_ptr->estimated_ul_buffer -= UE_template_ptr->TBS_UL[harq_pid]; + if (UE_template_ptr->estimated_ul_buffer < 0) { + UE_template_ptr->estimated_ul_buffer = 0; + } if (find_RA_id(enb_mod_idP, CC_idP, current_rnti) != -1) { cancel_ra_proc(enb_mod_idP, CC_idP, frameP, current_rnti);