From 566570899c6103d3ce43166274e87cb8c0adb369 Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Thu, 6 Aug 2020 15:49:44 +0200 Subject: [PATCH] Handle case where all harq are busy --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index b5f0a48fc2..bacb279c92 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -776,7 +776,7 @@ void nr_schedule_uss_dlsch_phytest(module_id_t module_idP, } -uint8_t select_ul_harq_pid(NR_UE_sched_ctrl_t *sched_ctrl) { +int8_t select_ul_harq_pid(NR_UE_sched_ctrl_t *sched_ctrl) { uint8_t hrq_id; uint8_t max_ul_harq_pids = 3; // temp: for testing @@ -802,6 +802,8 @@ uint8_t select_ul_harq_pid(NR_UE_sched_ctrl_t *sched_ctrl) { return hrq_id; } } + LOG_E(MAC,"All UL HARQ processes are busy. Cannot schedule ULSCH\n"); + return -1; } void schedule_fapi_ul_pdu(int Mod_idP, @@ -1006,7 +1008,8 @@ void schedule_fapi_ul_pdu(int Mod_idP, //Pusch Allocation in frequency domain [TS38.214, sec 6.1.2.2] //Optional Data only included if indicated in pduBitmap - uint8_t harq_id = select_ul_harq_pid(&UE_list->UE_sched_ctrl[UE_id]); + int8_t harq_id = select_ul_harq_pid(&UE_list->UE_sched_ctrl[UE_id]); + if (harq_id < 0) return; NR_UE_ul_harq_t *cur_harq = &UE_list->UE_sched_ctrl[UE_id].ul_harq_processes[harq_id]; pusch_pdu->pusch_data.harq_process_id = harq_id; pusch_pdu->pusch_data.new_data_indicator = cur_harq->ndi;