diff --git a/ci-scripts/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab index d5c526acb385586c4d2777a05d21f89b55a6839c..576ae7b05555c86cfd84162e4a0468ea488c6325 100644 --- a/ci-scripts/Jenkinsfile-gitlab +++ b/ci-scripts/Jenkinsfile-gitlab @@ -30,8 +30,6 @@ def sendSocialMediaMessage(pipeChannel, pipeColor, pipeMessage) { } } -def doFlexranCtrlTest = false - // Location of the executor node def nodeExecutor = params.nodeExecutor @@ -66,9 +64,6 @@ pipeline { echo "Platform is ${env.TESTPLATFORM_OWNER}" } - if (params.FlexRanRtcGitLabRepository_Credentials != null) { - doFlexranCtrlTest = true - } if (fileExists("flexran")) { sh "rm -Rf flexran > /dev/null 2>&1" } @@ -141,15 +136,13 @@ pipeline { // For the moment, there is no fail criteria. Just a notification of number of files that do not follow sh "./ci-scripts/checkCodingFormattingRules.sh" } - if (doFlexranCtrlTest && doMandatoryTests) { + // With Mosaic 5G being part of OSA and making all it's repositories public + // No need to pass credentials to clone flexran-rtc + if (doMandatoryTests) { sh "mkdir flexran" dir ('flexran') { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.FlexRanRtcGitLabRepository_Credentials}", usernameVariable: 'git_username', passwordVariable: 'git_password'] - ]) { - sh "git clone https://${git_username}:${git_password}@gitlab.eurecom.fr/flexran/flexran-rtc.git . > ../git_clone.log 2>&1" - sh "git checkout develop >> ../git_clone.log 2>&1" - } + sh "git clone https://gitlab.eurecom.fr/flexran/flexran-rtc.git . > ../git_clone.log 2>&1" + sh "git checkout develop >> ../git_clone.log 2>&1" sh "zip -r -qq flexran.zip ." } } @@ -315,7 +308,7 @@ pipeline { stages { stage ("Build Flexran Controller") { when { - expression {doFlexranCtrlTest && doMandatoryTests} + expression {doMandatoryTests} } steps { lock (vmResource) { diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index dff0838d490b84004ae2c3440b20fea7497786ad..f32e8b38646196b406836b45d2602190f639037b 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -150,6 +150,8 @@ class Containerize(): imageNames.append(('oai-nr-ue', 'nrUE')) if self.host == 'Red Hat': imageNames.append(('oai-physim', 'phySim')) + if self.host == 'Ubuntu': + imageNames.append(('oai-lte-ru', 'lteRU')) if len(imageNames) == 0: imageNames.append(('oai-enb', 'eNB')) diff --git a/ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf index 419598647b123e8d151037127fea63f3fbc6393e..7f6bff304d6d3fe9d52fed202369256d2a66e25a 100644 --- a/ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf @@ -19,54 +19,54 @@ eNBs = tracking_area_code = 1; plmn_list = ( { mcc = 208; mnc = 92; mnc_length = 2; } ); - ////////// Physical parameters: + ////////// Physical parameters: component_carriers = ( { - node_function = "NGFI_RCC_IF4p5"; - 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 = 40; - downlink_frequency = 2350000000L; - uplink_frequency_offset = 0; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - 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 = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 0; - pdsch_referenceSignalPower =-27; - 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 =;*/ + node_function = "NGFI_RCC_IF4p5"; + 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 = 40; + downlink_frequency = 2350000000L; + uplink_frequency_offset = 0; + Nid_cell = 0; + N_RB_DL = 25; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 125; + 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 = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 0; + pdsch_referenceSignalPower =-27; + 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"; @@ -76,7 +76,7 @@ eNBs = pucch_deltaF_Format1b = "deltaF3"; pucch_deltaF_Format2 = "deltaF0"; pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; rach_numberOfRA_Preambles = 64; rach_preamblesGroupAConfig = "DISABLE"; @@ -92,17 +92,17 @@ eNBs = 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 = 1; + 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 = 1; } ); @@ -148,7 +148,7 @@ eNBs = enable_measurement_reports = "no"; ///X2 - enable_x2 = "no"; + enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ tx2_reloc_overall = 2000; /* unit: millisecond */ t_dc_prep = 1000; /* unit: millisecond */ @@ -186,41 +186,41 @@ eNBs = } ); MACRLCs = ( - { - num_cc = 1; - tr_s_preference = "local_L1"; - tr_n_preference = "local_RRC"; - scheduler_mode = "fairRR"; - puSch10xSnr = 200; - puCch10xSnr = 200; - } + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + scheduler_mode = "fairRR"; + puSch10xSnr = 200; + puCch10xSnr = 200; + } ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - } + { + num_cc = 1; + tr_n_preference = "local_mac"; + } ); RUs = ( - { - local_if_name = "lo"; - remote_address = "127.0.0.2"; - local_address = "127.0.0.1"; - local_portc = 50000; - remote_portc = 50000; - local_portd = 50001; - remote_portd = 50001; - local_rf = "no" - tr_preference = "udp_if4p5" - nb_tx = 1 - nb_rx = 1 - att_tx = 0 - att_rx = 0; - eNB_instances = [0]; - } -); + { + local_if_name = "lo"; + remote_address = "127.0.0.2"; + local_address = "127.0.0.1"; + local_portc = 50000; + remote_portc = 50000; + local_portd = 50001; + remote_portd = 50001; + local_rf = "no" + tr_preference = "udp_if4p5" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + eNB_instances = [0]; + } +); THREAD_STRUCT = ( { diff --git a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf index 2c3c11b84f287cc237922114166ecf9809863331..574c8b25456d5ce7d8f9d72f4a2c379e64143798 100644 --- a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf @@ -25,51 +25,51 @@ eNBs = component_carriers = ( { - node_function = "NGFI_RCC_IF4p5"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2680000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - 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 = -25; - 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 =;*/ + node_function = "NGFI_RCC_IF4p5"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 2680000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 25; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + 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 = -25; + 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"; @@ -79,7 +79,7 @@ eNBs = pucch_deltaF_Format1b = "deltaF3"; pucch_deltaF_Format2 = "deltaF0"; pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; rach_numberOfRA_Preambles = 64; rach_preamblesGroupAConfig = "DISABLE"; @@ -97,25 +97,25 @@ eNBs = 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 = 1; + 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 = 1; //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_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; @@ -185,7 +185,7 @@ eNBs = enable_measurement_reports = "no"; ///X2 - enable_x2 = "no"; + enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ tx2_reloc_overall = 2000; /* unit: millisecond */ t_dc_prep = 1000; /* unit: millisecond */ @@ -205,21 +205,21 @@ eNBs = ); MACRLCs = ( - { - num_cc = 1; - tr_s_preference = "local_L1"; - tr_n_preference = "local_RRC"; - phy_test_mode = 0; - puSch10xSnr = 160; - puCch10xSnr = 160; - } + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + phy_test_mode = 0; + puSch10xSnr = 160; + puCch10xSnr = 160; + } ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - } + { + num_cc = 1; + tr_n_preference = "local_mac"; + } ); RUs = ( @@ -260,20 +260,20 @@ NETWORK_CONTROLLER : 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"; - }; +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/common/utils/system.c b/common/utils/system.c index 4c6c1a4dc0bf0b297b549d92d3a4e3f3aa70f39c..37622932ff7a2fe279207d2fe636a97204482170 100644 --- a/common/utils/system.c +++ b/common/utils/system.c @@ -96,6 +96,51 @@ static void read_pipe(int p, char *b, int size) { } } +static int baseRunTimeCommand(char* cmd) { + FILE *fp; + size_t retSize = 0; + + fp = popen(cmd, "r"); + + memset(cmd, 1, sizeof(*cmd)); + retSize = fread(cmd, 1, sizeof(*cmd), fp); + fclose(fp); + + if (retSize == 0) { + return 0; + } + return atoi(cmd); +} + +int checkIfFedoraDistribution(void) { + char cmd[200]; + + memset(cmd, 1, 200); + sprintf(cmd, "cat /etc/os-release | grep ID_LIKE | grep -ic fedora || true"); + return baseRunTimeCommand(cmd); +} + +int checkIfGenericKernelOnFedora(void) { + char cmd[200]; + + memset(cmd, 1, 200); + sprintf(cmd, "uname -a | grep -c rt || true"); + return (1 - baseRunTimeCommand(cmd)); +} + +int checkIfInsideContainer(void) { + char cmd[200]; + int res = 0; + + memset(cmd, 1, 200); + sprintf(cmd, "cat /proc/self/cgroup | egrep -c 'libpod|podman|kubepods' || true"); + res = baseRunTimeCommand(cmd); + if (res > 0) + return 1; + else + return 0; +} + /********************************************************************/ /* background process */ /********************************************************************/ @@ -200,29 +245,38 @@ void start_background_system(void) { void threadCreate(pthread_t* t, void * (*func)(void*), void * param, char* name, int affinity, int priority){ pthread_attr_t attr; int ret; + int settingPriority = 1; ret=pthread_attr_init(&attr); AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno); ret=pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno); ret=pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED); AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno); - ret=pthread_attr_setschedpolicy(&attr, SCHED_OAI); - AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno); - if(priority<sched_get_priority_min(SCHED_OAI) || priority>sched_get_priority_max(SCHED_FIFO)) { - LOG_E(TMR,"Prio not possible: %d, min is %d, max: %d, forced in the range\n", - priority, - sched_get_priority_min(SCHED_OAI), - sched_get_priority_max(SCHED_OAI)); - if(priority<sched_get_priority_min(SCHED_OAI)) - priority=sched_get_priority_min(SCHED_OAI); - if(priority>sched_get_priority_max(SCHED_OAI)) - priority=sched_get_priority_max(SCHED_OAI); + if (checkIfFedoraDistribution()) + if (checkIfGenericKernelOnFedora()) + if (checkIfInsideContainer()) + settingPriority = 0; + + if (settingPriority) { + ret=pthread_attr_setschedpolicy(&attr, SCHED_OAI); + AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno); + if(priority<sched_get_priority_min(SCHED_OAI) || priority>sched_get_priority_max(SCHED_FIFO)) { + LOG_E(TMR,"Prio not possible: %d, min is %d, max: %d, forced in the range\n", + priority, + sched_get_priority_min(SCHED_OAI), + sched_get_priority_max(SCHED_OAI)); + if(priority<sched_get_priority_min(SCHED_OAI)) + priority=sched_get_priority_min(SCHED_OAI); + if(priority>sched_get_priority_max(SCHED_OAI)) + priority=sched_get_priority_max(SCHED_OAI); + } + AssertFatal(priority<=sched_get_priority_max(SCHED_OAI),""); + struct sched_param sparam={0}; + sparam.sched_priority = priority; + ret=pthread_attr_setschedparam(&attr, &sparam); + AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno); } - AssertFatal(priority<=sched_get_priority_max(SCHED_OAI),""); - struct sched_param sparam={0}; - sparam.sched_priority = priority; - ret=pthread_attr_setschedparam(&attr, &sparam); - AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno); + ret=pthread_create(t, &attr, func, param); AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno); diff --git a/common/utils/system.h b/common/utils/system.h index fbfd338a1a7a2b4e197d6011cb9405aa4d504abd..c76fef9144a7c9cf64e78015046a020df416faf5 100644 --- a/common/utils/system.h +++ b/common/utils/system.h @@ -58,6 +58,14 @@ void thread_top_init(char *thread_name, uint64_t deadline, uint64_t period); +/**************************************************** + * Functions to check system at runtime. + ****************************************************/ + +int checkIfFedoraDistribution(void); +int checkIfGenericKernelOnFedora(void); +int checkIfInsideContainer(void); + #ifdef __cplusplus } #endif diff --git a/docker/Dockerfile.lteRU.rhel8.2 b/docker/Dockerfile.lteRU.rhel8.2 new file mode 100644 index 0000000000000000000000000000000000000000..35078de00720f47e0b36742dd641b7743a3fa85d --- /dev/null +++ b/docker/Dockerfile.lteRU.rhel8.2 @@ -0,0 +1,99 @@ +#/* +# * 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 +# */ +#--------------------------------------------------------------------- +# +# Dockerfile for the Open-Air-Interface BUILD service +# Valid for RHEL8 +# +#--------------------------------------------------------------------- + +FROM ran-build:latest AS ru-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 && \ + mkdir -p log && \ + ./build_oai --RU --ninja -w USRP --verbose-ci + +RUN yum install -y python3-pip && \ + pip3 install --ignore-installed pyyaml && \ + python3 ./docker/scripts/generateTemplate.py ./docker/scripts/enb_parameters.yaml + +#start from scratch for target executable +FROM registry.access.redhat.com/ubi8/ubi:latest as oai-lte-ru +ENV TZ=Europe/Paris + +RUN yum update -y && \ + yum install -y --enablerepo="ubi-8-codeready-builder" \ + tzdata \ + atlas \ + net-tools \ + iputils \ + iproute && \ + echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \ + echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf + +WORKDIR /opt/oai-lte-ru/bin +COPY --from=ru-build /oai-ran/targets/bin/oairu.Rel15 . +COPY --from=ru-build /oai-ran/docker/scripts/lte_ru_entrypoint.sh entrypoint.sh + +WORKDIR /usr/local/lib/ +COPY --from=ru-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 . +COPY --from=ru-build /oai-ran/targets/bin/libtcp_bridge_oai.so.Rel15 . +COPY --from=ru-build /oai-ran/targets/bin/librfsimulator.so.Rel15 . +COPY --from=ru-build /oai-ran/targets/bin/liboai_usrpdevif.so.Rel15 . +COPY --from=ru-build /oai-ran/targets/bin/libparams_libconfig.so . +COPY --from=ru-build /oai-ran/cmake_targets/ran_build/build/libdfts.so . + +# Copying from the ran-build image the USRP needed packages +COPY --from=ru-build /lib64/libconfig.so.9 /lib64 +COPY --from=ru-build /lib64/libblas.so.3 /lib64 +COPY --from=ru-build /lib64/liblapack.so.3 /lib64 +COPY --from=ru-build /lib64/liblapacke.so.3 /lib64 +COPY --from=ru-build /lib64/libboost_chrono.so.1.66.0 /lib64 +COPY --from=ru-build /lib64/libboost_date_time.so.1.66.0 /lib64 +COPY --from=ru-build /lib64/libboost_filesystem.so.1.66.0 /lib64 +COPY --from=ru-build /lib64/libboost_program_options.so.1.66.0 /lib64 +COPY --from=ru-build /lib64/libboost_serialization.so.1.66.0 /lib64 +COPY --from=ru-build /lib64/libboost_thread.so.1.66.0 /lib64 +COPY --from=ru-build /lib64/libboost_system.so.1.66.0 /lib64 +COPY --from=ru-build /lib64/libboost_unit_test_framework.so.1.66.0 /lib64 +COPY --from=ru-build /lib64/libboost_atomic.so.1.66.0 /lib64 +COPY --from=ru-build /lib64/libboost_timer.so.1.66.0 /lib64 +COPY --from=ru-build /usr/local/lib64/libuhd.so.4.0.0 /usr/local/lib64 + +RUN /bin/bash -c "ln -s /usr/local/lib/liboai_eth_transpro.so.Rel15 /usr/local/lib/liboai_transpro.so" && \ + /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so.Rel15 /usr/local/lib/liboai_device.so" && \ + /bin/bash -c "ln -s /usr/local/lib/librfsimulator.so.Rel15 /usr/local/lib/librfsimulator.so" && \ + ldconfig + +# Copy the relevant configuration files for RRU +WORKDIR /opt/oai-lte-ru/etc +COPY --from=ru-build /oai-ran/docker/etc/rru* ./ + +WORKDIR /opt/oai-lte-ru + +ENTRYPOINT ["/opt/oai-lte-ru/bin/entrypoint.sh"] +CMD ["/opt/oai-lte-ru/bin/oairu.Rel15", "-O", "/opt/oai-lte-ru/etc/rru.conf"] diff --git a/docker/Dockerfile.lteRU.ubuntu18 b/docker/Dockerfile.lteRU.ubuntu18 new file mode 100644 index 0000000000000000000000000000000000000000..381d63d9f30ffcd6faa89e4550f524802e8f19b9 --- /dev/null +++ b/docker/Dockerfile.lteRU.ubuntu18 @@ -0,0 +1,94 @@ +#/* +# * 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 +# */ +#--------------------------------------------------------------------- +# +# Dockerfile for the Open-Air-Interface BUILD service +# Valid for Ubuntu 18.04 +# +#--------------------------------------------------------------------- + +FROM ran-build:latest AS ru-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 && \ + mkdir -p log && \ + ./build_oai --RU --ninja -w USRP --verbose-ci + +RUN apt-get install -y python3-pip && \ + pip3 install --ignore-installed pyyaml && \ + python3 ./docker/scripts/generateTemplate.py ./docker/scripts/enb_parameters.yaml + +#start from scratch for target executable +FROM ubuntu:bionic as oai-lte-ru +ENV DEBIAN_FRONTEND=noninteractive +ENV TZ=Europe/Paris + +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \ + DEBIAN_FRONTEND=noninteractive apt-get install --yes \ + tzdata \ + software-properties-common \ + libblas3 \ + libatlas3-base \ + libconfig9 \ + net-tools \ + iputils-ping \ + iproute2 && \ + # Install UHD driver from ettus ppa + # At time of writing, it is 3.14 + add-apt-repository ppa:ettusresearch/uhd --yes && \ + apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install --yes \ + python \ + libusb-1.0-0 \ + libuhd003 \ + uhd-host && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR /opt/oai-lte-ru/bin +COPY --from=ru-build /oai-ran/targets/bin/oairu.Rel15 . +COPY --from=ru-build /oai-ran/docker/scripts/lte_ru_entrypoint.sh entrypoint.sh + +WORKDIR /usr/local/lib/ +COPY --from=ru-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 . +COPY --from=ru-build /oai-ran/targets/bin/libtcp_bridge_oai.so.Rel15 . +COPY --from=ru-build /oai-ran/targets/bin/librfsimulator.so.Rel15 . +COPY --from=ru-build /oai-ran/targets/bin/liboai_usrpdevif.so.Rel15 . +COPY --from=ru-build /oai-ran/targets/bin/libparams_libconfig.so . +COPY --from=ru-build /oai-ran/cmake_targets/ran_build/build/libdfts.so . +RUN /bin/bash -c "ln -s /usr/local/lib/liboai_eth_transpro.so.Rel15 /usr/local/lib/liboai_transpro.so" && \ + /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so.Rel15 /usr/local/lib/liboai_device.so" && \ + /bin/bash -c "ln -s /usr/local/lib/librfsimulator.so.Rel15 /usr/local/lib/librfsimulator.so" && \ + ldconfig + +# Copy the relevant configuration files for RRU +WORKDIR /opt/oai-lte-ru/etc +COPY --from=ru-build /oai-ran/docker/etc/rru* ./ + +WORKDIR /opt/oai-lte-ru + +ENTRYPOINT ["/opt/oai-lte-ru/bin/entrypoint.sh"] +CMD ["/opt/oai-lte-ru/bin/oairu.Rel15", "-O", "/opt/oai-lte-ru/etc/rru.conf"] diff --git a/docker/scripts/enb_entrypoint.sh b/docker/scripts/enb_entrypoint.sh index dbe97360f67a689a200aa3e51e38d565a34190b1..6810a86416255dec22baf665ed6ee461be6c2193 100755 --- a/docker/scripts/enb_entrypoint.sh +++ b/docker/scripts/enb_entrypoint.sh @@ -11,6 +11,8 @@ if [[ -v USE_FDD_DU ]]; then ln -s $PREFIX/etc/du.fdd.conf $PREFIX/etc/enb.conf; if [[ -v USE_FDD_MONO ]]; then ln -s $PREFIX/etc/enb.fdd.conf $PREFIX/etc/enb.conf; fi if [[ -v USE_TDD_MONO ]]; then ln -s $PREFIX/etc/enb.tdd.conf $PREFIX/etc/enb.conf; fi if [[ -v USE_FDD_FAPI_RCC ]]; then ln -s $PREFIX/etc/rcc.nfapi.fdd.conf $PREFIX/etc/enb.conf; fi +if [[ -v USE_FDD_IF4P5_RCC ]]; then ln -s $PREFIX/etc/rcc.if4p5.fdd.conf $PREFIX/etc/enb.conf; fi +if [[ -v USE_TDD_IF4P5_RCC ]]; then ln -s $PREFIX/etc/rcc.if4p5.tdd.conf $PREFIX/etc/enb.conf; fi if [[ -v USE_FDD_RRU ]]; then ln -s $PREFIX/etc/rru.fdd.conf $PREFIX/etc/enb.conf; fi if [[ -v USE_TDD_RRU ]]; then ln -s $PREFIX/etc/rru.tdd.conf $PREFIX/etc/enb.conf; fi diff --git a/docker/scripts/enb_parameters.yaml b/docker/scripts/enb_parameters.yaml index d115d177ab863df37f232aca8421f060e1e4914c..749600f47d7e8cfe1234415179ff0c889ef1cce8 100644 --- a/docker/scripts/enb_parameters.yaml +++ b/docker/scripts/enb_parameters.yaml @@ -25,7 +25,7 @@ dest_dir: docker/etc - configurations: - - filePrefix: cu + - filePrefix: cu.band7.tm1.25PRB outputfilename: "cu.fdd.conf" config: - key: Active_eNBs @@ -68,7 +68,7 @@ - key: ENB_IPV4_ADDRESS_FOR_X2C env: "@F1_CU_IP_ADDRESS@" - - filePrefix: du + - filePrefix: du.band7.tm1.25PRB outputfilename: "du.fdd.conf" config: - key: Active_eNBs @@ -248,3 +248,89 @@ - key: ENB_IPV4_ADDRESS_FOR_X2C env: "@F1_CU_IP_ADDRESS@" + - filePrefix: "rcc.band7.tm1.if4p5.lo.25PRB" + outputfilename: "rcc.if4p5.fdd.conf" + config: + - key: Active_eNBs + env: "@ENB_NAME@" + - key: eNB_name + env: "@ENB_NAME@" + - key: plmn_list + env: + mcc: "@MCC@" + mnc: "@MNC@" + mnc_length: "@MNC_LENGTH@" + - key: tracking_area_code + env: "@TAC@" + - key: eutra_band + env: "@UTRA_BAND_ID@" + - key: downlink_frequency + env: "@DL_FREQUENCY_IN_MHZ@000000" + - key: uplink_frequency_offset + env: "@UL_FREQUENCY_OFFSET_IN_MHZ@000000" + - key: Nid_cell + env: "@NID_CELL@" + - key: N_RB_DL + env: "@NB_PRB@" + - key: ipv4 + env: "@MME_S1C_IP_ADDRESS@" + - key: ENB_INTERFACE_NAME_FOR_S1_MME + env: "@RCC_IF_NAME@" + - key: ENB_IPV4_ADDRESS_FOR_S1_MME + env: "@RCC_S1C_IP_ADDRESS@" + - key: ENB_INTERFACE_NAME_FOR_S1U + env: "@RCC_IF_NAME@" + - key: ENB_IPV4_ADDRESS_FOR_S1U + env: "@RCC_IP_ADDRESS@" + - key: ENB_IPV4_ADDRESS_FOR_X2C + env: "@RCC_IP_ADDRESS@" + - key: local_if_name + env: "@IF4P5_IF_NAME@" + - key: remote_address + env: "@IF4P5_RRU_IP_ADDRESS@" + - key: local_address + env: "@IF4P5_RCC_IP_ADDRESS@" + + - filePrefix: "rcc.band40.tm1.25PRB" + outputfilename: "rcc.if4p5.tdd.conf" + config: + - key: Active_eNBs + env: "@ENB_NAME@" + - key: eNB_name + env: "@ENB_NAME@" + - key: plmn_list + env: + mcc: "@MCC@" + mnc: "@MNC@" + mnc_length: "@MNC_LENGTH@" + - key: tracking_area_code + env: "@TAC@" + - key: eutra_band + env: "@UTRA_BAND_ID@" + - key: downlink_frequency + env: "@DL_FREQUENCY_IN_MHZ@000000" + - key: uplink_frequency_offset + env: "@UL_FREQUENCY_OFFSET_IN_MHZ@000000" + - key: Nid_cell + env: "@NID_CELL@" + - key: N_RB_DL + env: "@NB_PRB@" + - key: ipv4 + env: "@MME_S1C_IP_ADDRESS@" + - key: ENB_INTERFACE_NAME_FOR_S1_MME + env: "@RCC_IF_NAME@" + - key: ENB_IPV4_ADDRESS_FOR_S1_MME + env: "@RCC_S1C_IP_ADDRESS@" + - key: ENB_INTERFACE_NAME_FOR_S1U + env: "@RCC_IF_NAME@" + - key: ENB_IPV4_ADDRESS_FOR_S1U + env: "@RCC_IP_ADDRESS@" + - key: ENB_IPV4_ADDRESS_FOR_X2C + env: "@RCC_IP_ADDRESS@" + - key: local_if_name + env: "@IF4P5_IF_NAME@" + - key: remote_address + env: "@IF4P5_RRU_IP_ADDRESS@" + - key: local_address + env: "@IF4P5_RCC_IP_ADDRESS@" + diff --git a/docker/scripts/generateTemplate.py b/docker/scripts/generateTemplate.py index 418476d3959161898f35fec9550777b8f295acc6..5ce0d146e59682ddd7fac4a927a7c5290ca6ba60 100644 --- a/docker/scripts/generateTemplate.py +++ b/docker/scripts/generateTemplate.py @@ -39,20 +39,24 @@ def main(): for config in data[1]["configurations"]: filePrefix = config["filePrefix"] outputfilename = config["outputfilename"] + print('================================================') print('filePrefix = ' + filePrefix) print('outputfilename = ' + outputfilename) for inputfile in dir: if inputfile.find(filePrefix) >=0: - prefix_outputfile = {"cu": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', - "du": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', + prefix_outputfile = {"cu.band7.tm1.25PRB": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', + "du.band7.tm1.25PRB": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', "rru.fdd": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', "rru.tdd": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', "enb.band7.tm1.25PRB.usrpb210": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', "enb.band40.tm1.25PRB.FairScheduler.usrpb210": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', "rcc.band7.tm1.nfapi": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', + "rcc.band7.tm1.if4p5.lo.25PRB": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', + "rcc.band40.tm1.25PRB": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', "ue.nfapi": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', "ue_sim_ci": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}' } + print('inputfile = ' + inputfile) if filePrefix in prefix_outputfile: outputfile1 = prefix_outputfile[filePrefix] diff --git a/docker/scripts/lte_ru_entrypoint.sh b/docker/scripts/lte_ru_entrypoint.sh new file mode 100755 index 0000000000000000000000000000000000000000..f466e25ec28a30acad6af2d4bea9a5743859e7a5 --- /dev/null +++ b/docker/scripts/lte_ru_entrypoint.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +set -euo pipefail + +PREFIX=/opt/oai-lte-ru + +# Based another env var, pick one template to use +if [[ -v USE_FDD_RRU ]]; then ln -s $PREFIX/etc/rru.fdd.conf $PREFIX/etc/rru.conf; fi +if [[ -v USE_TDD_RRU ]]; then ln -s $PREFIX/etc/rru.tdd.conf $PREFIX/etc/rru.conf; fi + +# Only this template will be manipulated +CONFIG_FILES=`ls $PREFIX/etc/rru.conf || true` + +for c in ${CONFIG_FILES}; do + # grep variable names (format: ${VAR}) from template to be rendered + VARS=$(grep -oP '@[a-zA-Z0-9_]+@' ${c} | sort | uniq | xargs) + + # create sed expressions for substituting each occurrence of ${VAR} + # with the value of the environment variable "VAR" + EXPRESSIONS="" + for v in ${VARS}; do + NEW_VAR=`echo $v | sed -e "s#@##g"` + if [[ "${!NEW_VAR}x" == "x" ]]; then + echo "Error: Environment variable '${NEW_VAR}' is not set." \ + "Config file '$(basename $c)' requires all of $VARS." + exit 1 + fi + EXPRESSIONS="${EXPRESSIONS};s|${v}|${!NEW_VAR}|g" + done + EXPRESSIONS="${EXPRESSIONS#';'}" + + # render template and inline replace config file + sed -i "${EXPRESSIONS}" ${c} +done + +# Load the USRP binaries +if [[ -v USE_B2XX ]]; then + /usr/lib/uhd/utils/uhd_images_downloader.py -t b2xx +elif [[ -v USE_X3XX ]]; then + /usr/lib/uhd/utils/uhd_images_downloader.py -t x3xx +elif [[ -v USE_N3XX ]]; then + /usr/lib/uhd/utils/uhd_images_downloader.py -t n3xx +fi + +echo "==================================" +echo "== Starting eNB soft modem" +if [[ -v USE_ADDITIONAL_OPTIONS ]]; then + echo "Additional option(s): ${USE_ADDITIONAL_OPTIONS}" + new_args=() + while [[ $# -gt 0 ]]; do + new_args+=("$1") + shift + done + for word in ${USE_ADDITIONAL_OPTIONS}; do + new_args+=("$word") + done + echo "${new_args[@]}" + exec "${new_args[@]}" +else + echo "$@" + exec "$@" +fi diff --git a/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c b/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c index 0455c481d548576ef49f31efaa0c82da175a39f0..f6f331ec2179a67a036ced0810091b1b059f22cf 100644 --- a/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c +++ b/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c @@ -417,7 +417,7 @@ bool pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_ int dmrs_scrambling_id=0,data_scrambling_id=0; NR_UE_MAC_INST_t *mac = get_mac_inst(0); - NR_PUCCH_Resource_t *pucch_resource; + NR_PUCCH_Resource_t *pucch_resource = NULL; uint16_t crnti = mac->crnti; NR_BWP_Id_t bwp_id = mac->UL_BWP_Id; @@ -497,7 +497,8 @@ bool pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_ pucch_resource_set = find_pucch_resource_set( mac, gNB_id, N_UCI); if (pucch_resource_set != MAX_NB_OF_PUCCH_RESOURCE_SETS) { pucch_resource_indicator = 0; - pucch_resource_id = mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup->resourceSetToAddModList->list.array[pucch_resource_set]->resourceList.list.array[pucch_resource_indicator][0]; /* get the first resource of the set */ + /* get the first resource of the set */ + pucch_resource_id = mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup->resourceSetToAddModList->list.array[pucch_resource_set]->resourceList.list.array[pucch_resource_indicator][0]; } else { LOG_W(PHY,"PUCCH no resource set found for CSI at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME); @@ -639,7 +640,6 @@ bool pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_ int O_CRC = 0; nb_symbols = nb_symbols_total; /* by default, it can be reduced due to symbols reserved for dmrs */ - pucch_resource = mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup->resourceToAddModList->list.array[pucch_resource_id]; switch(format) { case pucch_format0_nr: @@ -1122,7 +1122,7 @@ boolean_t select_pucch_resource(PHY_VARS_NR_UE *ue, NR_UE_MAC_INST_t *mac, uint8 int current_resource_id = MAX_NB_OF_PUCCH_RESOURCES; pucch_format_nr_t format_pucch; int ready_pucch_resource_id = FALSE; /* in the case that it is already given */ - NR_PUCCH_Resource_t *pucch_resource; + NR_PUCCH_Resource_t *pucch_resource = NULL; NR_BWP_Id_t bwp_id = mac->UL_BWP_Id; /* ini values to unset */ @@ -1193,6 +1193,7 @@ boolean_t select_pucch_resource(PHY_VARS_NR_UE *ue, NR_UE_MAC_INST_t *mac, uint8 } if (resource_set_found == TRUE) { + if (pucch_resource_indicator < MAX_PUCCH_RESOURCE_INDICATOR) { // Verify that the value of pucch_resource_indicator is valid if (mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup->resourceSetToAddModList->list.array[pucch_resource_set_id]->resourceList.list.count <= pucch_resource_indicator) @@ -1202,7 +1203,6 @@ boolean_t select_pucch_resource(PHY_VARS_NR_UE *ue, NR_UE_MAC_INST_t *mac, uint8 } /* check if resource indexing by pucch_resource_indicator of this set is compatible */ if ((ready_pucch_resource_id == TRUE) || (mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup->resourceSetToAddModList->list.array[pucch_resource_set_id]->resourceList.list.array[pucch_resource_indicator][0] != MAX_NB_OF_PUCCH_RESOURCES)) { - if (ready_pucch_resource_id == TRUE) { current_resource_id = *resource_id; } @@ -1236,17 +1236,14 @@ boolean_t select_pucch_resource(PHY_VARS_NR_UE *ue, NR_UE_MAC_INST_t *mac, uint8 } } - /*uint8_t pucch_resource_count = mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup->resourceToAddModList.list.count; + uint8_t pucch_resource_count = mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup->resourceToAddModList->list.count; for (uint8_t i=0; i<pucch_resource_count; i++) { - if (mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup->resourceToAddModList.list.array[i]->pucch_ResourceId == current_resource_id) - pucch_resource = mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup->resourceToAddModList.list.array[i]; - }*/ - - pucch_resource = mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup->resourceToAddModList->list.array[current_resource_id]; + if (mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup->resourceToAddModList->list.array[i]->pucch_ResourceId == current_resource_id) + pucch_resource = mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup->resourceToAddModList->list.array[i]; + } if (pucch_resource != NULL) { - format_pucch = mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup->resourceToAddModList->list.array[current_resource_id]->format.present; + format_pucch = pucch_resource->format.present; nb_symbols_for_tx = get_nb_symbols_pucch(pucch_resource, format_pucch); - if (check_pucch_format(mac, gNB_id, format_pucch, nb_symbols_for_tx, uci_size) == TRUE) { *resource_set_id = pucch_resource_set_id; *resource_id = current_resource_id; diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index cc084d18c5c29173745245d92a65afc4b20224ac..6e6c2533b4dd5b56b1b8e6f99e22423ffec3a9b0 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -32,6 +32,7 @@ #include "lte-softmodem.h" #include "rt_wrapper.h" +#include "system.h" #include "LAYER2/MAC/mac.h" #include "RRC/LTE/rrc_extern.h" @@ -230,14 +231,23 @@ void init_thread(int sched_runtime, } #else + int settingPriority = 1; - if (CPU_COUNT(cpuset) > 0) - AssertFatal( 0 == pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), cpuset), ""); + if (checkIfFedoraDistribution()) + if (checkIfGenericKernelOnFedora()) + if (checkIfInsideContainer()) + settingPriority = 0; + + if (settingPriority) { + if (CPU_COUNT(cpuset) > 0) + AssertFatal( 0 == pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), cpuset), ""); + + struct sched_param sp; + sp.sched_priority = sched_fifo; + AssertFatal(pthread_setschedparam(pthread_self(),SCHED_FIFO,&sp)==0, + "Can't set thread priority, Are you root?\n"); + } - struct sched_param sp; - sp.sched_priority = sched_fifo; - AssertFatal(pthread_setschedparam(pthread_self(),SCHED_FIFO,&sp)==0, - "Can't set thread priority, Are you root?\n"); /* Check the actual affinity mask assigned to the thread */ cpu_set_t *cset=CPU_ALLOC(CPU_SETSIZE); diff --git a/targets/RT/USER/rt_wrapper.c b/targets/RT/USER/rt_wrapper.c index b0518688252856a39f8d70c6efcd045a2f87f85d..da3a2d3cfe2ea9456b409ee992db3fda92ee2c8f 100644 --- a/targets/RT/USER/rt_wrapper.c +++ b/targets/RT/USER/rt_wrapper.c @@ -43,6 +43,7 @@ #include <getopt.h> #include <sys/sysinfo.h> #include "rt_wrapper.h" +#include "system.h" #include <errno.h> #include <common/utils/msc/msc.h> @@ -294,6 +295,7 @@ void thread_top_init(char *thread_name, 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 */ @@ -340,30 +342,37 @@ void thread_top_init(char *thread_name, } } - memset(&sparam, 0, sizeof(sparam)); - sparam.sched_priority = sched_get_priority_max(SCHED_FIFO); - policy = SCHED_FIFO ; + 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_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"); - } + 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); + 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 ); + 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