diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h index 7fd870ed1f..21dbee692e 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h @@ -203,4 +203,6 @@ void nr_mac_gNB_rrc_ul_failure_reset(const module_id_t Mod_instP, const sub_frame_t subframeP, const rnti_t rntiP); +void nr_mac_gNB_enable_rrc_processing_timer_req(const module_id_t Mod_instP, const rnti_t rntiP); + #endif diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index f36dbc4a16..9d0a2d1fbe 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -1942,6 +1942,11 @@ void nr_check_Msg4_Ack(module_id_t module_id, int CC_id, frame_t frame, sub_fram LOG_A(NR_MAC, "(ue %i, rnti 0x%04x) Received Ack of RA-Msg4. CBRA procedure succeeded!\n", UE_id, ra->rnti); UE_info->active[UE_id] = true; UE_info->Msg4_ACKed[UE_id] = true; + + // Pause scheduling according to: + // 3GPP TS 38.331 Section 12 Table 12.1-1: UE performance requirements for RRC procedures for UEs + sched_ctrl->schedule_enabled = false; + nr_mac_gNB_enable_rrc_processing_timer_req(module_id, ra->rnti); } else { LOG_I(NR_MAC, "(ue %i, rnti 0x%04x) RA Procedure failed at Msg4!\n", UE_id, ra->rnti); diff --git a/openair2/RRC/NR/L2_nr_interface.c b/openair2/RRC/NR/L2_nr_interface.c index a1f776b5ca..77890d4a08 100644 --- a/openair2/RRC/NR/L2_nr_interface.c +++ b/openair2/RRC/NR/L2_nr_interface.c @@ -391,4 +391,15 @@ void nr_mac_gNB_rrc_ul_failure_reset(const module_id_t Mod_instP, } else { LOG_W(RRC,"Frame %d, Subframe %d: UL failure reset: UE %x unknown \n",frameP,subframeP,rntiP); } +} + +void nr_mac_gNB_enable_rrc_processing_timer_req(const module_id_t Mod_instP, const rnti_t rntiP) { + struct rrc_gNB_ue_context_s *ue_context_p = NULL; + ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[Mod_instP], rntiP); + if (ue_context_p != NULL) { + ue_context_p->ue_context.nr_rrc_processing_timer = 1; + ue_context_p->ue_context.nr_rrc_processing_delay = NR_RRC_PROCESSING_DELAY_MS; + } else { + LOG_D(RRC,"%s: Unknown RNTI 0x%04x\n", __FUNCTION__, rntiP); + } } \ No newline at end of file diff --git a/openair2/RRC/NR/nr_rrc_defs.h b/openair2/RRC/NR/nr_rrc_defs.h index 448b76d785..588ba5c03f 100644 --- a/openair2/RRC/NR/nr_rrc_defs.h +++ b/openair2/RRC/NR/nr_rrc_defs.h @@ -96,6 +96,9 @@ typedef struct nr_uid_linear_allocator_s { #define PROTOCOL_NR_RRC_CTXT_FMT PROTOCOL_CTXT_FMT #define PROTOCOL_NR_RRC_CTXT_ARGS(CTXT_Pp) PROTOCOL_NR_CTXT_ARGS(CTXT_Pp) +// Delay to take in consideration for sl_ahead value +#define TX_SL_AHEAD_DELAY 3 + // 3GPP TS 38.331 Section 12 Table 12.1-1: UE performance requirements for RRC procedures for UEs #define NR_RRC_PROCESSING_DELAY_MS 10 diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 5a1c188602..d8474de67e 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -142,10 +142,9 @@ void openair_nr_rrc_on(const protocol_ctxt_t *const ctxt_pP) { void enable_nr_rrc_processing_timer(module_id_t module_id, rrc_gNB_ue_context_t *ue_context_pP, - NR_SubcarrierSpacing_t subcarrierSpacing, uint32_t delay_ms) { ue_context_pP->ue_context.nr_rrc_processing_timer = 1; - ue_context_pP->ue_context.nr_rrc_processing_delay = delay_ms << subcarrierSpacing; + ue_context_pP->ue_context.nr_rrc_processing_delay = delay_ms; nr_rrc_mac_schedule_ue_enabled(module_id, ue_context_pP->ue_context.rnti, false); } @@ -353,11 +352,6 @@ rrc_gNB_generate_RRCSetup( masterCellGroup_from_DU, scc,&rrc->carrier); - enable_nr_rrc_processing_timer(ctxt_pP->module_id, - ue_context_pP, - rrc->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, - NR_RRC_PROCESSING_DELAY_MS); - LOG_DUMPMSG(NR_RRC, DEBUG_RRC, (char *)(ue_p->Srb0.Tx_buffer.Payload), ue_p->Srb0.Tx_buffer.payload_size, @@ -468,11 +462,6 @@ rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest( NULL, scc,&rrc_instance_p->carrier); - enable_nr_rrc_processing_timer(ctxt_pP->module_id, - ue_context_pP, - rrc_instance_p->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, - NR_RRC_PROCESSING_DELAY_MS); - LOG_DUMPMSG(NR_RRC, DEBUG_RRC, (char *)(ue_p->Srb0.Tx_buffer.Payload), ue_p->Srb0.Tx_buffer.payload_size, @@ -743,10 +732,7 @@ rrc_gNB_generate_defaultRRCReconfiguration( NULL, ue_p->masterCellGroup); - enable_nr_rrc_processing_timer(ctxt_pP->module_id, - ue_context_pP, - rrc->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, - NR_RRC_PROCESSING_DELAY_MS); + enable_nr_rrc_processing_timer(ctxt_pP->module_id, ue_context_pP, TX_SL_AHEAD_DELAY + NR_RRC_PROCESSING_DELAY_MS); free(ue_context_pP->ue_context.nas_pdu.buffer); @@ -1011,10 +997,7 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( NULL, cellGroupConfig); - enable_nr_rrc_processing_timer(ctxt_pP->module_id, - ue_context_pP, - rrc->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, - NR_RRC_PROCESSING_DELAY_MS); + enable_nr_rrc_processing_timer(ctxt_pP->module_id, ue_context_pP, TX_SL_AHEAD_DELAY + NR_RRC_PROCESSING_DELAY_MS); LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, "[MSG] RRC Reconfiguration\n"); @@ -1189,10 +1172,7 @@ rrc_gNB_modify_dedicatedRRCReconfiguration( NULL, NULL); - enable_nr_rrc_processing_timer(ctxt_pP->module_id, - ue_context_pP, - RC.nrrrc[ctxt_pP->module_id]->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, - NR_RRC_PROCESSING_DELAY_MS); + enable_nr_rrc_processing_timer(ctxt_pP->module_id, ue_context_pP, TX_SL_AHEAD_DELAY + NR_RRC_PROCESSING_DELAY_MS); LOG_DUMPMSG(NR_RRC, DEBUG_RRC, (char *)buffer, size, "[MSG] RRC Reconfiguration\n"); @@ -1295,10 +1275,7 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release( NULL, NULL); - enable_nr_rrc_processing_timer(ctxt_pP->module_id, - ue_context_pP, - RC.nrrrc[ctxt_pP->module_id]->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, - NR_RRC_PROCESSING_DELAY_MS); + enable_nr_rrc_processing_timer(ctxt_pP->module_id, ue_context_pP, TX_SL_AHEAD_DELAY + NR_RRC_PROCESSING_DELAY_MS); ue_context_pP->ue_context.pdu_session_release_command_flag = 1; @@ -1850,10 +1827,7 @@ rrc_gNB_process_RRCConnectionReestablishmentComplete( NULL, NULL); - enable_nr_rrc_processing_timer(ctxt_pP->module_id, - ue_context_pP, - RC.nrrrc[ctxt_pP->module_id]->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, - NR_RRC_PROCESSING_DELAY_MS); + enable_nr_rrc_processing_timer(ctxt_pP->module_id, ue_context_pP, TX_SL_AHEAD_DELAY + NR_RRC_PROCESSING_DELAY_MS); LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, "[MSG] RRC Reconfiguration\n"); @@ -3475,7 +3449,7 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) { if (ue_context_p->ue_context.nr_rrc_processing_timer > 0) { ue_context_p->ue_context.nr_rrc_processing_timer++; - if(ue_context_p->ue_context.nr_rrc_processing_timer >= ue_context_p->ue_context.nr_rrc_processing_delay) { + if (ue_context_p->ue_context.nr_rrc_processing_timer > ue_context_p->ue_context.nr_rrc_processing_delay) { ue_context_p->ue_context.nr_rrc_processing_timer = 0; nr_rrc_mac_schedule_ue_enabled(ctxt_pP->module_id, ue_context_p->ue_context.rnti, true); }