From 885611cd006e356681b8d2a96d546c0185fd16ae Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 28 Feb 2024 08:41:26 +0100 Subject: [PATCH 01/13] SRS config: make explicit that > 30 UEs don't work, handle gracefully at runtime We can only support up to 30 UEs for SRS. In this commit, we change: - if the total number of UEs is > 32, throw error during compilation to raise awareness (32 so that a multiple of two still works, everything else is confusing, see also next point) - during runtime, handle gracefully if UID is 30 or 31 to not abort (we can simply not allocate SRS resources) Also, refactor config_srs() to always give back new memory; the code is shorter and clearer. Rename to get_contig_srs() to make it explicit. --- openair2/RRC/NR/nr_rrc_config.c | 72 +++++++++++++-------------------- 1 file changed, 27 insertions(+), 45 deletions(-) diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index d85bedf79e..06e5f75442 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -608,25 +608,27 @@ static struct NR_SRS_Resource__resourceType__periodic *configure_periodic_srs(co return periodic_srs; } -static void config_srs(const NR_ServingCellConfigCommon_t *scc, - NR_SetupRelease_SRS_Config_t *setup_release_srs_Config, - const NR_UE_NR_Capability_t *uecap, - const int curr_bwp, - const int uid, - const int res_id, - const long maxMIMO_Layers, - const int do_srs) +static NR_SetupRelease_SRS_Config_t *get_config_srs(const NR_ServingCellConfigCommon_t *scc, + const NR_UE_NR_Capability_t *uecap, + const int curr_bwp, + const int uid, + const int res_id, + const long maxMIMO_Layers, + int do_srs) { - setup_release_srs_Config->present = NR_SetupRelease_SRS_Config_PR_setup; - - NR_SRS_Config_t *srs_Config; - if (setup_release_srs_Config->choice.setup) { - srs_Config = setup_release_srs_Config->choice.setup; - ASN_STRUCT_FREE(asn_DEF_NR_SRS_Config, srs_Config); + // if in the future NUMBER_OF_gNB_MAX is increased, it will be necessary to improve the allocation of SRS resources, + // where the startPosition = 2 or 3 and sl160 = 17, 17, 27 ... 157 only give us 30 different allocations. + static_assert(NUMBER_OF_gNB_MAX <= 32, + "SRS can only handle up to 30 UEs (additional ones are handled gracefully, but don't have SRS enabled\n"); + if (do_srs && (uid < 0 || uid > 29)) { + LOG_E(NR_RRC, "gNB cannot allocate SRS resources for UID %d: available resources exceeded\n", uid); + do_srs = 0; } + NR_SetupRelease_SRS_Config_t *setup_release_srs_Config = calloc(1,sizeof(*setup_release_srs_Config)); + setup_release_srs_Config->present = NR_SetupRelease_SRS_Config_PR_setup; setup_release_srs_Config->choice.setup = calloc(1,sizeof(*setup_release_srs_Config->choice.setup)); - srs_Config = setup_release_srs_Config->choice.setup; + NR_SRS_Config_t *srs_Config = setup_release_srs_Config->choice.setup; srs_Config->srs_ResourceSetToReleaseList = NULL; @@ -733,6 +735,8 @@ static void config_srs(const NR_ServingCellConfigCommon_t *scc, srs_res0->spatialRelationInfo->referenceSignal.present = NR_SRS_SpatialRelationInfo__referenceSignal_PR_ssb_Index; srs_res0->spatialRelationInfo->referenceSignal.choice.ssb_Index = 0; asn1cSeqAdd(&srs_Config->srs_ResourceToAddModList->list,srs_res0); + + return setup_release_srs_Config; } void prepare_sim_uecap(NR_UE_NR_Capability_t *cap, @@ -1443,15 +1447,7 @@ static void config_uplinkBWP(NR_BWP_Uplink_t *ubwp, && servingcellconfigdedicated->uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers ? *servingcellconfigdedicated->uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers : 1; - ubwp->bwp_Dedicated->srs_Config = calloc(1,sizeof(*ubwp->bwp_Dedicated->srs_Config)); - config_srs(scc, - ubwp->bwp_Dedicated->srs_Config, - NULL, - curr_bwp, - uid, - bwp_loop+1, - maxMIMO_Layers, - configuration->do_SRS); + ubwp->bwp_Dedicated->srs_Config = get_config_srs(scc, NULL, curr_bwp, uid, bwp_loop + 1, maxMIMO_Layers, configuration->do_SRS); ubwp->bwp_Dedicated->configuredGrantConfig = NULL; ubwp->bwp_Dedicated->beamFailureRecoveryConfig = NULL; @@ -2227,8 +2223,7 @@ static NR_SpCellConfig_t *get_initial_SpCellConfig(int uid, : 1; // We are using do_srs = 0 here because the periodic SRS will only be enabled in update_cellGroupConfig() if do_srs == 1 - initialUplinkBWP->srs_Config = calloc(1, sizeof(*initialUplinkBWP->srs_Config)); - config_srs(scc, initialUplinkBWP->srs_Config, NULL, curr_bwp, uid, 0, maxMIMO_Layers, 0); + initialUplinkBWP->srs_Config = get_config_srs(scc, NULL, curr_bwp, uid, 0, maxMIMO_Layers, 0); scheduling_request_config(scc, pucch_Config, scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing); @@ -2525,17 +2520,8 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, // UL and SRS configuration if (configuration->do_SRS && uplinkConfig && uplinkConfig->initialUplinkBWP) { - if (!uplinkConfig->initialUplinkBWP->srs_Config) { - uplinkConfig->initialUplinkBWP->srs_Config = calloc(1, sizeof(*uplinkConfig->initialUplinkBWP->srs_Config)); - } - config_srs(scc, - SpCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->srs_Config, - uecap, - curr_bwp, - uid, - 0, - maxMIMO_Layers, - configuration->do_SRS); + ASN_STRUCT_FREE(asn_DEF_NR_SetupRelease_SRS_Config, uplinkConfig->initialUplinkBWP->srs_Config); + uplinkConfig->initialUplinkBWP->srs_Config = get_config_srs(scc, uecap, curr_bwp, uid, 0, maxMIMO_Layers, configuration->do_SRS); } // Set DL MCS table @@ -2570,7 +2556,9 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, } *pusch_Config->maxRank = ul_max_layers; } - config_srs(scc, ul_bwp->bwp_Dedicated->srs_Config, uecap, bwp_size, uid, i + 1, maxMIMO_Layers, configuration->do_SRS); + + ASN_STRUCT_FREE(asn_DEF_NR_SetupRelease_SRS_Config, ul_bwp->bwp_Dedicated->srs_Config); + ul_bwp->bwp_Dedicated->srs_Config = get_config_srs(scc, uecap, bwp_size, uid, i + 1, maxMIMO_Layers, configuration->do_SRS); } } update_cqitables(bwp_Dedicated->pdsch_Config, SpCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup); @@ -2648,11 +2636,6 @@ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigC if (uecap == NULL) LOG_E(RRC, "No UE Capabilities available when programming default CellGroup in NSA\n"); - // This assert will never happen in the current implementation because NUMBER_OF_UE_MAX = 4. - // However, if in the future NUMBER_OF_UE_MAX is increased, it will be necessary to improve the allocation of SRS resources, - // where the startPosition = 2 or 3 and sl160 = 17, 17, 27 ... 157 only give us 30 different allocations. - AssertFatal(uid >= 0 && uid < 30, "gNB cannot allocate the SRS resources\n"); - uint64_t bitmap = get_ssb_bitmap(servingcellconfigcommon); // See comment at the end of this function regarding ServingCellConfig fix_servingcellconfigdedicated(servingcellconfigdedicated); @@ -2772,8 +2755,7 @@ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigC int curr_bwp = NRRIV2BW(servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - initialUplinkBWP->srs_Config = calloc(1, sizeof(*initialUplinkBWP->srs_Config)); - config_srs(servingcellconfigcommon, initialUplinkBWP->srs_Config, NULL, curr_bwp, uid, 0, maxMIMO_Layers, configuration->do_SRS); + initialUplinkBWP->srs_Config = get_config_srs(servingcellconfigcommon, NULL, curr_bwp, uid, 0, maxMIMO_Layers, configuration->do_SRS); // Downlink BWPs int n_dl_bwp = 1; From 70be05381f38d650ee5ffd474f4bc594a1124195 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 28 Feb 2024 08:08:37 +0100 Subject: [PATCH 02/13] remove unused UE_PF_PO and ue_pf_po_mutex They use 4G NUMBER_OF_UE_MAX, which is not supposed to be present in 5G. Further, the mutex and variable are global state; for Paging, we should use F1. --- executables/nr-softmodem.c | 4 --- executables/nr-uesoftmodem.c | 3 --- openair2/RRC/NR/nr_rrc_extern.h | 4 --- openair2/RRC/NR/rrc_gNB.c | 43 +++------------------------------ 4 files changed, 3 insertions(+), 51 deletions(-) diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index 3d9c02f5e4..04b66237dc 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -679,9 +679,6 @@ int main( int argc, char **argv ) { AssertFatal(ret == 0, "cannot create ITTI tasks\n"); } - // init UE_PF_PO and mutex lock - pthread_mutex_init(&ue_pf_po_mutex, NULL); - memset (&UE_PF_PO[0][0], 0, sizeof(UE_PF_PO_t)*NUMBER_OF_UE_MAX*MAX_NUM_CCs); mlockall(MCL_CURRENT | MCL_FUTURE); pthread_cond_init(&sync_cond,NULL); pthread_mutex_init(&sync_mutex, NULL); @@ -823,7 +820,6 @@ int main( int argc, char **argv ) { pthread_mutex_destroy(&sync_mutex); pthread_cond_destroy(&nfapi_sync_cond); pthread_mutex_destroy(&nfapi_sync_mutex); - pthread_mutex_destroy(&ue_pf_po_mutex); // *** Handle per CC_id openair0 diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index de1c97a07b..a0ea170aa5 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -567,9 +567,6 @@ int main(int argc, char **argv) } init_openair0(); - // init UE_PF_PO and mutex lock - pthread_mutex_init(&ue_pf_po_mutex, NULL); - memset (&UE_PF_PO[0][0], 0, sizeof(UE_PF_PO_t)*NUMBER_OF_UE_MAX*MAX_NUM_CCs); set_latency_target(); if(IS_SOFTMODEM_DOSCOPE_QT) { diff --git a/openair2/RRC/NR/nr_rrc_extern.h b/openair2/RRC/NR/nr_rrc_extern.h index 64e6095dcd..0752941dbc 100644 --- a/openair2/RRC/NR/nr_rrc_extern.h +++ b/openair2/RRC/NR/nr_rrc_extern.h @@ -51,8 +51,4 @@ extern uint16_t RACH_FREQ_ALLOC; extern MAC_MEAS_T BCCH_MEAS_TRIGGER,CCCH_MEAS_TRIGGER,DCCH_MEAS_TRIGGER,DTCH_MEAS_TRIGGER; extern MAC_AVG_T BCCH_MEAS_AVG,CCCH_MEAS_AVG,DCCH_MEAS_AVG, DTCH_MEAS_AVG; -extern UE_PF_PO_t UE_PF_PO[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB]; - -extern pthread_mutex_t ue_pf_po_mutex; - #endif diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 513e874073..0dc77fcf09 100644 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -2698,14 +2698,12 @@ rrc_gNB_generate_RRCRelease( int rrc_gNB_generate_pcch_msg(sctp_assoc_t assoc_id, const NR_SIB1_t *sib1, uint32_t tmsi, uint8_t paging_drx) { instance_t instance = 0; - uint8_t CC_id = 0; const unsigned int Ttab[4] = {32,64,128,256}; uint8_t Tc; uint8_t Tue; uint32_t pfoffset; uint32_t N; /* N: min(T,nB). total count of PF in one DRX cycle */ uint32_t Ns = 0; /* Ns: max(1,nB/T) */ - uint8_t i_s; /* i_s = floor(UE_ID/N) mod Ns */ uint32_t T; /* DRX cycle */ uint32_t length; uint8_t buffer[RRC_BUF_SIZE]; @@ -2767,44 +2765,9 @@ int rrc_gNB_generate_pcch_msg(sctp_assoc_t assoc_id, const NR_SIB1_t *sib1, uint return (-1); } - /* insert data to UE_PF_PO or update data in UE_PF_PO */ - pthread_mutex_lock(&ue_pf_po_mutex); - uint8_t i = 0; - - for (i = 0; i < MAX_MOBILES_PER_ENB; i++) { - if ((UE_PF_PO[CC_id][i].enable_flag == true && UE_PF_PO[CC_id][i].ue_index_value == (uint16_t)(tmsi%1024)) - || (UE_PF_PO[CC_id][i].enable_flag != true)) { - /* set T = min(Tc,Tue) */ - UE_PF_PO[CC_id][i].T = T; - /* set UE_ID */ - UE_PF_PO[CC_id][i].ue_index_value = (uint16_t)(tmsi%1024); - /* calculate PF and PO */ - /* set PF_min and PF_offset: (SFN + PF_offset) mod T = (T div N)*(UE_ID mod N) */ - UE_PF_PO[CC_id][i].PF_min = (T / N) * (UE_PF_PO[CC_id][i].ue_index_value % N); - UE_PF_PO[CC_id][i].PF_offset = pfoffset; - /* set i_s */ - /* i_s = floor(UE_ID/N) mod Ns */ - i_s = (uint8_t)((UE_PF_PO[CC_id][i].ue_index_value / N) % Ns); - UE_PF_PO[CC_id][i].i_s = i_s; - - // TODO,set PO - - if (UE_PF_PO[CC_id][i].enable_flag == true) { - //paging exist UE log - LOG_D(NR_RRC,"[gNB %ld] CC_id %d In rrc_gNB_generate_pcch_msg: Update exist UE %d, T %d, N %d, PF %d, i_s %d, PF_offset %d\n", instance, CC_id, UE_PF_PO[CC_id][i].ue_index_value, - T, N, UE_PF_PO[CC_id][i].PF_min, UE_PF_PO[CC_id][i].i_s, UE_PF_PO[CC_id][i].PF_offset); - } else { - /* set enable_flag */ - UE_PF_PO[CC_id][i].enable_flag = true; - //paging new UE log - LOG_D(NR_RRC,"[gNB %ld] CC_id %d In rrc_gNB_generate_pcch_msg: Insert a new UE %d, T %d, N %d, PF %d, i_s %d, PF_offset %d\n", instance, CC_id, UE_PF_PO[CC_id][i].ue_index_value, - T, N, UE_PF_PO[CC_id][i].PF_min, UE_PF_PO[CC_id][i].i_s, UE_PF_PO[CC_id][i].PF_offset); - } - break; - } - } - - pthread_mutex_unlock(&ue_pf_po_mutex); + (void) N; /* not used, suppress warning */ + (void) Ns; /* not used, suppress warning */ + (void) pfoffset; /* not used, suppress warning */ /* Create message for PDCP (DLInformationTransfer_t) */ length = do_NR_Paging (instance, From 7ea883352901aae571248f68fc119cefe4122e4c Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 28 Feb 2024 10:38:56 +0100 Subject: [PATCH 03/13] Use MAX_MOBILES_PER_GNB in 5G NR code NUMBER_OF_UE_MAX is a 4G constant, use 5G one instead --- openair1/PHY/TOOLS/nr_phy_scope.c | 14 +++++++------- openair1/SIMULATION/NR_PHY/ulsim.c | 2 +- openair2/RRC/NR/rrc_gNB.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/openair1/PHY/TOOLS/nr_phy_scope.c b/openair1/PHY/TOOLS/nr_phy_scope.c index 79ac95ef73..f9abcf211b 100644 --- a/openair1/PHY/TOOLS/nr_phy_scope.c +++ b/openair1/PHY/TOOLS/nr_phy_scope.c @@ -614,8 +614,8 @@ static void pucchIQ (OAIgraph_t *graph, scopeData_t *p, int nb_UEs) { static void puschThroughtput (OAIgraph_t *graph, scopeData_t *p, int nb_UEs) { // PUSCH Throughput /* - float tput_time_enb[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}}; - float tput_enb[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}}; + float tput_time_enb[MAX_MOBILES_PER_GNB][TPUT_WINDOW_LENGTH] = {{0}}; + float tput_enb[MAX_MOBILES_PER_GNB][TPUT_WINDOW_LENGTH] = {{0}}; memmove( tput_time_enb[UE_id], &tput_time_enb[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) ); memmove( tput_enb[UE_id], &tput_enb[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) ); @@ -725,7 +725,7 @@ static void *scope_thread_gNB(void *arg) { int fl_argc=1; char *name="5G-gNB-scope"; fl_initialize (&fl_argc, &name, NULL, 0, 0); - int nb_ue=min(NUMBER_OF_UE_MAX, scope_enb_num_ue); + int nb_ue=min(MAX_MOBILES_PER_GNB, scope_enb_num_ue); OAI_phy_scope_t *form_gnb = create_phy_scope_gnb(); while (!oai_exit) { @@ -985,9 +985,9 @@ static void uePdschIQ (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_ } static void uePdschThroughput (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { /* - float tput_time_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}}; - float tput_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}}; - float tput_ue_max[NUMBER_OF_UE_MAX] = {0}; + float tput_time_ue[MAX_MOBILES_PER_GNB][TPUT_WINDOW_LENGTH] = {{0}}; + float tput_ue[MAX_MOBILES_PER_GNB][TPUT_WINDOW_LENGTH] = {{0}}; + float tput_ue_max[MAX_MOBILES_PER_GNB] = {0}; // PDSCH Throughput @@ -1178,7 +1178,7 @@ static void reset_stats_gNB(FL_OBJECT *button, int i,k; //PHY_VARS_gNB *phy_vars_gNB = RC.gNB[0][0]; - for (i=0; idlsch[i][0]->Mlimit; j++) { phy_vars_gNB->UE_stats[i].dlsch_NAK[k][j]=0; diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index f4f6e891b2..b252f1cdd4 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -136,7 +136,7 @@ nrUE_params_t *get_nrUE_params(void) { uint16_t n_rnti = 0x1234; openair0_config_t openair0_cfg[MAX_CARDS]; -channel_desc_t *UE2gNB[NUMBER_OF_UE_MAX][NUMBER_OF_gNB_MAX]; +channel_desc_t *UE2gNB[MAX_MOBILES_PER_GNB][NUMBER_OF_gNB_MAX]; int NB_UE_INST = 1; configmodule_interface_t *uniqCfg = NULL; diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 0dc77fcf09..f0df5996a3 100644 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -317,7 +317,7 @@ static void rrc_gNB_CU_DU_init(gNB_RRC_INST *rrc) void openair_rrc_gNB_configuration(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration) { AssertFatal(rrc != NULL, "RC.nrrrc not initialized!"); - AssertFatal(NUMBER_OF_UE_MAX < (module_id_t)0xFFFFFFFFFFFFFFFF, " variable overflow"); + AssertFatal(MAX_MOBILES_PER_GNB < (module_id_t)0xFFFFFFFFFFFFFFFF, " variable overflow"); AssertFatal(configuration!=NULL,"configuration input is null\n"); rrc->module_id = 0; rrc_gNB_CU_DU_init(rrc); From 711518ba00c21d9d44263d62e5db7a8d3616ec83 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 28 Feb 2024 08:03:08 +0100 Subject: [PATCH 04/13] Move NUMBER_FRAMES_PHY_UE_INACTIVE to smaller scope --- common/openairinterface5g_limits.h | 2 -- openair1/PHY/NR_TRANSPORT/nr_ulsch.h | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/openairinterface5g_limits.h b/common/openairinterface5g_limits.h index d9e49e26a7..d2f44a6195 100644 --- a/common/openairinterface5g_limits.h +++ b/common/openairinterface5g_limits.h @@ -12,8 +12,6 @@ # define NUMBER_OF_SRS_MAX 16 # define NUMBER_OF_SCH_STATS_MAX 16 -#define NUMBER_FRAMES_PHY_UE_INACTIVE 10 - #define MAX_MANAGED_ENB_PER_MOBILE 2 #define MAX_MANAGED_GNB_PER_MOBILE 2 diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch.h b/openair1/PHY/NR_TRANSPORT/nr_ulsch.h index ec7f6cae69..76fbb5da7f 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch.h +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch.h @@ -33,6 +33,8 @@ #include "PHY/defs_gNB.h" #include "common/utils/threadPool/thread-pool.h" +#define NUMBER_FRAMES_PHY_UE_INACTIVE 10 + void free_gNB_ulsch(NR_gNB_ULSCH_t *ulsch, uint16_t N_RB_UL); NR_gNB_ULSCH_t new_gNB_ulsch(uint8_t max_ldpc_iterations, uint16_t N_RB_UL); From 98c309ffe3a510d8c98d3b6c8bce9a4470efd2a7 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 27 Feb 2024 18:52:07 +0100 Subject: [PATCH 05/13] Refactor nr_decode_pucch0() to not rely on uci_stats the uci_stats variable (pointing to per-UE statistics for UCI) is used in function nr_decode_pucch0() to store information which is important beyond statistics, e.g., uci_stats->pucch0_thres as a threshold (which comes from somewhere else) This commit refactors to use original or intermediate variables to not mix uci_stats usage with actual processing. Also, group uci_stats a bit more. --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 35b5b1be3d..4ef42119bf 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -348,9 +348,14 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, #endif index=maxpos; - uci_stats->pucch0_n00 = gNB->measurements.n0_subband_power_tot_dB[prb_offset[0]]; - uci_stats->pucch0_n01 = gNB->measurements.n0_subband_power_tot_dB[prb_offset[1]]; - LOG_D(PHY,"n00[%d] = %d, n01[%d] = %d\n",prb_offset[0],uci_stats->pucch0_n00,prb_offset[1],uci_stats->pucch0_n01); + int pucch0_n00 = gNB->measurements.n0_subband_power_tot_dB[prb_offset[0]]; + int pucch0_n01 = gNB->measurements.n0_subband_power_tot_dB[prb_offset[1]]; + LOG_D(PHY, "n00[%d] = %d, n01[%d] = %d\n", prb_offset[0], pucch0_n00, prb_offset[1], pucch0_n01); + + uci_stats->pucch0_n00 = pucch0_n00; + uci_stats->pucch0_n01 = pucch0_n01; + uci_stats->pucch0_thres = gNB->pucch0_thres; + // estimate CQI for MAC (from antenna port 0 only) int max_n0 = max(gNB->measurements.n0_subband_power_tot_dB[prb_offset[0]], gNB->measurements.n0_subband_power_tot_dB[prb_offset[1]]); @@ -363,7 +368,6 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, else cqi = (640 + SNRtimes10) / 5; - uci_stats->pucch0_thres = gNB->pucch0_thres; /* + (10*max_n0);*/ bool no_conf=false; if (nr_sequences>1) { if (/*xrtmag_dBtimes10 < (30+xrtmag_next_dBtimes10) ||*/ SNRtimes10 < gNB->pucch0_thres) { @@ -372,7 +376,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, "%d.%d PUCCH bad confidence: %d threshold, %d, %d, %d\n", frame, slot, - uci_stats->pucch0_thres, + gNB->pucch0_thres, SNRtimes10, xrtmag_dBtimes10, xrtmag_next_dBtimes10); @@ -388,7 +392,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->rssi = 1280 - (10 * dB_fixed(32767 * 32767)) - dB_fixed_times10(signal_energy_ant0); if (pucch_pdu->bit_len_harq==0) { - uci_pdu->sr.sr_confidence_level = SNRtimes10 < uci_stats->pucch0_thres; + uci_pdu->sr.sr_confidence_level = SNRtimes10 < gNB->pucch0_thres; uci_stats->pucch0_sr_trials++; if (xrtmag_dBtimes10>(10*max_n0+100)) { uci_pdu->sr.sr_indication = 1; @@ -415,9 +419,9 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, xrtmag_next_dBtimes10, pucch_power_dBtimes10, max_n0, - uci_stats->pucch0_n00, - uci_stats->pucch0_n01, - uci_stats->pucch0_thres, + pucch0_n00, + pucch0_n01, + gNB->pucch0_thres, cqi, SNRtimes10, 10 * log10((double)signal_energy_ant0)); @@ -450,9 +454,9 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, xrtmag_next_dBtimes10, pucch_power_dBtimes10, max_n0, - uci_stats->pucch0_n00, - uci_stats->pucch0_n01, - uci_stats->pucch0_thres, + pucch0_n00, + pucch0_n01, + gNB->pucch0_thres, cqi, SNRtimes10); if (pucch_pdu->sr_flag == 1) { From 8d87f0c4e2edb38c0bc0f5e447becf124c71ea20 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 27 Feb 2024 18:54:36 +0100 Subject: [PATCH 06/13] get_phy_stats(): full list is non-fatal Do not assert if the list of phy statistics is full; instead return NULL. In most places, this is handled appropriately (we do not store anything if we can't). In nr_decode_pucch0(), the return value of get_phy_stats() is used a little bit all over the function, and a constant if (uci_stats) uci_stats->variable++; would look ugly, so make uci_stats point to the stack if we cannot store in the phy_stats. --- openair1/PHY/INIT/nr_init.c | 5 ++++- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 11 ++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index c864a0366a..1f918086b2 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -79,8 +79,11 @@ NR_gNB_PHY_STATS_t *get_phy_stats(PHY_VARS_gNB *gNB, uint16_t rnti) else if (!stats->active && first_free == -1) first_free = i; } + + if (first_free < 0) + return NULL; + // new stats - AssertFatal(first_free >= 0, "PHY statistics list is full\n"); stats = &gNB->phy_stats[first_free]; stats->active = true; stats->rnti = rnti; diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 4ef42119bf..8a44e410f9 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -162,10 +162,15 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, pucch_pdu->bit_len_harq, pucch_pdu->sr_flag); + /* it might be that the stats list is full: In this case, we will simply + * write to some memory on the stack instead of the UE's UCI stats */ + NR_gNB_UCI_STATS_t stack_uci_stats = {0}; + NR_gNB_UCI_STATS_t *uci_stats = &stack_uci_stats; NR_gNB_PHY_STATS_t *phy_stats = get_phy_stats(gNB, pucch_pdu->rnti); - AssertFatal(phy_stats != NULL, "phy_stats shouldn't be NULL\n"); - phy_stats->frame = frame; - NR_gNB_UCI_STATS_t *uci_stats = &phy_stats->uci_stats; + if (phy_stats != NULL) { + phy_stats->frame = frame; + uci_stats = &phy_stats->uci_stats; + } int nr_sequences; const uint8_t *mcs; From 09a75009cecfc30b476f7968d2e6c8c133a49e07 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 27 Feb 2024 19:25:51 +0100 Subject: [PATCH 07/13] nr_fill_ulsch(): gracefully handle case of no ulsch found --- openair1/PHY/NR_TRANSPORT/nr_ulsch.c | 7 +++++-- openair1/PHY/NR_TRANSPORT/nr_ulsch.h | 2 -- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch.c index 7e7562ff22..bc3046c578 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch.c @@ -34,7 +34,7 @@ #include "PHY/NR_TRANSPORT/nr_transport_common_proto.h" #include "PHY/NR_TRANSPORT/nr_ulsch.h" -NR_gNB_ULSCH_t *find_nr_ulsch(PHY_VARS_gNB *gNB, uint16_t rnti, int pid) +static NR_gNB_ULSCH_t *find_nr_ulsch(PHY_VARS_gNB *gNB, uint16_t rnti, int pid) { int16_t first_free_index = -1; AssertFatal(gNB != NULL, "gNB is null\n"); @@ -62,7 +62,10 @@ void nr_fill_ulsch(PHY_VARS_gNB *gNB, int frame, int slot, nfapi_nr_pusch_pdu_t { int harq_pid = ulsch_pdu->pusch_data.harq_process_id; NR_gNB_ULSCH_t *ulsch = find_nr_ulsch(gNB, ulsch_pdu->rnti, harq_pid); - AssertFatal(ulsch, "No ulsch_id found for rnti %04x\n", ulsch_pdu->rnti); + if (ulsch == NULL) { + LOG_E(NR_PHY, "No ulsch_id found for rnti %04x\n", ulsch_pdu->rnti); + return; + } ulsch->rnti = ulsch_pdu->rnti; ulsch->harq_pid = harq_pid; diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch.h b/openair1/PHY/NR_TRANSPORT/nr_ulsch.h index 76fbb5da7f..817fe90931 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch.h +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch.h @@ -73,8 +73,6 @@ void nr_ulsch_unscrambling(int16_t* llr, uint32_t size, uint32_t Nid, uint32_t n void nr_ulsch_layer_demapping(int16_t *llr_cw, uint8_t Nl, uint8_t mod_order, uint32_t length, int16_t **llr_layers); -NR_gNB_ULSCH_t *find_nr_ulsch(PHY_VARS_gNB *gNB, uint16_t rnti, int pid); - void dump_pusch_stats(FILE *fd,PHY_VARS_gNB *gNB); void dump_nr_I0_stats(FILE *fd,PHY_VARS_gNB *gNB); From c1895918270696b42de00611883b986cdd2cd01f Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 29 Feb 2024 10:20:38 +0100 Subject: [PATCH 08/13] Add header guards inr nr_ulsch.h to avoid circular dependencies --- openair1/PHY/NR_TRANSPORT/nr_ulsch.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch.h b/openair1/PHY/NR_TRANSPORT/nr_ulsch.h index 817fe90931..fa7d085ed0 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch.h +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch.h @@ -30,6 +30,9 @@ * \warning */ +#ifndef NR_ULSCH_H_ +#define NR_ULSCH_H_ + #include "PHY/defs_gNB.h" #include "common/utils/threadPool/thread-pool.h" @@ -78,3 +81,5 @@ void dump_pusch_stats(FILE *fd,PHY_VARS_gNB *gNB); void dump_nr_I0_stats(FILE *fd,PHY_VARS_gNB *gNB); NR_gNB_SCH_STATS_t *get_ulsch_stats(PHY_VARS_gNB *gNB,NR_gNB_ULSCH_t *ulsch); + +#endif /* NR_ULSCH_H_ */ From e80d8a01f3b358cc1dd4e7bc7cdb9c4fb11e43ca Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 29 Feb 2024 15:36:31 +0100 Subject: [PATCH 09/13] delete dead code --- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 70 ----------------------- 1 file changed, 70 deletions(-) diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index cfbd8d9c12..4005c7d581 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -471,76 +471,6 @@ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id, else if (SNRtimes10 > 635) cqi=255; else cqi=(640+SNRtimes10)/5; - - if (0/*pusch_pdu->mcs_index == 9*/) { - __attribute__((unused)) - int off = ((pusch_pdu->rb_size&1) == 1)? 4:0; - - LOG_M("rxsigF0.m", - "rxsF0", - &gNB->common_vars - .rxdataF[0][(slot_rx % RU_RX_SLOT_DEPTH) * gNB->frame_parms.ofdm_symbol_size * gNB->frame_parms.symbols_per_slot], - gNB->frame_parms.ofdm_symbol_size * gNB->frame_parms.symbols_per_slot, - 1, - 1); - LOG_M("chestF0.m", - "chF0", - &gNB->pusch_vars[0].ul_ch_estimates[0][pusch_pdu->start_symbol_index * gNB->frame_parms.ofdm_symbol_size], - gNB->frame_parms.ofdm_symbol_size, - 1, - 1); - LOG_M("chestF0_ext.m", - "chF0_ext", - &gNB->pusch_vars[0] - .ul_ch_estimates_ext[0][(pusch_pdu->start_symbol_index + 1) * (off + (NR_NB_SC_PER_RB * pusch_pdu->rb_size))], - (pusch_pdu->nr_of_symbols - 1) * (off + (NR_NB_SC_PER_RB * pusch_pdu->rb_size)), - 1, - 1); - LOG_M("rxsigF0_comp.m", - "rxsF0_comp", - &gNB->pusch_vars[0].rxdataF_comp[0][pusch_pdu->start_symbol_index * (off + (NR_NB_SC_PER_RB * pusch_pdu->rb_size))], - pusch_pdu->nr_of_symbols * (off + (NR_NB_SC_PER_RB * pusch_pdu->rb_size)), - 1, - 1); - LOG_M("rxsigF0_llr.m", - "rxsF0_llr", - &gNB->pusch_vars[0].llr[0], - (pusch_pdu->nr_of_symbols - 1) * NR_NB_SC_PER_RB * pusch_pdu->rb_size * pusch_pdu->qam_mod_order, - 1, - 0); - if (gNB->frame_parms.nb_antennas_rx > 1) { - LOG_M( - "rxsigF1.m", - "rxsF1", - &gNB->common_vars - .rxdataF[1][(slot_rx % RU_RX_SLOT_DEPTH) * gNB->frame_parms.ofdm_symbol_size * gNB->frame_parms.symbols_per_slot], - gNB->frame_parms.ofdm_symbol_size * gNB->frame_parms.symbols_per_slot, - 1, - 1); - LOG_M("chestF1.m", - "chF1", - &gNB->pusch_vars[0].ul_ch_estimates[1][pusch_pdu->start_symbol_index * gNB->frame_parms.ofdm_symbol_size], - gNB->frame_parms.ofdm_symbol_size, - 1, - 1); - LOG_M("chestF1_ext.m", - "chF1_ext", - &gNB->pusch_vars[0] - .ul_ch_estimates_ext[1][(pusch_pdu->start_symbol_index + 1) * (off + (NR_NB_SC_PER_RB * pusch_pdu->rb_size))], - (pusch_pdu->nr_of_symbols - 1) * (off + (NR_NB_SC_PER_RB * pusch_pdu->rb_size)), - 1, - 1); - LOG_M("rxsigF1_comp.m", - "rxsF1_comp", - &gNB->pusch_vars[0].rxdataF_comp[1][pusch_pdu->start_symbol_index * (off + (NR_NB_SC_PER_RB * pusch_pdu->rb_size))], - pusch_pdu->nr_of_symbols * (off + (NR_NB_SC_PER_RB * pusch_pdu->rb_size)), - 1, - 1); - } - exit(-1); - - } - // crc indication uint16_t num_crc = gNB->UL_INFO.crc_ind.number_crcs; gNB->UL_INFO.crc_ind.crc_list = &gNB->crc_pdu_list[0]; From 012894592202f43c25b41fec3de2f006eed7139b Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 29 Feb 2024 16:51:31 +0100 Subject: [PATCH 10/13] nr_fill_indication(): protect with mutex nr_fill_indication() fills CRC and RX requests, to be sent from L1 to L2. Before this commit, nr_fill_indication() is called when - we finally decoded LDPC (or not) - low signal on PUSCH This might happen at the same time, i.e., nr_fill_indication() might try to fill both CRC and RX, in the same list, from different threads. This can lead to this assertion: Assertion (crc->rnti == rx->rnti) failed! In handle_nr_ulsch() ../../../openair2/NR_PHY_INTERFACE/NR_IF_Module.c:190 mis-match between CRC RNTI e071 and RX RNTI 5e3b e.g., e071 is low energy, and while 5e3b related message are filled in one thread, e071 is being put into the message structure as well. At least that is my understanding. I could not actually reproduce this assertion; to be seen if it still happens. --- openair1/PHY/INIT/nr_init.c | 4 ++++ openair1/SCHED_NR/phy_procedures_nr_gNB.c | 12 +++++++++++- openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 9 +++++++-- openair2/NR_PHY_INTERFACE/NR_IF_Module.h | 8 +++++--- 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 1f918086b2..864420f56e 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -135,6 +135,8 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB) load_LDPClib(NULL, &ldpc_interface); + pthread_mutex_init(&gNB->UL_INFO.crc_rx_mutex, NULL); + if (gNB->ldpc_offload_flag) load_LDPClib("_t2", &ldpc_interface_offload); gNB->max_nb_pdsch = MAX_MOBILES_PER_GNB; @@ -331,6 +333,8 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB) const int max_ul_mimo_layers = 4; // taken from phy_init_nr_gNB() const int n_buf = Prx * max_ul_mimo_layers; + pthread_mutex_destroy(&gNB->UL_INFO.crc_rx_mutex); + PHY_MEASUREMENTS_gNB *meas = &gNB->measurements; free_and_zero(meas->n0_subband_power); free_and_zero(meas->n0_subband_power_dB); diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 4005c7d581..4289c98a57 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -471,6 +471,14 @@ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id, else if (SNRtimes10 > 635) cqi=255; else cqi=(640+SNRtimes10)/5; + // multiple threads might call this function at the same time, or while the + // L2 reads the messages. Hence, if not protected, crc and rx indications + // might not appear pairwise (in the same order) in the same slot, or even in + // separate slots. The L2 does not support this; hence, use the crc_rx_mutex + // to ensure that messages are pairwise. + int rc = pthread_mutex_lock(&gNB->UL_INFO.crc_rx_mutex); + DevAssert(rc == 0); + // crc indication uint16_t num_crc = gNB->UL_INFO.crc_ind.number_crcs; gNB->UL_INFO.crc_ind.crc_list = &gNB->crc_pdu_list[0]; @@ -507,8 +515,10 @@ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id, gNB->rx_pdu_list[num_rx].pdu_length = harq_process->TBS; gNB->rx_pdu_list[num_rx].pdu = harq_process->b; } - gNB->UL_INFO.rx_ind.number_of_pdus++; + + rc = pthread_mutex_unlock(&gNB->UL_INFO.crc_rx_mutex); + DevAssert(rc == 0); } // Function to fill UL RB mask to be used for N0 measurements diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index 37bedddf46..8494a56492 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -177,6 +177,9 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) } if (UL_info->rx_ind.number_of_pdus > 0 && UL_info->crc_ind.number_crcs > 0) { + // see nr_fill_indication about why this mutex is necessary + int rc = pthread_mutex_lock(&UL_info->crc_rx_mutex); + DevAssert(rc == 0); AssertFatal(UL_info->rx_ind.number_of_pdus == UL_info->crc_ind.number_crcs, "number_of_pdus %d, number_crcs %d\n", UL_info->rx_ind.number_of_pdus, UL_info->crc_ind.number_crcs); @@ -210,9 +213,11 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) rx->rssi); handle_nr_ul_harq(UL_info->CC_id, UL_info->module_id, UL_info->frame, UL_info->slot, crc); } + UL_info->rx_ind.number_of_pdus = 0; + UL_info->crc_ind.number_crcs = 0; + rc = pthread_mutex_unlock(&UL_info->crc_rx_mutex); + DevAssert(rc == 0); } - UL_info->rx_ind.number_of_pdus = 0; - UL_info->crc_ind.number_crcs = 0; } void handle_nr_srs(NR_UL_IND_t *UL_info) { diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.h b/openair2/NR_PHY_INTERFACE/NR_IF_Module.h index 108e0afe7a..ba230e4f63 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.h +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.h @@ -64,6 +64,11 @@ typedef struct { /// crc indication list nfapi_nr_crc_indication_t crc_ind; + /// RX indication + nfapi_nr_rx_data_indication_t rx_ind; + /// mutex to protect concurrent access to crc_ind and rx_ind, which the L2 + /// needs to be pairwise + pthread_mutex_t crc_rx_mutex; /// RACH indication list nfapi_nr_rach_indication_t rach_ind; @@ -71,9 +76,6 @@ typedef struct { /// SRS indication list nfapi_nr_srs_indication_t srs_ind; - /// RX indication - nfapi_nr_rx_data_indication_t rx_ind; - /// UCI indication nfapi_nr_uci_indication_t uci_ind; From 4245dd9be9ffe0d5f058385dfcc9c20f9b4c92ea Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Thu, 7 Mar 2024 09:43:22 +0100 Subject: [PATCH 11/13] Remove useless declarations --- openair1/PHY/phy_vars.h | 2 -- openair2/RRC/NR/nr_rrc_extern.h | 16 ---------------- 2 files changed, 18 deletions(-) diff --git a/openair1/PHY/phy_vars.h b/openair1/PHY/phy_vars.h index 89063c5be2..85d2d2a59f 100644 --- a/openair1/PHY/phy_vars.h +++ b/openair1/PHY/phy_vars.h @@ -30,8 +30,6 @@ PHY_VARS_UE ***PHY_vars_UE_g; UL_RCC_IND_t UL_RCC_INFO; -NR_UL_IND_t UL_INFO; - unsigned char NB_RU=0; int number_of_cards; uint8_t max_turbo_iterations=4; diff --git a/openair2/RRC/NR/nr_rrc_extern.h b/openair2/RRC/NR/nr_rrc_extern.h index 0752941dbc..66483214a7 100644 --- a/openair2/RRC/NR/nr_rrc_extern.h +++ b/openair2/RRC/NR/nr_rrc_extern.h @@ -34,21 +34,5 @@ #include "COMMON/mac_rrc_primitives.h" #include "LAYER2/RLC/rlc.h" #include "openair2/RRC/common.h" - void openair_rrc_gNB_configuration(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration); - -extern UE_RRC_INST *UE_rrc_inst; - -extern uint8_t DRB2LCHAN[8]; - -extern int NB_UE_INST; -extern void* bigphys_malloc(int); - - -//uint8_t RACH_TIME_ALLOC; -extern uint16_t RACH_FREQ_ALLOC; -// uint8_t NB_RACH; -extern MAC_MEAS_T BCCH_MEAS_TRIGGER,CCCH_MEAS_TRIGGER,DCCH_MEAS_TRIGGER,DTCH_MEAS_TRIGGER; -extern MAC_AVG_T BCCH_MEAS_AVG,CCCH_MEAS_AVG,DCCH_MEAS_AVG, DTCH_MEAS_AVG; - #endif From 6259b62a18ad96b5a720948218b186056984129f Mon Sep 17 00:00:00 2001 From: Jaroslava Fiedlerova Date: Thu, 18 Jan 2024 16:42:51 +0100 Subject: [PATCH 12/13] CI AW2S Multi-UE: attach/detach 15 UEs, ping from 15 UEs --- ci-scripts/ci_ueinfra.yaml | 36 ++++++++++++++++ .../xml_files/container_sa_aw2s_asue.xml | 43 +++++++++++++++++-- 2 files changed, 75 insertions(+), 4 deletions(-) diff --git a/ci-scripts/ci_ueinfra.yaml b/ci-scripts/ci_ueinfra.yaml index deef3718ec..0618aeadea 100644 --- a/ci-scripts/ci_ueinfra.yaml +++ b/ci-scripts/ci_ueinfra.yaml @@ -119,6 +119,42 @@ amarisoft_ue_10: NetworkScript: ip netns exec ue10 ip a show dev pdn0 CmdPrefix: ip netns exec ue10 MTU: 1500 +amarisoft_ue_11: + Host: amariue + AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":11}' + DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":11}' + NetworkScript: ip netns exec ue11 ip a show dev pdn0 + CmdPrefix: ip netns exec ue11 + MTU: 1500 +amarisoft_ue_12: + Host: amariue + AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":12}' + DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":12}' + NetworkScript: ip netns exec ue12 ip a show dev pdn0 + CmdPrefix: ip netns exec ue12 + MTU: 1500 +amarisoft_ue_13: + Host: amariue + AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":13}' + DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":13}' + NetworkScript: ip netns exec ue13 ip a show dev pdn0 + CmdPrefix: ip netns exec ue13 + MTU: 1500 +amarisoft_ue_14: + Host: amariue + AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":14}' + DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":14}' + NetworkScript: ip netns exec ue14 ip a show dev pdn0 + CmdPrefix: ip netns exec ue14 + MTU: 1500 +amarisoft_ue_15: + Host: amariue + AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":15}' + DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":15}' + NetworkScript: ip netns exec ue15 ip a show dev pdn0 + CmdPrefix: ip netns exec ue15 + MTU: 1500 + oai_ue_caracal: Host: caracal diff --git a/ci-scripts/xml_files/container_sa_aw2s_asue.xml b/ci-scripts/xml_files/container_sa_aw2s_asue.xml index 4d81b123e6..0dd7ddd15f 100644 --- a/ci-scripts/xml_files/container_sa_aw2s_asue.xml +++ b/ci-scripts/xml_files/container_sa_aw2s_asue.xml @@ -40,6 +40,11 @@ 002008 002009 002010 + 002011 + 002012 + 002013 + 002014 + 002015 000100 000010 000020 @@ -132,12 +137,42 @@ amarisoft_ue_10 + + Attach_UE + Attach UE + amarisoft_ue_11 + + + + Attach_UE + Attach UE + amarisoft_ue_12 + + + + Attach_UE + Attach UE + amarisoft_ue_13 + + + + Attach_UE + Attach UE + amarisoft_ue_14 + + + + Attach_UE + Attach UE + amarisoft_ue_15 + + Iperf iperf (DL/7Mbps/UDP)(30 sec)(multi-ue profile) -u -b 70M -t 30 -i 1 -R IPERF3 - amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 + amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 amarisoft_ue_11 amarisoft_ue_12 amarisoft_ue_13 amarisoft_ue_14 amarisoft_ue_15 25 80 balanced @@ -148,7 +183,7 @@ iperf (UL/3.6Mbps/UDP)(30 sec)(multi-ue profile) -u -b 36M -t 30 -i 1 IPERF3 - amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 + amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 amarisoft_ue_11 amarisoft_ue_12 amarisoft_ue_13 amarisoft_ue_14 amarisoft_ue_15 25 80 balanced @@ -157,7 +192,7 @@ Ping Ping: 20pings in 20sec, multi-ue - amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 + amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 amarisoft_ue_11 amarisoft_ue_12 amarisoft_ue_13 amarisoft_ue_14 amarisoft_ue_15 -c 20 %cn_ip% 1 25 @@ -175,7 +210,7 @@ Detach_UE Detach UE - amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 + amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 amarisoft_ue_11 amarisoft_ue_12 amarisoft_ue_13 amarisoft_ue_14 amarisoft_ue_15 From 066aa3379981bf29cffedfe1ff0781f92bd899e1 Mon Sep 17 00:00:00 2001 From: Jaroslava Fiedlerova Date: Fri, 1 Mar 2024 14:38:37 +0100 Subject: [PATCH 13/13] Add 16th UE to AW2S pipeline - connection and ping test --- ci-scripts/ci_ueinfra.yaml | 8 +++++++- ci-scripts/xml_files/container_sa_aw2s_asue.xml | 15 +++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/ci-scripts/ci_ueinfra.yaml b/ci-scripts/ci_ueinfra.yaml index 0618aeadea..2636c7413a 100644 --- a/ci-scripts/ci_ueinfra.yaml +++ b/ci-scripts/ci_ueinfra.yaml @@ -154,7 +154,13 @@ amarisoft_ue_15: NetworkScript: ip netns exec ue15 ip a show dev pdn0 CmdPrefix: ip netns exec ue15 MTU: 1500 - +amarisoft_ue_16: + Host: amariue + AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":16}' + DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":16}' + NetworkScript: ip netns exec ue16 ip a show dev pdn0 + CmdPrefix: ip netns exec ue16 + MTU: 1500 oai_ue_caracal: Host: caracal diff --git a/ci-scripts/xml_files/container_sa_aw2s_asue.xml b/ci-scripts/xml_files/container_sa_aw2s_asue.xml index 0dd7ddd15f..10170885f0 100644 --- a/ci-scripts/xml_files/container_sa_aw2s_asue.xml +++ b/ci-scripts/xml_files/container_sa_aw2s_asue.xml @@ -48,6 +48,7 @@ 000100 000010 000020 + 002016 000200 003000 004000 @@ -198,11 +199,17 @@ 25 + + Attach_UE + Attach UE + amarisoft_ue_16 + + Ping - Ping: 100pings in 20sec, multi-ue - amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 - -c 100 -i 0.2 %cn_ip% + Ping: 50pings in 10sec, multi-ue + amarisoft_ue_16 + -c 50 -i 0.2 %cn_ip% 1 30 @@ -210,7 +217,7 @@ Detach_UE Detach UE - amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 amarisoft_ue_11 amarisoft_ue_12 amarisoft_ue_13 amarisoft_ue_14 amarisoft_ue_15 + amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 amarisoft_ue_11 amarisoft_ue_12 amarisoft_ue_13 amarisoft_ue_14 amarisoft_ue_15 amarisoft_ue_16