From f23890e0b94c9cb04c74cb05c6299cc99cb60109 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 5 Feb 2021 21:13:45 +0100 Subject: [PATCH] Search correct UL HARQ, don't assert on late slot At the time of this commit, the CI has realtime issues. This can mean that the HARQ result is delivered in a delayed fashion. Before this commit, we were asserting on whether the slot corresponds to the HARQ process's expected feedback slot, but a particular feedback might be delayed under realtime issues, and we actually don't care about the timing since we get the HARQ process ID. Instead, we loop through the HARQ processes for which we wait for a feedback in the beginning until we have the right process (which did not seem to cause a problem till now, but who knows. --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 0d61d0fbb4..90a1811b22 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -310,9 +310,6 @@ void handle_nr_ul_harq(module_id_t mod_id, sub_frame_t slot, const nfapi_nr_crc_t *crc_pdu) { - const NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels->ServingCellConfigCommon; - const int num_slots = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; - int UE_id = find_nr_UE_id(mod_id, crc_pdu->rnti); if (UE_id < 0) { LOG_E(MAC, "%s(): unknown RNTI %04x in PUSCH\n", __func__, crc_pdu->rnti); @@ -321,23 +318,23 @@ void handle_nr_ul_harq(module_id_t mod_id, NR_UE_info_t *UE_info = &RC.nrmac[mod_id]->UE_info; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; - const int8_t harq_pid = sched_ctrl->feedback_ul_harq.head; - if (crc_pdu->harq_id != harq_pid && harq_pid < 0) { + int8_t harq_pid = sched_ctrl->feedback_ul_harq.head; + while (crc_pdu->harq_id != harq_pid || harq_pid < 0) { LOG_W(MAC, "Unexpected ULSCH HARQ PID %d (have %d) for RNTI %04x (ignore this warning for RA)\n", crc_pdu->harq_id, harq_pid, crc_pdu->rnti); - return; + if (harq_pid < 0) + return; + + remove_front_nr_list(&sched_ctrl->feedback_ul_harq); + sched_ctrl->ul_harq_processes[harq_pid].round++; + add_tail_nr_list(&sched_ctrl->retrans_ul_harq, harq_pid); + harq_pid = sched_ctrl->feedback_ul_harq.head; } - DevAssert(harq_pid == crc_pdu->harq_id); remove_front_nr_list(&sched_ctrl->feedback_ul_harq); NR_UE_ul_harq_t *harq = &sched_ctrl->ul_harq_processes[harq_pid]; - const int feedback_slot = (slot - 1 + num_slots) % num_slots; - AssertFatal(harq->feedback_slot == feedback_slot, - "expected feedback slot %d, but found %d instead\n", - harq->feedback_slot, - feedback_slot); DevAssert(harq->is_waiting); harq->feedback_slot = -1; harq->is_waiting = false;