From d5f11902b7f3faa7b8101b0a210c1cfb2f3b5275 Mon Sep 17 00:00:00 2001 From: Robert Schmidt <robert.schmidt@openairinterface.org> Date: Thu, 8 Feb 2024 10:46:39 +0100 Subject: [PATCH] Handle PUCCH frame/slot mismatches gracefully For different reasons, the frame/slot numbers might jump (e.g., gNB and RU machines not properly synced). The scheduler would assert for PUCCH allocations. Handle this gracefully by printing an error message, and resetting the PUCCH structure. --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 9f77dab5130..aef5b113406 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -185,7 +185,16 @@ void nr_schedule_pucch(gNB_MAC_INST *nrmac, NR_sched_pucch_t *curr_pucch = &UE->UE_sched_ctrl.sched_pucch[pucch_index]; if (!curr_pucch->active) continue; - DevAssert(frameP == curr_pucch->frame && slotP == curr_pucch->ul_slot); + if (frameP != curr_pucch->frame || slotP != curr_pucch->ul_slot) { + LOG_E(NR_MAC, + "PUCCH frame/slot mismatch: current %4d.%2d vs. request %4d.%2d: not scheduling PUCCH\n", + curr_pucch->frame, + curr_pucch->ul_slot, + frameP, + slotP); + memset(curr_pucch, 0, sizeof(*curr_pucch));; + continue; + } const uint16_t O_ack = curr_pucch->dai_c; const uint16_t O_csi = curr_pucch->csi_bits; @@ -1296,8 +1305,13 @@ int nr_acknack_scheduling(gNB_MAC_INST *mac, return pucch_index; // index of current PUCCH structure } else if (curr_pucch->active) { - AssertFatal(1==0, "This shouldn't happen! curr_pucch frame.slot %d.%d not matching with computed frame.slot %d.%d\n", - curr_pucch->frame, curr_pucch->ul_slot, pucch_frame, pucch_slot); + LOG_E(NR_MAC, + "current PUCCH inactive: curr_pucch frame.slot %d.%d not matching with computed frame.slot %d.%d\n", + curr_pucch->frame, + curr_pucch->ul_slot, + pucch_frame, + pucch_slot); + memset(curr_pucch, 0, sizeof(*curr_pucch)); } else { // unoccupied occasion // checking if in ul_slot the resources potentially to be assigned to this PUCCH are available @@ -1392,8 +1406,13 @@ void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t SFN, sub_frame_t slot) curr_pucch->resource_indicator == idx) curr_pucch->sr_flag = true; else if (curr_pucch->active) { - AssertFatal(1==0, "This shouldn't happen! curr_pucch frame.slot %d.%d not matching with SR function frame.slot %d.%d\n", - curr_pucch->frame, curr_pucch->ul_slot, SFN, slot); + LOG_E(NR_MAC, + "current PUCCH inactive: curr_pucch frame.slot %d.%d not matching with computed frame.slot %d.%d\n", + curr_pucch->frame, + curr_pucch->ul_slot, + SFN, + slot); + memset(curr_pucch, 0, sizeof(*curr_pucch)); continue; } else { -- GitLab