From a6d9d8a2d181dc3755c132fff6b9e2999231ba36 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 19 Oct 2021 16:56:25 +0200 Subject: [PATCH 001/107] ue capabilities xml file in SA conf files --- .../PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml | 1375 +++++++++++++++++ 1 file changed, 1375 insertions(+) create mode 100644 targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml b/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml new file mode 100644 index 0000000000..00d74af54b --- /dev/null +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml @@ -0,0 +1,1375 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 11 + + + + + + + 01 + + + + + + + + + + + + + + + + + 8 + 64 + + + + 4 + 32 + + + 2 + 2 + 0 + 2 + 2 + + + + 0 + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 78 + + + + + + + + + + + + + + + + + + + + + + 2 + 8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 8 + 64 + + + + + + 8 + 32 + + + + + + 4 + 64 + + + + + + 2 + 64 + + + + + + 4 + + + + + 8 + 64 + + + + 4 + 32 + + + 2 + 2 + 0 + 2 + 2 + + + + 0 + 4 + + + 2 + 1 + 8 + 16 + + + + + + + + + + + + + + 0000000000 + 0001011111 + 0000000000 + + + + + 0000000000 + 0001011111 + 0000000000 + + + + + + + + 1000000000000000 + + + + + 1000000000000000 + + + + + + + + + 78 + + + + + + + + + 0 + + + + + + + + 78 + + + + + + + + + + + + + + + + 8 + 64 + + 8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + 2 + + + + + + + + 3 + + + + + + + + 4 + + + + + + + + 5 + + + + + + + + 6 + + + + + + + + 7 + + + + + + + + 8 + + + + + + + + 9 + + + + + + + + 10 + + + + + + + + 11 + + + + + + + + 12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 2 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 3 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 4 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 5 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 6 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 7 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 8 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 9 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 10 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 11 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 12 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 11 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2 + 2 + + + + + + + + + 7 + 38 + + + + + + + + + + + + + + + + + + + + + From 3556423cf083597dc15df3239983700fc26bfc3d Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 26 Oct 2021 13:55:29 +0200 Subject: [PATCH 002/107] read uecap file in nr_rrc_ue_process_ueCapabilityEnquiry --- openair2/RRC/NR_UE/rrc_UE.c | 34 +- .../PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml | 2731 ++++++++--------- 2 files changed, 1383 insertions(+), 1382 deletions(-) diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index 7c664d292d..99f60a1660 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -2597,14 +2597,22 @@ nr_rrc_ue_process_ueCapabilityEnquiry( //----------------------------------------------------------------------------- { asn_enc_rval_t enc_rval; + asn_dec_rval_t dec_rval; NR_UL_DCCH_Message_t ul_dcch_msg; NR_UE_CapabilityRAT_Container_t ue_CapabilityRAT_Container; + char UE_NR_Capability_xer_fname[1024]; + char UE_NR_Capability_xer[8192]; + size_t size; uint8_t buffer[200]; int i; LOG_I(NR_RRC,"[UE %d] Frame %d: Receiving from SRB1 (DL-DCCH), Processing UECapabilityEnquiry (gNB %d)\n", ctxt_pP->module_id, ctxt_pP->frame, gNB_index); + + sprintf(UE_NR_Capability_xer_fname,"%stargets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml",getenv("OPENAIR_HOME")); + FILE *f = fopen(UE_NR_Capability_xer_fname, "r"); + memset((void *)&ul_dcch_msg,0,sizeof(NR_UL_DCCH_Message_t)); memset((void *)&ue_CapabilityRAT_Container,0,sizeof(NR_UE_CapabilityRAT_Container_t)); ul_dcch_msg.message.present = NR_UL_DCCH_MessageType_PR_c1; @@ -2613,14 +2621,26 @@ nr_rrc_ue_process_ueCapabilityEnquiry( ul_dcch_msg.message.choice.c1->choice.ueCapabilityInformation = CALLOC(1, sizeof(struct NR_UECapabilityInformation)); ul_dcch_msg.message.choice.c1->choice.ueCapabilityInformation->rrc_TransactionIdentifier = UECapabilityEnquiry->rrc_TransactionIdentifier; ue_CapabilityRAT_Container.rat_Type = NR_RAT_Type_nr; - NR_UE_NR_Capability_t* UE_Capability_nr; + NR_UE_NR_Capability_t* UE_Capability_nr; UE_Capability_nr = CALLOC(1,sizeof(NR_UE_NR_Capability_t)); - NR_BandNR_t *nr_bandnr; - nr_bandnr = CALLOC(1,sizeof(NR_BandNR_t)); - nr_bandnr->bandNR = 1; - ASN_SEQUENCE_ADD( - &UE_Capability_nr->rf_Parameters.supportedBandListNR.list, - nr_bandnr); + + if(f){ + size = fread(UE_NR_Capability_xer, 1, sizeof UE_NR_Capability_xer, f); + if (size == 0 || size == sizeof UE_NR_Capability_xer) { + LOG_E(NR_RRC,"UE Capabilities XER file %s is too large\n", UE_NR_Capability_xer_fname); + free(UE_Capability_nr); + return; + } + dec_rval = xer_decode(0, &asn_DEF_NR_UE_NR_Capability, (void *)UE_Capability_nr, UE_NR_Capability_xer, size); + assert(dec_rval.code == RC_OK); + } + else { + NR_BandNR_t *nr_bandnr; + nr_bandnr = CALLOC(1,sizeof(NR_BandNR_t)); + nr_bandnr->bandNR = 1; + ASN_SEQUENCE_ADD(&UE_Capability_nr->rf_Parameters.supportedBandListNR.list, + nr_bandnr); + } OAI_NR_UECapability_t *UECap; UECap = CALLOC(1,sizeof(OAI_NR_UECapability_t)); UECap->UE_NR_Capability = UE_Capability_nr; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml b/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml index 00d74af54b..994b64e4ae 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml @@ -1,1375 +1,1356 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 11 - - - - - - - 01 - - - - - - - - - - - - - - - - - 8 - 64 - - - - 4 - 32 - - - 2 - 2 - 0 - 2 - 2 - - - - 0 - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 78 - - - - - - - - - - - - - - - - - - - - - - 2 - 8 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 8 - 64 - - - - - - 8 - 32 - - - - - - 4 - 64 - - - - - - 2 - 64 - - - - - - 4 - - - - - 8 - 64 - - - - 4 - 32 - - - 2 - 2 - 0 - 2 - 2 - - - - 0 - 4 - - - 2 - 1 - 8 - 16 - - - - - - - - - - - - - - 0000000000 - 0001011111 - 0000000000 - - - - - 0000000000 - 0001011111 - 0000000000 - - - - - - - - 1000000000000000 - - - - - 1000000000000000 - - - - - - - - - 78 - - - - - - - - - 0 - - - - - - - - 78 - - - - - - - - - - - - - - - - 8 - 64 - - 8 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - 2 - - - - - - - - 3 - - - - - - - - 4 - - - - - - - - 5 - - - - - - - - 6 - - - - - - - - 7 - - - - - - - - 8 - - - - - - - - 9 - - - - - - - - 10 - - - - - - - - 11 - - - - - - - - 12 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 2 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 3 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 4 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 5 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 6 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 7 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 8 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 9 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 10 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 11 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 12 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 11 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2 - 2 - - - - - - - - - 7 - 38 - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 11 + + + + + + + 01 + + + + + + + + + + + + + + + + + 8 + 64 + + + + 4 + 32 + + + 2 + 2 + 0 + 2 + 2 + + + + 0 + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 78 + + + + + + + + + + + + + + + + + + + + + + 2 + 8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 8 + 64 + + + + + + 8 + 32 + + + + + + 4 + 64 + + + + + + 2 + 64 + + + + + + 4 + + + + + 8 + 64 + + + + 4 + 32 + + + 2 + 2 + 0 + 2 + 2 + + + + 0 + 4 + + + 2 + 1 + 8 + 16 + + + + + + + + + + + + + + 0000000000 + 0001011111 + 0000000000 + + + + + 0000000000 + 0001011111 + 0000000000 + + + + + + + + 1000000000000000 + + + + + 1000000000000000 + + + + + + + + + 78 + + + + + + + + + 0 + + + + + + + + 78 + + + + + + + + + + + + + + + + 8 + 64 + + 8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + 2 + + + + + + + + 3 + + + + + + + + 4 + + + + + + + + 5 + + + + + + + + 6 + + + + + + + + 7 + + + + + + + + 8 + + + + + + + + 9 + + + + + + + + 10 + + + + + + + + 11 + + + + + + + + 12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 2 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 3 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 4 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 5 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 6 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 7 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 8 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 9 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 10 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 11 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 12 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + 11 + + + + + + 6 + + + + 6 + + + + 2 + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2 + 2 + + + + + + + + + 7 + 38 + + + + + + + + + + + + + From 35c4623bf2a68050ff3b22f74a16f6fabc8217ca Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 27 Oct 2021 12:16:03 +0200 Subject: [PATCH 003/107] fixes in uecap function --- openair2/RRC/NR_UE/rrc_UE.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index 99f60a1660..1e2f10aaaa 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -2601,7 +2601,7 @@ nr_rrc_ue_process_ueCapabilityEnquiry( NR_UL_DCCH_Message_t ul_dcch_msg; NR_UE_CapabilityRAT_Container_t ue_CapabilityRAT_Container; char UE_NR_Capability_xer_fname[1024]; - char UE_NR_Capability_xer[8192]; + char UE_NR_Capability_xer[65536]; size_t size; uint8_t buffer[200]; int i; @@ -2610,7 +2610,7 @@ nr_rrc_ue_process_ueCapabilityEnquiry( ctxt_pP->frame, gNB_index); - sprintf(UE_NR_Capability_xer_fname,"%stargets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml",getenv("OPENAIR_HOME")); + sprintf(UE_NR_Capability_xer_fname,"../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml"); FILE *f = fopen(UE_NR_Capability_xer_fname, "r"); memset((void *)&ul_dcch_msg,0,sizeof(NR_UL_DCCH_Message_t)); @@ -2627,7 +2627,7 @@ nr_rrc_ue_process_ueCapabilityEnquiry( if(f){ size = fread(UE_NR_Capability_xer, 1, sizeof UE_NR_Capability_xer, f); if (size == 0 || size == sizeof UE_NR_Capability_xer) { - LOG_E(NR_RRC,"UE Capabilities XER file %s is too large\n", UE_NR_Capability_xer_fname); + LOG_E(NR_RRC,"UE Capabilities XER file %s is too large (%ld)\n", UE_NR_Capability_xer_fname,size); free(UE_Capability_nr); return; } @@ -2644,9 +2644,7 @@ nr_rrc_ue_process_ueCapabilityEnquiry( OAI_NR_UECapability_t *UECap; UECap = CALLOC(1,sizeof(OAI_NR_UECapability_t)); UECap->UE_NR_Capability = UE_Capability_nr; - if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) { - xer_fprint(stdout,&asn_DEF_NR_UE_NR_Capability,(void *)UE_Capability_nr); - } + xer_fprint(stdout,&asn_DEF_NR_UE_NR_Capability,(void *)UE_Capability_nr); enc_rval = uper_encode_to_buffer(&asn_DEF_NR_UE_NR_Capability, NULL, From c830f78f8a9e5d0f17c5c66aabfb1533af42b5a2 Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 12 Nov 2021 16:42:03 +0100 Subject: [PATCH 004/107] UE capabilities directly from file for phy-test and do-ra --- openair2/RRC/NR/rrc_gNB_nsa.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 52f451d7bb..2d858f6d02 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -144,6 +144,27 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ unsigned char *kUPenc = NULL; unsigned char *kUPint = NULL; int i; + + // In case of phy-test and do-ra mode, read UE capabilities directly from file + if (get_softmodem_params()->phy_test == 1 || get_softmodem_params()->do_ra == 1) { + NR_UE_NR_Capability_t* UE_Capability_nr = NULL; + char UE_NR_Capability_xer_fname[1024]; + char UE_NR_Capability_xer[65536]; + sprintf(UE_NR_Capability_xer_fname,"../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml"); + FILE *f = fopen(UE_NR_Capability_xer_fname, "r"); + if(f){ + size_t size = fread(UE_NR_Capability_xer, 1, sizeof UE_NR_Capability_xer, f); + if (size == 0 || size == sizeof UE_NR_Capability_xer) + LOG_E(NR_RRC,"UE Capabilities XER file %s is too large (%ld)\n", UE_NR_Capability_xer_fname,size); + else { + UE_Capability_nr = CALLOC(1,sizeof(NR_UE_NR_Capability_t)); + asn_dec_rval_t dec_rval = xer_decode(0, &asn_DEF_NR_UE_NR_Capability, (void *)UE_Capability_nr, UE_NR_Capability_xer, size); + assert(dec_rval.code == RC_OK); + } + } + ue_context_p->ue_context.UE_Capability_nr = UE_Capability_nr; + } + // NR RRCReconfiguration AssertFatal(rrc->Nb_ue < MAX_NR_RRC_UE_CONTEXTS,"cannot add another UE\n"); ue_context_p->ue_context.reconfig = calloc(1,sizeof(NR_RRCReconfiguration_t)); From 220e568c81a72ec7f78219ca064672513064ed52 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 16 Dec 2021 17:18:20 +0100 Subject: [PATCH 005/107] xml file that works, thanks to Cedric --- .../PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml | 2218 +++++++---------- 1 file changed, 862 insertions(+), 1356 deletions(-) diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml b/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml index 994b64e4ae..baca6649cb 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml @@ -1,1356 +1,862 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 11 - - - - - - - 01 - - - - - - - - - - - - - - - - - 8 - 64 - - - - 4 - 32 - - - 2 - 2 - 0 - 2 - 2 - - - - 0 - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 78 - - - - - - - - - - - - - - - - - - - - - - 2 - 8 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 8 - 64 - - - - - - 8 - 32 - - - - - - 4 - 64 - - - - - - 2 - 64 - - - - - - 4 - - - - - 8 - 64 - - - - 4 - 32 - - - 2 - 2 - 0 - 2 - 2 - - - - 0 - 4 - - - 2 - 1 - 8 - 16 - - - - - - - - - - - - - - 0000000000 - 0001011111 - 0000000000 - - - - - 0000000000 - 0001011111 - 0000000000 - - - - - - - - 1000000000000000 - - - - - 1000000000000000 - - - - - - - - - 78 - - - - - - - - - 0 - - - - - - - - 78 - - - - - - - - - - - - - - - - 8 - 64 - - 8 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - 2 - - - - - - - - 3 - - - - - - - - 4 - - - - - - - - 5 - - - - - - - - 6 - - - - - - - - 7 - - - - - - - - 8 - - - - - - - - 9 - - - - - - - - 10 - - - - - - - - 11 - - - - - - - - 12 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 2 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 3 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 4 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 5 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 6 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 7 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 8 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 9 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 10 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 11 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 12 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - 11 - - - - - - 6 - - - - 6 - - - - 2 - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2 - 2 - - - - - - - - - 7 - 38 - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 11 + + + + + 01 + + + + + + + + + 8 + 64 + + 4 + 32 + + + 2 + 2 + 0 + 2 + 2 + + 0 + 4 + + + + + + + + + + + + + + + + + + + + 78 + + + + + + + + + + 2 + 8 + + + + + + + + + + + + + + + + + + + 8 + 64 + + + + 8 + 32 + + + + 4 + 64 + + + + 2 + 64 + + + + 4 + + + + + 8 + 64 + + 4 + 32 + + + 2 + 2 + 0 + 2 + 2 + + 0 + 4 + + + 2 + 1 + 8 + 16 + + + + + + + + + + 0000000000 + + + 0001011111 + + + 0000000000 + + + + + + + 0000000000 + + + 0001011111 + + + 0000000000 + + + + + + + + + + + 1000000000000000 + + + + + + + 1000000000000000 + + + + + + + + + + + 78 + + + + + 0 + + + + + + 78 + + + + + + + + + + + + + + + 8 + 64 + + 8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + 2 + + + + + + 3 + + + + + + 4 + + + + + + 5 + + + + + + 6 + + + + + + 7 + + + + + + 8 + + + + + + 9 + + + + + + 10 + + + + + + 11 + + + + + + 12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + 6 + + 6 + + 2 + + + + + + 2 + + + + 6 + + 6 + + 2 + + + + + + 3 + + + + 6 + + 6 + + 2 + + + + + + 4 + + + + 6 + + 6 + + 2 + + + + + + 5 + + + + 6 + + 6 + + 2 + + + + + + 6 + + + + 6 + + 6 + + 2 + + + + + + 7 + + + + 6 + + 6 + + 2 + + + + + + 8 + + + + 6 + + 6 + + 2 + + + + + + 9 + + + + 6 + + 6 + + 2 + + + + + + 10 + + + + 6 + + 6 + + 2 + + + + + + 11 + + + + 6 + + 6 + + 2 + + + + + + 12 + + + + 6 + + 6 + + 2 + + + + + + 11 + + + + 6 + + 6 + + 2 + + + + + + + + + + + + + 1 + + + + + + + + + + + + 1 + + + + + + + + + + + 1 + + + + + + + + + + + 1 + + + + + + + + + + + 1 + + + + + + + + + + + 1 + + + + + + + + + + + 1 + + + + + + + + + + + 1 + + + + + + + + + + + 1 + + + + + + + + + + + 1 + + + + + + + + + + + + 1 + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2 + 2 + + + + + + + + + 7 + 38 + + + + + + + + + From 9f87b9dd155596655f2676cacafb6e7f1cef05de Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 17 Dec 2021 12:03:44 +0100 Subject: [PATCH 006/107] bugfix, thanks to Cedric --- openair2/RRC/NR/rrc_gNB_nsa.c | 3 ++- openair2/RRC/NR_UE/rrc_UE.c | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 109d8bb8c3..399754bd00 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -156,8 +156,9 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ LOG_E(NR_RRC,"UE Capabilities XER file %s is too large (%ld)\n", UE_NR_Capability_xer_fname,size); else { UE_Capability_nr = CALLOC(1,sizeof(NR_UE_NR_Capability_t)); - asn_dec_rval_t dec_rval = xer_decode(0, &asn_DEF_NR_UE_NR_Capability, (void *)UE_Capability_nr, UE_NR_Capability_xer, size); + asn_dec_rval_t dec_rval = xer_decode(0, &asn_DEF_NR_UE_NR_Capability, (void *)&UE_Capability_nr, UE_NR_Capability_xer, size); assert(dec_rval.code == RC_OK); + xer_fprint(stdout,&asn_DEF_NR_UE_NR_Capability,(void *)UE_Capability_nr); } } ue_context_p->ue_context.UE_Capability_nr = UE_Capability_nr; diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index fcd66624fd..beaa74fa2f 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -2643,8 +2643,7 @@ nr_rrc_ue_process_ueCapabilityEnquiry( ul_dcch_msg.message.choice.c1->choice.ueCapabilityInformation = CALLOC(1, sizeof(struct NR_UECapabilityInformation)); ul_dcch_msg.message.choice.c1->choice.ueCapabilityInformation->rrc_TransactionIdentifier = UECapabilityEnquiry->rrc_TransactionIdentifier; ue_CapabilityRAT_Container.rat_Type = NR_RAT_Type_nr; - NR_UE_NR_Capability_t* UE_Capability_nr; - UE_Capability_nr = CALLOC(1,sizeof(NR_UE_NR_Capability_t)); + NR_UE_NR_Capability_t* UE_Capability_nr = NULL; if(f){ size = fread(UE_NR_Capability_xer, 1, sizeof UE_NR_Capability_xer, f); @@ -2653,7 +2652,7 @@ nr_rrc_ue_process_ueCapabilityEnquiry( free(UE_Capability_nr); return; } - dec_rval = xer_decode(0, &asn_DEF_NR_UE_NR_Capability, (void *)UE_Capability_nr, UE_NR_Capability_xer, size); + dec_rval = xer_decode(0, &asn_DEF_NR_UE_NR_Capability, (void *)&UE_Capability_nr, UE_NR_Capability_xer, size); assert(dec_rval.code == RC_OK); } else { From fcfcc6050bf79e0fd08f63f92cac201a76ce7592 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 20 Dec 2021 09:13:01 +0100 Subject: [PATCH 007/107] fix in ue capability size --- openair2/RRC/NR_UE/rrc_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/RRC/NR_UE/rrc_defs.h b/openair2/RRC/NR_UE/rrc_defs.h index b79cbb4bae..790da98f1b 100644 --- a/openair2/RRC/NR_UE/rrc_defs.h +++ b/openair2/RRC/NR_UE/rrc_defs.h @@ -70,7 +70,7 @@ typedef enum { nr_RadioBearerConfigX_r15=1 } nsa_message_t; -#define MAX_UE_NR_CAPABILITY_SIZE 255 +#define MAX_UE_NR_CAPABILITY_SIZE 2048 typedef struct OAI_NR_UECapability_s { uint8_t sdu[MAX_UE_NR_CAPABILITY_SIZE]; uint8_t sdu_size; From 90f150a4a8591c83c44b587fee0208337cbca658 Mon Sep 17 00:00:00 2001 From: hardy Date: Tue, 21 Dec 2021 16:12:37 +0100 Subject: [PATCH 008/107] improve iperf pass fail checker --- ci-scripts/cls_oaicitest.py | 16 +++++++++++++--- ci-scripts/main.py | 7 +++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index b8b99a053b..68b71da892 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -129,6 +129,7 @@ class OaiCiTest(): self.ping_rttavg_threshold ='' self.iperf_args = '' self.iperf_packetloss_threshold = '' + self.iperf_bitrate_threshold = '' self.iperf_profile = '' self.iperf_options = '' self.iperf_direction = '' @@ -2085,13 +2086,21 @@ class OaiCiTest(): pl = float(100 * pl_sum / ps_sum) packetloss = '%2.1f ' % (pl) packetloss += '%' + #checking packet loss compliance if float(pl) > float(self.iperf_packetloss_threshold): pal_too_high_msg = 'Packet Loss too high : actual = '+packetloss+', target = '+self.iperf_packetloss_threshold+'%\n' else: - pal_too_high_msg='' + pal_too_high_msg='' + #checking bitrate perf compliance + if float(br_loss) < float(self.iperf_bitrate_threshold): + bit_too_low_msg = 'Bitrate too low : actual = '+bitperf+', target = '+self.iperf_bitrate_threshold+'%\n' + else: + bit_too_low_msg='' lock.acquire() - if (br_loss < 90) or (float(pl) > float(self.iperf_packetloss_threshold)): + if (br_loss < self.iperf_bitrate_threshold) or (float(pl) > float(self.iperf_packetloss_threshold)): statusQueue.put(1) + elif (br_loss < self.iperf_bitrate_threshold) and (float(pl) > float(self.iperf_packetloss_threshold)): + statusQueue.put(-1) else: statusQueue.put(0) statusQueue.put(device_id) @@ -2101,7 +2110,7 @@ class OaiCiTest(): brl_msg = 'Bitrate Perf: ' + bitperf jit_msg = 'Jitter : ' + jitter pal_msg = 'Packet Loss : ' + packetloss - statusQueue.put(req_msg + '\n' + bir_msg + '\n' + brl_msg + '\n' + jit_msg + '\n' + pal_msg + '\n' + pal_too_high_msg + '\n') + statusQueue.put(req_msg + '\n' + bir_msg + '\n' + brl_msg + '\n' + jit_msg + '\n' + pal_msg + '\n' + pal_too_high_msg + '\n' + bit_too_low_msg + '\n') logging.debug('\u001B[1;37;45m iperf result (' + UE_IPAddress + ') \u001B[0m') logging.debug('\u001B[1;35m ' + req_msg + '\u001B[0m') logging.debug('\u001B[1;35m ' + bir_msg + '\u001B[0m') @@ -2109,6 +2118,7 @@ class OaiCiTest(): logging.debug('\u001B[1;35m ' + jit_msg + '\u001B[0m') logging.debug('\u001B[1;35m ' + pal_msg + '\u001B[0m') logging.debug('\u001B[1;35m ' + pal_too_high_msg + '\u001B[0m') + logging.debug('\u001B[1;35m ' + bit_too_low_msg + '\u001B[0m') lock.release() else: self.ping_iperf_wrong_exit(lock, UE_IPAddress, device_id, statusQueue, 'Could not analyze from server log') diff --git a/ci-scripts/main.py b/ci-scripts/main.py index ddf9bb531e..415d3c4d3d 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -310,6 +310,13 @@ def GetParametersFromXML(action): CiTestObj.ue_id = ue_id CiTestObj.iperf_direction = test.findtext('direction')#used for modules only CiTestObj.iperf_packetloss_threshold = test.findtext('iperf_packetloss_threshold') + iperf_bitrate_threshold = test.findtext('iperf_bitrate_threshold') + if (iperf_bitrate_threshold is None): + CiTestObj.iperf_bitrate_threshold = "90" #if no threshold is specified, default will be 90% + else: + CiTestObj.iperf_bitrate_threshold = iperf_bitrate_threshold + + CiTestObj.iperf_profile = test.findtext('iperf_profile') if (CiTestObj.iperf_profile is None): CiTestObj.iperf_profile = 'balanced' From 984338e991adb7d8bdf30917ea35f51bdbce6330 Mon Sep 17 00:00:00 2001 From: hardy Date: Tue, 21 Dec 2021 16:29:04 +0100 Subject: [PATCH 009/107] update 2x2 tests with new iperf pass fail criteria --- ci-scripts/xml_files/container_nsa_b200_quectel.xml | 2 ++ ci-scripts/xml_files/fr1_lte_2x2_quectel.xml | 2 ++ ci-scripts/xml_files/fr1_nsa_quectel.xml | 2 ++ ci-scripts/xml_files/fr1_sa_quectel.xml | 2 ++ ci-scripts/xml_files/fr1_sa_quectel_stages.xml | 5 +++++ 5 files changed, 13 insertions(+) diff --git a/ci-scripts/xml_files/container_nsa_b200_quectel.xml b/ci-scripts/xml_files/container_nsa_b200_quectel.xml index 0af0d9bd70..3cac13dad4 100644 --- a/ci-scripts/xml_files/container_nsa_b200_quectel.xml +++ b/ci-scripts/xml_files/container_nsa_b200_quectel.xml @@ -124,6 +124,7 @@ DL idefix 3 + 95 single-ue @@ -134,6 +135,7 @@ UL idefix 1 + 95 single-ue diff --git a/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml b/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml index ae7a4c92be..4cb6b88a0c 100644 --- a/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml @@ -107,6 +107,7 @@ DL nrmodule2_quectel 5 + 95 single-ue @@ -117,6 +118,7 @@ UL nrmodule2_quectel 5 + 95 single-ue diff --git a/ci-scripts/xml_files/fr1_nsa_quectel.xml b/ci-scripts/xml_files/fr1_nsa_quectel.xml index 6414f09b6b..6e3d208040 100644 --- a/ci-scripts/xml_files/fr1_nsa_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_quectel.xml @@ -119,6 +119,7 @@ DL idefix 3 + 95 single-ue @@ -129,6 +130,7 @@ UL idefix 1 + 95 single-ue diff --git a/ci-scripts/xml_files/fr1_sa_quectel.xml b/ci-scripts/xml_files/fr1_sa_quectel.xml index 4db5bb64a5..4cef4d404b 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel.xml @@ -105,6 +105,7 @@ DL nrmodule2_quectel 5 + 95 single-ue @@ -115,6 +116,7 @@ UL nrmodule2_quectel 5 + 95 single-ue diff --git a/ci-scripts/xml_files/fr1_sa_quectel_stages.xml b/ci-scripts/xml_files/fr1_sa_quectel_stages.xml index a9922bec52..754d201fcf 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel_stages.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel_stages.xml @@ -104,6 +104,7 @@ DL nrmodule2_quectel 5 + 95 single-ue @@ -113,6 +114,7 @@ DL nrmodule2_quectel 5 + 95 single-ue @@ -122,6 +124,7 @@ DL nrmodule2_quectel 5 + 95 single-ue @@ -131,6 +134,7 @@ DL nrmodule2_quectel 5 + 95 single-ue @@ -140,6 +144,7 @@ DL nrmodule2_quectel 5 + 95 single-ue From 478f67e47dcc5613cffebeec53b64879d7ed1c25 Mon Sep 17 00:00:00 2001 From: hardy Date: Thu, 23 Dec 2021 11:58:21 +0100 Subject: [PATCH 010/107] fix type conversion for comparison operation --- ci-scripts/cls_oaicitest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 68b71da892..e0c261df22 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -2097,9 +2097,9 @@ class OaiCiTest(): else: bit_too_low_msg='' lock.acquire() - if (br_loss < self.iperf_bitrate_threshold) or (float(pl) > float(self.iperf_packetloss_threshold)): + if (float(br_loss) < float(self.iperf_bitrate_threshold)) or (float(pl) > float(self.iperf_packetloss_threshold)): statusQueue.put(1) - elif (br_loss < self.iperf_bitrate_threshold) and (float(pl) > float(self.iperf_packetloss_threshold)): + elif (float(br_loss) < float(self.iperf_bitrate_threshold)) and (float(pl) > float(self.iperf_packetloss_threshold)): statusQueue.put(-1) else: statusQueue.put(0) From 25bd60a96a9ca95f6f1cf52d9d2df099549e4eda Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 23 Dec 2021 18:02:30 +0100 Subject: [PATCH 011/107] fixes in case of no uecap file found --- openair2/RRC/NR/rrc_gNB_nsa.c | 2 ++ openair2/RRC/NR_UE/rrc_UE.c | 1 + 2 files changed, 3 insertions(+) diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 399754bd00..4fde0a1a0f 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -161,6 +161,8 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ xer_fprint(stdout,&asn_DEF_NR_UE_NR_Capability,(void *)UE_Capability_nr); } } + else + LOG_E(NR_RRC,"Could not open UE Capabilities input file. Not handling OAI UE Capabilities.\n"); ue_context_p->ue_context.UE_Capability_nr = UE_Capability_nr; } diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index beaa74fa2f..e444b45fff 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -2656,6 +2656,7 @@ nr_rrc_ue_process_ueCapabilityEnquiry( assert(dec_rval.code == RC_OK); } else { + UE_Capability_nr = CALLOC(1,sizeof(NR_UE_NR_Capability_t)); NR_BandNR_t *nr_bandnr; nr_bandnr = CALLOC(1,sizeof(NR_BandNR_t)); nr_bandnr->bandNR = 1; From 0d3ee346bff9bbadba4ded2452286dc79355031b Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 30 Dec 2021 12:17:11 +0100 Subject: [PATCH 012/107] uecap file path from command line at UE --- executables/nr-softmodem-common.h | 3 ++- executables/nr-ue.c | 6 ++++-- executables/nr-uesoftmodem.c | 3 ++- executables/nr-uesoftmodem.h | 7 ++++--- openair2/RRC/NR_UE/main_ue.c | 4 ++-- openair2/RRC/NR_UE/rrc_UE.c | 14 ++++++++++---- openair2/RRC/NR_UE/rrc_defs.h | 2 ++ openair2/RRC/NR_UE/rrc_proto.h | 4 ++-- 8 files changed, 28 insertions(+), 15 deletions(-) diff --git a/executables/nr-softmodem-common.h b/executables/nr-softmodem-common.h index c02155326b..22b616f29e 100644 --- a/executables/nr-softmodem-common.h +++ b/executables/nr-softmodem-common.h @@ -88,7 +88,8 @@ #define CONFIG_HLP_TNOFORK "to ease debugging with gdb\n" #define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n" #define CONFIG_HLP_DISABLETIMECORR "disable UE timing correction\n" -#define CONFIG_HLP_RRC_CFG_PATH "path for RRC configuration\n" +#define CONFIG_HLP_RRC_CFG_PATH "path for RRC configuration\n" +#define CONFIG_HLP_UECAP_PATH "path for UE Capabilities file\n" #define CONFIG_HLP_NUMEROLOGY "adding numerology for 5G\n" #define CONFIG_HLP_EMULATE_RF "Emulated RF enabled(disable by defult)\n" diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 60ff40abeb..ee9c4cd174 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -756,13 +756,15 @@ void *UE_thread(void *arg) { return NULL; } -void init_NR_UE(int nb_inst, char* rrc_config_path) { +void init_NR_UE(int nb_inst, + char* uecap_path, + char* rrc_config_path) { int inst; NR_UE_MAC_INST_t *mac_inst; NR_UE_RRC_INST_t* rrc_inst; for (inst=0; inst < nb_inst; inst++) { - AssertFatal((rrc_inst = nr_l3_init_ue(rrc_config_path)) != NULL, "can not initialize RRC module\n"); + AssertFatal((rrc_inst = nr_l3_init_ue(uecap_path,rrc_config_path)) != NULL, "can not initialize RRC module\n"); AssertFatal((mac_inst = nr_l2_init_ue(rrc_inst)) != NULL, "can not initialize L2 module\n"); AssertFatal((mac_inst->if_module = nr_ue_if_module_init(inst)) != NULL, "can not initialize IF module\n"); } diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index ad5ea982c9..746297e6fb 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -115,6 +115,7 @@ int vcdflag = 0; double rx_gain_off = 0.0; char *usrp_args = NULL; char *rrc_config_path = NULL; +char *uecap_path = NULL; int dumpframe = 0; uint64_t downlink_frequency[MAX_NUM_CCs][4]; @@ -443,7 +444,7 @@ int main( int argc, char **argv ) { #endif LOG_I(HW, "Version: %s\n", PACKAGE_VERSION); - init_NR_UE(1,rrc_config_path); + init_NR_UE(1,uecap_path,rrc_config_path); if(IS_SOFTMODEM_NOS1 || get_softmodem_params()->sa) init_pdcp(); diff --git a/executables/nr-uesoftmodem.h b/executables/nr-uesoftmodem.h index 7f47ed5eb3..0def34dd39 100644 --- a/executables/nr-uesoftmodem.h +++ b/executables/nr-uesoftmodem.h @@ -33,8 +33,9 @@ {"dlsch-parallel", CONFIG_HLP_DLSCH_PARA, 0, iptr:(int32_t *)&nrUE_params.nr_dlsch_parallel, defintval:0, TYPE_UINT8, 0}, \ {"offset-divisor", CONFIG_HLP_OFFSET_DIV, 0, uptr:(uint32_t *)&nrUE_params.ofdm_offset_divisor, defuintval:UINT_MAX, TYPE_UINT32, 0}, \ {"nr-dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&nr_dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \ - {"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&vcdflag, defintval:0, TYPE_INT, 0}, \ - {"rrc_config_path", CONFIG_HLP_RRC_CFG_PATH,0, strptr:(char **)&rrc_config_path, defstrval:"./", TYPE_STRING, 0} \ + {"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&vcdflag, defintval:0, TYPE_INT, 0}, \ + {"uecap_path", CONFIG_HLP_UECAP_PATH, 0, strptr:(char **)&uecap_path, defstrval:"./", TYPE_STRING, 0}, \ + {"rrc_config_path", CONFIG_HLP_RRC_CFG_PATH,0, strptr:(char **)&rrc_config_path, defstrval:"./", TYPE_STRING, 0} \ } @@ -84,7 +85,7 @@ extern nrUE_params_t *get_nrUE_params(void); // In nr-ue.c extern int setup_nr_ue_buffers(PHY_VARS_NR_UE **phy_vars_ue, openair0_config_t *openair0_cfg); extern void fill_ue_band_info(void); -extern void init_NR_UE(int, char*); +extern void init_NR_UE(int, char*, char*); extern void init_NR_UE_threads(int); extern void reset_opp_meas(void); extern void print_opp_meas(void); diff --git a/openair2/RRC/NR_UE/main_ue.c b/openair2/RRC/NR_UE/main_ue.c index 07409c6026..5e2bc429eb 100644 --- a/openair2/RRC/NR_UE/main_ue.c +++ b/openair2/RRC/NR_UE/main_ue.c @@ -34,8 +34,8 @@ #include "rrc_proto.h" #include "common/utils/LOG/log.h" -NR_UE_RRC_INST_t* nr_l3_init_ue(char* rrc_config_path){ +NR_UE_RRC_INST_t* nr_l3_init_ue(char* uecap, char* rrc_config_path){ //LOG_I(RRC, "[MAIN] NR UE MAC initialization...\n"); - return openair_rrc_top_init_ue_nr(rrc_config_path); + return openair_rrc_top_init_ue_nr(uecap,rrc_config_path); } diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index e444b45fff..f2868e9c97 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -410,7 +410,7 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type, } -NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* rrc_config_path){ +NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* uecap_path, char* rrc_config_path){ int nr_ue; if(NB_NR_UE_INST > 0){ NR_UE_rrc_inst = (NR_UE_RRC_INST_t *)malloc(NB_NR_UE_INST * sizeof(NR_UE_RRC_INST_t)); @@ -485,6 +485,8 @@ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* rrc_config_path){ RRC_LIST_INIT(NR_UE_rrc_inst[nr_ue].CSI_ReportConfig_list, NR_maxNrofCSI_ReportConfigurations); } + NR_UE_rrc_inst->uecap_path = uecap_path; + if (get_softmodem_params()->phy_test==1 || get_softmodem_params()->do_ra==1) { // read in files for RRCReconfiguration and RBconfig FILE *fd; @@ -494,7 +496,7 @@ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* rrc_config_path){ else sprintf(filename,"reconfig.raw"); fd = fopen(filename,"r"); - char buffer[1024]; + char buffer[1024]; AssertFatal(fd, "cannot read file %s: errno %d, %s\n", filename, @@ -2632,8 +2634,12 @@ nr_rrc_ue_process_ueCapabilityEnquiry( ctxt_pP->frame, gNB_index); - sprintf(UE_NR_Capability_xer_fname,"../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml"); - FILE *f = fopen(UE_NR_Capability_xer_fname, "r"); + FILE *f = NULL; + char *file_path = NR_UE_rrc_inst[ctxt_pP->module_id].uecap_path; + if (file_path) { + sprintf(UE_NR_Capability_xer_fname,"%s/uecap.xml",file_path); + f = fopen(UE_NR_Capability_xer_fname, "r"); + } memset((void *)&ul_dcch_msg,0,sizeof(NR_UL_DCCH_Message_t)); memset((void *)&ue_CapabilityRAT_Container,0,sizeof(NR_UE_CapabilityRAT_Container_t)); diff --git a/openair2/RRC/NR_UE/rrc_defs.h b/openair2/RRC/NR_UE/rrc_defs.h index 790da98f1b..d623481c81 100644 --- a/openair2/RRC/NR_UE/rrc_defs.h +++ b/openair2/RRC/NR_UE/rrc_defs.h @@ -120,6 +120,8 @@ typedef struct NR_UE_RRC_INST_s { NR_DRB_ToAddMod_t *DRB_config[NB_CNX_UE][8]; rb_id_t *defaultDRB; // remember the ID of the default DRB + char *uecap_path; + NR_SRB_INFO Srb0[NB_SIG_CNX_UE]; NR_SRB_INFO_TABLE_ENTRY Srb1[NB_CNX_UE]; NR_SRB_INFO_TABLE_ENTRY Srb2[NB_CNX_UE]; diff --git a/openair2/RRC/NR_UE/rrc_proto.h b/openair2/RRC/NR_UE/rrc_proto.h index 534da0112b..78237a709c 100644 --- a/openair2/RRC/NR_UE/rrc_proto.h +++ b/openair2/RRC/NR_UE/rrc_proto.h @@ -43,14 +43,14 @@ // main_rrc.c // /**\brief Layer 3 initialization*/ -NR_UE_RRC_INST_t* nr_l3_init_ue(char*); +NR_UE_RRC_INST_t* nr_l3_init_ue(char*,char*); // // UE_rrc.c // /**\brief Initial the top level RRC structure instance*/ -NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char*); +NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char*,char*); From f3874a21ad07b3f63399a903ae7ad5a3bf714616 Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 24 Dec 2021 10:11:42 +0100 Subject: [PATCH 013/107] some tentative fixes in config files --- .../gnb.band78.sa.fr1.106PRB.usrpn310.conf | 659 +++++++++--------- .../gnb.band78.sa.fr1.162PRB.usrpn310.conf | 316 +++++++++ .../gnb.band78.tm1.fr1.106PRB.usrpn310.conf | 1 + 3 files changed, 633 insertions(+), 343 deletions(-) create mode 100644 ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index f00a343089..70892930c9 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -1,343 +1,316 @@ -Active_gNBs = ( "gNB-OAI"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -gNBs = -( - { - ////////// Identification parameters: - gNB_CU_ID = 0xe00; - -# cell_type = "CELL_MACRO_GNB"; - - gNB_name = "gNB-OAI"; - min_rxtxtime_pdsch = 6; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = 1; - - plmn_list = ({ - mcc = 208; - mnc = 97; - mnc_length = 2; - snssaiList = ( - { - sst = 1; - sd = 0x010203; // 0 false, else true - }, - { - sst = 1; - sd = 0x112233; // 0 false, else true - } - ); - }); - - nr_cellid = 12345678L - -# tr_s_preference = "local_mac" - - ////////// Physical parameters: - - ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; - #pusch_TargetSNRx10 = 200; - #pucch_TargetSNRx10 = 200; - ul_prbblacklist = "51,52,53,54" - - pdcch_ConfigSIB1 = ( - { - controlResourceSetZero = 11; - searchSpaceZero = 0; - } - ); - - servingCellConfigCommon = ( - { - #spCellConfigCommon - - physCellId = 0; - -# downlinkConfigCommon - #frequencyInfoDL - # this is 3301.68 MHz + 22*12*30e-3 MHz = 3309.6 - #absoluteFrequencySSB = 620640; - # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68 - absoluteFrequencySSB = 621312; - # this is 3503.28 MHz + 22*12*30e-3 MHz = 3511.2 - #absoluteFrequencySSB = 634080; - # this is 3600.48 MHz - #absoluteFrequencySSB = 640032; - #dl_frequencyBand = 78; - # this is 3301.68 MHz - #dl_absoluteFrequencyPointA = 620112; - # this is 3300.60 MHz - dl_absoluteFrequencyPointA = 620040; - # this is 3502.56 MHz - #dl_absoluteFrequencyPointA = 633552; - # this is 3600.48 MHz - #dl_absoluteFrequencyPointA = 640032; - #scs-SpecificCarrierList - dl_offstToCarrier = 0; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - dl_subcarrierSpacing = 1; - dl_carrierBandwidth = 106; - #initialDownlinkBWP - #genericParameters - # this is RBstart=0,L=106 (275*(L-1))+RBstart - initialDLBWPlocationAndBandwidth = 28875; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - initialDLBWPsubcarrierSpacing = 1; - #pdcch-ConfigCommon - initialDLBWPcontrolResourceSetZero = 11; - initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; - #initialULBWPmappingType - #0=typeA,1=typeB - initialDLBWPmappingType_0 = 0; - #this is SS=1,L=13 - initialDLBWPstartSymbolAndLength_0 = 40; - - initialDLBWPk0_1 = 0; - initialDLBWPmappingType_1 = 0; - #this is SS=1,L=5 - initialDLBWPstartSymbolAndLength_1 = 57; - - #uplinkConfigCommon - #frequencyInfoUL - ul_frequencyBand = 78; - #scs-SpecificCarrierList - ul_offstToCarrier = 0; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - ul_subcarrierSpacing = 1; - ul_carrierBandwidth = 106; - pMax = 20; - #initialUplinkBWP - #genericParameters - initialULBWPlocationAndBandwidth = 28875; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - initialULBWPsubcarrierSpacing = 1; - #rach-ConfigCommon - #rach-ConfigGeneric - prach_ConfigurationIndex = 98; -#prach_msg1_FDM -#0 = one, 1=two, 2=four, 3=eight - prach_msg1_FDM = 0; - prach_msg1_FrequencyStart = 0; - zeroCorrelationZoneConfig = 12; - preambleReceivedTargetPower = -104; -#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) - preambleTransMax = 6; -#powerRampingStep -# 0=dB0,1=dB2,2=dB4,3=dB6 - powerRampingStep = 1; -#ra_ReponseWindow -#1,2,4,8,10,20,40,80 - ra_ResponseWindow = 4; -#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR -#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen - ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 3; -#oneHalf (0..15) 4,8,12,16,...60,64 - ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15; -#ra_ContentionResolutionTimer -#(0..7) 8,16,24,32,40,48,56,64 - ra_ContentionResolutionTimer = 7; - rsrp_ThresholdSSB = 19; -#prach-RootSequenceIndex_PR -#1 = 839, 2 = 139 - prach_RootSequenceIndex_PR = 2; - prach_RootSequenceIndex = 1; - # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex - # - msg1_SubcarrierSpacing = 1, -# restrictedSetConfig -# 0=unrestricted, 1=restricted type A, 2=restricted type B - restrictedSetConfig = 0, - - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - # this is SS=2 L=13 - initialULBWPstartSymbolAndLength_0 = 41; - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=4 - initialULBWPstartSymbolAndLength_1 = 52; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; - - msg3_DeltaPreamble = 1; - p0_NominalWithGrant =-90; - -# pucch-ConfigCommon setup : -# pucchGroupHopping -# 0 = neither, 1= group hopping, 2=sequence hopping - pucchGroupHopping = 0; - hoppingId = 40; - p0_nominal = -90; -# ssb_PositionsInBurs_BitmapPR -# 1=short, 2=medium, 3=long - ssb_PositionsInBurst_PR = 2; - ssb_PositionsInBurst_Bitmap = 1; - -# ssb_periodicityServingCell -# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 - ssb_periodicityServingCell = 2; - -# dmrs_TypeA_position -# 0 = pos2, 1 = pos3 - dmrs_TypeA_Position = 0; - -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - subcarrierSpacing = 1; - - - #tdd-UL-DL-ConfigurationCommon -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - referenceSubcarrierSpacing = 1; - # pattern1 - # dl_UL_TransmissionPeriodicity - # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 - dl_UL_TransmissionPeriodicity = 6; - nrofDownlinkSlots = 7; - nrofDownlinkSymbols = 6; - nrofUplinkSlots = 2; - nrofUplinkSymbols = 4; - - ssPBCH_BlockPower = -25; - } - - ); - - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// AMF parameters: - amf_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - GNB_INTERFACE_NAME_FOR_NG_AMF = "em1"; - GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR"; - GNB_INTERFACE_NAME_FOR_NGU = "em1"; - GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR"; - GNB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - } -); - -MACRLCs = ( - { - num_cc = 1; - tr_s_preference = "local_L1"; - tr_n_preference = "local_RRC"; - pusch_TargetSNRx10 = 200; - pucch_TargetSNRx10 = 200; - ulsch_max_frame_inactivity = 1; - } -); - -L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 2; - prach_dtx_threshold = 120; -# pucch0_dtx_threshold = 150; - } -); - -RUs = ( - { - local_rf = "yes" - nb_tx = 1 - nb_rx = 1 - att_tx = 0 - att_rx = 0; - bands = [78]; - max_pdschReferenceSignalPower = -27; - max_rxgain = 75; - eNB_instances = [0]; - ##beamforming 1x2 matrix: 1 layer x 2 antennas - bf_weights = [0x00007fff, 0x0000]; - ##beamforming 1x4 matrix: 1 layer x 4 antennas - #bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000]; - ## beamforming 2x2 matrix: - # bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff]; - ## beamforming 4x4 matrix: - #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; - sf_extension = 0 - sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" - } -); - -THREAD_STRUCT = ( - { - #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" - parallel_config = "PARALLEL_SINGLE_THREAD"; - #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" - worker_config = "WORKER_ENABLE"; - } -); - -security = { - # preferred ciphering algorithms - # the first one of the list that an UE supports in chosen - # valid values: nea0, nea1, nea2, nea3 - ciphering_algorithms = ( "nea0" ); - - # preferred integrity algorithms - # the first one of the list that an UE supports in chosen - # valid values: nia0, nia1, nia2, nia3 - integrity_algorithms = ( "nia2", "nia0" ); - - # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter - # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' - drb_ciphering = "yes"; - drb_integrity = "no"; -}; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; - }; +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_CU_ID = 0xe00; + +# cell_type = "CELL_MACRO_GNB"; + + gNB_name = "gNB-OAI"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + + plmn_list = ({ + mcc = 208; + mnc = 97; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x010203; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + }); + + nr_cellid = 12345678L + +# tr_s_preference = "local_mac" + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + #pusch_TargetSNRx10 = 200; + #pucch_TargetSNRx10 = 200; + ul_prbblacklist = "51,52,53,54" + min_rxtxtime = 6; + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 11; + searchSpaceZero = 0; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3301.68 MHz + 22*12*30e-3 MHz = 3309.6 + #absoluteFrequencySSB = 620640; + # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68 + absoluteFrequencySSB = 621312; + # this is 3503.28 MHz + 22*12*30e-3 MHz = 3511.2 + #absoluteFrequencySSB = 634080; + # this is 3600.48 MHz + #absoluteFrequencySSB = 640032; + #dl_frequencyBand = 78; + # this is 3301.68 MHz + #dl_absoluteFrequencyPointA = 620112; + # this is 3300.60 MHz + dl_absoluteFrequencyPointA = 620040; + # this is 3502.56 MHz + #dl_absoluteFrequencyPointA = 633552; + # this is 3600.48 MHz + #dl_absoluteFrequencyPointA = 640032; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 106; + #initialDownlinkBWP + #genericParameters + # this is RBstart=0,L=106 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 11; + initialDLBWPsearchSpaceZero = 0; + + + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 78; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 106; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 12; + preambleReceivedTargetPower = -104; +#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) + preambleTransMax = 6; +#powerRampingStep +# 0=dB0,1=dB2,2=dB4,3=dB6 + powerRampingStep = 1; +#ra_ReponseWindow +#1,2,4,8,10,20,40,80 + ra_ResponseWindow = 4; +#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR +#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 3; +#oneHalf (0..15) 4,8,12,16,...60,64 + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15; +#ra_ContentionResolutionTimer +#(0..7) 8,16,24,32,40,48,56,64 + ra_ContentionResolutionTimer = 7; + rsrp_ThresholdSSB = 19; +#prach-RootSequenceIndex_PR +#1 = 839, 2 = 139 + prach_RootSequenceIndex_PR = 2; + prach_RootSequenceIndex = 1; + # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex + # + msg1_SubcarrierSpacing = 1, +# restrictedSetConfig +# 0=unrestricted, 1=restricted type A, 2=restricted type B + restrictedSetConfig = 0, + + msg3_DeltaPreamble = 1; + p0_NominalWithGrant =-90; + +# pucch-ConfigCommon setup : +# pucchGroupHopping +# 0 = neither, 1= group hopping, 2=sequence hopping + pucchGroupHopping = 0; + hoppingId = 40; + p0_nominal = -90; +# ssb_PositionsInBurs_BitmapPR +# 1=short, 2=medium, 3=long + ssb_PositionsInBurst_PR = 2; + ssb_PositionsInBurst_Bitmap = 1; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 2; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 1; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 1; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 6; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + GNB_INTERFACE_NAME_FOR_NG_AMF = "em1"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR"; + GNB_INTERFACE_NAME_FOR_NGU = "em1"; + GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 200; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; + } +); + +L1s = ( + { + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 4; + prach_dtx_threshold = 120; +# pucch0_dtx_threshold = 150; + } +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 75; + eNB_instances = [0]; + ##beamforming 1x2 matrix: 1 layer x 2 antennas + bf_weights = [0x00007fff, 0x0000]; + ##beamforming 1x4 matrix: 1 layer x 4 antennas + #bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000]; + ## beamforming 2x2 matrix: + # bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff]; + ## beamforming 4x4 matrix: + #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; + sf_extension = 0 + sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + } +); + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; + }; diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf new file mode 100644 index 0000000000..70892930c9 --- /dev/null +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf @@ -0,0 +1,316 @@ +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_CU_ID = 0xe00; + +# cell_type = "CELL_MACRO_GNB"; + + gNB_name = "gNB-OAI"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + + plmn_list = ({ + mcc = 208; + mnc = 97; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x010203; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + }); + + nr_cellid = 12345678L + +# tr_s_preference = "local_mac" + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + #pusch_TargetSNRx10 = 200; + #pucch_TargetSNRx10 = 200; + ul_prbblacklist = "51,52,53,54" + min_rxtxtime = 6; + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 11; + searchSpaceZero = 0; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3301.68 MHz + 22*12*30e-3 MHz = 3309.6 + #absoluteFrequencySSB = 620640; + # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68 + absoluteFrequencySSB = 621312; + # this is 3503.28 MHz + 22*12*30e-3 MHz = 3511.2 + #absoluteFrequencySSB = 634080; + # this is 3600.48 MHz + #absoluteFrequencySSB = 640032; + #dl_frequencyBand = 78; + # this is 3301.68 MHz + #dl_absoluteFrequencyPointA = 620112; + # this is 3300.60 MHz + dl_absoluteFrequencyPointA = 620040; + # this is 3502.56 MHz + #dl_absoluteFrequencyPointA = 633552; + # this is 3600.48 MHz + #dl_absoluteFrequencyPointA = 640032; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 106; + #initialDownlinkBWP + #genericParameters + # this is RBstart=0,L=106 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 11; + initialDLBWPsearchSpaceZero = 0; + + + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 78; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 106; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 12; + preambleReceivedTargetPower = -104; +#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) + preambleTransMax = 6; +#powerRampingStep +# 0=dB0,1=dB2,2=dB4,3=dB6 + powerRampingStep = 1; +#ra_ReponseWindow +#1,2,4,8,10,20,40,80 + ra_ResponseWindow = 4; +#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR +#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 3; +#oneHalf (0..15) 4,8,12,16,...60,64 + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15; +#ra_ContentionResolutionTimer +#(0..7) 8,16,24,32,40,48,56,64 + ra_ContentionResolutionTimer = 7; + rsrp_ThresholdSSB = 19; +#prach-RootSequenceIndex_PR +#1 = 839, 2 = 139 + prach_RootSequenceIndex_PR = 2; + prach_RootSequenceIndex = 1; + # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex + # + msg1_SubcarrierSpacing = 1, +# restrictedSetConfig +# 0=unrestricted, 1=restricted type A, 2=restricted type B + restrictedSetConfig = 0, + + msg3_DeltaPreamble = 1; + p0_NominalWithGrant =-90; + +# pucch-ConfigCommon setup : +# pucchGroupHopping +# 0 = neither, 1= group hopping, 2=sequence hopping + pucchGroupHopping = 0; + hoppingId = 40; + p0_nominal = -90; +# ssb_PositionsInBurs_BitmapPR +# 1=short, 2=medium, 3=long + ssb_PositionsInBurst_PR = 2; + ssb_PositionsInBurst_Bitmap = 1; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 2; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 1; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 1; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 6; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + GNB_INTERFACE_NAME_FOR_NG_AMF = "em1"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR"; + GNB_INTERFACE_NAME_FOR_NGU = "em1"; + GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 200; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; + } +); + +L1s = ( + { + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 4; + prach_dtx_threshold = 120; +# pucch0_dtx_threshold = 150; + } +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 75; + eNB_instances = [0]; + ##beamforming 1x2 matrix: 1 layer x 2 antennas + bf_weights = [0x00007fff, 0x0000]; + ##beamforming 1x4 matrix: 1 layer x 4 antennas + #bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000]; + ## beamforming 2x2 matrix: + # bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff]; + ## beamforming 4x4 matrix: + #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; + sf_extension = 0 + sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + } +); + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; + }; diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf index e6bbbf2d41..3441cf39ec 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf @@ -23,6 +23,7 @@ gNBs = ssb_SubcarrierOffset = 31; //0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; + min_rxtxtime = 6; servingCellConfigCommon = ( { From c26d6fd685ca8b2381bcd5c2b1fe7199fe66cd48 Mon Sep 17 00:00:00 2001 From: hardy Date: Mon, 3 Jan 2022 11:55:26 +0100 Subject: [PATCH 014/107] fix test status depending on results ; cosmetic fix on assertions text --- ci-scripts/cls_oaicitest.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index e0c261df22..9f930e8897 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -2088,19 +2088,19 @@ class OaiCiTest(): packetloss += '%' #checking packet loss compliance if float(pl) > float(self.iperf_packetloss_threshold): - pal_too_high_msg = 'Packet Loss too high : actual = '+packetloss+', target = '+self.iperf_packetloss_threshold+'%\n' + pal_too_high_msg = 'Packet Loss too high : actual = '+packetloss+', target = '+self.iperf_packetloss_threshold+'%' else: - pal_too_high_msg='' + pal_too_high_msg='Packet Loss value is within acceptance range' #checking bitrate perf compliance if float(br_loss) < float(self.iperf_bitrate_threshold): - bit_too_low_msg = 'Bitrate too low : actual = '+bitperf+', target = '+self.iperf_bitrate_threshold+'%\n' + bit_too_low_msg = 'Bitrate too low : actual = '+bitperf+', target = '+self.iperf_bitrate_threshold+'%' else: - bit_too_low_msg='' + bit_too_low_msg='Bitrate perf value is within acceptance range' lock.acquire() - if (float(br_loss) < float(self.iperf_bitrate_threshold)) or (float(pl) > float(self.iperf_packetloss_threshold)): - statusQueue.put(1) - elif (float(br_loss) < float(self.iperf_bitrate_threshold)) and (float(pl) > float(self.iperf_packetloss_threshold)): + if (float(br_loss) < float(self.iperf_bitrate_threshold)) and (float(pl) > float(self.iperf_packetloss_threshold)): statusQueue.put(-1) + elif (float(br_loss) < float(self.iperf_bitrate_threshold)) or (float(pl) > float(self.iperf_packetloss_threshold)): + statusQueue.put(1) else: statusQueue.put(0) statusQueue.put(device_id) From 535cc3de21de090ab9d5da392e78553946eeb52f Mon Sep 17 00:00:00 2001 From: hardy Date: Mon, 3 Jan 2022 16:15:04 +0100 Subject: [PATCH 015/107] fixing ping analysis (extra stats) for module UE --- ci-scripts/cls_oaicitest.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 9f930e8897..f5692579ee 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -1579,6 +1579,7 @@ class OaiCiTest(): SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) #cat is executed on EPC SSH.command('cat ' + EPC.SourceCodePath + '/scripts/ping_' + self.testCase_id + '_' + device_id + '.log', '\$', 5) + ping_log_file='ping_' + self.testCase_id + '_' + device_id + '.log' else: #launch from Module SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword) #target address is different depending on EPC type @@ -1596,6 +1597,7 @@ class OaiCiTest(): #cat is executed locally SSH.command('cat ping_' + self.testCase_id + '_' + self.ue_id + '.log', '\$', 5) + ping_log_file='ping_' + self.testCase_id + '_' + self.ue_id + '.log' ping_status=0 # TIMEOUT CASE @@ -1643,7 +1645,7 @@ class OaiCiTest(): logging.debug('\u001B[1;34m ' + max_msg + '\u001B[0m') #adding extra ping stats from local file - ping_log_file='ping_' + self.testCase_id + '_' + device_id + '.log' + #ping_log_file variable is defined above in this function, depending on device/ue logging.debug('Analyzing Ping log file : ' + os.getcwd() + '/' + ping_log_file) ping_stat=GetPingTimeAnalysis(ping_log_file) ping_stat_msg='' @@ -2088,12 +2090,12 @@ class OaiCiTest(): packetloss += '%' #checking packet loss compliance if float(pl) > float(self.iperf_packetloss_threshold): - pal_too_high_msg = 'Packet Loss too high : actual = '+packetloss+', target = '+self.iperf_packetloss_threshold+'%' + pal_too_high_msg = 'Packet Loss too high : tested = '+packetloss+', target = '+self.iperf_packetloss_threshold+'%' else: pal_too_high_msg='Packet Loss value is within acceptance range' #checking bitrate perf compliance if float(br_loss) < float(self.iperf_bitrate_threshold): - bit_too_low_msg = 'Bitrate too low : actual = '+bitperf+', target = '+self.iperf_bitrate_threshold+'%' + bit_too_low_msg = 'Bitrate too low : tested = '+bitperf+', target = '+self.iperf_bitrate_threshold+'%' else: bit_too_low_msg='Bitrate perf value is within acceptance range' lock.acquire() From 76f0990352574007ca763027f787cf22ab746426 Mon Sep 17 00:00:00 2001 From: hardy Date: Mon, 3 Jan 2022 17:46:38 +0100 Subject: [PATCH 016/107] add/fix autoterminate when a node does not start (gnb in nsa for ex) --- ci-scripts/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 415d3c4d3d..f448447e44 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -818,6 +818,8 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re check_OAI_UE = False RAN.pStatus=CiTestObj.CheckProcessExist(check_eNB, check_OAI_UE,RAN,EPC) RAN.InitializeeNB(HTML, EPC) + if RAN.prematureExit: + CiTestObj.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC,InfraUE,CONTAINERS) elif action == 'Terminate_eNB': RAN.TerminateeNB(HTML, EPC) elif action == 'Initialize_UE': From 4a263215ada6a6a4ccd9a34f567c1af79811f295 Mon Sep 17 00:00:00 2001 From: hardy Date: Mon, 3 Jan 2022 23:27:04 +0100 Subject: [PATCH 017/107] add ping events graph into artifacts as png --- ci-scripts/cls_oaicitest.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index f5692579ee..7e02a51b34 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -62,7 +62,7 @@ import cls_ci_ueinfra #class defining the multi Ue infrastrucure # Utility functions #----------------------------------------------------------- -def GetPingTimeAnalysis(ping_log_file): +def GetPingTimeAnalysis(ping_log_file,ping_rttavg_threshold): #ping time values read from file t_ping=[] #ping stats (dictionary) to be returned by the function @@ -93,6 +93,24 @@ def GetPingTimeAnalysis(ping_log_file): ping_stat['median_1']=stat.median(t_ping) ping_stat['max_1']=max(t_ping) + #plot ping over time and save png for artifacts + ticks = np.arange(0, len(t_ping), 1) + figure, axis = plt.subplots(figsize=(10, 10)) + axis.plot(ticks,t_ping,marker='o') + axis.set_xlabel('Ping Events') + axis.set_ylabel("Ping RTT (in ms)") + axis.set_title(ping_log_file) + YMAX=20 #base scale + if max(t_ping) > YMAX: + y_max=max(t_ping)+1 + else: + y_max=YMAX+1 + plt.ylim(0,y_max) + th_label="Ping Fail Threshold="+ping_rttavg_threshold + plt.axhline(y=float(ping_rttavg_threshold), color='r', linestyle='-',label=th_label) + axis.legend() + plt.savefig(ping_log_file+'.png') + return ping_stat else: @@ -1647,7 +1665,7 @@ class OaiCiTest(): #adding extra ping stats from local file #ping_log_file variable is defined above in this function, depending on device/ue logging.debug('Analyzing Ping log file : ' + os.getcwd() + '/' + ping_log_file) - ping_stat=GetPingTimeAnalysis(ping_log_file) + ping_stat=GetPingTimeAnalysis(ping_log_file,self.ping_rttavg_threshold) ping_stat_msg='' if (ping_stat!=-1) and (len(ping_stat)!=0): ping_stat_msg+='Ping stats before removing largest value : \n' From a0fd26e8dff5d7be767f58149059a63185390870 Mon Sep 17 00:00:00 2001 From: hardy Date: Tue, 4 Jan 2022 08:50:49 +0100 Subject: [PATCH 018/107] fix matplotlib numpy lib import --- ci-scripts/cls_oaicitest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 7e02a51b34..1e3b15cd08 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -57,6 +57,8 @@ import sshconnection import cls_module_ue import cls_ci_ueinfra #class defining the multi Ue infrastrucure +import matplotlib.pyplot as plt +import numpy as np #----------------------------------------------------------- # Utility functions From af554f66ede8243076c2b19a58b36d073de66520 Mon Sep 17 00:00:00 2001 From: hardy Date: Tue, 4 Jan 2022 10:54:34 +0100 Subject: [PATCH 019/107] fix matplotlib logging level --- ci-scripts/cls_oaicitest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 1e3b15cd08..799e5283c4 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -57,6 +57,7 @@ import sshconnection import cls_module_ue import cls_ci_ueinfra #class defining the multi Ue infrastrucure +logging.getLogger("matplotlib").setLevel(logging.WARNING) import matplotlib.pyplot as plt import numpy as np From a54c1f239ea52bccde06483516d782da2fb3f3a8 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 4 Jan 2022 14:11:21 +0100 Subject: [PATCH 020/107] passing the file name on top of the path for uecap --- executables/nr-softmodem-common.h | 4 ++-- executables/nr-ue.c | 4 ++-- executables/nr-uesoftmodem.c | 14 ++------------ executables/nr-uesoftmodem.h | 2 +- openair2/RRC/NR_UE/rrc_UE.c | 18 +++++++++--------- openair2/RRC/NR_UE/rrc_defs.h | 6 +++--- 6 files changed, 19 insertions(+), 29 deletions(-) diff --git a/executables/nr-softmodem-common.h b/executables/nr-softmodem-common.h index 22b616f29e..45d7852adc 100644 --- a/executables/nr-softmodem-common.h +++ b/executables/nr-softmodem-common.h @@ -87,9 +87,9 @@ #define CONFIG_HLP_NOTWAIT "don't wait for tracer, start immediately\n" #define CONFIG_HLP_TNOFORK "to ease debugging with gdb\n" #define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n" -#define CONFIG_HLP_DISABLETIMECORR "disable UE timing correction\n" +#define CONFIG_HLP_DISABLETIMECORR "disable UE timing correction\n" #define CONFIG_HLP_RRC_CFG_PATH "path for RRC configuration\n" -#define CONFIG_HLP_UECAP_PATH "path for UE Capabilities file\n" +#define CONFIG_HLP_UECAP_FILE "path for UE Capabilities file\n" #define CONFIG_HLP_NUMEROLOGY "adding numerology for 5G\n" #define CONFIG_HLP_EMULATE_RF "Emulated RF enabled(disable by defult)\n" diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 03ae537e04..23846b70fc 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -757,14 +757,14 @@ void *UE_thread(void *arg) { } void init_NR_UE(int nb_inst, - char* uecap_path, + char* uecap_file, char* rrc_config_path) { int inst; NR_UE_MAC_INST_t *mac_inst; NR_UE_RRC_INST_t* rrc_inst; for (inst=0; inst < nb_inst; inst++) { - AssertFatal((rrc_inst = nr_l3_init_ue(uecap_path,rrc_config_path)) != NULL, "can not initialize RRC module\n"); + AssertFatal((rrc_inst = nr_l3_init_ue(uecap_file,rrc_config_path)) != NULL, "can not initialize RRC module\n"); AssertFatal((mac_inst = nr_l2_init_ue(rrc_inst)) != NULL, "can not initialize L2 module\n"); AssertFatal((mac_inst->if_module = nr_ue_if_module_init(inst)) != NULL, "can not initialize IF module\n"); } diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index 6deca88eb8..c63b553fce 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -115,7 +115,7 @@ int vcdflag = 0; double rx_gain_off = 0.0; char *usrp_args = NULL; char *rrc_config_path = NULL; -char *uecap_path = NULL; +char *uecap_file = NULL; int dumpframe = 0; uint64_t downlink_frequency[MAX_NUM_CCs][4]; @@ -148,8 +148,6 @@ int numerology = 0; int oaisim_flag = 0; int emulate_rf = 0; uint32_t N_RB_DL = 106; -char uecap_xer_in = 0; -char uecap_xer[1024]; /* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed * this is very hackish - find a proper solution @@ -254,14 +252,6 @@ static void get_options(void) { if (vcdflag > 0) ouput_vcd = 1; - - if ( !(CONFIG_ISFLAGSET(CONFIG_ABORT)) && (!(CONFIG_ISFLAGSET(CONFIG_NOOOPT))) ) { - // Here the configuration file is the XER encoded UE capabilities - // Read it in and store in asn1c data structures - sprintf(uecap_xer,"%stargets/PROJECTS/GENERIC-LTE-EPC/CONF/UE_config.xml",getenv("OPENAIR_HOME")); - printf("%s\n",uecap_xer); - uecap_xer_in=1; - } /* UE with config file */ } // set PHY vars from command line @@ -439,7 +429,7 @@ int main( int argc, char **argv ) { #endif LOG_I(HW, "Version: %s\n", PACKAGE_VERSION); - init_NR_UE(1,uecap_path,rrc_config_path); + init_NR_UE(1,uecap_file,rrc_config_path); if(IS_SOFTMODEM_NOS1 || get_softmodem_params()->sa) init_pdcp(); diff --git a/executables/nr-uesoftmodem.h b/executables/nr-uesoftmodem.h index 0def34dd39..0cb7c072a0 100644 --- a/executables/nr-uesoftmodem.h +++ b/executables/nr-uesoftmodem.h @@ -34,7 +34,7 @@ {"offset-divisor", CONFIG_HLP_OFFSET_DIV, 0, uptr:(uint32_t *)&nrUE_params.ofdm_offset_divisor, defuintval:UINT_MAX, TYPE_UINT32, 0}, \ {"nr-dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&nr_dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \ {"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&vcdflag, defintval:0, TYPE_INT, 0}, \ - {"uecap_path", CONFIG_HLP_UECAP_PATH, 0, strptr:(char **)&uecap_path, defstrval:"./", TYPE_STRING, 0}, \ + {"uecap_file", CONFIG_HLP_UECAP_FILE, 0, strptr:(char **)&uecap_file, defstrval:"./", TYPE_STRING, 0}, \ {"rrc_config_path", CONFIG_HLP_RRC_CFG_PATH,0, strptr:(char **)&rrc_config_path, defstrval:"./", TYPE_STRING, 0} \ } diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index f2868e9c97..93e7e0b8fe 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -410,7 +410,7 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type, } -NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* uecap_path, char* rrc_config_path){ +NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* uecap_file, char* rrc_config_path){ int nr_ue; if(NB_NR_UE_INST > 0){ NR_UE_rrc_inst = (NR_UE_RRC_INST_t *)malloc(NB_NR_UE_INST * sizeof(NR_UE_RRC_INST_t)); @@ -485,7 +485,7 @@ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* uecap_path, char* rrc_config_ RRC_LIST_INIT(NR_UE_rrc_inst[nr_ue].CSI_ReportConfig_list, NR_maxNrofCSI_ReportConfigurations); } - NR_UE_rrc_inst->uecap_path = uecap_path; + NR_UE_rrc_inst->uecap_file = uecap_file; if (get_softmodem_params()->phy_test==1 || get_softmodem_params()->do_ra==1) { // read in files for RRCReconfiguration and RBconfig @@ -2634,13 +2634,6 @@ nr_rrc_ue_process_ueCapabilityEnquiry( ctxt_pP->frame, gNB_index); - FILE *f = NULL; - char *file_path = NR_UE_rrc_inst[ctxt_pP->module_id].uecap_path; - if (file_path) { - sprintf(UE_NR_Capability_xer_fname,"%s/uecap.xml",file_path); - f = fopen(UE_NR_Capability_xer_fname, "r"); - } - memset((void *)&ul_dcch_msg,0,sizeof(NR_UL_DCCH_Message_t)); memset((void *)&ue_CapabilityRAT_Container,0,sizeof(NR_UE_CapabilityRAT_Container_t)); ul_dcch_msg.message.present = NR_UL_DCCH_MessageType_PR_c1; @@ -2651,6 +2644,13 @@ nr_rrc_ue_process_ueCapabilityEnquiry( ue_CapabilityRAT_Container.rat_Type = NR_RAT_Type_nr; NR_UE_NR_Capability_t* UE_Capability_nr = NULL; + FILE *f = NULL; + char *file_path = NR_UE_rrc_inst[ctxt_pP->module_id].uecap_file; + if (file_path) { + sprintf(UE_NR_Capability_xer_fname,"%s",file_path); + f = fopen(UE_NR_Capability_xer_fname, "r"); + } + if(f){ size = fread(UE_NR_Capability_xer, 1, sizeof UE_NR_Capability_xer, f); if (size == 0 || size == sizeof UE_NR_Capability_xer) { diff --git a/openair2/RRC/NR_UE/rrc_defs.h b/openair2/RRC/NR_UE/rrc_defs.h index d623481c81..3aa98951f2 100644 --- a/openair2/RRC/NR_UE/rrc_defs.h +++ b/openair2/RRC/NR_UE/rrc_defs.h @@ -120,15 +120,15 @@ typedef struct NR_UE_RRC_INST_s { NR_DRB_ToAddMod_t *DRB_config[NB_CNX_UE][8]; rb_id_t *defaultDRB; // remember the ID of the default DRB - char *uecap_path; + char *uecap_file; - NR_SRB_INFO Srb0[NB_SIG_CNX_UE]; + NR_SRB_INFO Srb0[NB_SIG_CNX_UE]; NR_SRB_INFO_TABLE_ENTRY Srb1[NB_CNX_UE]; NR_SRB_INFO_TABLE_ENTRY Srb2[NB_CNX_UE]; uint8_t MBMS_flag; OAI_NR_UECapability_t *UECap; - uint8_t *UECapability; + uint8_t *UECapability; uint8_t UECapability_size; RA_trigger_t ra_trigger; From e4d3bf9f4135057bac709eee1c1c4f899e7e88e9 Mon Sep 17 00:00:00 2001 From: frtabu Date: Tue, 23 Nov 2021 14:55:18 +0100 Subject: [PATCH 021/107] Fixes after MR 1257 1225: sanitize address error introduced in ldpctest when using alternatives ldpc libraries and LOG flooding introduced in nrUE. Also improved openCL ldpc library build --- cmake_targets/CMakeLists.txt | 5 + common/config/config_load_configmodule.c | 9 +- .../CODING/nrLDPC_decoder/nrLDPC_decoder_CL.c | 67 ++-- .../nrLDPC_decoder_kernels_CL.cl | 302 ------------------ openair1/PHY/CODING/nrLDPC_load.c | 4 +- openair1/PHY/INIT/nr_parms.c | 4 +- .../NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 46 +-- .../PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 4 +- openair1/PHY/TOOLS/time_meas.c | 17 - openair1/PHY/TOOLS/time_meas.h | 19 +- 10 files changed, 92 insertions(+), 385 deletions(-) delete mode 100644 openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_kernels_CL.cl diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index f513ac0563..af3baa2584 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1531,6 +1531,10 @@ set(PHY_LDPC_CL_SRC ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_CL.c ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c ) +add_custom_target( nrLDPC_decoder_kernels_CL + COMMAND gcc ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_kernels_CL.c -dD -DNRLDPC_KERNEL_SOURCE -E -o ${CMAKE_CURRENT_BINARY_DIR}/nrLDPC_decoder_kernels_CL.clc + SOURCES ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_kernels_CL.c +) set(PHY_NR_CODINGIF ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_load.c; @@ -1541,6 +1545,7 @@ add_library(ldpc_optim MODULE ${PHY_LDPC_OPTIM_SRC} ) add_library(ldpc_optim8seg MODULE ${PHY_LDPC_OPTIM8SEG_SRC} ) add_library(ldpc_cl MODULE ${PHY_LDPC_CL_SRC} ) target_link_libraries(ldpc_cl OpenCL) +add_dependencies(ldpc_cl nrLDPC_decoder_kernels_CL) if (CUDA_FOUND) cuda_add_library(ldpc_cuda MODULE ${PHY_LDPC_CUDA_SRC} ) diff --git a/common/config/config_load_configmodule.c b/common/config/config_load_configmodule.c index 740c6e240b..f98b1db167 100644 --- a/common/config/config_load_configmodule.c +++ b/common/config/config_load_configmodule.c @@ -219,11 +219,9 @@ configmodule_interface_t *load_configmodule(int argc, cfgparam = getenv("OAI_CONFIGMODULE"); } - /* default different for UE and softmodem because UE doesn't use config file*/ + /* default different for UE and softmodem because UE may run without config file */ /* and -O option is not mandatory for UE */ /* phy simulators behave as UE */ - /* test of exec name would better be replaced by a parameter to the l */ - /* oad_configmodule function */ if (cfgparam == NULL) { tmpflags = tmpflags | CONFIG_NOOOPT; @@ -249,9 +247,14 @@ configmodule_interface_t *load_configmodule(int argc, } cfgptr = calloc(sizeof(configmodule_interface_t),1); + /* argv_info is used to memorize command line options which have been recognized */ + /* and to detect unrecognized command line options which might have been specified */ cfgptr->argv_info = calloc(sizeof(int32_t), argc); + /* argv[0] is the exec name, always Ok */ cfgptr->argv_info[0] |= CONFIG_CMDLINEOPT_PROCESSED; + /* when OoptIdx is >0, -O option has been detected at position OoptIdx + * we must memorize arv[OoptIdx is Ok */ if (OoptIdx >= 0) { cfgptr->argv_info[OoptIdx] |= CONFIG_CMDLINEOPT_PROCESSED; cfgptr->argv_info[OoptIdx+1] |= CONFIG_CMDLINEOPT_PROCESSED; diff --git a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_CL.c b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_CL.c index 58e6b507af..c60286ab3a 100644 --- a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_CL.c +++ b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_CL.c @@ -25,15 +25,7 @@ * \version 1.0 * \note initial implem - translation of cuda version */ -/* uses HW component id for log messages ( --log_config.hw_log_level ) */ -#include -#include -#include -#include -#include "PHY/CODING/nrLDPC_decoder/nrLDPC_types.h" -#include "PHY/CODING/nrLDPC_decoder/nrLDPCdecoder_defs.h" -#include "assertions.h" -#include "common/utils/LOG/log.h" + #define MAX_ITERATION 2 #define MC 1 @@ -41,16 +33,29 @@ #define MAX_OCLDEV 10 #define MAX_OCLRUNTIME 5 - -#define CLSETKERNELARG(A,B,C,D) \ -rt=clSetKernelArg(A,B,C,D) ;\ -AssertFatal(rt == CL_SUCCESS, "Error %d setting kernel argument index %d\n" , (int)rt, B); - typedef struct{ char x; char y; short value; } h_element; + +#ifdef NRLDPC_KERNEL_SOURCE +#include "nrLDPC_decoder_kernels_CL.c" +#else +/* uses HW component id for log messages ( --log_config.hw_log_level ) */ +#include +#include +#include +#include +#include "PHY/CODING/nrLDPC_decoder/nrLDPC_types.h" +#include "PHY/CODING/nrLDPC_decoder/nrLDPCdecoder_defs.h" +#include "assertions.h" +#include "common/utils/LOG/log.h" + +#define CLSETKERNELARG(A,B,C,D) \ +rt=clSetKernelArg(A,B,C,D) ;\ +AssertFatal(rt == CL_SUCCESS, "Error %d setting kernel argument index %d\n" , (int)rt, B); + #include "../nrLDPC_decoder_LYC/bgs/BG1_compact_in_C.h" typedef struct{ @@ -213,20 +218,31 @@ void get_CompilErr(cl_program program, int pltf) { } -size_t load_source(char **source_str) { - int MAX_SOURCE_SIZE=(500*132); +size_t load_source(char **source_str, char *filename) { FILE *fp; + struct stat st ; size_t source_size; - - fp = fopen("nrLDPC_decoder_kernels_CL.cl", "r"); - AssertFatal(fp,"failed to open cl source: %s\n",strerror(errno)); + char *src= NULL; - *source_str = (char*)malloc(MAX_SOURCE_SIZE); - source_size = fread( *source_str, 1, MAX_SOURCE_SIZE, fp); - fclose( fp ); - return source_size; + if (filename == NULL) { + src = "nrLDPC_decoder_kernels_CL.clc"; + } else { + src = filename; + } + fp = fopen(src, "r"); + AssertFatal(fp,"failed to open cl source %s: %s\n",src,strerror(errno)); + + fstat(fileno(fp), &st); + source_size = st.st_size; + *source_str = (char*)malloc(source_size); + source_size = fread( *source_str, 1, source_size, fp); + fclose( fp ); + LOG_I(HW,"Loaded kernel sources from %s %u bytes\n", (filename==NULL)?"embedded cl code":src,(unsigned int)source_size ); + return source_size; } + + /* from here: entry points in decoder shared lib */ int ldpc_autoinit(void) { // called by the library loader cl_platform_id platforms[10]; @@ -284,11 +300,11 @@ int ldpc_autoinit(void) { // called by the library loader ocl.runtime[i].dev_tmp = clCreateBuffer(ocl.runtime[i].context, CL_MEM_READ_ONLY|CL_MEM_HOST_WRITE_ONLY, 68*384, NULL, (cl_int *)&rt); AssertFatal(rt == CL_SUCCESS, "Error %d creating buffer dev_tmp for platform %i \n" , (int)rt, i); char *source_str; - size_t source_size=load_source(&source_str); + size_t source_size=load_source(&source_str,"nrLDPC_decoder_kernels_CL.clc"); cl_program program = clCreateProgramWithSource(ocl.runtime[i].context, 1, (const char **)&source_str, (const size_t *)&source_size, (cl_int *)&rt); AssertFatal(rt == CL_SUCCESS, "Error %d creating program for platform %i \n" , (int)rt, i); - rt = clBuildProgram(program, ocl.runtime[i].num_devices,ocl.runtime[i].devices, NULL, NULL, NULL); + rt = clBuildProgram(program, ocl.runtime[i].num_devices,ocl.runtime[i].devices, NULL /* compile options */, NULL, NULL); if (rt == CL_BUILD_PROGRAM_FAILURE) { get_CompilErr(program,i); } @@ -434,3 +450,4 @@ int32_t nrLDPC_decod(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8_t* p_ return MAX_ITERATION; } +#endif //NRLDPC_KERNEL_SOURCE diff --git a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_kernels_CL.cl b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_kernels_CL.cl deleted file mode 100644 index d5e2fa5695..0000000000 --- a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_kernels_CL.cl +++ /dev/null @@ -1,302 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.0 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file PHY/CODING/nrLDPC_decoder_kernels_CL.cl -* \brief kernel functions for ldpc decoder accelerated via openCL -* \author Francois TABURET -* \date 2021 -* \version 1.0 -* \company Nokia BellLabs France -* \email: francois.taburet@nokia-bell-labs.com -* \note initial implem - translation of cuda version -* \warning -*/ -#define define MAX_ITERATION 2 -#define MC 1 - -#define INT32_MAX 2147483647 - -typedef struct{ - char x; - char y; - short value; -} h_element; - -//__global char dev_dt [46*68*384]; -//__local char *dev_t; -//__global char dev_llr[68*384]; -//__global unsigned char dev_tmp[68*384]; - - - - -//__constant h_element dev_h_compact1[46*19] = {}; // used in kernel 1 -//__constant h_element dev_h_compact2[68*30] = {}; // used in kernel 2 - -// __device__ __constantant__ h_element dev_h_compact1[46*19]; // used in kernel 1 -// __device__ __constantant__ h_element dev_h_compact2[68*30]; // used in kernel 2 - -// row and col element count -__constant char h_ele_row_bg1_count[46] = { - 19, 19, 19, 19, 3, 8, 9, 7, 10, 9, - 7, 8, 7, 6, 7, 7, 6, 6, 6, 6, - 6, 6, 5, 5, 6, 5, 5, 4, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 4, 5, 5, - 4, 5, 4, 5, 5, 4}; -__constant char h_ele_col_bg1_count[68] = { - 30, 28, 7, 11, 9, 4, 8, 12, 8, 7, - 12, 10, 12, 11, 10, 7, 10, 10, 13, 7, - 8, 11, 12, 5, 6, 6, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1}; -__constant char h_ele_row_bg2_count[42] = { - 8, 10, 8, 10, 4, 6, 6, 6, 4, 5, - 5, 5, 4, 5, 5, 4, 5, 5, 4, 4, - 4, 4, 3, 4, 4, 3, 5, 3, 4, 3, - 5, 3, 4, 4, 4, 4, 4, 3, 4, 4, - 4, 4}; -__constant char h_ele_col_bg2_count[52] = { - 22, 23, 10, 5, 5, 14, 7, 13, 6, 8, - 9, 16, 9, 12, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1}; - - - -// Kernel 1 -__kernel void ldpc_cnp_kernel_1st_iter( __global char * dev_llr, __global char * dev_dt, __local h_element *dev_h_compact1, int BG, int row, int col, int Zc) -{ -// int iMCW = blockIdx.y; // codeword id -// int iBlkRow = blockIdx.x; // block row in h_base -// int iSubRow = threadIdx.x; // row index in sub_block of h_base -// if(blockIdx.x == 0 && threadIdx.x == 1) printf("cnp %d\n", threadIdx.x); - int iMCW = get_group_id(1); // codeword id - int iBlkRow = get_group_id(0); // block row in h_base - int iBlkCol; // block col in h_base - int iSubRow = get_local_id(0);; // row index in sub_block of h_base - int iCol; // overall col index in h_base - int offsetR; - int shift_t; - -// For 2-min algorithm. - int Q_sign = 0; - int sq; - int Q, Q_abs; - int R_temp; - - int sign = 1; - int rmin1 = INT32_MAX; - int rmin2 = INT32_MAX; - char idx_min = 0; - - h_element h_element_t; - int s = (BG==1)? h_ele_row_bg1_count[iBlkRow]:h_ele_row_bg2_count[iBlkRow]; - offsetR = (iMCW * row*col*Zc) + iBlkRow * Zc + iSubRow; // row*col*Zc = size of dev_dt -// if(blockIdx.x == 0 && threadIdx.x == 1) printf("s: %d, offset %d\n", s, offsetR); -// The 1st recursion - for(int i = 0; i < s; i++) // loop through all the ZxZ sub-blocks in a row - { - h_element_t = dev_h_compact1[i*row+iBlkRow]; // compact_col == row - - iBlkCol = h_element_t.y; - shift_t = h_element_t.value; - - shift_t = (iSubRow + shift_t) % Zc; - iCol = (iMCW * col*Zc) + iBlkCol * Zc + shift_t; // col*Zc = size of llr - Q = dev_llr[iCol]; - Q_abs = (Q>0)? Q : -Q; - sq = Q < 0; -// if(blockIdx.x == 0 && threadIdx.x == 1) printf("i %d, icol %d, Q: %d\n", i, iCol, Q); - // quick version - sign = sign * (1 - sq * 2); - Q_sign |= sq << i; - - if (Q_abs < rmin1){ - rmin2 = rmin1; - rmin1 = Q_abs; - idx_min = i; - } else if (Q_abs < rmin2){ - rmin2 = Q_abs; - } - } - -// if(blockIdx.x == 0 && threadIdx.x == 1)printf("min1 %d, min2 %d, min1_idx %d\n", rmin1, rmin2, idx_min); - -// The 2nd recursion - for(int i = 0; i < s; i++){ - // v0: Best performance so far. 0.75f is the value of alpha. - sq = 1 - 2 * ((Q_sign >> i) & 0x01); - R_temp = 0.75f * sign * sq * (i != idx_min ? rmin1 : rmin2); - // write results to global memory - h_element_t = dev_h_compact1[i*row+iBlkRow]; - int addr_temp = offsetR + h_element_t.y * row * Zc; - dev_dt[addr_temp] = R_temp; -// if(blockIdx.x == 0 && threadIdx.x == 1)printf("R_temp %d, temp_addr %d\n", R_temp, addr_temp); - } -} - -// Kernel_1 -__kernel void ldpc_cnp_kernel( __global char * dev_llr, __global char * dev_dt, __local h_element *dev_h_compact1, int BG, int row, int col, int Zc) -{ -// if(blockIdx.x == 0 && threadIdx.x == 1) printf("cnp\n"); -// int iMCW = blockIdx.y; -// int iBlkRow = blockIdx.x; // block row in h_base // block col in h_base -// int iSubRow = threadIdx.x; // row index in sub_block of h_base - int iMCW = get_group_id(1); - int iBlkRow = get_group_id(0); // block row in h_base - int iBlkCol; // block col in h_base - int iSubRow = get_local_id(0);; // row index in sub_block of h_base - int iCol; // overall col index in h_base - int offsetR; - int shift_t; - -// For 2-min algorithm. - int Q_sign = 0; - int sq; - int Q, Q_abs; - int R_temp; - - int sign = 1; - int rmin1 = INT32_MAX; - int rmin2 = INT32_MAX; - char idx_min = 0; - - h_element h_element_t; - int s = (BG==1)? h_ele_row_bg1_count[iBlkRow]: h_ele_row_bg2_count[iBlkRow]; - offsetR = (iMCW *row*col*Zc) + iBlkRow * Zc + iSubRow; // row * col * Zc = size of dev_dt -// if(blockIdx.x == 0 && threadIdx.x == 1) printf("s: %d, offset %d\n", s, offsetR); -// The 1st recursion - for(int i = 0; i < s; i++) // loop through all the ZxZ sub-blocks in a row - { - h_element_t = dev_h_compact1[i*row+iBlkRow]; - - iBlkCol = h_element_t.y; - shift_t = h_element_t.value; - shift_t = (iSubRow + shift_t) % Zc; - iCol = iBlkCol * Zc + shift_t; - - R_temp = dev_dt[offsetR + iBlkCol * row * Zc]; - - Q = dev_llr[iMCW * (col*Zc) + iCol] - R_temp; - Q_abs = (Q>0)? Q : -Q; -// if(blockIdx.x == 0 && threadIdx.x == 1) printf("i %d, icol %d, Q: %d\n", i, iCol, Q); - sq = Q < 0; - sign = sign * (1 - sq * 2); - Q_sign |= sq << i; - - if (Q_abs < rmin1){ - rmin2 = rmin1; - rmin1 = Q_abs; - idx_min = i; - } else if (Q_abs < rmin2){ - rmin2 = Q_abs; - } - - } - -// if(blockIdx.x == 0 && threadIdx.x == 1)printf("min1 %d, min2 %d, min1_idx %d\n", rmin1, rmin2, idx_min); - -// The 2nd recursion - for(int i = 0; i < s; i ++){ - sq = 1 - 2 * ((Q_sign >> i) & 0x01); - R_temp = 0.75f * sign * sq * (i != idx_min ? rmin1 : rmin2); - - - // write results to global memory - h_element_t = dev_h_compact1[i*row+iBlkRow]; - int addr_temp = h_element_t.y * row * Zc + offsetR; - dev_dt[addr_temp] = R_temp; -// if(blockIdx.x == 0 && threadIdx.x == 1)printf("R_temp %d, temp_addr %d\n", R_temp, addr_temp); - } -} - -// Kernel 2: VNP processing -__kernel void -ldpc_vnp_kernel_normal(__global char * dev_llr, __global char * dev_dt, __global char * dev_const_llr, __local h_element *dev_h_compact2, int BG, int row, int col, int Zc) -{ -// int iMCW = blockIdx.y; -// int iBlkCol = blockIdx.x; -// int iSubCol = threadIdx.x; - int iMCW = get_group_id(1); - int iBlkCol = get_group_id(0); - int iBlkRow; - int iSubCol = get_local_id(0); - int iRow; - int iCol; - - int shift_t, sf; - int APP; - - h_element h_element_t; - - // update all the llr values - iCol = iBlkCol * Zc + iSubCol; - APP = dev_const_llr[iMCW *col*Zc + iCol]; - int offsetDt = iMCW *row*col*Zc + iBlkCol * row * Zc; - int s = (BG==1)? h_ele_col_bg1_count[iBlkCol]:h_ele_col_bg2_count[iBlkCol]; - - for(int i = 0; i < s; i++) - { - h_element_t = dev_h_compact2[i*col+iBlkCol]; - - shift_t = h_element_t.value%Zc; - iBlkRow = h_element_t.x; - - sf = iSubCol - shift_t; - sf = (sf + Zc) % Zc; - - iRow = iBlkRow * Zc + sf; - APP = APP + dev_dt[offsetDt + iRow]; - } - if(APP > SCHAR_MAX) APP = SCHAR_MAX; - if(APP < SCHAR_MIN) APP = SCHAR_MIN; - // write back to device global memory - dev_llr[iMCW *col*Zc + iCol] = APP; -} - - -__kernel void pack_decoded_bit(__global unsigned char * dev_llr, __global unsigned char * dev_tmp, int col, int Zc) -{ -// int iMCW = blockIdx.y; -// int btid = threadIdx.x; - unsigned char tmp[128]; - int iMCW = get_group_id(1); - int btid = get_local_id(0); - int tid = iMCW * col*Zc + get_group_id(0)*128 + btid; - tmp[btid] = 0; - - if(dev_llr[tid] < 0){ - tmp[btid] = 1 << (7-(btid&7)); - } -// __syncthreads(); - - if(btid < 16){ - dev_tmp[iMCW * col*Zc + get_group_id(0)*16+btid] = 0; - for(int i = 0; i < 8; i++){ - dev_tmp[iMCW * col*Zc + get_group_id(0)*16+btid] += tmp[btid*8+i]; - } - } -} - diff --git a/openair1/PHY/CODING/nrLDPC_load.c b/openair1/PHY/CODING/nrLDPC_load.c index 23e5032bad..3049070cd6 100644 --- a/openair1/PHY/CODING/nrLDPC_load.c +++ b/openair1/PHY/CODING/nrLDPC_load.c @@ -46,14 +46,14 @@ static loader_shlibfunc_t shlib_fdesc[3]; /* arguments used when called from phy simulators exec's which do not use the config module */ /* arg is used to initialize the config module so that the loader works as expected */ -char *arg[64]={"ldpctest","-O","cmdlineonly::dbgl0",NULL,NULL}; +char *arg[64]={"ldpctest",NULL}; int load_nrLDPClib(char *version) { char *ptr = (char*)config_get_if(); char libname[64]="ldpc"; if ( ptr==NULL ) {// phy simulators, config module possibly not loaded - load_configmodule(0,(char **)NULL,CONFIG_ENABLECMDLINEONLY) ; + load_configmodule(1,arg,CONFIG_ENABLECMDLINEONLY) ; logInit(); } shlib_fdesc[0].fname = "nrLDPC_decod"; diff --git a/openair1/PHY/INIT/nr_parms.c b/openair1/PHY/INIT/nr_parms.c index 347155ed3b..0c0d38ea0b 100644 --- a/openair1/PHY/INIT/nr_parms.c +++ b/openair1/PHY/INIT/nr_parms.c @@ -250,7 +250,7 @@ int nr_init_frame_parms(nfapi_nr_config_request_scf_t* cfg, int Ncp = NFAPI_CP_NORMAL; int mu = cfg->ssb_config.scs_common.value; -#if DISABLE_LOG_X +#if PHYSIM printf("Initializing frame parms for mu %d, N_RB %d, Ncp %d\n",mu, fp->N_RB_DL, Ncp); #else LOG_I(PHY,"Initializing frame parms for mu %d, N_RB %d, Ncp %d\n",mu, fp->N_RB_DL, Ncp); @@ -343,7 +343,7 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp, AssertFatal(fp->ul_CarrierFreq == (fp->dl_CarrierFreq + uplink_frequency_offset), "Disagreement in uplink frequency for band %d: ul_CarrierFreq = %lu Hz vs expected %lu Hz\n", fp->nr_band, fp->ul_CarrierFreq, fp->dl_CarrierFreq + uplink_frequency_offset); -#if DISABLE_LOG_X +#if PHYSIM printf("Initializing UE frame parms for mu %d, N_RB %d, Ncp %d\n",fp->numerology_index, fp->N_RB_DL, Ncp); #else LOG_I(PHY,"Initializing frame parms for mu %d, N_RB %d, Ncp %d\n",fp->numerology_index, fp->N_RB_DL, Ncp); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index 0894ae9166..31b3f8896a 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -379,13 +379,10 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, len = (pilots==1)? ((config_type==NFAPI_NR_DMRS_TYPE1)?nb_rb*(12-6*dlsch0_harq->n_dmrs_cdm_groups): nb_rb*(12-4*dlsch0_harq->n_dmrs_cdm_groups)):(nb_rb*12); stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d type %d: Pilot/Data extraction %5.2f \n", - frame,nr_slot_rx,slot,symbol,type,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else - LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d type %d: Pilot/Data extraction %5.2f \n", - frame,nr_slot_rx,slot,symbol,type,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#endif + if (cpumeas(CPUMEAS_GETSTATE)) + LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d type %d: Pilot/Data extraction %5.2f \n", + frame,nr_slot_rx,slot,symbol,type,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); + start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); n_tx = dlsch0_harq->Nl; @@ -402,11 +399,9 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, nb_rb_pdsch); stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else + if (cpumeas(CPUMEAS_GETSTATE)) LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#endif + start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); if (first_symbol_flag==1) { if (beamforming_mode==0){ @@ -463,11 +458,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, #endif stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else - LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#endif + if (cpumeas(CPUMEAS_GETSTATE)) + LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); // Now channel compensation @@ -515,11 +507,9 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, } stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else - LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#endif + if (cpumeas(CPUMEAS_GETSTATE)) + LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); + start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); if (frame_parms->nb_antennas_rx > 1) { @@ -574,11 +564,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, } stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else - LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#endif + if (cpumeas(CPUMEAS_GETSTATE)) + LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); /* Store the valid DL RE's */ pdsch_vars[gNB_id]->dl_valid_re[symbol-1] = len; @@ -657,11 +644,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, } stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else - LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#endif + if (cpumeas(CPUMEAS_GETSTATE)) + LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); // Please keep it: useful for debugging #ifdef DEBUG_PDSCH_RX diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index 767edf9cc6..44e103e90e 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -353,7 +353,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, if( (abs(ue->common_vars.freq_offset) > 150) && (ret == 0) ) { ret=-1; -#if DISABLE_LOG_X +#if PHYSIM printf("Ignore MIB with high freq offset [%d Hz] estimation \n",ue->common_vars.freq_offset); #else LOG_E(HW, "Ignore MIB with high freq offset [%d Hz] estimation \n",ue->common_vars.freq_offset); @@ -363,7 +363,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, if (ret==0) { // PBCH found so indicate sync to higher layers and configure frame parameters //#ifdef DEBUG_INITIAL_SYNCH -#if DISABLE_LOG_X +#if PHYSIM printf("[UE%d] In synch, rx_offset %d samples\n",ue->Mod_id, ue->rx_offset); #else LOG_I(PHY, "[UE%d] In synch, rx_offset %d samples\n",ue->Mod_id, ue->rx_offset); diff --git a/openair1/PHY/TOOLS/time_meas.c b/openair1/PHY/TOOLS/time_meas.c index 1b62687f7e..353f170434 100644 --- a/openair1/PHY/TOOLS/time_meas.c +++ b/openair1/PHY/TOOLS/time_meas.c @@ -51,24 +51,7 @@ double get_cpu_freq_GHz(void) return cpu_freq_GHz; } -int cpumeas(int action) -{ - switch (action) { - case CPUMEAS_ENABLE: - opp_enabled = 1; - break; - case CPUMEAS_DISABLE: - opp_enabled = 0; - break; - - case CPUMEAS_GETSTATE: - default: - break; - } - - return opp_enabled; -} void print_meas_now(time_stats_t *ts, const char *name, diff --git a/openair1/PHY/TOOLS/time_meas.h b/openair1/PHY/TOOLS/time_meas.h index bb2bb3d276..56d8299470 100644 --- a/openair1/PHY/TOOLS/time_meas.h +++ b/openair1/PHY/TOOLS/time_meas.h @@ -115,7 +115,24 @@ static inline uint32_t rdtsc_oai(void) { #define CPUMEAS_DISABLE 0 #define CPUMEAS_ENABLE 1 #define CPUMEAS_GETSTATE 2 -int cpumeas(int action); +static inline int cpumeas(int action) { + switch (action) { + case CPUMEAS_ENABLE: + opp_enabled = 1; + break; + + case CPUMEAS_DISABLE: + opp_enabled = 0; + break; + + case CPUMEAS_GETSTATE: + default: + break; + } + + return opp_enabled; +} + static inline void start_meas(time_stats_t *ts) { if (opp_enabled) { if (ts->meas_flag==0) { From 25e20db71fb0bbd268fec16c710de08cb3e4a86e Mon Sep 17 00:00:00 2001 From: frtabu Date: Tue, 23 Nov 2021 17:24:44 +0100 Subject: [PATCH 022/107] ldpc openCL doc update --- openair1/PHY/CODING/DOC/LDPCImplementation.md | 44 ++++++++++++++----- 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/openair1/PHY/CODING/DOC/LDPCImplementation.md b/openair1/PHY/CODING/DOC/LDPCImplementation.md index c5411540b6..a82c204074 100644 --- a/openair1/PHY/CODING/DOC/LDPCImplementation.md +++ b/openair1/PHY/CODING/DOC/LDPCImplementation.md @@ -24,12 +24,33 @@ loading `libldpc_cl.so` instead of `libldpc.so`: `make ldpc_cl` -`cp ../../../openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_kernels_CL.cl` +This command creates the `libldpc_cl.so` shared library. To perform this build successfully, only the OpenCL header `(/usr/include/CL/opencl.h)` and library `(/usr/lib/x86_64-linux-gnu/libOpenCL.so)`are required, they implement OpenCL API support which is not hardware dependent. + +``` +Scanning dependencies of target nrLDPC_decoder_kernels_CL +Built target nrLDPC_decoder_kernels_CL +Scanning dependencies of target ldpc_cl +Building C object CMakeFiles/ldpc_cl.dir/usr/local/oai/oai-develop/openairinterface5g/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_CL.c.o +In file included from /usr/include/CL/cl.h:32, + from /usr/include/CL/opencl.h:38, + from /usr/local/oai/oai-develop/openairinterface5g/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_CL.c:49: +/usr/include/CL/cl_version.h:34:9: note: #pragma message: cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 220 (OpenCL 2.2) + #pragma message("cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 220 (OpenCL 2.2)") + ^~~~~~~ + +Building C object CMakeFiles/ldpc_cl.dir/usr/local/oai/oai-develop/openairinterface5g/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c.o +Linking C shared module libldpc_cl.so +Built target ldpc_cl + +``` + +At runtime, to successfully use hardware acceleration via OpenCL, you need to install vendor specific packages which deliver the required drivers and tools to make use of their GPU (Nvidia, Intel...) , fpga (Xilinx, Intel) or CPU (Intel, AMD, ARM...) through OpenCL. `./nr-softmodem -O libconfig:gnb.band78.sa.fr1.106PRB.usrpb210.conf:dbgl5 --rfsim --rfsimulator.serveraddr server --sa --log_config.gtpu_log_level info --loader.ldpc.shlibversion _cl` -``` [LOADER] library libldpc_cl.so successfully loaded +``` ------------------------------------------------ +[LOADER] library libldpc_cl.so successfully loaded [HW] Platform 0, OpenCL profile FULL_PROFILE [HW] Platform 0, OpenCL version OpenCL 2.1 LINUX [HW] Device 0 is available @@ -62,8 +83,9 @@ loading `libldpc_cl.so` instead of `libldpc.so`: `./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --sa -O libconfig:/usr/local/oai/conf/nrue_sim.conf:dbgl5 --nokrnmod --loader.ldpc.shlibversion _cl --log_config.hw_log_level info` -```[CONFIG] shlibversion set to _cl from command line +``` ............................................................ +[CONFIG] shlibversion set to _cl from command line [CONFIG] loader.ldpc 1 options set from command line [LOADER] library libldpc_cl.so successfully loaded [HW] Platform 0, OpenCL profile FULL_PROFILE @@ -94,7 +116,6 @@ loading `libldpc_cl.so` instead of `libldpc.so`: [HW] Device 0, max Work Items size for dimension: 1 512 [HW] Device 0, max Work Items size for dimension: 2 512 ------------------------------------------------------------ -​``` ``` A mechanism to select ldpc implementation is also available in the `ldpctest` phy simulator via the `-v`option, which can be used to specify the version of the ldpc shared library to be used. @@ -103,7 +124,9 @@ A mechanism to select ldpc implementation is also available in the `ldpctest` ph Loading libldpc_cuda.so, the cuda implementation of the ldpc decoder: -```$ ./ldpctest -v _cuda +``` +$ ./ldpctest -v _cuda +ldpctest -v _cuda Initializing random number generator, seed 0 block length 8448: n_trials 1: @@ -119,18 +142,16 @@ log init done [CONFIG] loader.ldpc: 1/2 parameters successfully set [LOADER] library libldpc_cuda.so successfully loaded ................................... -​``` ``` + Loading libldpc_cl.so, the opencl implementation of the ldpc decoder: `make ldpc_cl` -`cp ../../../openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_kernels_CL.cl` -`./ldpctest -v _cl` - -```$ ./ldpctest -v _cl +``` +$ ./ldpctest -v _cl Initializing random number generator, seed 0 block length 8448: n_trials 1: @@ -164,7 +185,6 @@ log init done [HW] Device 0, max Work Items size for dimension: 1 512 [HW] Device 0, max Work Items size for dimension: 2 512 ................................ -​``` ``` @@ -174,6 +194,6 @@ Libraries implementing the LDPC algorithms must be named `libldpc<_version>.so`, `libldpc_cuda.so`has been tested with the `ldpctest` executable, usage from the softmodem's has to be tested. -`libldpc_cl`is under development. +`libldpc_cl.so`is under development. [oai Wikis home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home) From ada154f852c368d15298bb7d85bb39d8139967a6 Mon Sep 17 00:00:00 2001 From: hardy Date: Tue, 4 Jan 2022 15:15:28 +0100 Subject: [PATCH 023/107] add ping png to artifacts --- ci-scripts/cls_oaicitest.py | 8 +++++++- ci-scripts/ran.py | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 799e5283c4..310b71f8c0 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -103,17 +103,23 @@ def GetPingTimeAnalysis(ping_log_file,ping_rttavg_threshold): axis.set_xlabel('Ping Events') axis.set_ylabel("Ping RTT (in ms)") axis.set_title(ping_log_file) + axis.set_xticks(ticks) + axis.set_xticklabels([]) YMAX=20 #base scale if max(t_ping) > YMAX: y_max=max(t_ping)+1 else: y_max=YMAX+1 plt.ylim(0,y_max) - th_label="Ping Fail Threshold="+ping_rttavg_threshold + th_label="AVG Ping Fail Threshold="+ping_rttavg_threshold plt.axhline(y=float(ping_rttavg_threshold), color='r', linestyle='-',label=th_label) axis.legend() plt.savefig(ping_log_file+'.png') + #copy the png file already to enb to move it move it later into the artifacts + mySSH = sshconnection.SSHConnection() + mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, ping_log_file+'.png', self.eNBSourceCodePath + '/cmake_targets/') + return ping_stat else: diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 95066d168d..32913f1ad0 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -738,8 +738,8 @@ class RANManagement(): mySSH.command('echo ' + self.eNBPassword + ' | sudo -S mv /tmp/enb_*.pcap .','\$',20) mySSH.command('echo ' + self.eNBPassword + ' | sudo -S mv /tmp/gnb_*.pcap .','\$',20) mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm -f enb.log.zip', '\$', 5) - mySSH.command('echo ' + self.eNBPassword + ' | sudo -S zip enb.log.zip enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png log/*/*.log log/*/*.pcap', '\$', 60) - mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png log/*/*.log log/*/*.pcap', '\$', 15) + mySSH.command('echo ' + self.eNBPassword + ' | sudo -S zip enb.log.zip enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png ping*.log.png log/*/*.log log/*/*.pcap', '\$', 60) + mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png ping*.log.png log/*/*.log log/*/*.pcap', '\$', 15) mySSH.close() def AnalyzeLogFile_eNB(self, eNBlogFile, HTML): From 683072f4133c45306b1ed051e16b3e4e42bb152a Mon Sep 17 00:00:00 2001 From: frtabu Date: Wed, 24 Nov 2021 11:00:05 +0100 Subject: [PATCH 024/107] Fix time measurment LOGS in phy_procedures_nr_UE.c --- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 49 +++++++++++---------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 850b41d2fb..3b4c3657df 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -844,7 +844,8 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int gNB_ } else AssertFatal(1==0,"Not RA_PDSCH, SI_PDSCH or PDSCH\n"); stop_meas(&ue->dlsch_llr_stats_parallelization[proc->thread_id][slot]); - LOG_D(PHY, "[AbsSFN %d.%d] LLR Computation Symbol %d %5.2f \n",frame_rx,nr_slot_rx,m,ue->dlsch_llr_stats_parallelization[proc->thread_id][slot].p_time/(cpuf*1000.0)); + if (cpumeas(CPUMEAS_GETSTATE)) + LOG_D(PHY, "[AbsSFN %d.%d] LLR Computation Symbol %d %5.2f \n",frame_rx,nr_slot_rx,m,ue->dlsch_llr_stats_parallelization[proc->thread_id][slot].p_time/(cpuf*1000.0)); if(first_symbol_flag) { proc->first_symbol_available = 1; @@ -1024,10 +1025,13 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); - LOG_D(PHY, " --> Unscrambling for CW0 %5.3f\n", - (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); - LOG_D(PHY, "AbsSubframe %d.%d --> LDPC Decoding for CW0 %5.3f\n", - frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); + + if (cpumeas(CPUMEAS_GETSTATE)) { + LOG_D(PHY, " --> Unscrambling for CW0 %5.3f\n", + (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); + LOG_D(PHY, "AbsSubframe %d.%d --> LDPC Decoding for CW0 %5.3f\n", + frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); + } if(is_cw1_active) { // start ldpc decode for CW 1 @@ -1079,16 +1083,13 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, LOG_T(PHY,"CWW sequential dlsch decoding, ret1 = %d\n", ret1); } - - stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); - - LOG_D(PHY, " --> Unscrambling for CW1 %5.3f\n", - (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); - LOG_D(PHY, "AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n", - frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); - LOG_D(PHY,"AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n", - frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); - + stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); + if (cpumeas(CPUMEAS_GETSTATE)) { + LOG_D(PHY, " --> Unscrambling for CW1 %5.3f\n", + (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); + LOG_D(PHY, "AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n", + frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); + } LOG_D(PHY, "harq_pid: %d, TBS expected dlsch1: %d \n", harq_pid, dlsch1->harq_processes[harq_pid]->TBS); } @@ -1394,8 +1395,8 @@ void *UE_thread_slot1_dl_processing(void *arg) { stop_meas(&ue->ue_front_end_per_slot_stat[proc->thread_id][1]); - LOG_D(PHY, "[AbsSFN %d.%d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",frame_rx,nr_slot_rx,ue->ue_front_end_per_slot_stat[proc->thread_id][1].p_time/(cpuf*1000.0)); - + if (cpumeas(CPUMEAS_GETSTATE)) + LOG_D(PHY, "[AbsSFN %d.%d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",frame_rx,nr_slot_rx,ue->ue_front_end_per_slot_stat[proc->thread_id][1].p_time/(cpuf*1000.0)); //wait until pdcch is decoded uint32_t wait = 0; @@ -1484,7 +1485,8 @@ void *UE_thread_slot1_dl_processing(void *arg) { //printf("Set available LLR slot1 to 1 AbsSubframe %d.%d \n",frame_rx,nr_slot_rx); stop_meas(&ue->pdsch_procedures_per_slot_stat[proc->thread_id][1]); - LOG_D(PHY, "[AbsSFN %d.%d] Slot1: LLR Computation %5.2f \n",frame_rx,nr_slot_rx,ue->pdsch_procedures_per_slot_stat[proc->thread_id][1].p_time/(cpuf*1000.0)); + if (cpumeas(CPUMEAS_GETSTATE)) + LOG_D(PHY, "[AbsSFN %d.%d] Slot1: LLR Computation %5.2f \n",frame_rx,nr_slot_rx,ue->pdsch_procedures_per_slot_stat[proc->thread_id][1].p_time/(cpuf*1000.0)); if (pthread_mutex_lock(&proc->mutex_slot1_dl_processing) != 0) { LOG_E( PHY, "[SCHED][UE] error locking mutex for UE RXTX\n" ); @@ -1853,9 +1855,10 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, dlsch_parallel); stop_meas(&ue->dlsch_procedures_stat[proc->thread_id]); - LOG_D(PHY, "[SFN %d] Slot1: Pdsch Proc %5.2f\n",nr_slot_rx,ue->pdsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); - LOG_D(PHY, "[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",nr_slot_rx,ue->dlsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); - + if (cpumeas(CPUMEAS_GETSTATE)) { + LOG_D(PHY, "[SFN %d] Slot1: Pdsch Proc %5.2f\n",nr_slot_rx,ue->pdsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); + LOG_D(PHY, "[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",nr_slot_rx,ue->dlsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); + } // deactivate dlsch once dlsch proc is done ue->dlsch[proc->thread_id][gNB_id][0]->active = 0; @@ -1939,8 +1942,8 @@ phy_procedures_emos_UE_RX(ue,slot,gNB_id); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT); stop_meas(&ue->phy_proc_rx[proc->thread_id]); -LOG_D(PHY, "------FULL RX PROC [SFN %d]: %5.2f ------\n",nr_slot_rx,ue->phy_proc_rx[proc->thread_id].p_time/(cpuf*1000.0)); - +if (cpumeas(CPUMEAS_GETSTATE)) + LOG_D(PHY, "------FULL RX PROC [SFN %d]: %5.2f ------\n",nr_slot_rx,ue->phy_proc_rx[proc->thread_id].p_time/(cpuf*1000.0)); //#endif //pdsch LOG_D(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, nr_slot_rx); From fefa42c889ac8d52e28a86b0ad27e3da090dfd33 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Fri, 3 Dec 2021 18:13:52 +0100 Subject: [PATCH 025/107] phy simulators remove measurments printf and check/allow log level config --- openair1/PHY/CODING/TESTBENCH/ldpctest.c | 18 ++++++++++++++---- .../NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 6 +++--- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 15 ++++++++------- openair1/SIMULATION/NR_PHY/dlsim.c | 1 + openair1/SIMULATION/NR_PHY/ulsim.c | 3 ++- 5 files changed, 28 insertions(+), 15 deletions(-) diff --git a/openair1/PHY/CODING/TESTBENCH/ldpctest.c b/openair1/PHY/CODING/TESTBENCH/ldpctest.c index aff707a1d5..371deba3f2 100644 --- a/openair1/PHY/CODING/TESTBENCH/ldpctest.c +++ b/openair1/PHY/CODING/TESTBENCH/ldpctest.c @@ -514,7 +514,7 @@ int main(int argc, char *argv[]) unsigned char qbits=8; unsigned int decoded_errors[10000]; // initiate the size of matrix equivalent to size of SNR int c,i=0, i1 = 0; - + int loglvl=OAILOG_WARNING; int n_trials = 1; double SNR_step = 0.1; @@ -525,8 +525,11 @@ int main(int argc, char *argv[]) n_iter_stats_t dec_iter[3]; short BG=0,Zc,Kb=0; - - while ((c = getopt (argc, argv, "q:r:s:S:l:G:n:d:i:t:u:hv:")) != -1) + if ( load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) == 0) { + exit_fun(" Error, configuration module init failed\n"); + } // must be done before specific options parsing to prevent errasing them + + while ((c = getopt (argc, argv, "q:r:s:S:l:L:G:n:d:i:t:u:hv:")) != -1) switch (c) { case 'q': @@ -544,6 +547,10 @@ int main(int argc, char *argv[]) case 'l': block_length = atoi(optarg); break; + + case 'L': + loglvl = atoi(optarg); + break; case 'G': ldpc_version="_cuda"; @@ -581,10 +588,11 @@ int main(int argc, char *argv[]) printf("BG1 (blocklength > 3840): 1/3, 2/3, 22/25 (8/9) \n"); printf("BG2 (blocklength <= 3840): 1/5, 1/3, 2/3 \n\n"); printf("-h This message\n"); + printf("-L \n"); printf("-q Quantization bits, Default: 8\n"); printf("-r Nominator rate, (1, 2, 22), Default: 1\n"); printf("-d Denominator rate, (3, 5, 25), Default: 1\n"); - printf("-l Block length (l > 3840 -> BG1, rest BG2 ), Default: 8448\n"); + printf("-l Block length (l > 3840 -> BG1, rest BG2 ), Default: 8448\n"); printf("-G give 1 to run cuda for LDPC, Default: 0\n"); printf("-n Number of simulation trials, Default: 1\n"); //printf("-M MCS2 for TB 2\n"); @@ -603,6 +611,8 @@ int main(int argc, char *argv[]) printf("n_trials %d: \n", n_trials); printf("SNR0 %f: \n", SNR0); + logInit(); + set_glog(loglvl); if (ldpc_version != NULL) load_nrLDPClib(ldpc_version); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index 31b3f8896a..1e031d531c 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -399,8 +399,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, nb_rb_pdsch); stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); - if (cpumeas(CPUMEAS_GETSTATE)) - LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); + if (cpumeas(CPUMEAS_GETSTATE)) + LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); if (first_symbol_flag==1) { @@ -509,7 +509,6 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); if (cpumeas(CPUMEAS_GETSTATE)) LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); - start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); if (frame_parms->nb_antennas_rx > 1) { @@ -566,6 +565,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); if (cpumeas(CPUMEAS_GETSTATE)) LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); + start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); /* Store the valid DL RE's */ pdsch_vars[gNB_id]->dl_valid_re[symbol-1] = len; diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 3b4c3657df..b65cb333f7 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1025,7 +1025,6 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); - if (cpumeas(CPUMEAS_GETSTATE)) { LOG_D(PHY, " --> Unscrambling for CW0 %5.3f\n", (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); @@ -1083,12 +1082,12 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, LOG_T(PHY,"CWW sequential dlsch decoding, ret1 = %d\n", ret1); } - stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); + stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); if (cpumeas(CPUMEAS_GETSTATE)) { - LOG_D(PHY, " --> Unscrambling for CW1 %5.3f\n", - (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); - LOG_D(PHY, "AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n", - frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); + LOG_D(PHY, " --> Unscrambling for CW1 %5.3f\n", + (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); + LOG_D(PHY, "AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n", + frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); } LOG_D(PHY, "harq_pid: %d, TBS expected dlsch1: %d \n", harq_pid, dlsch1->harq_processes[harq_pid]->TBS); } @@ -1859,7 +1858,6 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, LOG_D(PHY, "[SFN %d] Slot1: Pdsch Proc %5.2f\n",nr_slot_rx,ue->pdsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); LOG_D(PHY, "[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",nr_slot_rx,ue->dlsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); } - // deactivate dlsch once dlsch proc is done ue->dlsch[proc->thread_id][gNB_id][0]->active = 0; @@ -1933,6 +1931,8 @@ if (nr_slot_rx==9) { } stop_meas(&ue->generic_stat); +if (cpumeas(CPUMEAS_GETSTATE)) + LOG_D(PHY,"after tubo until end of Rx %5.2f \n",ue->generic_stat.p_time/(cpuf*1000.0)); #ifdef EMOS phy_procedures_emos_UE_RX(ue,slot,gNB_id); @@ -1944,6 +1944,7 @@ VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDUR stop_meas(&ue->phy_proc_rx[proc->thread_id]); if (cpumeas(CPUMEAS_GETSTATE)) LOG_D(PHY, "------FULL RX PROC [SFN %d]: %5.2f ------\n",nr_slot_rx,ue->phy_proc_rx[proc->thread_id].p_time/(cpuf*1000.0)); + //#endif //pdsch LOG_D(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, nr_slot_rx); diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index fa868a6896..80d1a512b1 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -645,6 +645,7 @@ int main(int argc, char **argv) printf("%s -h(elp) -p(extended_prefix) -N cell_id -f output_filename -F input_filename -g channel_model -n n_frames -t Delayspread -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant -i Intefrence0 -j Interference1 -A interpolation_file -C(alibration offset dB) -N CellId\n", argv[0]); printf("-h This message\n"); + printf("-L \n"); //printf("-p Use extended prefix mode\n"); //printf("-d Use TDD\n"); printf("-n Number of frames to simulate\n"); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 97c753d455..9be5a18805 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -600,6 +600,7 @@ int main(int argc, char **argv) //printf("-C Generate Calibration information for Abstraction (effective SNR adjustment to remove Pe bias w.r.t. AWGN)\n"); printf("-F Input filename (.txt format) for RX conformance testing\n"); printf("-G Offset of samples to read from file (0 default)\n"); + printf("-L \n"); printf("-M Multiple SSB positions in burst\n"); printf("-N Nid_cell\n"); printf("-O oversampling factor (1,2,4,8,16)\n"); @@ -640,7 +641,7 @@ int main(int argc, char **argv) else if (N_RB_UL == 106) bandwidth = 40; else if (N_RB_UL == 32) bandwidth = 50; else { printf("Add N_RB_UL %d\n",N_RB_UL); exit(-1); } - + LOG_I( PHY,"++++++++++++++++++++++++++++++++++++++++++++++%i+++++++++++++++++++++++++++++++++++++++++",loglvl); if (openair0_cfg[0].threequarter_fs == 1) sampling_frequency*=.75; UE2gNB = new_channel_desc_scm(n_tx, n_rx, channel_model, From 883964c7daf2ebb34649d17baac123d8323fb226 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Tue, 7 Dec 2021 10:42:46 +0100 Subject: [PATCH 026/107] remove remaining printf under PHYSIM build option --- openair1/PHY/INIT/nr_parms.c | 11 +++-------- openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 10 ++-------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/openair1/PHY/INIT/nr_parms.c b/openair1/PHY/INIT/nr_parms.c index 0c0d38ea0b..35bc28d9c1 100644 --- a/openair1/PHY/INIT/nr_parms.c +++ b/openair1/PHY/INIT/nr_parms.c @@ -250,11 +250,9 @@ int nr_init_frame_parms(nfapi_nr_config_request_scf_t* cfg, int Ncp = NFAPI_CP_NORMAL; int mu = cfg->ssb_config.scs_common.value; -#if PHYSIM - printf("Initializing frame parms for mu %d, N_RB %d, Ncp %d\n",mu, fp->N_RB_DL, Ncp); -#else + LOG_I(PHY,"Initializing frame parms for mu %d, N_RB %d, Ncp %d\n",mu, fp->N_RB_DL, Ncp); -#endif + if (Ncp == NFAPI_CP_EXTENDED) AssertFatal(mu == NR_MU_2,"Invalid cyclic prefix %d for numerology index %d\n", Ncp, mu); @@ -343,11 +341,8 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp, AssertFatal(fp->ul_CarrierFreq == (fp->dl_CarrierFreq + uplink_frequency_offset), "Disagreement in uplink frequency for band %d: ul_CarrierFreq = %lu Hz vs expected %lu Hz\n", fp->nr_band, fp->ul_CarrierFreq, fp->dl_CarrierFreq + uplink_frequency_offset); -#if PHYSIM - printf("Initializing UE frame parms for mu %d, N_RB %d, Ncp %d\n",fp->numerology_index, fp->N_RB_DL, Ncp); -#else LOG_I(PHY,"Initializing frame parms for mu %d, N_RB %d, Ncp %d\n",fp->numerology_index, fp->N_RB_DL, Ncp); -#endif + if (Ncp == NFAPI_CP_EXTENDED) AssertFatal(fp->numerology_index == NR_MU_2,"Invalid cyclic prefix %d for numerology index %d\n", Ncp, fp->numerology_index); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index 44e103e90e..2963ad5010 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -353,21 +353,15 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, if( (abs(ue->common_vars.freq_offset) > 150) && (ret == 0) ) { ret=-1; -#if PHYSIM - printf("Ignore MIB with high freq offset [%d Hz] estimation \n",ue->common_vars.freq_offset); -#else LOG_E(HW, "Ignore MIB with high freq offset [%d Hz] estimation \n",ue->common_vars.freq_offset); -#endif }*/ if (ret==0) { // PBCH found so indicate sync to higher layers and configure frame parameters //#ifdef DEBUG_INITIAL_SYNCH -#if PHYSIM - printf("[UE%d] In synch, rx_offset %d samples\n",ue->Mod_id, ue->rx_offset); -#else + LOG_I(PHY, "[UE%d] In synch, rx_offset %d samples\n",ue->Mod_id, ue->rx_offset); -#endif + //#endif if (ue->UE_scan_carrier == 0) { From 52fc3ff5a54a61aa4391bd5839da42c93c1bbcf2 Mon Sep 17 00:00:00 2001 From: frtabu Date: Thu, 9 Dec 2021 14:41:06 +0100 Subject: [PATCH 027/107] Switch loglvl to ARNING by default as for other simulators --- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- openair1/SIMULATION/NR_PHY/ulsim.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 80d1a512b1..9ba165f55f 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -400,7 +400,7 @@ int main(int argc, char **argv) NR_UE_MAC_INST_t *UE_mac; int cyclic_prefix_type = NFAPI_CP_NORMAL; int run_initial_sync=0; - int loglvl=OAILOG_INFO; + int loglvl=OAILOG_WARNING; //float target_error_rate = 0.01; int css_flag=0; diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 9be5a18805..dcb1849ced 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -272,7 +272,7 @@ int main(int argc, char **argv) //unsigned char frame_type = 0; NR_DL_FRAME_PARMS *frame_parms; - int loglvl = OAILOG_INFO; + int loglvl = OAILOG_WARNING; //uint64_t SSB_positions=0x01; uint16_t nb_symb_sch = 12; int start_symbol = 0; From caf4035286cfc625b91e8c79874fbf24f135fa9c Mon Sep 17 00:00:00 2001 From: frtabu Date: Wed, 24 Nov 2021 11:00:05 +0100 Subject: [PATCH 028/107] Fix time measurment LOGS in phy_procedures_nr_UE.c --- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index b65cb333f7..30480b89d9 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1025,12 +1025,12 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); - if (cpumeas(CPUMEAS_GETSTATE)) { - LOG_D(PHY, " --> Unscrambling for CW0 %5.3f\n", - (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); - LOG_D(PHY, "AbsSubframe %d.%d --> LDPC Decoding for CW0 %5.3f\n", - frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); - } + if (cpumeas(CPUMEAS_GETSTATE)) { + LOG_D(PHY, " --> Unscrambling for CW0 %5.3f\n", + (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); + LOG_D(PHY, "AbsSubframe %d.%d --> LDPC Decoding for CW0 %5.3f\n", + frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); + } if(is_cw1_active) { // start ldpc decode for CW 1 From 4f7936565a23fc4ff0cff6793a3020f60d3c42fc Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Fri, 3 Dec 2021 18:13:52 +0100 Subject: [PATCH 029/107] phy simulators remove measurments printf and check/allow log level config --- openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 2 +- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index 1e031d531c..4412115d1e 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -460,7 +460,6 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); if (cpumeas(CPUMEAS_GETSTATE)) LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); - start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); // Now channel compensation if (dlsch0_harq->mimo_modegeneric_stat_bis[proc->thread_id][slot]); if (cpumeas(CPUMEAS_GETSTATE)) LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); + start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); if (frame_parms->nb_antennas_rx > 1) { diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 30480b89d9..9033c432fe 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1858,6 +1858,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, LOG_D(PHY, "[SFN %d] Slot1: Pdsch Proc %5.2f\n",nr_slot_rx,ue->pdsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); LOG_D(PHY, "[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",nr_slot_rx,ue->dlsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); } + // deactivate dlsch once dlsch proc is done ue->dlsch[proc->thread_id][gNB_id][0]->active = 0; From 712f85760bac7f310d38d606fc587039dfd7e8eb Mon Sep 17 00:00:00 2001 From: frtabu Date: Fri, 10 Dec 2021 18:47:26 +0100 Subject: [PATCH 030/107] fix measurment flag enforced in nr_dlsch_decoding.c --- openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 1 - 1 file changed, 1 deletion(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index b8cd59eead..95c451fa1a 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -642,7 +642,6 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, if (LOG_DEBUGFLAG(DEBUG_DLSCH_DECOD)) LOG_I(PHY,"Segmentation: C %d, K %d\n",harq_process->C,harq_process->K); - opp_enabled=1; Kr = harq_process->K; // [hna] overwrites this line "Kr = p_decParams->Z*kb" Kr_bytes = Kr>>3; offset = 0; From 87bb0ffab06720bbd042eac91d113a5578bd898b Mon Sep 17 00:00:00 2001 From: frtabu Date: Wed, 24 Nov 2021 11:00:05 +0100 Subject: [PATCH 031/107] Fix time measurment LOGS in phy_procedures_nr_UE.c --- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 9033c432fe..f2465127aa 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1021,16 +1021,13 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, LOG_D(PHY, "In %s DL PDU length in bits: %d, in bytes: %d \n", __FUNCTION__, dlsch0->harq_processes[harq_pid]->TBS, dlsch0->harq_processes[harq_pid]->TBS / 8); - - - - stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); - if (cpumeas(CPUMEAS_GETSTATE)) { - LOG_D(PHY, " --> Unscrambling for CW0 %5.3f\n", - (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); - LOG_D(PHY, "AbsSubframe %d.%d --> LDPC Decoding for CW0 %5.3f\n", - frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); - } + stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); + if (cpumeas(CPUMEAS_GETSTATE)) { + LOG_D(PHY, " --> Unscrambling for CW0 %5.3f\n", + (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); + LOG_D(PHY, "AbsSubframe %d.%d --> LDPC Decoding for CW0 %5.3f\n", + frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); + } if(is_cw1_active) { // start ldpc decode for CW 1 From 9cd976d6f76cdfd1daaba90b8fc1fd7f440e59cc Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Fri, 3 Dec 2021 18:13:52 +0100 Subject: [PATCH 032/107] phy simulators remove measurments printf and check/allow log level config --- openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 1 + 1 file changed, 1 insertion(+) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index 4412115d1e..b4edae972a 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -460,6 +460,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); if (cpumeas(CPUMEAS_GETSTATE)) LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); + start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); // Now channel compensation if (dlsch0_harq->mimo_mode Date: Fri, 24 Dec 2021 12:23:34 +0100 Subject: [PATCH 033/107] Change obelix N300 IP addresses We suspected a faulty N310 on obelix. It has been replaced with another N300 with the same .10.2 addr, but the mgmt_addr changed to .18.16, corrected in this commit. --- ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf | 2 +- ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf | 2 +- ci-scripts/xml_files/fr1_lte_2x2_quectel.xml | 2 +- ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml | 2 +- ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml | 2 +- ci-scripts/xml_files/fr1_sa_oaiue_n310.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf index d2e91fb872..bc29f1bd37 100644 --- a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf @@ -237,7 +237,7 @@ RUs = ( max_pdschReferenceSignalPower = -27; max_rxgain = 75; eNB_instances = [0]; - sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.20.2,second_addr=192.168.10.2"; + sdr_addrs = "mgmt_addr=192.168.18.16,addr=192.168.10.2"; } ); diff --git a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf index 6c8d5ba6f0..f9d42acaa1 100644 --- a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf @@ -237,7 +237,7 @@ RUs = ( max_pdschReferenceSignalPower = -27; max_rxgain = 75; eNB_instances = [0]; - sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.20.2,second_addr=192.168.10.2"; + sdr_addrs = "mgmt_addr=192.168.18.16,addr=192.168.10.2"; } ); diff --git a/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml b/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml index 4cb6b88a0c..aa500f27de 100644 --- a/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml @@ -65,7 +65,7 @@ lte yes yes - 192.168.18.241 + 192.168.18.16 diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml index 86af12b53e..6018fcd16c 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml @@ -67,7 +67,7 @@ lte yes yes - 192.168.18.241 + 192.168.18.16 diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml index 2d17ff38e2..e56ae2b8cd 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml @@ -87,7 +87,7 @@ lte yes yes - 192.168.18.241 + 192.168.18.16 diff --git a/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml b/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml index 28eee1e224..d6f30c0909 100644 --- a/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml +++ b/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml @@ -42,7 +42,7 @@ Initialize_OAI_UE Initialize OAI UE nr - --sa -O ../../../ci-scripts/conf_files/ue.sa.conf --usrp-args "mgmt_addr=192.168.18.241,addr=192.168.20.2,second_addr=192.168.10.2" --numerology 1 -r 106 --band 78 -C 3319680000 --nokrnmod 1 --ue-txgain 0 --ue-rxgain 70 --ue-fo-compensation + --sa -O ../../../ci-scripts/conf_files/ue.sa.conf --usrp-args "mgmt_addr=192.168.18.16,second_addr=192.168.10.2" --numerology 1 -r 106 --band 78 -C 3319680000 --nokrnmod 1 --ue-txgain 0 --ue-rxgain 70 --ue-fo-compensation From 12a3910e69c27286511e2e9c53140de81c761618 Mon Sep 17 00:00:00 2001 From: frtabu Date: Wed, 24 Nov 2021 11:00:05 +0100 Subject: [PATCH 034/107] Fix time measurment LOGS in phy_procedures_nr_UE.c --- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index f2465127aa..fde3434138 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1391,6 +1391,7 @@ void *UE_thread_slot1_dl_processing(void *arg) { stop_meas(&ue->ue_front_end_per_slot_stat[proc->thread_id][1]); + if (cpumeas(CPUMEAS_GETSTATE)) LOG_D(PHY, "[AbsSFN %d.%d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",frame_rx,nr_slot_rx,ue->ue_front_end_per_slot_stat[proc->thread_id][1].p_time/(cpuf*1000.0)); @@ -1851,6 +1852,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, dlsch_parallel); stop_meas(&ue->dlsch_procedures_stat[proc->thread_id]); + if (cpumeas(CPUMEAS_GETSTATE)) { LOG_D(PHY, "[SFN %d] Slot1: Pdsch Proc %5.2f\n",nr_slot_rx,ue->pdsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); LOG_D(PHY, "[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",nr_slot_rx,ue->dlsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); @@ -1940,6 +1942,7 @@ phy_procedures_emos_UE_RX(ue,slot,gNB_id); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT); stop_meas(&ue->phy_proc_rx[proc->thread_id]); + if (cpumeas(CPUMEAS_GETSTATE)) LOG_D(PHY, "------FULL RX PROC [SFN %d]: %5.2f ------\n",nr_slot_rx,ue->phy_proc_rx[proc->thread_id].p_time/(cpuf*1000.0)); From 379d17a5d977c8e7fadccb7e94b7722440b49340 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Fri, 3 Dec 2021 18:13:52 +0100 Subject: [PATCH 035/107] phy simulators remove measurments printf and check/allow log level config --- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index fde3434138..d524d7713f 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1078,19 +1078,15 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, LOG_T(PHY,"CWW sequential dlsch decoding, ret1 = %d\n", ret1); } - stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); if (cpumeas(CPUMEAS_GETSTATE)) { - LOG_D(PHY, " --> Unscrambling for CW1 %5.3f\n", - (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); - LOG_D(PHY, "AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n", - frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); + LOG_D(PHY, " --> Unscrambling for CW1 %5.3f\n", + (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); + LOG_D(PHY, "AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n", + frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); } - LOG_D(PHY, "harq_pid: %d, TBS expected dlsch1: %d \n", harq_pid, dlsch1->harq_processes[harq_pid]->TBS); + LOG_D(PHY, "harq_pid: %d, TBS expected dlsch1: %d \n", harq_pid, dlsch1->harq_processes[harq_pid]->TBS); } - - LOG_D(PHY," ------ end ldpc decoder for AbsSubframe %d.%d ------ decoded in %d \n", frame_rx, nr_slot_rx, ret); - // send to mac if (ue->if_inst && ue->if_inst->dl_indication) { ue->if_inst->dl_indication(&dl_indication, ul_time_alignment); @@ -1391,7 +1387,6 @@ void *UE_thread_slot1_dl_processing(void *arg) { stop_meas(&ue->ue_front_end_per_slot_stat[proc->thread_id][1]); - if (cpumeas(CPUMEAS_GETSTATE)) LOG_D(PHY, "[AbsSFN %d.%d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",frame_rx,nr_slot_rx,ue->ue_front_end_per_slot_stat[proc->thread_id][1].p_time/(cpuf*1000.0)); From add1293e9bfa2f28f03dc8e01b44c689390f3d49 Mon Sep 17 00:00:00 2001 From: frtabu Date: Wed, 24 Nov 2021 11:00:05 +0100 Subject: [PATCH 036/107] Fix time measurment LOGS in phy_procedures_nr_UE.c --- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index d524d7713f..156aa7fff8 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1847,7 +1847,6 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, dlsch_parallel); stop_meas(&ue->dlsch_procedures_stat[proc->thread_id]); - if (cpumeas(CPUMEAS_GETSTATE)) { LOG_D(PHY, "[SFN %d] Slot1: Pdsch Proc %5.2f\n",nr_slot_rx,ue->pdsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); LOG_D(PHY, "[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",nr_slot_rx,ue->dlsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); @@ -1941,6 +1940,7 @@ stop_meas(&ue->phy_proc_rx[proc->thread_id]); if (cpumeas(CPUMEAS_GETSTATE)) LOG_D(PHY, "------FULL RX PROC [SFN %d]: %5.2f ------\n",nr_slot_rx,ue->phy_proc_rx[proc->thread_id].p_time/(cpuf*1000.0)); + //#endif //pdsch LOG_D(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, nr_slot_rx); From 6d2672d7ba4c47a058dbabdec680d9ee12271f46 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Fri, 3 Dec 2021 18:13:52 +0100 Subject: [PATCH 037/107] phy simulators remove measurments printf and check/allow log level config --- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 156aa7fff8..fb34fc6dd0 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1936,11 +1936,9 @@ phy_procedures_emos_UE_RX(ue,slot,gNB_id); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT); stop_meas(&ue->phy_proc_rx[proc->thread_id]); - if (cpumeas(CPUMEAS_GETSTATE)) LOG_D(PHY, "------FULL RX PROC [SFN %d]: %5.2f ------\n",nr_slot_rx,ue->phy_proc_rx[proc->thread_id].p_time/(cpuf*1000.0)); - //#endif //pdsch LOG_D(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, nr_slot_rx); From aed13183fb8c7d8a57356c0687c19979429d9f6c Mon Sep 17 00:00:00 2001 From: frtabu Date: Wed, 24 Nov 2021 11:00:05 +0100 Subject: [PATCH 038/107] Fix time measurment LOGS in phy_procedures_nr_UE.c --- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index fb34fc6dd0..4ba5cd677d 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1387,6 +1387,7 @@ void *UE_thread_slot1_dl_processing(void *arg) { stop_meas(&ue->ue_front_end_per_slot_stat[proc->thread_id][1]); + if (cpumeas(CPUMEAS_GETSTATE)) LOG_D(PHY, "[AbsSFN %d.%d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",frame_rx,nr_slot_rx,ue->ue_front_end_per_slot_stat[proc->thread_id][1].p_time/(cpuf*1000.0)); @@ -1847,6 +1848,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, dlsch_parallel); stop_meas(&ue->dlsch_procedures_stat[proc->thread_id]); + if (cpumeas(CPUMEAS_GETSTATE)) { LOG_D(PHY, "[SFN %d] Slot1: Pdsch Proc %5.2f\n",nr_slot_rx,ue->pdsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); LOG_D(PHY, "[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",nr_slot_rx,ue->dlsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); @@ -1936,6 +1938,7 @@ phy_procedures_emos_UE_RX(ue,slot,gNB_id); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT); stop_meas(&ue->phy_proc_rx[proc->thread_id]); + if (cpumeas(CPUMEAS_GETSTATE)) LOG_D(PHY, "------FULL RX PROC [SFN %d]: %5.2f ------\n",nr_slot_rx,ue->phy_proc_rx[proc->thread_id].p_time/(cpuf*1000.0)); From 9159e200028068a842483c5fc3d4018f86cf777e Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Fri, 3 Dec 2021 18:13:52 +0100 Subject: [PATCH 039/107] phy simulators remove measurments printf and check/allow log level config --- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 1 - 1 file changed, 1 deletion(-) diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 4ba5cd677d..d524d7713f 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1387,7 +1387,6 @@ void *UE_thread_slot1_dl_processing(void *arg) { stop_meas(&ue->ue_front_end_per_slot_stat[proc->thread_id][1]); - if (cpumeas(CPUMEAS_GETSTATE)) LOG_D(PHY, "[AbsSFN %d.%d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",frame_rx,nr_slot_rx,ue->ue_front_end_per_slot_stat[proc->thread_id][1].p_time/(cpuf*1000.0)); From 6f13d453bfc4ecb4bfb8d1fcd5d660f96d3faf62 Mon Sep 17 00:00:00 2001 From: frtabu Date: Wed, 24 Nov 2021 11:00:05 +0100 Subject: [PATCH 040/107] Fix time measurment LOGS in phy_procedures_nr_UE.c --- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index d524d7713f..0aa6f87233 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1480,6 +1480,7 @@ void *UE_thread_slot1_dl_processing(void *arg) { if (cpumeas(CPUMEAS_GETSTATE)) LOG_D(PHY, "[AbsSFN %d.%d] Slot1: LLR Computation %5.2f \n",frame_rx,nr_slot_rx,ue->pdsch_procedures_per_slot_stat[proc->thread_id][1].p_time/(cpuf*1000.0)); + if (pthread_mutex_lock(&proc->mutex_slot1_dl_processing) != 0) { LOG_E( PHY, "[SCHED][UE] error locking mutex for UE RXTX\n" ); exit_fun("noting to add"); @@ -1847,7 +1848,6 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, dlsch_parallel); stop_meas(&ue->dlsch_procedures_stat[proc->thread_id]); - if (cpumeas(CPUMEAS_GETSTATE)) { LOG_D(PHY, "[SFN %d] Slot1: Pdsch Proc %5.2f\n",nr_slot_rx,ue->pdsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); LOG_D(PHY, "[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",nr_slot_rx,ue->dlsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); @@ -1937,7 +1937,6 @@ phy_procedures_emos_UE_RX(ue,slot,gNB_id); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT); stop_meas(&ue->phy_proc_rx[proc->thread_id]); - if (cpumeas(CPUMEAS_GETSTATE)) LOG_D(PHY, "------FULL RX PROC [SFN %d]: %5.2f ------\n",nr_slot_rx,ue->phy_proc_rx[proc->thread_id].p_time/(cpuf*1000.0)); From a631bb2a58b406c69a022a17b0143b3b20d8bca2 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Fri, 3 Dec 2021 18:13:52 +0100 Subject: [PATCH 041/107] phy simulators remove measurments printf and check/allow log level config --- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 0aa6f87233..af01f4116b 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1078,6 +1078,7 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, LOG_T(PHY,"CWW sequential dlsch decoding, ret1 = %d\n", ret1); } + stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); if (cpumeas(CPUMEAS_GETSTATE)) { LOG_D(PHY, " --> Unscrambling for CW1 %5.3f\n", @@ -1853,6 +1854,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, LOG_D(PHY, "[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",nr_slot_rx,ue->dlsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); } + // deactivate dlsch once dlsch proc is done ue->dlsch[proc->thread_id][gNB_id][0]->active = 0; From 88f67ded26c26a49426819535a23ae3863efc9e4 Mon Sep 17 00:00:00 2001 From: frtabu Date: Wed, 24 Nov 2021 11:00:05 +0100 Subject: [PATCH 042/107] Fix time measurment LOGS in phy_procedures_nr_UE.c --- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index af01f4116b..1054a40807 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1481,7 +1481,6 @@ void *UE_thread_slot1_dl_processing(void *arg) { if (cpumeas(CPUMEAS_GETSTATE)) LOG_D(PHY, "[AbsSFN %d.%d] Slot1: LLR Computation %5.2f \n",frame_rx,nr_slot_rx,ue->pdsch_procedures_per_slot_stat[proc->thread_id][1].p_time/(cpuf*1000.0)); - if (pthread_mutex_lock(&proc->mutex_slot1_dl_processing) != 0) { LOG_E( PHY, "[SCHED][UE] error locking mutex for UE RXTX\n" ); exit_fun("noting to add"); @@ -1849,12 +1848,12 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, dlsch_parallel); stop_meas(&ue->dlsch_procedures_stat[proc->thread_id]); + if (cpumeas(CPUMEAS_GETSTATE)) { LOG_D(PHY, "[SFN %d] Slot1: Pdsch Proc %5.2f\n",nr_slot_rx,ue->pdsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); LOG_D(PHY, "[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",nr_slot_rx,ue->dlsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); } - // deactivate dlsch once dlsch proc is done ue->dlsch[proc->thread_id][gNB_id][0]->active = 0; @@ -1942,6 +1941,7 @@ stop_meas(&ue->phy_proc_rx[proc->thread_id]); if (cpumeas(CPUMEAS_GETSTATE)) LOG_D(PHY, "------FULL RX PROC [SFN %d]: %5.2f ------\n",nr_slot_rx,ue->phy_proc_rx[proc->thread_id].p_time/(cpuf*1000.0)); + //#endif //pdsch LOG_D(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, nr_slot_rx); From 4f5ea3bb6fba92aff8a69cae4b8e497fe994fe7e Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Fri, 3 Dec 2021 18:13:52 +0100 Subject: [PATCH 043/107] phy simulators remove measurments printf and check/allow log level config --- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 1054a40807..9b4f667dbe 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1085,7 +1085,8 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); LOG_D(PHY, "AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n", frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); - } + } + } LOG_D(PHY, "harq_pid: %d, TBS expected dlsch1: %d \n", harq_pid, dlsch1->harq_processes[harq_pid]->TBS); } // send to mac @@ -1848,7 +1849,6 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, dlsch_parallel); stop_meas(&ue->dlsch_procedures_stat[proc->thread_id]); - if (cpumeas(CPUMEAS_GETSTATE)) { LOG_D(PHY, "[SFN %d] Slot1: Pdsch Proc %5.2f\n",nr_slot_rx,ue->pdsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); LOG_D(PHY, "[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",nr_slot_rx,ue->dlsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); From 1dc47e5db11d3504e3141134f623da2c15fe6d08 Mon Sep 17 00:00:00 2001 From: frtabu Date: Thu, 9 Dec 2021 14:41:06 +0100 Subject: [PATCH 044/107] Switch loglvl to ARNING by default as for other simulators --- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 1 - 1 file changed, 1 deletion(-) diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 9b4f667dbe..81e2fa0ad5 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -846,7 +846,6 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int gNB_ stop_meas(&ue->dlsch_llr_stats_parallelization[proc->thread_id][slot]); if (cpumeas(CPUMEAS_GETSTATE)) LOG_D(PHY, "[AbsSFN %d.%d] LLR Computation Symbol %d %5.2f \n",frame_rx,nr_slot_rx,m,ue->dlsch_llr_stats_parallelization[proc->thread_id][slot].p_time/(cpuf*1000.0)); - if(first_symbol_flag) { proc->first_symbol_available = 1; } From a7b6c4bcb0f81e4f46235be4958e14b69c1b73e9 Mon Sep 17 00:00:00 2001 From: frtabu Date: Tue, 4 Jan 2022 18:38:51 +0100 Subject: [PATCH 045/107] fix a warning. fix openCL regression after rebase --- cmake_targets/CMakeLists.txt | 4 +- .../nrLDPC_decoder_kernels_CL.c | 292 ++++++++++++++++++ openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c | 3 +- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 1 - 4 files changed, 295 insertions(+), 5 deletions(-) create mode 100644 openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_kernels_CL.c diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index af3baa2584..3f27379d1d 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1532,8 +1532,8 @@ set(PHY_LDPC_CL_SRC ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c ) add_custom_target( nrLDPC_decoder_kernels_CL - COMMAND gcc ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_kernels_CL.c -dD -DNRLDPC_KERNEL_SOURCE -E -o ${CMAKE_CURRENT_BINARY_DIR}/nrLDPC_decoder_kernels_CL.clc - SOURCES ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_kernels_CL.c + COMMAND gcc ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_CL.c -dD -DNRLDPC_KERNEL_SOURCE -E -o ${CMAKE_CURRENT_BINARY_DIR}/nrLDPC_decoder_kernels_CL.clc + SOURCES ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_CL.c ) set(PHY_NR_CODINGIF diff --git a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_kernels_CL.c b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_kernels_CL.c new file mode 100644 index 0000000000..42b25e41c0 --- /dev/null +++ b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_kernels_CL.c @@ -0,0 +1,292 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file PHY/CODING/nrLDPC_decoder_kernels_CL.cl +* \brief kernel functions for ldpc decoder accelerated via openCL +* \author Francois TABURET +* \date 2021 +* \version 1.0 +* \company Nokia BellLabs France +* \email: francois.taburet@nokia-bell-labs.com +* \note initial implem - translation of cuda version +* \warning +*/ + + +//__global char dev_dt [46*68*384]; +//__local char *dev_t; +//__global char dev_llr[68*384]; +//__global unsigned char dev_tmp[68*384]; + + +#define INT32_MAX 2147483647 + +//__constant h_element dev_h_compact1[46*19] = {}; // used in kernel 1 +//__constant h_element dev_h_compact2[68*30] = {}; // used in kernel 2 + +// __device__ __constantant__ h_element dev_h_compact1[46*19]; // used in kernel 1 +// __device__ __constantant__ h_element dev_h_compact2[68*30]; // used in kernel 2 + +// row and col element count +__constant char h_ele_row_bg1_count[46] = { + 19, 19, 19, 19, 3, 8, 9, 7, 10, 9, + 7, 8, 7, 6, 7, 7, 6, 6, 6, 6, + 6, 6, 5, 5, 6, 5, 5, 4, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 4, 5, 5, + 4, 5, 4, 5, 5, 4}; +__constant char h_ele_col_bg1_count[68] = { + 30, 28, 7, 11, 9, 4, 8, 12, 8, 7, + 12, 10, 12, 11, 10, 7, 10, 10, 13, 7, + 8, 11, 12, 5, 6, 6, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1}; +__constant char h_ele_row_bg2_count[42] = { + 8, 10, 8, 10, 4, 6, 6, 6, 4, 5, + 5, 5, 4, 5, 5, 4, 5, 5, 4, 4, + 4, 4, 3, 4, 4, 3, 5, 3, 4, 3, + 5, 3, 4, 4, 4, 4, 4, 3, 4, 4, + 4, 4}; +__constant char h_ele_col_bg2_count[52] = { + 22, 23, 10, 5, 5, 14, 7, 13, 6, 8, + 9, 16, 9, 12, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1}; + + + +// Kernel 1 +__kernel void ldpc_cnp_kernel_1st_iter( __global char * dev_llr, __global char * dev_dt, __local h_element *dev_h_compact1, int BG, int row, int col, int Zc) +{ +// int iMCW = blockIdx.y; // codeword id +// int iBlkRow = blockIdx.x; // block row in h_base +// int iSubRow = threadIdx.x; // row index in sub_block of h_base +// if(blockIdx.x == 0 && threadIdx.x == 1) printf("cnp %d\n", threadIdx.x); + int iMCW = get_group_id(1); // codeword id + int iBlkRow = get_group_id(0); // block row in h_base + int iBlkCol; // block col in h_base + int iSubRow = get_local_id(0);; // row index in sub_block of h_base + int iCol; // overall col index in h_base + int offsetR; + int shift_t; + +// For 2-min algorithm. + int Q_sign = 0; + int sq; + int Q, Q_abs; + int R_temp; + + int sign = 1; + int rmin1 = INT32_MAX; + int rmin2 = INT32_MAX; + char idx_min = 0; + + h_element h_element_t; + int s = (BG==1)? h_ele_row_bg1_count[iBlkRow]:h_ele_row_bg2_count[iBlkRow]; + offsetR = (iMCW * row*col*Zc) + iBlkRow * Zc + iSubRow; // row*col*Zc = size of dev_dt +// if(blockIdx.x == 0 && threadIdx.x == 1) printf("s: %d, offset %d\n", s, offsetR); +// The 1st recursion + for(int i = 0; i < s; i++) // loop through all the ZxZ sub-blocks in a row + { + h_element_t = dev_h_compact1[i*row+iBlkRow]; // compact_col == row + + iBlkCol = h_element_t.y; + shift_t = h_element_t.value; + + shift_t = (iSubRow + shift_t) % Zc; + iCol = (iMCW * col*Zc) + iBlkCol * Zc + shift_t; // col*Zc = size of llr + Q = dev_llr[iCol]; + Q_abs = (Q>0)? Q : -Q; + sq = Q < 0; +// if(blockIdx.x == 0 && threadIdx.x == 1) printf("i %d, icol %d, Q: %d\n", i, iCol, Q); + // quick version + sign = sign * (1 - sq * 2); + Q_sign |= sq << i; + + if (Q_abs < rmin1){ + rmin2 = rmin1; + rmin1 = Q_abs; + idx_min = i; + } else if (Q_abs < rmin2){ + rmin2 = Q_abs; + } + } + +// if(blockIdx.x == 0 && threadIdx.x == 1)printf("min1 %d, min2 %d, min1_idx %d\n", rmin1, rmin2, idx_min); + +// The 2nd recursion + for(int i = 0; i < s; i++){ + // v0: Best performance so far. 0.75f is the value of alpha. + sq = 1 - 2 * ((Q_sign >> i) & 0x01); + R_temp = 0.75f * sign * sq * (i != idx_min ? rmin1 : rmin2); + // write results to global memory + h_element_t = dev_h_compact1[i*row+iBlkRow]; + int addr_temp = offsetR + h_element_t.y * row * Zc; + dev_dt[addr_temp] = R_temp; +// if(blockIdx.x == 0 && threadIdx.x == 1)printf("R_temp %d, temp_addr %d\n", R_temp, addr_temp); + } +} + +// Kernel_1 +__kernel void ldpc_cnp_kernel( __global char * dev_llr, __global char * dev_dt, __local h_element *dev_h_compact1, int BG, int row, int col, int Zc) +{ +// if(blockIdx.x == 0 && threadIdx.x == 1) printf("cnp\n"); +// int iMCW = blockIdx.y; +// int iBlkRow = blockIdx.x; // block row in h_base // block col in h_base +// int iSubRow = threadIdx.x; // row index in sub_block of h_base + int iMCW = get_group_id(1); + int iBlkRow = get_group_id(0); // block row in h_base + int iBlkCol; // block col in h_base + int iSubRow = get_local_id(0);; // row index in sub_block of h_base + int iCol; // overall col index in h_base + int offsetR; + int shift_t; + +// For 2-min algorithm. + int Q_sign = 0; + int sq; + int Q, Q_abs; + int R_temp; + + int sign = 1; + int rmin1 = INT32_MAX; + int rmin2 = INT32_MAX; + char idx_min = 0; + + h_element h_element_t; + int s = (BG==1)? h_ele_row_bg1_count[iBlkRow]: h_ele_row_bg2_count[iBlkRow]; + offsetR = (iMCW *row*col*Zc) + iBlkRow * Zc + iSubRow; // row * col * Zc = size of dev_dt +// if(blockIdx.x == 0 && threadIdx.x == 1) printf("s: %d, offset %d\n", s, offsetR); +// The 1st recursion + for(int i = 0; i < s; i++) // loop through all the ZxZ sub-blocks in a row + { + h_element_t = dev_h_compact1[i*row+iBlkRow]; + + iBlkCol = h_element_t.y; + shift_t = h_element_t.value; + shift_t = (iSubRow + shift_t) % Zc; + iCol = iBlkCol * Zc + shift_t; + + R_temp = dev_dt[offsetR + iBlkCol * row * Zc]; + + Q = dev_llr[iMCW * (col*Zc) + iCol] - R_temp; + Q_abs = (Q>0)? Q : -Q; +// if(blockIdx.x == 0 && threadIdx.x == 1) printf("i %d, icol %d, Q: %d\n", i, iCol, Q); + sq = Q < 0; + sign = sign * (1 - sq * 2); + Q_sign |= sq << i; + + if (Q_abs < rmin1){ + rmin2 = rmin1; + rmin1 = Q_abs; + idx_min = i; + } else if (Q_abs < rmin2){ + rmin2 = Q_abs; + } + + } + +// if(blockIdx.x == 0 && threadIdx.x == 1)printf("min1 %d, min2 %d, min1_idx %d\n", rmin1, rmin2, idx_min); + +// The 2nd recursion + for(int i = 0; i < s; i ++){ + sq = 1 - 2 * ((Q_sign >> i) & 0x01); + R_temp = 0.75f * sign * sq * (i != idx_min ? rmin1 : rmin2); + + + // write results to global memory + h_element_t = dev_h_compact1[i*row+iBlkRow]; + int addr_temp = h_element_t.y * row * Zc + offsetR; + dev_dt[addr_temp] = R_temp; +// if(blockIdx.x == 0 && threadIdx.x == 1)printf("R_temp %d, temp_addr %d\n", R_temp, addr_temp); + } +} + +// Kernel 2: VNP processing +__kernel void +ldpc_vnp_kernel_normal(__global char * dev_llr, __global char * dev_dt, __global char * dev_const_llr, __local h_element *dev_h_compact2, int BG, int row, int col, int Zc) +{ +// int iMCW = blockIdx.y; +// int iBlkCol = blockIdx.x; +// int iSubCol = threadIdx.x; + int iMCW = get_group_id(1); + int iBlkCol = get_group_id(0); + int iBlkRow; + int iSubCol = get_local_id(0); + int iRow; + int iCol; + + int shift_t, sf; + int APP; + + h_element h_element_t; + + // update all the llr values + iCol = iBlkCol * Zc + iSubCol; + APP = dev_const_llr[iMCW *col*Zc + iCol]; + int offsetDt = iMCW *row*col*Zc + iBlkCol * row * Zc; + int s = (BG==1)? h_ele_col_bg1_count[iBlkCol]:h_ele_col_bg2_count[iBlkCol]; + + for(int i = 0; i < s; i++) + { + h_element_t = dev_h_compact2[i*col+iBlkCol]; + + shift_t = h_element_t.value%Zc; + iBlkRow = h_element_t.x; + + sf = iSubCol - shift_t; + sf = (sf + Zc) % Zc; + + iRow = iBlkRow * Zc + sf; + APP = APP + dev_dt[offsetDt + iRow]; + } + if(APP > SCHAR_MAX) APP = SCHAR_MAX; + if(APP < SCHAR_MIN) APP = SCHAR_MIN; + // write back to device global memory + dev_llr[iMCW *col*Zc + iCol] = APP; +} + + +__kernel void pack_decoded_bit(__global unsigned char * dev_llr, __global unsigned char * dev_tmp, int col, int Zc) +{ +// int iMCW = blockIdx.y; +// int btid = threadIdx.x; + unsigned char tmp[128]; + int iMCW = get_group_id(1); + int btid = get_local_id(0); + int tid = iMCW * col*Zc + get_group_id(0)*128 + btid; + tmp[btid] = 0; + + if(dev_llr[tid] < 0){ + tmp[btid] = 1 << (7-(btid&7)); + } +// __syncthreads(); + + if(btid < 16){ + dev_tmp[iMCW * col*Zc + get_group_id(0)*16+btid] = 0; + for(int i = 0; i < 8; i++){ + dev_tmp[iMCW * col*Zc + get_group_id(0)*16+btid] += tmp[btid*8+i]; + } + } +} diff --git a/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c index 82bb0a2659..83a6b3234a 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c @@ -46,10 +46,9 @@ void pcfich_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, uint32_t i; uint8_t reset; - uint32_t x1, x2, s=0; + uint32_t x1=0, x2, s=0; // x1 is set in lte_gold_generic reset = 1; - // x1 is set in lte_gold_generic x2 = ((((2*frame_parms->Nid_cell)+1)*(1+subframe))<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.7.1 for (i=0; i<32; i++) { diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 81e2fa0ad5..f6b36ddce7 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1085,7 +1085,6 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, LOG_D(PHY, "AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n", frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); } - } LOG_D(PHY, "harq_pid: %d, TBS expected dlsch1: %d \n", harq_pid, dlsch1->harq_processes[harq_pid]->TBS); } // send to mac From 02a1b883a6cb8de492d0bf7917264ba9813d4afe Mon Sep 17 00:00:00 2001 From: hardy Date: Tue, 4 Jan 2022 22:23:12 +0100 Subject: [PATCH 046/107] fix copy of ping graph --- ci-scripts/cls_oaicitest.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 310b71f8c0..59993034a3 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -65,7 +65,7 @@ import numpy as np # Utility functions #----------------------------------------------------------- -def GetPingTimeAnalysis(ping_log_file,ping_rttavg_threshold): +def GetPingTimeAnalysis(RAN,ping_log_file,ping_rttavg_threshold): #ping time values read from file t_ping=[] #ping stats (dictionary) to be returned by the function @@ -89,12 +89,13 @@ def GetPingTimeAnalysis(ping_log_file,ping_rttavg_threshold): max_loc=t_ping.index(max(t_ping)) ping_stat['max_loc']=max_loc #remove it - t_ping.pop(max_loc) + t_ping_post=t_ping.copy() + t_ping_post.pop(max_loc) #new stats after removing max value - ping_stat['min_1']=min(t_ping) - ping_stat['mean_1']=stat.mean(t_ping) - ping_stat['median_1']=stat.median(t_ping) - ping_stat['max_1']=max(t_ping) + ping_stat['min_1']=min(t_ping_post) + ping_stat['mean_1']=stat.mean(t_ping_post) + ping_stat['median_1']=stat.median(t_ping_post) + ping_stat['max_1']=max(t_ping_post) #plot ping over time and save png for artifacts ticks = np.arange(0, len(t_ping), 1) @@ -118,7 +119,7 @@ def GetPingTimeAnalysis(ping_log_file,ping_rttavg_threshold): #copy the png file already to enb to move it move it later into the artifacts mySSH = sshconnection.SSHConnection() - mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, ping_log_file+'.png', self.eNBSourceCodePath + '/cmake_targets/') + mySSH.copyout(RAN.eNBIPAddress, RAN.eNBUserName, RAN.eNBPassword, ping_log_file+'.png', RAN.eNBSourceCodePath + '/cmake_targets/') return ping_stat @@ -1559,7 +1560,7 @@ class OaiCiTest(): statusQueue.put(message) lock.release() - def Ping_common(self, lock, UE_IPAddress, device_id, statusQueue,EPC, Module_UE): + def Ping_common(self, lock, UE_IPAddress, device_id, statusQueue,EPC, Module_UE,RAN): try: SSH = sshconnection.SSHConnection() # Launch ping on the EPC side (true for ltebox and old open-air-cn) @@ -1674,7 +1675,7 @@ class OaiCiTest(): #adding extra ping stats from local file #ping_log_file variable is defined above in this function, depending on device/ue logging.debug('Analyzing Ping log file : ' + os.getcwd() + '/' + ping_log_file) - ping_stat=GetPingTimeAnalysis(ping_log_file,self.ping_rttavg_threshold) + ping_stat=GetPingTimeAnalysis(RAN,ping_log_file,self.ping_rttavg_threshold) ping_stat_msg='' if (ping_stat!=-1) and (len(ping_stat)!=0): ping_stat_msg+='Ping stats before removing largest value : \n' @@ -1864,7 +1865,7 @@ class OaiCiTest(): device_id = self.UEDevices[i] else: device_id = Module_UE.ID + "-" + Module_UE.Kind - p = Process(target = self.Ping_common, args = (lock,UE_IPAddress,device_id,status_queue,EPC,Module_UE,)) + p = Process(target = self.Ping_common, args = (lock,UE_IPAddress,device_id,status_queue,EPC,Module_UE,RAN,)) p.daemon = True p.start() multi_jobs.append(p) From 154f9b6acd66d9ab13c2caf369a8ef8c40f79212 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Wed, 5 Jan 2022 13:19:52 +0100 Subject: [PATCH 047/107] fix bug in rfsimulator channel simulation model change --- targets/ARCH/rfsimulator/simulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/ARCH/rfsimulator/simulator.c b/targets/ARCH/rfsimulator/simulator.c index 13945998d7..e93c5eaa00 100644 --- a/targets/ARCH/rfsimulator/simulator.c +++ b/targets/ARCH/rfsimulator/simulator.c @@ -820,7 +820,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { AssertFatal((rfsimulator->epollfd = epoll_create1(0)) != -1,""); - //randominit(0); + randominit(0); set_taus_seed(0); /* look for telnet server, if it is loaded, add the channel modeling commands to it */ add_telnetcmd_func_t addcmd = (add_telnetcmd_func_t)get_shlibmodule_fptr("telnetsrv", TELNET_ADDCMD_FNAME); From 0ec9d171d7a5c254095b3c4336a1eb49dcdf5e33 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Wed, 5 Jan 2022 13:26:07 +0100 Subject: [PATCH 048/107] fix bug in rfsimulator channel simulation model change --- targets/ARCH/rfsimulator/simulator.c | 1 + 1 file changed, 1 insertion(+) diff --git a/targets/ARCH/rfsimulator/simulator.c b/targets/ARCH/rfsimulator/simulator.c index e93c5eaa00..013e542689 100644 --- a/targets/ARCH/rfsimulator/simulator.c +++ b/targets/ARCH/rfsimulator/simulator.c @@ -820,6 +820,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { AssertFatal((rfsimulator->epollfd = epoll_create1(0)) != -1,""); + // we need to call randominit() for telnet server (use gaussdouble=>uniformrand) randominit(0); set_taus_seed(0); /* look for telnet server, if it is loaded, add the channel modeling commands to it */ From 6ccc419dfa784700d9e475676a84cbc10467588f Mon Sep 17 00:00:00 2001 From: hardy Date: Wed, 5 Jan 2022 15:30:50 +0100 Subject: [PATCH 049/107] fix autoterminate --- ci-scripts/cls_oaicitest.py | 35 +++++++++++++++++++++++++++++++++++ ci-scripts/main.py | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 59993034a3..42ed46cca5 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -3434,6 +3434,41 @@ class OaiCiTest(): CONTAINERS.UndeployObject(HTML,RAN) RAN.prematureExit=True + #this function is called only if eNB/gNB fails to start + #RH to be re-factored + def AutoTerminateeNB(self,HTML,RAN,EPC,CONTAINERS): + if (RAN.Initialize_eNB_args != ''): + self.testCase_id = 'AUTO-KILL-RAN' + HTML.testCase_id = self.testCase_id + self.desc = 'Automatic Termination of all RAN nodes' + HTML.desc = self.desc + self.ShowTestID() + #terminate all RAN nodes eNB/gNB/OCP + for instance in range(0, len(RAN.air_interface)): + if RAN.air_interface[instance]!='': + logging.debug('Auto Termination of Instance ' + str(instance) + ' : ' + RAN.air_interface[instance]) + RAN.eNB_instance=instance + RAN.TerminateeNB(HTML,EPC) + if RAN.flexranCtrlInstalled and RAN.flexranCtrlStarted: + self.testCase_id = 'AUTO-KILL-flexran-ctl' + HTML.testCase_id = self.testCase_id + self.desc = 'Automatic Termination of FlexRan CTL' + HTML.desc = self.desc + self.ShowTestID() + self.TerminateFlexranCtrl(HTML,RAN,EPC) + if CONTAINERS.yamlPath[0] != '': + self.testCase_id = 'AUTO-KILL-CONTAINERS' + HTML.testCase_id = self.testCase_id + self.desc = 'Automatic Termination of all RAN containers' + HTML.desc = self.desc + self.ShowTestID() + for instance in range(0, len(CONTAINERS.yamlPath)): + if CONTAINERS.yamlPath[instance]!='': + CONTAINERS.eNB_instance=instance + CONTAINERS.UndeployObject(HTML,RAN) + RAN.prematureExit=True + + def IdleSleep(self,HTML): time.sleep(self.idle_sleep_time) HTML.CreateHtmlTestRow(str(self.idle_sleep_time) + ' sec', 'OK', CONST.ALL_PROCESSES_OK) diff --git a/ci-scripts/main.py b/ci-scripts/main.py index f448447e44..3a5a69573d 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -819,7 +819,7 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re RAN.pStatus=CiTestObj.CheckProcessExist(check_eNB, check_OAI_UE,RAN,EPC) RAN.InitializeeNB(HTML, EPC) if RAN.prematureExit: - CiTestObj.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC,InfraUE,CONTAINERS) + CiTestObj.AutoTerminateeNB(HTML,RAN,EPC,CONTAINERS) elif action == 'Terminate_eNB': RAN.TerminateeNB(HTML, EPC) elif action == 'Initialize_UE': From 5afec8db5756130a0bc88ce95c00759e1acbfd3a Mon Sep 17 00:00:00 2001 From: hardy Date: Wed, 5 Jan 2022 16:05:51 +0100 Subject: [PATCH 050/107] fix ping analysis if no threshold defined + escape if scp fails --- ci-scripts/cls_oaicitest.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 42ed46cca5..3ba014b7c9 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -112,14 +112,18 @@ def GetPingTimeAnalysis(RAN,ping_log_file,ping_rttavg_threshold): else: y_max=YMAX+1 plt.ylim(0,y_max) - th_label="AVG Ping Fail Threshold="+ping_rttavg_threshold - plt.axhline(y=float(ping_rttavg_threshold), color='r', linestyle='-',label=th_label) - axis.legend() + if ping_rttavg_threshold != '': + th_label="AVG Ping Fail Threshold="+ping_rttavg_threshold + plt.axhline(y=float(ping_rttavg_threshold), color='r', linestyle='-',label=th_label) + axis.legend() plt.savefig(ping_log_file+'.png') #copy the png file already to enb to move it move it later into the artifacts - mySSH = sshconnection.SSHConnection() - mySSH.copyout(RAN.eNBIPAddress, RAN.eNBUserName, RAN.eNBPassword, ping_log_file+'.png', RAN.eNBSourceCodePath + '/cmake_targets/') + try: + mySSH = sshconnection.SSHConnection() + mySSH.copyout(RAN.eNBIPAddress, RAN.eNBUserName, RAN.eNBPassword, ping_log_file+'.png', RAN.eNBSourceCodePath + '/cmake_targets/') + except: + logging.debug('\u001B[1;37;41m Ping PNG SCP to eNB FAILED\u001B[0m') return ping_stat From 33f93804c62d9f620a44eaa8b446c44850b38615 Mon Sep 17 00:00:00 2001 From: hardy Date: Thu, 6 Jan 2022 08:31:17 +0100 Subject: [PATCH 051/107] bugfix ping analysis --- ci-scripts/cls_oaicitest.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 3ba014b7c9..ac1d89893f 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -128,7 +128,7 @@ def GetPingTimeAnalysis(RAN,ping_log_file,ping_rttavg_threshold): return ping_stat else: - logging.error("Ping log file does not exist") + logging.error("GetPingTimeAnalysis : Ping log file does not exist") return -1 @@ -1592,6 +1592,7 @@ class OaiCiTest(): ping_status = SSH.command('docker exec -it prod-trf-gen /bin/bash -c "ping ' + self.ping_args + ' ' + UE_IPAddress + '" 2>&1 | tee ping_' + self.testCase_id + '_' + device_id + '.log', '\$', int(ping_time[0])*1.5) else: ping_status = SSH.command('stdbuf -o0 ping ' + self.ping_args + ' ' + UE_IPAddress + ' 2>&1 | stdbuf -o0 tee ping_' + self.testCase_id + '_' + device_id + '.log', '\$', int(ping_time[0])*1.5) + ping_log_file='ping_' + self.testCase_id + '_' + device_id + '.log' #copy the ping log file to have it locally for analysis (ping stats) SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, EPC.SourceCodePath + '/scripts/ping_' + self.testCase_id + '_' + device_id + '.log', '.') else: @@ -1611,7 +1612,7 @@ class OaiCiTest(): SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) #cat is executed on EPC SSH.command('cat ' + EPC.SourceCodePath + '/scripts/ping_' + self.testCase_id + '_' + device_id + '.log', '\$', 5) - ping_log_file='ping_' + self.testCase_id + '_' + device_id + '.log' + ping_log_file='/scripts/ping_' + self.testCase_id + '_' + device_id + '.log' else: #launch from Module SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword) #target address is different depending on EPC type From 8e9f7d9477a4bf32e0603f8decbfe8c4d0609e32 Mon Sep 17 00:00:00 2001 From: hardy Date: Fri, 7 Jan 2022 09:49:01 +0100 Subject: [PATCH 052/107] Revert "Change obelix N300 IP addresses" This reverts commit f34d5e2f1bd187df5820f54d8fcd8d2dddb76fe4. --- ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf | 2 +- ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf | 2 +- ci-scripts/xml_files/fr1_lte_2x2_quectel.xml | 2 +- ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml | 2 +- ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml | 2 +- ci-scripts/xml_files/fr1_sa_oaiue_n310.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf index bc29f1bd37..d2e91fb872 100644 --- a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf @@ -237,7 +237,7 @@ RUs = ( max_pdschReferenceSignalPower = -27; max_rxgain = 75; eNB_instances = [0]; - sdr_addrs = "mgmt_addr=192.168.18.16,addr=192.168.10.2"; + sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.20.2,second_addr=192.168.10.2"; } ); diff --git a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf index f9d42acaa1..6c8d5ba6f0 100644 --- a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf @@ -237,7 +237,7 @@ RUs = ( max_pdschReferenceSignalPower = -27; max_rxgain = 75; eNB_instances = [0]; - sdr_addrs = "mgmt_addr=192.168.18.16,addr=192.168.10.2"; + sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.20.2,second_addr=192.168.10.2"; } ); diff --git a/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml b/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml index aa500f27de..4cb6b88a0c 100644 --- a/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml @@ -65,7 +65,7 @@ lte yes yes - 192.168.18.16 + 192.168.18.241 diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml index c453d78e37..2516af9429 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml @@ -67,7 +67,7 @@ lte yes yes - 192.168.18.16 + 192.168.18.241 diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml index b6153d50ad..52cf1ec6e8 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml @@ -87,7 +87,7 @@ lte yes yes - 192.168.18.16 + 192.168.18.241 diff --git a/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml b/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml index 2e30f25020..00eeeb0c46 100644 --- a/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml +++ b/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml @@ -42,7 +42,7 @@ Initialize_OAI_UE Initialize OAI UE (N310) nr - --sa -O ../../../ci-scripts/conf_files/ue.sa.conf --usrp-args "mgmt_addr=192.168.18.16,second_addr=192.168.10.2" --numerology 1 -r 106 --band 78 -C 3319680000 --nokrnmod 1 --ue-txgain 0 --ue-rxgain 70 --ue-fo-compensation + --sa -O ../../../ci-scripts/conf_files/ue.sa.conf --usrp-args "mgmt_addr=192.168.18.241,addr=192.168.20.2,second_addr=192.168.10.2" --numerology 1 -r 106 --band 78 -C 3319680000 --nokrnmod 1 --ue-txgain 0 --ue-rxgain 70 --ue-fo-compensation From 3606c3814536d39b4344f487174e2a03a094bc1e Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 7 Jan 2022 14:48:09 +0100 Subject: [PATCH 053/107] uecap file from command line at gnb for phytest and dora mode --- executables/nr-softmodem.c | 10 ++----- executables/nr-softmodem.h | 2 ++ openair2/GNB_APP/gnb_config.c | 2 +- openair2/RRC/NR/nr_rrc_defs.h | 2 ++ openair2/RRC/NR/rrc_gNB.c | 56 ++++------------------------------- openair2/RRC/NR/rrc_gNB_nsa.c | 8 +++-- openair2/RRC/NR_UE/rrc_UE.c | 3 +- 7 files changed, 21 insertions(+), 62 deletions(-) diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index a2b5c18b6c..12728434ad 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -111,16 +111,11 @@ int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; //Temp fix for inexistent NR upper layer unsigned char NB_gNB_INST = 1; +char *uecap_file; - -int UE_scan = 1; -int UE_scan_carrier = 0; runmode_t mode = normal_txrx; static double snr_dB=20; -FILE *input_fd=NULL; - - #if MAX_NUM_CCs == 1 rx_gain_t rx_gain_mode[MAX_NUM_CCs][4] = {{max_gain,max_gain,max_gain,max_gain}}; double tx_gain[MAX_NUM_CCs][4] = {{20,0,0,0}}; @@ -193,8 +188,6 @@ openair0_config_t openair0_cfg[MAX_CARDS]; double cpuf; -extern char uecap_xer[1024]; -char uecap_xer_in=0; /* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed * this is very hackish - find a proper solution @@ -702,6 +695,7 @@ int main( int argc, char **argv ) { // don't create if node doesn't connect to RRC/S1/GTP AssertFatal(create_gNB_tasks(1) == 0,"cannot create ITTI tasks\n"); + /* Start the agent. If it is turned off in the configuration, it won't start */ /* RCconfig_nr_flexran(); diff --git a/executables/nr-softmodem.h b/executables/nr-softmodem.h index 896c363cbf..926b4b1f0f 100644 --- a/executables/nr-softmodem.h +++ b/executables/nr-softmodem.h @@ -29,6 +29,7 @@ {"D" , CONFIG_HLP_DLBM_PHYTEST,0, u64ptr:&dlsch_slot_bitmap, defintval:0, TYPE_UINT64, 0}, \ {"U" , CONFIG_HLP_ULBM_PHYTEST,0, u64ptr:&ulsch_slot_bitmap, defintval:0, TYPE_UINT64, 0}, \ {"usrp-tx-thread-config", CONFIG_HLP_USRP_THREAD, 0, iptr:&usrp_tx_thread, defstrval:0, TYPE_INT, 0}, \ + {"uecap_file", CONFIG_HLP_UECAP_FILE, 0, strptr:(char **)&uecap_file, defstrval:"./", TYPE_STRING, 0}, \ {"s" , CONFIG_HLP_SNR, 0, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0}, \ } @@ -41,6 +42,7 @@ extern uint32_t target_dl_bw; extern uint32_t target_ul_bw; extern uint64_t dlsch_slot_bitmap; extern uint64_t ulsch_slot_bitmap; +extern char *uecap_file; // In nr-gnb.c extern void init_gNB(int single_thread_flag,int wait_for_sync); diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index d069bfe2f4..ef464f4976 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -1533,7 +1533,7 @@ void NRRCConfig(void) { config_get( GNBSParams,sizeof(GNBSParams)/sizeof(paramdef_t),NULL); RC.nb_nr_inst = GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt; - // Get num MACRLC instances + // Get num MACRLC instances config_getlist( &MACRLCParamList,NULL,0, NULL); RC.nb_nr_macrlc_inst = MACRLCParamList.numelt; // Get num L1 instances diff --git a/openair2/RRC/NR/nr_rrc_defs.h b/openair2/RRC/NR/nr_rrc_defs.h index d71393bc2d..7f0612dbdd 100644 --- a/openair2/RRC/NR/nr_rrc_defs.h +++ b/openair2/RRC/NR/nr_rrc_defs.h @@ -520,6 +520,8 @@ typedef struct gNB_RRC_INST_s { int cell_info_configured; pthread_mutex_t cell_info_mutex; + char *uecap_file; + // security configuration (preferred algorithms) nr_security_configuration_t security; } gNB_RRC_INST; diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 7f7353f9af..184bfd6384 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -178,56 +178,12 @@ static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration pthread_mutex_unlock(&rrc->cell_info_mutex); if (get_softmodem_params()->phy_test > 0 || get_softmodem_params()->do_ra > 0) { - // This is for phytest only, emulate first X2 message if uecap.raw file is present - FILE *fd; - fd = fopen("uecap.raw","r"); - - if (fd != NULL) { - char buffer[4096]; - int msg_len=fread(buffer,1,4096,fd); - LOG_I(RRC,"Read in %d bytes for uecap\n",msg_len); - LTE_UL_DCCH_Message_t *LTE_UL_DCCH_Message; - asn_dec_rval_t dec_rval = uper_decode_complete( NULL, - &asn_DEF_LTE_UL_DCCH_Message, - (void **)<E_UL_DCCH_Message, - (uint8_t *)buffer, - msg_len); - - if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) { - AssertFatal(1==0,"NR_UL_DCCH_MESSAGE decode error\n"); - // free the memory - SEQUENCE_free( &asn_DEF_LTE_UL_DCCH_Message, LTE_UL_DCCH_Message, 1 ); - return; - } - - fclose(fd); - xer_fprint(stdout,&asn_DEF_LTE_UL_DCCH_Message, LTE_UL_DCCH_Message); - // recreate enough of X2 EN-DC Container - AssertFatal(LTE_UL_DCCH_Message->message.choice.c1.present == LTE_UL_DCCH_MessageType__c1_PR_ueCapabilityInformation, - "ueCapabilityInformation not present\n"); - NR_CG_ConfigInfo_t *CG_ConfigInfo = calloc(1,sizeof(*CG_ConfigInfo)); - CG_ConfigInfo->criticalExtensions.present = NR_CG_ConfigInfo__criticalExtensions_PR_c1; - CG_ConfigInfo->criticalExtensions.choice.c1 = calloc(1,sizeof(*CG_ConfigInfo->criticalExtensions.choice.c1)); - CG_ConfigInfo->criticalExtensions.choice.c1->present = NR_CG_ConfigInfo__criticalExtensions__c1_PR_cg_ConfigInfo; - CG_ConfigInfo->criticalExtensions.choice.c1->choice.cg_ConfigInfo = calloc(1,sizeof(*CG_ConfigInfo->criticalExtensions.choice.c1->choice.cg_ConfigInfo)); - NR_CG_ConfigInfo_IEs_t *cg_ConfigInfo = CG_ConfigInfo->criticalExtensions.choice.c1->choice.cg_ConfigInfo; - cg_ConfigInfo->ue_CapabilityInfo = calloc(1,sizeof(*cg_ConfigInfo->ue_CapabilityInfo)); - asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_UE_CapabilityRAT_ContainerList,NULL, - (void *)<E_UL_DCCH_Message->message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList,buffer,4096); - AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %jd)!\n", - enc_rval.failed_type->name, enc_rval.encoded); - OCTET_STRING_fromBuf(cg_ConfigInfo->ue_CapabilityInfo, - (const char *)buffer, - (enc_rval.encoded+7)>>3); - parse_CG_ConfigInfo(rrc,CG_ConfigInfo,NULL); - } else { - struct rrc_gNB_ue_context_s *ue_context_p = rrc_gNB_allocate_new_UE_context(rrc); - ue_context_p->ue_context.spCellConfig = calloc(1, sizeof(struct NR_SpCellConfig)); - ue_context_p->ue_context.spCellConfig->spCellConfigDedicated = configuration->scd; - LOG_I(NR_RRC,"Adding new user (%p)\n",ue_context_p); - if (!NODE_IS_CU(RC.nrrrc[0]->node_type)) { - rrc_add_nsa_user(rrc,ue_context_p,NULL); - } + struct rrc_gNB_ue_context_s *ue_context_p = rrc_gNB_allocate_new_UE_context(rrc); + ue_context_p->ue_context.spCellConfig = calloc(1, sizeof(struct NR_SpCellConfig)); + ue_context_p->ue_context.spCellConfig->spCellConfigDedicated = configuration->scd; + LOG_I(NR_RRC,"Adding new user (%p)\n",ue_context_p); + if (!NODE_IS_CU(RC.nrrrc[0]->node_type)) { + rrc_add_nsa_user(rrc,ue_context_p,NULL); } } } diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 70abaccc8d..5ac2f4ee02 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -38,6 +38,7 @@ #include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h" #include "openair2/RRC/LTE/rrc_eNB_GTPV1U.h" #include "executables/softmodem-common.h" +#include "executables/nr-softmodem.h" #include #include #include "UTIL/OSA/osa_defs.h" @@ -148,8 +149,11 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ NR_UE_NR_Capability_t* UE_Capability_nr = NULL; char UE_NR_Capability_xer_fname[1024]; char UE_NR_Capability_xer[65536]; - sprintf(UE_NR_Capability_xer_fname,"../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml"); - FILE *f = fopen(UE_NR_Capability_xer_fname, "r"); + FILE *f = NULL; + if (uecap_file) { + sprintf(UE_NR_Capability_xer_fname,"%s",uecap_file); + f = fopen(UE_NR_Capability_xer_fname, "r"); + } if(f){ size_t size = fread(UE_NR_Capability_xer, 1, sizeof UE_NR_Capability_xer, f); if (size == 0 || size == sizeof UE_NR_Capability_xer) diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index 93e7e0b8fe..b0d84960e8 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -2644,8 +2644,9 @@ nr_rrc_ue_process_ueCapabilityEnquiry( ue_CapabilityRAT_Container.rat_Type = NR_RAT_Type_nr; NR_UE_NR_Capability_t* UE_Capability_nr = NULL; - FILE *f = NULL; char *file_path = NR_UE_rrc_inst[ctxt_pP->module_id].uecap_file; + + FILE *f = NULL; if (file_path) { sprintf(UE_NR_Capability_xer_fname,"%s",file_path); f = fopen(UE_NR_Capability_xer_fname, "r"); From bc05bd882d7355971c514d41eade93f1987c15c0 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Mon, 10 Jan 2022 11:44:45 +0100 Subject: [PATCH 054/107] cleaning after big merge --- cmake_targets/CMakeLists.txt | 3 - common/utils/system.c | 132 +++++++- common/utils/system.h | 2 +- executables/nr-ru.c | 31 +- openair1/PHY/LTE_TRANSPORT/dlsch_coding.c | 1 - targets/RT/USER/TOOLS/thread_ipc.c | 231 ------------- targets/RT/USER/lte-enb.c | 3 - targets/RT/USER/lte-ru.c | 1 - targets/RT/USER/lte-softmodem.c | 13 +- targets/RT/USER/lte-softmodem.h | 2 - targets/RT/USER/lte-ue.c | 1 - targets/RT/USER/lte-uesoftmodem.c | 58 +--- targets/RT/USER/rt_wrapper.c | 383 ---------------------- targets/RT/USER/rt_wrapper.h | 132 -------- targets/RT/USER/ru_control.c | 1 - 15 files changed, 149 insertions(+), 845 deletions(-) delete mode 100644 targets/RT/USER/TOOLS/thread_ipc.c delete mode 100644 targets/RT/USER/rt_wrapper.c delete mode 100644 targets/RT/USER/rt_wrapper.h diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index bf3bb2b017..abf9cd1145 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -2767,7 +2767,6 @@ target_link_libraries (test5Gnas LIB_5GNAS_GNB CONFIG_LIB minimal_lib ) ################################################### add_executable(lte-softmodem - ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c ${OPENAIR_TARGETS}/RT/USER/lte-enb.c ${OPENAIR_TARGETS}/RT/USER/lte-ru.c ${OPENAIR_TARGETS}/RT/USER/ru_control.c @@ -2882,7 +2881,6 @@ target_link_libraries(du_test add_executable(oairu ${OPENAIR_TARGETS}/RT/USER/lte-ru.c ${OPENAIR_TARGETS}/RT/USER/ru_control.c - ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c ${OPENAIR_TARGETS}/ARCH/COMMON/record_player.c ${OPENAIR_DIR}/executables/softmodem-common.c @@ -2910,7 +2908,6 @@ target_link_libraries (oairu pthread m ${CONFIG_LIB} rt ${CMAKE_DL_LIBS} ${T_LIB ####################################### add_executable(lte-uesoftmodem - ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c ${OPENAIR_TARGETS}/RT/USER/lte-ue.c ${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.c ${OPENAIR_DIR}/executables/softmodem-common.c diff --git a/common/utils/system.c b/common/utils/system.c index 93b13f03f2..07a85fad97 100644 --- a/common/utils/system.c +++ b/common/utils/system.c @@ -211,6 +211,19 @@ void start_background_system(void) { background_system_process(); } +int rt_sleep_ns (uint64_t x) +{ + struct timespec myTime; + clock_gettime(CLOCK_MONOTONIC, &myTime); + myTime.tv_sec += x/1000000000ULL; + myTime.tv_nsec = x%1000000000ULL; + if (myTime.tv_nsec>=1000000000) { + myTime.tv_nsec -= 1000000000; + myTime.tv_sec++; + } + + return clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &myTime, NULL); +} void threadCreate(pthread_t* t, void * (*func)(void*), void * param, char* name, int affinity, int priority){ pthread_attr_t attr; @@ -260,11 +273,128 @@ void threadCreate(pthread_t* t, void * (*func)(void*), void * param, char* name, pthread_attr_destroy(&attr); } +// Legacy, pthread_create + thread_top_init() should be replaced by threadCreate +// threadCreate encapsulates the posix pthread api +void thread_top_init(char *thread_name, + int affinity, + uint64_t runtime, + uint64_t deadline, + uint64_t period) { + +#ifdef DEADLINE_SCHEDULER + struct sched_attr attr; + + unsigned int flags = 0; + + attr.size = sizeof(attr); + attr.sched_flags = 0; + attr.sched_nice = 0; + attr.sched_priority = 0; + + attr.sched_policy = SCHED_DEADLINE; + attr.sched_runtime = runtime; + attr.sched_deadline = deadline; + attr.sched_period = period; + + if (sched_setattr(0, &attr, flags) < 0 ) { + perror("[SCHED] eNB tx thread: sched_setattr failed\n"); + fprintf(stderr,"sched_setattr Error = %s",strerror(errno)); + exit(1); + } + +#else //LOW_LATENCY + int policy, s, j; + struct sched_param sparam; + char cpu_affinity[1024]; + cpu_set_t cpuset; + int settingPriority = 1; + + /* Set affinity mask to include CPUs 2 to MAX_CPUS */ + /* CPU 0 is reserved for UHD threads */ + /* CPU 1 is reserved for all RX_TX threads */ + /* Enable CPU Affinity only if number of CPUs > 2 */ + CPU_ZERO(&cpuset); + +#ifdef CPU_AFFINITY + if (affinity == 0) { + LOG_W(HW,"thread_top_init() called with affinity==0, but overruled by #ifdef CPU_AFFINITY\n"); + } + else if (get_nprocs() > 2) + { + for (j = 2; j < get_nprocs(); j++) + CPU_SET(j, &cpuset); + s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_setaffinity_np"); + exit_fun("Error setting processor affinity"); + } + } +#else //CPU_AFFINITY + if (affinity) { + LOG_W(HW,"thread_top_init() called with affinity>0, but overruled by #ifndef CPU_AFFINITY.\n"); + } +#endif //CPU_AFFINITY + + /* Check the actual affinity mask assigned to the thread */ + s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_getaffinity_np"); + exit_fun("Error getting processor affinity "); + } + memset(cpu_affinity,0,sizeof(cpu_affinity)); + for (j = 0; j < 1024; j++) + { + if (CPU_ISSET(j, &cpuset)) + { + char temp[1024]; + sprintf (temp, " CPU_%d", j); + strcat(cpu_affinity, temp); + } + } + + if (checkIfFedoraDistribution()) + if (checkIfGenericKernelOnFedora()) + if (checkIfInsideContainer()) + settingPriority = 0; + + if (settingPriority) { + memset(&sparam, 0, sizeof(sparam)); + sparam.sched_priority = sched_get_priority_max(SCHED_FIFO); + policy = SCHED_FIFO; + + s = pthread_setschedparam(pthread_self(), policy, &sparam); + if (s != 0) { + perror("pthread_setschedparam : "); + exit_fun("Error setting thread priority"); + } + + s = pthread_getschedparam(pthread_self(), &policy, &sparam); + if (s != 0) { + perror("pthread_getschedparam : "); + exit_fun("Error getting thread priority"); + } + + pthread_setname_np(pthread_self(), thread_name); + + LOG_I(HW, "[SCHED][eNB] %s started on CPU %d, sched_policy = %s , priority = %d, CPU Affinity=%s \n",thread_name,sched_getcpu(), + (policy == SCHED_FIFO) ? "SCHED_FIFO" : + (policy == SCHED_RR) ? "SCHED_RR" : + (policy == SCHED_OTHER) ? "SCHED_OTHER" : + "???", + sparam.sched_priority, cpu_affinity ); + } + +#endif //LOW_LATENCY +} + + // Block CPU C-states deep sleep void configure_linux(void) { int ret; static int latency_target_fd=-1; - uint32_t latency_target_value=10; // in microseconds + uint32_t latency_target_value=2; // in microseconds if (latency_target_fd == -1) { if ( (latency_target_fd = open("/dev/cpu_dma_latency", O_RDWR)) != -1 ) { ret = write(latency_target_fd, &latency_target_value, sizeof(latency_target_value)); diff --git a/common/utils/system.h b/common/utils/system.h index c76fef9144..0554163ba1 100644 --- a/common/utils/system.h +++ b/common/utils/system.h @@ -65,7 +65,7 @@ void thread_top_init(char *thread_name, int checkIfFedoraDistribution(void); int checkIfGenericKernelOnFedora(void); int checkIfInsideContainer(void); - + int rt_sleep_ns (uint64_t x); #ifdef __cplusplus } #endif diff --git a/executables/nr-ru.c b/executables/nr-ru.c index a2539a3adf..c8cce5f9a1 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -77,6 +77,7 @@ static int DEFBFW[] = {0x00007fff}; #include "T.h" #include "nfapi_interface.h" +#include extern volatile int oai_exit; @@ -1335,24 +1336,22 @@ void *ru_thread( void *param ) { while (!oai_exit) { - // these are local subframe/frame counters to check that we are in synch with the fronthaul timing. - // They are set on the first rx/tx in the underly FH routines. - slot_start = timespec_add(slot_start,slot_duration); - struct timespec curr_time; - clock_gettime(CLOCK_MONOTONIC, &curr_time); - - struct timespec sleep_time; - - if((slot_start.tv_sec > curr_time.tv_sec) || (slot_start.tv_sec == curr_time.tv_sec && slot_start.tv_nsec > curr_time.tv_nsec)){ - sleep_time = timespec_sub(slot_start,curr_time); + + if (NFAPI_MODE==NFAPI_MODE_VNF) { + // We should make a VNF main loop with proper tasks calls in case of VNF + slot_start = timespec_add(slot_start,slot_duration); + struct timespec curr_time; + clock_gettime(CLOCK_MONOTONIC, &curr_time); - usleep(sleep_time.tv_nsec * 1e-3); + struct timespec sleep_time; + + if((slot_start.tv_sec > curr_time.tv_sec) || (slot_start.tv_sec == curr_time.tv_sec && slot_start.tv_nsec > curr_time.tv_nsec)){ + sleep_time = timespec_sub(slot_start,curr_time); + + usleep(sleep_time.tv_nsec * 1e-3); + } } - else{//continue - } - - // clock_gettime(CLOCK_MONOTONIC, &curr_time); - //printf("sfn:%d, slot:%d, start time %d.%d slot start %d.%d \n",frame,slot,curr_time.tv_sec,curr_time.tv_nsec,slot_start.tv_sec,slot_start.tv_nsec); + if (slot==(fp->slots_per_frame-1)) { slot=0; frame++; diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c index b5bcb0848d..3ccbd8ca35 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c @@ -42,7 +42,6 @@ #include "common/utils/LOG/log.h" #include "targets/RT/USER/lte-softmodem.h" #include -#include "targets/RT/USER/rt_wrapper.h" #include //#define DEBUG_DLSCH_CODING diff --git a/targets/RT/USER/TOOLS/thread_ipc.c b/targets/RT/USER/TOOLS/thread_ipc.c deleted file mode 100644 index 7eda3e8431..0000000000 --- a/targets/RT/USER/TOOLS/thread_ipc.c +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -#include -#include -#include -#include - -#include -#include - -#include "thread_ipc.h" - -g_thread_ipc_t thread_ipc = {0}; - -void loop_buffer_reset(buffer_t *loop_buf) -{ - int i; - - for (i = 0; i < BUFFERMAX; i++) { - loop_buf[i].subframe_num = -1; - } - - return; -} - -static void loop_buffer_init(loop_buffer_op_t *loop_buffer) -{ - loop_buffer->packet_num = 0; - loop_buffer->isfull = 0; - loop_buffer->isempty = 1; - - pthread_mutex_init(&loop_buffer->buffer_mutex, NULL); - - pthread_cond_init(&loop_buffer->full_cond, NULL); - pthread_cond_init(&loop_buffer->empty_cond, NULL); - - loop_buffer_reset(loop_buffer->loop_buf); - - return; -} - -static void sync_buffer_init(sync_buffer_t *sync_buffer) -{ - sync_buffer->decoding_subframe_num = 0; - pthread_mutex_init(&sync_buffer->buffer_mutex, NULL); - - return; -} - -int thread_ipc_init(void) -{ - //printf("recv %d\n", thread_ipc.sync_buffer.decoding_subframe_num); - thread_ipc.ue_sync_state = 0; - thread_ipc.rx_timestamp = 0; - thread_ipc.tx_timestamp = 0; - thread_ipc.current_subframe = 0; - - pthread_mutex_init(&thread_ipc.dl_decode_mutex, NULL); - pthread_mutex_lock(&thread_ipc.dl_decode_mutex); - - pthread_mutex_init(&thread_ipc.ul_send_mutex, NULL); - pthread_mutex_lock(&thread_ipc.ul_send_mutex); - - pthread_mutex_init(&thread_ipc.sync_mutex, NULL); - pthread_mutex_lock(&thread_ipc.sync_mutex); - - loop_buffer_init(&thread_ipc.loop_buffer); - sync_buffer_init(&thread_ipc.sync_buffer); - - return 0; -} - -int thread_ipc_deinit(void) -{ - pthread_mutex_destroy(&thread_ipc.ul_send_mutex); - pthread_mutex_destroy(&thread_ipc.sync_mutex); - pthread_mutex_destroy(&thread_ipc.dl_decode_mutex); - - pthread_mutex_destroy(&thread_ipc.loop_buffer.buffer_mutex); - pthread_cond_destroy(&thread_ipc.loop_buffer.full_cond); - pthread_cond_destroy(&thread_ipc.loop_buffer.empty_cond); - - pthread_mutex_destroy(&thread_ipc.sync_buffer.buffer_mutex); - - return 0; -} - -int set_thread_attr(pthread_attr_t *attr, int policy, int priority, int cpuid) -{ - struct sched_param param; - cpu_set_t cpu_info; - - pthread_attr_init(attr); - - if (pthread_attr_setschedpolicy(attr, policy) != 0) { - perror("pthread_attr_setschedpolicy"); - return -1; - } - - param.sched_priority = priority; - - if (pthread_attr_setschedparam(attr, ¶m) != 0) { - perror("pthread_attr_setschedparam"); - return -1; - } - - CPU_ZERO(&cpu_info); - CPU_SET(cpuid, &cpu_info); - - if (pthread_attr_setaffinity_np(attr,sizeof(cpu_set_t),&cpu_info)) { - perror("pthread_attr_setaffinity_np"); - return -1; - } - - if (pthread_attr_setinheritsched(attr, PTHREAD_EXPLICIT_SCHED) != 0) { - perror("pthread_attr_setinheritsched"); - return -1; - } - - return 0; -} - - -int find_subframe_num(unsigned long long current_subframe_num, buffer_t *buf, int *flag) -{ - long long tmp; - int i; - - tmp = current_subframe_num; - - for ( i = 0; i < HIGHBUFFER + 1; i++) { - if(tmp == buf[i].subframe_num) { - return i; - } else if (tmp < buf[i].subframe_num) { - *flag = 1; - } - } - - return -1; -} - -int ue_unsync_thread_ipc_reset(void) -{ - thread_ipc.ue_sync_state = 0; - - pthread_mutex_lock(&thread_ipc.loop_buffer.buffer_mutex); - - if (thread_ipc.loop_buffer.isempty) { - pthread_cond_signal(&thread_ipc.loop_buffer.empty_cond); - } - - if (thread_ipc.loop_buffer.isfull) { - pthread_cond_signal(&thread_ipc.loop_buffer.full_cond); - } - - thread_ipc.loop_buffer.packet_num = 0; - thread_ipc.loop_buffer.isfull = 0; - thread_ipc.loop_buffer.isempty = 1; - - loop_buffer_reset(thread_ipc.loop_buffer.loop_buf); - pthread_mutex_unlock(&thread_ipc.loop_buffer.buffer_mutex); - - thread_ipc.current_subframe = 0; - - return 0; -} -void bind_thread2kernel(int cpu_id) -{ - cpu_set_t mask; - cpu_set_t get; - int i; - int num = sysconf(_SC_NPROCESSORS_CONF); - //printf("system has %d processor(s) by super\n", num); - CPU_ZERO(&mask); - CPU_SET(cpu_id, &mask); - - if (pthread_setaffinity_np(pthread_self(), sizeof(mask), &mask) < 0) { - fprintf(stderr, "set thread affinity failed\n"); - } - - /*CPU_ZERO(&get); - if (pthread_getaffinity_np(pthread_self(), sizeof(get), &get) < 0) { - fprintf(stderr, "get thread affinity failed\n"); - } - for (i = 0; i < num; i++) { - if (CPU_ISSET(i, &get)) { - printf("thread %d is running in processor %d\n", (int)pthread_self(), i); - } - } - if (CPU_ISSET(cpu_id, &get)) { - printf("thread %d is running in processor %d by super\n", (int)pthread_self(), cpu_id); - }*/ -} -void get_thread2kernel(void) -{ - cpu_set_t get; - int i; - int num = sysconf(_SC_NPROCESSORS_CONF); - printf("system has %d processor(s) by super\n", num); - CPU_ZERO(&get); - - if (pthread_getaffinity_np(pthread_self(), sizeof(get), &get) < 0) { - fprintf(stderr, "get thread affinity failed\n"); - } - - for (i = 0; i < num; i++) { - if (CPU_ISSET(i, &get)) { - printf("The thread %d is running in processor %d by super\n", (int)pthread_self(), i); - } - } -} - diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index f20f8267ed..0b6b0b3a75 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -48,8 +48,6 @@ #undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all -#include "rt_wrapper.h" - #include "assertions.h" @@ -101,7 +99,6 @@ extern RAN_CONTEXT_t RC; //#define USRP_DEBUG 1 struct timing_info_t { //unsigned int frame, hw_slot, last_slot, next_slot; - RTIME time_min, time_max, time_avg, time_last, time_now; //unsigned int mbox0, mbox1, mbox2, mbox_target; unsigned int n_samples; } timing_info; diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 20644388c8..8ad610f1af 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -44,7 +44,6 @@ #include #include #include -#include "rt_wrapper.h" #undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 8cc693623b..ff1b0f99dd 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -34,7 +34,6 @@ #define _GNU_SOURCE /* See feature_test_macros(7) */ #include -#include "rt_wrapper.h" #include @@ -518,13 +517,6 @@ static void wait_nfapi_init(char *thread_name) { int main ( int argc, char **argv ) { - set_priority(79); - if (mlockall(MCL_CURRENT | MCL_FUTURE) == -1) - { - fprintf(stderr, "mlockall: %s\n", strerror(errno)); - return EXIT_FAILURE; - } - int i; int CC_id = 0; int ru_id; @@ -537,8 +529,8 @@ int main ( int argc, char **argv ) } mode = normal_txrx; - set_latency_target(); logInit(); + configure_linux(); printf("Reading in command-line options\n"); get_options (); @@ -573,13 +565,10 @@ int main ( int argc, char **argv ) init_opt(); // to make a graceful exit when ctrl-c is pressed set_softmodem_sighandler(); - check_clock(); #ifndef PACKAGE_VERSION # define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL" #endif LOG_I(HW, "Version: %s\n", PACKAGE_VERSION); - printf("Runtime table\n"); - fill_modeled_runtime_table(runtime_phy_rx,runtime_phy_tx); /* Read configuration */ if (RC.nb_inst > 0) { diff --git a/targets/RT/USER/lte-softmodem.h b/targets/RT/USER/lte-softmodem.h index 4154d6c8db..cf35a13fe9 100644 --- a/targets/RT/USER/lte-softmodem.h +++ b/targets/RT/USER/lte-softmodem.h @@ -6,7 +6,6 @@ #include #include #include -#include "rt_wrapper.h" #include #include #include @@ -21,7 +20,6 @@ #include #include #include "threads_t.h" -#include "rt_wrapper.h" #include "../../ARCH/COMMON/common_lib.h" //#undef MALLOC #include "assertions.h" diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 70e4677943..1643ca36ca 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -31,7 +31,6 @@ */ #include "lte-softmodem.h" -#include "rt_wrapper.h" #include "system.h" #include "LAYER2/MAC/mac.h" diff --git a/targets/RT/USER/lte-uesoftmodem.c b/targets/RT/USER/lte-uesoftmodem.c index dcbecc85ac..da5214bfad 100644 --- a/targets/RT/USER/lte-uesoftmodem.c +++ b/targets/RT/USER/lte-uesoftmodem.c @@ -34,9 +34,6 @@ #define _GNU_SOURCE /* See feature_test_macros(7) */ #include -#include "rt_wrapper.h" - - #undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all #include "assertions.h" @@ -542,12 +539,6 @@ AssertFatal(false,""); } int main( int argc, char **argv ) { - set_priority(79); - if (mlockall(MCL_CURRENT | MCL_FUTURE) == -1) - { - fprintf(stderr, "mlockall: %s\n", strerror(errno)); - return EXIT_FAILURE; - } int CC_id; uint8_t abstraction_flag=0; @@ -565,8 +556,8 @@ int main( int argc, char **argv ) { mode = normal_txrx; memset(&openair0_cfg[0],0,sizeof(openair0_config_t)*MAX_CARDS); - set_latency_target(); logInit(); + configure_linux(); printf("Reading in command-line options\n"); for (int i=0; i2 */ - cpu_set_t cpuset; - int s; - char cpu_affinity[1024]; - CPU_ZERO(&cpuset); -#ifdef CPU_AFFINITY - int j; - if (get_nprocs() > 2) { - for (j = 2; j < get_nprocs(); j++) - CPU_SET(j, &cpuset); - - s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); - - if (s != 0) { - perror( "pthread_setaffinity_np"); - exit_fun("Error setting processor affinity"); - } - LOG_I(HW, "Setting the affinity of main function to all CPUs, for device library to use CPU 0 only!\n"); - } - -#endif - /* Check the actual affinity mask assigned to the thread */ - s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); - - if (s != 0) { - perror( "pthread_getaffinity_np"); - exit_fun("Error getting processor affinity "); - } - - memset(cpu_affinity, 0, sizeof(cpu_affinity)); - - for (int j = 0; j < CPU_SETSIZE; j++) { - if (CPU_ISSET(j, &cpuset)) { - char temp[1024]; - sprintf(temp, " CPU_%d ", j); - strcat(cpu_affinity, temp); - } - } - - LOG_I(HW, "CPU Affinity of main() function is... %s\n", cpu_affinity); -#endif - if (create_tasks_ue(NB_UE_INST) < 0) { printf("cannot create ITTI tasks\n"); exit(-1); // need a softer mode diff --git a/targets/RT/USER/rt_wrapper.c b/targets/RT/USER/rt_wrapper.c deleted file mode 100644 index da3a2d3cfe..0000000000 --- a/targets/RT/USER/rt_wrapper.c +++ /dev/null @@ -1,383 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file rt_wrapper.h -* \brief provides a wrapper for the timing function, runtime calculations for real-time opeartions depending on weather RTAI or DEADLINE_SCHEDULER kernels are used or not -* \author F. Kaltenberger and Navid Nikaein -* \date 2013 -* \version 0.1 -* \company Eurecom -* \email: florian.kaltenberger@eurecom.fr, navid.nikaein@eurecom.fr -* \note -* \warning -*/ -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "rt_wrapper.h" -#include "system.h" -#include -#include - -#include "openair1/PHY/defs_common.h" - -static int latency_target_fd = -1; -static int32_t latency_target_value = 0; -/* Latency trick - taken from cyclictest.c - * if the file /dev/cpu_dma_latency exists, - * open it and write a zero into it. This will tell - * the power management system not to transition to - * a high cstate (in fact, the system acts like idle=poll) - * When the fd to /dev/cpu_dma_latency is closed, the behavior - * goes back to the system default. - * - * Documentation/power/pm_qos_interface.txt - */ -void set_latency_target(void) { - struct stat s; - int ret; - - if (stat("/dev/cpu_dma_latency", &s) == 0) { - latency_target_fd = open("/dev/cpu_dma_latency", O_RDWR); - - if (latency_target_fd == -1) - return; - - ret = write(latency_target_fd, &latency_target_value, 4); - - if (ret == 0) { - printf("# error setting cpu_dma_latency to %d!: %s\n", latency_target_value, strerror(errno)); - close(latency_target_fd); - return; - } - - printf("# /dev/cpu_dma_latency set to %dus\n", latency_target_value); - } -} - - -struct timespec interval, next, now, res; -clockid_t clock_id = CLOCK_MONOTONIC; //other options are CLOCK_MONOTONIC, CLOCK_REALTIME, CLOCK_PROCESS_CPUTIME_ID, CLOCK_THREAD_CPUTIME_ID -RTIME rt_get_time_ns (void) -{ - clock_gettime(clock_id, &now); - return(now.tv_sec*1e9+now.tv_nsec); -} - -int rt_sleep_ns (RTIME x) -{ - int ret; - clock_gettime(clock_id, &now); - interval.tv_sec = x/((RTIME)1000000000); - interval.tv_nsec = x%((RTIME)1000000000); - //rt_printk("sleeping for %d sec and %d ns\n",interval.tv_sec,interval.tv_nsec); - next = now; - next.tv_sec += interval.tv_sec; - next.tv_nsec += interval.tv_nsec; - - if (next.tv_nsec>=1000000000) { - next.tv_nsec -= 1000000000; - next.tv_sec++; - } - - ret = clock_nanosleep(clock_id, TIMER_ABSTIME, &next, NULL); - - /* - if (ret==EFAULT) - rt_printk("rt_sleep_ns returned EFAULT (%d), reqested %d sec and %d ns\n",ret,next.tv_sec,next.tv_nsec); - if (ret==EINVAL) - rt_printk("rt_sleep_ns returned EINVAL (%d), reqested %d sec and %d ns\n",ret,next.tv_sec,next.tv_nsec); - if (ret==EINTR) - rt_printk("rt_sleep_ns returned EINTR (%d), reqested %d sec and %d ns\n",ret,next.tv_sec,next.tv_nsec); - */ - - return(ret); -} - -void check_clock(void) -{ - if (clock_getres(clock_id, &res)) { - printf("clock_getres failed"); - } else { - printf("reported resolution = %lld ns\n", (long long int) ((int) 1e9 * res.tv_sec) + (long long int) res.tv_nsec); - } -} - -uint16_t cell_processing_dl[6]={10,15,24,42,80,112}; -uint16_t platform_processing_dl=20; // upperbound for GPP, LXC, DOCKER and KVM -uint16_t user_processing_dl_a[6]={2,4,5,7,10,12}; -uint16_t user_processing_dl_b[6]={10, 15, 25, 70, 110, 150}; -uint16_t user_processing_dl_err[6]={20, 40, 60, 90, 120, 160}; -uint16_t protocol_processing_dl[6]={150, 250, 350, 450, 650, 800}; // assumption: max MCS 27 --> gives an upper bound for the transport block size : to be measured - -uint16_t cell_processing_ul[6]={10,15,24,42,80,112}; -uint16_t platform_processing_ul=30; // upperbound for GPP, LXC, DOCKER and KVM -uint16_t user_processing_ul_a[6]={5, 9, 12, 24, 33, 42}; -uint16_t user_processing_ul_b[6]={20, 30, 40, 76, 140, 200}; -uint16_t user_processing_ul_err[6]={15, 25, 32, 60, 80, 95}; -uint16_t protocol_processing_ul[6]={100, 200, 300, 400, 550, 700}; // assumption: max MCS 16 --> gives an upper bound for the transport block size - -int fill_modeled_runtime_table(uint16_t runtime_phy_rx[29][6], - uint16_t runtime_phy_tx[29][6]){ - //double cpu_freq; - //cpu_freq = get_cpu_freq_GHz(); - // target_dl_mcs - // target_ul_mcs - // frame_parms[0]->N_RB_DL - int i,j; - memset(runtime_phy_rx,0,sizeof(uint16_t)*29*6); - memset(runtime_phy_tx,0,sizeof(uint16_t)*29*6); - /* only the BBU/PHY procesing time */ - for (i=0;i<29;i++){ - for (j=0;j<6;j++){ - runtime_phy_rx[i][j] = cell_processing_ul[j] + platform_processing_ul + user_processing_ul_err[j] + user_processing_ul_a[j]*i+ user_processing_ul_b[j]; - runtime_phy_tx[i][j] = cell_processing_dl[j] + platform_processing_dl + user_processing_dl_err[j] + user_processing_dl_a[j]*i+ user_processing_dl_b[j]; - } - } - return 0; -} - -// int runtime_upper_layers[6]; // values for different RBs -// int runtime_phy_rx[29][6]; // SISO [MCS 0-28][RBs 0-5 : 6, 15, 25, 50, 75, 100] -// int runtime_phy_tx[29][6]; // SISO [MCS 0-28][RBs 0-5 : 6, 15, 25, 50, 75, 100] - -// target_dl_mcs - // target_ul_mcs - // frame_parms[0]->N_RB_DL - //runtime_upper_layers[6]; // values for different RBs - // int runtime_phy_rx[29][6]; // SISO [MCS 0-28][RBs 0-5 : 6, 15, 25, 50, 75, 100] - // int runtime_phy_tx[29][6] - -double get_runtime_tx(int tx_subframe, uint16_t runtime_phy_tx[29][6], uint32_t mcs, int N_RB_DL,double cpuf,int nb_tx_antenna){ - int i; - double runtime; - //printf("cpuf =%lf \n",cpuf); - switch(N_RB_DL){ - case 6: - i = 0; - break; - case 15: - i = 1; - break; - case 25: - i = 2; - break; - case 50: - i = 3; - break; - case 75: - i = 4; - break; - case 100: - i = 5; - break; - default: - i = 3; - break; - } - - runtime = ( (3.2/cpuf)*(double)runtime_phy_tx[mcs][i] + (3.2/cpuf)*(double)protocol_processing_dl[i])/1000 ; - printf("Setting tx %d runtime value (ms) = %lf\n",tx_subframe,runtime); - - return runtime; - } - -double get_runtime_rx(int rx_subframe, uint16_t runtime_phy_rx[29][6], uint32_t mcs, int N_RB_DL,double cpuf,int nb_rx_antenna){ - int i; - double runtime; - - //printf("N_RB_DL=%d cpuf =%lf \n",N_RB_DL, cpuf); - switch(N_RB_DL){ - case 6: - i = 0; - break; - case 15: - i = 1; - break; - case 25: - i = 2; - break; - case 50: - i = 3; - break; - case 75: - i = 4; - break; - case 100: - i = 5; - break; - default: - i = 3; - break; - } - - runtime = ((3.2/cpuf)*(double)runtime_phy_rx[mcs][i] + (3.2/cpuf)*(double)protocol_processing_ul[i])/1000 ; - printf("Setting rx %d runtime value (ms) = %lf \n",rx_subframe, runtime); - - return runtime; -} - -#ifdef DEADLINE_SCHEDULER -int sched_setattr(pid_t pid, const struct sched_attr *attr, unsigned int flags) -{ - - return syscall(__NR_sched_setattr, pid, attr, flags); -} - - -int sched_getattr(pid_t pid,struct sched_attr *attr,unsigned int size, unsigned int flags) -{ - - return syscall(__NR_sched_getattr, pid, attr, size, flags); -} - -#endif - -void thread_top_init(char *thread_name, - int affinity, - uint64_t runtime, - uint64_t deadline, - uint64_t period) { - - MSC_START_USE(); - -#ifdef DEADLINE_SCHEDULER - struct sched_attr attr; - - unsigned int flags = 0; - - attr.size = sizeof(attr); - attr.sched_flags = 0; - attr.sched_nice = 0; - attr.sched_priority = 0; - - attr.sched_policy = SCHED_DEADLINE; - attr.sched_runtime = runtime; - attr.sched_deadline = deadline; - attr.sched_period = period; - - if (sched_setattr(0, &attr, flags) < 0 ) { - perror("[SCHED] eNB tx thread: sched_setattr failed\n"); - fprintf(stderr,"sched_setattr Error = %s",strerror(errno)); - exit(1); - } - -#else //LOW_LATENCY - int policy, s, j; - struct sched_param sparam; - char cpu_affinity[1024]; - cpu_set_t cpuset; - int settingPriority = 1; - - /* Set affinity mask to include CPUs 2 to MAX_CPUS */ - /* CPU 0 is reserved for UHD threads */ - /* CPU 1 is reserved for all RX_TX threads */ - /* Enable CPU Affinity only if number of CPUs > 2 */ - CPU_ZERO(&cpuset); - -#ifdef CPU_AFFINITY - if (affinity == 0) { - LOG_W(HW,"thread_top_init() called with affinity==0, but overruled by #ifdef CPU_AFFINITY\n"); - } - else if (get_nprocs() > 2) - { - for (j = 2; j < get_nprocs(); j++) - CPU_SET(j, &cpuset); - s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); - if (s != 0) - { - perror( "pthread_setaffinity_np"); - exit_fun("Error setting processor affinity"); - } - } -#else //CPU_AFFINITY - if (affinity) { - LOG_W(HW,"thread_top_init() called with affinity>0, but overruled by #ifndef CPU_AFFINITY.\n"); - } -#endif //CPU_AFFINITY - - /* Check the actual affinity mask assigned to the thread */ - s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); - if (s != 0) - { - perror( "pthread_getaffinity_np"); - exit_fun("Error getting processor affinity "); - } - memset(cpu_affinity,0,sizeof(cpu_affinity)); - for (j = 0; j < 1024; j++) - { - if (CPU_ISSET(j, &cpuset)) - { - char temp[1024]; - sprintf (temp, " CPU_%d", j); - strcat(cpu_affinity, temp); - } - } - - if (checkIfFedoraDistribution()) - if (checkIfGenericKernelOnFedora()) - if (checkIfInsideContainer()) - settingPriority = 0; - - if (settingPriority) { - memset(&sparam, 0, sizeof(sparam)); - sparam.sched_priority = sched_get_priority_max(SCHED_FIFO); - policy = SCHED_FIFO; - - s = pthread_setschedparam(pthread_self(), policy, &sparam); - if (s != 0) { - perror("pthread_setschedparam : "); - exit_fun("Error setting thread priority"); - } - - s = pthread_getschedparam(pthread_self(), &policy, &sparam); - if (s != 0) { - perror("pthread_getschedparam : "); - exit_fun("Error getting thread priority"); - } - - pthread_setname_np(pthread_self(), thread_name); - - LOG_I(HW, "[SCHED][eNB] %s started on CPU %d, sched_policy = %s , priority = %d, CPU Affinity=%s \n",thread_name,sched_getcpu(), - (policy == SCHED_FIFO) ? "SCHED_FIFO" : - (policy == SCHED_RR) ? "SCHED_RR" : - (policy == SCHED_OTHER) ? "SCHED_OTHER" : - "???", - sparam.sched_priority, cpu_affinity ); - } - -#endif //LOW_LATENCY - - mlockall(MCL_CURRENT | MCL_FUTURE); - -} - - diff --git a/targets/RT/USER/rt_wrapper.h b/targets/RT/USER/rt_wrapper.h deleted file mode 100644 index 32554d9e17..0000000000 --- a/targets/RT/USER/rt_wrapper.h +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file rt_wrapper.h -* \brief provides a wrapper for the timing function for real-time opeartions. It also implements an API for the SCHED_DEADLINE kernel scheduler. -* \author F. Kaltenberger and Navid Nikaein -* \date 2013 -* \version 0.1 -* \company Eurecom -* \email: florian.kaltenberger@eurecom.fr, navid.nikaein@eurecom.fr -* \note -* \warning This code will be removed when a legacy libc API becomes available. -*/ - -#ifndef _RT_WRAPPER_H_ -#define _RT_WRAPPER_H_ - -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common/utils/LOG/log_extern.h" -#include "msc.h" - -#define RTIME long long int - -#define rt_printk printf - -void set_latency_target(void); - -RTIME rt_get_time_ns (void); - -int rt_sleep_ns (RTIME x); - -void check_clock(void); - -int fill_modeled_runtime_table(uint16_t runtime_phy_rx[29][6],uint16_t runtime_phy_tx[29][6]); - -double get_runtime_tx(int tx_subframe, uint16_t runtime_phy_tx[29][6],uint32_t mcs, int N_RB_DL,double cpuf,int nb_tx_antenna); - -double get_runtime_rx(int rx_subframe, uint16_t runtime_phy_rx[29][6], uint32_t mcs, int N_RB_DL,double cpuf,int nb_rx_antenna); -/** - * see https://www.kernel.org/doc/Documentation/scheduler/sched-deadline.txt or - * http://www.blaess.fr/christophe/2014/04/05/utiliser-un-appel-systeme-inconnu-de-la-libc/ - */ -#ifdef DEADLINE_SCHEDULER - -#define gettid() syscall(__NR_gettid) - -#define SCHED_DEADLINE 6 - -/* XXX use the proper syscall numbers */ -#ifdef __x86_64__ -#define __NR_sched_setattr 314 -#define __NR_sched_getattr 315 -#endif - -#ifdef __i386__ -#define __NR_sched_setattr 351 -#define __NR_sched_getattr 352 -#endif - -struct sched_attr { - __u32 size; - - __u32 sched_policy; - __u64 sched_flags; - - /* SCHED_NORMAL, SCHED_BATCH */ - __s32 sched_nice; - - /* SCHED_FIFO, SCHED_RR */ - __u32 sched_priority; - - /* SCHED_DEADLINE (nsec) */ - __u64 sched_runtime; - __u64 sched_deadline; - __u64 sched_period; -}; - -int sched_setattr(pid_t pid, const struct sched_attr *attr, unsigned int flags); - -int sched_getattr(pid_t pid,struct sched_attr *attr,unsigned int size, unsigned int flags); - -#endif - -#define gettid() syscall(__NR_gettid) // for gettid - - -void thread_top_init(char *thread_name, - int affinity, - uint64_t runtime, - uint64_t deadline, - uint64_t period); - -#endif diff --git a/targets/RT/USER/ru_control.c b/targets/RT/USER/ru_control.c index 95b5ce6155..7280c78523 100644 --- a/targets/RT/USER/ru_control.c +++ b/targets/RT/USER/ru_control.c @@ -42,7 +42,6 @@ #include #include #include -#include "rt_wrapper.h" #undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all From 42bf5765967cc6150336e7af629d4c9d82f9c4b6 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 10 Jan 2022 14:09:21 +0100 Subject: [PATCH 055/107] review fixes --- executables/nr-softmodem.h | 2 +- executables/nr-uesoftmodem.h | 2 +- openair2/RRC/NR/rrc_gNB_nsa.c | 9 +++------ openair2/RRC/NR_UE/rrc_UE.c | 10 +++------- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/executables/nr-softmodem.h b/executables/nr-softmodem.h index 926b4b1f0f..4190a6074b 100644 --- a/executables/nr-softmodem.h +++ b/executables/nr-softmodem.h @@ -29,7 +29,7 @@ {"D" , CONFIG_HLP_DLBM_PHYTEST,0, u64ptr:&dlsch_slot_bitmap, defintval:0, TYPE_UINT64, 0}, \ {"U" , CONFIG_HLP_ULBM_PHYTEST,0, u64ptr:&ulsch_slot_bitmap, defintval:0, TYPE_UINT64, 0}, \ {"usrp-tx-thread-config", CONFIG_HLP_USRP_THREAD, 0, iptr:&usrp_tx_thread, defstrval:0, TYPE_INT, 0}, \ - {"uecap_file", CONFIG_HLP_UECAP_FILE, 0, strptr:(char **)&uecap_file, defstrval:"./", TYPE_STRING, 0}, \ + {"uecap_file", CONFIG_HLP_UECAP_FILE, 0, strptr:(char **)&uecap_file, defstrval:"./uecap.xml", TYPE_STRING, 0}, \ {"s" , CONFIG_HLP_SNR, 0, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0}, \ } diff --git a/executables/nr-uesoftmodem.h b/executables/nr-uesoftmodem.h index b1810a1f4f..95914678e5 100644 --- a/executables/nr-uesoftmodem.h +++ b/executables/nr-uesoftmodem.h @@ -34,7 +34,7 @@ {"offset-divisor", CONFIG_HLP_OFFSET_DIV, 0, uptr:(uint32_t *)&nrUE_params.ofdm_offset_divisor, defuintval:UINT_MAX, TYPE_UINT32, 0}, \ {"nr-dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&nr_dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \ {"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&vcdflag, defintval:0, TYPE_INT, 0}, \ - {"uecap_file", CONFIG_HLP_UECAP_FILE, 0, strptr:(char **)&uecap_file, defstrval:"./", TYPE_STRING, 0}, \ + {"uecap_file", CONFIG_HLP_UECAP_FILE, 0, strptr:(char **)&uecap_file, defstrval:"./uecap.xml", TYPE_STRING, 0}, \ {"rrc_config_path", CONFIG_HLP_RRC_CFG_PATH,0, strptr:(char **)&rrc_config_path, defstrval:"./", TYPE_STRING, 0}, \ {"ue-idx-standalone", NULL, 0, u16ptr:&ue_idx_standalone, defuintval:0xFFFF, TYPE_UINT16, 0} \ } diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 414d6d809d..15caff0b4d 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -148,17 +148,14 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ // In case of phy-test and do-ra mode, read UE capabilities directly from file if (get_softmodem_params()->phy_test == 1 || get_softmodem_params()->do_ra == 1) { NR_UE_NR_Capability_t* UE_Capability_nr = NULL; - char UE_NR_Capability_xer_fname[1024]; char UE_NR_Capability_xer[65536]; FILE *f = NULL; - if (uecap_file) { - sprintf(UE_NR_Capability_xer_fname,"%s",uecap_file); - f = fopen(UE_NR_Capability_xer_fname, "r"); - } + if (uecap_file) + f = fopen(uecap_file, "r"); if(f){ size_t size = fread(UE_NR_Capability_xer, 1, sizeof UE_NR_Capability_xer, f); if (size == 0 || size == sizeof UE_NR_Capability_xer) - LOG_E(NR_RRC,"UE Capabilities XER file %s is too large (%ld)\n", UE_NR_Capability_xer_fname,size); + LOG_E(NR_RRC,"UE Capabilities XER file %s is too large (%ld)\n", uecap_file, size); else { UE_Capability_nr = CALLOC(1,sizeof(NR_UE_NR_Capability_t)); asn_dec_rval_t dec_rval = xer_decode(0, &asn_DEF_NR_UE_NR_Capability, (void *)&UE_Capability_nr, UE_NR_Capability_xer, size); diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index 21ccd4226b..bc209afd02 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -2639,7 +2639,6 @@ nr_rrc_ue_process_ueCapabilityEnquiry( asn_dec_rval_t dec_rval; NR_UL_DCCH_Message_t ul_dcch_msg; NR_UE_CapabilityRAT_Container_t ue_CapabilityRAT_Container; - char UE_NR_Capability_xer_fname[1024]; char UE_NR_Capability_xer[65536]; size_t size; uint8_t buffer[200]; @@ -2662,15 +2661,12 @@ nr_rrc_ue_process_ueCapabilityEnquiry( char *file_path = NR_UE_rrc_inst[ctxt_pP->module_id].uecap_file; FILE *f = NULL; - if (file_path) { - sprintf(UE_NR_Capability_xer_fname,"%s",file_path); - f = fopen(UE_NR_Capability_xer_fname, "r"); - } - + if (file_path) + f = fopen(file_path, "r"); if(f){ size = fread(UE_NR_Capability_xer, 1, sizeof UE_NR_Capability_xer, f); if (size == 0 || size == sizeof UE_NR_Capability_xer) { - LOG_E(NR_RRC,"UE Capabilities XER file %s is too large (%ld)\n", UE_NR_Capability_xer_fname,size); + LOG_E(NR_RRC,"UE Capabilities XER file %s is too large (%ld)\n", file_path,size); free(UE_Capability_nr); return; } From 08067342543106db8c2fba67ee4b6786b1c9a307 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Mon, 10 Jan 2022 17:10:07 +0100 Subject: [PATCH 056/107] T tracer: add option to have both T traces and regular console logs Use --T_stdout 2 to have both. --T_stdout 0 is still the way to have only T traces and no console logs. --- common/utils/LOG/DOC/log.md | 2 +- common/utils/LOG/log.h | 10 +++++----- common/utils/T/T.c | 7 ++++++- common/utils/T/T.h | 4 ++-- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/common/utils/LOG/DOC/log.md b/common/utils/LOG/DOC/log.md index 4b3e5981e1..4d97e3845d 100644 --- a/common/utils/LOG/DOC/log.md +++ b/common/utils/LOG/DOC/log.md @@ -8,7 +8,7 @@ By default, this facility is included at build-time and activated at run-time. T ```bash /build_oai --disable-T-Tracer ``` -- To use the the T-Tracer instead of the console logging facility, use the command line option *T_stdout*. *T_stdout* is a boolean option, which, when set to 0 (false) disable the console logging facility. All stdout messages are then sent to the T-Tracer. +- To use the the T-Tracer, use the command line option *T_stdout*. When set to 0, it disables the console logging facility. All stdout messages are then sent to the T-Tracer. When set to 1 (the default), the logs are output to the linux console and no T trace is generated. When set to 2 both console logging and T traces are activated. ## Documentation diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h index d644445424..350337b61b 100644 --- a/common/utils/LOG/log.h +++ b/common/utils/LOG/log.h @@ -428,12 +428,12 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int # if T_TRACER /* per component, level dependent macros */ -# define LOG_E(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_ERR ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ERR, x) ;} else { T(T_LEGACY_ ## c ## _ERROR, T_PRINTF(x)) ;}} while (0) -# define LOG_W(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_WARNING) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_WARNING, x) ;} else { T(T_LEGACY_ ## c ## _WARNING, T_PRINTF(x)) ;}} while (0) +# define LOG_E(c, x...) do { T(T_LEGACY_ ## c ## _ERROR, T_PRINTF(x)) ; if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_ERR ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ERR, x) ;} } while (0) +# define LOG_W(c, x...) do { T(T_LEGACY_ ## c ## _WARNING, T_PRINTF(x)); if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_WARNING) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_WARNING, x);} } while (0) # define LOG_A LOG_I -# define LOG_I(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_INFO ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ;} else { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ;}} while (0) -# define LOG_D(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_DEBUG ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ;} else { T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x)) ;}} while (0) -# define LOG_T(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_TRACE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_TRACE, x) ;} else { T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x)) ;}} while (0) +# define LOG_I(c, x...) do { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ; if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_INFO ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ;} } while (0) +# define LOG_D(c, x...) do { T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x)) ; if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_DEBUG ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ;} } while (0) +# define LOG_T(c, x...) do { T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x)) ; if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_TRACE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_TRACE, x) ;} } while (0) # define VLOG(c,l, f, args) do { if (T_stdout) { if( g_log->log_component[c].level >= l ) vlogRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, l, f, args) ;} } while (0) /* macro used to dump a buffer or a message as in openair2/RRC/LTE/RRC_eNB.c, replaces LOG_F macro */ # define LOG_DUMPMSG(c, f, b, s, x...) do { if(g_log->dump_mask & f) log_dump(c, b, s, LOG_DUMP_CHAR, x) ;} while (0) /* */ diff --git a/common/utils/T/T.c b/common/utils/T/T.c index 8ee359b77f..49742bf600 100644 --- a/common/utils/T/T.c +++ b/common/utils/T/T.c @@ -217,6 +217,11 @@ void T_Config_Init(void) { sizeof(ttraceparams) / sizeof(paramdef_t), NULL); - if (T_stdout == 0) + if (T_stdout < 0 || T_stdout > 2) { + printf("fatal error: T_stdout = %d but only values 0, 1, or 2 are allowed\n", T_stdout); + exit(1); + } + + if (T_stdout == 0 || T_stdout == 2) T_init(T_port, 1-T_nowait, T_dont_fork); } diff --git a/common/utils/T/T.h b/common/utils/T/T.h index 626dbafd25..0142945054 100644 --- a/common/utils/T/T.h +++ b/common/utils/T/T.h @@ -100,7 +100,7 @@ extern int T_stdout; 20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)(__VA_ARGS__) #define TN_N(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,\ n18,n19,n20,n21,n22,n23,n24,n25,n26,n27,n28,n29,n30,n31,n32,n,...) T##n -#define T(...) do { if (T_stdout == 0) TN(__VA_ARGS__); } while (0) +#define T(...) do { if (T_stdout == 0 || T_stdout == 2) TN(__VA_ARGS__); } while (0) /* type used to send arbitrary buffer data */ typedef struct { @@ -607,7 +607,7 @@ extern int *T_active; {"T_port", CONFIG_HLP_TPORT, 0, iptr:&T_port, defintval:TTRACER_DEFAULT_PORTNUM, TYPE_INT, 0},\ {"T_nowait", CONFIG_HLP_NOTWAIT, PARAMFLAG_BOOL, iptr:&T_nowait, defintval:0, TYPE_INT, 0},\ {"T_dont_fork", CONFIG_HLP_TNOFORK, PARAMFLAG_BOOL, iptr:&T_dont_fork, defintval:0, TYPE_INT, 0},\ - {"T_stdout", CONFIG_HLP_STDOUT, PARAMFLAG_BOOL, iptr:&T_stdout, defintval:1, TYPE_INT, 0},\ + {"T_stdout", CONFIG_HLP_STDOUT, 0, iptr:&T_stdout, defintval:1, TYPE_INT, 0},\ } From fe81d31ea3eb87454d027ea67ae5fb2fe5243df7 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Mon, 10 Jan 2022 17:10:35 +0100 Subject: [PATCH 057/107] compilation warnings fixes The previous commit created two new warnings: warning: 'avgs' may be used uninitialized in this function warning: 'seq_index' may be used uninitialized in this function This commit removes them. Maybe it's not the correct solution. To be fixed if needed. --- openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c | 2 +- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c index 28dd5ab219..681a9eae16 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c @@ -1174,7 +1174,7 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB, uint8_t aarx, aatx; uint32_t nb_re_pusch, bwp_start_subcarrier; - int avgs; + int avgs = 0; NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms; nfapi_nr_pusch_pdu_t *rel15_ul = &gNB->ulsch[ulsch_id][0]->harq_processes[harq_pid]->ulsch_pdu; diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 8844a530af..22c8ff0b0e 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -302,7 +302,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, int32_t corr_re[1+frame_parms->nb_antennas_rx][2]; int32_t corr_im[1+frame_parms->nb_antennas_rx][2]; //int32_t no_corr = 0; - int seq_index; + int seq_index = 0; int64_t temp; for(i=0;i Date: Thu, 6 Jan 2022 12:09:15 +0100 Subject: [PATCH 058/107] nr ue: fix rlc and pdcp tick generation Ticks have to come every millisecond. The code was calling tick only for DL slots. (This whole logic will change at some point, this tick mechanism is not good. But in the meantime, let's fix anyway.) --- executables/nr-ue.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 46c1cff491..05f9efae3c 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -698,6 +698,16 @@ void processSlotRX(void *arg) { int tx_slot_type = nr_ue_slot_select(cfg, proc->frame_tx, proc->nr_slot_tx); uint8_t gNB_id = 0; + if (IS_SOFTMODEM_NOS1 || get_softmodem_params()->sa) { + /* send tick to RLC and PDCP every ms */ + if (proc->nr_slot_rx % UE->frame_parms.slots_per_subframe == 0) { + void nr_rlc_tick(int frame, int subframe); + void nr_pdcp_tick(int frame, int subframe); + nr_rlc_tick(proc->frame_rx, proc->nr_slot_rx / UE->frame_parms.slots_per_subframe); + nr_pdcp_tick(proc->frame_rx, proc->nr_slot_rx / UE->frame_parms.slots_per_subframe); + } + } + if (rx_slot_type == NR_DOWNLINK_SLOT || rx_slot_type == NR_MIXED_SLOT){ if(UE->if_inst != NULL && UE->if_inst->dl_indication != NULL) { @@ -720,14 +730,6 @@ void processSlotRX(void *arg) { protocol_ctxt_t ctxt; PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, UE->Mod_id, ENB_FLAG_NO, mac->crnti, proc->frame_rx, proc->nr_slot_rx, 0); pdcp_run(&ctxt); - - /* send tick to RLC and PDCP every ms */ - if (proc->nr_slot_rx % UE->frame_parms.slots_per_subframe == 0) { - void nr_rlc_tick(int frame, int subframe); - void nr_pdcp_tick(int frame, int subframe); - nr_rlc_tick(proc->frame_rx, proc->nr_slot_rx / UE->frame_parms.slots_per_subframe); - nr_pdcp_tick(proc->frame_rx, proc->nr_slot_rx / UE->frame_parms.slots_per_subframe); - } } // calling UL_indication to schedule things other than PUSCH (eg, PUCCH) rxtxD->ue_sched_mode = NOT_PUSCH; From 2ac6a30cffe8d71b534189af30ac57db54aea5b3 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 12 Jan 2022 11:27:50 +0100 Subject: [PATCH 059/107] fix(ci): forcing USRP N3xx reboot on caracal; creating a real dummy scenario Signed-off-by: Raphael Defosseux --- ci-scripts/ran.py | 2 +- ci-scripts/xml_files/gnb_phytest_usrp_run.xml | 25 ++++++++++--------- ci-scripts/xml_files/simple_dummy_build.xml | 8 +++++- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index f01b85015b..4caa876719 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -346,7 +346,7 @@ class RANManagement(): #reboot USRP if requested in xml if self.USRPIPAddress!='': - logging.debug('USRP '+ self.USRPIPAddress +'reboot request') + logging.debug('USRP '+ self.USRPIPAddress +': reboot request') mySSH.open(lIpAddr, lUserName, lPassWord) cmd2usrp='ssh root@'+self.USRPIPAddress+' reboot' mySSH.command2(cmd2usrp,1) diff --git a/ci-scripts/xml_files/gnb_phytest_usrp_run.xml b/ci-scripts/xml_files/gnb_phytest_usrp_run.xml index 9365d7f12e..f1185c08c9 100644 --- a/ci-scripts/xml_files/gnb_phytest_usrp_run.xml +++ b/ci-scripts/xml_files/gnb_phytest_usrp_run.xml @@ -21,21 +21,22 @@ --> - gNB-PHY-Test - Run-gNB-PHY-Test - tasks + gNB-PHY-Test + Run-gNB-PHY-Test + tasks 3 090101 000001 090109 - - - Initialize_eNB - Initialize gNB USRP + + + Initialize_eNB + Initialize gNB USRP -O ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf --phy-test -q -U 787200 -T 106 -t 28 -D 130175 -m 28 -M 106 --log_config.global_log_options level,nocolor,time NR - + 192.168.30.2 + IdleSleep @@ -44,10 +45,10 @@ - - Terminate_eNB - Terminate gNB + + Terminate_eNB + Terminate gNB NR - + diff --git a/ci-scripts/xml_files/simple_dummy_build.xml b/ci-scripts/xml_files/simple_dummy_build.xml index 75e5f6339a..a3649c210c 100644 --- a/ci-scripts/xml_files/simple_dummy_build.xml +++ b/ci-scripts/xml_files/simple_dummy_build.xml @@ -25,7 +25,7 @@ Build wrench - 010101 + 000001 @@ -38,4 +38,10 @@ 0 + + IdleSleep + Sleep + 5 + + From 586b91b461ec82edfbda3ffc309e608a37f9c08b Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Wed, 12 Jan 2022 11:35:49 +0100 Subject: [PATCH 060/107] fix dlsim regression --- executables/nr-uesoftmodem.c | 1 + openair1/SIMULATION/LTE_PHY/dlsim.c | 11 +++++++++++ openair1/SIMULATION/LTE_PHY/dummy_functions.c | 6 ------ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index ac89bcfd4e..989d2b6f61 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -84,6 +84,7 @@ unsigned short config_frames[4] = {2,9,11,13}; #include "executables/thread-common.h" #include "nr_nas_msg_sim.h" +#include extern const char *duplex_mode[]; THREAD_STRUCT thread_struct; diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index 833207a408..b61d1b1476 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -1247,6 +1247,17 @@ int main(int argc, char **argv) { eNB->dlsch[k][i]->rnti = n_rnti+k; } } + + for (int i=0;iulsch[i] = new_eNB_ulsch(MAX_TURBO_ITERATIONS,eNB->frame_parms.N_RB_UL, 0); + + if (!eNB->ulsch[i]) { + LOG_E(PHY,"Can't get eNB ulsch structures\n"); + exit(-1); + } + } /* allocate memory for both subframes (only one is really used * but there is now "copy_harq_proc_struct" which needs both diff --git a/openair1/SIMULATION/LTE_PHY/dummy_functions.c b/openair1/SIMULATION/LTE_PHY/dummy_functions.c index 120e4845d9..fcbab51f4b 100644 --- a/openair1/SIMULATION/LTE_PHY/dummy_functions.c +++ b/openair1/SIMULATION/LTE_PHY/dummy_functions.c @@ -86,12 +86,6 @@ int8_t get_Po_NOMINAL_PUSCH(module_id_t module_idP, uint8_t CC_id) { return(0);} int8_t get_deltaP_rampup(module_id_t module_idP, uint8_t CC_id) { return(0);} -void thread_top_init(char *thread_name, - int affinity, - uint64_t runtime, - uint64_t deadline, - uint64_t period) {} - int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) { return(0);} int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) { return(0); } From d108d9c651869a56b2f603ee33ec8b7956648a70 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Wed, 12 Jan 2022 15:22:10 +0100 Subject: [PATCH 061/107] fix loop on wrong array size in 4G dlsim --- openair1/SIMULATION/LTE_PHY/dlsim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index b61d1b1476..32f17c09a1 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -1234,7 +1234,7 @@ int main(int argc, char **argv) { break; } - for (k=0; kdlsch[k][i] = new_eNB_dlsch(Kmimo,8,Nsoft,N_RB_DL,0,&eNB->frame_parms); From d7515686892c76937e971a842ab8af464041dcea Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Wed, 12 Jan 2022 16:12:36 +0100 Subject: [PATCH 062/107] fix a bug in call to realloc inside a function --- openair1/PHY/INIT/nr_init_ue.c | 1 + openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c | 2 +- openair1/SIMULATION/LTE_PHY/dlsim.c | 12 ++++++------ openair1/SIMULATION/LTE_PHY/mbmssim.c | 12 ++++++------ openair1/SIMULATION/LTE_PHY/ulsim.c | 18 +++++++++--------- openair2/UTIL/LISTS/list.h | 9 +++++++-- 6 files changed, 30 insertions(+), 24 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index f664a03ba0..c193733aef 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -41,6 +41,7 @@ #include "PHY/NR_REFSIG/ul_ref_seq_nr.h" #include "PHY/NR_REFSIG/refsig_defs_ue.h" #include "PHY/NR_REFSIG/nr_refsig.h" +#include #if 0 void phy_config_harq_ue(module_id_t Mod_id, diff --git a/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c index 82bb0a2659..e0cf694fff 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c @@ -46,7 +46,7 @@ void pcfich_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, uint32_t i; uint8_t reset; - uint32_t x1, x2, s=0; + uint32_t x1=0, x2=0, s=0; reset = 1; // x1 is set in lte_gold_generic diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index 32f17c09a1..c1443700f3 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -1826,12 +1826,12 @@ int main(int argc, char **argv) { if (t_rx > 2000 ) n_rx_dropped++; - appendVarArray(table_tx, &t_tx); - appendVarArray(table_tx_ifft, &t_tx_ifft); - appendVarArray(table_rx, &t_rx ); - appendVarArray(table_rx_fft, &t_rx_fft ); - appendVarArray(table_rx_demod, &t_rx_demod ); - appendVarArray(table_rx_dec, &t_rx_dec ); + appendVarArray(&table_tx, &t_tx); + appendVarArray(&table_tx_ifft, &t_tx_ifft); + appendVarArray(&table_rx, &t_rx ); + appendVarArray(&table_rx_fft, &t_rx_fft ); + appendVarArray(&table_rx_demod, &t_rx_demod ); + appendVarArray(&table_rx_dec, &t_rx_dec ); } //trials // round_trials[0]: number of code word : goodput the protocol diff --git a/openair1/SIMULATION/LTE_PHY/mbmssim.c b/openair1/SIMULATION/LTE_PHY/mbmssim.c index 53c15ccc89..31c3b47227 100644 --- a/openair1/SIMULATION/LTE_PHY/mbmssim.c +++ b/openair1/SIMULATION/LTE_PHY/mbmssim.c @@ -1971,12 +1971,12 @@ int main(int argc, char **argv) { if (t_rx > 2000 ) n_rx_dropped++; - appendVarArray(table_tx, &t_tx); - appendVarArray(table_tx_ifft, &t_tx_ifft); - appendVarArray(table_rx, &t_rx ); - appendVarArray(table_rx_fft, &t_rx_fft ); - appendVarArray(table_rx_demod, &t_rx_demod ); - appendVarArray(table_rx_dec, &t_rx_dec ); + appendVarArray(&table_tx, &t_tx); + appendVarArray(&table_tx_ifft, &t_tx_ifft); + appendVarArray(&table_rx, &t_rx ); + appendVarArray(&table_rx_fft, &t_rx_fft ); + appendVarArray(&table_rx_demod, &t_rx_demod ); + appendVarArray(&table_rx_dec, &t_rx_dec ); } //trials // round_trials[0]: number of code word : goodput the protocol diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c index 39593a640c..1b1058535e 100644 --- a/openair1/SIMULATION/LTE_PHY/ulsim.c +++ b/openair1/SIMULATION/LTE_PHY/ulsim.c @@ -743,7 +743,7 @@ int main(int argc, char **argv) { UE2eNB->max_Doppler = maxDoppler; // NN: N_RB_UL has to be defined in ulsim - for (int k=0; kulsch[k] = new_eNB_ulsch(max_turbo_iterations,N_RB_DL,0); + for (int k=0; kulsch[k] = new_eNB_ulsch(max_turbo_iterations,N_RB_DL,0); UE->ulsch[0] = new_ue_ulsch(N_RB_DL,0); printf("ULSCH %p\n",UE->ulsch[0]); @@ -1279,14 +1279,14 @@ int main(int argc, char **argv) { n_rx_dropped++; if (trials < 1000) { - appendVarArray(table_tx, &t_tx); - appendVarArray(table_tx_ifft, &t_tx_ifft); - appendVarArray(table_tx_mod, &t_tx_mod ); - appendVarArray(table_tx_enc, &t_tx_enc ); - appendVarArray(table_rx, &t_rx ); - appendVarArray(table_rx_fft, &t_rx_fft ); - appendVarArray(table_rx_demod, &t_rx_demod ); - appendVarArray(table_rx_dec, &t_rx_dec ); + appendVarArray(&table_tx, &t_tx); + appendVarArray(&table_tx_ifft, &t_tx_ifft); + appendVarArray(&table_tx_mod, &t_tx_mod ); + appendVarArray(&table_tx_enc, &t_tx_enc ); + appendVarArray(&table_rx, &t_rx ); + appendVarArray(&table_rx_fft, &t_rx_fft ); + appendVarArray(&table_rx_demod, &t_rx_demod ); + appendVarArray(&table_rx_dec, &t_rx_dec ); } } //trials diff --git a/openair2/UTIL/LISTS/list.h b/openair2/UTIL/LISTS/list.h index b88c581dea..079c723ebf 100644 --- a/openair2/UTIL/LISTS/list.h +++ b/openair2/UTIL/LISTS/list.h @@ -48,6 +48,8 @@ #include "UTIL/MEM/mem_block.h" +#include + //----------------------------------------------------------------------------- void list_init (list_t* , char *); @@ -126,10 +128,13 @@ static inline void * dataArray(varArray_t * input) { return input+1; } -static inline void appendVarArray(varArray_t * input, void* data) { +static inline void appendVarArray(varArray_t ** inputPtr, void* data) { + varArray_t *input=*inputPtr; if (input->size>=input->mallocedSize) { input->mallocedSize+=input->increment; - input=(varArray_t *)realloc(input,sizeof(varArray_t)+input->mallocedSize*input->atomSize); + *inputPtr=(varArray_t *)realloc(input,sizeof(varArray_t)+input->mallocedSize*input->atomSize); + AssertFatal(*inputPtr, "no memory left"); + input=*inputPtr; } memcpy((uint8_t*)(input+1)+input->atomSize*input->size++, data, input->atomSize); } From 83ab3ea39f5874a09de048c9d1904bb58ec33500 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 13 Jan 2022 13:57:50 +0100 Subject: [PATCH 063/107] fix(docker): phySim image was always built on the latest of develop branch and not current code for merge requests Signed-off-by: Raphael Defosseux --- docker/Dockerfile.phySim.rhel8.2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docker/Dockerfile.phySim.rhel8.2 b/docker/Dockerfile.phySim.rhel8.2 index 0e76a12805..141a80cb50 100644 --- a/docker/Dockerfile.phySim.rhel8.2 +++ b/docker/Dockerfile.phySim.rhel8.2 @@ -27,6 +27,10 @@ FROM ran-base:latest AS phy-sim-build +RUN rm -Rf /oai-ran +WORKDIR /oai-ran +COPY . . + #run build_oai to build the target image RUN /bin/sh oaienv && \ cd cmake_targets && \ From 2ccc7188e50a3efc73d693d418109ecd50ca2018 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Thu, 13 Jan 2022 14:39:56 +0100 Subject: [PATCH 064/107] fix regression in merge develop and some warnings --- .../install_external_packages.ubuntu20 | 3 ++- openair1/PHY/INIT/nr_init_ue.c | 1 + openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c | 2 +- openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c | 4 ++-- openair1/SIMULATION/NR_PHY/dlsim.c | 22 +++++++++---------- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/cmake_targets/install_external_packages.ubuntu20 b/cmake_targets/install_external_packages.ubuntu20 index f0314ca575..f8b64980f6 100755 --- a/cmake_targets/install_external_packages.ubuntu20 +++ b/cmake_targets/install_external_packages.ubuntu20 @@ -24,6 +24,7 @@ # authors Laurent Thomas # ####################################### + if [ ! -f /etc/os-release ]; then echo "No /etc/os-release file found. You're likely on an unsupported distro." exit 1 @@ -483,7 +484,7 @@ if ! check_supported_distribution; then echo_error "Your distribution $(get_distribution_release) is not supported by oai !" exit 1 fi - +set_openair_env echo_info "Installing packages" check_install_ubuntu_packages diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index f664a03ba0..c193733aef 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -41,6 +41,7 @@ #include "PHY/NR_REFSIG/ul_ref_seq_nr.h" #include "PHY/NR_REFSIG/refsig_defs_ue.h" #include "PHY/NR_REFSIG/nr_refsig.h" +#include #if 0 void phy_config_harq_ue(module_id_t Mod_id, diff --git a/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c index 82bb0a2659..e0cf694fff 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c @@ -46,7 +46,7 @@ void pcfich_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, uint32_t i; uint8_t reset; - uint32_t x1, x2, s=0; + uint32_t x1=0, x2=0, s=0; reset = 1; // x1 is set in lte_gold_generic diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c index afd1fc6e0d..819fccc588 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c @@ -294,8 +294,8 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ENCODING, VCD_FUNCTION_IN); uint32_t A = rel15->TBSize[0]<<3; - if ( dlsch->rnti != SI_RNTI ) - trace_NRpdu(DIRECTION_DOWNLINK, a, rel15->TBSize[0], 0, WS_C_RNTI, dlsch->rnti, frame, slot,0, 0); + if ( rel15->rnti != SI_RNTI) + trace_NRpdu(DIRECTION_DOWNLINK, a, rel15->TBSize[0], 0, WS_C_RNTI, rel15->rnti, frame, slot,0, 0); NR_gNB_SCH_STATS_t *stats=NULL; int first_free=-1; diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 9c0772bf48..5c64affd14 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -982,10 +982,15 @@ int main(int argc, char **argv) gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t)); initTpool(gNBthreads, gNB->threadPool, true); - gNB->resp_L1_tx = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); - initNotifiedFIFO(gNB->resp_L1_tx); + // L1 TX result FIFO + gNB->L1_tx_free = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); + gNB->L1_tx_filled = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); + gNB->L1_tx_out = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); + initNotifiedFIFO(gNB->L1_tx_free); + initNotifiedFIFO(gNB->L1_tx_filled); + initNotifiedFIFO(gNB->L1_tx_out); // we create 2 threads for L1 tx processing - notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->resp_L1_tx,processSlotTX); + notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->L1_tx_free,processSlotTX); processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx); init_DLSCH_struct(gNB, msgDataTx); msgDataTx->slot = slot; @@ -1305,17 +1310,10 @@ int main(int argc, char **argv) printf("\n"); if (print_perf==1) { - printf("\ngNB TX function statistics (per %d us slot, NPRB %d, mcs %d, TBS %d)\n", + printf("\ngNB TX function statistics (per %d us slot, NPRB %d, mcs %d, block %d)\n", 1000>>*scc->ssbSubcarrierSpacing, g_rbSize, g_mcsIndex, -<<<<<<< HEAD - msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3, - msgDataTx->dlsch[0][0]->harq_process.K, - msgDataTx->dlsch[0][0]->harq_process.K/((msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3)>3824?22:10)); - printDistribution(gNB->phy_proc_tx[0],table_tx,"PHY proc tx"); -======= msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3); - printDistribution(gNB->phy_proc_tx_0,table_tx,"PHY proc tx"); ->>>>>>> 264e829922fc68e4caa3611b70d921c131e7ca68 + printDistribution(gNB->phy_proc_tx[0],table_tx,"PHY proc tx"); printStatIndent2(&gNB->dlsch_encoding_stats,"DLSCH encoding time"); printStatIndent3(&gNB->dlsch_segmentation_stats,"DLSCH segmentation time"); printStatIndent3(&gNB->tinput,"DLSCH LDPC input processing time"); From 3f2dd17191f1c04721a05fa80ddfe340d0739779 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Thu, 13 Jan 2022 16:04:16 +0100 Subject: [PATCH 065/107] code review comments + re-test --- cmake_targets/build_oai | 2 +- .../install_external_packages.ubuntu20 | 11 - cmake_targets/nas_sim_tools/CMakeLists.txt | 1 + cmake_targets/tools/build_helper | 2 +- common/utils/system.c | 2 +- common/utils/system.h | 7 +- common/utils/utils.c | 16 - common/utils/utils.h | 104 +- executables/main-ocp.c | 2 +- executables/nr-softmodem.c | 2 +- executables/nr-uesoftmodem.c | 2 +- executables/ocp-gnb.c | 2 +- openair1/PHY/TOOLS/calibration_test.c | 2 +- openair1/PHY/impl_defs_top.h | 47 +- openair2/COMMON/openair_defs.h | 22 +- openair2/SIMULATION/NR_RRC/itti_sim.c | 2 +- targets/RT/USER/lte-softmodem.c | 2 +- targets/RT/USER/lte-uesoftmodem.c | 2 +- targets/build_helper.bash | 1315 ----------------- targets/build_oai.bash | 840 ----------- 20 files changed, 116 insertions(+), 2269 deletions(-) delete mode 100755 targets/build_helper.bash delete mode 100755 targets/build_oai.bash diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index b427b161e5..2dc03967f6 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -707,7 +707,7 @@ function main() { # generate USIM data if [ -f $dbin/conf2uedata ]; then - install_nas_tools $conf_nvram_path $gen_nvram_path + install_nas_tools $conf_nvram_path $gen_nvram_path "$dlog/conf2uedata.txt" echo_info "Copying UE specific part to $DIR/$build_dir/build" cp -Rvf $dbin/.ue_emm.nvram0 $DIR/$build_dir/build cp -Rvf $dbin/.ue.nvram0 $DIR/$build_dir/build diff --git a/cmake_targets/install_external_packages.ubuntu20 b/cmake_targets/install_external_packages.ubuntu20 index f0314ca575..0023c8d3c8 100755 --- a/cmake_targets/install_external_packages.ubuntu20 +++ b/cmake_targets/install_external_packages.ubuntu20 @@ -452,17 +452,6 @@ install_asn1c_from_source(){ ) > "$asn1_install_log" 2>&1 } -################################################# -# 2. compile -################################################ - -install_nas_tools() { - echo_success "generate .ue_emm.nvram .ue.nvram" - ./nvram --gen -c "$1" -o "$2" - ./usim --gen -c "$1" -o "$2" -} - - ################################ # set_openair_env ############################### diff --git a/cmake_targets/nas_sim_tools/CMakeLists.txt b/cmake_targets/nas_sim_tools/CMakeLists.txt index 308c71be4c..739e55a33e 100755 --- a/cmake_targets/nas_sim_tools/CMakeLists.txt +++ b/cmake_targets/nas_sim_tools/CMakeLists.txt @@ -15,6 +15,7 @@ set(CMAKE_C_FLAGS set(OPENAIR_DIR $ENV{OPENAIR_DIR}) set(OPENAIR3_DIR $ENV{OPENAIR_DIR}/openair3) include_directories (${OPENAIR_DIR}/openair2/COMMON) +include_directories (${OPENAIR_DIR}) set(CONF2UEDATA_LIB_SRC ${OPENAIR_DIR}/openair3/NAS/TOOLS/conf_emm.c diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 06f32183b7..7eeba80920 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -901,7 +901,7 @@ install_nas_tools() { if [ ! -f .usim.nvram0 ]; then echo_success "generate .usim.nvram" - ./usim --gen -c $1 -o $2 + ./usim --gen -c $1 -o $2 > "$3" else [ ./usim -nt .usim.nvram0 ] && ./usim --gen -c $1 -o $2 fi diff --git a/common/utils/system.c b/common/utils/system.c index 07a85fad97..d897063144 100644 --- a/common/utils/system.c +++ b/common/utils/system.c @@ -391,7 +391,7 @@ void thread_top_init(char *thread_name, // Block CPU C-states deep sleep -void configure_linux(void) { +void set_latency_target(void) { int ret; static int latency_target_fd=-1; uint32_t latency_target_value=2; // in microseconds diff --git a/common/utils/system.h b/common/utils/system.h index 0554163ba1..c25c2a6f1f 100644 --- a/common/utils/system.h +++ b/common/utils/system.h @@ -43,10 +43,9 @@ int background_system(char *command); void start_background_system(void); void set_latency_target(void); -void configure_linux(void); -void threadCreate(pthread_t* t, void * (*func)(void*), void * param, char* name, int affinity, int priority); - +void threadCreate(pthread_t *t, void *(*func)(void *), void *param, char *name, int affinity, int priority); + #define SCHED_OAI SCHED_RR #define OAI_PRIORITY_RT_LOW sched_get_priority_min(SCHED_OAI) #define OAI_PRIORITY_RT ((sched_get_priority_min(SCHED_OAI)+sched_get_priority_max(SCHED_OAI))/2) @@ -65,7 +64,7 @@ void thread_top_init(char *thread_name, int checkIfFedoraDistribution(void); int checkIfGenericKernelOnFedora(void); int checkIfInsideContainer(void); - int rt_sleep_ns (uint64_t x); +int rt_sleep_ns (uint64_t x); #ifdef __cplusplus } #endif diff --git a/common/utils/utils.c b/common/utils/utils.c index 3f32881393..16402c1057 100644 --- a/common/utils/utils.c +++ b/common/utils/utils.c @@ -7,23 +7,7 @@ #include #include "utils.h" -void *calloc_or_fail(size_t size) { - void *ptr = calloc(1, size); - if (ptr == NULL) { - fprintf(stderr, "[UE] Failed to calloc %zu bytes", size); - exit(EXIT_FAILURE); - } - return ptr; -} -void *malloc_or_fail(size_t size) { - void *ptr = malloc(size); - if (ptr == NULL) { - fprintf(stderr, "[UE] Failed to malloc %zu bytes", size); - exit(EXIT_FAILURE); - } - return ptr; -} const char *hexdump(const void *data, size_t data_len, char *out, size_t out_len) { diff --git a/common/utils/utils.h b/common/utils/utils.h index d4337e71a6..46ca9b8b2f 100644 --- a/common/utils/utils.h +++ b/common/utils/utils.h @@ -1,16 +1,110 @@ #ifndef _UTILS_H #define _UTILS_H -#include -#include + #ifdef __cplusplus extern "C" { #endif +#include +#include +#include +#include +#include +#include + + #ifdef MALLOC_TRACE + #define malloc myMalloc + #endif + #define sizeofArray(a) (sizeof(a)/sizeof(*(a))) -void *calloc_or_fail(size_t size); -void *malloc_or_fail(size_t size); -const char *hexdump(const void *data, size_t data_len, char *out, size_t out_len); + +#define cmax(a,b) ((a>b) ? (a) : (b)) +#define cmax3(a,b,c) ((cmax(a,b)>c) ? (cmax(a,b)) : (c)) +#define cmin(a,b) ((a #include "defs_eNB.h" #include "types.h" - - /** @addtogroup _PHY_STRUCTURES_ * @{ */ @@ -315,50 +314,6 @@ typedef struct { #include "openairinterface5g_limits.h" #include "assertions.h" -#define cmax(a,b) ((a>b) ? (a) : (b)) -#define cmax3(a,b,c) ((cmax(a,b)>c) ? (cmax(a,b)) : (c)) -#define cmin(a,b) ((a #include -#if !defined (msg) -# define msg(aRGS...) LOG_D(PHY, ##aRGS) -#endif -#ifndef malloc16 -# ifdef __AVX2__ -# define malloc16(x) memalign(32,x) -# else -# define malloc16(x) memalign(16,x) -# endif -#endif -#define free16(y,x) free(y) -#define bigmalloc malloc -#define bigmalloc16 malloc16 -#define openair_free(y,x) free((y)) -#define PAGE_SIZE 4096 - -#define PAGE_MASK 0xfffff000 -#define virt_to_phys(x) (x) - -#define cmax(a,b) ((a>b) ? (a) : (b)) -#define cmin(a,b) ((a #endif // /*__openair_DEFS_H__ */ diff --git a/openair2/SIMULATION/NR_RRC/itti_sim.c b/openair2/SIMULATION/NR_RRC/itti_sim.c index e3792dca77..28de1ca3b8 100644 --- a/openair2/SIMULATION/NR_RRC/itti_sim.c +++ b/openair2/SIMULATION/NR_RRC/itti_sim.c @@ -546,7 +546,7 @@ int main( int argc, char **argv ) #endif logInit(); - //configure_linux(); + //set_latency_target(); printf("Reading in command-line options\n"); get_options (); diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index ff1b0f99dd..85e493f194 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -530,7 +530,7 @@ int main ( int argc, char **argv ) mode = normal_txrx; logInit(); - configure_linux(); + set_latency_target(); printf("Reading in command-line options\n"); get_options (); diff --git a/targets/RT/USER/lte-uesoftmodem.c b/targets/RT/USER/lte-uesoftmodem.c index da5214bfad..4395694bf4 100644 --- a/targets/RT/USER/lte-uesoftmodem.c +++ b/targets/RT/USER/lte-uesoftmodem.c @@ -557,7 +557,7 @@ int main( int argc, char **argv ) { mode = normal_txrx; memset(&openair0_cfg[0],0,sizeof(openair0_config_t)*MAX_CARDS); logInit(); - configure_linux(); + set_latency_target(); printf("Reading in command-line options\n"); for (int i=0; i /dev/null 2>&1 && { - echo "$1 is installed." - } || { - echo "$1 is not installed." - OAI_INSTALLED=0 - $SUDO apt-get install -y $@ - } - fi -} - -test_uninstall_package() { - - if [ $# -eq 1 ]; then - dpkg -s "$1" > /dev/null 2>&1 && { - $SUDO apt-get remove --assume-yes $1 - echo "$1 is uninstalled." - } || { - echo "$1 is not installed." - } - fi -} -test_command_install_script() { - # usage: test_command_install_script searched_binary script_to_be_invoked_if_binary_not_found - command -v $1 >/dev/null 2>&1 || { echo_warning "Program $1 is not installed. Trying installing it." >&2; bash $2; command -v $1 >/dev/null 2>&1 || { echo_fatal "Program $1 is not installed. Aborting." >&2; };} - echo_success "$1 available" -} - - -check_for_machine_type(){ - MACHINE_TYPE=`uname -m` - if [ ${MACHINE_TYPE} = "x86_64" ]; then - return 64 # 64-bit stuff here - else - if [ ${MACHINE_TYPE} = "i686" ]; then - return 32 # 32-bit stuff here - else - return -1 - fi - fi -} - -#################################################### -## OAI related functions -##################################################### - -#################################################### -# 1. install the required packages -#################################################### - -make_certs(){ - - # for certtificate generation - rm -rf demoCA - mkdir -m 777 -p demoCA - echo 01 > demoCA/serial - touch demoCA/index.txt - - echo "creating the certificate" - - user=$(whoami) - HOSTNAME=$(hostname -f) - - echo "Creating certificate for user '$HOSTNAME'" - -# CA self certificate - openssl req -new -batch -x509 -days 3650 -nodes -newkey rsa:1024 -out cacert.pem -keyout cakey.pem -subj /CN=eur/C=FR/ST=PACA/L=Aix/O=Eurecom/OU=CM - - # openssl genrsa -out user.key.pem 1024 - openssl genrsa -out hss.key.pem 1024 - #openssl req -new -batch -out user.csr.pem -key user.key.pem -subj /CN=$HOSTNAME.eur/C=FR/ST=PACA/L=Aix/O=Eurecom/OU=CM - openssl req -new -batch -out hss.csr.pem -key hss.key.pem -subj /CN=hss.eur/C=FR/ST=PACA/L=Aix/O=Eurecom/OU=CM - openssl ca -cert cacert.pem -keyfile cakey.pem -in hss.csr.pem -out hss.cert.pem -outdir . -batch - - if [ ! -d /usr/local/etc/freeDiameter ]; then - echo "Creating non existing directory: /usr/local/etc/freeDiameter/" - $SUDO mkdir /usr/local/etc/freeDiameter/ - fi - - echo "Copying *.pem to /usr/local/etc/freeDiameter/" - $SUDO cp *.pem /usr/local/etc/freeDiameter/ - mv *.pem bin/ - -# openssl genrsa -out ubuntu.key.pem 1024 -# openssl req -new -batch -x509 -out ubuntu.csr.pem -key ubuntu.key.pem -subj /CN=ubuntu.localdomain/C=FR/ST=BdR/L=Aix/O=fD/OU=Tests -# openssl ca -cert cacert.pem -keyfile cakey.pem -in ubuntu.csr.pem -out ubuntu.cert.pem -outdir . -batch - -} - -check_install_nettle(){ - if [ ! -f ./.lock_oaibuild ]; then - if [ $UBUNTU_REL = "12.04" ]; then - test_uninstall_package nettle-dev - test_uninstall_package nettle-bin - - if [ ! -d /usr/local/src/ ]; then - echo "/usr/local/src/ doesn't exist please create one" - exit -1 - fi - - if [ ! -w /usr/local/src/ ]; then - echo "You don't have permissions to write to /usr/local/src/, installing as a sudoer" - # exit -1 - fi - - cd /usr/local/src/ - - echo "Downloading nettle archive" - - if [ -f nettle-2.5.tar.gz ]; then - $SUDO rm -f nettle-2.5.tar.gz - fi - if [ -f nettle-2.5.tar ]; then - $SUDO rm -f nettle-2.5.tar - fi - if [ -d nettle-2.5 ]; then - $SUDO rm -rf nettle-2.5/ - fi - - - $SUDO wget ftp://ftp.lysator.liu.se/pub/security/lsh/nettle-2.5.tar.gz - $SUDO gunzip nettle-2.5.tar.gz - $SUDO echo "Uncompressing nettle archive" - $SUDO tar -xf nettle-2.5.tar - cd nettle-2.5/ - $SUDO ./configure --disable-openssl --enable-shared --prefix=/usr - if [ $? -ne 0 ]; then - exit -1 - fi - echo "Compiling nettle" - $SUDO make -j $NUM_CPU - $SUDO make check - $SUDO make install - cd ../ - fi - fi -} - -check_install_freediamter(){ - - if [ $UBUNTU_REL = "12.04" ]; then - - if [ ! -d /usr/local/src/ ]; then - echo "/usr/local/src/ doesn't exist please create one" - exit -1 - fi - - if [ ! -w /usr/local/src/ ]; then - echo "You don't have permissions to write to /usr/local/src/, installing as a sudoer" -# exit -1 - fi - - cd /usr/local/src/ - - echo "Downloading nettle archive" - - if [ -f nettle-2.5.tar.gz ]; then - $SUDO rm -f nettle-2.5.tar.gz - fi - if [ -f nettle-2.5.tar ]; then - $SUDO rm -f nettle-2.5.tar - fi - if [ -d nettle-2.5 ]; then - $SUDO rm -rf nettle-2.5/ - fi - - - $SUDO wget ftp://ftp.lysator.liu.se/pub/security/lsh/nettle-2.5.tar.gz - $SUDO gunzip nettle-2.5.tar.gz - $SUDO echo "Uncompressing nettle archive" - $SUDO tar -xf nettle-2.5.tar - cd nettle-2.5/ - $SUDO ./configure --disable-openssl --enable-shared --prefix=/usr - if [ $? -ne 0 ]; then - exit -1 - fi - echo "Compiling nettle" - $SUDO make -j $NUM_CPU - $SUDO make check - $SUDO make install - cd ../ - fi - - echo "Downloading gnutls archive" - - if [ -f gnutls-3.1.23.tar.xz ]; then - $SUDO rm -f gnutls-3.1.23.tar.xz - fi - if [ -d gnutls-3.1.23/ ]; then - $SUDO rm -rf gnutls-3.1.23/ - fi - - test_uninstall_package libgnutls-dev - - $SUDO wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.1/gnutls-3.1.23.tar.xz - $SUDO tar -xf gnutls-3.1.23.tar.xz - echo "Uncompressing gnutls archive ($PWD)" - cd gnutls-3.1.23/ - $SUDO ./configure --prefix=/usr - if [ $? -ne 0 ]; then - exit -1 - fi - echo "Compiling gnutls" - $SUDO make -j $NUM_CPU - $SUDO make install - cd ../ - - echo "Downloading freeDiameter archive" - - if [ -f 1.1.5.tar.gz ]; then - $SUDO rm -f 1.1.5.tar.gz - fi - if [ -d freeDiameter-1.1.5/ ]; then - $SUDO rm -rf freeDiameter-1.1.5/ - fi - - $SUDO wget http://www.freediameter.net/hg/freeDiameter/archive/1.1.5.tar.gz - $SUDO tar -xzf 1.1.5.tar.gz - echo "Uncompressing freeDiameter archive" - cd freeDiameter-1.1.5 - $SUDO patch -p1 < $OPENAIR3_DIR/S6A/freediameter/freediameter-1.1.5.patch - $SUDO mkdir build - cd build - $SUDO cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ../ - if [ $? -ne 0 ]; then - exit -1 - fi - echo "Compiling freeDiameter" - $SUDO make -j $NUM_CPU -#make help - $SUDO make test - $SUDO sudo make install - -# make_certs - -} - - -test_is_host_reachable() { - ping -c 1 $1 > /dev/null || { echo_fatal "$2 host $1 does not respond to ping" >&2 ; } - echo_success "$2 host $1 is reachable" -} - - -check_epc_s6a_certificate() { - if [ -d /usr/local/etc/freeDiameter ] - then - if [ -f /usr/local/etc/freeDiameter/user.cert.pem ] - then - full_hostname=`cat /usr/local/etc/freeDiameter/user.cert.pem | grep "Subject" | grep "CN" | cut -d '=' -f6` - if [ a$full_hostname == a`hostname`.${1:-'eur'} ] - then - echo_success "EPC S6A: Found valid certificate in /usr/local/etc/freeDiameter" - return 0 - fi - fi - fi - echo_error "EPC S6A: Did not find valid certificate in /usr/local/etc/freeDiameter" - echo_warning "EPC S6A: generatting new certificate in /usr/local/etc/freeDiameter..." - cd $OPENAIR3_DIR/S6A/freediameter - ./make_certs.sh ${1:-'eur'} - if [ $# -lt 2 ] ; then - check_epc_s6a_certificate ${1:-'eur'} 2 - return $? - else - exit 1 - fi -} - - -check_hss_s6a_certificate() { - if [ -d /usr/local/etc/freeDiameter ]; then - if [ -f /usr/local/etc/freeDiameter/hss.cert.pem ]; then - full_hostname=`cat /usr/local/etc/freeDiameter/hss.cert.pem | grep "Subject" | grep "CN" | cut -d '=' -f6` - if [ a$full_hostname == a`hostname`.${1:-'eur'} ] - then - echo_success "HSS S6A: Found valid certificate in /usr/local/etc/freeDiameter" - return 0 - else - echo_error "Bad hss hostname found in cert file: "$full_hostname " hostname is "`hostname` - fi - fi - fi - echo_error "S6A: Did not find valid certificate in /usr/local/etc/freeDiameter" - echo_warning "S6A: generatting new certificate in /usr/local/etc/freeDiameter..." - cd $OPENAIR3_DIR/OPENAIRHSS/conf - ./make_certs.sh ${1:-'eur'} - if [ $# -lt 2 ] ; then - check_hss_s6a_certificate ${1:-'eur'} 2 - return $? - else - exit 1 - fi -} - -check_install_usrp_uhd_driver(){ - if [ ! -f /etc/apt/sources.list.d/ettus.list ] ; then - $SUDO bash -c 'echo "deb http://files.ettus.com/binaries/uhd/repo/uhd/ubuntu/`lsb_release -cs` `lsb_release -cs` main" >> /etc/apt/sources.list.d/ettus.list' - $SUDO apt-get update - fi - $SUDO apt-get install -t $UBUNTU_REL_NAME uhd - test_install_package python - test_install_package libboost-all-dev - test_install_package libusb-1.0-0-dev - #test_install_package uhd -} - -check_install_oai_software() { - - if [ ! -f ./.lock_oaibuild ]; then - $SUDO apt-get update - if [ $UBUNTU_REL = "12.04" ]; then - test_uninstall_package nettle-dev - test_uninstall_package nettle-bin - else - test_install_package nettle-dev - test_install_package nettle-bin - fi - test_install_package autoconf - test_install_package automake - test_install_package bison - test_install_package build-essential - test_install_package dialog - test_install_package flex - test_install_package gawk - test_install_package gcc - test_install_package gdb - test_install_package make - test_install_package cmake - test_install_package openssh-client - test_install_package openssh-server - sudo service ssh start - test_install_package unzip - test_install_package autoconf - test_install_package automake - test_install_package bison - test_install_package build-essential - test_install_package check - test_install_package ethtool - test_install_package flex - test_install_package g++ - test_install_package gawk - test_install_package gcc - test_install_package gccxml - test_install_package gdb - test_install_package guile-2.0-dev - test_install_package iperf - test_install_package iproute - test_install_package iptables - test_install_package libatlas-base-dev - test_install_package libatlas-dev - test_install_package libblas3gf - test_install_package libblas-dev - test_install_package liblapack-dev - test_install_package liblapack-dev -# if [ $MACHINE_ARCH = 64 ]; then - test_install_package libconfig8-dev -# else -# test_install_package libconfig-dev -# fi - test_install_package libforms-bin - test_install_package libforms-dev - test_install_package libgcrypt11-dev - test_install_package libgmp-dev - test_install_package libgtk-3-dev - test_install_package libidn11-dev - test_install_package libidn2-0-dev - test_install_package libpgm-dev - test_install_package libpgm-5.1-0 - test_install_package libpthread-stubs0-dev - test_install_package libsctp1 - test_install_package libsctp-dev - test_install_package libtasn1-3-dev - test_install_package libxml2 - test_install_package libxml2-dev -# test_install_package linux-headers-`uname -r` - test_install_package openssl - test_install_package libssl-dev - test_install_package pkg-config - test_install_package python-dev - test_install_package python-pexpect - test_install_package sshfs - test_install_package subversion - test_install_package valgrind - test_install_package doxygen - test_install_package graphviz - -# test_install_package libboost-all-dev - - if [ $OAI_INSTALLED = 1 ]; then - touch ./.lock_oaibuild - fi - - else - echo_info "All the required packages installed: skip" - fi - -} - -check_install_hss_software() { - if [ ! -f ./.lock_oaibuild ]; then - $SUDO apt-get update - if [ $UBUNTU_REL = "12.04" ]; then - test_uninstall_package nettle-dev - test_uninstall_package nettle-bin - else - test_install_package nettle-dev - test_install_package nettle-bin - fi - test_install_package autoconf - test_install_package automake - test_install_package bison - test_install_package build-essential - test_install_package cmake - test_install_package cmake-curses-gui - test_install_package dialog - test_install_package dkms - test_install_package flex - test_install_package gawk - test_install_package gcc - test_install_package gdb - test_install_package guile-2.0-dev - test_install_package g++ - test_install_package libgmp-dev - test_install_package libgcrypt11-dev - test_install_package libidn11-dev - test_install_package libidn2-0-dev - test_install_package libmysqlclient-dev - test_install_package libtasn1-3-dev - test_install_package libsctp1 - test_install_package libsctp-dev - test_install_package libxml2-dev -# test_install_package linux-headers-`uname -r` - test_install_package make - test_install_package mysql-client - test_install_package mysql-server-core-5.5 - test_install_package mysql-server - test_install_package openssh-client - test_install_package openssh-server - sudo service ssh start - test_install_package phpmyadmin - test_install_package python-dev - test_install_package sshfs - test_install_package swig - test_install_package unzip -# test_install_package nettle-bin -# test_install_package nettle-dev - test_install_package valgrind - - if [ $OAI_INSTALLED = 1 ]; then - touch ./.lock_oaibuild - fi - - else - echo_info "All the required packages installed: skip" - fi - -} - -check_install_epc_software() { - - if [ ! -f ./.lock_oaibuild ]; then - $SUDO apt-get update - if [ $UBUNTU_REL = "12.04" ]; then - test_uninstall_package nettle-dev - test_uninstall_package nettle-bin - else - test_install_package nettle-dev - test_install_package nettle-bin - fi - test_install_package autoconf - test_install_package automake - test_install_package bison - test_install_package build-essential - test_install_package check - test_install_package cmake - test_install_package cmake-curses-gui - test_install_package dialog - test_install_package ethtool - test_install_package flex - test_install_package g++ - test_install_package gawk - test_install_package gcc - test_install_package gccxml - test_install_package gdb - test_install_package guile-2.0-dev - test_install_package gtkwave - test_install_package iperf - test_install_package iproute - test_install_package iptables - test_install_package iptables-dev - test_install_package libatlas-base-dev - test_install_package libatlas-dev - test_install_package libblas - test_install_package libblas-dev -# if [ $MACHINE_ARCH = 64 ]; then - test_install_package libconfig8-dev -# else -# test_install_package libconfig-dev -# fi - test_install_package libforms-bin - test_install_package libforms-dev - test_install_package libgcrypt11-dev - test_install_package libgmp-dev - test_install_package libgtk-3-dev - test_install_package libidn11-dev - test_install_package libidn2-0-dev - test_install_package libmysqlclient-dev - test_install_package libpgm-dev - test_install_package libpthread-stubs0-dev - test_install_package libsctp1 - test_install_package libsctp-dev - test_install_package libssl-dev - test_install_package libtasn1-3-dev - test_install_package libtool - test_install_package libxml2 - test_install_package libxml2-dev -# test_install_package linux-headers-`uname -r` - test_install_package make - test_install_package openssh-client - test_install_package openssh-server - $SUDO service ssh start - test_install_package openssl - test_install_package openvpn - test_install_package pkg-config - test_install_package python-dev - test_install_package sshfs - test_install_package subversion - test_install_package swig - test_install_package tshark - test_install_package uml-utilities - test_install_package unzip - test_install_package valgrind - test_install_package vlan - - if [ $OAI_INSTALLED = 1 ]; then - touch ./.lock_oaibuild - fi - - else - echo_info "All the required packages installed: skip" - fi - -} - -check_install_asn1c(){ - - test_command_install_script "asn1c" "$OPENAIR_TARGETS/SCRIPTS/install_asn1c_0.9.24.modified.bash $SUDO" - - # One mor check about version of asn1c - ASN1C_COMPILER_REQUIRED_VERSION_MESSAGE="ASN.1 Compiler, v0.9.24" - ASN1C_COMPILER_VERSION_MESSAGE=`asn1c -h 2>&1 | grep -i ASN\.1\ Compiler` - ##ASN1C_COMPILER_VERSION_MESSAGE=`trim $ASN1C_COMPILER_VERSION_MESSAGE` - if [ "$ASN1C_COMPILER_VERSION_MESSAGE" != "$ASN1C_COMPILER_REQUIRED_VERSION_MESSAGE" ]; then - # diff <(echo -n "$ASN1C_COMPILER_VERSION_MESSAGE") <(echo -n "$ASN1C_COMPILER_REQUIRED_VERSION_MESSAGE") - echo_error "Version of asn1c is not the required one, do you want to install the required one (overwrite installation) ? (Y/n)" - echo_error "$ASN1C_COMPILER_VERSION_MESSAGE" - while read -r -n 1 -s answer; do - if [[ $answer = [YyNn] ]]; then - [[ $answer = [Yy] ]] && $OPENAIR_TARGETS/SCRIPTS/install_asn1c_0.9.24.modified.bash $SUDO - [[ $answer = [Nn] ]] && echo_error "Version of asn1c is not the required one, exiting." && exit 1 - break - fi - done - fi - -} - -################################################# -# 2. compile -################################################ -compile_hss() { - cd $OPENAIR3_DIR/OPENAIRHSS - - if [ "$1" -eq 1 ]; then - echo_info "build a clean HSS" - rm -rfv obj* - rm -rfv m4 - rm -rfv .autom4* - rm -fv configure - fi - - OBJ_DIR=`find . -maxdepth 1 -type d -iname obj*` - - if [ ! -n "$OBJ_DIR" ]; then - OBJ_DIR="objs" - mkdir --verbose -m 777 ./$OBJ_DIR - else - OBJ_DIR=`basename $OBJ_DIR` - fi - - if [ ! -f "$OBJ_DIR"/Makefile ]; then - if [ ! -d m4 ]; then - mkdir --verbose -m 777 m4 - fi - echo_success "Invoking autogen" - ./autogen.sh - if [ $? -ne 0 ]; then - return 1 - fi - cd $OBJ_DIR - echo_success "Invoking configure" - ../configure - if [ $? -ne 0 ]; then - return 1 - fi - else - cd $OBJ_DIR - fi - - if [ -f Makefile ]; then - echo_success "Compiling..." - make ; #-j $NUM_CPU - if [ $? -ne 0 ]; then - echo_error "Build failed, exiting" - return 1 - else - return 0 - fi - else - echo_error "Configure failed, aborting" - fi - return 1 -} - - -compile_epc() { - cd $OPENAIR3_DIR - if [ $1 = 1 ]; then - echo_info "build a clean EPC" - bash_exec "rm -rf objs" - fi - OBJ_DIR=`find . -maxdepth 1 -type d -iname obj*` - if [ ! -n "$OBJ_DIR" ]; then - OBJ_DIR="objs" - bash_exec "mkdir -m 777 ./$OBJ_DIR" - echo_success "Created $OBJ_DIR directory" - else - OBJ_DIR=`basename $OBJ_DIR` - fi - if [ ! -f $OBJ_DIR/Makefile ]; then - if [ ! -n "m4" ]; then - mkdir -m 777 m4 - fi - bash_exec "autoreconf -i -f" - echo_success "Invoking autogen" - bash_exec "libtoolize" - bash_exec "./autogen.sh" - cd ./$OBJ_DIR - echo_success "Invoking configure" - if [ $DEBUG -ne 0 ]; then - ../configure --enable-debug --enable-standalone-epc --enable-gtp1u-in-kernel LDFLAGS=-L/usr/local/lib - else - ../configure --enable-standalone-epc --enable-gtp1u-in-kernel LDFLAGS=-L/usr/local/lib - fi - else - cd ./$OBJ_DIR - fi - -# pkill oai_epc -# pkill tshark - - if [ -f Makefile ]; then - echo_success "Compiling..." - make -j $NUM_CPU - if [ $? -ne 0 ]; then - echo_error "Build failed, exiting" - return 1 - else - cp -pf ./OAI_EPC/oai_epc $OPENAIR_TARGETS/bin - fi - else - echo_error "Configure failed, exiting" - return 1 - fi - - cd $OPENAIR3_DIR/GTPV1-U/GTPUAH; - make - if [ $? -ne 0 ]; then - echo_error "Build GTPUAH module failed, exiting" - return 1 - else - $SUDO cp -pfv ./Bin/libxt_*.so /lib/xtables - $SUDO cp -pfv ./Bin/*.ko $OPENAIR_TARGETS/bin - fi - - cd $OPENAIR3_DIR/GTPV1-U/GTPURH; - make - if [ $? -ne 0 ]; then - echo_error "Build GTPURH module failed, exiting" - return 1 - else - $SUDO cp -pfv ./Bin/libxt_*.so /lib/xtables - $SUDO cp -pfv ./Bin/*.ko $OPENAIR_TARGETS/bin - fi - return 0 -} - -compile_exmimo2_driver() { - cd $OPENAIR_TARGETS/ARCH/EXMIMO/DRIVER/eurecom && make clean && make || exit 1 - cd $OPENAIR_TARGETS/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT && make clean && make || exit 1 - # TO DO CHECKS... -} - - -compile_ltesoftmodem() { - cd $OPENAIR_TARGETS/RT/USER - if [ -f Makefile ]; then - rm -f ./lte-softmodem - echo "LTE softmodem compiling directives: $SOFTMODEM_DIRECTIVES" - if [ $OAI_CLEAN -ne 0 ]; then - echo "Cleaning LTE softmodem" - make cleanall > /dev/null 2>&1 - fi - make -j $NUM_CPU $SOFTMODEM_DIRECTIVES - if [ $? -ne 0 ]; then - # to locate easily compilation error in log file - make $SOFTMODEM_DIRECTIVES - fi - if [ $? -ne 0 ]; then - if [ ! -f ./lte-softmodem ]; then - echo_error "Build lte-softmodem failed, returning" - return 1 - else - cp -pf ./lte-softmodem $OPENAIR_TARGETS/bin - return 0 - fi - else - cp -pf ./lte-softmodem $OPENAIR_TARGETS/bin - return 0 - fi - else - echo_error "make file for oai softmodem not found, returning" - return 1 - fi -} - -compile_oaisim() { - cd $OPENAIR_TARGETS/SIMU/USER - if [ -f Makefile ]; then - echo "Compiling for oaisim target ($OAISIM_DIRECTIVES)" - make cleanall > /dev/null - make -j $NUM_CPU $OAISIM_DIRECTIVES - if [ $? -ne 0 ]; then - echo_error "Build oaisim failed, returning" - return 1 - else - cp -pf ./oaisim $OPENAIR_TARGETS/bin - return 0 - fi - else - echo_error "Makefile not found for oaisim target, returning" - return 1 - fi -} - -compile_unisim() { - cd $OPENAIR1_DIR/SIMULATION/LTE_PHY - if [ -f Makefile ]; then - echo "Compiling for UNISIM target ..." - make cleanall - make -j $NUM_CPU all - if [ $? -ne 0 ]; then - echo_error "Build unisim failed, returning" - return 1 - else - cp -pf ./dlsim $OPENAIR_TARGETS/bin - cp -pf ./ulsim $OPENAIR_TARGETS/bin - cp -pf ./pucchsim $OPENAIR_TARGETS/bin - cp -pf ./prachsim $OPENAIR_TARGETS/bin - cp -pf ./pdcchsim $OPENAIR_TARGETS/bin - cp -pf ./pbchsim $OPENAIR_TARGETS/bin - cp -pf ./mbmssim $OPENAIR_TARGETS/bin - return 0 - fi - else - echo_error "Configure failed, exiting" - return 1 - fi -} - -compile_nas_tools() { - - export NVRAM_DIR=$OPENAIR_TARGETS/bin - - cd $NVRAM_DIR - - if [ ! -f /tmp/nas_cleaned ]; then - echo_success "make --directory=$OPENAIR3_DIR/NAS/EURECOM-NAS/tools veryveryclean" - make --directory=$OPENAIR3_DIR/NAS/EURECOM-NAS/tools veryveryclean - fi - echo_success "make --directory=$OPENAIR3_DIR/NAS/EURECOM-NAS/tools all" - make --directory=$OPENAIR3_DIR/NAS/EURECOM-NAS/tools all - rm .ue.nvram0 - rm .usim.nvram0 - touch /tmp/nas_cleaned -} - - -compile_ue_ip_nw_driver() { - cd $OPENAIR2_DIR && make ue_ip.ko -} - -################################################ -# 1. check if the executable functions exist -############################################### - -check_for_ltesoftmodem_executable() { - if [ ! -f $OPENAIR_TARGETS/RT/USER/lte-softmodem ]; then - echo_error "Cannot find lte-softmodem executable object in directory $OPENAIR_TARGETS/RT/USER" - echo_error "Check the compilation logs in bin/install_log.txt" - exit 1 - fi -} - -check_for_epc_executable() { - if [ ! -f $OPENAIR3_DIR/objs/OAI_EPC/oai_epc ]; then - echo_error "Cannot find oai_epc executable object in directory $OPENAIR3_DIR/objs/OAI_EPC/" - echo_fatal "Please make sure you have compiled OAI EPC with --enable-standalone-epc option" - fi -} - -check_for_hss_executable() { - if [ ! -f $OPENAIR3_DIR/OPENAIRHSS/objs/openair-hss ]; then - echo_error "Cannot find openair-hss executable object in directory $OPENAIR3_DIR/OPENAIRHSS/objs/" - echo_fatal "Please make sure you have compiled OAI HSS" - fi -} - -check_for_sgw_executable() { - if [ ! -f $OPENAIR3_DIR/objs/OAI_SGW/oai_sgw ]; then - echo_error "Cannot find oai_sgw executable object in directory $OPENAIR3_DIR/OPENAIRMME/objs/OAI_SGW/" - echo_fatal "Please make sure you have compiled OAI EPC without --enable-standalone-epc option" - fi -} - -check_for_oaisim_executable() { - if [ ! -f $OPENAIR_TARGETS/SIMU/USER/oaisim ]; then - echo_error "Cannot find oaisim executable object in directory $OPENAIR_TARGETS/SIMU/USER" - echo_error "Check the compilation logs in bin/install_log.txt" - fi -} - -check_for_dlsim_executable() { - if [ ! -f $OPENAIR1_DIR/SIMULATION/LTE_PHY/dlsim ]; then - echo_error "Cannot find dlsim executable object in directory $OPENAIR1_DIR/SIMULATION/LTE_PHY" - echo_error "Check the compilation logs in bin/install_log.txt" - fi -} - -check_for_ulsim_executable() { - if [ ! -f $OPENAIR1_DIR/SIMULATION/LTE_PHY/ulsim ]; then - echo_error "Cannot find ulsim executable object in directory $OPENAIR1_DIR/SIMULATION/LTE_PHY" - echo_error "Check the compilation logs in bin/install_log.txt" - fi -} - -check_for_pucchsim_executable() { - if [ ! -f $OPENAIR1_DIR/SIMULATION/LTE_PHY/pucchsim ]; then - echo_error "Cannot find pucchsim executable object in directory $OPENAIR1_DIR/SIMULATION/LTE_PHY" - echo_error "Check the compilation logs in bin/install_log.txt" - fi -} - -check_for_prachsim_executable() { - if [ ! -f $OPENAIR1_DIR/SIMULATION/LTE_PHY/prachsim ]; then - echo_error "Cannot find prachsim executable object in directory $OPENAIR1_DIR/SIMULATION/LTE_PHY" - echo_error "Check the compilation logs in bin/install_log.txt" - fi -} - -check_for_pdcchsim_executable() { - if [ ! -f $OPENAIR1_DIR/SIMULATION/LTE_PHY/pdcchsim ]; then - echo_error "Cannot find pdcchsim executable object in directory $OPENAIR1_DIR/SIMULATION/LTE_PHY" - echo_error "Check the compilation logs in bin/install_log.txt" - fi -} - -check_for_pbchsim_executable() { - if [ ! -f $OPENAIR1_DIR/SIMULATION/LTE_PHY/pbchsim ]; then - echo_error "Cannot find pbchsim executable object in directory $OPENAIR1_DIR/SIMULATION/LTE_PHY" - echo_error "Check the compilation logs in bin/install_log.txt" - fi -} - -check_for_mbmssim_executable() { - if [ ! -f $OPENAIR1_DIR/SIMULATION/LTE_PHY/mbmssim ]; then - echo_error "Cannot find mbmssim executable object in directory $OPENAIR1_DIR/SIMULATION/LTE_PHY" - echo_error "Check the compilation logs in bin/install_log.txt" - fi -} - -check_for_nas_ue_executable() { - if [ ! -f $OPENAIR3_DIR/NAS/EURECOM-NAS/bin/UserProcess ]; then - echo_error "Cannot find UserProcess executable object in directory $OPENAIR3_DIR/NAS/EURECOM-NAS/bin" - echo_fatal "Check the compilation logs in bin/install_log.txt" - fi -} - -################################################ -# 1. check if the executable functions exist -############################################### - -# arg1 is RT -# arg2 is HW -# arg3 is ENB_S1 -install_ltesoftmodem() { - # RT - if [ $1 = "RTAI" ]; then - if [ ! -f /tmp/init_rt_done.tmp ]; then - echo_info " 8.1 Insert RTAI modules" - $SUDO insmod /usr/realtime/modules/rtai_hal.ko > /dev/null 2>&1 - $SUDO insmod /usr/realtime/modules/rtai_sched.ko > /dev/null 2>&1 - $SUDO insmod /usr/realtime/modules/rtai_sem.ko > /dev/null 2>&1 - $SUDO insmod /usr/realtime/modules/rtai_fifos.ko > /dev/null 2>&1 - $SUDO insmod /usr/realtime/modules/rtai_mbx.ko > /dev/null 2>&1 - $SUDO touch /tmp/init_rt_done.tmp - $SUDO chmod 666 /tmp/init_rt_done.tmp - else - echo_warning " 8.1 RTAI modules already inserted" - fi - fi - #HW - if [ $2 = "EXMIMO" ]; then - echo_info " 8.2 [EXMIMO] creating RTAI fifos" - for i in `seq 0 64`; do - have_rtfX=`ls /dev/ |grep -c rtf$i`; - if [ "$have_rtfX" -eq 0 ] ; then - $SUDO mknod -m 666 /dev/rtf$i c 150 $i; - fi; - done - echo_info " 8.3 [EXMIMO] Build lte-softmodemdrivers" - cd $OPENAIR_TARGETS/ARCH/EXMIMO/DRIVER/eurecom && make clean && make # || exit 1 - cd $OPENAIR_TARGETS/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT && make clean && make # || exit 1 - - echo_info " 8.4 [EXMIMO] Setup RF card" - cd $OPENAIR_TARGETS/RT/USER - . ./init_exmimo2.sh - else - if [ $2 = "USRP" ]; then - echo_info " 8.2 [USRP] " - fi - - fi - - # ENB_S1 - if [ $3 = 0 ]; then - cd $OPENAIR2_DIR && make clean && make nasmesh_netlink.ko #|| exit 1 - cd $OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL && make clean && make # || exit 1 - fi - -} - -# arg1 is ENB_S1 'boolean' -install_oaisim() { - if [ $1 = 0 ]; then - cd $OPENAIR2_DIR && make clean && make nasmesh_netlink.ko #|| exit 1 - cd $OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL && make clean && make # || exit 1 - else - compile_ue_ip_nw_driver - install_nas_tools - fi - -} - - -install_nas_tools() { - cd $OPENAIR_TARGETS/bin - if [ ! -f .ue.nvram0 ]; then - echo_success "generate .ue_emm.nvram0 .ue.nvram0" - $OPENAIR3_DIR/NAS/EURECOM-NAS/bin/ue_data --gen - fi - - if [ ! -f .usim.nvram0 ]; then - echo_success "generate .usim.nvram0" - $OPENAIR3_DIR/NAS/EURECOM-NAS/bin/usim_data --gen - fi - $OPENAIR3_DIR/NAS/EURECOM-NAS/bin/ue_data --print - $OPENAIR3_DIR/NAS/EURECOM-NAS/bin/usim_data --print -} - -install_nasmesh(){ - echo_success "LOAD NASMESH IP DRIVER FOR UE AND eNB" - (cd $OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL && make clean && make) - (cd $OPENAIR2_DIR && make clean && make nasmesh_netlink_address_fix.ko) - $SUDO rmmod nasmesh - $SUDO insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko -} - -################################## -# create HSS DB -################################ - -# arg 1 is mysql user (root) -# arg 2 is mysql password (linux) -# arg 3 is hss username (hssadmin) -# arg 4 is hss password (admin) -# arg 5 is database name (oai_db) -create_hss_database(){ - EXPECTED_ARGS=5 - E_BADARGS=65 - MYSQL=`which mysql` - rv=0 - if [ $# -ne $EXPECTED_ARGS ] - then - echo_fatal "Usage: $0 dbuser dbpass hssuser hsspass databasename" - rv=1 - fi - - set_openair_env - - # removed % - #Q1="GRANT ALL PRIVILEGES ON *.* TO '$3'@'%' IDENTIFIED BY '$4' WITH GRANT OPTION;" - Q1="GRANT ALL PRIVILEGES ON *.* TO '$3'@'localhost' IDENTIFIED BY '$4' WITH GRANT OPTION;" - Q2="FLUSH PRIVILEGES;" - SQL="${Q1}${Q2}" - $MYSQL -u $1 --password=$2 -e "$SQL" - if [ $? -ne 0 ]; then - echo_error "$3 permissions failed" - return 1 - else - echo_success "$3 permissions succeeded" - fi - - - Q1="CREATE DATABASE IF NOT EXISTS ${BTICK}$5${BTICK};" - SQL="${Q1}" - $MYSQL -u $3 --password=$4 -e "$SQL" - if [ $? -ne 0 ]; then - echo_error "$5 creation failed" - return 1 - else - echo_success "$5 creation succeeded" - fi - - - # test if tables have been created - mysql -u $3 --password=$4 -e "desc $5.users" > /dev/null 2>&1 - - if [ $? -eq 1 ]; then - $MYSQL -u $3 --password=$4 $5 < $OPENAIR3_DIR/OPENAIRHSS/db/oai_db.sql - if [ $? -ne 0 ]; then - echo_error "$5 tables creation failed" - return 1 - else - echo_success "$5 tables creation succeeded" - fi - fi - - return 0 -} - -################################ -# set_openair_env -############################### -set_openair_env(){ - - fullpath=`readlink -f $BASH_SOURCE` - [ -f "/.$fullpath" ] || fullpath=`readlink -f $PWD/$fullpath` - openair_path=${fullpath%/targets/*} - openair_path=${openair_path%/openair3/*} - openair_path=${openair_path%/openair[123]/*} - - export OPENAIR_DIR=$openair_path - export OPENAIR_HOME=$openair_path - export OPENAIR1_DIR=$openair_path/openair1 - export OPENAIR2_DIR=$openair_path/openair2 - export OPENAIR3_DIR=$openair_path/openair3 - export OPENAIR3_DIR=$openair_path/openair3 - export OPENAIR_TARGETS=$openair_path/targets - -} - -######################################## -### print help -###################################### - -print_help(){ - echo_success "Name : build_oai - install and build OAI" - echo_success "Usage: build_oai.bash -a -b -c -d -e RTAI -m -r REL8 -s -t OAISIM -w EXMIMO -x" - echo_success "-a | --doxygen : Enable doxygen for documentation (default disabled)" - echo_success "-b | --disable-s1 : Disable S1 interface for eNB (default enabled)" - echo_success "-c | --clean : Enable clean OAI build (default disabled)" - echo_success "-C | --config-file : Set the config file local path" - echo_success "-d | --debug : Enable debug mode (default disabled)" - echo_success "-D | --disable-check-installed-software : Disable the checking of installed software (default is check)" - echo_success "-e | --realtime : Set realtime mode: RTAI, NONE (default NONE)" - echo_success "-g | --run-with-gdb : Run the executable built by this script with gdb" - echo_success "-K | --itti-dump-file : Set the execution events trace file" - echo_success "-l | --build-target : Set the LTE build target: ENB,EPC,HSS,NONE (default ENB)" - echo_success "-m | --build-from-makefile : Enable build from the makefile (default disabled)" - echo_success "-r | --3gpp-release : Set the release: REL8, REL10 (default REL8)" - echo_success "-p | --wireshark : enable wireshark interface for L2 pdus" - echo_success "-R | --run : Run the executable built by this script" - echo_success "-s | --check : Enable OAI testing and sanity check (default disabled)" - echo_success "-t | --enb-build-target : Set the eNB build target: ALL, SOFTMODEM,OAISIM,UNISIM (default ALL)" - echo_success "-V | --vcd : Log vcd events" - echo_success "-w | --hardware : Set the hardware platform: EXMIMO, USRP (also installs UHD driver), ETHERNET, NONE, (default EXMIMO)" - echo_success "-x | --xforms : Enable xforms (default disabled)" - echo_success "-z | --defaults : Set the default build options" -} - -print_help_perf(){ - echo_success "Name : perf_oai generate traffic and evaluate the performance " - echo_success "Usage: perf_oai.bash -l ITG " - echo_success "-l | --perf-app : Set Performance evaluation app: ITGS, ITGD,PING, OTG-OAISIM, OTG-CBA, (default PING)" - echo_success "-m | --owd : enable D-ITG one-way-delay meter (default disabled)" - echo_success "-e | --duration : set the duration of the experiment (default 60000ms)" - echo_success "-i | --idt-dist : set the distribution of the inter-departure time: CONSTANT, UNIFORM,EXPONENTIAL (default CONSTANT)" - echo_success "-s | --ps-dist : set the distribution of the inter-departure time (default CONSTANT, available options: UNIFORM,EXPONENTIAL)" - echo_success "-d | --dst : set the destination address (default 127.0.0.1)" - echo_success "-p | --dst-port : set the destination address (default NONE)" - echo_success "-t | --test : enable test mode to validate the functionality (default disabled)" - echo_success "-k | --keep-log-file : keep the log files (default disabled)" - -} -############################### -## echo and family -############################### -black='\E[30m' -red='\E[31m' -green='\E[32m' -yellow='\E[33m' -blue='\E[34m' -magenta='\E[35m' -cyan='\E[36m' -white='\E[37m' -reset_color='\E[00m' - - -cecho() # Color-echo -# arg1 = message -# arg2 = color -{ - local default_msg="No Message." - message=${1:-$default_msg} - color=${2:-$green} - if [ $BUILD_FROM_MAKEFILE = 0 ]; then - echo -e -n "$color$message$reset_color" - echo - else - echo "$message" - fi - return -} - -echo_error() { - local my_string="" - until [ -z "$1" ] - do - my_string="$my_string$1" - shift - done - cecho "$my_string" $red -} - -echo_fatal() { - local my_string="" - until [ -z "$1" ] - do - my_string="$my_string$1" - shift - done - echo_error "$my_string" - exit -1 -} - -echo_warning() { - local my_string="" - until [ -z "$1" ] - do - my_string="$my_string$1" - shift - done - cecho "$my_string" $yellow -} - -echo_success() { - local my_string="" - until [ -z "$1" ] - do - my_string="$my_string$1" - shift - done - cecho "$my_string" $green -} -echo_info() { - local my_string="" - until [ -z "$1" ] - do - my_string="$my_string$1" - shift - done - cecho "$my_string" $blue -} - -bash_exec() { - output=$($1 2>&1) - result=$? - if [ $result -eq 0 ]; then - echo_success "$1" - else - echo_error "$1: $output" - fi -} - - -wait_process_started () { - if [ -z "$1" ]; then - echo_error "WAITING FOR PROCESS START: NO PROCESS" - return 1 - fi - ps -C $1 > /dev/null 2>&1 - while [ $? -ne 0 ]; do - echo_warning "WAITING FOR $1 START" - sleep 2 - ps -C $1 > /dev/null 2>&1 - done - echo_success "PROCESS $1 STARTED" - return 0 -} - -is_process_started () { - if [ -z "$1" ]; then - echo_error "WAITING FOR PROCESS START: NO PROCESS" - return 1 - fi - ps -C $1 > /dev/null 2>&1 - if [ $? -ne 0 ]; then - echo_success "PROCESS $1 NOT STARTED" - return 1 - fi - echo_success "PROCESS $1 STARTED" - return 0 -} - -assert() { - # If condition false - # exit from script with error message - E_PARAM_ERR=98 - E_PARAM_FAILED=99 - - if [ -z "$2" ] ; then # Not enought parameters passed. - return $E_PARAM_ERR - fi - - lineno=$2 - if [ ! $1 ]; then - echo_error "Assertion failed: \"$1\"" - echo_fatal "File \"$0\", line $lineno" - fi -} diff --git a/targets/build_oai.bash b/targets/build_oai.bash deleted file mode 100755 index 05b14a541b..0000000000 --- a/targets/build_oai.bash +++ /dev/null @@ -1,840 +0,0 @@ -#/* -# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more -# * contributor license agreements. See the NOTICE file distributed with -# * this work for additional information regarding copyright ownership. -# * The OpenAirInterface Software Alliance licenses this file to You under -# * the OAI Public License, Version 1.1 (the "License"); you may not use this file -# * except in compliance with the License. -# * You may obtain a copy of the License at -# * -# * http://www.openairinterface.org/?page_id=698 -# * -# * Unless required by applicable law or agreed to in writing, software -# * distributed under the License is distributed on an "AS IS" BASIS, -# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# * See the License for the specific language governing permissions and -# * limitations under the License. -# *------------------------------------------------------------------------------- -# * For more information about the OpenAirInterface (OAI) Software Alliance: -# * contact@openairinterface.org -# */ -################################################################################ -# file build_oai.bash -# brief OAI automated build tool that can be used to install, compile, run OAI. -# author Navid Nikaein, Lionel GAUTHIER -# company Eurecom -# email: navid.nikaein@eurecom.fr, lionel.gauthier@eurecom.fr -# - -#!/bin/bash -################################ -# include helper functions -################################ -THIS_SCRIPT_PATH=$(dirname $(readlink -f $0)) -. $THIS_SCRIPT_PATH/build_helper.bash - -check_for_root_rights - -####################################### -# Default PARAMETERS -###################################### -declare OAI_DB_ADMIN_USER_NAME="root" -declare OAI_DB_ADMIN_USER_PASSWORD="linux" - -#only one could be set at the time -declare BUILD_LTE="NONE" # ENB, EPC, HSS - -declare HW="EXMIMO" # EXMIMO, USRP, ETHERNET, NONE -declare TARGET="ALL" # ALL, SOFTMODEM, OAISIM, UNISIM, NONE -declare ENB_S1=1 -declare REL="REL8" # REL8, REL10 -declare RT="NONE" # RTAI, RT_PREMPT, NONE -declare DEBUG=0 -declare CONFIG_FILE=" " -declare CONFIG_FILE_ACCESS_OK=0 -declare EXE_ARGUMENTS=" " -declare RUN_GDB=0 -declare RUN=0 -declare DISABLE_CHECK_INSTALLED_SOFTWARE=0 -declare OAI_CLEAN=0 -declare CLEAN_IPTABLES=0 -declare CLEAN_HSS=0 - -declare OAI_TEST=0 -declare XFORMS=0 - -# script is not currently handling these params -declare EPC=0 # flag to build EPC - -declare ITTI_ANALYZER=0 -declare VCD_TIMING=0 -declare WIRESHARK=0 -declare TIME_MEAS=0 -declare DOXYGEN=0 -declare DEV=0 - -#EMULATION_DEV_INTERFACE="eth0" -#EMULATION_MULTICAST_GROUP=1 -#EMULATION_DEV_ADDRESS=`ifconfig $EMULATION_DEV_INTERFACE | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'` - -############## script params ##################### - -if [ -f ./.lock_oaibuild ]; then - OAI_CLEAN=0 -else - OAI_CLEAN=1 -fi - -#for i in "$@" -#do -# echo "i is : $i" -# case $i in - - - until [ -z "$1" ] - do - case "$1" in - -a | --doxygen) - DOXYGEN=1 - echo "setting doxygen flag to: $DOXYGEN" - shift; - ;; - -b | --disable-s1) - ENB_S1=0 - echo "disable eNB S1 flag" - shift; - ;; - -c | --clean) - rm -rf ./.lock_oaibuild - OAI_CLEAN=1 - CLEAN_HSS=1 - echo "setting clean flag to: $OAI_CLEAN" - echo "may check package installation, and recompile OAI" - shift; - ;; - --clean-iptables) - CLEAN_IPTABLES=1; - shift; - ;; - -C | --config-file) - CONFIG_FILE=$2 - # may be relative path - if [ -f $(dirname $(readlink -f $0))/$CONFIG_FILE ]; then - CONFIG_FILE=$(dirname $(readlink -f $0))/$CONFIG_FILE - echo "setting config file to: $CONFIG_FILE" - CONFIG_FILE_ACCESS_OK=1 - else - # may be absolute path - if [ -f $CONFIG_FILE ]; then - echo "setting config file to: $CONFIG_FILE" - CONFIG_FILE_ACCESS_OK=1 - else - echo "config file not found" - exit 1 - fi - fi - EXE_ARGUMENTS="$EXE_ARGUMENTS -O $CONFIG_FILE" - shift 2; - ;; - -d | --debug) - DEBUG=1 - echo "setting debug flag to: $DEBUG" - shift; - ;; - -D | --disable-check-installed-software) - DISABLE_CHECK_INSTALLED_SOFTWARE=1 - echo "disable check installed software" - shift; - ;; - -e | --realtime) - RT=$2 - echo "setting realtime flag to: $RT" - shift 2 ; - ;; - -g | --run-with-gdb) - DEBUG=1 - RUN=1 - RUN_GDB=1 - echo "Running with gdb" - shift; - ;; - -K | --itti-dump-file) - ITTI_ANALYZER=1 - ITTI_DUMP_FILE=$2 - echo "setting ITTI dump file to: $ITTI_DUMP_FILE" - EXE_ARGUMENTS="$EXE_ARGUMENTS -K $ITTI_DUMP_FILE" - shift 2; - ;; - -l | --build-target) - BUILD_LTE=$2 - echo "setting top-level build target to: $2" - shift 2; - ;; - -h | --help) - print_help - exit -1 - ;; - -m | --build-from-makefile) - BUILD_FROM_MAKEFILE=1 - set_build_from_makefile $BUILD_FROM_MAKEFILE - echo "setting a flag to build from makefile to: $BUILD_FROM_MAKEFILE" - shift; - ;; - -r | --3gpp-release) - REL=$2 - echo "setting release to: $REL" - shift 2 ; - ;; - -R | --run) - RUN=1 - echo "setting run to $RUN" - shift; - ;; - -s | --check) - OAI_TEST=1 - echo "setting sanity check to: $OAI_TEST" - shift; - ;; - -t | --enb-build-target) - TARGET=$2 - echo "setting enb build target to: $TARGET" - shift 2; - ;; - -V | --vcd) - echo "setting gtk-wave output" - VCD_TIMING=1 - EXE_ARGUMENTS="$EXE_ARGUMENTS -V" - shift ; - ;; - -w | --hardware) - HW="$2" #"${i#*=}" - echo "setting hardware to: $HW" - shift 2 ; - ;; - -x | --xforms) - XFORMS=1 - EXE_ARGUMENTS="$EXE_ARGUMENTS -d" - echo "setting xforms to: $XFORMS" - shift; - ;; - -p | --wireshark) - WIRESHARK=1 - echo "enabling Wireshark interface to $WIRESHARK" - shift; - ;; - -z | --defaults) - echo "setting all parameters to: default" - rm -rf ./.lock_oaibuild - OAI_CLEAN=1 - HW="EXMIMO" - TARGET="ALL" - ENB_S1=1 - REL="REL8" - RT="NONE" - DEBUG=0 - ENB_CONFIG_FILE=$OPENAIR_TARGETS/"PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.conf" - OAI_TEST=0 - shift ; - ;; - *) - echo "Unknown option $1" - break ; - # unknown option - ;; - esac -done - -##################### -# create a bin dir -##################### -echo_info "1. Creating the bin dir ..." -mkdir -m 777 bin - -build_date=`date +%Y_%m_%d` -oai_build_date="oai_built_${build_date}" -touch bin/${oai_build_date} -chmod -f 777 bin/${oai_build_date} - -touch bin/install_log.txt -chmod -f 777 bin/install_log.txt -################################ -# cleanup first -################################ -#echo_info "3. Cleaning ..." - -#$SUDO kill -9 `ps -ef | grep oaisim | awk '{print $2}'` 2>&1 -#$SUDO kill -9 `ps -ef | grep lte-softmodem | awk '{print $2}'` 2>&1 -#$SUDO kill -9 `ps -ef | grep dlsim | awk '{print $2}'` 2>&1 -#$SUDO kill -9 `ps -ef | grep ulsim | awk '{print $2}'` 2>&1 - -if [ $CLEAN_IPTABLES -eq 1 ]; then - echo_info "Flushing iptables..." - $SUDO modprobe ip_tables - $SUDO modprobe x_tables - $SUDO iptables -P INPUT ACCEPT - $SUDO iptables -F INPUT - $SUDO iptables -P OUTPUT ACCEPT - $SUDO iptables -F OUTPUT - $SUDO iptables -P FORWARD ACCEPT - $SUDO iptables -F FORWARD - $SUDO iptables -t nat -F - $SUDO iptables -t mangle -F - $SUDO iptables -t filter -F - $SUDO iptables -t raw -F - echo_info "Flushed iptables" -fi -############################################ -# setting and printing OAI envs, we should check here -############################################ - -echo_info "2. Setting the OAI PATHS ..." - -set_openair_env -cecho "OPENAIR_HOME = $OPENAIR_HOME" $green -cecho "OPENAIR1_DIR = $OPENAIR1_DIR" $green -cecho "OPENAIR2_DIR = $OPENAIR2_DIR" $green -cecho "OPENAIR3_DIR = $OPENAIR3_DIR" $green -cecho "OPENAIR3_DIR = $OPENAIR3_DIR" $green -cecho "OPENAIR_TARGETS = $OPENAIR_TARGETS" $green - - -echo "OPENAIR_HOME = $OPENAIR_HOME" >> bin/${oai_build_date} -echo "OPENAIR1_DIR = $OPENAIR1_DIR" >> bin/${oai_build_date} -echo "OPENAIR2_DIR = $OPENAIR2_DIR" >> bin/${oai_build_date} -echo "OPENAIR3_DIR = $OPENAIR3_DIR" >> bin/${oai_build_date} -echo "OPENAIR3_DIR = $OPENAIR3_DIR" >> bin/${oai_build_date} -echo "OPENAIR_TARGETS = $OPENAIR_TARGETS" >> bin/${oai_build_date} - - -build_enb(){ - -########################################## -# process parameters -######################################### - - echo_info "4. Process the parameters" - - echo_info "User-defined Parameters : HW=$HW, TARGET=$TARGET, ENB_S1=$ENB_S1, REL=$REL, RT=$RT, DEBUG=$DEBUG XFORMS=$XFORMS" - - echo "User-defined Parameters : HW=$HW, TARGET=$TARGET, ENB_S1=$ENB_S1, REL=$REL, RT=$RT, DEBUG=$DEBUG XFORMS=$XFORMS" >> bin/${oai_build_date} - - -############################################ -# compilation directives -############################################ - - echo_info "5. building the compilation directives ..." - - - SOFTMODEM_DIRECTIVES="DEBUG=$DEBUG XFORMS=$XFORMS " - OAISIM_DIRECTIVES="DEBUG=$DEBUG XFORMS=$XFORMS " - - if [ $ENB_S1 -eq 1 ]; then - SOFTMODEM_DIRECTIVES="$SOFTMODEM_DIRECTIVES USE_MME=R10 ENABLE_ITTI=1 LINK_ENB_PDCP_TO_GTPV1U=1 SECU=1 " - #OAISIM_DIRECTIVES="$OAISIM_DIRECTIVES USE_MME=R10 ENABLE_ITTI=1 LINK_ENB_PDCP_TO_GTPV1U=1 SECU=1 " - OAISIM_DIRECTIVES="$OAISIM_DIRECTIVES ENABLE_ITTI=1 LINK_ENB_PDCP_TO_GTPV1U=1 SECU=1 " - fi - - if [ $DEBUG -eq 0 ]; then - SOFTMODEM_DIRECTIVES="$SOFTMODEM_DIRECTIVES DISABLE_XER_PRINT=1 " - OAISIM_DIRECTIVES="$OAISIM_DIRECTIVES DISABLE_XER_PRINT=1 " - fi - - if [ $HW = "USRP" ]; then - SOFTMODEM_DIRECTIVES="$SOFTMODEM_DIRECTIVES USRP=1 " - fi - - if [ $HW = "ADRV9371_ZC706" ]; then - SOFTMODEM_DIRECTIVES="$SOFTMODEM_DIRECTIVES ADRV9371_ZC706=1 " - fi - - if [ $HW = "EXMIMO" ]; then - SOFTMODEM_DIRECTIVES="$SOFTMODEM_DIRECTIVES EXMIMO=1 " - fi - - if [ $HW = "ETHERNET" ]; then - SOFTMODEM_DIRECTIVES="$SOFTMODEM_DIRECTIVES ETHERNET=1 " - fi - - if [ $ENB_S1 -eq 0 ]; then - SOFTMODEM_DIRECTIVES="$SOFTMODEM_DIRECTIVES NAS=1 " - OAISIM_DIRECTIVES="$OAISIM_DIRECTIVES NAS=1 " - fi - - if [ $REL = "REL8" ]; then - SOFTMODEM_DIRECTIVES="$SOFTMODEM_DIRECTIVES Rel8=1 " - OAISIM_DIRECTIVES="$OAISIM_DIRECTIVES Rel8=1 " - else - SOFTMODEM_DIRECTIVES="$SOFTMODEM_DIRECTIVES Rel10=1 " - OAISIM_DIRECTIVES="$OAISIM_DIRECTIVES Rel10=1 " - fi - - if [ $RT = "RTAI" ]; then - if [ ! -f /usr/realtime/modules/rtai_hal.ko ]; then - echo_warning "RTAI doesn't seem to be installed" - RT="NONE" - SOFTMODEM_DIRECTIVES="$SOFTMODEM_DIRECTIVES RTAI=0 " - else - SOFTMODEM_DIRECTIVES="$SOFTMODEM_DIRECTIVES HARD_RT=1 " - fi - else - SOFTMODEM_DIRECTIVES="$SOFTMODEM_DIRECTIVES RTAI=0 " - RT="NONE" - fi - - if [ $TARGET != "ALL" ]; then - if [ $TARGET != "SOFTMODEM" ]; then - HW="NONE" - fi - fi - - if [ $UBUNTU_REL = "12.04" ]; then - output=$(check_for_machine_type 2>&1) - MACHINE_ARCH=$? - if [ $MACHINE_ARCH -eq 64 ]; then - SOFTMODEM_DIRECTIVES="$SOFTMODEM_DIRECTIVES LIBCONFIG_LONG=1 " - OAISIM_DIRECTIVES="$OASIM_DIRECTIVES LIBCONFIG_LONG=1 " - fi - fi - - echo_success "SOFTMODEM Compilation directives: $SOFTMODEM_DIRECTIVES" - echo_success "OAISIM Compilation directives: $OAISIM_DIRECTIVES" - - echo "SOFTMODEM Compilation directives: $SOFTMODEM_DIRECTIVES" >> bin/${oai_build_date} - echo "OAISIM Compilation directive: $OAISIM_DIRECTIVES" >> bin/${oai_build_date} - - -############################################ -# check the installation -############################################ - if [ $DISABLE_CHECK_INSTALLED_SOFTWARE -eq 0 ]; then - echo_info "6. Checking the the required softwares/packages ..." - - check_install_oai_software - if [ $HW = "USRP" ]; then - check_install_usrp_uhd_driver - fi - check_install_asn1c - check_install_nettle - else - echo_info "6. Not checking the required softwares/packages ..." - touch ./.lock_oaibuild - fi - -############################################ -# compile -############################################ - - echo_info "7. compiling and installing the OAI binaries ..." - - softmodem_compiled=1 - oaisim_compiled=1 - unisim_compiled=1 - - if [ $TARGET = "ALL" ]; then - echo "############# compile_ltesoftmodem #############" >> bin/install_log.txt - output=$(compile_ltesoftmodem >> bin/install_log.txt 2>&1 ) - softmodem_compiled=$? - check_for_ltesoftmodem_executable - echo_info "7.1 finished ltesoftmodem target : check the installation log file bin/install_log.txt" - - echo "################ compile_oaisim #################" >> bin/install_log.txt - output=$(compile_oaisim >> bin/install_log.txt 2>&1 ) - oaisim_compiled=$? - check_for_oaisim_executable - echo_info "7.2 finished oaisim target : check the installation log file bin/install_log.txt" - - echo "################## compile_unisim ##################" >> bin/install_log.txt - output=$(compile_unisim >> bin/install_log.txt 2>&1 ) - unisim_compiled=$? - check_for_dlsim_executable - check_for_ulsim_executable - check_for_pucchsim_executable - check_for_prachsim_executable - check_for_pdcchsim_executable - check_for_pbchsim_executable - check_for_mbmssim_executable - echo_info "7.3 finished unisim target : check the installation log file bin/install_log.txt" - - - else - if [ $TARGET == "SOFTMODEM" ]; then - echo "############# compile_ltesoftmodem #############" >> bin/install_log.txt - output=$(compile_ltesoftmodem >> bin/install_log.txt 2>&1 ) - softmodem_compiled=$? - check_for_ltesoftmodem_executable - echo_info "7.1 finished ltesoftmodem target: check the installation log file bin/install_log.txt" - - if [ $HW == "EXMIMO" ]; then - output=$(compile_exmimo2_driver >> bin/install_log.txt 2>&1) - fi - fi - if [ $TARGET = "OAISIM" ]; then - echo "################ compile_oaisim #################" >> bin/install_log.txt - output=$(compile_oaisim >> bin/install_log.txt 2>&1 ) - oaisim_compiled=$? - check_for_oaisim_executable - echo_info "7.2 finished oaisim target: check the installation log file bin/install_log.txt" - - if [ $ENB_S1 -eq 1 ]; then - compile_nas_tools 2>&1 - nas_tools_compiled=$? - check_for_nas_tools_executable - echo_info "7.2.1 finished nas ue target: check the installation log file bin/install_log.txt" - fi - fi - if [ $TARGET = "UNISIM" ]; then - echo "################## compile_unisim ##################" >> bin/install_log.txt - output=$(compile_unisim >> bin/install_log.txt 2>&1 ) - unisim_compiled=$? - check_for_dlsim_executable - check_for_ulsim_executable - check_for_pucchsim_executable - check_for_prachsim_executable - check_for_pdcchsim_executable - check_for_pbchsim_executable - check_for_mbmssim_executable - echo_info "7.3 finished unisim target: check the installation log file bin/install_log.txt" - fi - fi - - -############################################ -# install -############################################ - - echo_info "8. Installing ..." - - if [ $softmodem_compiled -eq 0 ]; then - echo_success "target lte-softmodem built and installed in the bin directory" - echo "target lte-softmodem built and installed in the bin directory" >> bin/${oai_build_date} - output=$(install_ltesoftmodem $RT $HW $ENB_S1 ) - fi - if [ $oaisim_compiled -eq 0 ]; then - echo_success "target oaisim built and installed in the bin directory" - echo "target oaisim built and installed in the bin directory" >> bin/${oai_build_date} - output=$(install_oaisim $ENB_S1 ) - fi - if [ $unisim_compiled -eq 0 ]; then - echo_success "target unisim built and installed in the bin directory" - echo "target unisim built and installed in the bin directory" >> bin/${oai_build_date} - fi - - echo_info "build terminated, binaries are located in bin/" - echo_info "build terminated, logs are located in bin/${oai_build_date} and bin/install_log.txt" - - - -} -build_epc(){ - - epc_compiled=1 - - echo_info "Note: this scripts tested only on Ubuntu 14.04x64" - -###################################### -# CHECK MISC SOFTWARES AND LIBS # -###################################### - if [ $DISABLE_CHECK_INSTALLED_SOFTWARE -eq 0 ]; then - echo_info "4. Checking the the required softwares/packages for EPC..." - - check_install_epc_software - check_install_asn1c - if [ $OAI_CLEAN -eq 1 ]; then - check_install_freediamter - else - if [ ! -d /usr/local/etc/freeDiameter ]; then - check_install_freediamter - fi - fi - else - echo_info "4. Not checking the required softwares/packages for EPC" - fi - -########################################### -# configure and compile -########################################## - - echo_info "5. configure and compile epc" - - output=$(compile_epc $OAI_CLEAN >> $OPENAIR_TARGETS/bin/install_log.txt 2>&1 ) - epc_compiled=$? - if [ $epc_compiled -ne 0 ]; then - echo_error "EPC compilation failed : check the installation log file bin/install_log.txt" - exit 1 - fi - check_for_epc_executable - echo_info "finished epc target: check the installation log file bin/install_log.txt" - - if [ $CONFIG_FILE_ACCESS_OK -eq 0 ]; then - echo_error "You have to provide a EPC config file" - exit 1 - fi - - TEMP_FILE=`tempfile` - VARIABLES=" S6A_CONF\|\ - HSS_HOSTNAME\|\ - REALM" - - VARIABLES=$(echo $VARIABLES | sed -e 's/\\r//g') - VARIABLES=$(echo $VARIABLES | tr -d ' ') - cat $CONFIG_FILE | grep -w "$VARIABLES"| tr -d " " | tr -d ";" > $TEMP_FILE - source $TEMP_FILE - rm -f $TEMP_FILE - - if [ x"$REALM" == "x" ]; then - echo_error "Your config file do not contain a REALM for S6A configuration" - exit 1 - fi - if [ x"$S6A_CONF" != "x./epc_s6a.conf" ]; then - echo_error "Your config file do not contain the good path for the S6A config file," - echo_error "accordingly to what is done in this script, it should be set to epc_s6a.conf" - exit 1 - fi - - check_epc_s6a_certificate $REALM - -########################################### -# install the binary in bin -########################################## - - echo_info "6. install the binary file" - - if [ $epc_compiled -eq 0 ]; then - echo_success "target epc built and installed in the bin directory" - echo "target epc built and installed in the bin directory" >> bin/${oai_build_date} - cp -f $CONFIG_FILE $OPENAIR_TARGETS/bin - cp -f $OPENAIR3_DIR/objs/UTILS/CONF/s6a.conf $OPENAIR_TARGETS/bin/epc_s6a.conf - fi -} - -build_hss(){ - echo_info "Note: this script tested only for Ubuntu 12.04 x64 -> 14.04 x64" - -###################################### -# CHECK MISC SOFTWARES AND LIBS # -###################################### - if [ $DISABLE_CHECK_INSTALLED_SOFTWARE -eq 0 ]; then - echo_info "4. check the required packages for HSS" - check_install_hss_software - if [ $OAI_CLEAN -eq 1 ]; then - check_install_freediamter - else - if [ ! -d /usr/local/etc/freeDiameter ]; then - check_install_freediamter - fi - fi - else - echo_info "4. Not checking the required packages for HSS" - fi - - -###################################### -# compile HSS # -###################################### - echo_info "5. compile HSS" - - # Bad behaviour of $OAI_CLEAN with ./.lock_oaibuild ... - compile_hss $CLEAN_HSS - hss_compiled=$? - check_for_hss_executable - echo_info "finished hss target" - -###################################### -# Check certificates # -###################################### - - TEMP_FILE=`tempfile` - cat $OPENAIR3_DIR/OPENAIRHSS/conf/hss_fd.conf | grep -w "Identity" | tr -d " " | tr -d ";" > $TEMP_FILE - cat $OPENAIR3_DIR/OPENAIRHSS/conf/hss.conf | grep -w "MYSQL_user" | tr -d " " | tr -d ";" >> $TEMP_FILE - cat $OPENAIR3_DIR/OPENAIRHSS/conf/hss.conf | grep -w "MYSQL_pass" | tr -d " " | tr -d ";" >> $TEMP_FILE - cat $OPENAIR3_DIR/OPENAIRHSS/conf/hss.conf | grep -w "MYSQL_db" | tr -d " " | tr -d ";" >> $TEMP_FILE - source $TEMP_FILE - rm -f $TEMP_FILE - - if [ x"$Identity" == "x" ]; then - echo_error "Your config file do not contain a host identity for S6A configuration" - exit 1 - fi - HSS_REALM=$(echo $Identity | sed 's/.*\.//') - HSS_HOSTNAME=${Identity%.$HSS_REALM} - NEW_HOSTNAME=`hostname -s` - if [ "x$HSS_HOSTNAME" != "x$NEW_HOSTNAME" ]; then - echo_warning "Changing identity of HSS from <$HSS_HOSTNAME.$HSS_REALM> to <$NEW_HOSTNAME.$HSS_REALM>" - sed -ibak "s/$HSS_HOSTNAME/$NEW_HOSTNAME/" $OPENAIR3_DIR/OPENAIRHSS/conf/hss_fd.conf - fi - check_hss_s6a_certificate $HSS_REALM - -###################################### -# fill the HSS DB -###################################### - echo_info "6. create HSS database (for EURECOM SIM CARDS)" - hss_db_created=1 - create_hss_database $OAI_DB_ADMIN_USER_NAME $OAI_DB_ADMIN_USER_PASSWORD $MYSQL_user $MYSQL_pass $MYSQL_db - if [ $? -eq 1 ]; then - echo_fatal "hss DB not created" - fi -} - - - - -echo_info "3. set the top-level build target" -case "$BUILD_LTE" in - 'ENB') - echo_success "build LTE eNB" - build_enb - ;; - 'EPC') - echo_success "build EPC(MME and xGW)" - build_epc - ;; - 'HSS') - echo_success "build HSS" - build_hss - ;; - 'NONE') - ;; - *) - ;; -esac - -# Additional operation - -############################################ -# Generate doxygen documentation -############################################ - -if [ $DOXYGEN = 1 ]; then - echo_info "9. Generate doxygen documentation ..." - doxygen $OPENAIR_TARGETS/DOCS/Doxyfile - echo_info "9.1 use your navigator to open $OPENAIR_TARGETS/DOCS/html/index.html " -else - echo_info "9. Bypassing doxygen documentation ..." -fi - - -############################################ -# testing -############################################ - -if [ $OAI_TEST -eq 1 ]; then - echo_info "10. Running OAI pre commit tests (pre-ci) ..." - python $OPENAIR_TARGETS/TEST/OAI/test01.py -l -else - echo_info "10. Bypassing the Tests ..." -fi - -############################################ -# run -############################################ - -if [ $RUN -ne 0 ]; then - echo_info "11. Running ..." - cd $OPENAIR_TARGETS/bin - case "$BUILD_LTE" in - 'ENB') - if [ $TARGET == "SOFTMODEM" ]; then - if [ $HW == "EXMIMO" ]; then - $SUDO chmod 777 $OPENAIR_TARGETS/RT/USER/init_exmimo2.sh - $SUDO $OPENAIR_TARGETS/RT/USER/init_exmimo2.sh - fi - if [ $WIRESHARK -eq 1 ]; then - EXE_ARGUMENTS="$EXE_ARGUMENTS -W" - fi - echo "############# running ltesoftmodem #############" - if [ $RUN_GDB -eq 0 ]; then - $SUDO $OPENAIR_TARGETS/bin/lte-softmodem `echo $EXE_ARGUMENTS` - else - $SUDO setenv MALLOC_CHECK_ 2 - $SUDO touch ~/.gdb_lte_softmodem - $SUDO echo "file $OPENAIR_TARGETS/bin/lte-softmodem" > ~/.gdb_lte_softmodem - $SUDO echo "set args $EXE_ARGUMENTS" >> ~/.gdb_lte_softmodem - $SUDO echo "run" >> ~/.gdb_lte_softmodem - $SUDO gdb -nh -x ~/.gdb_lte_softmodem 2>&1 - fi - - elif [ $TARGET == "OAISIM" ]; then - - if [ $ENB_S1 -eq 0 ]; then - install_nasmesh - else - # prepare NAS for UE - if [ ! -f .ue.nvram0 ]; then - echo_success "generate .ue_emm.nvram0 .ue.nvram0" - $OPENAIR3_DIR/NAS/EURECOM-NAS/bin/ue_data --gen - fi - - if [ ! -f .usim.nvram0 ]; then - echo_success "generate .usim.nvram0" - $OPENAIR3_DIR/NAS/EURECOM-NAS/bin/usim_data --gen - fi - $OPENAIR3_DIR/NAS/EURECOM-NAS/bin/ue_data --print - $OPENAIR3_DIR/NAS/EURECOM-NAS/bin/usim_data --print - - insmod $OPENAIR2_DIR/NETWORK_DRIVER/UE_IP/ue_ip.ko - - fi - if [ $WIRESHARK -eq 1 ]; then - EXE_ARGUMENTS="$EXE_ARGUMENTS -P wireshark" - fi - if [ $RUN_GDB -eq 0 ]; then - $SUDO exec $OPENAIR_TARGETS/bin/oaisim `echo $EXE_ARGUMENTS` - else - $SUDO setenv MALLOC_CHECK_ 2 - $SUDO touch ~/.gdb_oaisim - $SUDO echo "file $OPENAIR_TARGETS/bin/lte-oaisim" > ~/.gdb_oaisim - $SUDO echo "set args $EXE_ARGUMENTS" >> ~/.gdb_oaisim - $SUDO echo "run" >> ~/.gdb_oaisim - $SUDO gdb -nh -x ~/.gdb_oaisim 2>&1 - fi - fi - ;; - - - 'EPC') - echo "############# running EPC #############" - test_is_host_reachable $HSS_HOSTNAME.$REALM HSS - if [ $RUN_GDB -eq 0 ]; then - $SUDO $OPENAIR_TARGETS/bin/oai_epc `echo $EXE_ARGUMENTS` - else - touch ~/.gdb_epc - chmod 777 ~/.gdb_epc - echo "file $OPENAIR_TARGETS/bin/oai_epc" > ~/.gdb_epc - echo "set args $EXE_ARGUMENTS" >> ~/.gdb_epc - echo "run" >> ~/.gdb_epc - $SUDO gdb -nh -x ~/.gdb_epc 2>&1 - fi - ;; - - - 'HSS') - echo "############# running HSS #############" - cd $OPENAIR3_DIR/OPENAIRHSS/objs - if [ $RUN_GDB -eq 0 ]; then - $SUDO exec ./openair-hss -c ./conf/hss.conf - else - touch ~/.gdb_hss - chmod 777 ~/.gdb_hss - echo "file ./openair-hss" > ~/.gdb_hss - echo "set args -c ./conf/hss.conf" >> ~/.gdb_hss - echo "run" >> ~/.gdb_hss - $SUDO gdb -nh -x ~/.gdb_hss 2>&1 - fi - ;; - - - 'NONE') - ;; - - - *) - echo_error "Unknown option $BUILD_LTE: do not execute" - ;; - esac -else - echo_info "11. No run requested, end of script" - exit 0 -fi - - From ea0cf9e227760d29c611e5e28d49e736a59b21a6 Mon Sep 17 00:00:00 2001 From: hardy Date: Thu, 13 Jan 2022 18:08:00 +0100 Subject: [PATCH 066/107] workout a more readable and compact test results note --- ci-scripts/ran_dashboard/Hdashboard.py | 53 +++++++++++++++++++++----- 1 file changed, 44 insertions(+), 9 deletions(-) diff --git a/ci-scripts/ran_dashboard/Hdashboard.py b/ci-scripts/ran_dashboard/Hdashboard.py index 0cfae97c76..3fae068dc7 100644 --- a/ci-scripts/ran_dashboard/Hdashboard.py +++ b/ci-scripts/ran_dashboard/Hdashboard.py @@ -509,18 +509,52 @@ class Dashboard: s3.meta.client.copy(copy_source, 'oaitestdashboard', path+'/'+ 'test_styles.css') - def PostGitNote(self,mr,jobname,buildurl,buildid,status): + def PostGitNote(self,mr,commit, jobname,buildurl,buildid,status): + #current date and time to be posted with test reulst + now = datetime.now() + dt_string = now.strftime("%d/%m/%Y %H:%M") + gl = gitlab.Gitlab.from_config('OAI') project_id = 223 project = gl.projects.get(project_id) + + #retrieve all the notes from the MR editable_mr = project.mergerequests.get(int(mr)) - mr_notes = editable_mr.notes.list() - mr_note = editable_mr.notes.create({ - 'body': 'Completed Test : '+jobname+', status: '+status+', '+\ - '('+buildid+')
'+\ - 'Consolidated Test Results' - }) - editable_mr.save() + mr_notes = editable_mr.notes.list(all=True) + + #find key word in notes to find out if such a note has already been posted + n=0 + found=False + while found==False and nConsolidated Test Results
'+\ + dt_string + ' ' + commit + ': '+jobname+', status is '+status+', '+\ + '('+buildid+')
' + }) + editable_mr.save() + else: + #retrieve current note : due to post incr in the parsing loop, need to check note n-1 + cur_body = mr_notes[n-1].body + append_body = dt_string + ' ' + commit + ': '+jobname+', status is '+status+', '+\ + '('+buildid+')
' + new_body = cur_body + append_body + #create a new note at the bottom + mr_note = editable_mr.notes.create({ + 'body': new_body + }) + editable_mr.save() + #delete current note + mr_notes[n-1].delete() + editable_mr.save() + + def main(): @@ -535,13 +569,14 @@ def main(): buildurl=sys.argv[4] buildid=sys.argv[5] status=sys.argv[6] + commit=sys.argv[7] htmlDash=Dashboard() if mr in htmlDash.mr_list: htmlDash.Build('singleMR',mr,'/tmp/MR'+mr+'_index.html') htmlDash.CopyToS3('/tmp/MR'+mr+'_index.html','oaitestdashboard','MR'+mr+'/index.html') htmlDash.Build('Tests','0000','/tmp/Tests_index.html') htmlDash.CopyToS3('/tmp/Tests_index.html','oaitestdashboard','index.html') - htmlDash.PostGitNote(mr,jobname,buildurl,buildid,status) + htmlDash.PostGitNote(mr,commit,jobname,buildurl,buildid,status) else: print("Not a Merge Request => this build is for testing/debug purpose, no report to git") #test and MR status dash boards, cron based From 39f5863280f8bf3ff8831c89294f49c92fbd8bf7 Mon Sep 17 00:00:00 2001 From: hardy Date: Thu, 13 Jan 2022 21:37:54 +0100 Subject: [PATCH 067/107] update jenkinsfile to provide git post with commit id --- ci-scripts/Jenkinsfile-tmp-multi-enb-nsa | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/Jenkinsfile-tmp-multi-enb-nsa b/ci-scripts/Jenkinsfile-tmp-multi-enb-nsa index a3939d832d..7ac5942698 100644 --- a/ci-scripts/Jenkinsfile-tmp-multi-enb-nsa +++ b/ci-scripts/Jenkinsfile-tmp-multi-enb-nsa @@ -390,7 +390,7 @@ pipeline { steps { script { dir ('ci-scripts/ran_dashboard') { - sh "python3 Hdashboard.py testevent ${params.eNB_MR} ${JOB_NAME} ${env.BUILD_URL} ${env.BUILD_ID} ${StatusForDb} " + sh "python3 Hdashboard.py testevent ${params.eNB_MR} ${JOB_NAME} ${env.BUILD_URL} ${env.BUILD_ID} ${StatusForDb} ${params.eNB_CommitID}" } } } From a2e0da258cf9acd1d26f03700f4b2a42c12e908d Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Fri, 14 Jan 2022 17:15:34 +0100 Subject: [PATCH 068/107] fix(ci): hot fix, to clean container volumes Signed-off-by: Raphael Defosseux --- ci-scripts/cls_containerize.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index ffd93d79cf..db51f2647c 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -342,6 +342,8 @@ class Containerize(): if self.ranAllowMerge and forceBaseImageBuild: mySSH.command(self.cli + ' image rm ' + baseImage + ':' + baseTag + ' || true', '\$', 30) mySSH.command(self.cli + ' image rm ran-build:' + imageTag + ' || true','\$', 5) + # Cleaning any created tmp volume + mySSH.command(self.cli + ' volume prune --force || true','\$', 15) mySSH.close() ZipFile('build_log_' + self.testCase_id + '.zip').extractall('.') @@ -595,6 +597,8 @@ class Containerize(): mySSH.command('docker rm -f ' + containerName, '\$', 30) # Forcing the down now to remove the networks and any artifacts mySSH.command('docker-compose --file ci-docker-compose.yml down', '\$', 5) + # Cleaning any created tmp volume + mySSH.command('docker volume prune --force || true', '\$', 20) mySSH.close() @@ -754,6 +758,11 @@ class Containerize(): logging.error('\u001B[1m Undeploying OAI Object(s) FAILED\u001B[0m') return + # Cleaning any created tmp volume + cmd = 'docker volume prune --force || true' + logging.debug(cmd) + deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=100) + HTML.CreateHtmlTestRow('n/a', 'OK', CONST.ALL_PROCESSES_OK) logging.info('\u001B[1m Undeploying OAI Object(s) PASS\u001B[0m') From bcc68d6597b84b30d3f072bf9e41178dc87870e0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 7 Jan 2022 17:37:01 +0100 Subject: [PATCH 069/107] CI: store both core dump and executable in zip --- ci-scripts/ran.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 4caa876719..b35b73e9d3 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -738,7 +738,10 @@ class RANManagement(): mySSH.command('echo ' + self.eNBPassword + ' | sudo -S mv /tmp/enb_*.pcap .','\$',20) mySSH.command('echo ' + self.eNBPassword + ' | sudo -S mv /tmp/gnb_*.pcap .','\$',20) mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm -f enb.log.zip', '\$', 5) - mySSH.command('echo ' + self.eNBPassword + ' | sudo -S zip enb.log.zip enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png ping*.log.png log/*/*.log log/*/*.pcap', '\$', 60) + mySSH.command('echo ' + self.eNBPassword + ' | sudo -S zip enb.log.zip enb*.log enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png ping*.log.png log/*/*.log log/*/*.pcap', '\$', 60) + result = re.search('core.\d+', mySSH.getBefore()) + if result is not None: + mySSH.command('echo ' + self.eNBPassword + ' | sudo -S zip enb.log.zip core* ran_build/build/{lte,nr}-softmodem', '\$', 60) # add core and executable to zip mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png ping*.log.png log/*/*.log log/*/*.pcap', '\$', 15) mySSH.close() From f5d949742e7a786311e4625759b36bcedb85ec94 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 7 Jan 2022 18:59:20 +0100 Subject: [PATCH 070/107] CI: refine tshark capture filters The CI pcaps are too large if we have large data traffic, as they include all the GTP capture (they contain basically the data that we send in the tests). This commit reduces this: - in the RAN: capture only S1AP (port 36412), X2AP (36422), NGAP (38412) traffic - in the CN: exclude GTP traffic (port 2152) --- ci-scripts/cls_containerize.py | 2 +- ci-scripts/epc.py | 6 +++--- ci-scripts/ran.py | 10 ++++++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index db51f2647c..ef382a8c6c 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -689,7 +689,7 @@ class Containerize(): def CaptureOnDockerNetworks(self): cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml config | grep com.docker.network.bridge.name | sed -e "s@^.*name: @@"' networkNames = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) - cmd = 'sudo nohup tshark -f "not tcp and not arp and not port 53 and not host archive.ubuntu.com and not host security.ubuntu.com"' + cmd = 'sudo nohup tshark -f "not tcp and not arp and not port 53 and not host archive.ubuntu.com and not host security.ubuntu.com and not port 2152"' for name in networkNames.split('\n'): res = re.search('rfsim', name) if res is not None: diff --git a/ci-scripts/epc.py b/ci-scripts/epc.py index a7d923ca90..a62bb96ed1 100644 --- a/ci-scripts/epc.py +++ b/ci-scripts/epc.py @@ -133,7 +133,7 @@ class EPCManagement(): mySSH.open(self.IPAddress, self.UserName, self.Password) if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): logging.debug('Using the OAI EPC Release 14 MME in Docker') - mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-mme /bin/bash -c "nohup tshark -i eth0 -i lo:s10 -w /tmp/mme_check_run.pcap 2>&1 > /dev/null"', '\$', 5) + mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-mme /bin/bash -c "nohup tshark -i eth0 -i lo:s10 -f "not port 2152" -w /tmp/mme_check_run.pcap 2>&1 > /dev/null"', '\$', 5) time.sleep(5) mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-mme /bin/bash -c "nohup ./bin/oai_mme -c ./etc/' + self.mmeConfFile + ' > mme_check_run.log 2>&1"', '\$', 5) elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): @@ -198,8 +198,8 @@ class EPCManagement(): mySSH.open(self.IPAddress, self.UserName, self.Password) if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): logging.debug('Using the OAI EPC Release 14 SPGW-CUPS in Docker') - mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-spgwc /bin/bash -c "nohup tshark -i eth0 -i lo:p5c -i lo:s5c -w /tmp/spgwc_check_run.pcap 2>&1 > /dev/null"', '\$', 5) - mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-spgwu-tiny /bin/bash -c "nohup tshark -i eth0 -w /tmp/spgwu_check_run.pcap 2>&1 > /dev/null"', '\$', 5) + mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-spgwc /bin/bash -c "nohup tshark -i eth0 -i lo:p5c -i lo:s5c -f "not port 2152" -w /tmp/spgwc_check_run.pcap 2>&1 > /dev/null"', '\$', 5) + mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-spgwu-tiny /bin/bash -c "nohup tshark -i eth0 -f "not port 2152" -w /tmp/spgwu_check_run.pcap 2>&1 > /dev/null"', '\$', 5) time.sleep(5) mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-spgwc /bin/bash -c "nohup ./bin/oai_spgwc -o -c ./etc/spgw_c.conf > spgwc_check_run.log 2>&1"', '\$', 5) time.sleep(5) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index b35b73e9d3..3c0abccdbf 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -371,10 +371,11 @@ class RANManagement(): result = re.search('interfaceToUse=(?P[a-zA-Z0-9\-\_]+)done', mySSH.getBefore()) if result is not None: eth_interface = result.group('eth_interface') - logging.debug('\u001B[1m Launching tshark on interface ' + eth_interface + '\u001B[0m') + fltr = 'port 38412 or port 36412 or port 36422' # NGAP, S1AP, X2AP + logging.debug('\u001B[1m Launching tshark on interface ' + eth_interface + ' with filter "' + fltr + '"\u001B[0m') pcapfile = pcapfile_prefix + self.testCase_id + '_log.pcap' mySSH.command('echo ' + lPassWord + ' | sudo -S rm -f /tmp/' + pcapfile , '\$', 5) - mySSH.command('echo $USER; nohup sudo -E tshark -i ' + eth_interface + ' -w /tmp/' + pcapfile + ' > /dev/null 2>&1 &','\$', 5) + mySSH.command('echo $USER; nohup sudo -E tshark -i ' + eth_interface + ' -f "' + fltr + '" -w /tmp/' + pcapfile + ' > /dev/null 2>&1 &','\$', 5) mySSH.close() @@ -390,10 +391,11 @@ class RANManagement(): result = re.search('interfaceToUse=(?P[a-zA-Z0-9\-\_]+)done', mySSH.getBefore()) if result is not None: eth_interface = result.group('eth_interface') - logging.debug('\u001B[1m Launching tshark on interface ' + eth_interface + '\u001B[0m') + fltr = 'port 38412 or port 36412 or port 36422' # NGAP, S1AP, X2AP + logging.debug('\u001B[1m Launching tshark on interface ' + eth_interface + ' with filter "' + fltr + '"\u001B[0m') self.epcPcapFile = 'enb_' + self.testCase_id + '_s1log.pcap' mySSH.command('echo ' + localEpcPassword + ' | sudo -S rm -f /tmp/' + self.epcPcapFile , '\$', 5) - mySSH.command('echo $USER; nohup sudo tshark -f "host ' + lIpAddr +'" -i ' + eth_interface + ' -w /tmp/' + self.epcPcapFile + ' > /tmp/tshark.log 2>&1 &', localEpcUserName, 5) + mySSH.command('echo $USER; nohup sudo tshark -f "host ' + lIpAddr +'" -i ' + eth_interface + ' -f "' + fltr + '" -w /tmp/' + self.epcPcapFile + ' > /tmp/tshark.log 2>&1 &', localEpcUserName, 5) mySSH.close() mySSH.open(lIpAddr, lUserName, lPassWord) mySSH.command('cd ' + lSourcePath, '\$', 5) From 9240d51774e46444c2cf59544a763194ed26659a Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 1 Dec 2021 14:29:48 +0100 Subject: [PATCH 071/107] Complete build_oai usage --- cmake_targets/build_oai | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index b427b161e5..e5a806c0ad 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -99,25 +99,23 @@ Options Makes the LTE softmodem --eNBocp Makes the OCP LTE softmodem --gNB +--gNB Makes the NR softmodem ---nrUE - Makes the NR UE softmodem --RU Makes the OAI RRU --UE Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file +--nrUE + Makes the NR UE softmodem --UE-conf-nvram [configuration file] Specify conf_nvram_path (default \"$conf_nvram_path\") --UE-gen-nvram [output path] Specify gen_nvram_path (default \"$gen_nvram_path\") ---HWLAT - Makes test program for haw latency tests --a | --agent - Enables agent for software-defined control of the eNB -w | --hardware EXMIMO, USRP, BLADERF, LMSSDR, IRIS, ADRV9371_ZC706, SIMU, AW2SORI, None (Default) Adds this RF board support (in external packages installation and in compilation) +-t | --transport + Selects the transport protocol type, options: None, ETHERNET -P | --phy_simulators Makes the unitary tests Layer 1 simulators -S | --core_simulators @@ -128,6 +126,14 @@ Options runs only specified test cases specified here. This flag is only valid with -s -V | --vcd Adds a debgging facility to the binary files: GUI with major internal synchronization events +-x | --xforms + Will compile with software oscilloscope features +--HWLAT + Makes test program for haw latency tests +--HWLAT_TEST + Compiles a hw latency test program +--verbose-ci + Compile with verbose instructions in CI Docker env --verbose-compile Shows detailed compilation instructions in makefile --cflags_processor @@ -163,6 +169,10 @@ Options Build for I/Q record-playback modes -k | --skip-shared-libraries Skip build for shared libraries to reduce compilation time when building frequently for debugging purposes +--ninja + Tell cmake to use the Ninja build system. Without, will generate make files +--sanitize-address | -fsanitize=address + Enable the address sanitizer on all targets --ittiSIM Makes the itti simulator -h | --help From 0c9c716fbc0debc86eace57867da943334d0ec7f Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 14 Dec 2021 18:08:14 +0100 Subject: [PATCH 072/107] Build all libraries in Ubuntu/RHEL containers --- docker/Dockerfile.build.rhel8.2 | 2 +- docker/Dockerfile.build.ubuntu18 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile.build.rhel8.2 b/docker/Dockerfile.build.rhel8.2 index 7ddfcdc034..22486c5e68 100644 --- a/docker/Dockerfile.build.rhel8.2 +++ b/docker/Dockerfile.build.rhel8.2 @@ -35,4 +35,4 @@ COPY . . RUN /bin/sh oaienv && \ cd cmake_targets && \ mkdir -p log && \ - ./build_oai --eNB --gNB --RU --UE --nrUE --ninja -w USRP --verbose-ci + ./build_oai --eNB --gNB --RU --UE --nrUE --ninja --build-lib all -w USRP --verbose-ci diff --git a/docker/Dockerfile.build.ubuntu18 b/docker/Dockerfile.build.ubuntu18 index b479ee90d9..3ba1e41442 100644 --- a/docker/Dockerfile.build.ubuntu18 +++ b/docker/Dockerfile.build.ubuntu18 @@ -35,4 +35,4 @@ COPY . . RUN /bin/sh oaienv && \ cd cmake_targets && \ mkdir -p log && \ - ./build_oai --eNB --gNB --RU --UE --nrUE --ninja -w USRP --verbose-ci + ./build_oai --eNB --gNB --RU --UE --nrUE --ninja --build-lib all -w USRP --verbose-ci From 8c38dc0fbf50da70317ebe7f0c77604d33aa7187 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 24 Dec 2021 13:20:32 +0100 Subject: [PATCH 073/107] Include telnet SOs in container images --- docker/Dockerfile.eNB.rhel8.2 | 2 ++ docker/Dockerfile.eNB.ubuntu18 | 2 ++ docker/Dockerfile.gNB.rhel8.2 | 1 + docker/Dockerfile.gNB.ubuntu18 | 1 + docker/Dockerfile.lteUE.rhel8.2 | 1 + docker/Dockerfile.lteUE.ubuntu18 | 1 + docker/Dockerfile.nrUE.rhel8.2 | 2 ++ docker/Dockerfile.nrUE.ubuntu18 | 2 ++ 8 files changed, 12 insertions(+) diff --git a/docker/Dockerfile.eNB.rhel8.2 b/docker/Dockerfile.eNB.rhel8.2 index bb0a9cb064..6c921a4932 100644 --- a/docker/Dockerfile.eNB.rhel8.2 +++ b/docker/Dockerfile.eNB.rhel8.2 @@ -69,6 +69,8 @@ COPY --from=enb-build \ /oai-ran/cmake_targets/ran_build/build/libparams_libconfig.so \ /oai-ran/cmake_targets/ran_build/build/libdfts.so \ /oai-ran/cmake_targets/ran_build/build/liboai_iqplayer.so \ + /oai-ran/cmake_targets/ran_build/build/libtelnetsrv.so \ + /oai-ran/cmake_targets/ran_build/build/libtelnetsrv_enb.so \ /usr/local/lib/ COPY --from=enb-base \ diff --git a/docker/Dockerfile.eNB.ubuntu18 b/docker/Dockerfile.eNB.ubuntu18 index 23cea729ca..1f375a20dc 100644 --- a/docker/Dockerfile.eNB.ubuntu18 +++ b/docker/Dockerfile.eNB.ubuntu18 @@ -76,6 +76,8 @@ COPY --from=enb-build \ /oai-ran/cmake_targets/ran_build/build/libparams_libconfig.so \ /oai-ran/cmake_targets/ran_build/build/libdfts.so \ /oai-ran/cmake_targets/ran_build/build/liboai_iqplayer.so \ + /oai-ran/cmake_targets/ran_build/build/libtelnetsrv.so \ + /oai-ran/cmake_targets/ran_build/build/libtelnetsrv_enb.so \ /usr/local/lib/ # Now we are copying from builder-image the UHD files. diff --git a/docker/Dockerfile.gNB.rhel8.2 b/docker/Dockerfile.gNB.rhel8.2 index 832fa17153..703f4c67b5 100644 --- a/docker/Dockerfile.gNB.rhel8.2 +++ b/docker/Dockerfile.gNB.rhel8.2 @@ -74,6 +74,7 @@ COPY --from=gnb-build \ /oai-ran/cmake_targets/ran_build/build/libldpc_optim.so \ /oai-ran/cmake_targets/ran_build/build/libldpc_optim8seg.so \ /oai-ran/cmake_targets/ran_build/build/libldpc_orig.so \ + /oai-ran/cmake_targets/ran_build/build/libtelnetsrv.so \ /usr/local/lib/ COPY --from=gnb-base \ diff --git a/docker/Dockerfile.gNB.ubuntu18 b/docker/Dockerfile.gNB.ubuntu18 index 66c5d7703f..24e4bcbc7c 100644 --- a/docker/Dockerfile.gNB.ubuntu18 +++ b/docker/Dockerfile.gNB.ubuntu18 @@ -78,6 +78,7 @@ COPY --from=gnb-build \ /oai-ran/cmake_targets/ran_build/build/libldpc_optim.so \ /oai-ran/cmake_targets/ran_build/build/libldpc_optim8seg.so \ /oai-ran/cmake_targets/ran_build/build/libldpc_orig.so \ + /oai-ran/cmake_targets/ran_build/build/libtelnetsrv.so \ /usr/local/lib/ # Now we are copying from builder-image the UHD files. diff --git a/docker/Dockerfile.lteUE.rhel8.2 b/docker/Dockerfile.lteUE.rhel8.2 index 2580b95278..f547558bdb 100644 --- a/docker/Dockerfile.lteUE.rhel8.2 +++ b/docker/Dockerfile.lteUE.rhel8.2 @@ -73,6 +73,7 @@ COPY --from=lte-ue-build \ /oai-ran/cmake_targets/ran_build/build/libparams_libconfig.so \ /oai-ran/cmake_targets/ran_build/build/libSIMU.so \ /oai-ran/cmake_targets/ran_build/build/libdfts.so \ + /oai-ran/cmake_targets/ran_build/build/libtelnetsrv.so \ /usr/local/lib/ COPY --from=lte-ue-base \ diff --git a/docker/Dockerfile.lteUE.ubuntu18 b/docker/Dockerfile.lteUE.ubuntu18 index 70394d8a4b..a5bf4cfe94 100644 --- a/docker/Dockerfile.lteUE.ubuntu18 +++ b/docker/Dockerfile.lteUE.ubuntu18 @@ -80,6 +80,7 @@ COPY --from=lte-ue-build \ /oai-ran/cmake_targets/ran_build/build/libparams_libconfig.so \ /oai-ran/cmake_targets/ran_build/build/libSIMU.so \ /oai-ran/cmake_targets/ran_build/build/libdfts.so \ + /oai-ran/cmake_targets/ran_build/build/libtelnetsrv.so \ /usr/local/lib/ # Now we are copying from builder-image the UHD files. diff --git a/docker/Dockerfile.nrUE.rhel8.2 b/docker/Dockerfile.nrUE.rhel8.2 index f774638f47..cbc8d8c65f 100644 --- a/docker/Dockerfile.nrUE.rhel8.2 +++ b/docker/Dockerfile.nrUE.rhel8.2 @@ -76,6 +76,8 @@ COPY --from=nr-ue-build \ /oai-ran/cmake_targets/ran_build/build/libldpc_optim.so \ /oai-ran/cmake_targets/ran_build/build/libldpc_optim8seg.so \ /oai-ran/cmake_targets/ran_build/build/libldpc_orig.so \ + /oai-ran/cmake_targets/ran_build/build/libtelnetsrv.so \ + /oai-ran/cmake_targets/ran_build/build/libtelnetsrv_5Gue.so \ /usr/local/lib/ COPY --from=nr-ue-base \ diff --git a/docker/Dockerfile.nrUE.ubuntu18 b/docker/Dockerfile.nrUE.ubuntu18 index 021e8d39cf..126f268e00 100644 --- a/docker/Dockerfile.nrUE.ubuntu18 +++ b/docker/Dockerfile.nrUE.ubuntu18 @@ -81,6 +81,8 @@ COPY --from=nr-ue-build \ /oai-ran/cmake_targets/ran_build/build/libldpc_optim.so \ /oai-ran/cmake_targets/ran_build/build/libldpc_optim8seg.so \ /oai-ran/cmake_targets/ran_build/build/libldpc_orig.so \ + /oai-ran/cmake_targets/ran_build/build/libtelnetsrv.so \ + /oai-ran/cmake_targets/ran_build/build/libtelnetsrv_5Gue.so \ /usr/local/lib/ # Now we are copying from builder-image the UHD files. From 2a4d4d9cbddbe76c331b3615f709c72dda4587aa Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 24 Dec 2021 14:27:37 +0100 Subject: [PATCH 074/107] Add readline library: telnetsrv depends on it --- cmake_targets/tools/build_helper | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 06f32183b7..05075bb8ed 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -756,6 +756,7 @@ check_install_oai_software() { libidn11-dev \ libmysqlclient-dev \ libpython2.7-dev \ + libreadline-dev \ libsctp1 \ libsctp-dev \ libssl-dev \ @@ -842,6 +843,7 @@ check_install_oai_software() { patch \ psmisc \ python \ + readline-devel \ subversion \ xmlstarlet \ python-pip \ From bd08a828cfd7504e82dfaad7408ab03ed6226704 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 27 Dec 2021 14:42:48 +0100 Subject: [PATCH 075/107] Give container image delete some time --- ci-scripts/cls_containerize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index ef382a8c6c..60e755e9cd 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -341,7 +341,7 @@ class Containerize(): # Remove all intermediate build images if self.ranAllowMerge and forceBaseImageBuild: mySSH.command(self.cli + ' image rm ' + baseImage + ':' + baseTag + ' || true', '\$', 30) - mySSH.command(self.cli + ' image rm ran-build:' + imageTag + ' || true','\$', 5) + mySSH.command(self.cli + ' image rm ran-build:' + imageTag + ' || true','\$', 30) # Cleaning any created tmp volume mySSH.command(self.cli + ' volume prune --force || true','\$', 15) mySSH.close() From ac9ee8e206996444c0ee077cc6168b996dda07fd Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 2 Dec 2021 14:49:20 +0100 Subject: [PATCH 076/107] Increase 5G/SA/RFsimulator throughput test --- ci-scripts/xml_files/container_5g_rfsim.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/xml_files/container_5g_rfsim.xml b/ci-scripts/xml_files/container_5g_rfsim.xml index d930886d0b..d1114616a8 100644 --- a/ci-scripts/xml_files/container_5g_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_rfsim.xml @@ -93,7 +93,7 @@ rfsim5g-oai-nr-ue rfsim5g-oai-ext-dn -B 12.1.1.2 -u -i 1 -s - -c 12.1.1.2 -u -i 1 -t 30 -b 400K + -c 12.1.1.2 -u -i 1 -t 30 -b 3M @@ -102,7 +102,7 @@ rfsim5g-oai-ext-dn rfsim5g-oai-nr-ue -u -i 1 -s - -B 12.1.1.2 -c 192.168.72.135 -u -i 1 -t 30 -b 20K + -B 12.1.1.2 -c 192.168.72.135 -u -i 1 -t 30 -b 1M From d02a65c82476ec5fa89ebcdbc975239ad1026ce0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 27 Dec 2021 15:55:42 +0100 Subject: [PATCH 077/107] Tentatively analyze log files of RFsims --- ci-scripts/cls_containerize.py | 21 +++++++++++++++++++-- ci-scripts/main.py | 2 +- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 60e755e9cd..9248eba4b8 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -700,7 +700,7 @@ class Containerize(): logging.debug(cmd) networkNames = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) - def UndeployGenObject(self, HTML): + def UndeployGenObject(self, HTML, RAN): self.exitStatus = 0 ymlPath = self.yamlPath[0].split('/') logPath = '../cmake_targets/log/' + ymlPath[1] @@ -731,7 +731,24 @@ class Containerize(): logging.debug(cmd) deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30) if anyLogs: - cmd = 'mkdir -p '+ logPath + ' && mv ' + self.yamlPath[0] + '/*.log ' + logPath + cmd = 'mkdir -p '+ logPath + ' && cp ' + self.yamlPath[0] + '/*.log ' + logPath + logging.debug(cmd) + deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) + + # Analyzing log file! + filename = self.yamlPath[0] + '/rfsim?g_oai_?nb.log' + logging.debug('\u001B[1m Analyzing xNB logfile \u001B[0m ' + filename) + cmd = 'ls ' + filename + logfileLs = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=5) + logging.debug(logfileLs) + # For the moment just assume this exists + logStatus = RAN.AnalyzeLogFile_eNB(filename, HTML) + if (logStatus < 0): + HTML.CreateHtmlTestRow(RAN.runtime_stats, 'KO', logStatus) + else: + HTML.CreateHtmlTestRow(RAN.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK) + + cmd = 'rm ' + self.yamlPath[0] + '/*.log' logging.debug(cmd) deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) if self.tsharkStarted: diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 3a5a69573d..5b5eec285c 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -909,7 +909,7 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re if CONTAINERS.exitStatus==1: RAN.prematureExit = True elif action == 'UndeployGenObject': - CONTAINERS.UndeployGenObject(HTML) + CONTAINERS.UndeployGenObject(HTML, RAN) if CONTAINERS.exitStatus==1: RAN.prematureExit = True elif action == 'PingFromContainer': From 06bbea7f10aa46e4acc627c881c9d1df90aae834 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 10 Jan 2022 15:44:01 +0100 Subject: [PATCH 078/107] CI: Check for correct files --- ci-scripts/ran.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 3c0abccdbf..f20539b21e 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -1021,12 +1021,9 @@ class RANManagement(): datalog_rt_stats = yaml.load(f,Loader=yaml.FullLoader) rt_keys = datalog_rt_stats['Ref'] #we use the keys from the Ref field - if (os.path.isfile('./nrL1_stats.log')) and (os.path.isfile('./nrL1_stats.log')): - stat_files_present=True - else: - stat_files_present=False - logging.debug("NR Stats files for RT analysis not found") - if stat_files_present: + if os.path.isfile('./nrL1_stats.log') and os.path.isfile('./nrMAC_stats.log'): + # don't use CI-nrL1_stats.log, as this will increase the processing time for + # no reason, we just need the last occurence nrL1_stats = open('./nrL1_stats.log', 'r') nrMAC_stats = open('./nrMAC_stats.log', 'r') for line in nrL1_stats.readlines(): @@ -1047,6 +1044,8 @@ class RANManagement(): real_time_stats[k]=tmp.group(1) nrL1_stats.close() nrMAC_stats.close() + else: + logging.debug("NR Stats files for RT analysis not found") #stdout log file and stat log files analysis completed logging.debug(' File analysis (stdout, stats) completed') From 74a4c2f6ef81334d2642170711c90734fa3efb57 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 10 Jan 2022 15:44:46 +0100 Subject: [PATCH 079/107] CI: Log repo cloning/merging instructions --- ci-scripts/ran.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index f20539b21e..3f9c1a8e9e 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -159,6 +159,7 @@ class RANManagement(): # Raphael: here add a check if git clone or git fetch went smoothly mySSH.command('git config user.email "jenkins@openairinterface.org"', '\$', 5) mySSH.command('git config user.name "OAI Jenkins"', '\$', 5) + mySSH.command('git advice.detachedHead false', '\$', 5) # Checking the BUILD INFO file if not self.backgroundBuild: mySSH.command('ls *.txt', '\$', 5) @@ -203,6 +204,7 @@ class RANManagement(): else: logging.debug('Merging with the target branch: ' + self.ranTargetBranch) mySSH.command('git merge --ff origin/' + self.ranTargetBranch + ' -m "Temporary merge for CI"', '\$', 5) + logging.debug(mySSH.getBefore()) # print what git said when merging/checking out mySSH.command('source oaienv', '\$', 5) mySSH.command('cd cmake_targets', '\$', 5) mySSH.command('mkdir -p log', '\$', 5) @@ -212,6 +214,7 @@ class RANManagement(): mySSH.command('echo "./build_oai ' + self.Build_eNB_args + '" > ./my-lte-softmodem-build.sh', '\$', 5) mySSH.command('chmod 775 ./my-lte-softmodem-build.sh', '\$', 5) mySSH.command('echo ' + lPassWord + ' | sudo -S ls', '\$', 5) + logging.debug(mySSH.getBefore()) # print current directory contents for verification mySSH.command('echo $USER; nohup sudo -E ./my-lte-softmodem-build.sh' + ' > ' + lSourcePath + '/cmake_targets/compile_oai_enb.log ' + ' 2>&1 &', lUserName, 5) mySSH.close() HTML.CreateHtmlTestRow(self.Build_eNB_args, 'OK', CONST.ALL_PROCESSES_OK) From 76411447abc0c9469f195df8c73b4d48c79c6b01 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 10 Jan 2022 15:46:12 +0100 Subject: [PATCH 080/107] CI: Continuously collect RAN logging file output --- ci-scripts/stats_monitor.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ci-scripts/stats_monitor.py b/ci-scripts/stats_monitor.py index 933bf13203..e732325fa1 100755 --- a/ci-scripts/stats_monitor.py +++ b/ci-scripts/stats_monitor.py @@ -61,9 +61,16 @@ class StatMonitor(): def collect(self,node_type): if node_type=='enb': - cmd='cat L1_stats.log MAC_stats.log PDCP_stats.log RRC_stats.log' + files = ["L1_stats.log", "MAC_stats.log", "PDCP_stats.log", "RRC_stats.log"] else: #'gnb' - cmd='cat nrL1_stats.log nrMAC_stats.log nrPDCP_stats.log nrRRC_stats.log' + files = ["nrL1_stats.log", "nrMAC_stats.log", "nrPDCP_stats.log", "nrRRC_stats.log"] + # append each file's contents to another file (prepended with CI-) for + # post-mortem/debugging analysis + for f in files: + cmd = rf'cat {f} >> CI-{f}' + subprocess.Popen(shlex.split(cmd)) + # join the files for further processing + cmd = rf'cat {shlex.join(files)}' process=subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE) output = process.stdout.readlines() if node_type=='enb': From 4e0548328dcef531afcf1f8b06f3a54e64ed8638 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 10 Jan 2022 15:46:45 +0100 Subject: [PATCH 081/107] CI: delete old stats_monitor files --- ci-scripts/stats_monitor.py.old | 94 ----------------------------- ci-scripts/stats_monitor_dev.py | 101 -------------------------------- 2 files changed, 195 deletions(-) delete mode 100755 ci-scripts/stats_monitor.py.old delete mode 100755 ci-scripts/stats_monitor_dev.py diff --git a/ci-scripts/stats_monitor.py.old b/ci-scripts/stats_monitor.py.old deleted file mode 100755 index ae9b39bfa6..0000000000 --- a/ci-scripts/stats_monitor.py.old +++ /dev/null @@ -1,94 +0,0 @@ -import subprocess -import time -import shlex -import re -import sys -import matplotlib.pyplot as plt -import pickle -import numpy as np -import os - -def collect(d, node_type): - if node_type=='enb': - cmd='cat L1_stats.log MAC_stats.log PDCP_stats.log RRC_stats.log' - else: #'gnb' - cmd='cat nrL1_stats.log nrMAC_stats.log nrPDCP_stats.log nrRRC_stats.log' - process=subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE) - output = process.stdout.readlines() - for l in output: - tmp=l.decode("utf-8") - result=re.match(rf'^.*\bPHR\b ([0-9]+).+\bbler\b ([0-9]+\.[0-9]+).+\bmcsoff\b ([0-9]+).+\bmcs\b ([0-9]+)',tmp) - if result is not None: - d['PHR'].append(int(result.group(1))) - d['bler'].append(float(result.group(2))) - d['mcsoff'].append(int(result.group(3))) - d['mcs'].append(int(result.group(4))) - - -def graph(d, node_type): - - - figure, axis = plt.subplots(4, 1,figsize=(10, 10)) - - major_ticks = np.arange(0, len(d['PHR'])+1, 1) - axis[0].set_xticks(major_ticks) - axis[0].set_xticklabels([]) - axis[0].plot(d['PHR'],marker='o') - axis[0].set_xlabel('time') - axis[0].set_ylabel('PHR') - axis[0].set_title("PHR") - - major_ticks = np.arange(0, len(d['bler'])+1, 1) - axis[1].set_xticks(major_ticks) - axis[1].set_xticklabels([]) - axis[1].plot(d['bler'],marker='o') - axis[1].set_xlabel('time') - axis[1].set_ylabel('bler') - axis[1].set_title("bler") - - major_ticks = np.arange(0, len(d['mcsoff'])+1, 1) - axis[2].set_xticks(major_ticks) - axis[2].set_xticklabels([]) - axis[2].plot(d['mcsoff'],marker='o') - axis[2].set_xlabel('time') - axis[2].set_ylabel('mcsoff') - axis[2].set_title("mcsoff") - - major_ticks = np.arange(0, len(d['mcs'])+1, 1) - axis[3].set_xticks(major_ticks) - axis[3].set_xticklabels([]) - axis[3].plot(d['mcs'],marker='o') - axis[3].set_xlabel('time') - axis[3].set_ylabel('mcs') - axis[3].set_title("mcs") - - plt.tight_layout() - # Combine all the operations and display - plt.savefig(node_type+'_stats_monitor.png') - plt.show() - -if __name__ == "__main__": - - node_type = sys.argv[1]#enb or gnb - - d={} - d['PHR']=[] - d['bler']=[] - d['mcsoff']=[] - d['mcs']=[] - - - cmd='ps aux | grep modem | grep -v grep' - process=subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) - output = process.stdout.readlines() - while len(output)!=0 : - collect(d, node_type) - process=subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) - output = process.stdout.readlines() - time.sleep(1) - print('process stopped') - with open(node_type+'_stats_monitor.pickle', 'wb') as handle: - pickle.dump(d, handle, protocol=pickle.HIGHEST_PROTOCOL) - graph(d, node_type) - - diff --git a/ci-scripts/stats_monitor_dev.py b/ci-scripts/stats_monitor_dev.py deleted file mode 100755 index 83de20f5d2..0000000000 --- a/ci-scripts/stats_monitor_dev.py +++ /dev/null @@ -1,101 +0,0 @@ -""" -To create graphs and pickle from runtime statistics in L1,MAC,RRC,PDCP files -""" - -import subprocess -import time -import shlex -import re -import sys -import pickle -import matplotlib.pyplot as plt -import numpy as np -import yaml - - -class StatMonitor(): - def __init__(self,): - with open('stats_monitor_conf.yaml','r') as file: - self.d = yaml.load(file) - for node in self.d: - for metric in self.d[node]: - self.d[node][metric]=[] - - - def process_gnb (self,node_type,output): - for line in output: - tmp=line.decode("utf-8") - result=re.match(r'^.*\bdlsch_rounds\b ([0-9]+)\/([0-9]+).*\bdlsch_errors\b ([0-9]+)',tmp) - if result is not None: - self.d[node_type]['dlsch_err'].append(int(result.group(3))) - percentage=float(result.group(2))/float(result.group(1)) - self.d[node_type]['dlsch_err_perc_round_1'].append(percentage) - result=re.match(r'^.*\bulsch_rounds\b ([0-9]+)\/([0-9]+).*\bulsch_errors\b ([0-9]+)',tmp) - if result is not None: - self.d[node_type]['ulsch_err'].append(int(result.group(3))) - percentage=float(result.group(2))/float(result.group(1)) - self.d[node_type]['ulsch_err_perc_round_1'].append(percentage) - - - def process_enb (self,node_type,output): - for line in output: - tmp=line.decode("utf-8") - result=re.match(r'^.*\bPHR\b ([0-9]+).+\bbler\b ([0-9]+\.[0-9]+).+\bmcsoff\b ([0-9]+).+\bmcs\b ([0-9]+)',tmp) - if result is not None: - self.d[node_type]['PHR'].append(int(result.group(1))) - self.d[node_type]['bler'].append(float(result.group(2))) - self.d[node_type]['mcsoff'].append(int(result.group(3))) - self.d[node_type]['mcs'].append(int(result.group(4))) - - - def collect(self,node_type): - if node_type=='enb': - cmd='cat L1_stats.log MAC_stats.log PDCP_stats.log RRC_stats.log' - else: #'gnb' - cmd='cat nrL1_stats.log nrMAC_stats.log nrPDCP_stats.log nrRRC_stats.log' - process=subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE) - output = process.stdout.readlines() - if node_type=='enb': - self.process_enb(node_type,output) - else: #'gnb' - self.process_gnb(node_type,output) - - - def graph(self,node_type): - col = 1 - figure, axis = plt.subplots(len(self.d[node_type]), col ,figsize=(10, 10)) - i=0 - for metric in self.d[node_type]: - major_ticks = np.arange(0, len(self.d[node_type][metric])+1, 1) - axis[i].set_xticks(major_ticks) - axis[i].set_xticklabels([]) - axis[i].plot(self.d[node_type][metric],marker='o') - axis[i].set_xlabel('time') - axis[i].set_ylabel(metric) - axis[i].set_title(metric) - i+=1 - - plt.tight_layout() - # Combine all the operations and display - plt.savefig(node_type+'_stats_monitor.png') - plt.show() - - -if __name__ == "__main__": - - node = sys.argv[1]#enb or gnb - mon=StatMonitor() - - #collecting stats when modem process is stopped - CMD='ps aux | grep mode | grep -v grep' - process=subprocess.Popen(CMD, shell=True, stdout=subprocess.PIPE) - output = process.stdout.readlines() - while len(output)!=0 : - mon.collect(node) - process=subprocess.Popen(CMD, shell=True, stdout=subprocess.PIPE) - output = process.stdout.readlines() - time.sleep(1) - print('Process stopped') - with open(node+'_stats_monitor.pickle', 'wb') as handle: - pickle.dump(mon.d, handle, protocol=pickle.HIGHEST_PROTOCOL) - mon.graph(node) From 396fcd435ef00c967dfbb08ad9ce15b3fd50ede8 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 12 Jan 2022 14:43:04 +0100 Subject: [PATCH 082/107] CI: force rebuild of ran_base if build_oai/build_helper/Dockerfile change --- ci-scripts/cls_containerize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 9248eba4b8..be42bc2fc5 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -221,7 +221,7 @@ class Containerize(): if (self.ranAllowMerge): imageTag = 'ci-temp' if self.ranTargetBranch == 'develop': - mySSH.command('git diff HEAD..origin/develop -- docker/Dockerfile.base' + self.dockerfileprefix + ' | grep --colour=never -i INDEX', '\$', 5) + mySSH.command('git diff HEAD..origin/develop -- cmake_targets/build_oai cmake_targets/tools/build_helper docker/Dockerfile.base' + self.dockerfileprefix + ' | grep --colour=never -i INDEX', '\$', 5) result = re.search('index', mySSH.getBefore()) if result is not None: forceBaseImageBuild = True From 63a5a097325342a703c63009ca535022b5500e9b Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 13 Jan 2022 18:34:53 +0100 Subject: [PATCH 083/107] Complete build_oai -t options --- cmake_targets/build_oai | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index e5a806c0ad..2a032079d3 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -115,7 +115,7 @@ Options EXMIMO, USRP, BLADERF, LMSSDR, IRIS, ADRV9371_ZC706, SIMU, AW2SORI, None (Default) Adds this RF board support (in external packages installation and in compilation) -t | --transport - Selects the transport protocol type, options: None, ETHERNET + Selects the transport protocol type, options: None, Ethernet, benetel4g, benetel5g -P | --phy_simulators Makes the unitary tests Layer 1 simulators -S | --core_simulators From a8041b6794a84ce9915f390b26a156d70228a0ec Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 13 Jan 2022 18:44:40 +0100 Subject: [PATCH 084/107] CI: Correct file path of logging results --- ci-scripts/cls_containerize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index be42bc2fc5..f2f5d39153 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -736,7 +736,7 @@ class Containerize(): deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) # Analyzing log file! - filename = self.yamlPath[0] + '/rfsim?g_oai_?nb.log' + filename = self.yamlPath[0] + '/rfsim?g-oai-?nb.log' logging.debug('\u001B[1m Analyzing xNB logfile \u001B[0m ' + filename) cmd = 'ls ' + filename logfileLs = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=5) From 5dae0096f00ce118163d722dcc9991ff13e7eb46 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 14 Jan 2022 18:29:17 +0100 Subject: [PATCH 085/107] CI: Rename SA OAIUE x300 test cases to not overwrite N300 results --- ci-scripts/xml_files/fr1_sa_oaiue_x300.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml b/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml index 509fef9e8a..c43bdd2a7c 100644 --- a/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml +++ b/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml @@ -26,19 +26,19 @@ tasks 1 - 040000 + 041000 000002 - 010000 + 011000 000002 - 050000 - 050001 + 051000 + 051001 000001 010002 080000 - + Initialize_OAI_UE Initialize OAI UE (X300) nr @@ -51,7 +51,7 @@ - + Initialize_eNB Initialize gNB -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf --sa --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time @@ -76,14 +76,14 @@ - + Ping Ping from CN to UE: 20pings in 20sec -c 20 5 - + Ping Ping from CN to UE: 100pings in 20sec -c 100 -i 0.2 From 55d1f1bd11ff793fb22dfd5991c3cdb85e253745 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Fri, 14 Jan 2022 19:27:05 +0100 Subject: [PATCH 086/107] fix issue created from fix int8 overflow (int8 overflox is small) --- openair1/PHY/NR_REFSIG/ptrs_nr.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/openair1/PHY/NR_REFSIG/ptrs_nr.c b/openair1/PHY/NR_REFSIG/ptrs_nr.c index d3d4bf0faf..40a6a56611 100644 --- a/openair1/PHY/NR_REFSIG/ptrs_nr.c +++ b/openair1/PHY/NR_REFSIG/ptrs_nr.c @@ -105,10 +105,9 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols, uint8_t L_ptrs, uint16_t ul_dmrs_symb_pos) { - uint i = 0, last_symbol, l_ref; - int l_counter; - l_ref = start_symbol; - last_symbol = start_symbol + duration_in_symbols - 1; + int i = 0; + int l_ref = start_symbol; + const int last_symbol = start_symbol + duration_in_symbols - 1; if (L_ptrs==0) { LOG_E(PHY,"bug: impossible L_ptrs\n"); *ptrs_symbols = 0; @@ -117,7 +116,7 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols, while ( (l_ref + i*L_ptrs) <= last_symbol) { - int is_dmrs_symbol = 0; + int is_dmrs_symbol = 0, l_counter; for(l_counter = l_ref + i*L_ptrs; l_counter >= max(l_ref + (i-1)*L_ptrs + 1, l_ref); l_counter--) { @@ -269,8 +268,8 @@ void nr_ptrs_cpe_estimation(uint8_t K_ptrs, return; } uint16_t sc_per_symbol = (nb_rb + K_ptrs - 1)/K_ptrs; - int16_t *ptrs_p = (int16_t *)malloc(sizeof(int32_t)*((1 + sc_per_symbol/4)*4)); - int16_t *dmrs_comp_p = (int16_t *)malloc(sizeof(int32_t)*((1 + sc_per_symbol/4)*4)); + struct complex16 ptrs_p[(1 + sc_per_symbol/4)*4]; + struct complex16 dmrs_comp_p[(1 + sc_per_symbol/4)*4]; double abs = 0.0; double real = 0.0; double imag = 0.0; @@ -278,7 +277,7 @@ void nr_ptrs_cpe_estimation(uint8_t K_ptrs, double alpha = 0; #endif /* generate PTRS RE for the symbol */ - nr_gen_ref_conj_symbols(gold_seq,sc_per_symbol*2,ptrs_p, NR_MOD_TABLE_QPSK_OFFSET,2);// 2 for QPSK + nr_gen_ref_conj_symbols(gold_seq,sc_per_symbol*2,(int16_t*)ptrs_p, NR_MOD_TABLE_QPSK_OFFSET,2);// 2 for QPSK /* loop over all sub carriers to get compensated RE on ptrs symbols*/ for (int re = 0; re < nb_re_pdsch; re++) { @@ -292,8 +291,8 @@ void nr_ptrs_cpe_estimation(uint8_t K_ptrs, 0,// start_re is 0 here ofdm_symbol_size); if(is_ptrs_re) { - dmrs_comp_p[re_cnt*2] = rxF_comp[re *2]; - dmrs_comp_p[(re_cnt*2)+1] = rxF_comp[(re *2)+1]; + dmrs_comp_p[re_cnt].r = rxF_comp[re *2]; + dmrs_comp_p[re_cnt].i = rxF_comp[(re *2)+1]; re_cnt++; } else { @@ -307,7 +306,7 @@ void nr_ptrs_cpe_estimation(uint8_t K_ptrs, *ptrs_sc = re_cnt; /*Multiple compensated data with conj of PTRS */ - mult_cpx_vector(dmrs_comp_p, ptrs_p, ptrs_ch_p,(1 + sc_per_symbol/4)*4,15); // 2^15 shifted + mult_cpx_vector((int16_t*)dmrs_comp_p, (int16_t*)ptrs_p, ptrs_ch_p,(1 + sc_per_symbol/4)*4,15); // 2^15 shifted /* loop over all ptrs sub carriers in a symbol */ /* sum the error vector */ @@ -331,9 +330,6 @@ void nr_ptrs_cpe_estimation(uint8_t K_ptrs, #ifdef DEBUG_PTRS printf("[PHY][PTRS]: Estimated Symbol %d -> %d + j* %d \n",symbol, error_est[0], error_est[1] ); #endif - /* free vectors */ - free(ptrs_p); - free(dmrs_comp_p); } @@ -426,9 +422,10 @@ void get_slope_from_estimates(uint8_t start, uint8_t end, int16_t *est_p, double /* estimate from slope */ void ptrs_estimate_from_slope(int16_t *error_est, double *slope_p, uint8_t start, uint8_t end) { + struct complex16 *error=(struct complex16 *) error_est; for(uint8_t i = 1; i< (end -start);i++) { - error_est[(start+i)*2] = (error_est[start*2] + (int16_t)(i * slope_p[0]));// real - error_est[((start +i)*2)+1] = (error_est[(start*2)+1] + (int16_t)( i * slope_p[1])); //imag + error[start+i].r = error[start].r + (int16_t)(i * slope_p[0]);// real + error[start+i].i = error[start].i + (int16_t)(i * slope_p[1]); //imag #ifdef DEBUG_PTRS printf("[PHY][PTRS]: Estimated Symbol %2d -> %4d %4d from Slope (%4f %4f)\n", start+i,error_est[(start+i)*2],error_est[((start +i)*2)+1], slope_p[0],slope_p[1]); From e62844bfefd34142d94d3c16d7ff540ba4139954 Mon Sep 17 00:00:00 2001 From: hardy Date: Mon, 17 Jan 2022 12:47:15 +0100 Subject: [PATCH 087/107] debug : change gitpost method --- ci-scripts/Jenkinsfile-trig-nsa | 68 +++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 29 deletions(-) diff --git a/ci-scripts/Jenkinsfile-trig-nsa b/ci-scripts/Jenkinsfile-trig-nsa index 7b4238d678..ef45227111 100644 --- a/ci-scripts/Jenkinsfile-trig-nsa +++ b/ci-scripts/Jenkinsfile-trig-nsa @@ -47,38 +47,48 @@ pipeline { COMMIT_ID=sh returnStdout: true, script: """curl --silent "https://gitlab.eurecom.fr/api/v4/projects/oai%2Fopenairinterface5g/merge_requests/${MR}" | jq ".sha" || true """ COMMIT_ID=COMMIT_ID.trim() echo "Testing NSA on : ${MR} ${SRC_BRANCH} ${COMMIT_ID}" + def GitPostArgs = MR + ' ' + COMMIT_ID + ' ' + //calling NSA B200 - build job: "RAN-NSA-B200-Module-LTEBOX", wait : true, propagate : false, parameters: [ + jobName = "RAN-NSA-B200-Module-LTEBOX" + def jobStatus = build job: jobName, wait : true, propagate : false, parameters: [ string(name: 'eNB_MR', value: String.valueOf(MR)), string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) ] + jobResult = jobStatus.getResult() + def build_url = jobStatus.getBuildVariables()["BUILD_URL"]; + def build_id = jobStatus.getBuildVariables()["BUILD_ID"]; + GitPostArgs += jobName + ' ' + build_url + ' ' + build_id + ' ' + jobResult + echo GitPostArgs + + //calling NSA 2x2 - build job: "RAN-NSA-2x2-Module-OAIEPC", wait : true, propagate : false, parameters: [ - string(name: 'eNB_MR', value: String.valueOf(MR)), - string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), - string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), - string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), - booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) - ] + //build job: "RAN-NSA-2x2-Module-OAIEPC", wait : true, propagate : false, parameters: [ + // string(name: 'eNB_MR', value: String.valueOf(MR)), + // string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), + // string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), + // string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), + // booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) + //] //calling LTE 2x2 - build job: "RAN-LTE-2x2-Module-OAIEPC", wait : true, propagate : false, parameters: [ - string(name: 'eNB_MR', value: String.valueOf(MR)), - string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), - string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), - string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), - booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) - ] + //build job: "RAN-LTE-2x2-Module-OAIEPC", wait : true, propagate : false, parameters: [ + // string(name: 'eNB_MR', value: String.valueOf(MR)), + // string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), + // string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), + // string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), + // booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) + //] //calling SA - build job: "RAN-SA-Module-CN5G", wait : true, propagate : false, parameters: [ - string(name: 'eNB_MR', value: String.valueOf(MR)), - string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), - string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), - string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), - booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) - ] + //build job: "RAN-SA-Module-CN5G", wait : true, propagate : false, parameters: [ + // string(name: 'eNB_MR', value: String.valueOf(MR)), + // string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), + // string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), + // string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), + // booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) + //] //calling OAIUE B200 //build job: "RAN-SA-OAIUE-B200-CN5G", wait : true, propagate : false, parameters: [ // string(name: 'eNB_MR', value: String.valueOf(MR)), @@ -96,13 +106,13 @@ pipeline { // booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) //] //calling OAIUE N310-X300 - build job: "RAN-SA-OAIUE-N310-X300-CN5G", wait : true, propagate : false, parameters: [ - string(name: 'eNB_MR', value: String.valueOf(MR)), - string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), - string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), - string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), - booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) - ] + //build job: "RAN-SA-OAIUE-N310-X300-CN5G", wait : true, propagate : false, parameters: [ + // string(name: 'eNB_MR', value: String.valueOf(MR)), + // string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), + // string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), + // string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), + // booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) + //] } } From 6ab196d03b19f6dbcd27eb7db4bf6c04d3c7be00 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Mon, 17 Jan 2022 13:26:15 +0100 Subject: [PATCH 088/107] fix(ci): no history also for single ssh commands Signed-off-by: Raphael Defosseux --- ci-scripts/sshconnection.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ci-scripts/sshconnection.py b/ci-scripts/sshconnection.py index 67e0b832e6..d5b4a4c83e 100644 --- a/ci-scripts/sshconnection.py +++ b/ci-scripts/sshconnection.py @@ -157,22 +157,24 @@ class SSHConnection(): if not silent: logging.debug(commandline) self.cmd2Results = '' + noHistoryCmd = 'unset HISTFILE; ' + commandline myHost = self.username + '@' + self.ipaddress # CAUTION: THIS METHOD IMPLIES THAT THERE ARE VALID SSH KEYS # BETWEEN THE PYTHON EXECUTOR NODE AND THE REMOTE HOST # OTHERWISE IT WON'T WORK - lSsh = subprocess.Popen(["ssh", "%s" % myHost, commandline],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE) + lSsh = subprocess.Popen(["ssh", "%s" % myHost, noHistoryCmd],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE) self.cmd2Results = str(lSsh.stdout.readlines()) def command3(self, commandline, timeout, silent=False): if not silent: logging.debug(commandline) self.cmd2Results = '' + noHistoryCmd = 'unset HISTFILE; ' + commandline myHost = self.username + '@' + self.ipaddress # CAUTION: THIS METHOD IMPLIES THAT THERE ARE VALID SSH KEYS # BETWEEN THE PYTHON EXECUTOR NODE AND THE REMOTE HOST # OTHERWISE IT WON'T WORK - lSsh = subprocess.Popen(["ssh", "%s" % myHost, commandline],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE) + lSsh = subprocess.Popen(["ssh", "%s" % myHost, noHistoryCmd],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE) return lSsh.stdout.readlines() From 9ab5927dc821b015630652a02a6117af19dad5f1 Mon Sep 17 00:00:00 2001 From: hardy Date: Mon, 17 Jan 2022 14:25:14 +0100 Subject: [PATCH 089/107] update nsa b200 tests --- .../xml_files/container_nsa_b200_quectel.xml | 12 +++---- ci-scripts/xml_files/fr1_nsa_quectel.xml | 31 ++++++++++++++++--- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/ci-scripts/xml_files/container_nsa_b200_quectel.xml b/ci-scripts/xml_files/container_nsa_b200_quectel.xml index 3cac13dad4..552a917dab 100644 --- a/ci-scripts/xml_files/container_nsa_b200_quectel.xml +++ b/ci-scripts/xml_files/container_nsa_b200_quectel.xml @@ -37,8 +37,8 @@ 000001 050000 050001 - 070000 070001 + 070000 050000 050001 010002 @@ -119,19 +119,19 @@ Iperf - iperf (DL/40Mbps/UDP)(60 sec)(single-ue profile) - -u -b 40M -t 60 + iperf (DL/30Mbps/UDP)(60 sec)(single-ue profile) + -u -b 30M -t 60 DL idefix - 3 + 5 95 single-ue Iperf - iperf (UL/2Mbps/UDP)(60 sec)(single-ue profile) - -u -b 2M -t 60 + iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile) + -u -b 3M -t 60 UL idefix 1 diff --git a/ci-scripts/xml_files/fr1_nsa_quectel.xml b/ci-scripts/xml_files/fr1_nsa_quectel.xml index 5e5853ab7f..721c22a840 100644 --- a/ci-scripts/xml_files/fr1_nsa_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_quectel.xml @@ -34,9 +34,10 @@ 050000 050001 000001 + 070003 070000 - 000001 070001 + 070002 000001 050000 050001 @@ -114,16 +115,38 @@ Iperf - iperf (DL/60Mbps/UDP)(60 sec)(single-ue profile) - -u -b 60M -t 60 + iperf (DL/30Mbps/UDP)(30 sec)(single-ue profile) + -u -b 30M -t 30 DL idefix - 3 + 5 95 single-ue + Iperf + iperf (DL/40Mbps/UDP)(30 sec)(single-ue profile) + -u -b 40M -t 30 + DL + idefix + 5 + 95 + single-ue + + + + Iperf + iperf (DL/60Mbps/UDP)(30 sec)(single-ue profile) + -u -b 60M -t 30 + DL + idefix + 5 + 95 + single-ue + + + Iperf iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile) -u -b 3M -t 60 From b0e3867a5f6de4523711e49d56a6bae993e8d6d5 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 17 Jan 2022 15:01:53 +0100 Subject: [PATCH 090/107] Fix: Right RFsim CU/DU filename --- ci-scripts/cls_containerize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index f2f5d39153..cd1320b33f 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -736,7 +736,7 @@ class Containerize(): deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) # Analyzing log file! - filename = self.yamlPath[0] + '/rfsim?g-oai-?nb.log' + filename = self.yamlPath[0] + '/rfsim?g-oai-*.log' # 4g/enb, 5g/gnb, 5g/-du/-cu logging.debug('\u001B[1m Analyzing xNB logfile \u001B[0m ' + filename) cmd = 'ls ' + filename logfileLs = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=5) From 64058d84b3f74de55109206449ff6df3cd2e2fb8 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 17 Jan 2022 16:02:26 +0100 Subject: [PATCH 091/107] Don't execute ls on files to analyze (is useless) --- ci-scripts/cls_containerize.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index cd1320b33f..894067a03f 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -738,9 +738,6 @@ class Containerize(): # Analyzing log file! filename = self.yamlPath[0] + '/rfsim?g-oai-*.log' # 4g/enb, 5g/gnb, 5g/-du/-cu logging.debug('\u001B[1m Analyzing xNB logfile \u001B[0m ' + filename) - cmd = 'ls ' + filename - logfileLs = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=5) - logging.debug(logfileLs) # For the moment just assume this exists logStatus = RAN.AnalyzeLogFile_eNB(filename, HTML) if (logStatus < 0): From 2ded9658b8cf51ee2be8e64da5b3cab61bb462c3 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 17 Jan 2022 17:07:53 +0100 Subject: [PATCH 092/107] including uecap option in runmodem.md and some other improvements in that file --- doc/RUNMODEM.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/RUNMODEM.md b/doc/RUNMODEM.md index d063afd5d9..89d2ec8a2d 100644 --- a/doc/RUNMODEM.md +++ b/doc/RUNMODEM.md @@ -89,6 +89,8 @@ At the UE the --phy-test flag will ```bash sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf --phy-test``` +In phy-test mode it is possible to mimic the reception of UE Capabilities at gNB by passing through the command line parameter `--uecap_file` the location and file name of the input UE Capability file, e.g. `--uecap_file ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml` + ### Launch UE in another window ```bash sudo ./nr-uesoftmodem --phy-test [--rrc_config_path ../../../ci-scripts/rrc-files]``` @@ -122,6 +124,8 @@ gNB on machine 1: `sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf --do-ra` +In do-ra mode it is possible to mimic the reception of UE Capabilities at gNB by passing through the command line parameter `--uecap_file` the location and file name of the input UE Capability file, e.g. `--uecap_file ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml` + UE on machine 2: `sudo ./nr-uesoftmodem --do-ra` @@ -161,13 +165,17 @@ gNB on machine 1: UE on machine 2: -`sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --sa` +`sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 -s 516 --sa` With the RF simulator (on the same machine): `sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --rfsim --sa` -`sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --sa` +`sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 -s 516 --rfsim --sa` + +where `-r` sets the transmission bandwidth configuration in terms of RBs, `-C` sets the downlink carrier frequency and `-s` sets the SSB start subcarrier. + +Additionally, at UE side `--uecap_file` option can be used to pass the UE Capabilities input file (path location + filename), e.g. `--uecap_file ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml` ## IF setup with OAI From 064ed744b3ab3f4a929b73b2116e38f4b9d68ba3 Mon Sep 17 00:00:00 2001 From: hardy Date: Mon, 17 Jan 2022 13:55:30 +0100 Subject: [PATCH 093/107] testing variable names --- ci-scripts/Jenkinsfile-trig-nsa | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/Jenkinsfile-trig-nsa b/ci-scripts/Jenkinsfile-trig-nsa index ef45227111..031f38f989 100644 --- a/ci-scripts/Jenkinsfile-trig-nsa +++ b/ci-scripts/Jenkinsfile-trig-nsa @@ -59,8 +59,8 @@ pipeline { booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) ] jobResult = jobStatus.getResult() - def build_url = jobStatus.getBuildVariables()["BUILD_URL"]; - def build_id = jobStatus.getBuildVariables()["BUILD_ID"]; + build_url = jobStatus.getAbsoluteUrl() + build_id = jobStatus.getNumber().toString() GitPostArgs += jobName + ' ' + build_url + ' ' + build_id + ' ' + jobResult echo GitPostArgs From c555d3968f5568ddc16e4a2ba5dd720603fb8fdf Mon Sep 17 00:00:00 2001 From: hardy Date: Tue, 18 Jan 2022 10:50:58 +0100 Subject: [PATCH 094/107] update nsa b200 tests --- ci-scripts/xml_files/container_nsa_b200_quectel.xml | 8 ++++---- ci-scripts/xml_files/fr1_nsa_quectel.xml | 6 ++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/ci-scripts/xml_files/container_nsa_b200_quectel.xml b/ci-scripts/xml_files/container_nsa_b200_quectel.xml index 552a917dab..55f8b8638d 100644 --- a/ci-scripts/xml_files/container_nsa_b200_quectel.xml +++ b/ci-scripts/xml_files/container_nsa_b200_quectel.xml @@ -119,12 +119,12 @@ Iperf - iperf (DL/30Mbps/UDP)(60 sec)(single-ue profile) - -u -b 30M -t 60 + iperf (DL/40Mbps/UDP)(60 sec)(single-ue profile) + -u -b 40M -t 60 DL idefix - 5 - 95 + 20 + 85 single-ue diff --git a/ci-scripts/xml_files/fr1_nsa_quectel.xml b/ci-scripts/xml_files/fr1_nsa_quectel.xml index 721c22a840..55f6f4376e 100644 --- a/ci-scripts/xml_files/fr1_nsa_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_quectel.xml @@ -35,8 +35,6 @@ 050001 000001 070003 - 070000 - 070001 070002 000001 050000 @@ -137,8 +135,8 @@ Iperf - iperf (DL/60Mbps/UDP)(30 sec)(single-ue profile) - -u -b 60M -t 30 + iperf (DL/60Mbps/UDP)(60 sec)(single-ue profile) + -u -b 60M -t 60 DL idefix 5 From 1f0c2f890c877fae534559761b8cec45f2bcf984 Mon Sep 17 00:00:00 2001 From: hardy Date: Mon, 17 Jan 2022 22:47:41 +0100 Subject: [PATCH 095/107] new git post finalized, to be tested --- ci-scripts/Jenkinsfile-tmp-multi-enb-nsa | 2 +- ci-scripts/Jenkinsfile-trig-nsa | 119 ++++++++++++++++------- ci-scripts/ran_dashboard/Hdashboard.py | 96 +++++++++--------- 3 files changed, 134 insertions(+), 83 deletions(-) diff --git a/ci-scripts/Jenkinsfile-tmp-multi-enb-nsa b/ci-scripts/Jenkinsfile-tmp-multi-enb-nsa index 7ac5942698..6e987a5e38 100644 --- a/ci-scripts/Jenkinsfile-tmp-multi-enb-nsa +++ b/ci-scripts/Jenkinsfile-tmp-multi-enb-nsa @@ -390,7 +390,7 @@ pipeline { steps { script { dir ('ci-scripts/ran_dashboard') { - sh "python3 Hdashboard.py testevent ${params.eNB_MR} ${JOB_NAME} ${env.BUILD_URL} ${env.BUILD_ID} ${StatusForDb} ${params.eNB_CommitID}" + sh "python3 Hdashboard.py testevent ${params.eNB_MR} " } } } diff --git a/ci-scripts/Jenkinsfile-trig-nsa b/ci-scripts/Jenkinsfile-trig-nsa index 031f38f989..a9670bd12b 100644 --- a/ci-scripts/Jenkinsfile-trig-nsa +++ b/ci-scripts/Jenkinsfile-trig-nsa @@ -27,6 +27,9 @@ def pythonExecutor = params.pythonExecutor def TARGET_BRANCH = "develop" def ALLOW_MERGE = true +def GitPostArgs = '' +def DataBaseHost = params.DataBaseHost +def jobStatus pipeline { agent { @@ -47,11 +50,28 @@ pipeline { COMMIT_ID=sh returnStdout: true, script: """curl --silent "https://gitlab.eurecom.fr/api/v4/projects/oai%2Fopenairinterface5g/merge_requests/${MR}" | jq ".sha" || true """ COMMIT_ID=COMMIT_ID.trim() echo "Testing NSA on : ${MR} ${SRC_BRANCH} ${COMMIT_ID}" - def GitPostArgs = MR + ' ' + COMMIT_ID + ' ' + commit = COMMIT_ID.replace("\"","") + GitPostArgs += MR + ' ' + commit + ' ' + echo GitPostArgs + + //calling LTE 2x2 + jobName = "RAN-LTE-2x2-Module-OAIEPC" + jobStatus = build job: jobName, wait : true, propagate : false, parameters: [ + string(name: 'eNB_MR', value: String.valueOf(MR)), + string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), + string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), + string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), + booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) + ] + jobResult = jobStatus.getResult() + build_url = jobStatus.getAbsoluteUrl() + build_id = jobStatus.getNumber().toString() + GitPostArgs += jobName + ' ' + build_url + ' ' + build_id + ' ' + jobResult + ' ' + echo GitPostArgs //calling NSA B200 jobName = "RAN-NSA-B200-Module-LTEBOX" - def jobStatus = build job: jobName, wait : true, propagate : false, parameters: [ + jobStatus = build job: jobName, wait : true, propagate : false, parameters: [ string(name: 'eNB_MR', value: String.valueOf(MR)), string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), @@ -59,36 +79,42 @@ pipeline { booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) ] jobResult = jobStatus.getResult() - build_url = jobStatus.getAbsoluteUrl() - build_id = jobStatus.getNumber().toString() - GitPostArgs += jobName + ' ' + build_url + ' ' + build_id + ' ' + jobResult + build_url = jobStatus.getAbsoluteUrl() + build_id = jobStatus.getNumber().toString() + GitPostArgs += jobName + ' ' + build_url + ' ' + build_id + ' ' + jobResult + ' ' + echo GitPostArgs + + //calling NSA 2x2 + jobName = "RAN-NSA-2x2-Module-OAIEPC" + jobStatus = build job: jobName, wait : true, propagate : false, parameters: [ + string(name: 'eNB_MR', value: String.valueOf(MR)), + string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), + string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), + string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), + booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) + ] + jobResult = jobStatus.getResult() + build_url = jobStatus.getAbsoluteUrl() + build_id = jobStatus.getNumber().toString() + GitPostArgs += jobName + ' ' + build_url + ' ' + build_id + ' ' + jobResult + ' ' + echo GitPostArgs + + //calling SA + jobName = "RAN-SA-Module-CN5G" + jobStatus = build job: jobName, wait : true, propagate : false, parameters: [ + string(name: 'eNB_MR', value: String.valueOf(MR)), + string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), + string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), + string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), + booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) + ] + jobResult = jobStatus.getResult() + build_url = jobStatus.getAbsoluteUrl() + build_id = jobStatus.getNumber().toString() + GitPostArgs += jobName + ' ' + build_url + ' ' + build_id + ' ' + jobResult + ' ' echo GitPostArgs - //calling NSA 2x2 - //build job: "RAN-NSA-2x2-Module-OAIEPC", wait : true, propagate : false, parameters: [ - // string(name: 'eNB_MR', value: String.valueOf(MR)), - // string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), - // string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), - // string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), - // booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) - //] - //calling LTE 2x2 - //build job: "RAN-LTE-2x2-Module-OAIEPC", wait : true, propagate : false, parameters: [ - // string(name: 'eNB_MR', value: String.valueOf(MR)), - // string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), - // string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), - // string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), - // booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) - //] - //calling SA - //build job: "RAN-SA-Module-CN5G", wait : true, propagate : false, parameters: [ - // string(name: 'eNB_MR', value: String.valueOf(MR)), - // string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), - // string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), - // string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), - // booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) - //] //calling OAIUE B200 //build job: "RAN-SA-OAIUE-B200-CN5G", wait : true, propagate : false, parameters: [ // string(name: 'eNB_MR', value: String.valueOf(MR)), @@ -105,19 +131,38 @@ pipeline { // string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), // booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) //] - //calling OAIUE N310-X300 - //build job: "RAN-SA-OAIUE-N310-X300-CN5G", wait : true, propagate : false, parameters: [ - // string(name: 'eNB_MR', value: String.valueOf(MR)), - // string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), - // string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), - // string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), - // booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) - //] + //calling OAIUE N310-X300 + jobName = "RAN-SA-OAIUE-N310-X300-CN5G" + jobStatus = build job: jobName, wait : true, propagate : false, parameters: [ + string(name: 'eNB_MR', value: String.valueOf(MR)), + string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), + string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), + string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), + booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) + ] + jobResult = jobStatus.getResult() + build_url = jobStatus.getAbsoluteUrl() + build_id = jobStatus.getNumber().toString() + GitPostArgs += jobName + ' ' + build_url + ' ' + build_id + ' ' + jobResult + ' ' + echo GitPostArgs } } } } + stage ('Git Post') { + when { + expression { params.DataBaseHost != "none" } + } + agent {label DataBaseHost} + steps { + script { + dir ('ci-scripts/ran_dashboard') { + sh "python3 Hdashboard.py gitpost ${GitPostArgs}" + } + } + } + } } } diff --git a/ci-scripts/ran_dashboard/Hdashboard.py b/ci-scripts/ran_dashboard/Hdashboard.py index 3fae068dc7..864e31fc1f 100644 --- a/ci-scripts/ran_dashboard/Hdashboard.py +++ b/ci-scripts/ran_dashboard/Hdashboard.py @@ -509,81 +509,87 @@ class Dashboard: s3.meta.client.copy(copy_source, 'oaitestdashboard', path+'/'+ 'test_styles.css') - def PostGitNote(self,mr,commit, jobname,buildurl,buildid,status): - #current date and time to be posted with test reulst - now = datetime.now() - dt_string = now.strftime("%d/%m/%Y %H:%M") + def PostGitNote(self,mr,commit,args): + #current date and time to be posted with test results + #now = datetime.now() + #dt_string = now.strftime("%d/%m/%Y %H:%M") - gl = gitlab.Gitlab.from_config('OAI') - project_id = 223 - project = gl.projects.get(project_id) + if len(args)%4 != 0: + print("Wrong Number of Arguments") + return + else : + n_tests=len(args)//4 - #retrieve all the notes from the MR - editable_mr = project.mergerequests.get(int(mr)) - mr_notes = editable_mr.notes.list(all=True) + gl = gitlab.Gitlab.from_config('OAI') + project_id = 223 + project = gl.projects.get(project_id) - #find key word in notes to find out if such a note has already been posted - n=0 - found=False - while found==False and nConsolidated Test Results
'+\ + 'Tested CommitID: ' + commit + '
' + + for i in range(0,n_tests): + jobname = args[4*i] + buildurl = args[4*i+1] + buildid = args[4*i+2] + status = args[4*i+3] + body += jobname+', status is '+status+', ('+buildid+')
' - if found==False: #create new note mr_note = editable_mr.notes.create({ - 'body': 'Consolidated Test Results
'+\ - dt_string + ' ' + commit + ': '+jobname+', status is '+status+', '+\ - '('+buildid+')
' + 'body': body }) editable_mr.save() - else: - #retrieve current note : due to post incr in the parsing loop, need to check note n-1 - cur_body = mr_notes[n-1].body - append_body = dt_string + ' ' + commit + ': '+jobname+', status is '+status+', '+\ - '('+buildid+')
' - new_body = cur_body + append_body - #create a new note at the bottom - mr_note = editable_mr.notes.create({ - 'body': new_body - }) - editable_mr.save() - #delete current note - mr_notes[n-1].delete() - editable_mr.save() def main(): - #call from Jenkinsfile : sh "python3 Hdashboard.py testevent ${params.eNB_MR} ${JOB_NAME} ${env.BUILD_URL} ${env.BUILD_ID} ${StatusForDb} " + #call from slave Jenkinsfile : sh "python3 Hdashboard.py testevent ${params.eNB_MR} " + #call from master Jenkinsfile : sh "python3 Hdashboard.py gitpost ${GitPostArgs}" + - #individual MR test results + test dashboard, event based (end of jenkins pipeline) if len(sys.argv)>1: + + #individual MR test results + test dashboard, event based (end of slave jenkins pipeline) if sys.argv[1]=="testevent" : mr=sys.argv[2] - jobname=sys.argv[3] - buildurl=sys.argv[4] - buildid=sys.argv[5] - status=sys.argv[6] - commit=sys.argv[7] htmlDash=Dashboard() if mr in htmlDash.mr_list: + #single MR test results htmlDash.Build('singleMR',mr,'/tmp/MR'+mr+'_index.html') htmlDash.CopyToS3('/tmp/MR'+mr+'_index.html','oaitestdashboard','MR'+mr+'/index.html') + #all MR test results htmlDash.Build('Tests','0000','/tmp/Tests_index.html') htmlDash.CopyToS3('/tmp/Tests_index.html','oaitestdashboard','index.html') - htmlDash.PostGitNote(mr,commit,jobname,buildurl,buildid,status) + + #git post with MR test results, event based (end of master jenkins pipeline) + elif sys.argv[1]=="gitpost": + mr=sys.argv[2] + commit=sys.argv[3] + args=[] + for i in range (4, len(sys.argv)): #jobname, url, id , result + args.append(sys.argv[i]) + htmlDash=Dashboard() + if mr in htmlDash.mr_list: + htmlDash.PostGitNote(mr,commit, args) else: print("Not a Merge Request => this build is for testing/debug purpose, no report to git") - #test and MR status dash boards, cron based + else: + print("Wrong argument at position 1") + + + #test and MR status dashboards, cron based else: htmlDash=Dashboard() + #all MR status dashboard htmlDash.Build('MR','0000','/tmp/MR_index.html') htmlDash.CopyToS3('/tmp/MR_index.html','oairandashboard','index.html') + #all MR test results htmlDash.Build('Tests','0000','/tmp/Tests_index.html') htmlDash.CopyToS3('/tmp/Tests_index.html','oaitestdashboard','index.html') From b0d462e0ef692dfa4b256502a9c7092ed3be4e04 Mon Sep 17 00:00:00 2001 From: hardy Date: Wed, 19 Jan 2022 07:40:37 +0100 Subject: [PATCH 096/107] bugfix for Git Post (incorrect var init) --- ci-scripts/Jenkinsfile-trig-nsa | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/Jenkinsfile-trig-nsa b/ci-scripts/Jenkinsfile-trig-nsa index a9670bd12b..bf2797572e 100644 --- a/ci-scripts/Jenkinsfile-trig-nsa +++ b/ci-scripts/Jenkinsfile-trig-nsa @@ -51,7 +51,7 @@ pipeline { COMMIT_ID=COMMIT_ID.trim() echo "Testing NSA on : ${MR} ${SRC_BRANCH} ${COMMIT_ID}" commit = COMMIT_ID.replace("\"","") - GitPostArgs += MR + ' ' + commit + ' ' + GitPostArgs = MR + ' ' + commit + ' ' echo GitPostArgs //calling LTE 2x2 From edb876460f49d1e085847c992f1d3d85ce7bbba4 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 19 Jan 2022 14:38:57 +0100 Subject: [PATCH 097/107] feat(ci): adding RAN containers analysis Signed-off-by: Raphael Defosseux --- ci-scripts/cls_containerize.py | 39 +++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 894067a03f..799c58c6aa 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -730,20 +730,34 @@ class Containerize(): cmd = 'cd ' + self.yamlPath[0] + ' && docker logs ' + cName + ' > ' + cName + '.log 2>&1' logging.debug(cmd) deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30) + fullStatus = True if anyLogs: cmd = 'mkdir -p '+ logPath + ' && cp ' + self.yamlPath[0] + '/*.log ' + logPath logging.debug(cmd) deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) # Analyzing log file! - filename = self.yamlPath[0] + '/rfsim?g-oai-*.log' # 4g/enb, 5g/gnb, 5g/-du/-cu - logging.debug('\u001B[1m Analyzing xNB logfile \u001B[0m ' + filename) - # For the moment just assume this exists - logStatus = RAN.AnalyzeLogFile_eNB(filename, HTML) - if (logStatus < 0): - HTML.CreateHtmlTestRow(RAN.runtime_stats, 'KO', logStatus) - else: - HTML.CreateHtmlTestRow(RAN.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK) + listOfPossibleRanContainers = ['enb', 'gnb', 'cu', 'du'] + for container in listOfPossibleRanContainers: + filename = self.yamlPath[0] + '/rfsim?g-oai-' + container + '.log' + cmd = 'ls ' + filename + containerStatus = True + try: + lsStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) + filename = str(lsStatus).strip() + except: + containerStatus = False + if not containerStatus: + continue + + logging.debug('\u001B[1m Analyzing xNB logfile ' + filename + ' \u001B[0m') + # For the moment just assume this exists + logStatus = RAN.AnalyzeLogFile_eNB(filename, HTML) + if (logStatus < 0): + fullStatus = False + HTML.CreateHtmlTestRow(RAN.runtime_stats, 'KO', logStatus) + else: + HTML.CreateHtmlTestRow(RAN.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK) cmd = 'rm ' + self.yamlPath[0] + '/*.log' logging.debug(cmd) @@ -761,6 +775,7 @@ class Containerize(): logging.debug(cmd) copyStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) + logging.debug('\u001B[1m Undeploying \u001B[0m') cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml down' logging.debug(cmd) try: @@ -777,8 +792,12 @@ class Containerize(): logging.debug(cmd) deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=100) - HTML.CreateHtmlTestRow('n/a', 'OK', CONST.ALL_PROCESSES_OK) - logging.info('\u001B[1m Undeploying OAI Object(s) PASS\u001B[0m') + if fullStatus: + HTML.CreateHtmlTestRow('n/a', 'OK', CONST.ALL_PROCESSES_OK) + logging.info('\u001B[1m Undeploying OAI Object(s) PASS\u001B[0m') + else: + HTML.CreateHtmlTestRow('n/a', 'KO', CONST.ALL_PROCESSES_OK) + logging.info('\u001B[1m Undeploying OAI Object(s) FAIL\u001B[0m') def PingFromContainer(self, HTML): self.exitStatus = 0 From 425bb1490093a392bbc644e1b5827d33b4eaf7c1 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 19 Jan 2022 14:42:51 +0100 Subject: [PATCH 098/107] fix(ci): better shutdown of container when using USRP Signed-off-by: Raphael Defosseux --- ci-scripts/cls_containerize.py | 23 +++++++++++++++++++---- ci-scripts/epc.py | 2 ++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 799c58c6aa..ba5ce49e8d 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -586,11 +586,20 @@ class Containerize(): mySSH.command('cd ' + lSourcePath + '/' + self.yamlPath[self.eNB_instance], '\$', 5) # Currently support only one mySSH.command('docker-compose --file ci-docker-compose.yml config', '\$', 5) + containerName = '' + containerToKill = False result = re.search('container_name: (?P[a-zA-Z0-9\-\_]+)', mySSH.getBefore()) if self.eNB_logFile[self.eNB_instance] == '': self.eNB_logFile[self.eNB_instance] = 'enb_' + HTML.testCase_id + '.log' if result is not None: containerName = result.group('container_name') + containerToKill = True + if containerToKill: + mySSH.command('docker inspect ' + containerName, '\$', 30) + result = re.search('Error: No such object: ' + containerName, mySSH.getBefore()) + if result is not None: + containerToKill = False + if containerToKill: mySSH.command('docker kill --signal INT ' + containerName, '\$', 30) time.sleep(5) mySSH.command('docker logs ' + containerName + ' > ' + lSourcePath + '/cmake_targets/' + self.eNB_logFile[self.eNB_instance], '\$', 30) @@ -603,20 +612,26 @@ class Containerize(): mySSH.close() # Analyzing log file! - copyin_res = mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/' + self.eNB_logFile[self.eNB_instance], '.') + if containerToKill: + copyin_res = mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/' + self.eNB_logFile[self.eNB_instance], '.') + else: + copyin_res = 0 nodeB_prefix = 'e' if (copyin_res == -1): HTML.htmleNBFailureMsg='Could not copy ' + nodeB_prefix + 'NB logfile to analyze it!' HTML.CreateHtmlTestRow('N/A', 'KO', CONST.ENB_PROCESS_NOLOGFILE_TO_ANALYZE) else: - logging.debug('\u001B[1m Analyzing ' + nodeB_prefix + 'NB logfile \u001B[0m ' + self.eNB_logFile[self.eNB_instance]) - logStatus = RAN.AnalyzeLogFile_eNB(self.eNB_logFile[self.eNB_instance], HTML) + if containerToKill: + logging.debug('\u001B[1m Analyzing ' + nodeB_prefix + 'NB logfile \u001B[0m ' + self.eNB_logFile[self.eNB_instance]) + logStatus = RAN.AnalyzeLogFile_eNB(self.eNB_logFile[self.eNB_instance], HTML) + else: + logStatus = 0 if (logStatus < 0): HTML.CreateHtmlTestRow(RAN.runtime_stats, 'KO', logStatus) else: HTML.CreateHtmlTestRow(RAN.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK) # all the xNB run logs shall be on the server 0 for logCollecting - if self.eNB_serverId[self.eNB_instance] != '0': + if containerToKill and self.eNB_serverId[self.eNB_instance] != '0': mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './' + self.eNB_logFile[self.eNB_instance], self.eNBSourceCodePath + '/cmake_targets/') logging.info('\u001B[1m Undeploying OAI Object Pass\u001B[0m') diff --git a/ci-scripts/epc.py b/ci-scripts/epc.py index a62bb96ed1..9ed9f06d8e 100644 --- a/ci-scripts/epc.py +++ b/ci-scripts/epc.py @@ -532,6 +532,7 @@ class EPCManagement(): logging.debug('Terminating OAI CN5G') mySSH.command('cd /opt/oai-cn5g-fed/docker-compose', '\$', 5) mySSH.command('./core-network.sh stop nrf spgwu', '\$', 60) + mySSH.command('docker volume prune --force || true', '\$', 60) time.sleep(2) mySSH.command('tshark -r /tmp/oai-cn5g.pcap | egrep --colour=never "Tracking area update" ','\$', 30) result = re.search('Tracking area update request', mySSH.getBefore()) @@ -760,6 +761,7 @@ class EPCManagement(): nbContainers += 1 mySSH.command('docker-compose down', '\$', 60) + mySSH.command('docker volume prune --force || true', '\$', 60) mySSH.command('docker inspect --format=\'{{.State.Health.Status}}\' ' + listOfContainers, '\$', 10) noMoreContainerNb = mySSH.getBefore().count('No such object') mySSH.command('docker inspect --format=\'{{.Name}}\' prod-oai-public-net prod-oai-private-net', '\$', 10) From 27599b0b080390ac3e39cc4a48e6690279d60da3 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 19 Jan 2022 11:17:34 +0100 Subject: [PATCH 099/107] fix for phy-simulators compilation --- openair1/SIMULATION/NR_PHY/dlsim.c | 1 + openair1/SIMULATION/NR_PHY/prachsim.c | 1 + openair1/SIMULATION/NR_PHY/ulsim.c | 1 + 3 files changed, 3 insertions(+) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 4a0da8eade..47ef32e1f6 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -82,6 +82,7 @@ RAN_CONTEXT_t RC; int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; double cpuf; +char *uecap_file; uint16_t sf_ahead=4 ; uint16_t sl_ahead=0; diff --git a/openair1/SIMULATION/NR_PHY/prachsim.c b/openair1/SIMULATION/NR_PHY/prachsim.c index 6b9512a38b..fb0f37d7ac 100644 --- a/openair1/SIMULATION/NR_PHY/prachsim.c +++ b/openair1/SIMULATION/NR_PHY/prachsim.c @@ -60,6 +60,7 @@ LCHAN_DESC DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC; rlc_info_t Rlc_info_um,Rlc_info_am_config; +char *uecap_file; PHY_VARS_gNB *gNB; PHY_VARS_NR_UE *UE; RAN_CONTEXT_t RC; diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index ceeded145a..6c2ea03421 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -74,6 +74,7 @@ rlc_info_t Rlc_info_um,Rlc_info_am_config; PHY_VARS_gNB *gNB; PHY_VARS_NR_UE *UE; RAN_CONTEXT_t RC; +char *uecap_file; int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; uint16_t sf_ahead=4 ; From 3d504eb7f831078f7ac90e986c850de05c4238c0 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 19 Jan 2022 15:47:39 +0100 Subject: [PATCH 100/107] feat(ci): disabling obsolete pipelines; splitting the RF sim test into a 4G and a 5G pipelines Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-GitLab-Container | 26 ++++++++-- ci-scripts/Jenkinsfile-gitlab | 68 ------------------------- 2 files changed, 23 insertions(+), 71 deletions(-) diff --git a/ci-scripts/Jenkinsfile-GitLab-Container b/ci-scripts/Jenkinsfile-GitLab-Container index 9ff0371ae5..f5852bace5 100644 --- a/ci-scripts/Jenkinsfile-GitLab-Container +++ b/ci-scripts/Jenkinsfile-GitLab-Container @@ -198,17 +198,37 @@ pipeline { } } } - stage ("RF Simulators") { + stage ("4G RF Simulators") { when { expression {doMandatoryTests} } steps { script { - triggerSlaveJob ('RAN-RF-Sim-Test', 'Test-RF-Sim-Container') + triggerSlaveJob ('RAN-RF-Sim-Test-4G', 'Test-RF-Sim-Container-4G') } } post { always { script { - finalizeSlaveJob('RAN-RF-Sim-Test') + finalizeSlaveJob('RAN-RF-Sim-Test-4G') + } + } + failure { + script { + currentBuild.result = 'FAILURE' + } + } + } + } + stage ("5G RF Simulators") { + when { expression {doMandatoryTests} } + steps { + script { + triggerSlaveJob ('RAN-RF-Sim-Test-5G', 'Test-RF-Sim-Container-4G') + } + } + post { + always { + script { + finalizeSlaveJob('RAN-RF-Sim-Test-5G') } } failure { diff --git a/ci-scripts/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab index df816c12a7..8f1955f265 100644 --- a/ci-scripts/Jenkinsfile-gitlab +++ b/ci-scripts/Jenkinsfile-gitlab @@ -529,52 +529,6 @@ pipeline { } } } - stage ("Test MONOLITHIC - FDD - Band 13 - B210") { - when { - expression {doFullTestsuite} - } - steps { - script { - sh "sleep 60" - triggerSlaveJob ('eNB-CI-MONO-FDD-Band13-B210', 'Test-Mono-FDD-Band13-LTE-M') - } - } - post { - always { - script { - finalizeSlaveJob('eNB-CI-MONO-FDD-Band13-B210') - } - } - failure { - script { - currentBuild.result = 'FAILURE' - } - } - } - } - stage ("Test X2 Handover - FDD - Band 13 - B210") { - when { - expression {doFullTestsuite} - } - steps { - script { - sh "sleep 60" - triggerSlaveJob ('eNB-CI-MONO-FDD-Band13-X2HO-B210', 'Test-Mono-FDD-Band13-X2-HO') - } - } - post { - always { - script { - finalizeSlaveJob('eNB-CI-MONO-FDD-Band13-X2HO-B210') - } - } - failure { - script { - currentBuild.result = 'FAILURE' - } - } - } - } stage ("Test IF4p5 - TDD - Band 38 - B210 - MultiRRU") { when { expression {doFullTestsuite} @@ -643,28 +597,6 @@ pipeline { } } } - stage ("Test OAI OCP-eNB - FDD - Band 7 - B210") { - when { - expression {doFullTestsuite} - } - steps { - script { - triggerSlaveJob ('OCPeNB-FDD-Band7-B210', 'Test-OCP-FDD-Band7') - } - } - post { - always { - script { - finalizeSlaveJob('OCPeNB-FDD-Band7-B210') - } - } - failure { - script { - currentBuild.result = 'FAILURE' - } - } - } - } } post { always { From f157b06a01127ff11d52f57d57ce19cb86e5d407 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 19 Jan 2022 15:59:34 +0100 Subject: [PATCH 101/107] Revert changes in cqi_to_mcs Revert the changes to the cqi_to_mcs table introduced in 9fa09f530f96d23a9e417993ff513af6ec9232db. Also, take out cqi_to_mcs form NR UE, as it is not used in there. --- openair1/PHY/phy_vars.h | 3 +-- openair1/PHY/phy_vars_nr_ue.h | 3 --- openair1/PHY/phy_vars_ue.h | 3 +-- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/openair1/PHY/phy_vars.h b/openair1/PHY/phy_vars.h index 9fd186ec4f..d99a3016ba 100644 --- a/openair1/PHY/phy_vars.h +++ b/openair1/PHY/phy_vars.h @@ -82,8 +82,7 @@ const double sinr_to_cqi[4][16]= { {-2.5051, -2.5051, -1.7451, -0.3655, 1.0812, { -4.1057, -4.1057, -3.3768, -2.2916, -1.1392, 0.1236, 1.2849, 3.1933, 5.9298, 6.4052, 9.6245, 10.9414, 13.5166, 14.9545, 14.9545, 14.9545} }; -//int cqi_to_mcs[16]={0, 0, 1, 3, 5, 7, 9, 13, 15, 16, 20, 23, 25, 27, 27, 27}; -const int cqi_to_mcs[16]= {0, 0, 1, 2, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 27, 27}; +const int cqi_to_mcs[16]= {0, 0, 1, 2, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 27, 28}; //for SNR to MI conversion 7 th order Polynomial coeff const double q_qam16[8]= {3.21151853033897e-10,5.55435952230651e-09,-2.30760065362117e-07,-6.25587743817859e-06,4.62251036452795e-06,0.00224150813158937,0.0393723140344367,0.245486379182639}; diff --git a/openair1/PHY/phy_vars_nr_ue.h b/openair1/PHY/phy_vars_nr_ue.h index 303853add2..550a2f0394 100644 --- a/openair1/PHY/phy_vars_nr_ue.h +++ b/openair1/PHY/phy_vars_nr_ue.h @@ -83,9 +83,6 @@ const double sinr_to_cqi[4][16]= { {-2.5051, -2.5051, -1.7451, -0.3655, 1.0812, { -4.1057, -4.1057, -3.3768, -2.2916, -1.1392, 0.1236, 1.2849, 3.1933, 5.9298, 6.4052, 9.6245, 10.9414, 13.5166, 14.9545, 14.9545, 14.9545} }; -//int cqi_to_mcs[16]={0, 0, 1, 3, 5, 7, 9, 13, 15, 16, 20, 23, 25, 27, 27, 27}; -const int cqi_to_mcs[16]= {0, 0, 1, 2, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 27, 27}; - //for SNR to MI conversion 7 th order Polynomial coeff const double q_qam16[8]= {3.21151853033897e-10,5.55435952230651e-09,-2.30760065362117e-07,-6.25587743817859e-06,4.62251036452795e-06,0.00224150813158937,0.0393723140344367,0.245486379182639}; const double q_qpsk[8]= {1.94491167814437e-09,8.40494123817774e-08,4.75527131198034e-07,-2.48946285301621e-05,-0.000347614016158364,0.00209252225437100,0.0742986115462510,0.488297879889425}; diff --git a/openair1/PHY/phy_vars_ue.h b/openair1/PHY/phy_vars_ue.h index 2c1334b80b..2cdec82f0f 100644 --- a/openair1/PHY/phy_vars_ue.h +++ b/openair1/PHY/phy_vars_ue.h @@ -72,8 +72,7 @@ const double sinr_to_cqi[4][16]= { {-2.5051, -2.5051, -1.7451, -0.3655, 1.0812, { -4.1057, -4.1057, -3.3768, -2.2916, -1.1392, 0.1236, 1.2849, 3.1933, 5.9298, 6.4052, 9.6245, 10.9414, 13.5166, 14.9545, 14.9545, 14.9545} }; -//int cqi_to_mcs[16]={0, 0, 1, 3, 5, 7, 9, 13, 15, 16, 20, 23, 25, 27, 27, 27}; -const int cqi_to_mcs[16]= {0, 0, 1, 2, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 27, 27}; +const int cqi_to_mcs[16]= {0, 0, 1, 2, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 27, 28}; //for SNR to MI conversion 7 th order Polynomial coeff const double q_qam16[8]= {3.21151853033897e-10,5.55435952230651e-09,-2.30760065362117e-07,-6.25587743817859e-06,4.62251036452795e-06,0.00224150813158937,0.0393723140344367,0.245486379182639}; From 6aa7eea09fcdecfed91b06fd0f4f1872e1730b49 Mon Sep 17 00:00:00 2001 From: hardy Date: Thu, 20 Jan 2022 14:04:51 +0100 Subject: [PATCH 102/107] update lte 2x2 for tm2 --- ...nb.band38.lte_2x2_tm2.100PRB.usrpn310.conf | 281 ++++++++++++++++++ ...x2_quectel.xml => lte_2x2_tm1_quectel.xml} | 4 +- ci-scripts/xml_files/lte_2x2_tm2_quectel.xml | 145 +++++++++ 3 files changed, 428 insertions(+), 2 deletions(-) create mode 100644 ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf rename ci-scripts/xml_files/{fr1_lte_2x2_quectel.xml => lte_2x2_tm1_quectel.xml} (97%) create mode 100644 ci-scripts/xml_files/lte_2x2_tm2_quectel.xml diff --git a/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf new file mode 100644 index 0000000000..15a2e6ac1d --- /dev/null +++ b/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf @@ -0,0 +1,281 @@ +Active_eNBs = ( "eNB-Eurecom-B38"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe02; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB-Eurecom-B38"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ( { mcc = 208; mnc = 97; mnc_length = 2; } ); + + tr_s_preference = "local_mac" + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "3GPP_eNODEB"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "TDD"; + tdd_config = 1; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 38; + downlink_frequency = 2605000000L; + nr_scg_ssb_freq = 624608; + uplink_frequency_offset = 0; + Nid_cell = 0; + N_RB_DL = 100; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 2; + nb_antennas_rx = 2; + tx_gain = 90; + rx_gain = 125; + pbch_repetition = "FALSE"; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 0; + pucch_nCS_AN = 0; + pucch_n1_AN = 0; + pdsch_referenceSignalPower = -29; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -96; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -104; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -108; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + ue_TransmissionMode = 2; + + //Parameters for SIB18 + rxPool_sc_CP_Len = "normal"; + rxPool_sc_Period = "sf40"; + rxPool_data_CP_Len = "normal"; + rxPool_ResourceConfig_prb_Num = 20; + rxPool_ResourceConfig_prb_Start = 5; + rxPool_ResourceConfig_prb_End = 44; + rxPool_ResourceConfig_offsetIndicator_present = "prSmall"; + rxPool_ResourceConfig_offsetIndicator_choice = 0; + rxPool_ResourceConfig_subframeBitmap_present = "prBs40"; + rxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "00000000000000000000"; + rxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5; + rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0; +/* rxPool_dataHoppingConfig_hoppingParameter = 0; + rxPool_dataHoppingConfig_numSubbands = "ns1"; + rxPool_dataHoppingConfig_rbOffset = 0; + rxPool_commTxResourceUC-ReqAllowed = "TRUE"; +*/ + // Parameters for SIB19 + discRxPool_cp_Len = "normal" + discRxPool_discPeriod = "rf32" + discRxPool_numRetx = 1; + discRxPool_numRepetition = 2; + discRxPool_ResourceConfig_prb_Num = 5; + discRxPool_ResourceConfig_prb_Start = 3; + discRxPool_ResourceConfig_prb_End = 21; + discRxPool_ResourceConfig_offsetIndicator_present = "prSmall"; + discRxPool_ResourceConfig_offsetIndicator_choice = 0; + discRxPool_ResourceConfig_subframeBitmap_present = "prBs40"; + discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "f0ffffffff"; + discRxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5; + discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0; + + } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + enable_measurement_reports = "no"; + + ///X2 + enable_x2 = "yes"; + t_reloc_prep = 1000; /* unit: millisecond */ + tx2_reloc_overall = 2000; /* unit: millisecond */ + t_dc_prep = 1000; /* unit: millisecond */ + t_dc_overall = 2000; /* unit: millisecond */ + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "eno1"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "CI_ENB_IP_ADDR"; + ENB_INTERFACE_NAME_FOR_S1U = "eno1"; + ENB_IPV4_ADDRESS_FOR_S1U = "CI_ENB_IP_ADDR"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + ENB_IPV4_ADDRESS_FOR_X2C = "CI_ENB_IP_ADDR"; + ENB_PORT_FOR_X2C = 36422; # Spec 36422 + }; + } +); + +MACRLCs = ( + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + phy_test_mode = 0; + scheduler_mode = "fairRR"; + bler_target_upper = 20.0; + bler_target_lower = 10.0; + max_ul_rb_index = 27; + puSch10xSnr = 200; + puCch10xSnr = 150; + } +); + +L1s = ( + { + num_cc = 1; + tr_n_preference = "local_mac"; + prach_dtx_threshold = 200; + pucch1_dtx_threshold = 5 + pucch1ab_dtx_threshold =0; + } +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 2 + nb_rx = 2 + att_tx = 0 + att_rx = 0; + bands = [38]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 75; + eNB_instances = [0]; + sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.20.2,second_addr=192.168.10.2"; + + } +); + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + +NETWORK_CONTROLLER : +{ + FLEXRAN_ENABLED = "no"; + FLEXRAN_INTERFACE_NAME = "lo"; + FLEXRAN_IPV4_ADDRESS = "127.0.0.1"; + FLEXRAN_PORT = 2210; + FLEXRAN_CACHE = "/mnt/oai_agent_cache"; + FLEXRAN_AWAIT_RECONF = "no"; +}; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + diff --git a/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml b/ci-scripts/xml_files/lte_2x2_tm1_quectel.xml similarity index 97% rename from ci-scripts/xml_files/fr1_lte_2x2_quectel.xml rename to ci-scripts/xml_files/lte_2x2_tm1_quectel.xml index 57a66ece76..6cb7b2883b 100644 --- a/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml +++ b/ci-scripts/xml_files/lte_2x2_tm1_quectel.xml @@ -21,8 +21,8 @@ --> - TEST-LTE-TM2 - LTE 2x2 Ping DL UL with QUECTEL + TEST-LTE-TM1-Tab1 + LTE 2x2 TM1 Ping DL UL with QUECTEL tasks 1 diff --git a/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml b/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml new file mode 100644 index 0000000000..fcc772b8f4 --- /dev/null +++ b/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml @@ -0,0 +1,145 @@ + + + TEST-LTE-TM2-Tab2 + LTE 2x2 TM2 Ping DL UL with QUECTEL + tasks + 1 + + 030001 + 000002 + 010000 + 000001 + 050002 + 050003 + 000002 + 070002 + 070003 + 000001 + 010002 + 080000 + + + + + Initialize_UE + Initialize Quectel + nrmodule2_quectel + yes + + + + + Terminate_UE + Terminate Quectel + nrmodule2_quectel + + + + + Initialize_eNB + Initialize eNB + -O ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf --usrp-tx-thread-config 1 --thread-pool 0,2,4,6 --log_config.global_log_options level,nocolor,time + 0 + 0 + lte + yes + yes + 192.168.18.241 + + + + + IdleSleep + Sleep + 5 + + + + IdleSleep + Sleep + 20 + + + + + Ping + Ping: 20 pings + nrmodule2_quectel + -c 20 + 1 + 40 + + + Ping + Ping: 100 pings, size 1024 + nrmodule2_quectel + -c 100 -s 1024 -i 0,2 + 1 + 30 + + + + + Iperf + iperf (DL/26Mbps/UDP)(60 sec)(single-ue profile) + -u -b 26M -t 60 + DL + nrmodule2_quectel + 5 + 95 + single-ue + + + + Iperf + iperf (UL/7Mbps/UDP)(60 sec)(single-ue profile) + -u -b 7M -t 60 + UL + nrmodule2_quectel + 5 + 95 + single-ue + + + + + + + Terminate_eNB + Terminate eNB + 0 + 0 + lte + + + + Terminate_eNB + Terminate gNB + 1 + 1 + nr + + + + From a859c8810f8418c2e5873257df7b1bc95215eadf Mon Sep 17 00:00:00 2001 From: hardy Date: Wed, 19 Jan 2022 16:40:36 +0100 Subject: [PATCH 103/107] make real time monitor cfg PER test (called in xml) + update 2x2 tests requirements --- ci-scripts/constants.py | 1 + ci-scripts/datalog_rt_stats.2x2.yaml | 35 +++++++++++++++++++ ...ats.yaml => datalog_rt_stats.default.yaml} | 0 ci-scripts/main.py | 5 +++ ci-scripts/ran.py | 15 +++++--- ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml | 1 + .../fr1_nsa_2x2_quectel_attach_detach.xml | 1 + ci-scripts/xml_files/fr1_sa_quectel.xml | 1 + .../xml_files/fr1_sa_quectel_162prb.xml | 1 + .../xml_files/fr1_sa_quectel_stages.xml | 1 + .../fr1_sa_quectel_stages_162prb.xml | 1 + 11 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 ci-scripts/datalog_rt_stats.2x2.yaml rename ci-scripts/{datalog_rt_stats.yaml => datalog_rt_stats.default.yaml} (100%) diff --git a/ci-scripts/constants.py b/ci-scripts/constants.py index bb110bc0e8..3c05675928 100644 --- a/ci-scripts/constants.py +++ b/ci-scripts/constants.py @@ -44,6 +44,7 @@ ENB_PROCESS_ASSERTION = -12 ENB_PROCESS_REALTIME_ISSUE = -13 ENB_PROCESS_NOLOGFILE_TO_ANALYZE = -14 ENB_PROCESS_SLAVE_RRU_NOT_SYNCED = -15 +ENB_REAL_TIME_PROCESSING_ISSUE = -16 HSS_PROCESS_FAILED = -2 HSS_PROCESS_OK = +2 MME_PROCESS_FAILED = -3 diff --git a/ci-scripts/datalog_rt_stats.2x2.yaml b/ci-scripts/datalog_rt_stats.2x2.yaml new file mode 100644 index 0000000000..9e2b66862d --- /dev/null +++ b/ci-scripts/datalog_rt_stats.2x2.yaml @@ -0,0 +1,35 @@ +#this is a configuration file +#used to build real time processing statistics +#for 5G NR phy test (gNB terminate) +Title : Processing Time (us) +ColNames : + - Metric + - Average + - Max + - Average vs Reference Deviation (Reference Value ; Acceptability Threshold) +Ref : + feprx : 120.0 + feptx_prec : 8.0 + feptx_ofdm : 50.0 + feptx_total : 75.0 + L1 Tx processing thread 0 : 300.0 + L1 Tx processing thread 1 : 300.0 + DLSCH encoding : 230.0 + L1 Rx processing : 175.0 + PUSCH inner-receiver : 100.0 + PUSCH decoding : 180.0 + DL & UL scheduling timing stats : 37.0 + UL Indication : 38.0 +Threshold : + feprx : 1.25 + feptx_prec : 1.25 + feptx_ofdm : 1.25 + feptx_total : 1.25 + L1 Tx processing thread 0 : 1.25 + L1 Tx processing thread 1 : 1.25 + DLSCH encoding : 1.25 + L1 Rx processing : 1.25 + PUSCH inner-receiver : 1.25 + PUSCH decoding : 1.25 + DL & UL scheduling timing stats : 1.25 + UL Indication : 1.25 diff --git a/ci-scripts/datalog_rt_stats.yaml b/ci-scripts/datalog_rt_stats.default.yaml similarity index 100% rename from ci-scripts/datalog_rt_stats.yaml rename to ci-scripts/datalog_rt_stats.default.yaml diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 3a5a69573d..7a6b743d63 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -155,6 +155,11 @@ def GetParametersFromXML(action): elif action == 'Initialize_eNB': RAN.eNB_Trace=test.findtext('eNB_Trace') RAN.eNB_Stats=test.findtext('eNB_Stats') + datalog_rt_stats_file=test.findtext('rt_stats_cfg') + if datalog_rt_stats_file is None: + RAN.datalog_rt_stats_file='datalog_rt_stats.default.yaml' + else: + RAN.datalog_rt_stats_file=datalog_rt_stats_file RAN.Initialize_eNB_args=test.findtext('Initialize_eNB_args') eNB_instance=test.findtext('eNB_instance') USRPIPAddress=test.findtext('USRP_IPAddress') diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 4caa876719..f296ee368c 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -92,6 +92,7 @@ class RANManagement(): self.epcPcapFile = '' self.runtime_stats= '' self.datalog_rt_stats={} + self.datalog_rt_stats_file='datalog_rt_stats.default.yaml' self.eNB_Trace = '' #if 'yes', Tshark will be launched at initialization self.eNB_Stats = '' #if 'yes', Statistics Monitor will be launched at initialization self.USRPIPAddress = '' @@ -717,6 +718,9 @@ class RANManagement(): logStatus = self.AnalyzeLogFile_eNB(fileToAnalyze, HTML) if (logStatus < 0): HTML.CreateHtmlTestRow('N/A', 'KO', logStatus) + #display rt stats for gNB only + if len(self.datalog_rt_stats)!=0 and nodeB_prefix == 'g': + HTML.CreateHtmlDataLogTable(self.datalog_rt_stats) self.prematureExit = True self.eNBmbmsEnables[int(self.eNB_instance)] = False return @@ -802,6 +806,7 @@ class RANManagement(): #NSA specific log markers nsa_markers ={'SgNBReleaseRequestAcknowledge': [],'FAILURE': [], 'scgFailureInformationNR-r15': [], 'SgNBReleaseRequest': []} nodeB_prefix_found = False + RealTimeProcessingIssue = False line_cnt=0 #log file line counter for line in enb_log_file.readlines(): @@ -1003,7 +1008,7 @@ class RANManagement(): #the following part takes the *_stats.log files as source (not the stdout log file) #the datalog config file has to be loaded - datalog_rt_stats_file='datalog_rt_stats.yaml' + datalog_rt_stats_file=self.datalog_rt_stats_file if (os.path.isfile(datalog_rt_stats_file)): yaml_file=datalog_rt_stats_file elif (os.path.isfile('ci-scripts/'+datalog_rt_stats_file)): @@ -1120,8 +1125,7 @@ class RANManagement(): #check if there is a fail => will render the test as failed for k in datalog_rt_stats['Data']: if float(datalog_rt_stats['Data'][k][2])> datalog_rt_stats['Threshold'][k]: #condition for fail : avg/ref is greater than the fixed threshold - #setting prematureExit is ok although not the best option - self.prematureExit=False #temp for debug : do not stop the test if RT stats are excedeed + RealTimeProcessingIssue = True else: statMsg = 'No real time stats found in the log file\n' logging.debug('No real time stats found in the log file') @@ -1155,7 +1159,10 @@ class RANManagement(): logging.debug(statMsg) htmleNBFailureMsg += htmlMsg - + if RealTimeProcessingIssue: + logging.debug('\u001B[1;37;41m ' + nodeB_prefix + 'NB ended with real time processing issue! \u001B[0m') + htmleNBFailureMsg += 'Fail due to real time processing issue\n' + global_status = CONST.ENB_REAL_TIME_PROCESSING_ISSUE if uciStatMsgCount > 0: statMsg = nodeB_prefix + 'NB showed ' + str(uciStatMsgCount) + ' "uci->stat" message(s)' logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml index 045466a8ad..5c53bf5eed 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml @@ -79,6 +79,7 @@ 1 nr yes + datalog_rt_stats.2x2.yaml 192.168.18.240
diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml index 6fe23e022b..02544f273b 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml @@ -99,6 +99,7 @@ 1 nr yes + datalog_rt_stats.2x2.yaml 192.168.18.240
diff --git a/ci-scripts/xml_files/fr1_sa_quectel.xml b/ci-scripts/xml_files/fr1_sa_quectel.xml index 72b4c0a273..28c6b2e9e0 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel.xml @@ -64,6 +64,7 @@ nr yes yes + datalog_rt_stats.2x2.yaml 192.168.18.240
diff --git a/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml b/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml index f465b320b6..696ec790ff 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml @@ -64,6 +64,7 @@ nr yes yes + datalog_rt_stats.2x2.yaml 192.168.18.240
diff --git a/ci-scripts/xml_files/fr1_sa_quectel_stages.xml b/ci-scripts/xml_files/fr1_sa_quectel_stages.xml index dabe53f233..edc4440612 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel_stages.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel_stages.xml @@ -71,6 +71,7 @@ nr yes yes + datalog_rt_stats.2x2.yaml 192.168.18.240
diff --git a/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml b/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml index c28791e555..5feed75586 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml @@ -73,6 +73,7 @@ nr yes yes + datalog_rt_stats.2x2.yaml 192.168.18.240
From 70b93d0901ff6258890b9c0f3a5e11abea99bdb3 Mon Sep 17 00:00:00 2001 From: hardy Date: Thu, 20 Jan 2022 14:55:14 +0100 Subject: [PATCH 104/107] fix git post in one block for NSA test seq --- ci-scripts/Jenkinsfile-trig-nsa | 49 ++++++++++++++------------------- 1 file changed, 20 insertions(+), 29 deletions(-) diff --git a/ci-scripts/Jenkinsfile-trig-nsa b/ci-scripts/Jenkinsfile-trig-nsa index bf2797572e..69391a5a5f 100644 --- a/ci-scripts/Jenkinsfile-trig-nsa +++ b/ci-scripts/Jenkinsfile-trig-nsa @@ -28,7 +28,6 @@ def pythonExecutor = params.pythonExecutor def TARGET_BRANCH = "develop" def ALLOW_MERGE = true def GitPostArgs = '' -def DataBaseHost = params.DataBaseHost def jobStatus pipeline { @@ -72,7 +71,7 @@ pipeline { //calling NSA B200 jobName = "RAN-NSA-B200-Module-LTEBOX" jobStatus = build job: jobName, wait : true, propagate : false, parameters: [ - string(name: 'eNB_MR', value: String.valueOf(MR)), + string(name: 'eNB_MR', value: String.valueOf(MR)), string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), @@ -116,21 +115,21 @@ pipeline { //calling OAIUE B200 - //build job: "RAN-SA-OAIUE-B200-CN5G", wait : true, propagate : false, parameters: [ - // string(name: 'eNB_MR', value: String.valueOf(MR)), - // string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), - // string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), - // string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), - // booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) - //] + build job: "RAN-SA-OAIUE-B200-CN5G", wait : true, propagate : false, parameters: [ + string(name: 'eNB_MR', value: String.valueOf(MR)), + string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), + string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), + string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), + booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) + ] //calling OAIUE N310 - //build job: "RAN-SA-OAIUE-N310-CN5G", wait : true, propagate : false, parameters: [ - // string(name: 'eNB_MR', value: String.valueOf(MR)), - // string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), - // string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), - // string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), - // booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) - //] + build job: "RAN-SA-OAIUE-N310-CN5G", wait : true, propagate : false, parameters: [ + string(name: 'eNB_MR', value: String.valueOf(MR)), + string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), + string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), + string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), + booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) + ] //calling OAIUE N310-X300 jobName = "RAN-SA-OAIUE-N310-X300-CN5G" @@ -146,23 +145,15 @@ pipeline { build_id = jobStatus.getNumber().toString() GitPostArgs += jobName + ' ' + build_url + ' ' + build_id + ' ' + jobResult + ' ' echo GitPostArgs + + //git report the test results in 1 block, at the end of the test sequence of one MR + dir ('ci-scripts/ran_dashboard') { + sh "python3 Hdashboard.py gitpost ${GitPostArgs}" + } } } } } - stage ('Git Post') { - when { - expression { params.DataBaseHost != "none" } - } - agent {label DataBaseHost} - steps { - script { - dir ('ci-scripts/ran_dashboard') { - sh "python3 Hdashboard.py gitpost ${GitPostArgs}" - } - } - } - } } } From ecdb8ee05fbfbab32c7e69528f65bd7cafb0c08e Mon Sep 17 00:00:00 2001 From: hardy Date: Sat, 22 Jan 2022 09:07:46 +0100 Subject: [PATCH 105/107] clean/remove unused tests from scheduled tests (2x2) sequence --- ci-scripts/Jenkinsfile-trig-nsa | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/ci-scripts/Jenkinsfile-trig-nsa b/ci-scripts/Jenkinsfile-trig-nsa index 69391a5a5f..772b34231a 100644 --- a/ci-scripts/Jenkinsfile-trig-nsa +++ b/ci-scripts/Jenkinsfile-trig-nsa @@ -113,24 +113,6 @@ pipeline { GitPostArgs += jobName + ' ' + build_url + ' ' + build_id + ' ' + jobResult + ' ' echo GitPostArgs - - //calling OAIUE B200 - build job: "RAN-SA-OAIUE-B200-CN5G", wait : true, propagate : false, parameters: [ - string(name: 'eNB_MR', value: String.valueOf(MR)), - string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), - string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), - string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), - booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) - ] - //calling OAIUE N310 - build job: "RAN-SA-OAIUE-N310-CN5G", wait : true, propagate : false, parameters: [ - string(name: 'eNB_MR', value: String.valueOf(MR)), - string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), - string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), - string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), - booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) - ] - //calling OAIUE N310-X300 jobName = "RAN-SA-OAIUE-N310-X300-CN5G" jobStatus = build job: jobName, wait : true, propagate : false, parameters: [ From cb06ce6a3bb0e5e18038bf4cc474985a83a3a0ee Mon Sep 17 00:00:00 2001 From: hardy Date: Mon, 24 Jan 2022 10:53:22 +0100 Subject: [PATCH 106/107] fix conf file for LTE 2x2 TM2 --- .../conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf index 15a2e6ac1d..f116c3708d 100644 --- a/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf @@ -36,7 +36,7 @@ eNBs = Nid_cell = 0; N_RB_DL = 100; Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; + nb_antenna_ports = 2; nb_antennas_tx = 2; nb_antennas_rx = 2; tx_gain = 90; From a3d9d50eb9d30bbcbf77356f5736e8c7388433c7 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 27 Jan 2022 14:23:47 +0100 Subject: [PATCH 107/107] fix(ci): Updating the 5G RF simulator tutorial with CN5G v1.3.0 release Also remove an obsolete sub-pipeline Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-gitlab | 22 --- .../5g_f1_rfsimulator/docker-compose.yaml | 4 +- .../yaml_files/5g_f1_rfsimulator/oai-smf.conf | 133 ------------------ .../yaml_files/5g_rfsimulator/README.md | 6 +- .../5g_rfsimulator/docker-compose.yaml | 4 +- .../yaml_files/5g_rfsimulator/oai-smf.conf | 133 ------------------ 6 files changed, 7 insertions(+), 295 deletions(-) delete mode 100644 ci-scripts/yaml_files/5g_f1_rfsimulator/oai-smf.conf delete mode 100644 ci-scripts/yaml_files/5g_rfsimulator/oai-smf.conf diff --git a/ci-scripts/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab index 8f1955f265..3042ada815 100644 --- a/ci-scripts/Jenkinsfile-gitlab +++ b/ci-scripts/Jenkinsfile-gitlab @@ -529,28 +529,6 @@ pipeline { } } } - stage ("Test IF4p5 - TDD - Band 38 - B210 - MultiRRU") { - when { - expression {doFullTestsuite} - } - steps { - script { - triggerSlaveJob ('eNB-CI-IF4p5-TDD-Band38-MultiRRU-B210', 'Test-IF4p5-TDD-Band38-Multi-RRU') - } - } - post { - always { - script { - finalizeSlaveJob('eNB-CI-IF4p5-TDD-Band38-MultiRRU-B210') - } - } - failure { - script { - currentBuild.result = 'FAILURE' - } - } - } - } stage ("Test OAI UE - FDD - Band 20 - B200") { when { expression {doFullTestsuite} diff --git a/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml index eb15aef0d8..6a39f2147e 100644 --- a/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml @@ -111,7 +111,6 @@ services: oai-smf: container_name: "rfsim5g-oai-smf" image: oai-smf:latest - entrypoint: /bin/bash -c "/openair-smf/bin/oai_smf -c /openair-smf/bin/oai-smf.conf -o" environment: - TZ=Europe/Paris - INSTANCE=0 @@ -140,12 +139,13 @@ services: - REGISTER_NRF=yes - DISCOVER_UPF=yes - USE_FQDN_DNS=yes + - DNN_NI0=oai + - DNN_NI2=oai.ipv4 depends_on: - oai-nrf - oai-amf volumes: - ./smf-healthcheck.sh:/openair-smf/bin/smf-healthcheck.sh - - ./oai-smf.conf:/openair-smf/bin/oai-smf.conf healthcheck: test: /bin/bash -c "/openair-smf/bin/smf-healthcheck.sh" interval: 10s diff --git a/ci-scripts/yaml_files/5g_f1_rfsimulator/oai-smf.conf b/ci-scripts/yaml_files/5g_f1_rfsimulator/oai-smf.conf deleted file mode 100644 index 0c83ab8be9..0000000000 --- a/ci-scripts/yaml_files/5g_f1_rfsimulator/oai-smf.conf +++ /dev/null @@ -1,133 +0,0 @@ -################################################################################ -# Licensed to the OpenAirInterface (OAI) Software Alliance under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The OpenAirInterface Software Alliance licenses this file to You under -# the OAI Public License, Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.openairinterface.org/?page_id=698 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#------------------------------------------------------------------------------- -# For more information about the OpenAirInterface (OAI) Software Alliance: -# contact@openairinterface.org -################################################################################ - -SMF = -{ - FQDN = "oai-smf-svc"; - INSTANCE = 0; # 0 is the default - PID_DIRECTORY = "/var/run"; # /var/run is the default - - INTERFACES : - { - N4 : - { - # SMF binded interface for N4 communication (UPF) - INTERFACE_NAME = "eth0"; # YOUR NETWORK CONFIG HERE - IPV4_ADDRESS = "read"; - }; - - SBI : - { - # SMF binded interface for SBI interface (e.g., communication with AMF, UDM) - INTERFACE_NAME = "eth0"; # YOUR NETWORK CONFIG HERE - IPV4_ADDRESS = "read"; - PORT = 80; # YOUR NETWORK CONFIG HERE (default: 80) - HTTP2_PORT = 9090; # YOUR NETWORK CONFIG HERE - API_VERSION = "v1"; # YOUR SMF API VERSION CONFIG HERE - }; - - }; - - - # Pool of UE assigned IP addresses - # Do not make IP pools overlap - # first IPv4 address X.Y.Z.1 is reserved for GTP network device on UPF - IP_ADDRESS_POOL : - { - IPV4_LIST = ( - {RANGE = "12.1.1.2 - 12.1.1.128";}, # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE. - {RANGE = "12.1.1.129 - 12.1.1.224";}, # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE. - {RANGE = "10.10.10.2 - 10.10.10.253";} # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE. - - ); - IPV6_LIST = ( - {PREFIX = "2001:1:2::/64";}, # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE. - {PREFIX = "3001:1:2::/64";}, # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE. - {PREFIX = "4001:1:2::/64";} # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE. - ); - }; - - DNN_LIST = ( - # IPV4_POOL, IPV6_POOL are index in IPV4_LIST, IPV6_LIST, PDU_SESSION_TYPE choice in {IPv4, IPv6, IPv4v6} - {DNN_NI = "default"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 2; IPV6_POOL = -1}, - {DNN_NI = "carrier.com"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 1; IPV6_POOL = -1}, - {DNN_NI = "oai"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 0; IPV6_POOL = -1} - ); - - # DNS address communicated to UEs - DEFAULT_DNS_IPV4_ADDRESS = "192.168.18.129"; # YOUR DNS CONFIG HERE - DEFAULT_DNS_SEC_IPV4_ADDRESS = "192.168.18.129"; # YOUR DNS CONFIG HERE - DEFAULT_DNS_IPV6_ADDRESS = "2001:4860:4860::8888"; # YOUR DNS CONFIG HERE - DEFAULT_DNS_SEC_IPV6_ADDRESS = "2001:4860:4860::8844"; # YOUR DNS CONFIG HERE - - SUPPORT_FEATURES: - { - # STRING, {"yes", "no"}, - REGISTER_NRF = "yes"; # Set to yes if SMF resgisters to an NRF - DISCOVER_UPF = "yes"; # Set to yes to enable UPF discovery and selection - FORCE_PUSH_PROTOCOL_CONFIGURATION_OPTIONS = "no"; # Non standard feature, normally should be set to "no", - # but you may need to set to yes for UE that do not explicitly request a PDN address through NAS signalling - USE_LOCAL_SUBSCRIPTION_INFO = "yes"; # Set to yes if SMF uses local subscription information instead of from an UDM - USE_FQDN_DNS = "yes"; # Set to yes if AMF/UDM/NRF/UPF will relying on a DNS to resolve FQDN - } - - AMF : - { - IPV4_ADDRESS = "0.0.0.0"; # YOUR AMF CONFIG HERE - PORT = 80; # YOUR AMF CONFIG HERE (default: 80) - API_VERSION = "v1"; # YOUR AMF API VERSION FOR SBI CONFIG HERE - FQDN = "oai-amf" # YOUR AMF FQDN CONFIG HERE - }; - - UDM : - { - IPV4_ADDRESS = "127.0.0.1"; # YOUR UDM CONFIG HERE - PORT = 80; # YOUR UDM CONFIG HERE (default: 80) - API_VERSION = "v1"; # YOUR UDM API VERSION FOR SBI CONFIG HERE - FQDN = "localhost" # YOUR UDM FQDN CONFIG HERE - }; - - NRF : - { - IPV4_ADDRESS = "192.168.71.130"; # YOUR NRF CONFIG HERE - PORT = 80; # YOUR NRF CONFIG HERE (default: 80) - API_VERSION = "v1"; # YOUR NRF API VERSION FOR SBI CONFIG HERE - FQDN = "oai-nrf" # YOUR NRF FQDN CONFIG HERE - }; - - UPF_LIST = ( - {IPV4_ADDRESS = "192.168.71.134" ; FQDN = "oai-spgwu"} # YOUR UPF CONFIG HERE - ); - - LOCAL_CONFIGURATION : - { - SESSION_MANAGEMENT_SUBSCRIPTION_LIST = ( - { NSSAI_SST = 222, NSSAI_SD = "123", DNN = "default", DEFAULT_SESSION_TYPE = "IPV4", DEFAULT_SSC_MODE = 1, - QOS_PROFILE_5QI = 7, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT", - QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "20Mbps", SESSION_AMBR_DL = "22Mbps"}, - { NSSAI_SST = 1; NSSAI_SD = "1", DNN = "oai", DEFAULT_SESSION_TYPE = "IPV4", DEFAULT_SSC_MODE = 1, - QOS_PROFILE_5QI = 6, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT", - QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "20Mbps", SESSION_AMBR_DL = "22Mbps"} - ); - }; - -}; - diff --git a/ci-scripts/yaml_files/5g_rfsimulator/README.md b/ci-scripts/yaml_files/5g_rfsimulator/README.md index 5c384b3202..fc562dd1eb 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator/README.md +++ b/ci-scripts/yaml_files/5g_rfsimulator/README.md @@ -14,7 +14,7 @@ This page is only valid for an `Ubuntu18` host. -**NOTE: this version (2021-10-05) is valid for the `v1.1.0` and `v1.2.0` versions of the `OAI 5G CN`.** +**NOTE: this version (2022-01-27) has been updated for the `v1.3.0` version of the `OAI 5G CN`.** **TABLE OF CONTENTS** @@ -76,9 +76,9 @@ $ docker image tag rdefosseoai/oai-nr-ue:develop oai-nr-ue:develop $ docker logout ``` -**CAUTION: 2021/10/05 with the release `v1.2.0` of the `CN5G`, the previous version was not compatible any-more.** +**CAUTION: 2022/01/27 with the release `v1.3.0` of the `CN5G`, the previous version was not compatible any-more.** -**This new version is working for both the `v1.1.0` and `v1.2.0` of the `CN5G`.** +**This new version is working only with the `v1.3.0` of the `CN5G`.** # 2. Deploy containers # diff --git a/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml index 952da8087d..f0476b0a1e 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml @@ -111,7 +111,6 @@ services: oai-smf: container_name: "rfsim5g-oai-smf" image: oai-smf:latest - entrypoint: /bin/bash -c "/openair-smf/bin/oai_smf -c /openair-smf/bin/oai-smf.conf -o" environment: - TZ=Europe/Paris - INSTANCE=0 @@ -140,12 +139,13 @@ services: - REGISTER_NRF=yes - DISCOVER_UPF=yes - USE_FQDN_DNS=yes + - DNN_NI0=oai + - DNN_NI2=oai.ipv4 depends_on: - oai-nrf - oai-amf volumes: - ./smf-healthcheck.sh:/openair-smf/bin/smf-healthcheck.sh - - ./oai-smf.conf:/openair-smf/bin/oai-smf.conf healthcheck: test: /bin/bash -c "/openair-smf/bin/smf-healthcheck.sh" interval: 10s diff --git a/ci-scripts/yaml_files/5g_rfsimulator/oai-smf.conf b/ci-scripts/yaml_files/5g_rfsimulator/oai-smf.conf deleted file mode 100644 index 0c83ab8be9..0000000000 --- a/ci-scripts/yaml_files/5g_rfsimulator/oai-smf.conf +++ /dev/null @@ -1,133 +0,0 @@ -################################################################################ -# Licensed to the OpenAirInterface (OAI) Software Alliance under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The OpenAirInterface Software Alliance licenses this file to You under -# the OAI Public License, Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.openairinterface.org/?page_id=698 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#------------------------------------------------------------------------------- -# For more information about the OpenAirInterface (OAI) Software Alliance: -# contact@openairinterface.org -################################################################################ - -SMF = -{ - FQDN = "oai-smf-svc"; - INSTANCE = 0; # 0 is the default - PID_DIRECTORY = "/var/run"; # /var/run is the default - - INTERFACES : - { - N4 : - { - # SMF binded interface for N4 communication (UPF) - INTERFACE_NAME = "eth0"; # YOUR NETWORK CONFIG HERE - IPV4_ADDRESS = "read"; - }; - - SBI : - { - # SMF binded interface for SBI interface (e.g., communication with AMF, UDM) - INTERFACE_NAME = "eth0"; # YOUR NETWORK CONFIG HERE - IPV4_ADDRESS = "read"; - PORT = 80; # YOUR NETWORK CONFIG HERE (default: 80) - HTTP2_PORT = 9090; # YOUR NETWORK CONFIG HERE - API_VERSION = "v1"; # YOUR SMF API VERSION CONFIG HERE - }; - - }; - - - # Pool of UE assigned IP addresses - # Do not make IP pools overlap - # first IPv4 address X.Y.Z.1 is reserved for GTP network device on UPF - IP_ADDRESS_POOL : - { - IPV4_LIST = ( - {RANGE = "12.1.1.2 - 12.1.1.128";}, # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE. - {RANGE = "12.1.1.129 - 12.1.1.224";}, # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE. - {RANGE = "10.10.10.2 - 10.10.10.253";} # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE. - - ); - IPV6_LIST = ( - {PREFIX = "2001:1:2::/64";}, # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE. - {PREFIX = "3001:1:2::/64";}, # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE. - {PREFIX = "4001:1:2::/64";} # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE. - ); - }; - - DNN_LIST = ( - # IPV4_POOL, IPV6_POOL are index in IPV4_LIST, IPV6_LIST, PDU_SESSION_TYPE choice in {IPv4, IPv6, IPv4v6} - {DNN_NI = "default"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 2; IPV6_POOL = -1}, - {DNN_NI = "carrier.com"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 1; IPV6_POOL = -1}, - {DNN_NI = "oai"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 0; IPV6_POOL = -1} - ); - - # DNS address communicated to UEs - DEFAULT_DNS_IPV4_ADDRESS = "192.168.18.129"; # YOUR DNS CONFIG HERE - DEFAULT_DNS_SEC_IPV4_ADDRESS = "192.168.18.129"; # YOUR DNS CONFIG HERE - DEFAULT_DNS_IPV6_ADDRESS = "2001:4860:4860::8888"; # YOUR DNS CONFIG HERE - DEFAULT_DNS_SEC_IPV6_ADDRESS = "2001:4860:4860::8844"; # YOUR DNS CONFIG HERE - - SUPPORT_FEATURES: - { - # STRING, {"yes", "no"}, - REGISTER_NRF = "yes"; # Set to yes if SMF resgisters to an NRF - DISCOVER_UPF = "yes"; # Set to yes to enable UPF discovery and selection - FORCE_PUSH_PROTOCOL_CONFIGURATION_OPTIONS = "no"; # Non standard feature, normally should be set to "no", - # but you may need to set to yes for UE that do not explicitly request a PDN address through NAS signalling - USE_LOCAL_SUBSCRIPTION_INFO = "yes"; # Set to yes if SMF uses local subscription information instead of from an UDM - USE_FQDN_DNS = "yes"; # Set to yes if AMF/UDM/NRF/UPF will relying on a DNS to resolve FQDN - } - - AMF : - { - IPV4_ADDRESS = "0.0.0.0"; # YOUR AMF CONFIG HERE - PORT = 80; # YOUR AMF CONFIG HERE (default: 80) - API_VERSION = "v1"; # YOUR AMF API VERSION FOR SBI CONFIG HERE - FQDN = "oai-amf" # YOUR AMF FQDN CONFIG HERE - }; - - UDM : - { - IPV4_ADDRESS = "127.0.0.1"; # YOUR UDM CONFIG HERE - PORT = 80; # YOUR UDM CONFIG HERE (default: 80) - API_VERSION = "v1"; # YOUR UDM API VERSION FOR SBI CONFIG HERE - FQDN = "localhost" # YOUR UDM FQDN CONFIG HERE - }; - - NRF : - { - IPV4_ADDRESS = "192.168.71.130"; # YOUR NRF CONFIG HERE - PORT = 80; # YOUR NRF CONFIG HERE (default: 80) - API_VERSION = "v1"; # YOUR NRF API VERSION FOR SBI CONFIG HERE - FQDN = "oai-nrf" # YOUR NRF FQDN CONFIG HERE - }; - - UPF_LIST = ( - {IPV4_ADDRESS = "192.168.71.134" ; FQDN = "oai-spgwu"} # YOUR UPF CONFIG HERE - ); - - LOCAL_CONFIGURATION : - { - SESSION_MANAGEMENT_SUBSCRIPTION_LIST = ( - { NSSAI_SST = 222, NSSAI_SD = "123", DNN = "default", DEFAULT_SESSION_TYPE = "IPV4", DEFAULT_SSC_MODE = 1, - QOS_PROFILE_5QI = 7, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT", - QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "20Mbps", SESSION_AMBR_DL = "22Mbps"}, - { NSSAI_SST = 1; NSSAI_SD = "1", DNN = "oai", DEFAULT_SESSION_TYPE = "IPV4", DEFAULT_SSC_MODE = 1, - QOS_PROFILE_5QI = 6, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT", - QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "20Mbps", SESSION_AMBR_DL = "22Mbps"} - ); - }; - -}; -