From 65e47c882fbadcc1ad24ddcd8e43a381a00e504b Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 21 Mar 2022 14:35:41 +0000 Subject: [PATCH 1/6] Handle RRC processing time at gNB --- openair1/SIMULATION/NR_PHY/dlsim.c | 4 +- openair1/SIMULATION/NR_PHY/ulsim.c | 4 +- openair2/GNB_APP/gnb_config.c | 4 +- openair2/LAYER2/NR_MAC_gNB/config.c | 20 ++- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 3 + .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 28 +++- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 5 + .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 4 + openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 7 +- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 8 ++ openair2/RRC/NR/rrc_gNB.c | 122 +++++++++++++----- openair2/RRC/NR/rrc_gNB_nsa.c | 8 +- 12 files changed, 170 insertions(+), 47 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index e797c01096..ca7c2a4c61 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -808,9 +808,9 @@ int main(int argc, char **argv) AssertFatal((gNB->if_inst = NR_IF_Module_init(0))!=NULL,"Cannot register interface"); gNB->if_inst->NR_PHY_config_req = nr_phy_config_request; // common configuration - rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, 6, scc, NULL, 0, 0, NULL); + rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, 6, scc, NULL, 0, 0, NULL, false); // UE dedicated configuration - rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, 6, scc, NULL, 1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup); + rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, 6, scc, NULL, 1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup, false); // reset preprocessor to the one of DLSIM after it has been set during // rrc_mac_config_req_gNB gNB_mac->pre_processor_dl = nr_dlsim_preprocessor; diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 76d896a047..a527f2ad56 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -742,9 +742,9 @@ int main(int argc, char **argv) gNB->if_inst->NR_PHY_config_req = nr_phy_config_request; // common configuration - rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, 6, scc, &rrc.carrier.mib,0, 0, NULL); + rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, 6, scc, &rrc.carrier.mib,0, 0, NULL, false); // UE dedicated configuration - rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, 6, scc, &rrc.carrier.mib,1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup); + rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, 6, scc, &rrc.carrier.mib,1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup, false); frame_parms->nb_antennas_tx = n_tx; frame_parms->nb_antennas_rx = n_rx; nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 2795c07ce7..34063f852f 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -2045,8 +2045,8 @@ void configure_gnb_du_mac(int inst) { NULL, 0, 0, // rnti - (NR_CellGroupConfig_t *)NULL - ); + (NR_CellGroupConfig_t *)NULL, + false); } diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 7833b41f0b..24294dcb29 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -434,9 +434,10 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, int minRXTXTIMEpdsch, NR_ServingCellConfigCommon_t *scc, NR_BCCH_BCH_Message_t *mib, - int add_ue, + int add_ue, uint32_t rnti, - NR_CellGroupConfig_t *CellGroup) { + NR_CellGroupConfig_t *CellGroup, + bool rrc_reconfiguration_running) { if (scc != NULL ) { AssertFatal((scc->ssb_PositionsInBurst->present > 0) && (scc->ssb_PositionsInBurst->present < 4), "SSB Bitmap type %d is not valid\n",scc->ssb_PositionsInBurst->present); @@ -663,9 +664,22 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, sched_ctrl->maxL = 2; } } + + if (rrc_reconfiguration_running) { + const int UE_id = find_nr_UE_id(Mod_idP,rnti); + if (UE_id >= 0) { + NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info; + NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; + if (sched_ctrl->rrc_processing_info.rrc_processing_timer == 0) { + sched_ctrl->rrc_processing_info.rrc_processing_timer = 1; + LOG_I(NR_MAC, "Activating RRC processing timer for UE: %d\n", UE_id); + } + } + } + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_OUT); - return(0); + return 0; }// END rrc_mac_config_req_gNB diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 51541353f4..7c140b3952 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -346,6 +346,9 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, LOG_I(NR_MAC,"Frame.Slot %d.%d\n%s\n",frame,slot,stats_output); } + // This updates the RRC processing timers running at MAC layer + nr_update_rrc_processing_timer(module_idP, frame, slot); + // This schedules MIB schedule_nr_mib(module_idP, frame, slot); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index f366b2c4f9..2bb39098fa 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -514,14 +514,14 @@ void nr_store_dlsch_buffer(module_id_t module_id, 0); stop_meas(&RC.nrmac[module_id]->rlc_status_ind); } - if(sched_ctrl->rlc_status[DL_SCH_LCID_DCCH].bytes_in_buffer > 0){ + if (sched_ctrl->rlc_status[DL_SCH_LCID_DCCH].bytes_in_buffer > 0) { lcid = DL_SCH_LCID_DCCH; - } - else if (sched_ctrl->rlc_status[DL_SCH_LCID_DCCH1].bytes_in_buffer > 0) - { + } else if (sched_ctrl->rlc_status[DL_SCH_LCID_DCCH1].bytes_in_buffer > 0) { lcid = DL_SCH_LCID_DCCH1; - }else{ + } else if (sched_ctrl->rrc_processing_info.rrc_processing_timer == 0) { lcid = DL_SCH_LCID_DTCH; + } else { + continue; } sched_ctrl->num_total_bytes += sched_ctrl->rlc_status[lcid].bytes_in_buffer; @@ -1003,6 +1003,24 @@ nr_pp_impl_dl nr_init_fr1_dlsch_preprocessor(module_id_t module_id, int CC_id) return nr_fr1_dlsch_preprocessor; } +void nr_update_rrc_processing_timer(module_id_t module_id, + frame_t frame, + sub_frame_t slot) { + + NR_UE_info_t *UE_info = &RC.nrmac[module_id]->UE_info; + const NR_list_t *UE_list = &UE_info->list; + for (int UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) { + NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; + if (sched_ctrl->rrc_processing_info.rrc_processing_timer > 0) { + sched_ctrl->rrc_processing_info.rrc_processing_timer++; + if (sched_ctrl->rrc_processing_info.rrc_processing_timer >= sched_ctrl->rrc_processing_info.rrc_processing_delay) { + sched_ctrl->rrc_processing_info.rrc_processing_timer = 0; + LOG_I(NR_MAC, "De-activating RRC processing timer for UE: %d\n", UE_id); + } + } + } +} + void nr_schedule_ue_spec(module_id_t module_id, frame_t frame, sub_frame_t slot) { diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 4d05320e64..cae806e3d1 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2225,6 +2225,11 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG scc, genericParameters, NULL); + + sched_ctrl->rrc_processing_info.rrc_processing_timer = 0; + int rrc_processing_delay[5] = {10, 20, 40, 80, 160}; // 3GPP TS 38.331 Section 12 Table 12.1-1: UE performance requirements for RRC procedures for UEs + sched_ctrl->rrc_processing_info.rrc_processing_delay = rrc_processing_delay[genericParameters->subcarrierSpacing]; + const struct NR_UplinkConfig__uplinkBWP_ToAddModList *ubwpList = servingCellConfig ? servingCellConfig->uplinkConfig->uplinkBWP_ToAddModList : NULL; if (ubwpList) AssertFatal(ubwpList->list.count == 1, "uplinkBWP_ToAddModList has %d BWP!\n", diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index bd2836c3e7..ce9637662f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1176,6 +1176,10 @@ void pf_ul(module_id_t module_id, if (B == 0 && !do_sched) continue; + if (sched_ctrl->rrc_processing_info.rrc_processing_timer > 0) { + continue; + } + /* Schedule UE on SR or UL inactivity and no data (otherwise, will be scheduled * based on data to transmit) */ if (B == 0 && do_sched) { diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 28e9d689fa..5ded67deba 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -55,13 +55,18 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, NR_BCCH_BCH_Message_t *mib, int add_ue, uint32_t rnti, - NR_CellGroupConfig_t *CellGroup); + NR_CellGroupConfig_t *CellGroup, + bool rrc_reconfiguration_running); void clear_nr_nfapi_information(gNB_MAC_INST * gNB, int CC_idP, frame_t frameP, sub_frame_t subframeP); +void nr_update_rrc_processing_timer(module_id_t module_id, + frame_t frame, + sub_frame_t slot); + void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frame_rxP, sub_frame_t slot_rxP); diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index b1e1241487..b0ddbb50d1 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -547,6 +547,11 @@ typedef struct NR_UE_ul_harq { NR_sched_pusch_t sched_pusch; } NR_UE_ul_harq_t; +typedef struct NR_RRC_processing_info { + uint32_t rrc_processing_timer; + uint32_t rrc_processing_delay; +} NR_RRC_processing_info_t; + /*! \brief scheduling control information set through an API */ #define MAX_CSI_REPORTS 48 typedef struct { @@ -559,6 +564,9 @@ typedef struct { NR_ControlResourceSet_t *coreset; NR_sched_pdcch_t sched_pdcch; + /// Timer for RRC processing procedures + NR_RRC_processing_info_t rrc_processing_info; + /// CCE index and Aggr. Level are shared for PUSCH/PDSCH allocation decisions /// corresponding to the sched_pusch/sched_pdsch structures below int cce_index; diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index d6c658f01d..b53a4470aa 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -166,17 +166,17 @@ static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration if (NODE_IS_MONOLITHIC(rrc->node_type)){ rrc_mac_config_req_gNB(rrc->module_id, - rrc->carrier.ssb_SubcarrierOffset, - rrc->carrier.pdsch_AntennaPorts, - rrc->carrier.pusch_AntennaPorts, + rrc->carrier.ssb_SubcarrierOffset, + rrc->carrier.pdsch_AntennaPorts, + rrc->carrier.pusch_AntennaPorts, rrc->carrier.sib1_tda, rrc->carrier.minRXTXTIME, - (NR_ServingCellConfigCommon_t *)rrc->carrier.servingcellconfigcommon, - &rrc->carrier.mib, - 0, - 0, // WIP hardcoded rnti - (NR_CellGroupConfig_t *)NULL - ); + (NR_ServingCellConfigCommon_t *)rrc->carrier.servingcellconfigcommon, + &rrc->carrier.mib, + 0, + 0, // WIP hardcoded rnti + (NR_CellGroupConfig_t *)NULL, + false); } /* set flag to indicate that cell information is configured. This is required @@ -279,17 +279,18 @@ void apply_macrlc_config(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *const ue_context_pP, const protocol_ctxt_t *const ctxt_pP ) { - rrc_mac_config_req_gNB(rrc->module_id, - rrc->carrier.ssb_SubcarrierOffset, - rrc->carrier.pdsch_AntennaPorts, - rrc->carrier.pusch_AntennaPorts, - rrc->carrier.sib1_tda, - rrc->carrier.minRXTXTIME, - NULL, - NULL, - 0, - ue_context_pP->ue_context.rnti, - get_softmodem_params()->sa ? ue_context_pP->ue_context.masterCellGroup : (NR_CellGroupConfig_t *)NULL); + rrc_mac_config_req_gNB(rrc->module_id, + rrc->carrier.ssb_SubcarrierOffset, + rrc->carrier.pdsch_AntennaPorts, + rrc->carrier.pusch_AntennaPorts, + rrc->carrier.sib1_tda, + rrc->carrier.minRXTXTIME, + NULL, + NULL, + 0, + ue_context_pP->ue_context.rnti, + get_softmodem_params()->sa ? ue_context_pP->ue_context.masterCellGroup : (NR_CellGroupConfig_t *)NULL, + false); nr_rrc_rlc_config_asn1_req(ctxt_pP, ue_context_pP->ue_context.SRB_configList, @@ -474,8 +475,8 @@ rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest( &rrc_instance_p->carrier.mib, 0, ue_context_pP->ue_context.rnti, - (NR_CellGroupConfig_t *)NULL - ); + (NR_CellGroupConfig_t *)NULL, + false); LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating RRCSetup (bytes %d)\n", @@ -730,6 +731,19 @@ rrc_gNB_generate_defaultRRCReconfiguration( LOG_DUMPMSG(NR_RRC, DEBUG_RRC,(char *)buffer, size, "[MSG] RRC Reconfiguration\n"); + rrc_mac_config_req_gNB(ctxt_pP->module_id, + 0, + 0, + 0, + 0, + 0, + NULL, + NULL, + 0, + ue_context_pP->ue_context.rnti, + NULL, + true); + /* Free all NAS PDUs */ for (int i = 0; i < ue_context_pP->ue_context.nb_of_pdusessions; i++) { if (ue_context_pP->ue_context.pduSession[i].param.nas_pdu.buffer != NULL) { @@ -988,7 +1002,20 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( &rrc->carrier, NULL, cellGroupConfig); - LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size,"[MSG] RRC Reconfiguration\n"); + LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, "[MSG] RRC Reconfiguration\n"); + + rrc_mac_config_req_gNB(ctxt_pP->module_id, + 0, + 0, + 0, + 0, + 0, + NULL, + NULL, + 0, + ue_context_pP->ue_context.rnti, + NULL, + true); /* Free all NAS PDUs */ for (i = 0; i < ue_context_pP->ue_context.nb_of_pdusessions; i++) { @@ -1162,6 +1189,19 @@ rrc_gNB_modify_dedicatedRRCReconfiguration( NULL); LOG_DUMPMSG(NR_RRC, DEBUG_RRC, (char *)buffer, size, "[MSG] RRC Reconfiguration\n"); + rrc_mac_config_req_gNB(ctxt_pP->module_id, + 0, + 0, + 0, + 0, + 0, + NULL, + NULL, + 0, + ue_context_pP->ue_context.rnti, + NULL, + true); + /* Free all NAS PDUs */ for (i = 0; i < ue_context_pP->ue_context.nb_of_modify_pdusessions; i++) { if (ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.buffer != NULL) { @@ -1262,8 +1302,20 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release( NULL); ue_context_pP->ue_context.pdu_session_release_command_flag = 1; - LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, - "[MSG] RRC Reconfiguration\n"); + LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, "[MSG] RRC Reconfiguration\n"); + + rrc_mac_config_req_gNB(ctxt_pP->module_id, + 0, + 0, + 0, + 0, + 0, + NULL, + NULL, + 0, + ue_context_pP->ue_context.rnti, + NULL, + true); /* Free all NAS PDUs */ if (nas_length > 0) { @@ -1371,8 +1423,8 @@ rrc_gNB_process_RRCReconfigurationComplete( NULL, 0, ue_context_pP->ue_context.rnti, - ue_context_pP->ue_context.masterCellGroup - ); + ue_context_pP->ue_context.masterCellGroup, + false); LOG_D(NR_RRC,"Configuring RLC DRBs/SRBs for UE %x\n",ue_context_pP->ue_context.rnti); nr_rrc_rlc_config_asn1_req(ctxt_pP, SRB_configList, // NULL, @@ -1811,8 +1863,20 @@ rrc_gNB_process_RRCConnectionReestablishmentComplete( NULL, NULL, NULL); - LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, - "[MSG] RRC Reconfiguration\n"); + LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, "[MSG] RRC Reconfiguration\n"); + + rrc_mac_config_req_gNB(ctxt_pP->module_id, + 0, + 0, + 0, + 0, + 0, + NULL, + NULL, + 0, + ue_context_pP->ue_context.rnti, + NULL, + true); /* Free all NAS PDUs */ for (i = 0; i < ue_context_pP->ue_context.nb_of_pdusessions; i++) { diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 70dfebaaf7..271f699ca5 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -361,14 +361,15 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ rrc_mac_config_req_gNB(rrc->module_id, rrc->carrier.ssb_SubcarrierOffset, rrc->carrier.pdsch_AntennaPorts, - rrc->carrier.pusch_AntennaPorts, + rrc->carrier.pusch_AntennaPorts, rrc->carrier.sib1_tda, rrc->carrier.minRXTXTIME, rrc->carrier.servingcellconfigcommon, &rrc->carrier.mib, 1, // add_ue flag ue_context_p->ue_id_rnti, - ue_context_p->ue_context.secondaryCellGroup); + ue_context_p->ue_context.secondaryCellGroup, + false); } else { rrc_mac_config_req_gNB(rrc->module_id, rrc->carrier.ssb_SubcarrierOffset, @@ -380,7 +381,8 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ NULL, 1, // add_ue flag ue_context_p->ue_id_rnti, - ue_context_p->ue_context.secondaryCellGroup); + ue_context_p->ue_context.secondaryCellGroup, + false); } if(m == NULL){ From a9bbf18d9f46a7c5578ca6528500f441cef61e7e Mon Sep 17 00:00:00 2001 From: rmagueta Date: Mon, 21 Mar 2022 17:14:50 +0000 Subject: [PATCH 2/6] Simplification of rrc_processing_delay computation --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index cae806e3d1..019a47ee03 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2227,8 +2227,7 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG NULL); sched_ctrl->rrc_processing_info.rrc_processing_timer = 0; - int rrc_processing_delay[5] = {10, 20, 40, 80, 160}; // 3GPP TS 38.331 Section 12 Table 12.1-1: UE performance requirements for RRC procedures for UEs - sched_ctrl->rrc_processing_info.rrc_processing_delay = rrc_processing_delay[genericParameters->subcarrierSpacing]; + sched_ctrl->rrc_processing_info.rrc_processing_delay = 10<subcarrierSpacing; // 3GPP TS 38.331 Section 12 Table 12.1-1: UE performance requirements for RRC procedures for UEs const struct NR_UplinkConfig__uplinkBWP_ToAddModList *ubwpList = servingCellConfig ? servingCellConfig->uplinkConfig->uplinkBWP_ToAddModList : NULL; if (ubwpList) AssertFatal(ubwpList->list.count == 1, From bc7a404629c9d58597bc9e8f649a93fca72a2957 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Tue, 22 Mar 2022 20:18:23 +0000 Subject: [PATCH 3/6] Move rrc_processing_timer from MAC to RRC --- openair1/SIMULATION/NR_PHY/dlsim.c | 4 +- openair1/SIMULATION/NR_PHY/ulsim.c | 4 +- openair2/GNB_APP/gnb_config.c | 4 +- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h | 5 + openair2/LAYER2/NR_MAC_gNB/config.c | 16 +-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 3 - .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 22 +--- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 4 - .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 2 +- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 7 +- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 8 -- openair2/RRC/NR/L2_nr_interface.c | 17 +++ openair2/RRC/NR/nr_rrc_defs.h | 6 +- openair2/RRC/NR/rrc_gNB.c | 107 ++++++------------ openair2/RRC/NR/rrc_gNB_nsa.c | 6 +- 15 files changed, 74 insertions(+), 141 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 7edcd29d81..c3ff79ab07 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -808,9 +808,9 @@ int main(int argc, char **argv) AssertFatal((gNB->if_inst = NR_IF_Module_init(0))!=NULL,"Cannot register interface"); gNB->if_inst->NR_PHY_config_req = nr_phy_config_request; // common configuration - rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, 6, scc, NULL, 0, 0, NULL, false); + rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, 6, scc, NULL, 0, 0, NULL); // UE dedicated configuration - rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, 6, scc, NULL, 1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup, false); + rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, 6, scc, NULL, 1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup); // reset preprocessor to the one of DLSIM after it has been set during // rrc_mac_config_req_gNB gNB_mac->pre_processor_dl = nr_dlsim_preprocessor; diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 8f17a9021b..5e4ae2deb7 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -742,9 +742,9 @@ int main(int argc, char **argv) gNB->if_inst->NR_PHY_config_req = nr_phy_config_request; // common configuration - rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, 6, scc, &rrc.carrier.mib,0, 0, NULL, false); + rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, 6, scc, &rrc.carrier.mib,0, 0, NULL); // UE dedicated configuration - rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, 6, scc, &rrc.carrier.mib,1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup, false); + rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, 6, scc, &rrc.carrier.mib,1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup); frame_parms->nb_antennas_tx = n_tx; frame_parms->nb_antennas_rx = n_rx; nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index d8202d7dda..f5ff7ddf9e 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -2051,8 +2051,8 @@ void configure_gnb_du_mac(int inst) { NULL, 0, 0, // rnti - (NR_CellGroupConfig_t *)NULL, - false); + (NR_CellGroupConfig_t *)NULL + ); } diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h index c150c4f134..a05b26599d 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h @@ -202,4 +202,9 @@ void nr_mac_gNB_rrc_ul_failure_reset(const module_id_t Mod_instP, const frame_t frameP, const sub_frame_t subframeP, const rnti_t rntiP); + +bool nr_rrc_disabled_mac_scheduling(const module_id_t Mod_instP, + const frame_t frameP, + const sub_frame_t subframeP, + const rnti_t rntiP); #endif diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 24294dcb29..9ad57b2d84 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -436,8 +436,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, NR_BCCH_BCH_Message_t *mib, int add_ue, uint32_t rnti, - NR_CellGroupConfig_t *CellGroup, - bool rrc_reconfiguration_running) { + NR_CellGroupConfig_t *CellGroup) { if (scc != NULL ) { AssertFatal((scc->ssb_PositionsInBurst->present > 0) && (scc->ssb_PositionsInBurst->present < 4), "SSB Bitmap type %d is not valid\n",scc->ssb_PositionsInBurst->present); @@ -664,19 +663,6 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, sched_ctrl->maxL = 2; } } - - if (rrc_reconfiguration_running) { - const int UE_id = find_nr_UE_id(Mod_idP,rnti); - if (UE_id >= 0) { - NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info; - NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; - if (sched_ctrl->rrc_processing_info.rrc_processing_timer == 0) { - sched_ctrl->rrc_processing_info.rrc_processing_timer = 1; - LOG_I(NR_MAC, "Activating RRC processing timer for UE: %d\n", UE_id); - } - } - } - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_OUT); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 418e14c611..540198a22a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -346,9 +346,6 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, LOG_I(NR_MAC,"Frame.Slot %d.%d\n%s\n",frame,slot,stats_output); } - // This updates the RRC processing timers running at MAC layer - nr_update_rrc_processing_timer(module_idP, frame, slot); - // This schedules MIB schedule_nr_mib(module_idP, frame, slot); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 802225951e..9e09c704d7 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -518,12 +518,12 @@ void nr_store_dlsch_buffer(module_id_t module_id, lcid = DL_SCH_LCID_DCCH; } else if (sched_ctrl->rlc_status[DL_SCH_LCID_DCCH1].bytes_in_buffer > 0) { lcid = DL_SCH_LCID_DCCH1; - } else if (sched_ctrl->rrc_processing_info.rrc_processing_timer == 0) { + } else if (!nr_rrc_disabled_mac_scheduling(module_id, frame, slot, rnti)) { lcid = DL_SCH_LCID_DTCH; } else { continue; } - + sched_ctrl->num_total_bytes += sched_ctrl->rlc_status[lcid].bytes_in_buffer; //later multiplex here. Just select DCCH/SRB before DTCH/DRB sched_ctrl->lcid_to_schedule = lcid; @@ -1003,24 +1003,6 @@ nr_pp_impl_dl nr_init_fr1_dlsch_preprocessor(module_id_t module_id, int CC_id) return nr_fr1_dlsch_preprocessor; } -void nr_update_rrc_processing_timer(module_id_t module_id, - frame_t frame, - sub_frame_t slot) { - - NR_UE_info_t *UE_info = &RC.nrmac[module_id]->UE_info; - const NR_list_t *UE_list = &UE_info->list; - for (int UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) { - NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; - if (sched_ctrl->rrc_processing_info.rrc_processing_timer > 0) { - sched_ctrl->rrc_processing_info.rrc_processing_timer++; - if (sched_ctrl->rrc_processing_info.rrc_processing_timer >= sched_ctrl->rrc_processing_info.rrc_processing_delay) { - sched_ctrl->rrc_processing_info.rrc_processing_timer = 0; - LOG_I(NR_MAC, "De-activating RRC processing timer for UE: %d\n", UE_id); - } - } - } -} - void nr_schedule_ue_spec(module_id_t module_id, frame_t frame, sub_frame_t slot) { diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index b41d5c05c2..ac0b186218 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2254,10 +2254,6 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG scc, genericParameters, NULL); - - sched_ctrl->rrc_processing_info.rrc_processing_timer = 0; - sched_ctrl->rrc_processing_info.rrc_processing_delay = 10<subcarrierSpacing; // 3GPP TS 38.331 Section 12 Table 12.1-1: UE performance requirements for RRC procedures for UEs - const struct NR_UplinkConfig__uplinkBWP_ToAddModList *ubwpList = servingCellConfig ? servingCellConfig->uplinkConfig->uplinkBWP_ToAddModList : NULL; if (ubwpList) AssertFatal(ubwpList->list.count == 1, "uplinkBWP_ToAddModList has %d BWP!\n", diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index bba7f7d878..e6764b779f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1180,7 +1180,7 @@ void pf_ul(module_id_t module_id, if (B == 0 && !do_sched) continue; - if (sched_ctrl->rrc_processing_info.rrc_processing_timer > 0) { + if (nr_rrc_disabled_mac_scheduling(module_id, frame, slot, UE_info->rnti[UE_id])) { continue; } diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 9d822eba99..8b734e3b95 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -55,18 +55,13 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, NR_BCCH_BCH_Message_t *mib, int add_ue, uint32_t rnti, - NR_CellGroupConfig_t *CellGroup, - bool rrc_reconfiguration_running); + NR_CellGroupConfig_t *CellGroup); void clear_nr_nfapi_information(gNB_MAC_INST * gNB, int CC_idP, frame_t frameP, sub_frame_t subframeP); -void nr_update_rrc_processing_timer(module_id_t module_id, - frame_t frame, - sub_frame_t slot); - void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frame_rxP, sub_frame_t slot_rxP); diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 4ec51f964f..eccffca031 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -553,11 +553,6 @@ typedef struct NR_UE_ul_harq { NR_sched_pusch_t sched_pusch; } NR_UE_ul_harq_t; -typedef struct NR_RRC_processing_info { - uint32_t rrc_processing_timer; - uint32_t rrc_processing_delay; -} NR_RRC_processing_info_t; - /*! \brief scheduling control information set through an API */ #define MAX_CSI_REPORTS 48 typedef struct { @@ -570,9 +565,6 @@ typedef struct { NR_ControlResourceSet_t *coreset; NR_sched_pdcch_t sched_pdcch; - /// Timer for RRC processing procedures - NR_RRC_processing_info_t rrc_processing_info; - /// CCE index and Aggr. Level are shared for PUSCH/PDSCH allocation decisions /// corresponding to the sched_pusch/sched_pdsch structures below int cce_index; diff --git a/openair2/RRC/NR/L2_nr_interface.c b/openair2/RRC/NR/L2_nr_interface.c index 1cf690ac0c..54f6f7c899 100644 --- a/openair2/RRC/NR/L2_nr_interface.c +++ b/openair2/RRC/NR/L2_nr_interface.c @@ -392,3 +392,20 @@ void nr_mac_gNB_rrc_ul_failure_reset(const module_id_t Mod_instP, LOG_W(RRC,"Frame %d, Subframe %d: UL failure reset: UE %x unknown \n",frameP,subframeP,rntiP); } } + +bool nr_rrc_disabled_mac_scheduling(const module_id_t Mod_instP, + const frame_t frameP, + const sub_frame_t subframeP, + const rnti_t rntiP) { + bool ret = false; + 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) { + if(ue_context_p->ue_context.rrc_processing_timer > 0) { + ret = true; + } + } else { + LOG_W(RRC,"Frame %d, Subframe %d: UE 0x%04x unknown \n",frameP,subframeP,rntiP); + } + return ret; +} diff --git a/openair2/RRC/NR/nr_rrc_defs.h b/openair2/RRC/NR/nr_rrc_defs.h index 1b2c38c835..ed6a9b1555 100644 --- a/openair2/RRC/NR/nr_rrc_defs.h +++ b/openair2/RRC/NR/nr_rrc_defs.h @@ -96,6 +96,8 @@ 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) +// 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 #define NR_UE_MODULE_INVALID ((module_id_t) ~0) // FIXME attention! depends on type uint8_t!!! #define NR_UE_INDEX_INVALID ((module_id_t) ~0) // FIXME attention! depends on type uint8_t!!! used to be -1 @@ -372,8 +374,10 @@ typedef struct gNB_RRC_UE_s { rb_id_t gnb_gtp_ebi[S1AP_MAX_E_RAB]; rb_id_t gnb_gtp_psi[S1AP_MAX_E_RAB]; //GTPV1 F1-U TUNNELS - uint32_t incoming_teid[S1AP_MAX_E_RAB]; + uint32_t incoming_teid[S1AP_MAX_E_RAB]; + uint32_t rrc_processing_timer; + uint32_t rrc_processing_delay; uint32_t ul_failure_timer; uint32_t ue_release_timer; uint32_t ue_release_timer_thres; diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index b53a4470aa..d174736404 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -175,8 +175,7 @@ static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration &rrc->carrier.mib, 0, 0, // WIP hardcoded rnti - (NR_CellGroupConfig_t *)NULL, - false); + (NR_CellGroupConfig_t *)NULL); } /* set flag to indicate that cell information is configured. This is required @@ -289,8 +288,7 @@ void apply_macrlc_config(gNB_RRC_INST *rrc, NULL, 0, ue_context_pP->ue_context.rnti, - get_softmodem_params()->sa ? ue_context_pP->ue_context.masterCellGroup : (NR_CellGroupConfig_t *)NULL, - false); + get_softmodem_params()->sa ? ue_context_pP->ue_context.masterCellGroup : (NR_CellGroupConfig_t *)NULL); nr_rrc_rlc_config_asn1_req(ctxt_pP, ue_context_pP->ue_context.SRB_configList, @@ -475,8 +473,7 @@ rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest( &rrc_instance_p->carrier.mib, 0, ue_context_pP->ue_context.rnti, - (NR_CellGroupConfig_t *)NULL, - false); + (NR_CellGroupConfig_t *)NULL); LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating RRCSetup (bytes %d)\n", @@ -727,23 +724,13 @@ rrc_gNB_generate_defaultRRCReconfiguration( NULL, ue_p->masterCellGroup); + int common_scs = rrc->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; + ue_context_pP->ue_context.rrc_processing_timer = 1; + ue_context_pP->ue_context.rrc_processing_delay = NR_RRC_PROCESSING_DELAY_MS<ue_context.nas_pdu.buffer); LOG_DUMPMSG(NR_RRC, DEBUG_RRC,(char *)buffer, size, "[MSG] RRC Reconfiguration\n"); - rrc_mac_config_req_gNB(ctxt_pP->module_id, - 0, - 0, - 0, - 0, - 0, - NULL, - NULL, - 0, - ue_context_pP->ue_context.rnti, - NULL, - true); - /* Free all NAS PDUs */ for (int i = 0; i < ue_context_pP->ue_context.nb_of_pdusessions; i++) { if (ue_context_pP->ue_context.pduSession[i].param.nas_pdu.buffer != NULL) { @@ -1002,20 +989,12 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( &rrc->carrier, NULL, cellGroupConfig); - LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, "[MSG] RRC Reconfiguration\n"); - rrc_mac_config_req_gNB(ctxt_pP->module_id, - 0, - 0, - 0, - 0, - 0, - NULL, - NULL, - 0, - ue_context_pP->ue_context.rnti, - NULL, - true); + int common_scs = rrc->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; + ue_context_pP->ue_context.rrc_processing_timer = 1; + ue_context_pP->ue_context.rrc_processing_delay = NR_RRC_PROCESSING_DELAY_MS<ue_context.nb_of_pdusessions; i++) { @@ -1187,20 +1166,12 @@ rrc_gNB_modify_dedicatedRRCReconfiguration( NULL, NULL, NULL); - LOG_DUMPMSG(NR_RRC, DEBUG_RRC, (char *)buffer, size, "[MSG] RRC Reconfiguration\n"); - rrc_mac_config_req_gNB(ctxt_pP->module_id, - 0, - 0, - 0, - 0, - 0, - NULL, - NULL, - 0, - ue_context_pP->ue_context.rnti, - NULL, - true); + int common_scs = RC.nrrrc[ctxt_pP->module_id]->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; + ue_context_pP->ue_context.rrc_processing_timer = 1; + ue_context_pP->ue_context.rrc_processing_delay = NR_RRC_PROCESSING_DELAY_MS<ue_context.nb_of_modify_pdusessions; i++) { @@ -1301,21 +1272,12 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release( NULL, NULL); + int common_scs = RC.nrrrc[ctxt_pP->module_id]->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; + ue_context_pP->ue_context.rrc_processing_timer = 1; + ue_context_pP->ue_context.rrc_processing_delay = NR_RRC_PROCESSING_DELAY_MS<ue_context.pdu_session_release_command_flag = 1; - LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, "[MSG] RRC Reconfiguration\n"); - rrc_mac_config_req_gNB(ctxt_pP->module_id, - 0, - 0, - 0, - 0, - 0, - NULL, - NULL, - 0, - ue_context_pP->ue_context.rnti, - NULL, - true); + LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, "[MSG] RRC Reconfiguration\n"); /* Free all NAS PDUs */ if (nas_length > 0) { @@ -1423,8 +1385,7 @@ rrc_gNB_process_RRCReconfigurationComplete( NULL, 0, ue_context_pP->ue_context.rnti, - ue_context_pP->ue_context.masterCellGroup, - false); + ue_context_pP->ue_context.masterCellGroup); LOG_D(NR_RRC,"Configuring RLC DRBs/SRBs for UE %x\n",ue_context_pP->ue_context.rnti); nr_rrc_rlc_config_asn1_req(ctxt_pP, SRB_configList, // NULL, @@ -1863,20 +1824,12 @@ rrc_gNB_process_RRCConnectionReestablishmentComplete( NULL, NULL, NULL); - LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, "[MSG] RRC Reconfiguration\n"); - rrc_mac_config_req_gNB(ctxt_pP->module_id, - 0, - 0, - 0, - 0, - 0, - NULL, - NULL, - 0, - ue_context_pP->ue_context.rnti, - NULL, - true); + int common_scs = RC.nrrrc[ctxt_pP->module_id]->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; + ue_context_pP->ue_context.rrc_processing_timer = 1; + ue_context_pP->ue_context.rrc_processing_delay = NR_RRC_PROCESSING_DELAY_MS<ue_context.nb_of_pdusessions; i++) { @@ -3493,6 +3446,14 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) { get_ul_mimo_layers(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr)); } } + + if (ue_context_p->ue_context.rrc_processing_timer > 0) { + ue_context_p->ue_context.rrc_processing_timer++; + if(ue_context_p->ue_context.rrc_processing_timer >= ue_context_p->ue_context.rrc_processing_delay) { + ue_context_p->ue_context.rrc_processing_timer = 0; + } + } + if (ue_context_p->ue_context.ul_failure_timer > 0) { ue_context_p->ue_context.ul_failure_timer++; diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 271f699ca5..adb44d89cb 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -368,8 +368,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ &rrc->carrier.mib, 1, // add_ue flag ue_context_p->ue_id_rnti, - ue_context_p->ue_context.secondaryCellGroup, - false); + ue_context_p->ue_context.secondaryCellGroup); } else { rrc_mac_config_req_gNB(rrc->module_id, rrc->carrier.ssb_SubcarrierOffset, @@ -381,8 +380,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ NULL, 1, // add_ue flag ue_context_p->ue_id_rnti, - ue_context_p->ue_context.secondaryCellGroup, - false); + ue_context_p->ue_context.secondaryCellGroup); } if(m == NULL){ From 726cebaa9d49313e4b698c461bc6de791212dd6b Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Wed, 23 Mar 2022 11:17:52 +0000 Subject: [PATCH 4/6] Create function to enable nr_rrc_processing_timer --- openair2/RRC/NR/L2_nr_interface.c | 2 +- openair2/RRC/NR/nr_rrc_defs.h | 4 +-- openair2/RRC/NR/rrc_gNB.c | 47 ++++++++++++++++++------------- 3 files changed, 31 insertions(+), 22 deletions(-) diff --git a/openair2/RRC/NR/L2_nr_interface.c b/openair2/RRC/NR/L2_nr_interface.c index 54f6f7c899..ae3587e43f 100644 --- a/openair2/RRC/NR/L2_nr_interface.c +++ b/openair2/RRC/NR/L2_nr_interface.c @@ -401,7 +401,7 @@ bool nr_rrc_disabled_mac_scheduling(const module_id_t Mod_instP, 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) { - if(ue_context_p->ue_context.rrc_processing_timer > 0) { + if(ue_context_p->ue_context.nr_rrc_processing_timer > 0) { ret = true; } } else { diff --git a/openair2/RRC/NR/nr_rrc_defs.h b/openair2/RRC/NR/nr_rrc_defs.h index ed6a9b1555..448b76d785 100644 --- a/openair2/RRC/NR/nr_rrc_defs.h +++ b/openair2/RRC/NR/nr_rrc_defs.h @@ -376,8 +376,8 @@ typedef struct gNB_RRC_UE_s { //GTPV1 F1-U TUNNELS uint32_t incoming_teid[S1AP_MAX_E_RAB]; - uint32_t rrc_processing_timer; - uint32_t rrc_processing_delay; + uint32_t nr_rrc_processing_timer; + uint32_t nr_rrc_processing_delay; uint32_t ul_failure_timer; uint32_t ue_release_timer; uint32_t ue_release_timer_thres; diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index d174736404..3ca8386247 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -140,6 +140,13 @@ void openair_nr_rrc_on(const protocol_ctxt_t *const ctxt_pP) { RC.nrrrc[ctxt_pP->module_id]->carrier.Srb0.Active = 1; } +void enable_nr_rrc_processing_timer(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; +} + ///---------------------------------------------------------------------------------------------------------------/// ///---------------------------------------------------------------------------------------------------------------/// @@ -724,9 +731,10 @@ rrc_gNB_generate_defaultRRCReconfiguration( NULL, ue_p->masterCellGroup); - int common_scs = rrc->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; - ue_context_pP->ue_context.rrc_processing_timer = 1; - ue_context_pP->ue_context.rrc_processing_delay = NR_RRC_PROCESSING_DELAY_MS<carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, + NR_RRC_PROCESSING_DELAY_MS); + free(ue_context_pP->ue_context.nas_pdu.buffer); LOG_DUMPMSG(NR_RRC, DEBUG_RRC,(char *)buffer, size, "[MSG] RRC Reconfiguration\n"); @@ -990,9 +998,9 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( NULL, cellGroupConfig); - int common_scs = rrc->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; - ue_context_pP->ue_context.rrc_processing_timer = 1; - ue_context_pP->ue_context.rrc_processing_delay = NR_RRC_PROCESSING_DELAY_MS<carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, + NR_RRC_PROCESSING_DELAY_MS); LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, "[MSG] RRC Reconfiguration\n"); @@ -1167,9 +1175,9 @@ rrc_gNB_modify_dedicatedRRCReconfiguration( NULL, NULL); - int common_scs = RC.nrrrc[ctxt_pP->module_id]->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; - ue_context_pP->ue_context.rrc_processing_timer = 1; - ue_context_pP->ue_context.rrc_processing_delay = NR_RRC_PROCESSING_DELAY_MS<module_id]->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, + NR_RRC_PROCESSING_DELAY_MS); LOG_DUMPMSG(NR_RRC, DEBUG_RRC, (char *)buffer, size, "[MSG] RRC Reconfiguration\n"); @@ -1272,9 +1280,10 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release( NULL, NULL); - int common_scs = RC.nrrrc[ctxt_pP->module_id]->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; - ue_context_pP->ue_context.rrc_processing_timer = 1; - ue_context_pP->ue_context.rrc_processing_delay = NR_RRC_PROCESSING_DELAY_MS<module_id]->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, + NR_RRC_PROCESSING_DELAY_MS); + ue_context_pP->ue_context.pdu_session_release_command_flag = 1; LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, "[MSG] RRC Reconfiguration\n"); @@ -1825,9 +1834,9 @@ rrc_gNB_process_RRCConnectionReestablishmentComplete( NULL, NULL); - int common_scs = RC.nrrrc[ctxt_pP->module_id]->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; - ue_context_pP->ue_context.rrc_processing_timer = 1; - ue_context_pP->ue_context.rrc_processing_delay = NR_RRC_PROCESSING_DELAY_MS<module_id]->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, + NR_RRC_PROCESSING_DELAY_MS); LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, "[MSG] RRC Reconfiguration\n"); @@ -3447,10 +3456,10 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) { } } - if (ue_context_p->ue_context.rrc_processing_timer > 0) { - ue_context_p->ue_context.rrc_processing_timer++; - if(ue_context_p->ue_context.rrc_processing_timer >= ue_context_p->ue_context.rrc_processing_delay) { - ue_context_p->ue_context.rrc_processing_timer = 0; + 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) { + ue_context_p->ue_context.nr_rrc_processing_timer = 0; } } From 6f5ea27e0957ad91c68fc23910061f1c3f3ffc70 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Wed, 23 Mar 2022 13:11:04 +0000 Subject: [PATCH 5/6] Improve nr_rrc_processing_timer procedures --- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h | 4 ---- openair2/LAYER2/NR_MAC_gNB/config.c | 4 ++++ .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 1 + .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 5 +--- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 2 ++ openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 2 ++ openair2/RRC/NR/L2_nr_interface.c | 19 +-------------- openair2/RRC/NR/rrc_gNB.c | 24 ++++++++++++------- 9 files changed, 28 insertions(+), 35 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h index a05b26599d..7fd870ed1f 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h @@ -203,8 +203,4 @@ void nr_mac_gNB_rrc_ul_failure_reset(const module_id_t Mod_instP, const sub_frame_t subframeP, const rnti_t rntiP); -bool nr_rrc_disabled_mac_scheduling(const module_id_t Mod_instP, - const frame_t frameP, - const sub_frame_t subframeP, - const rnti_t rntiP); #endif diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 9ad57b2d84..62ec240a11 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -425,6 +425,10 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts } +void nr_rrc_mac_schedule_ue_enabled(module_id_t module_id, rnti_t rnti, bool schedule_enabled) { + const int UE_id = find_nr_UE_id(module_id,rnti); + RC.nrmac[module_id]->UE_info.UE_sched_ctrl[UE_id].schedule_enabled = schedule_enabled; +} int rrc_mac_config_req_gNB(module_id_t Mod_idP, int ssb_SubcarrierOffset, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 9e09c704d7..8e4d8a3ed9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -518,7 +518,7 @@ void nr_store_dlsch_buffer(module_id_t module_id, lcid = DL_SCH_LCID_DCCH; } else if (sched_ctrl->rlc_status[DL_SCH_LCID_DCCH1].bytes_in_buffer > 0) { lcid = DL_SCH_LCID_DCCH1; - } else if (!nr_rrc_disabled_mac_scheduling(module_id, frame, slot, rnti)) { + } else if (sched_ctrl->schedule_enabled == true) { lcid = DL_SCH_LCID_DTCH; } else { continue; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index ac0b186218..1cad885d85 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2220,6 +2220,7 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG sched_ctrl->pucch_consecutive_dtx_cnt = 0; sched_ctrl->pusch_consecutive_dtx_cnt = 0; sched_ctrl->ul_failure = 0; + sched_ctrl->schedule_enabled = true; sched_ctrl->sched_srs.frame = -1; sched_ctrl->sched_srs.slot = -1; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index e6764b779f..f8edd3fa86 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1177,10 +1177,7 @@ void pf_ul(module_id_t module_id, const bool do_sched = nr_UE_is_to_be_scheduled(module_id, 0, UE_id, sched_pusch->frame, sched_pusch->slot); LOG_D(NR_MAC,"pf_ul: do_sched UE %d => %s\n",UE_id,do_sched ? "yes" : "no"); - if (B == 0 && !do_sched) - continue; - - if (nr_rrc_disabled_mac_scheduling(module_id, frame, slot, UE_info->rnti[UE_id])) { + if ( (B == 0 && !do_sched) || (sched_ctrl->schedule_enabled == false) ) { continue; } diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 8b734e3b95..84a49182c7 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -45,6 +45,8 @@ void config_common(int Mod_idP, NR_ServingCellConfigCommon_t *scc ); +void nr_rrc_mac_schedule_ue_enabled(module_id_t module_id, rnti_t rnti, bool schedule_enabled); + int rrc_mac_config_req_gNB(module_id_t Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts, diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index eccffca031..d5061972b0 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -646,6 +646,8 @@ typedef struct { /// UL HARQ processes that await retransmission NR_list_t retrans_ul_harq; NR_UE_mac_ce_ctrl_t UE_mac_ce_ctrl;// MAC CE related information + /// Flag to indicate if MAC scheduling is enabled or disabled by RRC (e.g. during RRC processing time) + bool schedule_enabled; } NR_UE_sched_ctrl_t; typedef struct { diff --git a/openair2/RRC/NR/L2_nr_interface.c b/openair2/RRC/NR/L2_nr_interface.c index ae3587e43f..a1f776b5ca 100644 --- a/openair2/RRC/NR/L2_nr_interface.c +++ b/openair2/RRC/NR/L2_nr_interface.c @@ -391,21 +391,4 @@ 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); } -} - -bool nr_rrc_disabled_mac_scheduling(const module_id_t Mod_instP, - const frame_t frameP, - const sub_frame_t subframeP, - const rnti_t rntiP) { - bool ret = false; - 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) { - if(ue_context_p->ue_context.nr_rrc_processing_timer > 0) { - ret = true; - } - } else { - LOG_W(RRC,"Frame %d, Subframe %d: UE 0x%04x unknown \n",frameP,subframeP,rntiP); - } - return ret; -} +} \ No newline at end of file diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 3ca8386247..9ee81870f4 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -140,11 +140,13 @@ void openair_nr_rrc_on(const protocol_ctxt_t *const ctxt_pP) { RC.nrrrc[ctxt_pP->module_id]->carrier.Srb0.Active = 1; } -void enable_nr_rrc_processing_timer(rrc_gNB_ue_context_t *ue_context_pP, - NR_SubcarrierSpacing_t subcarrierSpacing, - uint32_t delay_ms) { +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; + nr_rrc_mac_schedule_ue_enabled(module_id, ue_context_pP->ue_context.rnti, false); } ///---------------------------------------------------------------------------------------------------------------/// @@ -731,7 +733,8 @@ rrc_gNB_generate_defaultRRCReconfiguration( NULL, ue_p->masterCellGroup); - enable_nr_rrc_processing_timer(ue_context_pP, + 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); @@ -998,7 +1001,8 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( NULL, cellGroupConfig); - enable_nr_rrc_processing_timer(ue_context_pP, + 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); @@ -1175,7 +1179,8 @@ rrc_gNB_modify_dedicatedRRCReconfiguration( NULL, NULL); - enable_nr_rrc_processing_timer(ue_context_pP, + 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); @@ -1280,7 +1285,8 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release( NULL, NULL); - enable_nr_rrc_processing_timer(ue_context_pP, + 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); @@ -1834,7 +1840,8 @@ rrc_gNB_process_RRCConnectionReestablishmentComplete( NULL, NULL); - enable_nr_rrc_processing_timer(ue_context_pP, + 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); @@ -3460,6 +3467,7 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) { 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) { 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); } } From daf3fb0e2c59817f47a054a61ba33d87ccdd4b3c Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Wed, 23 Mar 2022 13:29:07 +0000 Subject: [PATCH 6/6] Enable nr_rrc_processing_timer for RRCSetup --- openair2/RRC/NR/rrc_gNB.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 9ee81870f4..5a1c188602 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -353,6 +353,11 @@ 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, @@ -463,6 +468,11 @@ 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,