From 4c56c6b2de196229d7043076938fb5a2d66c0bf7 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Thu, 5 Feb 2026 11:33:11 +0100 Subject: [PATCH] Refactor (RRC): improve UE context removal logging Replace generic UE event log with explicit INFO log including UE ID and RNTI when removing a UE context and centralize access to UE fields via a local pointer. rrc_delete_ue_data removes the all the list in the UE context, including the serving cells, and therefore the cell id should not be logged in the function responsible for the removal of the UE context, which at this point is already emptied and while the cells themselves are still there (in the DU/global cell structures), the lists in the UE context are empty. --- openair2/RRC/NR/rrc_gNB_UE_context.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB_UE_context.c b/openair2/RRC/NR/rrc_gNB_UE_context.c index 86838927ab..01163e319f 100644 --- a/openair2/RRC/NR/rrc_gNB_UE_context.c +++ b/openair2/RRC/NR/rrc_gNB_UE_context.c @@ -155,10 +155,11 @@ void rrc_gNB_remove_ue_context(gNB_RRC_INST *rrc_instance_pP, rrc_gNB_ue_context return; } - LOG_UE_EVENT(&ue_context_pP->ue_context, "Remove UE context\n"); + gNB_RRC_UE_t *ue = &ue_context_pP->ue_context; + LOG_I(NR_RRC, "[--] (UE ID %d RNTI %04x) Remove UE context\n", ue->rrc_ue_id, ue->rnti); RB_REMOVE(rrc_nr_ue_tree_s, &rrc_instance_pP->rrc_ue_head, ue_context_pP); - uid_linear_allocator_free(&rrc_instance_pP->uid_allocator, ue_context_pP->ue_context.rrc_ue_id - 1); - cu_remove_f1_ue_data(ue_context_pP->ue_context.rrc_ue_id); + uid_linear_allocator_free(&rrc_instance_pP->uid_allocator, ue->rrc_ue_id - 1); + cu_remove_f1_ue_data(ue->rrc_ue_id); rrc_gNB_free_mem_ue_context(ue_context_pP); }