From 388942b5d38c5f3bec0e9cc31af939fd27356148 Mon Sep 17 00:00:00 2001 From: Giulio Carota Date: Thu, 2 May 2024 13:16:59 +0200 Subject: [PATCH] Revert "Send RRC UECapabilityEnquiry after reconfig, trigger UE update if necessary" This reverts commit 4a7d7975cee687131e7e413c91bd264a1da8d870. Trigger the UE capability right after security mode complete, as specified in O-RAN WG5.C.1-v11. Also, there is no "need" for the "default" RRC Reconfiguration (it will come once PDU sessions are requested), so remove this as well. --- openair2/RRC/NR/rrc_gNB.c | 56 +++------------------------------------ 1 file changed, 4 insertions(+), 52 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 18d4fb6db5..baa700b6f8 100644 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -567,20 +567,7 @@ void rrc_gNB_generate_dedicatedRRCReconfiguration(const protocol_ctxt_t *const c uint8_t xid = rrc_gNB_get_next_transaction_identifier(ctxt_pP->module_id); gNB_RRC_UE_t *ue_p = &ue_context_pP->ue_context; - /* hack: in many cases, we want to send a PDU session resource setup response - * after this dedicated RRC Reconfiguration (e.g., new PDU session). However, - * this is not always the case, e.g., when the PDU sessions came through the - * NG initial UE context setup, in which case all PDU sessions are - * established, and we end up here after a UE Capability Enquiry. So below, - * check if we are currently setting up any PDU sessions, and only then, set - * the xid to trigger a PDU session setup response. */ - ue_p->xids[xid] = RRC_DEDICATED_RECONF; - for (int i = 0; i < ue_p->nb_of_pdusessions; ++i) { - if (ue_p->pduSession[i].status < PDU_SESSION_STATUS_ESTABLISHED) { - ue_p->xids[xid] = RRC_PDUSESSION_ESTABLISH; - break; - } - } + ue_p->xids[xid] = RRC_PDUSESSION_ESTABLISH; struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList *dedicatedNAS_MessageList = CALLOC(1, sizeof(*dedicatedNAS_MessageList)); for (int i = 0; i < ue_p->nb_of_pdusessions; i++) { @@ -1389,35 +1376,6 @@ static int handle_ueCapabilityInformation(const protocol_ctxt_t *const ctxt_pP, rrc_gNB_send_NGAP_UE_CAPABILITIES_IND(ctxt_pP, ue_context_p, ue_cap_info); - /* if we already have DRBs setup (SRB2 exists if there is at least one DRB), - * there might not be a further reconfiguration on which we can rely, so send - * the UE capabilities to the DU to have it trigger a reconfiguration. */ - if (UE->Srb[2].Active && UE->ue_cap_buffer.len > 0 && UE->ue_cap_buffer.buf != NULL) { - cu_to_du_rrc_information_t cu2du = {0}; - if (UE->ue_cap_buffer.len > 0 && UE->ue_cap_buffer.buf != NULL) { - cu2du.uE_CapabilityRAT_ContainerList = UE->ue_cap_buffer.buf; - cu2du.uE_CapabilityRAT_ContainerList_length = UE->ue_cap_buffer.len; - } - - f1_ue_data_t ue_data = cu_get_f1_ue_data(UE->rrc_ue_id); - if (ue_data.du_assoc_id == 0) { - LOG_E(NR_RRC, "cannot send data: invalid assoc_id 0, DU offline\n"); - return -1; - } - gNB_RRC_INST *rrc = RC.nrrrc[0]; - f1ap_ue_context_modif_req_t ue_context_modif_req = { - .gNB_CU_ue_id = UE->rrc_ue_id, - .gNB_DU_ue_id = ue_data.secondary_ue, - .plmn.mcc = rrc->configuration.mcc[0], - .plmn.mnc = rrc->configuration.mnc[0], - .plmn.mnc_digit_length = rrc->configuration.mnc_digit_length[0], - .nr_cellid = rrc->nr_cellid, - .servCellId = 0, /* TODO: correct value? */ - .cu_to_du_rrc_information = &cu2du, - }; - rrc->mac_rrc.ue_context_modification_request(ue_data.du_assoc_id, &ue_context_modif_req); - } - return 0; } @@ -1535,14 +1493,6 @@ static void handle_rrcReconfigurationComplete(const protocol_ctxt_t *const ctxt_ LOG_I(RRC, "UE %d: transaction %d still ongoing for action %d\n", UE->rrc_ue_id, i, UE->xids[i]); } } - - /* if we did not receive any UE Capabilities, let's do that now. It should - * only happen on the first time a reconfiguration arrives. Afterwards, we - * should have them. If the UE does not give us anything, we will re-request - * the capabilities after each reconfiguration, which is a finite number */ - if (UE->ue_cap_buffer.len == 0) { - rrc_gNB_generate_UECapabilityEnquiry(ctxt_pP, ue_context_p); - } } //----------------------------------------------------------------------------- int rrc_gNB_decode_dcch(const protocol_ctxt_t *const ctxt_pP, @@ -1650,7 +1600,9 @@ int rrc_gNB_decode_dcch(const protocol_ctxt_t *const ctxt_pP, nr_rrc_pdcp_config_security(ctxt_pP, ue_context_p, 1); ue_context_p->ue_context.as_security_active = true; - rrc_gNB_generate_defaultRRCReconfiguration(ctxt_pP, ue_context_p); + /* trigger UE capability enquiry if we don't have them yet */ + if (ue_context_p->ue_context.ue_cap_buffer.len == 0) + rrc_gNB_generate_UECapabilityEnquiry(ctxt_pP, ue_context_p); break; case NR_UL_DCCH_MessageType__c1_PR_securityModeFailure: