From 25380e807507e87c58c1cd82289bcf9e43497131 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 17 Sep 2025 15:09:25 +0200 Subject: [PATCH] Add transm_timout timer to set UE to UL failure after timeout Introduce a new timer for the use case where a UE should not be scheduled anymore after a certain time. This is the case, for instance, during handover, where the "source DU" forwards the RRCReconfiguration and should stop scheduling this UE after some time. Originally, transm_interrupt was introduced in 5c6d90aaff41 ("Use NR_timer_t for UE transmission interrupt, e.g., RRC processing") to stop scheduling a UE. Commit 004403c84d57 ("Implement F1 UE Ctxt Modif Transmission Action Indicator") reused this timer in an attempt to save code with an "interrupt follow action". In commit 89ebbb419276 ("Do not trigger ul failure in measgap scheduling and standardize the verification if MAC is active in other scheduling functions"), the transm_interrupt timer is used to not schedule a UE through function nr_mac_ue_is_active(). This led to the UE not being forwarded the RRCReconfiguration, effectively breaking handover, as the message never reaches the UE. By using a new timer, the intended functionality is restored. Fixes: 89ebbb419276 ("Do not trigger ul failure in measgap scheduling and standardize the verification if MAC is active in other scheduling functions") --- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 20 ++++++++++++++++++- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 4 ++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index e914a71af3..7d8367ff6b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -3567,10 +3567,23 @@ int nr_mac_interrupt_ue_transmission(gNB_MAC_INST *mac, NR_UE_info_t *UE, int sl return 0; } +static void nr_mac_ue_transmission_timeout(gNB_MAC_INST *mac, NR_UE_info_t *UE, int slots) +{ + DevAssert(mac != NULL); + DevAssert(UE != NULL); + NR_SCHED_ENSURE_LOCKED(&mac->sched_lock); + + nr_timer_setup(&UE->UE_sched_ctrl.transm_timeout, slots, 1); + nr_timer_start(&UE->UE_sched_ctrl.transm_timeout); + + LOG_I(NR_MAC, "UE %04x: Timeout for UE transmission (%d slots)\n", UE->rnti, slots); + return; +} + int nr_transmission_action_indicator_stop(gNB_MAC_INST *mac, NR_UE_info_t *UE_info) { int delay = nr_mac_get_reconfig_delay_slots(UE_info->current_DL_BWP.scs); - nr_mac_interrupt_ue_transmission(mac, UE_info, delay); + nr_mac_ue_transmission_timeout(mac, UE_info, delay); LOG_I(NR_MAC, "gNB-DU received the TransmissionActionIndicator with Stop value for UE %04x\n", UE_info->rnti); return 0; } @@ -3640,6 +3653,11 @@ void nr_mac_update_timers(module_id_t module_id, frame_t frame, slot_t slot) /* expired */ nr_timer_stop(&sched_ctrl->transm_interrupt); } + if (nr_timer_tick(&sched_ctrl->transm_timeout)) { + nr_timer_stop(&sched_ctrl->transm_timeout); + LOG_W(NR_MAC, "UE %04x UL failure after transmission timeout\n", UE->rnti); + nr_mac_trigger_ul_failure(sched_ctrl, UE->current_DL_BWP.scs); + } } } diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 3abc547454..50f77b681c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -688,6 +688,10 @@ typedef struct { /// Timer for RRC processing procedures and transmission activity NR_timer_t transm_interrupt; + /// Timer for timeout before UE is set to UL failure (e.g., + /// "TransmissionActionIndicator" handling + NR_timer_t transm_timeout; + /// sri, ul_ri and tpmi based on SRS nr_srs_feedback_t srs_feedback;