From c54cf49f277af9d2b50d4c0dad60e7340cf020eb Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 22 Dec 2022 12:54:51 +0100 Subject: [PATCH 01/18] CI: stop containers more quickly - avoid wasting time - might prevent excess HARQ retx messing up the logs --- ci-scripts/cls_containerize.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 4540f2a8a0..785a90ab4d 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -1001,7 +1001,7 @@ class Containerize(): services.append(s) logging.info(f'stopping services {services}') - mySSH.command(f'docker-compose -f ci-docker-compose.yml stop', '\$', 30) + mySSH.command(f'docker-compose -f ci-docker-compose.yml stop -t3', '\$', 30) time.sleep(5) # give some time to running containers to stop for svcName in services: # head -n -1 suppresses the final "X exited with status code Y" @@ -1203,7 +1203,7 @@ class Containerize(): # Stop the containers to shut down objects logging.debug('\u001B[1m Stopping containers \u001B[0m') - cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml stop' + cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml stop -t3' logging.info(cmd) try: deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=100) From 3e3dd824333f80f575fa3d05b1f7d973f0de2830 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 22 Dec 2022 12:22:32 +0100 Subject: [PATCH 02/18] CI: Remove legacy bash scripts --- ci-scripts/Jenkinsfile-gitlab | 391 --- ci-scripts/auto_start_gnb.sh | 7 - ci-scripts/buildOnVM.sh | 236 -- ci-scripts/createVM.sh | 107 - ci-scripts/destroyAllRunningVM.sh | 51 - ci-scripts/doc/ci_dev_home.md | 31 - ci-scripts/doc/vm_based_simulator_build.md | 261 -- .../doc/vm_based_simulator_check_build.md | 44 - ci-scripts/doc/vm_based_simulator_create.md | 110 - ci-scripts/doc/vm_based_simulator_destroy.md | 69 - ci-scripts/doc/vm_based_simulator_env.md | 119 - .../doc/vm_based_simulator_main_scripts.md | 188 -- ci-scripts/doc/vm_based_simulator_sources.md | 83 - ci-scripts/doc/vm_based_simulator_test.md | 197 -- ci-scripts/oai-ci-vm-tool | 889 ------ ci-scripts/reportBuildLocally.sh | 613 ---- ci-scripts/reportTestLocally.sh | 1000 ------ ci-scripts/runTestOnVM.sh | 2741 ----------------- ci-scripts/waitBuildOnVM.sh | 205 -- 19 files changed, 7342 deletions(-) delete mode 100644 ci-scripts/Jenkinsfile-gitlab delete mode 100644 ci-scripts/auto_start_gnb.sh delete mode 100755 ci-scripts/buildOnVM.sh delete mode 100755 ci-scripts/createVM.sh delete mode 100755 ci-scripts/destroyAllRunningVM.sh delete mode 100644 ci-scripts/doc/ci_dev_home.md delete mode 100644 ci-scripts/doc/vm_based_simulator_build.md delete mode 100644 ci-scripts/doc/vm_based_simulator_check_build.md delete mode 100644 ci-scripts/doc/vm_based_simulator_create.md delete mode 100644 ci-scripts/doc/vm_based_simulator_destroy.md delete mode 100644 ci-scripts/doc/vm_based_simulator_env.md delete mode 100644 ci-scripts/doc/vm_based_simulator_main_scripts.md delete mode 100644 ci-scripts/doc/vm_based_simulator_sources.md delete mode 100644 ci-scripts/doc/vm_based_simulator_test.md delete mode 100755 ci-scripts/oai-ci-vm-tool delete mode 100755 ci-scripts/reportBuildLocally.sh delete mode 100755 ci-scripts/reportTestLocally.sh delete mode 100755 ci-scripts/runTestOnVM.sh delete mode 100755 ci-scripts/waitBuildOnVM.sh diff --git a/ci-scripts/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab deleted file mode 100644 index e2086950d7..0000000000 --- a/ci-scripts/Jenkinsfile-gitlab +++ /dev/null @@ -1,391 +0,0 @@ -#!/bin/groovy -/* - * 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 - */ - -// Location of the executor node -def nodeExecutor = params.nodeExecutor - -// VM Lockable resources -def vmResource = params.vmLockableResource - -// Tags to shorten pipeline duration -def doMandatoryTests = false -def doFullTestsuite = false - -pipeline { - agent { - label nodeExecutor - } - options { - disableConcurrentBuilds() - timestamps() - gitLabConnection('OAI GitLab') - ansiColor('xterm') - } - - stages { - stage ("Verify Parameters") { - steps { - script { - JOB_TIMESTAMP = sh returnStdout: true, script: 'date --utc --rfc-3339=seconds | sed -e "s#+00:00##"' - JOB_TIMESTAMP = JOB_TIMESTAMP.trim() - - echo '\u2705 \u001B[32mVerify Parameters\u001B[0m' - def allParametersPresent = true - if (env.TESTPLATFORM_OWNER) { - echo "Platform is ${env.TESTPLATFORM_OWNER}" - } - - echo '\u2705 \u001B[32mVerify Labels\u001B[0m' - if ("MERGE".equals(env.gitlabActionType)) { - LABEL_CHECK = sh returnStdout: true, script: 'ci-scripts/checkGitLabMergeRequestLabels.sh --mr-id ' + env.gitlabMergeRequestIid - LABEL_CHECK = LABEL_CHECK.trim() - if (LABEL_CHECK == 'NONE') { - def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): Your merge request has none of the mandatory labels:\n\n" - message += " - BUILD-ONLY\n" - message += " - 4G-LTE\n" - message += " - 5G-NR\n" - message += " - CI\n\n" - message += "Not performing CI due to lack of labels" - addGitLabMRComment comment: message - error('Not performing CI due to lack of labels') - } else if (LABEL_CHECK == 'FULL' || LABEL_CHECK == 'SHORTEN-4G') { - doMandatoryTests = true - doFullTestsuite = true - } else if (LABEL_CHECK == 'SHORTEN-5G') { - doMandatoryTests = true - } else { - def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): We will perform only build stages on your Merge Request" - addGitLabMRComment comment: message - } - } else { - doMandatoryTests = true - doFullTestsuite = true - } - } - } - } - stage ("Verify Guidelines") { - steps { - echo "Git URL is ${GIT_URL}" - echo "GitLab Act is ${env.gitlabActionType}" - script { - if ("MERGE".equals(env.gitlabActionType)) { - // since a bit, in push events, gitlabUserEmail is not populated - gitCommitAuthorEmailAddr = env.gitlabUserEmail - echo "GitLab Usermail is ${gitCommitAuthorEmailAddr}" - // GitLab-Jenkins plugin integration is lacking to perform the merge by itself - // Doing it manually --> it may have merge conflicts - sh "./ci-scripts/doGitLabMerge.sh --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}" - sh "zip -r -qq localZip.zip ." - - // here was an astyle formatting check, with corresponding messages. The same could be done with clang-format - } else { - echo "Git Branch is ${GIT_BRANCH}" - echo "Git Commit is ${GIT_COMMIT}" - // since a bit, in push events, gitlabUserEmail is not populated - gitCommitAuthorEmailAddr = sh returnStdout: true, script: 'git log -n1 --pretty=format:%ae ${GIT_COMMIT}' - gitCommitAuthorEmailAddr = gitCommitAuthorEmailAddr.trim() - echo "GitLab Usermail is ${gitCommitAuthorEmailAddr}" - sh "git log -n1 --pretty=format:\"%s\" > .git/CI_COMMIT_MSG" - - sh "zip -r -qq localZip.zip ." - } - } - } - post { - failure { - script { - def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): Merge Conflicts -- Cannot perform CI" - addGitLabMRComment comment: message - currentBuild.result = 'FAILURE' - } - } - } - } - - stage ("Start VM -- gnb-usrp") { - steps { - lock (vmResource) { - timeout (time: 5, unit: 'MINUTES') { - sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant gnb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" - } - } - } - } - - stage ("Start VM -- nr-ue-usrp") { - steps { - lock (vmResource) { - timeout (time: 5, unit: 'MINUTES') { - sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant nr-ue-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" - } - } - } - } - - stage ("Start VM -- enb-ethernet") { - steps { - lock (vmResource) { - timeout (time: 7, unit: 'MINUTES') { - sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant enb-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" - } - } - } - } - - stage ("Start VM -- ue-ethernet") { - steps { - lock (vmResource) { - timeout (time: 7, unit: 'MINUTES') { - sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" - } - } - } - } - - stage ("Variant Builds") { - parallel { - stage ("Build 5G gNB-USRP") { - steps { - gitlabCommitStatus(name: "Build gNB-USRP") { - timeout (time: 45, unit: 'MINUTES') { - sh "./ci-scripts/oai-ci-vm-tool wait --workspace $WORKSPACE --variant gnb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive" - } - } - } - } - stage ("Build 5G NR-UE-USRP") { - steps { - gitlabCommitStatus(name: "Build nr-UE-USRP") { - timeout (time: 45, unit: 'MINUTES') { - sh "./ci-scripts/oai-ci-vm-tool wait --workspace $WORKSPACE --variant nr-ue-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive" - } - } - } - } - stage ("Build eNB-ethernet") { - steps { - gitlabCommitStatus(name: "Build eNB-ethernet") { - timeout (time: 45, unit: 'MINUTES') { - sh "./ci-scripts/oai-ci-vm-tool wait --workspace $WORKSPACE --variant enb-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive" - } - } - } - } - stage ("Build UE-ethernet") { - steps { - // This is typically the last one to finish. - lock (vmResource) { - gitlabCommitStatus(name: "Build UE-ethernet") { - timeout (time: 45, unit: 'MINUTES') { - sh "./ci-scripts/oai-ci-vm-tool wait --workspace $WORKSPACE --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive" - } - } - } - } - } - } - post { - failure { - script { - currentBuild.result = 'FAILURE' - } - } - always { - script { - dir ('archives') { - if (fileExists('red_hat')) { - sh "zip -r -qq vm_build_logs.zip enb_eth ue_eth gnb_usrp nr_ue_usrp red_hat" - } else { - sh "zip -r -qq vm_build_logs.zip enb_eth ue_eth gnb_usrp nr_ue_usrp" - } - } - if(fileExists('archives/vm_build_logs.zip')) { - archiveArtifacts artifacts: 'archives/vm_build_logs.zip' - } - if ("MERGE".equals(env.gitlabActionType)) { - sh "./ci-scripts/oai-ci-vm-tool report-build --workspace $WORKSPACE --git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger merge-request --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}" - // If the merge request has introduced compilation warnings, notifications in GitLab - sh "./ci-scripts/checkAddedWarnings.sh --src-branch ${env.gitlabSourceBranch} --target-branch ${env.gitlabTargetBranch}" - def res=readFile('./oai_warning_files.txt').trim(); - if ("0".equals(res)) { - echo "No issues w/ warnings/errors in this merge request" - } else { - def fileList=readFile('./oai_warning_files_list.txt').trim(); - def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): Some modified files in Merge Request MAY have INTRODUCED WARNINGS (" + fileList + ")" - addGitLabMRComment comment: message - } - } else { - sh "./ci-scripts/oai-ci-vm-tool report-build --workspace $WORKSPACE --git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger push --branch ${GIT_BRANCH} --commit ${GIT_COMMIT}" - } - if(fileExists('build_results.html')) { - sh "sed -i -e 's#Build-ID: ${BUILD_ID}#Build-ID: ${BUILD_ID}#' -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' build_results.html" - archiveArtifacts artifacts: 'build_results.html' - } - } - } - } - } - - stage ("Variant Tests") { - parallel { - stage ("VM-based tests") { - stages { - stage ("Test L1 simulator") { - when { - expression {doMandatoryTests} - } - steps { - lock (vmResource) { - script { - timeout (time: 30, unit: 'MINUTES') { - try { - gitlabCommitStatus(name: "Test L1-sim") { - sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant l1-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive" - } - } catch (Exception e) { - currentBuild.result = 'FAILURE' - } - } - } - } - } - } - stage ("Test RF simulator") { - when { - expression {doMandatoryTests} - } - steps { - lock (vmResource) { - script { - timeout (time: 40, unit: 'MINUTES') { - try { - gitlabCommitStatus(name: "Test RF-sim") { - sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant rf-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive" - } - } catch (Exception e) { - currentBuild.result = 'FAILURE' - } - } - } - } - } - } - stage ("Test 5G RF simulator") { - when { - expression {doMandatoryTests} - } - steps { - lock (vmResource) { - script { - timeout (time: 40, unit: 'MINUTES') { - try { - gitlabCommitStatus(name: "Test 5G RF-sim") { - sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant rf5g-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive" - } - } catch (Exception e) { - currentBuild.result = 'FAILURE' - } - } - } - } - } - } - stage ("Destroy all Virtual Machines") { - when { - expression {doMandatoryTests} - } - steps { - lock (vmResource) { - sh "./ci-scripts/oai-ci-vm-tool destroy --job-name ${JOB_NAME} --build-id ${BUILD_ID}" - } - } - } - } - } - } - post { - always { - script { - if (doMandatoryTests) { - dir ('archives') { - sh "if [ -d rf_sim/test ] || [ -d rf5g_sim/test ] || [ -d l2_sim/test ]; then zip -r -qq vm_tests_logs.zip */test ; fi" - } - if(fileExists('archives/vm_tests_logs.zip')) { - archiveArtifacts artifacts: 'archives/vm_tests_logs.zip' - if ("MERGE".equals(env.gitlabActionType)) { - sh "./ci-scripts/oai-ci-vm-tool report-test --workspace $WORKSPACE --git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger merge-request --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}" - } else { - sh "./ci-scripts/oai-ci-vm-tool report-test --workspace $WORKSPACE --git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger push --branch ${GIT_BRANCH} --commit ${GIT_COMMIT}" - } - if(fileExists('test_simulator_results.html')) { - sh "sed -i -e 's#Build-ID: ${BUILD_ID}#Build-ID: ${BUILD_ID}#' -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' test_simulator_results.html" - archiveArtifacts artifacts: 'test_simulator_results.html' - } - } - } - } - } - } - } - } - post { - always { - script { - // Stage destroy may not be run if error in previous stage - sh "./ci-scripts/oai-ci-vm-tool destroy --job-name ${JOB_NAME} --build-id ${BUILD_ID}" - emailext attachmentsPattern: '*results*.html', - body: '''Hi, - -Here are attached HTML report files for $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS! - -Regards, -OAI CI Team''', - replyTo: 'no-reply@openairinterface.org', - subject: '$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!', - to: gitCommitAuthorEmailAddr - - if (fileExists('.git/CI_COMMIT_MSG')) { - sh "rm -f .git/CI_COMMIT_MSG" - } - } - } - success { - script { - def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): passed (" + BUILD_URL + ")" - if ("MERGE".equals(env.gitlabActionType)) { - echo "This is a MERGE event" - addGitLabMRComment comment: message - } - } - } - failure { - script { - def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): failed (" + BUILD_URL + ")" - if ("MERGE".equals(env.gitlabActionType)) { - echo "This is a MERGE event" - addGitLabMRComment comment: message - } - } - } - } -} diff --git a/ci-scripts/auto_start_gnb.sh b/ci-scripts/auto_start_gnb.sh deleted file mode 100644 index 86ffc66d18..0000000000 --- a/ci-scripts/auto_start_gnb.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -while true -do - echo "gNB will be started automatically..." - sleep 1 - sudo .././cmake_targets/ran_build/build/nr-softmodem -E -O ../targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf -done diff --git a/ci-scripts/buildOnVM.sh b/ci-scripts/buildOnVM.sh deleted file mode 100755 index 4df0d22e09..0000000000 --- a/ci-scripts/buildOnVM.sh +++ /dev/null @@ -1,236 +0,0 @@ -#!/bin/bash -#/* -# * 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 -# */ - -function build_usage { - echo "OAI CI VM script" - echo " Original Author: Raphael Defosseux" - echo " Requirements:" - echo " -- uvtool uvtool-libvirt apt-cacher" - echo " -- $VM_OSREL image already synced" - echo " Default:" - echo " -- eNB with USRP" - echo "" - echo "Usage:" - echo "------" - echo " oai-ci-vm-tool build [OPTIONS]" - echo "" - command_options_usage - -} - -function build_on_vm { - if [ ! -f $JENKINS_WKSP/localZip.zip ] - then - echo "Missing localZip.zip file!" - STATUS=1 - return - fi - if [[ ! -f /etc/apt/apt.conf.d/01proxy ]] && [[ "$OPTIONAL_APTCACHER" != "true" ]] - then - echo "Missing /etc/apt/apt.conf.d/01proxy file!" - echo "Is apt-cacher installed and configured?" - STATUS=1 - return - fi - - echo "############################################################" - echo "OAI CI VM script" - echo "############################################################" - - echo "VM_NAME = $VM_NAME" - echo "VM_CMD_FILE = $VM_CMDS" - echo "JENKINS_WKSP = $JENKINS_WKSP" - echo "ARCHIVES_LOC = $ARCHIVES_LOC" - echo "BUILD_OPTIONS = $BUILD_OPTIONS" - - if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]] || [[ "$VM_NAME" == *"-basic-sim"* ]] || [[ "$VM_NAME" == *"-flexran-rtc"* ]] || [[ "$VM_NAME" == *"-rf-sim"* ]] || [[ "$VM_NAME" == *"-ethernet"* ]] || [[ "$VM_NAME" == *"rf5g-sim"* ]] || [[ "$VM_NAME" == *"gnb-usrp"* ]] || [[ "$VM_NAME" == *"nr-ue-usrp"* ]] - then - echo "This VM type is no longer supported in the pipeline framework" - return - fi - - IS_VM_ALIVE=`uvt-kvm list | grep -c $VM_NAME` - - if [ $IS_VM_ALIVE -eq 0 ] - then - echo "VM_MEMORY = $VM_MEMORY MBytes" - echo "VM_CPU = $VM_CPU" - echo "VM_DISK = $VM_DISK GBytes" - echo "############################################################" - echo "Creating VM ($VM_NAME) on Ubuntu Cloud Image base" - echo "############################################################" - acquire_vm_create_lock - uvt-kvm create $VM_NAME release=$VM_OSREL --memory $VM_MEMORY --cpu $VM_CPU --disk $VM_DISK --unsafe-caching --template ci-scripts/template-host.xml - echo "Waiting for VM to be started" - uvt-kvm wait $VM_NAME --insecure - - VM_IP_ADDR=`uvt-kvm ip $VM_NAME` - echo "$VM_NAME has for IP addr = $VM_IP_ADDR" - release_vm_create_lock - else - echo "Waiting for VM to be started" - uvt-kvm wait $VM_NAME --insecure - - VM_IP_ADDR=`uvt-kvm ip $VM_NAME` - echo "$VM_NAME has for IP addr = $VM_IP_ADDR" - fi - - echo "############################################################" - echo "Copying GIT repo into VM ($VM_NAME)" - echo "############################################################" - if [[ "$VM_NAME" == *"-flexran-rtc"* ]] - then - scp -o StrictHostKeyChecking=no $JENKINS_WKSP/flexran/flexran.zip ubuntu@$VM_IP_ADDR:/home/ubuntu/localZip.zip - else - scp -o StrictHostKeyChecking=no $JENKINS_WKSP/localZip.zip ubuntu@$VM_IP_ADDR:/home/ubuntu - fi - [ -f /etc/apt/apt.conf.d/01proxy ] && scp -o StrictHostKeyChecking=no /etc/apt/apt.conf.d/01proxy ubuntu@$VM_IP_ADDR:/home/ubuntu - - echo "############################################################" - echo "Running install and build script on VM ($VM_NAME)" - echo "############################################################" - echo "[ -f 01proxy ] && sudo cp 01proxy /etc/apt/apt.conf.d/" > $VM_CMDS - echo "touch /home/ubuntu/.hushlogin" >> $VM_CMDS - echo "git config --global https.postBuffer 123289600" >> $VM_CMDS - if [[ "$VM_NAME" == *"-cppcheck"* ]] - then - if [ $DAEMON -eq 0 ] - then - echo "echo \"sudo apt-get --yes --quiet install zip cppcheck \"" >> $VM_CMDS - echo "sudo apt-get update > zip-install.txt 2>&1" >> $VM_CMDS - echo "sudo apt-get --yes install zip cppcheck >> zip-install.txt 2>&1" >> $VM_CMDS - else - echo "echo \"sudo apt-get --yes --quiet install zip daemon cppcheck \"" >> $VM_CMDS - echo "sudo apt-get update > zip-install.txt 2>&1" >> $VM_CMDS - echo "sudo apt-get --yes install zip daemon cppcheck >> zip-install.txt 2>&1" >> $VM_CMDS - fi - fi - if [[ "$VM_NAME" == *"-flexran-rtc"* ]] - then - if [ $DAEMON -eq 0 ] - then - echo "echo \"sudo apt-get --yes --quiet install zip curl jq \"" >> $VM_CMDS - echo "sudo apt-get update > zip-install.txt 2>&1" >> $VM_CMDS - echo "sudo apt-get --yes install zip curl jq >> zip-install.txt 2>&1" >> $VM_CMDS - else - echo "echo \"sudo apt-get --yes --quiet install zip daemon curl jq \"" >> $VM_CMDS - echo "sudo apt-get update > zip-install.txt 2>&1" >> $VM_CMDS - echo "sudo apt-get --yes install zip daemon curl jq >> zip-install.txt 2>&1" >> $VM_CMDS - fi - fi - if [[ "$VM_NAME" != *"-cppcheck"* ]] && [[ "$VM_NAME" != *"-flexran-rtc"* ]] - then - if [ $DAEMON -eq 0 ] - then - echo "echo \"sudo apt-get --yes --quiet install zip subversion libboost-dev \"" >> $VM_CMDS - echo "sudo apt-get update > zip-install.txt 2>&1" >> $VM_CMDS - if [[ "$VM_NAME" == *"-phy-sim"* ]] - then - echo "sudo apt-get --yes install zip subversion libboost-dev make gcc >> zip-install.txt 2>&1" >> $VM_CMDS - else - echo "sudo apt-get --yes install zip subversion libboost-dev >> zip-install.txt 2>&1" >> $VM_CMDS - fi - else - echo "echo \"sudo apt-get --yes --quiet install zip daemon subversion libboost-dev \"" >> $VM_CMDS - echo "sudo apt-get update > zip-install.txt 2>&1" >> $VM_CMDS - if [[ "$VM_NAME" == *"-phy-sim"* ]] - then - echo "sudo apt-get --yes install zip daemon subversion libboost-dev make gcc >> zip-install.txt 2>&1" >> $VM_CMDS - else - echo "sudo apt-get --yes install zip daemon subversion libboost-dev >> zip-install.txt 2>&1" >> $VM_CMDS - fi - fi - fi - echo "mkdir tmp" >> $VM_CMDS - echo "cd tmp" >> $VM_CMDS - echo "echo \"unzip -qq -DD ../localZip.zip\"" >> $VM_CMDS - echo "unzip -qq -DD ../localZip.zip" >> $VM_CMDS - # Trying to make some room on filesystem before building - echo "rm ../localZip.zip" >> $VM_CMDS - echo "export CI_ENV=True" >> $VM_CMDS - if [[ "$VM_NAME" == *"-cppcheck"* ]] - then - echo "mkdir cmake_targets/log" >> $VM_CMDS - echo "chmod 777 cmake_targets/log" >> $VM_CMDS - echo "cp /home/ubuntu/zip-install.txt cmake_targets/log" >> $VM_CMDS - echo "echo \"cppcheck $BUILD_OPTIONS . \"" >> $VM_CMDS - if [ $DAEMON -eq 0 ] - then - echo "cppcheck $BUILD_OPTIONS . 2> cmake_targets/log/cppcheck.xml 1> cmake_targets/log/cppcheck_build.txt" >> $VM_CMDS - else - echo "echo \"cppcheck $BUILD_OPTIONS .\" > ./my-vm-build.sh" >> $VM_CMDS - echo "chmod 775 ./my-vm-build.sh " >> $VM_CMDS - echo "sudo -E daemon --inherit --unsafe --name=build_daemon --chdir=/home/ubuntu/tmp -O /home/ubuntu/tmp/cmake_targets/log/cppcheck_build.txt -E /home/ubuntu/tmp/cmake_targets/log/cppcheck.xml ./my-vm-build.sh" >> $VM_CMDS - fi - fi - if [[ "$VM_NAME" == *"-flexran-rtc"* ]] - then - echo "mkdir -p cmake_targets/log" >> $VM_CMDS - echo "chmod 777 cmake_targets/log" >> $VM_CMDS - echo "cp /home/ubuntu/zip-install.txt cmake_targets/log" >> $VM_CMDS - # Patching the pistache build for Xenial (cmake too old for new commits) - echo "sed -i -e 's@cd pistache@cd pistache \&\& git checkout -f 9a65f40975fafca5bb5370ba6d0d00f42cbc4356@' ./tools/install_dependencies" >> $VM_CMDS - echo "echo \"./tools/install_dependencies \"" >> $VM_CMDS - echo "./tools/install_dependencies > cmake_targets/log/install-build.txt 2>&1" >> $VM_CMDS - echo "echo \"mkdir build\"" >> $VM_CMDS - echo "mkdir build" >> $VM_CMDS - echo "echo \"cd build\"" >> $VM_CMDS - echo "cd build" >> $VM_CMDS - echo "echo \"$BUILD_OPTIONS \"" >> $VM_CMDS - echo "$BUILD_OPTIONS > ../cmake_targets/log/rt_controller.txt 2>&1" >> $VM_CMDS - fi - if [[ "$VM_NAME" != *"-cppcheck"* ]] && [[ "$VM_NAME" != *"-flexran-rtc"* ]] - then - echo "echo \"source oaienv\"" >> $VM_CMDS - echo "source oaienv" >> $VM_CMDS - if [[ "$VM_NAME" == *"-phy-sim"* ]] - then - echo "cd common/utils/T" >> $VM_CMDS - echo "make" >> $VM_CMDS - echo "cd ../../.." >> $VM_CMDS - fi - echo "cd cmake_targets/" >> $VM_CMDS - echo "mkdir log" >> $VM_CMDS - echo "chmod 777 log" >> $VM_CMDS - echo "cp /home/ubuntu/zip-install.txt log" >> $VM_CMDS - if [ $DAEMON -eq 0 ] - then - echo "echo \"./build_oai -I $BUILD_OPTIONS \"" >> $VM_CMDS - echo "./build_oai -I $BUILD_OPTIONS > log/install-build.txt 2>&1" >> $VM_CMDS - else - if [[ "$VM_NAME" == *"-enb-ethernet"* ]] - then - echo "echo \"sleep 170 && ./build_oai -I $BUILD_OPTIONS\" > ./my-vm-build.sh" >> $VM_CMDS - elif [[ "$VM_NAME" == *"-ue-ethernet"* ]] - then - echo "echo \"sleep 60 && ./build_oai -I $BUILD_OPTIONS\" > ./my-vm-build.sh" >> $VM_CMDS - else - echo "echo \"./build_oai -I $BUILD_OPTIONS\" > ./my-vm-build.sh" >> $VM_CMDS - fi - echo "chmod 775 ./my-vm-build.sh " >> $VM_CMDS - echo "echo \"sudo -E daemon --inherit --unsafe --name=build_daemon --chdir=/home/ubuntu/tmp/cmake_targets -o /home/ubuntu/tmp/cmake_targets/log/install-build.txt ./my-vm-build.sh\"" >> $VM_CMDS - echo "sudo -E daemon --inherit --unsafe --name=build_daemon --chdir=/home/ubuntu/tmp/cmake_targets -o /home/ubuntu/tmp/cmake_targets/log/install-build.txt ./my-vm-build.sh" >> $VM_CMDS - fi - fi - ssh -T -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR < $VM_CMDS - rm -f $VM_CMDS -} diff --git a/ci-scripts/createVM.sh b/ci-scripts/createVM.sh deleted file mode 100755 index ec9b6169bd..0000000000 --- a/ci-scripts/createVM.sh +++ /dev/null @@ -1,107 +0,0 @@ -#!/bin/bash -#/* -# * 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 -# */ - -function create_usage { - echo "OAI CI VM script" - echo " Original Author: Raphael Defosseux" - echo " Requirements:" - echo " -- uvtool uvtool-libvirt apt-cacher" - echo " -- $VM_OSREL image already synced" - echo " Default:" - echo " -- eNB with USRP" - echo "" - echo "Usage:" - echo "------" - echo " oai-ci-vm-tool create [OPTIONS]" - echo "" - echo "Mandatory Options:" - echo "--------" - echo " --job-name #### OR -jn ####" - echo " Specify the name of the Jenkins job." - echo "" - echo " --build-id #### OR -id ####" - echo " Specify the build ID of the Jenkins job." - echo "" - variant_usage - echo " Specify the variant to build." - echo "" - echo " --help OR -h" - echo " Print this help message." - echo "" -} - -function acquire_vm_create_lock { - local FlockFile="/tmp/vmclone.lck" - local unlocked="0" - touch ${FlockFile} 2>/dev/null - if [[ $? -ne 0 ]] - then - echo "Cannot access lock file ${FlockFile}" - exit 2 - fi - while [ $unlocked -eq 0 ] - do - exec 5>${FlockFile} - flock -nx 5 - if [[ $? -ne 0 ]] - then - echo "Another instance of VM creation is running" - sleep 10 - else - unlocked="1" - fi - done - chmod 666 ${FlockFile} 2>/dev/null -} - -function release_vm_create_lock { - local FlockFile="/tmp/vmclone.lck" - rm -Rf ${FlockFile} -} - -function create_vm { - echo "############################################################" - echo "OAI CI VM script" - echo "############################################################" - echo "VM_NAME = $VM_NAME" - echo "VM_MEMORY = $VM_MEMORY MBytes" - echo "VM_CPU = $VM_CPU" - echo "VM_DISK = $VM_DISK GBytes" - - if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]] || [[ "$VM_NAME" == *"-rf-sim"* ]] || [[ "$VM_NAME" == *"-ethernet"* ]] || [[ "$VM_NAME" == *"rf5g-sim"* ]] - then - echo "This VM type is no longer supported in the pipeline framework" - return - fi - - echo "############################################################" - echo "Creating VM ($VM_NAME) on Ubuntu Cloud Image base" - echo "############################################################" - acquire_vm_create_lock - uvt-kvm create $VM_NAME release=$VM_OSREL --memory $VM_MEMORY --cpu $VM_CPU --disk $VM_DISK --unsafe-caching --template ci-scripts/template-host.xml - echo "Waiting for VM to be started" - uvt-kvm wait $VM_NAME --insecure - - VM_IP_ADDR=`uvt-kvm ip $VM_NAME` - echo "$VM_NAME has for IP addr = $VM_IP_ADDR" - release_vm_create_lock -} diff --git a/ci-scripts/destroyAllRunningVM.sh b/ci-scripts/destroyAllRunningVM.sh deleted file mode 100755 index c985246cdc..0000000000 --- a/ci-scripts/destroyAllRunningVM.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -#/* -# * 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 -# */ - -function destroy_usage { - echo "OAI CI VM script" - echo " Original Author: Raphael Defosseux" - echo " Requirements:" - echo " -- uvtool uvtool-libvirt apt-cacher" - echo "" - echo "Usage:" - echo "------" - echo " oai-ci-vm-tool destroy [OPTIONS]" - echo "" - command_options_usage -} - -function destroy_vm { - echo "############################################################" - echo "OAI CI VM script" - echo "############################################################" - echo "VM_TEMPLATE = $VM_TEMPLATE" - - LIST_CI_VM=`uvt-kvm list | grep $VM_TEMPLATE` - - for CI_VM in $LIST_CI_VM - do - VM_IP_ADDR=`uvt-kvm ip $CI_VM` - echo "VM to destroy: $CI_VM -- IP $VM_IP_ADDR" - uvt-kvm destroy $CI_VM - ssh-keygen -R $VM_IP_ADDR - done -} diff --git a/ci-scripts/doc/ci_dev_home.md b/ci-scripts/doc/ci_dev_home.md deleted file mode 100644 index 3bfc36d3f4..0000000000 --- a/ci-scripts/doc/ci_dev_home.md +++ /dev/null @@ -1,31 +0,0 @@ - - - - - -
- - - - - - OAI CI Dev documentation -
- -VM-based RF-Less Environment: - -* [How to setup your test env](./vm_based_simulator_env.md) -* [How to deal with OAI source files](./vm_based_simulator_sources.md) -* [The main script](./vm_based_simulator_main_scripts.md) -* [How to create one or several VM instances](./vm_based_simulator_create.md) -* [How to build an OAI variant](./vm_based_simulator_build.md) -* [How the build is checked](./vm_based_simulator_check_build.md) -* [How to test an OAI variant](./vm_based_simulator_test.md) -* [How to destroy all VM instances](./vm_based_simulator_destroy.md) - -Currently missing documentation: -* How to generate a build report -* How to generate a test report - ---- - diff --git a/ci-scripts/doc/vm_based_simulator_build.md b/ci-scripts/doc/vm_based_simulator_build.md deleted file mode 100644 index d75de46359..0000000000 --- a/ci-scripts/doc/vm_based_simulator_build.md +++ /dev/null @@ -1,261 +0,0 @@ - - - - - -
- - - - - - OAI CI Virtual-Machine-based Test Environment: build an OAI variant -
- -**Table of Contents** - -[[_TOC_]] - -# 1. Introduction # - -```bash -$ cd /tmp/CI-raphael -$ ls *.zip -localZip.zip -$ ./ci-scripts/oai-ci-vm-tool build --help -OAI CI VM script - Original Author: Raphael Defosseux - Requirements: - -- uvtool uvtool-libvirt apt-cacher - -- xenial image already synced - Default: - -- eNB with USRP - -Usage: ------- - oai-ci-vm-tool build [OPTIONS] - -Mandatory Options: --------- - --job-name #### OR -jn #### - Specify the name of the Jenkins job. - - --build-id #### OR -id #### - Specify the build ID of the Jenkins job. - - --workspace #### OR -ws #### - Specify the workspace. - -Options: --------- - # OpenAirInterface Build Variants - --variant enb-usrp OR -v1 ( build and test ) - --variant phy-sim OR -v3 ( build and test ) - --variant cppcheck OR -v4 ( build and test ) - --variant gnb-usrp OR -v5 ( build and test ) - --variant nr-ue-usrp OR -v6 ( build and test ) - --variant enb-ethernet OR -v7 ( build and test ) - --variant ue-ethernet OR -v8 ( build and test ) - # non-OSA Build Variants - --variant flexran-rtc OR -v10 ( build and test non-OSA ) - # OpenAirInterface Test Variants - --variant l1-sim OR -v20 ( test ) - --variant rf-sim OR -v21 ( test ) - --variant l2-sim OR -v22 ( test ) - Specify the variant to build. - - --keep-vm-alive OR -k - Keep the VM alive after the build. - - --daemon OR -D - Run as daemon - - --help OR -h - Print this help message. -``` - -# 2. Detailed Description # - -Source file concerned: `ci-scripts/buildOnVM.sh` - -## 2.1. build_on_vm function ## - -* First check if the ZIP file is available and if the apt-cacher proxy configuration file is present. If not, it will stop. -* Check if the VM instance is alive. If not, create it. -* Once the VM is alive, retrieve the IP address with VM_IP_ADDR=`uvt-kvm ip $VM_NAME` -* We copy the ZIP file to the VM : `scp localZip.zip ubuntu@$VM_IP_ADDR:/home/ubuntu` -* apt-cacher proxy file: `scp etc/apt/apt.conf.d/01proxy ubuntu@$VM_IP_ADDR:/home/ubuntu` - -Then we open a SSH session on the VM : `ssh ubuntu@$VM_IP_ADDR` - -* We copy the apt-cacher proxy file to its destination space: `sudo cp 01proxy /etc/apt/apt.conf.d/` -* We create an hush login file to eliminate the ssh opening session messages. -* We unzip the ZIP file into `/home/ubuntu/tmp/` folder -* and we work from there. - -# 3. Typical Usage # - -## 3.1. Build in the foreground, check the results and destroy the VM at the end ## - -```bash -$ cd /tmp/CI-raphael -$ ls *.zip -localZip.zip -$ ./ci-scripts/oai-ci-vm-tool build --workspace /tmp/CI-raphael --job-name RAN-CI-develop --build-id 47 --variant enb-usrp -############################################################ -OAI CI VM script -############################################################ -VM_NAME = RAN-CI-develop-b47-enb-usrp -VM_CMD_FILE = RAN-CI-develop-b47-enb-usrp_cmds.txt -JENKINS_WKSP = /var/jenkins/workspace/RAN-CI-develop -ARCHIVES_LOC = /var/jenkins/workspace/RAN-CI-develop/archives/enb_usrp -BUILD_OPTIONS = --eNB -w USRP --mu -VM_MEMORY = 2048 MBytes -VM_CPU = 4 -############################################################ -Creating VM (RAN-CI-develop-b47-enb-usrp) on Ubuntu Cloud Image base -############################################################ -Waiting for VM to be started -Warning: Permanently added '192.168.122.2' (ECDSA) to the list of known hosts. -RAN-CI-develop-b47-enb-usrp has for IP addr = 192.168.122.2 -############################################################ -Copying GIT repo into VM (RAN-CI-develop-b47-enb-usrp) -############################################################ -Warning: Permanently added '192.168.122.2' (ECDSA) to the list of known hosts. -############################################################ -Running install and build script on VM (RAN-CI-develop-b47-enb-usrp) -############################################################ -Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-145-generic x86_64) - - * Documentation: https://help.ubuntu.com - * Management: https://landscape.canonical.com - * Support: https://ubuntu.com/advantage - - Get cloud support with Ubuntu Advantage Cloud Guest: - http://www.ubuntu.com/business/services/cloud - -0 packages can be updated. -0 updates are security updates. - -New release '18.04.2 LTS' available. -Run 'do-release-upgrade' to upgrade to it. - - -sudo apt-get --yes --quiet install zip subversion libboost-dev -unzip -qq -DD ../localZip.zip -cd /home/ubuntu/tmp -source oaienv -cd cmake_targets -./build_oai -I --eNB -w USRP --mu - -# Here wait for a few minutes 8 to 12 minutes # - -############################################################ -Creating a tmp folder to store results and artifacts -############################################################ -############################################################ -Destroying VM -############################################################ -# Host 192.168.122.2 found: line 19 -/home/eurecom/.ssh/known_hosts updated. -Original contents retained as /home/eurecom/.ssh/known_hosts.old -############################################################ -Checking build status -############################################################ -STATUS seems OK -``` - -If you are adding the `-k` or `--keep-vm-alive` option, the VM instance will not be destroyed and you explore what happenned. - -## 3.2. Build in the background ## - -This is how it is done in the CI master job pipeline. - -```bash -$ cd /tmp/CI-raphael -$ ls *.zip -localZip.zip -$ ./ci-scripts/oai-ci-vm-tool build --workspace /tmp/CI-raphael --job-name RAN-CI-develop --build-id 47 --variant phy-sim --daemon -12:44:24 ############################################################ -12:44:24 OAI CI VM script -12:44:24 ############################################################ -12:44:24 VM_NAME = RAN-CI-develop-b47-phy-sim -12:44:24 VM_CMD_FILE = RAN-CI-develop-b47-phy-sim_cmds.txt -12:44:24 JENKINS_WKSP = /var/jenkins/workspace/RAN-CI-develop -12:44:24 ARCHIVES_LOC = /var/jenkins/workspace/RAN-CI-develop/archives/phy_sim -12:44:24 BUILD_OPTIONS = --phy_simulators -12:44:24 VM_MEMORY = 2048 MBytes -12:44:24 VM_CPU = 4 -12:44:24 ############################################################ -12:44:24 Creating VM (RAN-CI-develop-b47-phy-sim) on Ubuntu Cloud Image base -12:44:24 ############################################################ -12:44:27 Waiting for VM to be started -12:46:34 Warning: Permanently added '192.168.122.220' (ECDSA) to the list of known hosts. -12:46:34 RAN-CI-develop-b47-phy-sim has for IP addr = 192.168.122.220 -12:46:34 ############################################################ -12:46:34 Copying GIT repo into VM (RAN-CI-develop-b47-phy-sim) -12:46:34 ############################################################ -12:46:34 Warning: Permanently added '192.168.122.220' (ECDSA) to the list of known hosts. -12:46:34 ############################################################ -12:46:34 Running install and build script on VM (RAN-CI-develop-b47-phy-sim) -12:46:34 ############################################################ -12:46:34 Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-145-generic x86_64) -12:46:34 -12:46:34 * Documentation: https://help.ubuntu.com -12:46:34 * Management: https://landscape.canonical.com -12:46:34 * Support: https://ubuntu.com/advantage -12:46:34 -12:46:34 Get cloud support with Ubuntu Advantage Cloud Guest: -12:46:34 http://www.ubuntu.com/business/services/cloud -12:46:34 -12:46:34 0 packages can be updated. -12:46:34 0 updates are security updates. -12:46:34 -12:46:34 New release '18.04.2 LTS' available. -12:46:34 Run 'do-release-upgrade' to upgrade to it. -12:46:34 -12:46:34 -12:46:34 sudo apt-get --yes --quiet install zip daemon subversion libboost-dev -12:46:46 unzip -qq -DD ../localZip.zip -12:46:48 source oaienv -12:46:48 sudo -E daemon --inherit --unsafe --name=build_daemon --chdir=/home/ubuntu/tmp/cmake_targets -o /home/ubuntu/tmp/cmake_targets/log/install-build.txt ./my-vm-build.sh -12:46:48 STATUS seems OK -``` - -So here is 2.5 minutes, a VM was created, source files copied and the build process is started in the background. - -```bash -$ cd /tmp/raphael -$ ./ci-scripts/oai-ci-vm-tool wait --workspace /var/jenkins/workspace/RAN-CI-develop --variant phy-sim --job-name RAN-CI-develop --build-id 47 --keep-vm-alive -12:49:14 ############################################################ -12:49:14 OAI CI VM script -12:49:14 ############################################################ -12:49:14 VM_NAME = RAN-CI-develop-b47-phy-sim -12:49:14 VM_CMD_FILE = RAN-CI-develop-b47-phy-sim_cmds.txt -12:49:14 JENKINS_WKSP = /var/jenkins/workspace/RAN-CI-develop -12:49:14 ARCHIVES_LOC = /var/jenkins/workspace/RAN-CI-develop/archives/phy_sim -12:49:14 BUILD_OPTIONS = --phy_simulators -12:49:15 Waiting for VM to be started -12:49:15 Warning: Permanently added '192.168.122.220' (ECDSA) to the list of known hosts. -12:49:16 RAN-CI-develop-b47-phy-sim has for IP addr = 192.168.122.220 -12:49:16 ############################################################ -12:49:16 Waiting build process to end on VM (RAN-CI-develop-b47-phy-sim) -12:49:16 ############################################################ -12:49:16 ps -aux | grep build -12:54:23 ############################################################ -12:54:23 Creating a tmp folder to store results and artifacts -12:54:23 ############################################################ -12:54:23 ############################################################ -12:54:23 Checking build status -12:54:23 ############################################################ -12:54:23 STATUS seems OK -``` - -Here the `--keep-vm-alive` option is used to keep the VM alive and performs some testing. - ---- - -Next step: [how the build is checked](./vm_based_simulator_check_build.md) - -You can also go back to the [CI dev main page](./ci_dev_home.md) - diff --git a/ci-scripts/doc/vm_based_simulator_check_build.md b/ci-scripts/doc/vm_based_simulator_check_build.md deleted file mode 100644 index a9d9177fab..0000000000 --- a/ci-scripts/doc/vm_based_simulator_check_build.md +++ /dev/null @@ -1,44 +0,0 @@ - - - - - -
- - - - - - OAI CI Virtual-Machine-based Test Environment: checking the build result -
- -**Table of Contents** - -[[_TOC_]] - -# 1. Introduction # - -Function is called: - -- when building in foreground -- when waiting for the background build process is finished - -# 2. Detailed Description # - -Source file concerned: `ci-scripts/waitBuildOnVM.sh` - -## 2.1. check_on_vm_build function ## - -* Retrieve the build log files from the VM instance `ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/*.txt` -* and copy them locally in the workspace at $ARCHIVES_LOC -* List all log files that match the pattern. Each should have - * the `Built target` pattern (the library/executable SHALL link) -* Evaluate the remaining space on VM disk -* The number of patterned log files SHALL match $NB_PATTERN_FILES defined in `ci-scripts/oai-ci-vm-tool` script for the variant - ---- - -Next step: [how to test a function](./vm_based_simulator_test.md) - -You can also go back to the [CI dev main page](./ci_dev_home.md) - diff --git a/ci-scripts/doc/vm_based_simulator_create.md b/ci-scripts/doc/vm_based_simulator_create.md deleted file mode 100644 index db5ba2daed..0000000000 --- a/ci-scripts/doc/vm_based_simulator_create.md +++ /dev/null @@ -1,110 +0,0 @@ - - - - - -
- - - - - - OAI CI Virtual-Machine-based Test Environment: create a VM instance -
- -**Table of Contents** - -[[_TOC_]] - -# 1. Introduction # - -```bash -$ cd /tmp/CI-raphael -$ ./ci-scripts/oai-ci-vm-tool create --help -OAI CI VM script - Original Author: Raphael Defosseux - Requirements: - -- uvtool uvtool-libvirt apt-cacher - -- xenial image already synced - Default: - -- eNB with USRP - -Usage: ------- - oai-ci-vm-tool create [OPTIONS] - -Mandatory Options: --------- - --job-name #### OR -jn #### - Specify the name of the Jenkins job. - - --build-id #### OR -id #### - Specify the build ID of the Jenkins job. - - # OpenAirInterface Build Variants - --variant enb-usrp OR -v1 ( build and test ) - --variant phy-sim OR -v3 ( build and test ) - --variant cppcheck OR -v4 ( build and test ) - --variant gnb-usrp OR -v5 ( build and test ) - --variant nr-ue-usrp OR -v6 ( build and test ) - --variant enb-ethernet OR -v7 ( build and test ) - --variant ue-ethernet OR -v8 ( build and test ) - # non-OSA Build Variants - --variant flexran-rtc OR -v10 ( build and test non-OSA ) - # OpenAirInterface Test Variants - --variant l1-sim OR -v20 ( test ) - --variant rf-sim OR -v21 ( test ) - --variant l2-sim OR -v22 ( test ) - Specify the variant to build. - - --help OR -h - Print this help message. -``` - -# 2. Detailed Description # - -Source file concerned: `ci-scripts/createVM.sh` - -## 2.1. create_vm function ## - -This is the function that is being called from the main oai-vm-tool script. - -The main purpose is to start a VM instance: - -```bash -uvt-kvm create $VM_NAME release=xenial --memory $VM_MEMORY --cpu $VM_CPU --disk $VM_DISK --unsafe-caching --template ci-scripts/template-host.xml -``` - -Variables are set in the main script based on the options. - -`--unsafe-caching` option is used because our VM instances are throw-away's. - -`--template ci-scripts/template-host.xml` is used to duplicate the CPU properties to the VM instance. **VERY IMPORTANT to build OAI** - -## 2.2. Lock / Unlock functions ## - -There are `acquire_vm_create_lock` and `release_vm_create_lock` functions. - -Creating Virtual Machines instances in parallel **creates a lot of stress** on the host server HW. If you launch creations in parallel (Jenkins pipeline could do it) or you are several people working on the same host server, this mechanism atomizes the creation process and wait until the previous VM creation is finished. - -# 3. Typical Usage # - -```bash -$ cd /tmp/CI-raphael -$ ./ci-scripts/oai-ci-vm-tool create --job-name raphael --build-id 1 --variant phy-sim -# or a more **unique approach** -$ ./ci-scripts/oai-ci-vm-tool create -jn toto -id 1 -v2 -``` - -The Jenkins pipeline uses the master job name as `job-name` option and the job-build ID. - -Try to be unique if you are several developers working on the same host server. - -Finally, typically I never use the `create` command. I use directly the build command that checks if VM is created and if not, will create it. See next step. - ---- - -Next step: [how to build an OAI variant](./vm_based_simulator_build.md) - -You can also go back to the [CI dev main page](./ci_dev_home.md) - diff --git a/ci-scripts/doc/vm_based_simulator_destroy.md b/ci-scripts/doc/vm_based_simulator_destroy.md deleted file mode 100644 index 945c4a6475..0000000000 --- a/ci-scripts/doc/vm_based_simulator_destroy.md +++ /dev/null @@ -1,69 +0,0 @@ - - - - - -
- - - - - - OAI CI Virtual-Machine-based Test Environment: Properly Destroy all VM instances -
- -**Table of Contents** - -[[_TOC_]] - -# 1. Introduction # - -```bash -$ cd /tmp/CI-raphael -$ ./ci-scripts/oai-ci-vm-tool destroy --help -OAI CI VM script - Original Author: Raphael Defosseux - Requirements: - -- uvtool uvtool-libvirt apt-cacher - -Usage: ------- - oai-ci-vm-tool destroy [OPTIONS] - -Mandatory Options: --------- - --job-name #### OR -jn #### - Specify the name of the Jenkins job. - - --build-id #### OR -id #### - Specify the build ID of the Jenkins job. - -Options: --------- - --help OR -h - Print this help message. -``` - -# 2. Detailed Description # - -Source file concerned: `ci-scripts/destroyAllRunningVM.sh` - -## 2.1. destroy_vm function ## - -This is the function that is being called from the main oai-vm-tool script. - -The main purpose is to destroy all VM instances whose name matches a pattern. - -It also cleans up the `.ssh/known_hosts` file. - -# 3. Typical Usage # - -```bash -$ cd /tmp/CI-raphael -$ ./ci-scripts/oai-ci-vm-tool destroy --job-name raphael --build-id 1 -``` - ---- - -You can go back to the [CI dev main page](./ci_dev_home.md) - diff --git a/ci-scripts/doc/vm_based_simulator_env.md b/ci-scripts/doc/vm_based_simulator_env.md deleted file mode 100644 index 066f63a24a..0000000000 --- a/ci-scripts/doc/vm_based_simulator_env.md +++ /dev/null @@ -1,119 +0,0 @@ - - - - - -
- - - - - - OAI CI Virtual-Machine-based Simulator Test Environment -
- -**Table of Contents** - -[[_TOC_]] - -# 1. Introduction # - -This document explains how the master pipeline works and how any developer could contribute to add testing. - -It is an extension to the wiki [page](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/ci/enb-master-job). - -The purpose of this master pipeline is to: - -* Validate that a Merge Request is mergeable -* Validate that a Merge Request is following coding guidelines -* Validate that a Merge Request is not breaking any typical build variant -* Validate that a Merge Request is not breaking any legacy simulator-based test - -We will mainly focused on the 2 last items. - -Last point, this documentation is valid for all CI-supported branches: - -* `master` -* `develop` - -But the feature set may not be aligned. **The principles still apply.** - -# 2. Prerequisites # - -Some details are available on this wiki [section](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/ci/enb-ci-architecture#22-pipeline-executor). - -Currently we have a host server (`bellatrix`) with the current parameters: - -* 40 x Intel(R) Xeon(R) CPU E5-2640 v4 @ 2.40GHz -* 64 Gbytes RAM -* Ubuntu 16.04.3 LTS (xenial) - -For you to replicate this environment, you need a strong server: - -* At least 16 cores -* Ubuntu 16 (xenial) or higher (such as bionic, not tested) - -Also we are using a Virtual Machine (VM for the rest of document) based strategy for the moment. - -So you need to install 2 tools: - -* uvt-kvm -* apt-cacher - -We are planning to also add: - -* A Red Hat Linux Entreprise 7.6 host environment -* A Container-based strategy (such as Docket and Kubernetes) - -## 2.1. uvtool installation ## - -```bash -$ sudo apt-get install uvtool -# if you don't have already, create an ssh key -$ ssh-keygen -b 2048 -# retrieve an image -$ sudo uvt-simplestreams-libvirt sync arch=amd64 release=xenial -# we might soon switch to an Ubuntu 18.04 version -$ sudo uvt-simplestreams-libvirt sync arch=amd64 release=bionic -$ uvt-simplestreams-libvirt query -release=bionic arch=amd64 label=release (20190402) -release=xenial arch=amd64 label=release (20190406) -``` - -On our server, I don't update (sync) that often (every 2-4 months). - -For more details: - -* uvtool syntax is [here](http://manpages.ubuntu.com/manpages/trusty/man1/uvt-kvm.1.html) -* more readable tutorial is [here](https://help.ubuntu.com/lts/serverguide/cloud-images-and-uvtool.html) - -## 2.2. apt-cacher-server installation ## - -I recommend to follow to the letter this [tutorial](https://help.ubuntu.com/community/Apt-Cacher-Server). - -The reason: we are creating/using/destroying a lot of VM instances and we are always installing the same packages. -This service allows to cache on the host and, doing so, **decreases the pressure on your internet bandwith usage**. -It also optimizes time at build stage. - -```bash -$ sudo apt-get install apt-cacher apache2 -$ sudo vi /etc/default/apt-cache -$ sudo service apache2 restart - -# Server configuration -$ sudo vi /etc/apt-cacher/apt-cacher.conf - --> allowed_hosts = * - --> fix the installer_files_regexp -$ sudo vi /etc/apt/apt.conf.d/01proxy ---> add `Acquire::http::Proxy "http://:3142";` -$ sudo service apt-cacher restart -``` - -This last file (/etc/apt/apt.conf.d/01proxy) is very important since it is tested in any CI script. - ---- - -We can now switch to the next step: [how to deal with oai sources](./vm_based_simulator_sources.md) - -You can also go back to the [CI dev main page](./ci_dev_home.md) - diff --git a/ci-scripts/doc/vm_based_simulator_main_scripts.md b/ci-scripts/doc/vm_based_simulator_main_scripts.md deleted file mode 100644 index ccaf91ed12..0000000000 --- a/ci-scripts/doc/vm_based_simulator_main_scripts.md +++ /dev/null @@ -1,188 +0,0 @@ - - - - - -
- - - - - - OAI CI Virtual-Machine-based Test Environment: the Main Script -
- -**Table of Contents** - -[[_TOC_]] - -# 1. Introduction # - -The file name is `./ci-scripts/oai-ci-vm-tool` from the workspace root. - -```bash -$ cd /tmp/CI-raphael -$ ./ci-scripts/oai-ci-vm-tool --help -OAI CI VM script - Original Author: Raphael Defosseux - Requirements: - -- uvtool uvtool-libvirt apt-cacher - -- xenial image already synced - -Usage: ------- - oai-ci-vm-tool (-h|--help) {create,destroy,build,wait,test,report-build,report-test} ... - -``` - -This is a **BASH** script. - - -# 2. Sub BASH scripts # - -The main script is including a bunch of sub BASH scripts. - -* ci-scripts/createVM.sh -* ci-scripts/buildOnVM.sh -* ci-scripts/waitBuildOnVM.sh -* ci-scripts/destroyAllRunningVM.sh -* ci-scripts/runTestOnVM.sh -* ci-scripts/reportBuildLocally.sh -* ci-scripts/reportTestLocally.sh - -**NOTE: ci-scripts/runTestOnVM.sh is getting big and will certainly be split to facilitate maintenance. Start functions will be also factorized.** - -# 3. Main script features # - -The main purpose of the main script is decipher the options and launch the requested function. - -It is also **testing if uvtool and apt-cacher are installed.** - -It finally provides parameters to the requested functions. Parameter definition is centralized there. - -For example: - -for VM instance creation: - -* the instance name: VM_NAME -* the RAM and number of CPUs: VM_MEMORY, VM_CPU - -for OAI variant build: - -* build options: BUILD_OPTIONS -* build log file to parse: LOG_PATTERN -* the number of log files to parse: NB_PATTERN_FILES - -You can get the list of variant specific variables specifying the variant argument when asking for help: - -``` bash -./ci-scripts/oai-ci-vm-tool help variant - --variant flexran-rtc OR -v10 ( build and test non-OSA ) - VM_NAME=ci-flexran-rtc ARCHIVES_LOC=flexran - VM_MEMORY=2048 VM_CPU=4 - NB_PATTERN_FILES=1 BUILD_OPTIONS="cmake . && make -j2" - LOG_PATTERN=.txt - - --variant enb-usrp OR -v1 ( build and test ) - VM_NAME=ci-enb-usrp ARCHIVES_LOC=enb_usrp - VM_MEMORY=2048 VM_CPU=4 - NB_PATTERN_FILES=9 BUILD_OPTIONS="--eNB -w USRP --mu" - LOG_PATTERN=.txt - - --variant l1-sim OR -v20 ( test ) - VM_NAME=ci-l1-sim ARCHIVES_LOC=l1_sim - VM_MEMORY=2048 VM_CPU=4 - NB_PATTERN_FILES=9 BUILD_OPTIONS="" - LOG_PATTERN=.txt - - --variant rf-sim OR -v21 ( test ) - VM_NAME=ci-rf-sim ARCHIVES_LOC=rf_sim - VM_MEMORY=2048 VM_CPU=4 - NB_PATTERN_FILES=9 BUILD_OPTIONS="" - LOG_PATTERN=.txt - - --variant l2-sim OR -v22 ( test ) - VM_NAME=ci-l2-sim ARCHIVES_LOC=l2_sim - VM_MEMORY=2048 VM_CPU=4 - NB_PATTERN_FILES=9 BUILD_OPTIONS="" - LOG_PATTERN=.txt - - --variant phy-sim OR -v3 ( build and test ) - VM_NAME=ci-phy-sim ARCHIVES_LOC=phy_sim - VM_MEMORY=2048 VM_CPU=4 - NB_PATTERN_FILES=3 BUILD_OPTIONS="--phy_simulators" - LOG_PATTERN=.txt - - --variant cppcheck OR -v4 ( build and test ) - VM_NAME=ci-cppcheck ARCHIVES_LOC=cppcheck - VM_MEMORY=4096 VM_CPU=4 - NB_PATTERN_FILES=1 BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2 --suppressions-list=ci-scripts/cppcheck_suppressions.list -I common/utils -j4" - LOG_PATTERN=cppcheck.xml - - --variant enb-ethernet OR -v7 ( build and test ) - VM_NAME=ci-enb-ethernet ARCHIVES_LOC=enb_eth - VM_MEMORY=4096 VM_CPU=4 - NB_PATTERN_FILES=8 BUILD_OPTIONS="--eNB" - LOG_PATTERN=.txt - - --variant ue-ethernet OR -v8 ( build and test ) - VM_NAME=ci-ue-ethernet ARCHIVES_LOC=ue_eth - VM_MEMORY=4096 VM_CPU=4 - NB_PATTERN_FILES=12 BUILD_OPTIONS="--UE" - LOG_PATTERN=.txt - -``` - -To define a new variant you just need to define a function which name conforms to `function variant__v__` where n and variant_name will respectively define the short and long options for your variant. The function only needs to define the variant dependent variables. For many variables, default values are set in the `check_set_variant` function. When a variant doesn't define the BUILD_OPTIONS variable it cannot be used for the `build` `wait` and `create` commands. - -The main scripts also allows the definition of non variant-dependant variable via the `--setvar_ ` options. -You can get the list of these variables by using `help setvar`: - -```BASH -./ci-scripts/oai-ci-vm-tool help setvar ---setvar_ where varname is one of: - VM_OSREL : OS release to use in virtual machines - RUN_EXPERIMENTAL : Enforce execution of variants with EXPERIMENTAL variable set to "true" -``` - -To add a new non-variant dependant variable you need: -* Add an item to the `AUTHORIZED_VAR` array -* In the `setvar_usage`function, add your help string in the HELP_VAR[""] variable. -* Write the bash code for your variable. - -Example of non variant dependent usage: - -``` bash -./ci-scripts/oai-ci-vm-tool test -v21 -ws /usr/local/oai/enhance_CI_extEPC/openairinterface5g -id 1 -jn testci -Currently testci-b1-rf-sim Testing is not implemented / enabled -Comment out these lines in ./ci-scripts/oai-ci-vm-tool if you want to run it - or use option --setvar_RUN_EXPERIMENTAL=true to test it - - - ./ci-scripts/oai-ci-vm-tool test -v21 -ws /usr/local/oai/enhance_CI_extEPC/openairinterface5g -id 1 -jn testci --setvar_RUN_EXPERIMENTAL true - Setting RUN_EXPERIMENTAL to true... - ############################################################ - OAI CI VM script - ############################################################ - ENB_VM_NAME = testci-b1-enb-ethernet - ENB_VM_CMD_FILE = testci-b1-enb-ethernet_cmds.txt - UE_VM_NAME = testci-b1-ue-ethernet - UE_VM_CMD_FILE = testci-b1-ue-ethernet_cmds.txt - JENKINS_WKSP = /usr/local/oai/enhance_CI_extEPC/openairinterface5g - ARCHIVES_LOC = /usr/local/oai/enhance_CI_extEPC/openairinterface5g/archives/rf_sim/test - ############################################################ - Waiting for ENB VM to be started -........................... -``` - -In the same way, you can set the variable `VM_OSREL` to run the test in virtual machines of the specified OS release: - -``` bash -./ci-scripts/oai-ci-vm-tool test -v21 -ws /usr/local/oai/enhance_CI_extEPC/openairinterface5g -id 1 -jn testci --setvar_VM_OSREL bionic -``` - ---- - -Next step: [how to create one or several VM instances](./vm_based_simulator_create.md) - -You can also go back to the [CI dev main page](./ci_dev_home.md) diff --git a/ci-scripts/doc/vm_based_simulator_sources.md b/ci-scripts/doc/vm_based_simulator_sources.md deleted file mode 100644 index 33954ec39f..0000000000 --- a/ci-scripts/doc/vm_based_simulator_sources.md +++ /dev/null @@ -1,83 +0,0 @@ - - - - - -
- - - - - - OAI CI Virtual-Machine-based Simulator OAI source management -
- -**Table of Contents** - -[[_TOC_]] - -# 1. Introduction # - -The idea of this section is to optimize/uniform source management for several VM instances. - -If we were cloning the same repository in each VM we are creating, we would put so much pressure on the central GitLab repository. - -The solution: - -* clone/fetch on a given clean workspace and tar/zip only the source files without any artifacts. -* we then copy the tar/zip file to each VM instance -* and within each VM instance, unzip - -# 2. Centralized Workspace # - -You can create a brand new workspace by cloning: - -```bash -$ mkdir /tmp/CI-raphael -$ cd /tmp/CI-raphael -$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git . -$ git checkout develop -``` - -You can also use your current cloned workspace and any `develop`-based branch. - -```bash -$ cd /home/raphael/openairinterface5g -$ git fetch -$ git checkout develop-improved-documentation -# CAUTION: the following command will remove any file that has not already been added to GIT -$ sudo git clean -x -d -ff -$ git status -On branch develop-improved-documentation -Your branch is up-to-date with 'origin/develop-improved-documentation'. -nothing to commit, working directory clean -``` - -You can also have modified files. - -**The main point is to have NO ARTIFACTS from a previous build in your workspace.** - -Last point, the workspace folder name is not necesseraly `openairinterface5g`. But all the following commands will be run for the root of the workspace. - -For clarity, I will always use `/tmp/CI-raphael` as $WORKSPACE. - -# 3. Create the ZIP file # - -```bash -# go to root of workspace -$ cd /tmp/CI-raphael -$ zip -r -qq localZip.zip . -``` - -The **Jenkins Pipeline** performs automatically these operations. - -In addition, in case of a merge request, it tries to merge with the target branch and might create a dummy local commit. - -See [section](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/ci/enb-master-job#32-verify-guidelines-stage) - ---- - -Next step: [the main scripts](./vm_based_simulator_main_scripts.md) - -You can also go back to the [CI dev main page](./ci_dev_home.md) - diff --git a/ci-scripts/doc/vm_based_simulator_test.md b/ci-scripts/doc/vm_based_simulator_test.md deleted file mode 100644 index 52bf36e255..0000000000 --- a/ci-scripts/doc/vm_based_simulator_test.md +++ /dev/null @@ -1,197 +0,0 @@ - - - - - -
- - - - - - OAI CI Virtual-Machine-based Test Environment: Testing an OAI variant -
- -**Table of Contents** - -[[_TOC_]] - -# 1. Introduction # - -Currently 1 build variant can be directly tested: - -* Physical Simulators - -In addition, 2 build variants are used: - -* OAI eNB with ETHERNET transport -* OAI UE with ETHERNET transport - -for the following scenarios: - -* L1 simulator w/ a channel simulator (NOT IMPLEMENTED) -* RF simulator : (IMPLEMENTED but not working as of 2019.w15) -* L2 nFAPI simulator - -Tests are run sequentially in the Jenkins pipeline because: - -* We want to mutualize the VM creation for an EPC -* We have seen performance issues when running in parallel. - - -```bash -./ci-scripts/oai-ci-vm-tool test --help -OAI CI VM script - Original Author: Raphael Defosseux - Requirements: - -- uvtool uvtool-libvirt apt-cacher - -- xenial image already synced - Default: - -- eNB with USRP - -Usage: ------- - oai-ci-vm-tool test [OPTIONS] - -Options: --------- - --job-name #### OR -jn #### - Specify the name of the Jenkins job. - - --build-id #### OR -id #### - Specify the build ID of the Jenkins job. - - --workspace #### OR -ws #### - Specify the workspace. - - # OpenAirInterface Build Variants - --variant enb-usrp OR -v1 ( build and test ) - --variant phy-sim OR -v3 ( build and test ) - --variant cppcheck OR -v4 ( build and test ) - --variant gnb-usrp OR -v5 ( build and test ) - --variant nr-ue-usrp OR -v6 ( build and test ) - --variant enb-ethernet OR -v7 ( build and test ) - --variant ue-ethernet OR -v8 ( build and test ) - # non-OSA Build Variants - --variant flexran-rtc OR -v10 ( build and test non-OSA ) - # OpenAirInterface Test Variants - --variant l1-sim OR -v20 ( test ) - --variant rf-sim OR -v21 ( test ) - --variant l2-sim OR -v22 ( test ) - Specify the variant to build. - - --keep-vm-alive OR -k - Keep the VM alive after the build. - - --help OR -h - Print this help message. -``` - -# 2. Detailed Description # - -Source file concerned: `ci-scripts/run_test_on_vm.sh` - -**TBD when file is re-structured.** - -# 3. Typical Usage # - -## 3.1. Testing the physical simulators ## - -```bash -$ ./ci-scripts/oai-ci-vm-tool test --workspace /var/jenkins/workspace/RAN-CI-develop --variant phy-sim --job-name RAN-CI-develop --build-id 47 -12:54:29 ############################################################ -12:54:29 OAI CI VM script -12:54:29 ############################################################ -12:54:29 VM_NAME = RAN-CI-develop-b47-phy-sim -12:54:29 VM_CMD_FILE = RAN-CI-develop-b47-phy-sim_cmds.txt -12:54:29 JENKINS_WKSP = /var/jenkins/workspace/RAN-CI-develop -12:54:29 ARCHIVES_LOC = /var/jenkins/workspace/RAN-CI-develop/archives/phy_sim/test -12:54:29 ############################################################ -12:54:29 Waiting for VM to be started -12:54:29 ############################################################ -12:54:29 Warning: Permanently added '192.168.122.220' (ECDSA) to the list of known hosts. -12:54:30 RAN-CI-develop-b47-phy-sim has for IP addr = 192.168.122.220 -... -13:04:48 Test Results are written to /home/ubuntu/tmp/cmake_targets/autotests/log/results_autotests.xml -13:05:00 ############################################################ -13:05:00 Creating a tmp folder to store results and artifacts -13:05:00 ############################################################ -13:05:00 /var/jenkins/workspace/RAN-CI-develop/archives/phy_sim/test /var/jenkins/workspace/RAN-CI-develop -13:05:04 /var/jenkins/workspace/RAN-CI-develop -13:05:04 ############################################################ -13:05:04 Destroying VM -13:05:04 ############################################################ -13:05:06 # Host 192.168.122.220 found: line 21 -13:05:06 /home/eurecom/.ssh/known_hosts updated. -13:05:06 Original contents retained as /home/eurecom/.ssh/known_hosts.old -13:05:06 ############################################################ -13:05:06 Checking run status -13:05:06 ############################################################ -13:05:06 NB_FOUND_FILES = 1 -13:05:06 NB_RUNS = 20 -13:05:06 NB_FAILURES = 0 -13:05:06 STATUS seems OK -``` - -Note that the VM instance is destroyed. You do that when you are sure your test is passing. - -## 3.2. Test the RF simulator ## - -```bash -./ci-scripts/oai-ci-vm-tool test --workspace /var/jenkins/workspace/RAN-CI-develop --variant rf-sim --job-name RAN-CI-develop --build-id 48 --keep-vm-alive -15:24:45 Currently RF-Simulator Testing is not implemented / enabled -15:24:45 Comment out these lines in ./ci-scripts/oai-ci-vm-tool if you want to run it -15:24:45 STATUS seems OK -``` - -## 3.3. Testing the L2-nFAPI simulator - -```bash -./ci-scripts/oai-ci-vm-tool test --workspace /var/jenkins/workspace/RAN-CI-develop --variant l2-sim --job-name RAN-CI-develop --build-id 48 -15:24:47 ############################################################ -15:24:47 OAI CI VM script -15:24:47 ############################################################ -15:24:47 ENB_VM_NAME = RAN-CI-develop-b48-enb-ethernet -15:24:47 ENB_VM_CMD_FILE = RAN-CI-develop-b48-enb-ethernet_cmds.txt -15:24:47 UE_VM_NAME = RAN-CI-develop-b48-ue-ethernet -15:24:47 UE_VM_CMD_FILE = RAN-CI-develop-b48-ue-ethernet_cmds.txt -15:24:47 JENKINS_WKSP = /var/jenkins/workspace/RAN-CI-develop -15:24:47 ARCHIVES_LOC = /var/jenkins/workspace/RAN-CI-develop/archives/l2_sim/test -15:24:47 ############################################################ -15:24:47 Waiting for ENB VM to be started -15:24:47 ############################################################ -15:24:47 Warning: Permanently added '192.168.122.110' (ECDSA) to the list of known hosts. -15:24:48 RAN-CI-develop-b48-enb-ethernet has for IP addr = 192.168.122.110 -15:24:48 ############################################################ -15:24:48 Waiting for UE VM to be started -15:24:48 ############################################################ -15:24:49 Warning: Permanently added '192.168.122.90' (ECDSA) to the list of known hosts. -15:24:50 RAN-CI-develop-b48-ue-ethernet has for IP addr = 192.168.122.90 -15:24:50 ############################################################ -15:24:50 Test EPC on VM (RAN-CI-develop-b48-epc) will be using ltebox -15:24:50 ############################################################ -15:24:50 EPC_VM_CMD_FILE = RAN-CI-develop-b48-epc_cmds.txt -15:24:50 Waiting for VM to be started -15:24:50 Warning: Permanently added '192.168.122.156' (ECDSA) to the list of known hosts. -15:24:51 RAN-CI-develop-b48-epc has for IP addr = 192.168.122.156 -... -15:42:44 ############################################################ -15:42:44 Destroying VMs -15:42:44 ############################################################ -15:42:46 # Host 192.168.122.110 found: line 18 -15:42:46 /home/eurecom/.ssh/known_hosts updated. -15:42:46 Original contents retained as /home/eurecom/.ssh/known_hosts.old -15:42:47 # Host 192.168.122.90 found: line 18 -15:42:47 /home/eurecom/.ssh/known_hosts updated. -15:42:47 Original contents retained as /home/eurecom/.ssh/known_hosts.old -15:42:47 ############################################################ -15:42:47 Checking run status -15:42:47 ############################################################ -15:42:47 STATUS failed? -``` ---- - -Final step: [how to properly destroy all VM instances](./vm_based_simulator_destroy.md) - -You can also go back to the [CI dev main page](./ci_dev_home.md) - diff --git a/ci-scripts/oai-ci-vm-tool b/ci-scripts/oai-ci-vm-tool deleted file mode 100755 index c6ea533fce..0000000000 --- a/ci-scripts/oai-ci-vm-tool +++ /dev/null @@ -1,889 +0,0 @@ -#!/bin/bash -#/* -# * 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 -# */ - - -function top_usage { - echo "OAI CI VM script" - echo " Original Author: Raphael Defosseux" - echo " Requirements:" - echo " -- uvtool uvtool-libvirt apt-cacher" - echo " -- $VM_OSREL image already synced" - echo "" - echo "Usage:" - echo "------" - echo " oai-ci-vm-tool (-h|--help) { `for i in "${COMMANDS_NAME[@]}"; do echo -n $i,;done` ..." } - echo "" -} - -function variant_usage { - - for (( i=0 ; i<${#VARIANTS_LONG[@]} ; i++ )) - do - unset BUILD_OPTIONS - unset VARIANT_INFO - check_set_variant "${VARIANTS_SHORT[$i]}" - printf " --variant %-15s OR -%-3s" "${VARIANTS_LONG[$i]}" "${VARIANTS_SHORT[$i]}" - if [ "$BUILD_OPTIONS" = "" ] - then - echo -n " ( test " - else - echo -n " ( build and test " - fi - echo "$VARIANT_INFO )" - if [ "$1" = "full" ] - then - printf " VM_NAME=%-15s ARCHIVES_LOC=%-15s\n" "$VM_NAME" "$ARCHIVES_LOC" - printf " VM_MEMORY=%-15s VM_CPU=%-15s VM_DISK=%-15s\n" "$VM_MEMORY" "$VM_CPU" "$VM_DISK" - printf " NB_PATTERN_FILES=%-15s BUILD_OPTIONS=%-15s\n" "$NB_PATTERN_FILES" "\"$BUILD_OPTIONS\"" - printf " LOG_PATTERN=%-15s EXPERIMENTAL=%-15s\n\n\n" "$LOG_PATTERN" "$EXPERIMENTAL" - fi - done -} - -function command_options_usage { - - local -A HELP_MSG - HELP_MSG["jn"]=" Specify the name of the Jenkins job." - HELP_MSG["id"]=" Specify the build ID of the Jenkins job." - HELP_MSG["ws"]=" Specify the workspace" - HELP_MSG["var"]=" Specify the variant to build." - HELP_MSG["k"]=" Keep the VM alive after the build." - HELP_MSG["D"]=" Run as daemon" - HELP_MSG["gu"]=" Specify the URL of the GIT Repository." - HELP_MSG["pu"]=" trigger a push action from the Jenkins job to the specified url, \"--trigger pu\" can also be used" - HELP_MSG["mr"]=" trigger a merge request action from the Jenkins job, \"--trigger mr\" can also be used" - HELP_MSG["sb"]=" Specify the source branch of the merge request." - HELP_MSG["sc"]=" Specify the source commit ID (SHA-1) of the merge request." - HELP_MSG["tb"]=" Specify the target branch of the merge request (usually develop)." - HELP_MSG["tc"]=" Specify the target commit ID (SHA-1) of the merge request." - HELP_MSG["br"]=" Specify the branch of the push event." - HELP_MSG["co"]=" Specify the commit ID (SHA-1) of the push event." - HELP_MSG["epc"]=" (two arguments) Specify the ip addresses of an external EPC, on respectively the core network and the UEs network" - HELP_MSG["sim"]=" Specify the path to the sim file, used to emulate the oai UE sim card " - for (( m=0 ; m<2 ; m++ )) - do - if [[ $m -eq 0 || ( $m > 0 && ${MANDATORY_OPTMASK[$m]} > 0 ) ]] - then - echo "Mandatory Options ($((m+1))):" - echo "---------------------" - for (( i=0 ; i<${#SHORT_OPTIONS[@]} ; i++ )) - do - if [ $(( MANDATORY_OPTMASK[$m] & $(( 2**$i )) )) -ne 0 ] - then - if [ "${LONG_OPTIONS[$i]}" != "" ] - then - local ARGPATTERN - if [[ !("${HELP_MSG[${SHORT_OPTIONS[$i]}]}" =~ "Specify") ]] - then - ARGPATTERN="" - elif [[ "${HELP_MSG[${SHORT_OPTIONS[$i]}]}" =~ "(two arguments)" ]] - then - ARGPATTERN="#### ####" - else - ARGPATTERN="####" - fi - printf " %s %s OR " "--${LONG_OPTIONS[$i]}" "$ARGPATTERN" - fi - printf "%s %s \n" "-${SHORT_OPTIONS[$i]}" "$ARGPATTERN" - printf " %s\n\n" "${HELP_MSG[${SHORT_OPTIONS[$i]}]}" - fi - done - fi - done - echo "Options:" - echo "--------" - - for (( i=0 ; i<${#SHORT_OPTIONS[@]} ; i++ )) - do - if [ $(( ALLOWED_OPTMASK & $(( 2**$i )) )) -ne 0 ] - then - if [ "${LONG_OPTIONS[$i]}" != "" ] - then - printf " %s #### OR " "--${LONG_OPTIONS[$i]}" - fi - printf "%s #### \n" "-${SHORT_OPTIONS[$i]}" - printf " %s\n\n" "${HELP_MSG[${SHORT_OPTIONS[$i]}]}" - fi - done - - for (( i=0 ; i<${#SHORT_OPTIONS[@]} ; i++ )) - do - if [ $(( ALLOWED_OPTMASK & $(( 2**$i )) )) -ne 0 ] - then - if [ "$(type -t ${LONG_OPTIONS[$i]}_usage)" = 'function' ] - then - ${LONG_OPTIONS[$i]}_usage - fi - fi - done - echo " --help OR -h" - echo " Print this help message." - echo "" -} - -# function to set specific behavior depending on the TESTPLATFORM_OWNER variable -# which may be set by a jenkins server for exemple -function platform_set { - if [ "$TESTPLATFORM_OWNER" != "" ] - then - echo "Running on $TESTPLATFORM_OWNER platform" - if [ -x "/usr/local/bin/oai_${TESTPLATFORM_OWNER}_setenv.sh" ] - then - . /usr/local/bin/oai_${TESTPLATFORM_OWNER}_setenv.sh - fi - fi -} - -function setvar_usage { - declare -A HELP_VAR - HELP_VAR["VM_OSREL"]="OS release to use in virtual machines" - HELP_VAR["RUN_EXPERIMENTAL"]="Enforce execution of variants with EXPERIMENTAL variable set to \"true\"" - HELP_VAR["OPTIONAL_APTCACHER"]="build and Run tests will fail if apt-cacher not installed and this variable not set to \"true\"" - HELP_VAR["TESTPLATFORM_OWNER"]="Allow pipeline customization via execution of an externel scripts residing on the jenkins server" - echo "--setvar_ where varname is one of:" - for i in ${AUTHORIZED_VAR[@]}; do printf "%20s : %s\n" "$i" "${HELP_VAR[$i]}" ;done -} - -# functions variant__v__ are used to define build or test variants -# The only thing to do to define a new variant is to add a function which name -# match this template. Note that "_" character in function part -# will be replaced by "-" character in build_variant_arrays function, this is -# for compatibility reasons - -function variant__v1__enb_usrp { - NB_PATTERN_FILES=7 - BUILD_OPTIONS="--eNB -w USRP --mu" - VM_MEMORY=3072 -} - -function variant__v2__basic_sim { - NB_PATTERN_FILES=11 - BUILD_OPTIONS="--eNB --UE --noavx512" - VM_MEMORY=8192 - RUN_OPTIONS="complex" -} - -function variant__v3__phy_sim { - NB_PATTERN_FILES=11 - BUILD_OPTIONS="--phy_simulators" - VM_MEMORY=8192 - VM_DISK=20 - RUN_OPTIONS="./run_exec_autotests.bash -g \"01510* 015111 015112\" -q -np -b" -} - -function variant__v4__cppcheck { - VM_MEMORY=4096 - LOG_PATTERN=cppcheck.xml - NB_PATTERN_FILES=1 - BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2 -i openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c --suppressions-list=ci-scripts/cppcheck_suppressions.list -I common/utils -I openair3/NAS/COMMON/UTIL -j4" -} - -function variant__v5__gnb_usrp { - VM_MEMORY=10240 - VM_CPU=8 - NB_PATTERN_FILES=6 - BUILD_OPTIONS="--gNB -w USRP --noavx512" -} - -function variant__v6__nr_ue_usrp { - VM_MEMORY=4096 - VM_CPU=4 - NB_PATTERN_FILES=6 - BUILD_OPTIONS="--nrUE -w USRP --noavx512" -} - -function variant__v7__enb_ethernet { - VM_MEMORY=4096 - ARCHIVES_LOC=enb_eth - NB_PATTERN_FILES=6 - BUILD_OPTIONS="--eNB -w USRP --noavx512" -} - -function variant__v8__ue_ethernet { - VM_MEMORY=4096 - ARCHIVES_LOC=ue_eth - NB_PATTERN_FILES=10 - BUILD_OPTIONS="--UE -w USRP --noavx512" -} - -function variant__v10__flexran_rtc { - ARCHIVES_LOC=flexran - NB_PATTERN_FILES=1 - BUILD_OPTIONS="cmake .. && make -j2" - VARIANT_INFO="non-OSA" -} - -function variant__v20__l1_sim { - ARCHIVES_LOC=l1_sim - RUN_OPTIONS="complex" - EXPERIMENTAL="true" -} - -function variant__v21__rf_sim { - ARCHIVES_LOC=rf_sim - RUN_OPTIONS="complex" -} - -function variant__v22__l2_sim { - RUN_OPTIONS="complex" -} - -function variant__v23__rf5g_sim { - ARCHIVES_LOC=rf5g_sim - RUN_OPTIONS="complex" -} - -# Following function lists all variant__v__ functions -# and set the VARIANTS_SHORT and VARIANTS_LONG arrays from -# the function names -function build_variant_arrays { - VARIANTS=`declare -F` - VARIANTS=${VARIANTS//"declare -f "} - for i in $VARIANTS - do - if [ `expr match "$i" 'variant__v'` -eq 10 ] - then - IDX1=`expr match "$i" 'variant__v[0-9]\+__'` - VARIANTS_SHORT+=(${i:9:$((IDX1-11))}) - LONGNAME=${i:$IDX1} - VARIANTS_LONG+=(${LONGNAME//"_"/"-"}) - fi - done -} - -# check that the passed argument is a valid variant, set -# default values for variant related variables and then execute -# the corresponding variant__v__ function -function check_set_variant { - for (( i=0 ; i<${#VARIANTS_SHORT[@]} ; i++ )) - do - if [ "$1" = "${VARIANTS_SHORT[$i]}" ] || [ "$1" = "${VARIANTS_LONG[$i]}" ] - then - VM_NAME=ci-${VARIANTS_LONG[$i]} - LOG_PATTERN=.txt - ARCHIVES_LOC=${VARIANTS_LONG[$i]//"-"/"_"} - VM_MEMORY=2048 - VM_CPU=4 - VM_DISK=10 - EXPERIMENTAL="" - NBARGS=$[$NBARGS+$VARIANT_OPTID] - variant__${VARIANTS_SHORT[$i]}__${VARIANTS_LONG[$i]//"-"/"_"} - return 0 - fi - done - echo "$1" is not a valid variant - variant_usage - exit 1 - -} - -function check_command_options { - GIVEN_OPTIONS=$1 - declare -a MANDATORY_OPTIONS=("${!2}") - if [ ${MANDATORY_OPTIONS[1]} -eq 0 ] - then - MANDATORY_OPTIONS[1]=${MANDATORY_OPTIONS[0]} - fi - OPTIONAL_OPTIONS=$3 - if [ $(($GIVEN_OPTIONS & ${MANDATORY_OPTIONS[0]} )) -ne ${MANDATORY_OPTIONS[0]} ] && [ $(($GIVEN_OPTIONS & ${MANDATORY_OPTIONS[1]} )) -ne ${MANDATORY_OPTIONS[1]} ] - then - echo "Syntax Error: missing option(s) for $4 command" - ${4//-/_}_usage - exit 1 - fi - - if [ $(( $(($GIVEN_OPTIONS ^ ${MANDATORY_OPTIONS[0]})) | $OPTIONAL_OPTIONS )) -ne $(( $OPTIONAL_OPTIONS )) ] && [ $(( $(($GIVEN_OPTIONS ^ ${MANDATORY_OPTIONS[1]})) | $OPTIONAL_OPTIONS )) -ne $(( $OPTIONAL_OPTIONS )) ] - then - echo "Syntax Error: unknown option(s) for $4 command" - ${4//-/_}_usage - exit 1 - fi -} - -function check_ipv4addr { - local ipaddr=$1 - local stat=1 - - if [[ $ipaddr =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3} ]] - then - OIFS=$IFS - IFS='.' - ipaddr=($ipaddr) - IFS=$OIFS - [[ ${ipaddr[0]} -le 255 && ${ipaddr[1]} -le 255 \ - && ${ipaddr[2]} -le 255 && ${ipaddr[3]} -le 255 ]] - stat=$? - fi - if [ $stat -ne 0 ] - then - echo $ipaddr " is not a valid ip V4 address" - exit 1 - fi -} - -function check_setvar { - for i in ${AUTHORIZED_VAR[@]} - do - if [ "$1" = "$i" ] - then - echo "Setting $1 to $2..." - export "$1"="$2" - return 0 - fi - done - echo " $1 is not a variable you can set" - setvar_usage - exit 1 -} - -platform_set -MY_DIR=$(dirname $(readlink -f $0)) -. $MY_DIR/createVM.sh -. $MY_DIR/buildOnVM.sh -. $MY_DIR/waitBuildOnVM.sh -. $MY_DIR/destroyAllRunningVM.sh -. $MY_DIR/runTestOnVM.sh -. $MY_DIR/reportBuildLocally.sh -. $MY_DIR/reportTestLocally.sh - - -if [ $# -lt 1 ] -then - echo "Syntax Error: too few arguments" - echo "" - top_usage - exit 1 -fi - -VM_TEMPLATE=ci- - - -# look for ASN1 release in cmake directives -# It will be the release used when building -ASN1VEROPT=( `grep "set (RRC_ASN1_VERSION" CMakeLists.txt` ) -ASN1VER=${ASN1VEROPT[2]//\"} -ASN1VER=${ASN1VER//)} -unset ASN1VEROPT - -# variable to identify and store the command (build, create ...) -# command index in the COMMAND and COMMANDS_NAME arrays -HELP_CMD=0 -CREATE_CMD=1 -BUILD_CMD=2 -WAIT_CMD=3 -DESTROY_CMD=4 -TEST_CMD=5 -REPORT_BUILD_CMD=6 -REPORT_TEST_CMD=7 - -COMMANDS_NAME=(help create build wait destroy test report-build report-test) - -#COMMAND will be used to save the command entered as argument -declare -A COMMAND -for i in "${COMMANDS_NAME[@]}" -do - COMMAND[$i]=0 -done - -# build the variant arrays -declare -a VARIANTS_SHORT -declare -a VARIANTS_LONG -build_variant_arrays - -#variables to process options, for each option we define a variable to store -# its value and a bit mask, used to check allowed options depending on -# the command - -# The two following arrays must be consistent: a given index must point to the long and short options -# of a given command -SHORT_OPTIONS=( "jn" "id" "ws" "k" "D" "gu" "pu" "mr" "var" "notused" "sb" "sc" "tb" "tc" "br" "co" "epc" "sim") -LONG_OPTIONS=( "job-name" "build-id" "workspace" "keep-vm-alive" "daemon" "git-url" "push" "merge-request" - "variant" "notused" "src-branch" "src-commit" "target-branch" "target-commit" "branch" "commit" - "external-epc" "sim-file") - -JOB_NAME=XX -JOB_NAME_OPTINDEX=0 -JOB_NAME_OPTID=1 - -BUILD_ID=XX -BUILD_ID_OPTINDEX=1 -BUILD_ID_OPTID=2 - -JENKINS_WKSP_OPTINDEX=2 -JENKINS_WKSP_OPTID=4 - -KEEP_VM_ALIVE_OPTINDEX=3 -KEEP_VM_ALIVE_OPTID=8 -KEEP_VM_ALIVE=0 - -DAEMON_OPTINDEX=4 -DAEMON_OPTID=$((2**4)) -DAEMON=0 - -GITURL_OPTINDEX=5 -GITURL_OPTID=$((2**5)) - -PU_OPTINDEX=6 -PU_OPTID=$((2**6)) -PU_TRIG=0 - -MR_OPTINDEX=7 -MR_OPTID=$((2**7)) -MR_TRIG=0 - -VARIANT_OPTINDEX=8 -VARIANT_OPTID=$((2**8)) - -SB_OPTINDEX=10 -SB_OPTID=$((2**10)) - -SC_OPTINDEX=11 -SC_OPTID=$((2**11)) - -TB_OPTINDEX=12 -TB_OPTID=$((2**12)) - -TC_OPTINDEX=13 -TC_OPTID=$((2**13)) - -BR_OPTINDEX=14 -BR_OPTID=$((2**14)) - -CO_OPTINDEX=15 -CO_OPTID=$((2**15)) - -EPC_IPADDR_OPTINDEX=16 -EPC_IPADDR_OPTID=$((2**16)) -EPC_IPADDR="" - -SIM_OPTINDEX=17 -SIM_OPTID=$((2**17)) -SIMFILE="" - -RUN_OPTIONS="none" - - -# list of variables that can be set via the --setvar option -AUTHORIZED_VAR=("VM_OSREL RUN_EXPERIMENTAL OPTIONAL_APTCACHER TESTPLATFORM_OWNER") - - -#variables to set which OS VM should use -#if [ -f "/etc/os-release" ] -#then -# source /etc/os-release -# VM_OS="$NAME" -# VM_OSREL="$VERSION_CODENAME" -# VM_ARCHI=`uname -m` -#else - VM_OS="ubuntu" - VM_OSREL="xenial" - VM_ARCHI="x86_64" -#fi - - -# variant option, ie the test variant which will be run triggers the -# variables listed below, used to configure the VM and to define what this -# VM will do. The variant can be specified by the --variant option or by a -# -V option. -VM_NAME="" -VM_MEMORY=0 -VM_DISK=0 -VM_CPU=0 -ARCHIVES_LOC="" -LOG_PATTERN="" -NB_PATTERN_FILES=0 -BUILD_OPTIONS="" -RUN_OPTIONS="" - - - -# NARGS is used to check that only valid options are used for the given command -# It is a bit mask, each bit set to 1 specifies the corresponding option -# has been entered on the command line. MANDATORY_OPTMASK and ALLOWED_OPTMASK define -# respectively the mandatory and optional parameters of the entered command -NBARGS=0 -MANDATORY_OPTMASK=(0 0) # some command have two sets of mandatory options -ALLOWED_OPTMASK=0 - -while [[ $# -gt 0 ]] -do -key="$1" - -if [ "$(type -t $funcname)" != 'function' ]; then - funcname=do_it_normal -fi -case $key in - --debug) - set -v - set -x - shift - ;; - -h|--help|help) - COMMAND["help"]=1 - # following word might specify the topic for the help request - # but help can also be used without argument, so don't shift - if [ "$2" != "" ] && [ "$(type -t ${2//-/_}_usage)" = 'function' ] - then - HELPCMD="${2//-/_}_usage full" - fi - shift - ;; - create) - COMMAND[$key]=1 - # For create, mandatory options: jn, id. Optional: variant - MANDATORY_OPTMASK[0]=$(($JOB_NAME_OPTID + $BUILD_ID_OPTID )) - ALLOWED_OPTMASK=$(($VARIANT_OPTID)) - # It is implied to keep the VM when creating it - KEEP_VM_ALIVE=1 - shift - ;; - build) - COMMAND[$key]=1 - # For build, mandatory options: jn, id, ws. Optional: variant, k, D - MANDATORY_OPTMASK[0]=$(($JOB_NAME_OPTID + $BUILD_ID_OPTID + $JENKINS_WKSP_OPTID)) - ALLOWED_OPTMASK=$(($KEEP_VM_ALIVE_OPTID + $DAEMON_OPTID + $VARIANT_OPTID)) - shift - ;; - wait) - # For test, mandatory options: jn, id, ws. Optional: variant, k - COMMAND[$key]=1 - MANDATORY_OPTMASK[0]=$(($JOB_NAME_OPTID + $BUILD_ID_OPTID + $JENKINS_WKSP_OPTID)) - ALLOWED_OPTMASK=$(($KEEP_VM_ALIVE_OPTID + $VARIANT_OPTID)) - shift - ;; - test) - COMMAND[$key]=1 - # For test, mandatory options: jn, id, ws. Optional: variant, k, epc - MANDATORY_OPTMASK[0]=$(($JOB_NAME_OPTID + $BUILD_ID_OPTID + $JENKINS_WKSP_OPTID)) - ALLOWED_OPTMASK=$(($KEEP_VM_ALIVE_OPTID + $VARIANT_OPTID + $EPC_IPADDR_OPTID + $SIM_OPTID)) - shift - ;; - destroy) - COMMAND[$key]=1 - # For destroy, mandatory options: jn, id. - MANDATORY_OPTMASK[0]=$(($JOB_NAME_OPTID + $BUILD_ID_OPTID)) - shift - ;; - report-build) - COMMAND[$key]=1 - # For report-build, mandatory options: jn, id, ws, gu, pu, br,co. - # or: jn, id, ws, gu, mr, sb, sc, tb, tc. - MANDATORY_OPTMASK[0]=$(($JOB_NAME_OPTID + $BUILD_ID_OPTID + $JENKINS_WKSP_OPTID + $GITURL_OPTID + $PU_OPTID + $BR_OPTID + $CO_OPTID)) - MANDATORY_OPTMASK[1]=$(($JOB_NAME_OPTID + $BUILD_ID_OPTID + $JENKINS_WKSP_OPTID + $GITURL_OPTID + $MR_OPTID + $SB_OPTID + $SC_OPTID)) - MANDATORY_OPTMASK[1]=$(( ${MANDATORY_OPTMASK[1]} + $TB_OPTID + $TC_OPTID)) - shift - ;; - report-test) - COMMAND[$key]=1 - # For report-test, mandatory options: jn, id, ws, gu, pu, br,co. - # or: jn, id, ws, gu, mr, sb, sc, tb, tc. - MANDATORY_OPTMASK[0]=$(($JOB_NAME_OPTID + $BUILD_ID_OPTID + $JENKINS_WKSP_OPTID)) - MANDATORY_OPTMASK[0]=$((${MANDATORY_OPTMASK[0]} + $GITURL_OPTID + $PU_OPTID + $BR_OPTID + $CO_OPTID)) - MANDATORY_OPTMASK[1]=$(($JOB_NAME_OPTID + $BUILD_ID_OPTID + $JENKINS_WKSP_OPTID)) - MANDATORY_OPTMASK[1]=$((${MANDATORY_OPTMASK[1]} + GITURL_OPTID + $MR_OPTID + $SB_OPTID + $SC_OPTID)) - MANDATORY_OPTMASK[1]=$((${MANDATORY_OPTMASK[1]} + $TB_OPTID + $TC_OPTID)) - shift - ;; - -jn|--job-name) - JOB_NAME="$2" - NBARGS=$[$NBARGS+$JOB_NAME_OPTID] - shift - shift - ;; - -id|--build-id) - BUILD_ID="$2" - NBARGS=$[$NBARGS+$BUILD_ID_OPTID] - shift - shift - ;; - -ws|--workspace) - JENKINS_WKSP="$2" - NBARGS=$[$NBARGS+$JENKINS_WKSP_OPTID] - shift - shift - ;; - -k|--keep-vm-alive) - KEEP_VM_ALIVE=1 - NBARGS=$[$NBARGS+$KEEP_VM_ALIVE_OPTID] - shift - ;; - -D|--daemon) - DAEMON=1 - NBARGS=$[$NBARGS+$DAEMON_OPTID] - shift - ;; - -gu|--git-url) - GIT_URL="$2" - NBARGS=$[$NBARGS+$GITURL_OPTID] - shift - shift - ;; - --trigger) - TRIG="$2" - case $TRIG in - merge-request) - MR_TRIG=1 - NBARGS=$[$NBARGS+$MR_OPTID] - ;; - push) - PU_TRIG=1 - NBARGS=$[$NBARGS+$PU_OPTID] - ;; - *) - echo "" - echo "Syntax Error: Invalid Trigger option -> $TRIG" - echo "" - trigger_usage - exit - ;; - esac - shift - shift - ;; - -mr|--merge-request) - MR_TRIG=1 - NBARGS=$[$NBARGS+$MR_OPTID] - shift - ;; - -pu|--push) - PU_TRIG=1 - NBARGS=$[$NBARGS+$PU_OPTID] - shift - ;; - -sb|--src-branch) - SOURCE_BRANCH="$2" - NBARGS=$[$NBARGS+$SB_OPTID] - shift - shift - ;; - -sc|--src-commit) - SOURCE_COMMIT_ID="$2" - NBARGS=$[$NBARGS+$SC_OPTID] - shift - shift - ;; - -tb|--target-branch) - TARGET_BRANCH="$2" - NBARGS=$[$NBARGS+$TB_OPTID] - shift - shift - ;; - -tc|--target-commit) - TARGET_COMMIT_ID="$2" - NBARGS=$[$NBARGS+$TC_OPTID] - shift - shift - ;; - -br|--branch) - SOURCE_BRANCH="$2" - NBARGS=$[$NBARGS+$BR_OPTID] - shift - shift - ;; - -co|--commit) - SOURCE_COMMIT_ID="$2" - NBARGS=$[$NBARGS+$CO_OPTID] - shift - shift - ;; - -epc|--external-epc) - check_ipv4addr "$2" - check_ipv4addr "$3" - EPC_IPADDR="$2" - EPC_TUN_IPADDR="$3" - NBARGS=$[$NBARGS+$EPC_IPADDR_OPTID] - shift - shift - shift - ;; - -sim|--sim-file) - SIMFILE="$2" - NBARGS=$[$NBARGS+$SIM_OPTID] - shift - shift - ;; - --setvar_*) - check_setvar "${key:9}" "$2" - shift - shift - ;; - -v[0-9] | -v[0-9][0-9]) - check_set_variant ${key//"-"} - shift - ;; - -var|--variant) - variant="$2" - check_set_variant ${2} - shift - shift - ;; - *) - echo "Syntax Error: unknown option: $key" - echo "" - top_usage - exit 1 -esac -done - -i=0 -for (( COUNT=1 ; COUNT<${#COMMAND[@]} ; COUNT++ )) -do - if [ ${COMMAND[${COMMANDS_NAME[$COUNT]}]} -eq 1 ] - then - COMMAND_KEY[$i]=${COMMANDS_NAME[$COUNT]} - (( i++ )) - fi -done - -if [ ${COMMAND["help"]} -eq 1 ] -then - if [ ${#COMMAND_KEY[@]} -ne 1 ] && [ "$HELPCMD" == "" ] - then - top_usage - elif [ "$HELPCMD" != "" ] - then - $HELPCMD - else - ${COMMAND_KEY[0]//-/_}_usage - fi - exit 0 -else - if [ ${#COMMAND_KEY[@]} -gt 1 ] - then - echo "Syntax Error, too many commands: ${COMMAND_KEY[@]}" - top_usage - exit 1 - fi - - if [ -z "${COMMAND_KEY[0]}" ] - then - echo "Syntax Error: no command, specify one of: ${COMMANDS_NAME[@]}" - top_usage - exit 1 - fi - - check_command_options $NBARGS MANDATORY_OPTMASK[@] $ALLOWED_OPTMASK ${COMMAND_KEY[0]} -fi - -if [ ${COMMAND[${COMMANDS_NAME[$REPORT_BUILD_CMD]}]} -ne 1 ] && [ ${COMMAND[${COMMANDS_NAME[$REPORT_TEST_CMD]}]} -ne 1 ] -then - # Checking uvt-kvm is installed - UVT_KVM_PATH=`which uvt-kvm | grep -c uvt-kvm` - if [ $UVT_KVM_PATH -eq 0 ] - then - echo "Error: uvt-kvm is not installed" - top_usage - exit 1 - fi -fi - -if [ "$JOB_NAME" == "XX" ] || [ "$BUILD_ID" == "XX" ] -then - VM_TEMPLATE=ci- -else - VM_TEMPLATE=${JOB_NAME}-b${BUILD_ID}- -fi -# set default variant -if [ "$VM_NAME" = "" ] -then - check_set_variant "v1" -fi -VM_NAME=`echo $VM_NAME | sed -e "s#ci-#$VM_TEMPLATE#"` -VM_CMDS=${VM_NAME}_cmds.txt -ARCHIVES_LOC=${JENKINS_WKSP}/archives/${ARCHIVES_LOC} - -STATUS=0 -if [ ${COMMAND[${COMMANDS_NAME[$CREATE_CMD]}]} -eq 1 ] -then - if [[ "$BUILD_OPTIONS" = "" ]] - then - echo "$VM_NAME is not a build variant" - exit 0 - else - create_vm - fi -fi -if [ ${COMMAND[${COMMANDS_NAME[$BUILD_CMD]}]} -eq 1 ] -then - if [[ "$BUILD_OPTIONS" = "" ]] - then - echo " $VM_NAME is not a build variant" - exit 0 - else - build_on_vm - fi - if [ $DAEMON -eq 0 ] && [ $STATUS -eq 0 ] - then - check_on_vm_build - fi -fi -if [ ${COMMAND[${COMMANDS_NAME[$WAIT_CMD]}]} -eq 1 ] -then - if [[ "$BUILD_OPTIONS" = "" ]] - then - echo "$VM_NAME is not a build variant" - exit 0 - else - wait_on_vm_build - fi - if [ $STATUS -eq 0 ] - then - check_on_vm_build - fi -fi -if [ ${COMMAND[${COMMANDS_NAME[$TEST_CMD]}]} -eq 1 ] -then - # variant with EXPERIMENTAL variable set to true won't run and will be - # considered OK, except if --setvar_RUN_EXPERIMENTAL option has been set to true - if [ "$EXPERIMENTAL" = "true" ] && [ "$RUN_EXPERIMENTAL" != "true" ] - then - echo "Currently $VM_NAME Testing is not implemented / enabled" - echo "remove EXPERIMENTAL variable definition from this variant" - echo " or use option --setvar_RUN_EXPERIMENTAL=true to enforce testing it" - echo "STATUS seems OK" - exit $STATUS - fi - - ARCHIVES_LOC=${ARCHIVES_LOC}/test - run_test_on_vm -fi -if [ ${COMMAND[${COMMANDS_NAME[$DESTROY_CMD]}]} -eq 1 ] -then - destroy_vm -fi -if [ ${COMMAND[${COMMANDS_NAME[$REPORT_BUILD_CMD]}]} -eq 1 ] -then - report_build -fi -if [ ${COMMAND[${COMMANDS_NAME[$REPORT_TEST_CMD]}]} -eq 1 ] -then - report_test -fi - -# Did command pass or fail? -if [ $STATUS -eq 0 ] -then - echo "STATUS seems OK" -else - echo "STATUS failed?" -fi -exit $STATUS diff --git a/ci-scripts/reportBuildLocally.sh b/ci-scripts/reportBuildLocally.sh deleted file mode 100755 index 87a07d3d4a..0000000000 --- a/ci-scripts/reportBuildLocally.sh +++ /dev/null @@ -1,613 +0,0 @@ -#!/bin/bash -#/* -# * 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 -# */ - -function report_build_usage { - echo "OAI CI VM script" - echo " Original Author: Raphael Defosseux" - echo "" - echo "Usage:" - echo "------" - echo " oai-ci-vm-tool report-build [OPTIONS]" - echo "" - command_options_usage - -} - -function trigger_usage { - echo "OAI CI VM script" - echo " Original Author: Raphael Defosseux" - echo "" - echo " --trigger merge-request OR -mr" - echo " --trigger push OR -pu" - echo " Specify trigger action of the Jenkins job. Either a merge-request event or a push event." - echo "" -} - -function details_table { - echo "

$1

" >> $3 - - echo " " >> $3 - echo " " >> $3 - echo " " >> $3 - echo " " >> $3 - echo " " >> $3 - echo " " >> $3 - echo " " >> $3 - - LIST_MESSAGES=`egrep "error:|warning:" $2 | egrep -v "jobserver unavailable|Clock skew detected.|disabling jobserver mode"` - COMPLETE_MESSAGE="start" - for MESSAGE in $LIST_MESSAGES - do - if [[ $MESSAGE == *"/home/ubuntu/tmp"* ]] || [[ $MESSAGE == *"/tmp/CI-eNB"* ]] - then - FILENAME=`echo $MESSAGE | sed -e "s#^/home/ubuntu/tmp/##" -e "s#^.*/tmp/CI-eNB/##" | awk -F ":" '{print $1}'` - LINENB=`echo $MESSAGE | awk -F ":" '{print $2}'` - if [ "$COMPLETE_MESSAGE" != "start" ] - then - COMPLETE_MESSAGE=`echo $COMPLETE_MESSAGE | sed -e "s#‘#'#g" -e "s#’#'#g"` - echo " " >> $3 - echo " " >> $3 - fi - echo " " >> $3 - echo " " >> $3 - echo " " >> $3 - else - if [[ $MESSAGE == *"warning:"* ]] || [[ $MESSAGE == *"error:"* ]] - then - MSGTYPE=`echo $MESSAGE | sed -e "s#:##g"` - echo " " >> $3 - COMPLETE_MESSAGE="" - else - COMPLETE_MESSAGE=$COMPLETE_MESSAGE" "$MESSAGE - fi - fi - done - - if [ "$COMPLETE_MESSAGE" != "start" ] - then - COMPLETE_MESSAGE=`echo $COMPLETE_MESSAGE | sed -e "s#‘#'#g" -e "s#’#'#g"` - echo " " >> $3 - echo " " >> $3 - fi - echo "
FileLine NumberStatusMessage
$COMPLETE_MESSAGE
$FILENAME$LINENB$MSGTYPE$COMPLETE_MESSAGE
" >> $3 -} - -function summary_table_header { - echo "

$1

" >> ./build_results.html - if [ -f $2/build_final_status.log ] - then - if [ `grep -c COMMAND $2/build_final_status.log` -eq 1 ] - then - COMMAND=`grep COMMAND $2/build_final_status.log | sed -e "s#COMMAND: ##"` - else - COMMAND="Unknown" - fi - if [ `grep -c BUILD_OK $2/build_final_status.log` -eq 1 ] - then - echo "
" >> ./build_results.html - echo " $COMMAND " >> ./build_results.html - echo " BUILD was SUCCESSFUL " >> ./build_results.html - echo "
" >> ./build_results.html - else - echo "
" >> ./build_results.html - echo " $COMMAND " >> ./build_results.html - echo " BUILD was a FAILURE! " >> ./build_results.html - echo "
" >> ./build_results.html - fi - else - echo "
" >> ./build_results.html - echo " COULD NOT DETERMINE BUILD FINAL STATUS! " >> ./build_results.html - echo "
" >> ./build_results.html - fi - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html -} - -function summary_table_row { - echo " " >> ./build_results.html - echo " " >> ./build_results.html -} - -function summary_table_footer { - echo "
ElementStatusNb ErrorsNb Warnings
$1" >> ./build_results.html - if [ -f $2 ] - then - BUILD_STATUS=`egrep -c "$3" $2` - if [ $BUILD_STATUS -eq 1 ] - then - echo " OK" >> ./build_results.html - else - echo " KO" >> ./build_results.html - fi - NB_ERRORS=`egrep -c "error:" $2` - if [ $NB_ERRORS -eq 0 ] - then - echo " $NB_ERRORS" >> ./build_results.html - else - echo " $NB_ERRORS" >> ./build_results.html - fi - NB_WARNINGS=`egrep "warning:" $2 | egrep -v "jobserver unavailable|Clock skew detected.|disabling jobserver mode" | egrep -c "warning:"` - if [ $NB_WARNINGS -eq 0 ] - then - echo " $NB_WARNINGS" >> ./build_results.html - else - if [ $NB_WARNINGS -gt 20 ] - then - echo " $NB_WARNINGS" >> ./build_results.html - else - echo " $NB_WARNINGS" >> ./build_results.html - fi - fi - if [ $NB_ERRORS -ne 0 ] || [ $NB_WARNINGS -ne 0 ] - then - details_table "$1" $2 $4 - fi - else - echo " Unknown" >> ./build_results.html - echo " --" >> ./build_results.html - echo " --" >> ./build_results.html - fi - echo "
" >> ./build_results.html -} - -function sca_summary_table_header { - echo "

$2

" >> ./build_results.html - NB_ERRORS=`egrep -c "severity=\"error\"" $1` - NB_WARNINGS=`egrep -c "severity=\"warning\"" $1` - ADDED_ERRORS="0" - ADDED_WARNINGS="0" - FINAL_LOG=`echo $1 | sed -e "s#cppcheck\.xml#build_final_status.log#"` - if [ `grep -c COMMAND $FINAL_LOG` -eq 1 ] - then - COMMAND=`grep COMMAND $FINAL_LOG | sed -e "s#COMMAND: ##"` - else - COMMAND="Unknown" - fi - if [ $MR_TRIG -eq 1 ] - then - if [ -d ../../cppcheck_archives ] - then - if [ -d ../../cppcheck_archives/$JOB_NAME ] - then - ADDED_ERRORS=`diff $1 ../../cppcheck_archives/$JOB_NAME/cppcheck.xml | egrep --color=never "^<" | egrep -c "severity=\"error"` - ADDED_WARNINGS=`diff $1 ../../cppcheck_archives/$JOB_NAME/cppcheck.xml | egrep --color=never "^<" | egrep -c "severity=\"warning"` - fi - fi - local TOTAL_NUMBER=$[$ADDED_ERRORS+$ADDED_WARNINGS] - if [ -f $JENKINS_WKSP/oai_cppcheck_added_errors.txt ]; then rm -f $JENKINS_WKSP/oai_cppcheck_added_errors.txt; fi - echo "$TOTAL_NUMBER" > $JENKINS_WKSP/oai_cppcheck_added_errors.txt - fi - if [ $NB_ERRORS -eq 0 ] && [ $NB_WARNINGS -eq 0 ] - then - echo "
" >> ./build_results.html - echo " $COMMAND

" >> ./build_results.html - echo " CPPCHECK found NO error and NO warning " >> ./build_results.html - echo "
" >> ./build_results.html - else - if [ $NB_ERRORS -eq 0 ] - then - echo "
" >> ./build_results.html - echo " $COMMAND

" >> ./build_results.html - if [ $PU_TRIG -eq 1 ] - then - echo " CPPCHECK found NO error and $NB_WARNINGS warnings " >> ./build_results.html - fi - if [ $MR_TRIG -eq 1 ] - then - if [ $ADDED_WARNINGS -eq 0 ] - then - echo " CPPCHECK found NO error and $NB_WARNINGS warnings " >> ./build_results.html - else - echo " CPPCHECK found NO error and $NB_WARNINGS warnings " >> ./build_results.html - fi - fi - echo "
" >> ./build_results.html - else - echo "
" >> ./build_results.html - echo " $COMMAND

" >> ./build_results.html - if [ $PU_TRIG -eq 1 ] - then - echo " CPPCHECK found $NB_ERRORS errors and $NB_WARNINGS warnings " >> ./build_results.html - fi - if [ $MR_TRIG -eq 1 ] - then - if [ $ADDED_ERRORS -eq 0 ] && [ $ADDED_WARNINGS -eq 0 ] - then - echo " CPPCHECK found $NB_ERRORS errors and $NB_WARNINGS warnings " >> ./build_results.html - else - echo " CPPCHECK found $NB_ERRORS errors and $NB_WARNINGS warnings " >> ./build_results.html - echo "
" >> ./build_results.html - echo "
" >> ./build_results.html - echo " This Merge Request may have introduced up to $ADDED_ERRORS errors and $ADDED_WARNINGS warnings.
" >> ./build_results.html - fi - fi - echo "
" >> ./build_results.html - fi - fi - if [ $PU_TRIG -eq 1 ] - then - if [ -d ../../cppcheck_archives ] - then - if [ -d ../../cppcheck_archives/$JOB_NAME ] - then - cp $1 ../../cppcheck_archives/$JOB_NAME - fi - fi - fi - echo " " >> ./build_results.html - echo "
" >> ./build_results.html - echo "
" >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo "0" > ccp_error_cnt.txt -} - -function sca_summary_table_row { - echo " " >> ./build_results.html - echo " " >> ./build_results.html - if [ -f $1 ] - then - NB_ERRORS=`egrep "severity=\"error\"" $1 | egrep -c "id=\"$3\""` - echo " " >> ./build_results.html - echo " " >> ./build_results.html - if [ -f ccp_error_cnt.txt ] - then - TOTAL_ERRORS=`cat ccp_error_cnt.txt` - TOTAL_ERRORS=$((TOTAL_ERRORS + NB_ERRORS)) - echo $TOTAL_ERRORS > ccp_error_cnt.txt - fi - else - echo " " >> ./build_results.html - echo " " >> ./build_results.html - fi - echo " " >> ./build_results.html -} - -function sca_summary_table_footer { - if [ -f $1 ] - then - NB_ERRORS=`egrep -c "severity=\"error\"" $1` - NB_WARNINGS=`egrep -c "severity=\"warning\"" $1` - if [ -f ccp_error_cnt.txt ] - then - echo " " >> ./build_results.html - echo " " >> ./build_results.html - TOTAL_ERRORS=`cat ccp_error_cnt.txt` - TOTAL_ERRORS=$((NB_ERRORS - TOTAL_ERRORS)) - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - rm -f ccp_error_cnt.txt - fi - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - else - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - if [ -f ccp_error_cnt.txt ] - then - rm -f ccp_error_cnt.txt - fi - fi - echo " " >> ./build_results.html - echo "
Error / Warning TypeNb ErrorsNb Warnings
$2$NB_ERRORSN/AUnknownUnknown
Others$TOTAL_ERRORS$NB_WARNINGS
Total$NB_ERRORS$NB_WARNINGS
TotalUnknownUnknown
" >> ./build_results.html - echo "

Full details in zipped artifact (cppcheck/cppcheck.xml)

" >> ./build_results.html - echo "

Graphical Interface tool : cppcheck-gui -l cppcheck/cppcheck.xml

" >> ./build_results.html - - if [ $MR_TRIG -eq 1 ] - then - if [ $ADDED_ERRORS -ne 0 ] || [ $ADDED_WARNINGS -ne 0 ] - then - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - SEVERITY="none" - POTENTIAL_FILES=`diff $1 ../../cppcheck_archives/$JOB_NAME/cppcheck.xml | egrep --color=never "^<" | egrep "location file|severity" | sed -e "s# #@#g"` - for POT_FILE in $POTENTIAL_FILES - do - if [ `echo $POT_FILE | grep -c location` -eq 1 ] - then - FILENAME=`echo $POT_FILE | sed -e "s#^.*file=\"##" -e "s#\"@line.*/>##"` - LINE=`echo $POT_FILE | sed -e "s#^.*line=\"##" -e "s#\"/>##"` - if [[ $SEVERITY != *"none" ]] - then - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - fi - else - SEVERITY=`echo $POT_FILE | sed -e "s#^.*severity=\"##" -e "s#\"@msg=.*##"` - MESSAGE=`echo $POT_FILE | sed -e "s#^.*msg=\"##" -e "s#\"@verbose=.*##" -e "s#@# #g"` - fi - done - echo "
Potential File(s) impacted by added errors/warningsLine NumberSeverityMessage
$FILENAME$LINE$SEVERITY$MESSAGE
" >> ./build_results.html - fi - fi - echo "
" >> ./build_results.html -} - -function report_build { - echo "############################################################" - echo "OAI CI VM script" - echo "############################################################" - - echo "JENKINS_WKSP = $JENKINS_WKSP" - echo "GIT_URL = $GIT_URL" - - cd ${JENKINS_WKSP} - echo "" > ./build_results.html - echo "" >> ./build_results.html - echo "" >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " Build Results for $JOB_NAME job build #$BUILD_ID" >> ./build_results.html - echo " " >> ./build_results.html - echo "" >> ./build_results.html - echo "
" >> ./build_results.html - echo "
" >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo "
" >> ./build_results.html - echo " " >> ./build_results.html - echo " \"\"" >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " Job Summary -- Job: $JOB_NAME -- Build-ID: $BUILD_ID" >> ./build_results.html - echo "
" >> ./build_results.html - echo "
" >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - if [ $PU_TRIG -eq 1 ]; then echo " " >> ./build_results.html; fi - if [ $MR_TRIG -eq 1 ]; then echo " " >> ./build_results.html; fi - echo " " >> ./build_results.html - if [ $PU_TRIG -eq 1 ] - then - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - if [ -e .git/CI_COMMIT_MSG ] - then - echo " " >> ./build_results.html - echo " " >> ./build_results.html - MSG=`cat .git/CI_COMMIT_MSG` - echo " " >> ./build_results.html - echo " " >> ./build_results.html - fi - fi - if [ $MR_TRIG -eq 1 ] - then - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - if [ -e .git/CI_COMMIT_MSG ] - then - echo " " >> ./build_results.html - echo " " >> ./build_results.html - MSG=`cat .git/CI_COMMIT_MSG` - echo " " >> ./build_results.html - echo " " >> ./build_results.html - fi - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - fi - echo "
Build Start Time (UTC)TEMPLATE_BUILD_TIME
GIT Repository$GIT_URL
Job TriggerPush EventMerge-Request
Branch$SOURCE_BRANCH
Commit ID$SOURCE_COMMIT_ID
Commit Message$MSG
Source Branch$SOURCE_BRANCH
Source Commit ID$SOURCE_COMMIT_ID
Source Commit Message$MSG
Target Branch$TARGET_BRANCH
Target Commit ID$TARGET_COMMIT_ID
" >> ./build_results.html - echo "

Build Summary

" >> ./build_results.html - - echo "

OAI Coding / Formatting Guidelines Check

" >> ./build_results.html - if [ -f ./header-files-w-incorrect-define.txt ] - then - NB_FILES_IN_ERROR=`wc -l ./header-files-w-incorrect-define.txt | sed -e "s@ .*@@"` - if [ $NB_FILES_IN_ERROR -eq 0 ] - then - echo "
" >> ./build_results.html - if [ $MR_TRIG -eq 1 ]; then echo " No Issue for CIRCULAR DEPENDENCY PROTECTION in modified files" >> ./build_results.html; fi - if [ $PU_TRIG -eq 1 ]; then echo " No Issue for CIRCULAR DEPENDENCY PROTECTION in the whole repository" >> ./build_results.html; fi - echo "
" >> ./build_results.html - else - echo "
" >> ./build_results.html - if [ $MR_TRIG -eq 1 ]; then echo " ${NB_FILES_IN_ERROR} modified files MAY NOT HAVE CIRCULAR DEPENDENCY PROTECTION" >> ./build_results.html; fi - if [ $PU_TRIG -eq 1 ]; then echo " ${NB_FILES_IN_ERROR} files in repository MAY NOT HAVE CIRCULAR DEPENDENCY PROTECTION in the whole repository" >> ./build_results.html; fi - echo "
" >> ./build_results.html - echo " " >> ./build_results.html - echo "
" >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - awk '{if($0 ~/error in/){print " "};if($0 ~/files with same/){print " "}}' ./header-files-w-incorrect-define.txt >> ./build_results.html - echo "
Potential IssueImpacted FileIncorrect Macro
error in declaration"$4""$5"
files with same #define"$5""$6"
" >> ./build_results.html - echo "
" >> ./build_results.html - echo "
" >> ./build_results.html - fi - fi - if [ -f ./files-w-gnu-gpl-license-banner.txt ] - then - NB_FILES_IN_ERROR=`wc -l ./files-w-gnu-gpl-license-banner.txt | sed -e "s@ .*@@"` - if [ $NB_FILES_IN_ERROR -ne 0 ] - then - echo "
" >> ./build_results.html - if [ $MR_TRIG -eq 1 ]; then echo " ${NB_FILES_IN_ERROR} modified files HAVE a GNU GPL license banner" >> ./build_results.html; fi - if [ $PU_TRIG -eq 1 ]; then echo " ${NB_FILES_IN_ERROR} files in repository HAVE a GNU GPL license banner" >> ./build_results.html; fi - echo "
" >> ./build_results.html - echo " " >> ./build_results.html - echo "
" >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - awk '{print " "}' ./files-w-gnu-gpl-license-banner.txt >> ./build_results.html - echo "
Filename
"$1"
" >> ./build_results.html - echo "
" >> ./build_results.html - echo "
" >> ./build_results.html - fi - fi - if [ -f ./files-w-suspect-banner.txt ] - then - NB_FILES_IN_ERROR=`wc -l ./files-w-suspect-banner.txt | sed -e "s@ .*@@"` - if [ $NB_FILES_IN_ERROR -ne 0 ] - then - echo "
" >> ./build_results.html - if [ $MR_TRIG -eq 1 ]; then echo " ${NB_FILES_IN_ERROR} modified files HAVE a suspect license banner" >> ./build_results.html; fi - if [ $PU_TRIG -eq 1 ]; then echo " ${NB_FILES_IN_ERROR} files in repository HAVE a suspect license banner" >> ./build_results.html; fi - echo "
" >> ./build_results.html - echo " " >> ./build_results.html - echo "
" >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html - awk '{print " "}' ././files-w-suspect-banner.txt >> ./build_results.html - echo "
Filename
"$1"
" >> ./build_results.html - echo "
" >> ./build_results.html - echo "
" >> ./build_results.html - fi - fi - - echo "

Ubuntu 16.04 LTS -- Summary

" >> ./build_results.html - - if [ -f archives/gnb_usrp/nr-softmodem.txt ] - then - summary_table_header "OAI Build: 5G NR gNB -- USRP option" ./archives/gnb_usrp - summary_table_row "5G NR SoftModem" ./archives/gnb_usrp/nr-softmodem.txt "Built target nr-softmodem" ./gnb_usrp_row1.html - summary_table_row "Coding" ./archives/gnb_usrp/coding.txt "Built target coding" ./gnb_usrp_row2.html - summary_table_row "OAI USRP device if" ./archives/gnb_usrp/oai_usrpdevif.txt "Built target oai_usrpdevif" ./gnb_usrp_row3.html - summary_table_row "OAI ETHERNET transport" ./archives/gnb_usrp/oai_eth_transpro.txt "Built target oai_eth_transpro" ./gnb_usrp_row4.html - summary_table_row "Parameters Lib Config" ./archives/gnb_usrp/params_libconfig.txt "Built target params_libconfig" ./gnb_usrp_row6.html - summary_table_footer - fi - - if [ -f archives/nr_ue_usrp/nr-uesoftmodem.txt ] - then - summary_table_header "OAI Build: 5G NR UE -- USRP option" ./archives/nr_ue_usrp - summary_table_row "5G NR UE SoftModem" ./archives/nr_ue_usrp/nr-uesoftmodem.txt "Built target nr-uesoftmodem" ./nr_ue_usrp_row1.html - summary_table_row "Coding" ./archives/nr_ue_usrp/coding.txt "Built target coding" ./nr_ue_usrp_row2.html - summary_table_row "OAI USRP device if" ./archives/nr_ue_usrp/oai_usrpdevif.txt "Built target oai_usrpdevif" ./nr_ue_usrp_row3.html - summary_table_row "OAI ETHERNET transport" ./archives/nr_ue_usrp/oai_eth_transpro.txt "Built target oai_eth_transpro" ./nr_ue_usrp_row4.html - summary_table_row "Parameters Lib Config" ./archives/nr_ue_usrp/params_libconfig.txt "Built target params_libconfig" ./nr_ue_usrp_row6.html - summary_table_footer - fi - - if [ -e ./archives/red_hat ] - then - echo "

Red Hat Enterprise Linux Server release 7.6) -- Summary

" >> ./build_results.html - - summary_table_header "OAI Build: 4G LTE eNB -- USRP option (RHEL)" ./archives/red_hat - summary_table_row "LTE SoftModem" ./archives/red_hat/lte-softmodem.txt "Built target lte-softmodem" ./enb_usrp_rh_row1.html - summary_table_row "Coding" ./archives/red_hat/coding.txt "Built target coding" ./enb_usrp_rh_row2.html - summary_table_row "OAI USRP device if" ./archives/red_hat/oai_usrpdevif.txt "Built target oai_usrpdevif" ./enb_usrp_rh_row3.html - summary_table_row "Parameters Lib Config" ./archives/red_hat/params_libconfig.txt "Built target params_libconfig" ./enb_usrp_rh_row4.html - summary_table_footer - fi - - echo "

Details

" >> ./build_results.html - echo " " >> ./build_results.html - echo "
" >> ./build_results.html - - if [ -f ./enb_eth_row1.html ] || [ -f ./enb_eth_row2.html ] || [ -f ./enb_eth_row3.html ] || [ -f ./enb_eth_row4.html ] || [ -f ./enb_eth_row5.html ] || [ -f ./enb_eth_row6.html ] || [ -f ./enb_eth_row7.html ] - then - for DETAILS_TABLE in `ls ./enb_eth_row*.html` - do - cat $DETAILS_TABLE >> ./build_results.html - done - fi - if [ -f ./ue_eth_row1.html ] || [ -f ./ue_eth_row2.html ] || [ -f ./ue_eth_row3.html ] || [ -f ./ue_eth_row4.html ] || [ -f ./ue_eth_row5.html ] || [ -f ./ue_eth_row6.html ] || [ -f ./ue_eth_row7.html ] || [ -f ./ue_eth_row8.html ] || [ -f ./ue_eth_row9.html ] || [ -f ./ue_eth_row9a.html ] || [ -f ./ue_eth_row9b.html ] - then - for DETAILS_TABLE in `ls ./ue_eth_row*.html` - do - cat $DETAILS_TABLE >> ./build_results.html - done - fi - if [ -f ./gnb_usrp_row1.html ] || [ -f ./gnb_usrp_row2.html ] || [ -f ./gnb_usrp_row3.html ] || [ -f ./gnb_usrp_row4.html ] - then - for DETAILS_TABLE in `ls ./gnb_usrp_row*.html` - do - cat $DETAILS_TABLE >> ./build_results.html - done - fi - if [ -f ./nr_ue_usrp_row1.html ] || [ -f ./nr_ue_usrp_row2.html ] || [ -f ./nr_ue_usrp_row3.html ] || [ -f ./nr_ue_usrp_row4.html ] - then - for DETAILS_TABLE in `ls ./nr_ue_usrp_row*.html` - do - cat $DETAILS_TABLE >> ./build_results.html - done - fi - rm -f ./*_row*.html - - echo "
" >> ./build_results.html - echo "

" >> ./build_results.html - echo "
End of Build Report -- Copyright 2018 OpenAirInterface. All Rights Reserved.
" >> ./build_results.html - echo "
" >> ./build_results.html - echo "" >> ./build_results.html -} diff --git a/ci-scripts/reportTestLocally.sh b/ci-scripts/reportTestLocally.sh deleted file mode 100755 index f21c82830f..0000000000 --- a/ci-scripts/reportTestLocally.sh +++ /dev/null @@ -1,1000 +0,0 @@ -#!/bin/bash -#/* -# * 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 -# */ - -function report_test_usage { - echo "OAI CI VM script" - echo " Original Author: Raphael Defosseux" - echo "" - echo "Usage:" - echo "------" - echo " oai-ci-vm-tool report-test [OPTIONS]" - echo "" - command_options_usage -} - -function analyzePingFiles { - for PING_CASE in $PING_LOGS - do - echo " " >> ./test_simulator_results.html - NAME=`echo $PING_CASE | sed -e "s#$ARCHIVES_LOC/##"` - echo " $NAME" >> ./test_simulator_results.html - CMD=`egrep "COMMAND IS" $PING_CASE | sed -e "s#COMMAND IS: ##"` - echo " $CMD" >> ./test_simulator_results.html - FILE_COMPLETE=`egrep -c "ping statistics" $PING_CASE` - if [ $FILE_COMPLETE -eq 0 ] - then - echo " KO" >> ./test_simulator_results.html - echo " N/A" >> ./test_simulator_results.html - else - NB_TR_PACKETS=`egrep "packets transmitted" $PING_CASE | sed -e "s# packets transmitted.*##"` - NB_RC_PACKETS=`egrep "packets transmitted" $PING_CASE | sed -e "s#^.*packets transmitted, ##" -e "s# received,.*##"` - if [ $NB_TR_PACKETS -eq $NB_RC_PACKETS ] - then - echo " OK" >> ./test_simulator_results.html - else - echo " KO" >> ./test_simulator_results.html - fi - echo " " >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html
-            STATS=`egrep "packets transmitted" $PING_CASE | sed -e "s#^.*received, ##" -e "s#, time.*##" -e "s# packet loss##"`
-            echo "Packet Loss : $STATS" >> ./test_simulator_results.html
-            RTTMIN=`egrep "rtt min" $PING_CASE | awk '{split($4,a,"/"); print a[1] " " $5}'`
-            echo "RTT Minimal : $RTTMIN" >> ./test_simulator_results.html
-            RTTAVG=`egrep "rtt min" $PING_CASE | awk '{split($4,a,"/"); print a[2] " " $5}'`
-            echo "RTT Average : $RTTAVG" >> ./test_simulator_results.html
-            RTTMAX=`egrep "rtt min" $PING_CASE | awk '{split($4,a,"/"); print a[3] " " $5}'`
-            echo "RTT Maximal : $RTTMAX" >> ./test_simulator_results.html
-            echo "            
" >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - fi - echo " " >> ./test_simulator_results.html - done -} - -function analyzeIperfFiles { - for IPERF_CASE in $IPERF_TESTS - do - echo " " >> ./test_simulator_results.html - NAME=`echo $IPERF_CASE | sed -e "s#$ARCHIVES_LOC/##"` - echo " $NAME" >> ./test_simulator_results.html - CMD=`egrep "COMMAND IS" $IPERF_CASE | sed -e "s#COMMAND IS: ##"` - echo " $CMD" >> ./test_simulator_results.html - REQ_BITRATE=`echo $CMD | sed -e "s#^.*-b ##" -e "s#-i 1.*##"` - if [[ $REQ_BITRATE =~ .*K.* ]] - then - REQ_BITRATE=`echo $REQ_BITRATE | sed -e "s#K##"` - FLOAT_REQ_BITRATE=`echo "$REQ_BITRATE * 1000.0" | bc -l` - fi - if [[ $REQ_BITRATE =~ .*M.* ]] - then - REQ_BITRATE=`echo $REQ_BITRATE | sed -e "s#M##"` - FLOAT_REQ_BITRATE=`echo "$REQ_BITRATE * 1000000.0" | bc -l` - fi - if [[ $REQ_BITRATE =~ .*G.* ]] - then - REQ_BITRATE=`echo $REQ_BITRATE | sed -e "s#G##"` - FLOAT_REQ_BITRATE=`echo "$REQ_BITRATE * 1000000000.0" | bc -l` - fi - FILE_COMPLETE=`egrep -c "Server Report" $IPERF_CASE` - if [ $FILE_COMPLETE -eq 0 ] - then - SERVER_FILE=`echo $IPERF_CASE | sed -e "s#client#server#"` - FLOAT_EFF_BITRATE=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*Bytes *##" -e "s#sec *.*#sec#" | awk 'BEGIN{s=0;n=0}{n++;if ($2 ~/Mbits/){a = $1 * 1000000};if ($2 ~/Kbits/){a = $1 * 1000};s=s+a}END{br=s/n; printf "%.0f", br}'` - EFFECTIVE_BITRATE=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*Bytes *##" -e "s#sec *.*#sec#" | awk 'BEGIN{s=0;n=0}{n++;if ($2 ~/Mbits/){a = $1 * 1000000};if ($2 ~/Kbits/){a = $1 * 1000};s=s+a}END{br=s/n; if(br>1000000){printf "%.2f MBits/sec", br/1000000}else{printf "%.2f KBits/sec", br/1000}}'` - PERF=`echo "100 * $FLOAT_EFF_BITRATE / $FLOAT_REQ_BITRATE" | bc -l | awk '{printf "%.2f", $0}'` - PERF_INT=`echo "100 * $FLOAT_EFF_BITRATE / $FLOAT_REQ_BITRATE" | bc -l | awk '{printf "%.0f", $0}'` - JITTER=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*/sec *##" -e "s# *ms.*##" | awk 'BEGIN{s=0;n=0}{n++;s+=$1}END{jitter=s/n; printf "%.3f ms", jitter}'` - PACKETLOSS_NOSIGN=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*(##" -e "s#%.*##" | awk 'BEGIN{s=0;n=0}{n++;s+=$1}END{per=s/n; printf "%.1f", per}'` - PACKETLOSS=`echo "${PACKETLOSS_NOSIGN}%"` - if [[ $PERF_INT -lt 80 ]] - then - echo " KO" >> ./test_simulator_results.html - else - echo " OK" >> ./test_simulator_results.html - fi - else - EFFECTIVE_BITRATE=`tail -n3 $IPERF_CASE | egrep "bits/sec" | sed -e "s#^.*Bytes *##" -e "s#sec.*#sec#"` - if [[ $EFFECTIVE_BITRATE =~ .*Kbits/sec.* ]] - then - EFFECTIVE_BITRATE=`echo $EFFECTIVE_BITRATE | sed -e "s# *Kbits/sec.*##"` - FLOAT_EFF_BITRATE=`echo "$EFFECTIVE_BITRATE * 1000" | bc -l` - fi - if [[ $EFFECTIVE_BITRATE =~ .*Mbits/sec.* ]] - then - EFFECTIVE_BITRATE=`echo $EFFECTIVE_BITRATE | sed -e "s# *Mbits/sec.*##"` - FLOAT_EFF_BITRATE=`echo "$EFFECTIVE_BITRATE * 1000000" | bc -l` - fi - if [[ $EFFECTIVE_BITRATE =~ .*Gbits/sec.* ]] - then - EFFECTIVE_BITRATE=`echo $EFFECTIVE_BITRATE | sed -e "s# *Gbits/sec.*##"` - FLOAT_EFF_BITRATE=`echo "$EFFECTIVE_BITRATE * 1000000000" | bc -l` - fi - PERF=`echo "100 * $FLOAT_EFF_BITRATE / $FLOAT_REQ_BITRATE" | bc -l | awk '{printf "%.2f", $0}'` - PERF_INT=`echo "100 * $FLOAT_EFF_BITRATE / $FLOAT_REQ_BITRATE" | bc -l | awk '{printf "%.0f", $0}'` - if [[ $PERF_INT -lt 70 ]] - then - echo " KO" >> ./test_simulator_results.html - else - echo " OK" >> ./test_simulator_results.html - fi - EFFECTIVE_BITRATE=`tail -n3 $IPERF_CASE | egrep "bits/sec" | sed -e "s#^.*Bytes *##" -e "s#sec.*#sec#"` - JITTER=`tail -n3 $IPERF_CASE | egrep "bits/sec" | sed -e "s#^.*bits/sec *##" -e "s#ms.*#ms#"` - PACKETLOSS=`tail -n3 $IPERF_CASE | egrep "bits/sec" | sed -e "s#^.*(##" -e "s#).*##"` - fi - echo " " >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html
-        echo "Bitrate      : $EFFECTIVE_BITRATE" >> ./test_simulator_results.html
-        echo "Bitrate Perf : $PERF %" >> ./test_simulator_results.html
-        echo "Jitter       : $JITTER" >> ./test_simulator_results.html
-        echo "Packet Loss  : $PACKETLOSS" >> ./test_simulator_results.html
-        echo "            
" >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - done -} - -function report_test { - echo "############################################################" - echo "OAI CI VM script" - echo "############################################################" - - echo "JENKINS_WKSP = $JENKINS_WKSP" - - cd ${JENKINS_WKSP} - - echo "" > ./test_simulator_results.html - echo "" >> ./test_simulator_results.html - echo "" >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " Simulator Results for $JOB_NAME job build #$BUILD_ID" >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo "" >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " \"\"" >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " Job Summary -- Job: $JOB_NAME -- Build-ID: $BUILD_ID" >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - if [ $PU_TRIG -eq 1 ]; then echo " " >> ./test_simulator_results.html; fi - if [ $MR_TRIG -eq 1 ]; then echo " " >> ./test_simulator_results.html; fi - echo " " >> ./test_simulator_results.html - if [ $PU_TRIG -eq 1 ] - then - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - if [ -e .git/CI_COMMIT_MSG ] - then - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - MSG=`cat .git/CI_COMMIT_MSG` - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - fi - fi - if [ $MR_TRIG -eq 1 ] - then - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - if [ -e .git/CI_COMMIT_MSG ] - then - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - MSG=`cat .git/CI_COMMIT_MSG` - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - fi - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - fi - echo "
Build Start Time (UTC)TEMPLATE_BUILD_TIME
GIT Repository$GIT_URL
Job TriggerPush EventMerge-Request
Branch$SOURCE_BRANCH
Commit ID$SOURCE_COMMIT_ID
Commit Message$MSG
Source Branch$SOURCE_BRANCH
Source Commit ID$SOURCE_COMMIT_ID
Commit Message$MSG
Target Branch$TARGET_BRANCH
Target Commit ID$TARGET_COMMIT_ID
" >> ./test_simulator_results.html - echo "

Test Summary

" >> ./test_simulator_results.html - - ARCHIVES_LOC=archives/rf_sim/test - if test # evaluates to false - then - echo "

4G LTE RF Simulator Check

" >> ./test_simulator_results.html - - if [ -f $ARCHIVES_LOC/test_final_status.log ] - then - if [ `egrep -c "LTE: TEST_OK" $ARCHIVES_LOC/test_final_status.log` -eq 1 ] - then - echo "
" >> ./test_simulator_results.html - echo " TEST was SUCCESSFUL " >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - else - echo "
" >> ./test_simulator_results.html - echo " TEST was a FAILURE! " >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - fi - else - echo "
" >> ./test_simulator_results.html - echo " COULD NOT DETERMINE TEST FINAL STATUS! " >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - fi - - echo " " >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - - EPC_CONFIGS=("wS1 noS1") - TRANS_MODES=("fdd") - BW_CASES=(05 10) - for CN_CONFIG in ${EPC_CONFIGS[@]} - do - for TMODE in ${TRANS_MODES[@]} - do - for BW in ${BW_CASES[@]} - do - echo " " >> ./test_simulator_results.html - if [[ $CN_CONFIG =~ .*wS1.* ]] - then - echo " " >> ./test_simulator_results.html - else - echo " " >> ./test_simulator_results.html - fi - echo " " >> ./test_simulator_results.html - ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}MHz_${CN_CONFIG}_enb.log - UE_LOG=`echo $ENB_LOG | sed -e "s#enb#ue#"` - if [ -f $ENB_LOG ] && [ -f $UE_LOG ] - then - NAME_ENB=`echo $ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"` - NAME_UE=`echo $UE_LOG | sed -e "s#$ARCHIVES_LOC/##"` - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - NB_ENB_GOT_SYNC=`egrep -c "got sync" $ENB_LOG` - if [[ $CN_CONFIG =~ .*noS1.* ]] - then - NB_ENB_TUNNEL_UP=`egrep -c "Interface oaitun_enb1 successfully configured" $ENB_LOG` - fi - NB_UE_GOT_SYNC=`egrep -c "rfsimulator: Success" $UE_LOG` - NB_ENB_SYNCED_WITH_UE=`egrep -c "Generating RRCConnectionReconfigurationComplete" $UE_LOG` - if [[ $CN_CONFIG =~ .*noS1.* ]] - then - NB_UE_TUNNEL_UP=`egrep -c "Interface oaitun_ue1 successfully configured" $UE_LOG` - else - NB_UE_TUNNEL_UP=`egrep -c "ip link set oaitun_ue1 up" $UE_LOG` - fi - if [ $NB_ENB_GOT_SYNC -gt 0 ] && [ $NB_UE_GOT_SYNC -gt 0 ] && [ $NB_ENB_SYNCED_WITH_UE -gt 0 ] - then - echo " " >> ./test_simulator_results.html - else - echo " " >> ./test_simulator_results.html - fi - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - fi - PING_LOGS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${CN_CONFIG}_ping*.log 2> /dev/null` - analyzePingFiles - - IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${CN_CONFIG}_iperf_dl*client*txt | grep -v mbms 2> /dev/null` - analyzeIperfFiles - - IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${CN_CONFIG}_iperf_ul*client*txt | grep -v mbms 2> /dev/null` - analyzeIperfFiles - done - done - done - - # MBMS Case - CN_CONFIG="noS1" - TMODE="fdd" - BW_CASES=(05) - for BW in ${BW_CASES[@]} - do - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}MHz_${CN_CONFIG}_enb_mbms.log - UE_LOG=`echo $ENB_LOG | sed -e "s#enb#ue#"` - if [ -f $ENB_LOG ] && [ -f $UE_LOG ] - then - NAME_ENB=`echo $ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"` - NAME_UE=`echo $UE_LOG | sed -e "s#$ARCHIVES_LOC/##"` - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - NB_ENB_GOT_SYNC=`egrep -c "got sync" $ENB_LOG` - NB_ENB_TUNNEL_UP=`egrep -c "Interface oaitun_enb1 successfully configured" $ENB_LOG` - NB_ENB_MTUNNEL_UP=`egrep -c "Interface oaitun_enm1 successfully configured" $ENB_LOG` - NB_UE_GOT_SYNC=`egrep -c "rfsimulator: Success" $UE_LOG` - NB_ENB_SYNCED_WITH_UE=`egrep -c "Generating RRCConnectionReconfigurationComplete" $UE_LOG` - NB_UE_TUNNEL_UP=`egrep -c "Interface oaitun_ue1 successfully configured" $UE_LOG` - NB_UE_MTUNNEL_UP=`egrep -c "Interface oaitun_uem1 successfully configured" $UE_LOG` - NB_UE_MBMS_PUSH_MSG=`egrep -c "TRIED TO PUSH MBMS DATA TO" $UE_LOG` - if [ $NB_ENB_GOT_SYNC -gt 0 ] && [ $NB_UE_GOT_SYNC -gt 0 ] && [ $NB_ENB_SYNCED_WITH_UE -gt 0 ] && [ $NB_UE_MBMS_PUSH_MSG -gt 0 ] - then - echo " " >> ./test_simulator_results.html - else - echo " " >> ./test_simulator_results.html - fi - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - fi - #PING_LOGS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${CN_CONFIG}_ping*.log 2> /dev/null` - #analyzePingFiles - - #IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${CN_CONFIG}_iperf_dl*client*txt | grep -v mbms 2> /dev/null` - #analyzeIperfFiles - - #IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${CN_CONFIG}_iperf_ul*client*txt | grep -v mbms 2> /dev/null` - #analyzeIperfFiles - done - - # FeMBMS Case - CN_CONFIG="noS1" - TMODE="fdd" - BW_CASES=(05) - for BW in ${BW_CASES[@]} - do - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}MHz_${CN_CONFIG}_enb_fembms.log - UE_LOG=`echo $ENB_LOG | sed -e "s#enb#ue#"` - if [ -f $ENB_LOG ] && [ -f $UE_LOG ] - then - NAME_ENB=`echo $ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"` - NAME_UE=`echo $UE_LOG | sed -e "s#$ARCHIVES_LOC/##"` - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - #NB_ENB_GOT_SYNC=`egrep -c "got sync" $ENB_LOG` - NB_ENB_TUNNEL_UP=`egrep -c "Interface oaitun_enb1 successfully configured" $ENB_LOG` - NB_ENB_MTUNNEL_UP=`egrep -c "Interface oaitun_enm1 successfully configured" $ENB_LOG` - #NB_UE_GOT_SYNC=`egrep -c "rfsimulator: Success" $UE_LOG` - #NB_ENB_SYNCED_WITH_UE=`egrep -c "Generating RRCConnectionReconfigurationComplete" $UE_LOG` - NB_UE_TUNNEL_UP=`egrep -c "Interface oaitun_ue1 successfully configured" $UE_LOG` - NB_UE_MTUNNEL_UP=`egrep -c "Interface oaitun_uem1 successfully configured" $UE_LOG` - NB_UE_MBMS_PUSH_MSG=`egrep -c "TRIED TO PUSH MBMS DATA TO" $UE_LOG` - #if [ $NB_ENB_GOT_SYNC -gt 0 ] && [ $NB_UE_GOT_SYNC -gt 0 ] && [ $NB_ENB_SYNCED_WITH_UE -gt 0 ] && [ $NB_UE_MBMS_PUSH_MSG -gt 0 ] - if [ $NB_UE_MBMS_PUSH_MSG -gt 0 ] - then - echo " " >> ./test_simulator_results.html - else - echo " " >> ./test_simulator_results.html - fi - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - fi - #PING_LOGS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${CN_CONFIG}_ping*.log 2> /dev/null` - #analyzePingFiles - - #IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${CN_CONFIG}_iperf_dl*client*txt | grep -v mbms 2> /dev/null` - #analyzeIperfFiles - - #IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${CN_CONFIG}_iperf_ul*client*txt | grep -v mbms 2> /dev/null` - #analyzeIperfFiles - done - echo "
Log File NameCommandStatusStatistics
Test with EPC (aka withS1): ${TMODE} -- ${BW}MHz Test without EPC (aka noS1): ${TMODE} -- ${BW}MHz
$NAME_ENB --- $NAME_UEN/AOKKO
" >> ./test_simulator_results.html
-                    if [ $NB_ENB_GOT_SYNC -gt 0 ]
-                    then
-                        echo "- eNB --> got sync" >> ./test_simulator_results.html
-                    else
-                        echo "- eNB NEVER got sync" >> ./test_simulator_results.html
-                    fi
-                    if [[ $CN_CONFIG =~ .*noS1.* ]]
-                    then
-                        if [ $NB_ENB_TUNNEL_UP -gt 0 ]
-                        then
-                            echo "- eNB mounted oaitun_enb1 interface" >> ./test_simulator_results.html
-                        else
-                            echo "- eNB NEVER mounted oaitun_enb1 interface" >> ./test_simulator_results.html
-                        fi
-                    fi
-                    if [ $NB_UE_GOT_SYNC -gt 0 ]
-                    then
-                        echo "- LTE UE --> got sync" >> ./test_simulator_results.html
-                    else
-                        echo "- LTE UE NEVER got sync" >> ./test_simulator_results.html
-                    fi
-                    if [ $NB_ENB_SYNCED_WITH_UE -gt 0 ]
-                    then
-                        echo "- LTE UE attached to eNB" >> ./test_simulator_results.html
-                    else
-                        echo "- LTE UE NEVER attached to eNB" >> ./test_simulator_results.html
-                    fi
-                    if [ $NB_UE_TUNNEL_UP -gt 0 ]
-                    then
-                        echo "- LTE UE mounted oaitun_ue1 interface" >> ./test_simulator_results.html
-                    else
-                        echo "- LTE UE NEVER mounted oaitun_ue1 interface" >> ./test_simulator_results.html
-                    fi
-                    echo "        
Test MBMS without EPC (aka noS1): ${TMODE} -- ${BW}MHz
$NAME_ENB --- $NAME_UEN/AOKKO
" >> ./test_simulator_results.html
-                if [ $NB_ENB_GOT_SYNC -gt 0 ]
-                then
-                    echo "- eNB --> got sync" >> ./test_simulator_results.html
-                else
-                    echo "- eNB NEVER got sync" >> ./test_simulator_results.html
-                fi
-                if [ $NB_ENB_TUNNEL_UP -gt 0 ]
-                then
-                    echo "- eNB mounted oaitun_enb1 interface" >> ./test_simulator_results.html
-                else
-                    echo "- eNB NEVER mounted oaitun_enb1 interface" >> ./test_simulator_results.html
-                fi
-                if [ $NB_ENB_MTUNNEL_UP -gt 0 ]
-                then
-                    echo "- eNB mounted oaitun_enm1 interface" >> ./test_simulator_results.html
-                else
-                    echo "- eNB NEVER mounted oaitun_enm1 interface" >> ./test_simulator_results.html
-                fi
-                if [ $NB_UE_GOT_SYNC -gt 0 ]
-                then
-                    echo "- LTE UE --> got sync" >> ./test_simulator_results.html
-                else
-                    echo "- LTE UE NEVER got sync" >> ./test_simulator_results.html
-                fi
-                if [ $NB_ENB_SYNCED_WITH_UE -gt 0 ]
-                then
-                    echo "- LTE UE attached to eNB" >> ./test_simulator_results.html
-                else
-                    echo "- LTE UE NEVER attached to eNB" >> ./test_simulator_results.html
-                fi
-                if [ $NB_UE_TUNNEL_UP -gt 0 ]
-                then
-                    echo "- LTE UE mounted oaitun_ue1 interface" >> ./test_simulator_results.html
-                else
-                    echo "- LTE UE NEVER mounted oaitun_ue1 interface" >> ./test_simulator_results.html
-                fi
-                if [ $NB_UE_MTUNNEL_UP -gt 0 ]
-                then
-                    echo "- LTE UE mounted oaitun_uem1 interface" >> ./test_simulator_results.html
-                else
-                    echo "- LTE UE NEVER mounted oaitun_uem1 interface" >> ./test_simulator_results.html
-                fi
-                if [ $NB_UE_MBMS_PUSH_MSG -gt 0 ]
-                then
-                    echo "- LTE UE tried to push ${NB_UE_MBMS_PUSH_MSG} MBMS DATA" >> ./test_simulator_results.html
-                else
-                    echo "- LTE UE NEVER pushed MBMS DATA" >> ./test_simulator_results.html
-                fi
-                echo "        
Test FeMBMS without EPC (aka noS1): ${TMODE} -- ${BW}MHz
$NAME_ENB --- $NAME_UEN/AOKKO
" >> ./test_simulator_results.html
-                #if [ $NB_ENB_GOT_SYNC -gt 0 ]
-                #then
-                #    echo "- eNB --> got sync" >> ./test_simulator_results.html
-                #else
-                #    echo "- eNB NEVER got sync" >> ./test_simulator_results.html
-                #fi
-                if [ $NB_ENB_TUNNEL_UP -gt 0 ]
-                then
-                    echo "- eNB mounted oaitun_enb1 interface" >> ./test_simulator_results.html
-                else
-                    echo "- eNB NEVER mounted oaitun_enb1 interface" >> ./test_simulator_results.html
-                fi
-                if [ $NB_ENB_MTUNNEL_UP -gt 0 ]
-                then
-                    echo "- eNB mounted oaitun_enm1 interface" >> ./test_simulator_results.html
-                else
-                    echo "- eNB NEVER mounted oaitun_enm1 interface" >> ./test_simulator_results.html
-                fi
-                #if [ $NB_UE_GOT_SYNC -gt 0 ]
-                #then
-                #    echo "- LTE UE --> got sync" >> ./test_simulator_results.html
-                #else
-                #    echo "- LTE UE NEVER got sync" >> ./test_simulator_results.html
-                #fi
-                #if [ $NB_ENB_SYNCED_WITH_UE -gt 0 ]
-                #then
-                #    echo "- LTE UE attached to eNB" >> ./test_simulator_results.html
-                #else
-                #    echo "- LTE UE NEVER attached to eNB" >> ./test_simulator_results.html
-                #fi
-                if [ $NB_UE_TUNNEL_UP -gt 0 ]
-                then
-                    echo "- LTE UE mounted oaitun_ue1 interface" >> ./test_simulator_results.html
-                else
-                    echo "- LTE UE NEVER mounted oaitun_ue1 interface" >> ./test_simulator_results.html
-                fi
-                if [ $NB_UE_MTUNNEL_UP -gt 0 ]
-                then
-                    echo "- LTE UE mounted oaitun_uem1 interface" >> ./test_simulator_results.html
-                else
-                    echo "- LTE UE NEVER mounted oaitun_uem1 interface" >> ./test_simulator_results.html
-                fi
-                if [ $NB_UE_MBMS_PUSH_MSG -gt 0 ]
-                then
-                    echo "- LTE UE tried to push ${NB_UE_MBMS_PUSH_MSG} MBMS DATA" >> ./test_simulator_results.html
-                else
-                    echo "- LTE UE NEVER pushed MBMS DATA" >> ./test_simulator_results.html
-                fi
-                echo "        
" >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - fi - - ARCHIVES_LOC=archives/rf5g_sim/test - if [ -d $ARCHIVES_LOC ] - then - echo "

5G NR RF Simulator Check

" >> ./test_simulator_results.html - - if [ -f $ARCHIVES_LOC/test_final_status.log ] - then - if [ `egrep -c "5G-NR: TEST_OK" $ARCHIVES_LOC/test_final_status.log` -eq 1 ] - then - echo "
" >> ./test_simulator_results.html - echo " TEST was SUCCESSFUL " >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - else - echo "
" >> ./test_simulator_results.html - echo " TEST was a FAILURE! " >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - fi - else - echo "
" >> ./test_simulator_results.html - echo " COULD NOT DETERMINE TEST FINAL STATUS! " >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - fi - - echo " " >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - - #SA - EPC_CONFIGS=("noS1") - TRANS_MODES=("tdd") - FR_MODE=("SA") - BW_CASES=(106 24) - for CN_CONFIG in ${EPC_CONFIGS[@]} - do - for TMODE in ${TRANS_MODES[@]} - do - for BW in ${BW_CASES[@]} - do - echo " " >> ./test_simulator_results.html - if [[ $CN_CONFIG =~ .*wS1.* ]] - then - echo " " >> ./test_simulator_results.html - else - echo " " >> ./test_simulator_results.html - fi - echo " " >> ./test_simulator_results.html - - - #SA test (--sa option) - - SA_ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_gnb_sa_test.log - SA_UE_LOG=$ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_ue_sa_test.log - if [ -f $RA_ENB_LOG ] && [ -f $RA_UE_LOG ] - then - #get rid of full path - NAME_ENB=`echo $SA_ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"` - NAME_UE=`echo $SA_UE_LOG | sed -e "s#$ARCHIVES_LOC/##"` - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - - - RRC_CHECK=`egrep -c "Received rrcSetupComplete" $SA_ENB_LOG` - CBRA_CHECK=`egrep -c "Received Ack of RA-Msg4\. CBRA procedure succeeded" $SA_ENB_LOG` - SIB1_CHECK=`egrep -c "SIB1 decoded" $SA_UE_LOG` - - - if [ $RRC_CHECK -gt 0 ] && [ $CBRA_CHECK -gt 0 ] && [ $SIB1_CHECK -gt 0 ] - then - echo " " >> ./test_simulator_results.html - else - echo " " >> ./test_simulator_results.html - fi - - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - fi - - done - done - done - - - EPC_CONFIGS=("noS1") - TRANS_MODES=("tdd") - FR_MODE=("FR2") - BW_CASES=(32) - for CN_CONFIG in ${EPC_CONFIGS[@]} - do - for TMODE in ${TRANS_MODES[@]} - do - for BW in ${BW_CASES[@]} - do - echo " " >> ./test_simulator_results.html - if [[ $CN_CONFIG =~ .*wS1.* ]] - then - echo " " >> ./test_simulator_results.html - else - echo " " >> ./test_simulator_results.html - fi - echo " " >> ./test_simulator_results.html - - - #FR2 RA test (--do-ra option) - - #build log files names tdd_${PRB}prb_${CN_CONFIG}_gnb_ra_fr2_test.log - - RA_ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_gnb_ra_fr2_test.log - RA_UE_LOG=$ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_ue_ra_fr2_test.log - if [ -f $RA_ENB_LOG ] && [ -f $RA_UE_LOG ] - then - #get rid of full path - NAME_ENB=`echo $RA_ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"` - NAME_UE=`echo $RA_UE_LOG | sed -e "s#$ARCHIVES_LOC/##"` - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - - #gNB RA check - GNB_RECEIVED=`egrep -c "\[RAPROC\] PUSCH with TC_RNTI (.+) received correctly" $RA_ENB_LOG` - #UE RA check - UE_RA_PROC_OK=`egrep -c "\[RAPROC\] RA procedure succeeded" $RA_UE_LOG` - - - if [ $GNB_RECEIVED -gt 0 ] && [ $UE_RA_PROC_OK -gt 0 ] - then - echo " " >> ./test_simulator_results.html - else - echo " " >> ./test_simulator_results.html - fi - - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - fi - - done - done - done - - - EPC_CONFIGS=("noS1") - FR_MODE=("FR1") - TRANS_MODES=("fdd" "tdd") - BW_CASES=(106) - for CN_CONFIG in ${EPC_CONFIGS[@]} - do - for TMODE in ${TRANS_MODES[@]} - do - for BW in ${BW_CASES[@]} - do - echo " " >> ./test_simulator_results.html - if [[ $CN_CONFIG =~ .*wS1.* ]] - then - echo " " >> ./test_simulator_results.html - else - echo " " >> ./test_simulator_results.html - fi - echo " " >> ./test_simulator_results.html - - - #FR1 RA test (--do-ra option) - - #build log files names - RA_ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_gnb_ra_test.log - RA_UE_LOG=$ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_ue_ra_test.log - if [ -f $RA_ENB_LOG ] && [ -f $RA_UE_LOG ] - then - #get rid of full path - NAME_ENB=`echo $RA_ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"` - NAME_UE=`echo $RA_UE_LOG | sed -e "s#$ARCHIVES_LOC/##"` - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - - #gNB RA check - GNB_RECEIVED=`egrep -c "\[RAPROC\] PUSCH with TC_RNTI (.+) received correctly" $RA_ENB_LOG` - #UE RA check - UE_RA_PROC_OK=`egrep -c "\[RAPROC\] RA procedure succeeded" $RA_UE_LOG` - - - if [ $GNB_RECEIVED -gt 0 ] && [ $UE_RA_PROC_OK -gt 0 ] - then - echo " " >> ./test_simulator_results.html - else - echo " " >> ./test_simulator_results.html - fi - - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - fi - - #SYNC test - ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_gnb.log - UE_LOG=`echo $ENB_LOG | sed -e "s#gnb#ue#"` - if [ -f $ENB_LOG ] && [ -f $UE_LOG ] - then - NAME_ENB=`echo $ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"` - NAME_UE=`echo $UE_LOG | sed -e "s#$ARCHIVES_LOC/##"` - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - NB_ENB_GOT_SYNC=`egrep -c "got sync" $ENB_LOG` - NB_ENB_TUNNEL_UP=`egrep -c "Interface oaitun_enb1 successfully configured" $ENB_LOG` - NB_UE_GOT_SYNC=`egrep -c "rfsimulator: Success" $UE_LOG` - NB_ENB_SYNCED_WITH_UE=`egrep -c "Initial sync: starting PBCH detection" $UE_LOG` - NB_UE_TUNNEL_UP=`egrep -c "Interface oaitun_ue1 successfully configured" $UE_LOG` - if [ $NB_ENB_GOT_SYNC -gt 0 ] && [ $NB_UE_GOT_SYNC -gt 0 ] && [ $NB_ENB_SYNCED_WITH_UE -gt 0 ] - then - echo " " >> ./test_simulator_results.html - else - echo " " >> ./test_simulator_results.html - fi - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - fi - PING_LOGS=`ls $ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_ping*.log 2> /dev/null` - analyzePingFiles - - IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_iperf_dl*client*txt 2> /dev/null` - analyzeIperfFiles - - IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_iperf_ul*client*txt 2> /dev/null` - analyzeIperfFiles - done - done - done - - echo "
Log File NameCommandStatusStatistics
Test with CN5G : ${TMODE} -- ${BW}PRB -- ${FR_MODE}Test without CN5G : ${TMODE} -- ${BW}PRB -- ${FR_MODE}
$NAME_ENB --- $NAME_UECheck if SA proc succeededOKKO
" >> ./test_simulator_results.html
-                    if [ $RRC_CHECK -gt 0 ]
-                    then
-                        echo "- Received rrcSetupComplete OK" >> ./test_simulator_results.html
-                    else
-                        echo "- Received rrcSetupComplete KO" >> ./test_simulator_results.html
-                    fi
-                    if [ $CBRA_CHECK -gt 0 ]
-                    then
-                        echo "- CBRA procedure succeeded OK" >> ./test_simulator_results.html
-                    else
-                        echo "- CBRA procedure succeeded KO" >> ./test_simulator_results.html
-                    fi
-                    if [ $SIB1_CHECK -gt 0 ]
-                    then
-                        echo "- SIB1 decoded OK" >> ./test_simulator_results.html
-                    else
-                        echo "- SIB1 decoded KO" >> ./test_simulator_results.html
-                    fi
-
-                    echo "        
Test with CN5G : ${TMODE} -- ${BW}PRB -- ${FR_MODE}Test without CN5G : ${TMODE} -- ${BW}PRB -- ${FR_MODE}
$NAME_ENB --- $NAME_UECheck if FR2 RA proc succeededOKKO
" >> ./test_simulator_results.html
-                    if [ $GNB_RECEIVED -gt 0 ]
-                    then
-                        echo "- gNB --> RA received" >> ./test_simulator_results.html
-                    else
-                        echo "- gNB RA NOT RECEIVED" >> ./test_simulator_results.html
-                    fi
-                    if [ $UE_RA_PROC_OK -gt 0 ]
-                    then
-                        echo "- NR UE  --> RA procedure succeded" >> ./test_simulator_results.html
-                    else
-                        echo "- NR UE RA procedure failed" >> ./test_simulator_results.html
-                    fi
-                    echo "        
Test with CN5G : ${TMODE} -- ${BW}PRB -- ${FR_MODE}Test without CN5G : ${TMODE} -- ${BW}PRB -- ${FR_MODE}
$NAME_ENB --- $NAME_UECheck if FR1 RA proc succeededOKKO
" >> ./test_simulator_results.html
-                    if [ $GNB_RECEIVED -gt 0 ]
-                    then
-                        echo "- gNB --> RA received" >> ./test_simulator_results.html
-                    else
-                        echo "- gNB RA NOT RECEIVED" >> ./test_simulator_results.html
-                    fi
-                    if [ $UE_RA_PROC_OK -gt 0 ]
-                    then
-                        echo "- NR UE  --> RA procedure succeded" >> ./test_simulator_results.html
-                    else
-                        echo "- NR UE RA procedure failed" >> ./test_simulator_results.html
-                    fi
-                    echo "        
$NAME_ENB --- $NAME_UEN/AOKKO
" >> ./test_simulator_results.html
-                    if [ $NB_ENB_GOT_SYNC -gt 0 ]
-                    then
-                        echo "- gNB --> got sync" >> ./test_simulator_results.html
-                    else
-                        echo "- gNB NEVER got sync" >> ./test_simulator_results.html
-                    fi
-                    if [ $NB_ENB_TUNNEL_UP -gt 0 ]
-                    then
-                        echo "- gNB mounted oaitun_enb1 interface" >> ./test_simulator_results.html
-                    else
-                        echo "- gNB NEVER mounted oaitun_enb1 interface" >> ./test_simulator_results.html
-                    fi
-                    if [ $NB_UE_GOT_SYNC -gt 0 ]
-                    then
-                        echo "- NR UE --> got sync" >> ./test_simulator_results.html
-                    else
-                        echo "- NR UE NEVER got sync" >> ./test_simulator_results.html
-                    fi
-                    if [ $NB_ENB_SYNCED_WITH_UE -gt 0 ]
-                    then
-                        echo "- NR UE attached to gNB" >> ./test_simulator_results.html
-                    else
-                        echo "- NR UE NEVER attached to eNB" >> ./test_simulator_results.html
-                    fi
-                    if [ $NB_UE_TUNNEL_UP -gt 0 ]
-                    then
-                        echo "- NR UE mounted oaitun_ue1 interface" >> ./test_simulator_results.html
-                    else
-                        echo "- NR UE NEVER mounted oaitun_ue1 interface" >> ./test_simulator_results.html
-                    fi
-                    echo "        
" >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - fi - - ARCHIVES_LOC=archives/phy_sim/test - if [ -d $ARCHIVES_LOC ] - then - echo "

Physical Simulators Check

" >> ./test_simulator_results.html - - if [ -f $ARCHIVES_LOC/test_final_status.log ] - then - if [ `grep -c TEST_OK $ARCHIVES_LOC/test_final_status.log` -eq 1 ] - then - echo "
" >> ./test_simulator_results.html - echo " TEST was SUCCESSFUL " >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - else - echo "
" >> ./test_simulator_results.html - echo " TEST was a FAILURE! " >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - fi - else - echo "
" >> ./test_simulator_results.html - echo " COULD NOT DETERMINE TEST FINAL STATUS! " >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - fi - - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - - XML_TESTS=`ls $ARCHIVES_LOC/*xml` - for XML_FILE in $XML_TESTS - do - echo " " >> ./test_simulator_results.html - NAME=`echo $XML_FILE | sed -e "s#$ARCHIVES_LOC/##"` - NB_TESTS=`egrep "testsuite errors" $XML_FILE | sed -e "s#^.*tests='##" -e "s#' *time=.*##"` - NB_ERRORS=`egrep "testsuite errors" $XML_FILE | sed -e "s#^.*errors='##" -e "s#' *failures=.*##"` - NB_FAILURES=`egrep "testsuite errors" $XML_FILE | sed -e "s#^.*failures='##" -e "s#' *hostname=.*##"` - NB_SKIPPED=`egrep "testsuite errors" $XML_FILE | sed -e "s#^.*skipped='##" -e "s#' *tests=.*##"` - if [ $NB_ERRORS -eq 0 ] && [ $NB_FAILURES -eq 0 ] - then - echo " " >> ./test_simulator_results.html - else - echo " " >> ./test_simulator_results.html - fi - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - done - - echo "
Log File NameNb TestsNb ErrorsNb FailuresNb Failures
$NAME$NAME$NB_TESTS$NB_ERRORS$NB_FAILURES$NB_SKIPPED
" >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - - echo " " >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - - echo "

Details

" >> ./test_simulator_results.html - for XML_FILE in $XML_TESTS - do - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - PREV_SECTION=0 - PREV_TIME_IN_SECS=0 - TESTCASES_LIST=`sed -e "s# #@#g" $XML_FILE | grep testcase` - for TESTCASE in $TESTCASES_LIST - do - NAME=`echo $TESTCASE | sed -e "s#^.*name='##" -e "s#'@description=.*##" | sed -e "s#@# #g"` - SECTION=`echo $NAME | sed -e "s#\..*##"` - if [ $SECTION != $PREV_SECTION ] - then - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - PREV_SECTION=$SECTION - PREV_TIME_IN_SECS=0 - fi - DESC=`echo $TESTCASE | sed -e "s#^.*description='##" -e "s#'@Run_result=.*##" | sed -e "s#@# #g"` - RESULT=`echo $TESTCASE | sed -e "s#^.*RESULT='##" -e "s#'.*##" | sed -e "s#@# #g"` - TIME_IN_SECS=`echo $TESTCASE | sed -e "s#^.*time='##" -e "s#'@RESULT=.*##" | sed -e "s#@# #g" -e "s# s.*##"` - TIME=`echo "$TIME_IN_SECS - $PREV_TIME_IN_SECS" | bc -l | awk '{printf "%.2f s", $0}'` - PREV_TIME_IN_SECS=$TIME_IN_SECS - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - if [[ $RESULT =~ .*PASS.* ]] - then - echo " " >> ./test_simulator_results.html - else - SPLITTED_LINE=`echo -e $TESTCASE | sed -e "s#@#\n#g"` - NB_RUNS=`echo -e "${SPLITTED_LINE}" | grep -v Run_result | egrep -c "Run_"` - NB_FAILS=`echo -e "${SPLITTED_LINE}" | grep -v Run_result | egrep -c "=FAIL"` - echo " " >> ./test_simulator_results.html - fi - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - done - echo "
Test NameDescriptionResultTime
\"$SECTION\" series
$NAME$DESC$RESULT${RESULT} (${NB_FAILS}/${NB_RUNS})$TIME
" >> ./test_simulator_results.html - done - fi - - echo "
" >> ./test_simulator_results.html - echo "

" >> ./test_simulator_results.html - echo "
End of Test Report -- Copyright 2018 OpenAirInterface. All Rights Reserved.
" >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - echo "" >> ./test_simulator_results.html -} diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh deleted file mode 100755 index ad7e26be7c..0000000000 --- a/ci-scripts/runTestOnVM.sh +++ /dev/null @@ -1,2741 +0,0 @@ -#!/bin/bash -#/* -# * 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 -# */ - -function test_usage { - echo "OAI CI VM script" - echo " Original Author: Raphael Defosseux" - echo " Requirements:" - echo " -- uvtool uvtool-libvirt apt-cacher" - echo " -- $VM_OSREL image already synced" - echo " Default:" - echo " -- eNB with USRP" - echo "" - echo "Usage:" - echo "------" - echo " oai-ci-vm-tool test [OPTIONS]" - echo "" - command_options_usage -} - -function get_ue_ip_addr { - local LOC_IF_ID=$3 - echo "ifconfig oaitun_ue${LOC_IF_ID} | egrep \"inet addr\" | sed -e 's#^.*inet addr:##' -e 's# P-t-P:.*\$##'" > $1 - UE_IP_ADDR=`ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1` - echo "Test UE${LOC_IF_ID} IP Address is : $UE_IP_ADDR" - rm $1 -} - -function get_ue_mbms_ip_addr { - local LOC_IF_ID=$3 - echo "ifconfig oaitun_uem${LOC_IF_ID} | egrep \"inet addr\" | sed -e 's#^.*inet addr:##' -e 's# P-t-P:.*\$##'" > $1 - UE_IP_ADDR=`ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1` - echo "Test UE${LOC_IF_ID} MBMS IP Address is : $UE_IP_ADDR" - rm $1 -} - -function get_enb_noS1_ip_addr { - echo "ifconfig oaitun_enb1 | egrep \"inet addr\" | sed -e 's#^.*inet addr:##' -e 's# P-t-P:.*\$##'" > $1 - ENB_IP_ADDR=`ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1` - echo "Test eNB IP Address is : $ENB_IP_ADDR" - rm $1 -} - -function get_enb_mbms_noS1_ip_addr { - echo "ifconfig oaitun_enm1 | egrep \"inet addr\" | sed -e 's#^.*inet addr:##' -e 's# P-t-P:.*\$##'" > $1 - ENB_IP_ADDR=`ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1` - echo "Test eNB MBMS IP Address is : $ENB_IP_ADDR" - rm $1 -} - -function ping_ue_ip_addr { - local LOC_FG_OR_BG=$5 - echo "echo \"COMMAND IS: ping -c 20 $3\" > $4" > $1 - echo "echo \"ping -c 20 $3\"" >> $1 - if [ $LOC_FG_OR_BG -eq 0 ] - then - echo "ping -c 20 $UE_IP_ADDR >> $4 2>&1" >> $1 - echo "tail -3 $4" >> $1 - else - echo "nohup ping -c 20 $UE_IP_ADDR >> $4 &" >> $1 - fi - ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1 - rm -f $1 -} - -function ping_epc_ip_addr { - local LOC_IF_ID=$5 - local LOC_FG_OR_BG=$6 - echo "echo \"COMMAND IS: ping -I oaitun_ue${LOC_IF_ID} -c 20 $3\" > $4" > $1 - echo "echo \"ping -I oaitun_ue${LOC_IF_ID} -c 20 $3\"" >> $1 - if [ $LOC_FG_OR_BG -eq 0 ] - then - echo "ping -I oaitun_ue${LOC_IF_ID} -c 20 $3 >> $4 2>&1" >> $1 - echo "tail -3 $4" >> $1 - else - echo "nohup ping -I oaitun_ue${LOC_IF_ID} -c 20 $3 >> $4 &" >> $1 - fi - ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1 - rm -f $1 -} - -function ping_enb_ip_addr { - local LOC_FG_OR_BG=$5 - echo "echo \"COMMAND IS: ping -I oaitun_enb1 -c 20 $3\" > $4" > $1 - echo "echo \"ping -I oaitun_enb1 -c 20 $3\"" >> $1 - if [ $LOC_FG_OR_BG -eq 0 ] - then - echo "ping -I oaitun_enb1 -c 20 $3 >> $4 2>&1" >> $1 - echo "tail -3 $4" >> $1 - else - echo "nohup ping -I oaitun_enb1 -c 20 $3 >> $4 &" >> $1 - fi - ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1 - rm -f $1 -} - -function check_ping_result { - local LOC_PING_FILE=$1 - local LOC_NB_PINGS=$2 - if [ -f $LOC_PING_FILE ] - then - local FILE_COMPLETE=`egrep -c "ping statistics" $LOC_PING_FILE` - if [ $FILE_COMPLETE -eq 0 ] - then - PING_STATUS=-1 - echo "ping file incomplete" - else - local ALL_PACKET_RECEIVED=`egrep -c "$LOC_NB_PINGS received" $LOC_PING_FILE` - if [ $ALL_PACKET_RECEIVED -eq 1 ] - then - echo "got all ping packets" - else - LOC_NB_PINGS=$[$2-1] - ALL_PACKET_RECEIVED=`egrep -c "$LOC_NB_PINGS received" $LOC_PING_FILE` - if [ $ALL_PACKET_RECEIVED -eq 1 ] - then - echo "got almost all ping packets" - else - echo "got NOT all ping packets" - PING_STATUS=-1 - fi - fi - fi - else - echo "ping file not present" - PING_STATUS=-1 - fi -} - - -function check_sa_result { - local LOC_GNB_LOG=$1 - local LOC_UE_LOG=$2 - - #if log files exist - if [ -f $LOC_GNB_LOG ] && [ -f $LOC_UE_LOG ] - then - - #gNB SA test - #console check - echo "Checking gNB Log for SA success" - egrep "Received rrcSetupComplete" $1 - egrep "Received Ack of RA-Msg4\. CBRA procedure succeeded" $1 - - #script check - local RRC_CHECK=`egrep -c "Received rrcSetupComplete" $1` - local CBRA_CHECK=`egrep -c "Received Ack of RA-Msg4\. CBRA procedure succeeded" $1` - - #UE SA test - #console check - echo 'Checking UE Log for SA success' - egrep "SIB1 decoded" $2 - #script check - local SIB1_CHECK=`egrep -c "SIB1 decoded" $2` - - #generate status - if [ $RRC_CHECK -eq 0 ] || [ $CBRA_CHECK -eq 0 ] || [ $SIB1_CHECK -eq 0 ] - then - SA_STATUS=-1 - echo "SA test FAILED, could not find the markers" - fi - #case where log files do not exist - else - echo "SA test log files not present" - SA_STATUS=-1 - fi - -} - - -function check_ra_result { - local LOC_GNB_LOG=$1 - local LOC_UE_LOG=$2 - - #if log files exist - if [ -f $LOC_GNB_LOG ] && [ -f $LOC_UE_LOG ] - then - - #gNB RA test - #console check - echo "Checking gNB Log for RA success" - egrep "\[RAPROC\] PUSCH with TC_RNTI (.+) received correctly" $1 - #script check - local GNB_COMPLETE=`egrep -c "\[RAPROC\] PUSCH with TC_RNTI (.+) received correctly" $1` - - #UE RA test - #console check - echo 'Checking UE Log for RA success' - egrep "\[RAPROC\] RA procedure succeeded" $2 - #script check - local UE_COMPLETE=`egrep -c "\[RAPROC\] RA procedure succeeded" $2` - - #generate status - if [ $GNB_COMPLETE -eq 0 ] || [ $UE_COMPLETE -eq 0 ] - then - RA_STATUS=-1 - echo "RA test FAILED, could not find the markers" - fi - #case where log files do not exist - else - echo "RA test log files not present" - RA_STATUS=-1 - fi - -} - -# In DL: iperf server should be on UE side -# -B oaitun_ue{j}-IP-Addr -# iperf client should be on EPC (S1) or eNB (noS1) side -# -c oaitun_ue{j}-IP-Addr -B oaitun_enb1-IP-Addr (in noS1) -# In UL: iperf server should be on EPC (S1) or eNB (noS1) side -# -B oaitun_enb1-IP-Addr -# iperf client should be on UE side -# -c oaitun_enb1-IP-Addr -B oaitun_ue{j}-IP-Addr (in noS1) -function generic_iperf { - local LOC_ISERVER_CMD=$1 - local LOC_ISERVER_IP=$2 - local LOC_ISERVER_BOND_IP=$3 - local LOC_ICLIENT_CMD=$4 - local LOC_ICLIENT_IP=$5 - local LOC_ICLIENT_BOND_IP=$6 - local LOC_REQ_BANDWIDTH=$7 - local LOC_BASE_LOG_FILE=$8 - local LOC_PORT_ID=$[$9+5001] - local LOC_FG_OR_BG=${10} - # By default the requested bandwidth is in Mbits/sec - if [[ $LOC_REQ_BANDWIDTH =~ .*K.* ]] - then - local IPERF_FORMAT="-fk" - local FORMATTED_REQ_BW=$LOC_REQ_BANDWIDTH - else - local IPERF_FORMAT="-fm" - local FORMATTED_REQ_BW=${LOC_REQ_BANDWIDTH}"M" - fi - # Starting Iperf Server - echo "iperf -B ${LOC_ISERVER_BOND_IP} -u -s -i 1 ${IPERF_FORMAT} -p ${LOC_PORT_ID}" - echo "nohup iperf -B ${LOC_ISERVER_BOND_IP} -u -s -i 1 ${IPERF_FORMAT} -p ${LOC_PORT_ID} > ${LOC_BASE_LOG_FILE}_server.txt 2>&1 &" > ${LOC_ISERVER_CMD} - ssh -T -o StrictHostKeyChecking=no ubuntu@${LOC_ISERVER_IP} < ${LOC_ISERVER_CMD} - rm ${LOC_ISERVER_CMD} - - # Starting Iperf Client - echo "iperf -c ${LOC_ISERVER_BOND_IP} -u -t 30 -b ${FORMATTED_REQ_BW} -i 1 ${IPERF_FORMAT} -B ${LOC_ICLIENT_BOND_IP} -p ${LOC_PORT_ID}" - echo "echo \"COMMAND IS: iperf -c ${LOC_ISERVER_BOND_IP} -u -t 30 -b ${FORMATTED_REQ_BW} -i 1 ${IPERF_FORMAT} -B ${LOC_ICLIENT_BOND_IP} -p ${LOC_PORT_ID}\" > ${LOC_BASE_LOG_FILE}_client.txt" > ${LOC_ICLIENT_CMD} - if [ $LOC_FG_OR_BG -eq 0 ] - then - echo "iperf -c ${LOC_ISERVER_BOND_IP} -u -t 30 -b ${FORMATTED_REQ_BW} -i 1 ${IPERF_FORMAT} -B ${LOC_ICLIENT_BOND_IP} -p ${LOC_PORT_ID} >> ${LOC_BASE_LOG_FILE}_client.txt 2>&1" >> ${LOC_ICLIENT_CMD} - echo "tail -3 ${LOC_BASE_LOG_FILE}_client.txt | grep -v datagram" >> ${LOC_ICLIENT_CMD} - else - echo "nohup iperf -c ${LOC_ISERVER_BOND_IP} -u -t 30 -b ${FORMATTED_REQ_BW} -i 1 ${IPERF_FORMAT} -B ${LOC_ICLIENT_BOND_IP} -p ${LOC_PORT_ID} >> ${LOC_BASE_LOG_FILE}_client.txt 2>&1 &" >> ${LOC_ICLIENT_CMD} - fi - ssh -T -o StrictHostKeyChecking=no ubuntu@${LOC_ICLIENT_IP} < ${LOC_ICLIENT_CMD} - rm -f ${LOC_ICLIENT_CMD} - - # Stopping Iperf Server - if [ $LOC_FG_OR_BG -eq 0 ] - then - echo "killall --signal SIGKILL iperf" - echo "killall --signal SIGKILL iperf" > ${LOC_ISERVER_CMD} - ssh -T -o StrictHostKeyChecking=no ubuntu@${LOC_ISERVER_IP} < ${LOC_ISERVER_CMD} - rm ${LOC_ISERVER_CMD} - fi -} - -function check_iperf { - local LOC_BASE_LOG=$1 - local LOC_REQ_BW=`echo $2 | sed -e "s#K##"` - local LOC_REQ_BW_MINUS_ONE=`echo "$LOC_REQ_BW - 1" | bc -l` - local LOC_REQ_BW_MINUS_TWO=`echo "$LOC_REQ_BW - 2" | bc -l` - local LOC_REQ_BW_MINUS_THREE=`echo "$LOC_REQ_BW - 3" | bc -l` - local LOC_IS_DL=`echo $LOC_BASE_LOG | grep -c _dl` - local LOC_IS_RF_SIM=`echo $LOC_BASE_LOG | grep -c rf_sim` - local LOC_IS_NR=`echo $LOC_BASE_LOG | grep -c _106prb` - if [ -f ${LOC_BASE_LOG}_client.txt ] - then - local FILE_COMPLETE=`egrep -c "Server Report" ${LOC_BASE_LOG}_client.txt` - if [ $FILE_COMPLETE -eq 0 ] - then - IPERF_STATUS=-1 - echo "File Report not found" - else - if [ `egrep -c "Mbits/sec" ${LOC_BASE_LOG}_client.txt` -ne 0 ] - then - local EFFECTIVE_BANDWIDTH=`tail -n3 ${LOC_BASE_LOG}_client.txt | egrep "Mbits/sec" | sed -e "s#^.*MBytes *##" -e "s#sec.*#sec#"` - local BW_PREFIX="M" - fi - if [ `egrep -c "Kbits/sec" ${LOC_BASE_LOG}_client.txt` -ne 0 ] - then - local EFFECTIVE_BANDWIDTH=`tail -n3 ${LOC_BASE_LOG}_client.txt | egrep "Kbits/sec" | sed -e "s#^.*KBytes *##" -e "s#sec.*#sec#"` - local BW_PREFIX="K" - fi - if [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW}.*${BW_PREFIX}bits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_ONE}.*${BW_PREFIX}bits.* ]] - then - if [ $LOC_IS_DL -eq 1 ] - then - echo "got requested DL bandwidth: $EFFECTIVE_BANDWIDTH" - else - echo "got requested UL bandwidth: $EFFECTIVE_BANDWIDTH" - fi - else - echo "got LESS than requested DL bandwidth: $EFFECTIVE_BANDWIDTH" - IPERF_STATUS=-1 - fi - fi - else - IPERF_STATUS=-1 - echo "File not found" - fi -} - -function terminate_enb_ue_basic_sim { - # mode = 0 : eNB + UE or gNB and NR-UE - # mode = 1 : eNB or gNB - # mode = 2 : UE or NR-UE - local LOC_MODE=$3 - echo "NB_OAI_PROCESSES=\`ps -aux | grep modem | grep -v grep | grep -c softmodem\`" > $1 - if [ $LOC_MODE -eq 0 ] || [ $LOC_MODE -eq 1 ] - then - echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then echo \"sudo killall -r --signal SIGINT .*-softmodem\"; fi" >> $1 - echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sudo killall -r --signal SIGINT .*-softmodem; fi" >> $1 - echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sleep 5; fi" >> $1 - echo "echo \"ps -aux | grep softmodem\"" >> $1 - echo "ps -aux | grep softmodem | grep -v grep" >> $1 - echo "NB_OAI_PROCESSES=\`ps -aux | grep modem | grep -v grep | grep -c softmodem\`" >> $1 - echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then echo \"sudo killall -r --signal SIGKILL .*-softmodem\"; fi" >> $1 - echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sudo killall -r --signal SIGKILL .*-softmodem; fi" >> $1 - fi - if [ $LOC_MODE -eq 0 ] || [ $LOC_MODE -eq 2 ] - then - echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then echo \"sudo killall -r --signal SIGKILL .*-uesoftmodem\"; fi" >> $1 - echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sudo killall -r --signal SIGKILL .*-uesoftmodem; fi" >> $1 - echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sleep 5; fi" >> $1 - fi - echo "echo \"ps -aux | grep softmodem\"" >> $1 - echo "ps -aux | grep softmodem | grep -v grep" >> $1 - ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1 - rm -f $1 -} - -function recover_core_dump { - local IS_SEG_FAULT=`egrep -ic "segmentation fault" $3` - if [ $IS_SEG_FAULT -ne 0 ] - then - local TC=`echo $3 | sed -e "s#^.*enb_##" -e "s#Hz.*#Hz#"` - echo "Segmentation fault detected on enb -> recovering core dump" - echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" > $1 - echo "sync" >> $1 - echo "sudo tar -cjhf basic-simulator-enb-core-${TC}.bz2 core lte-softmodem *.so ci-lte-basic-sim.conf my-lte-softmodem-run.sh" >> $1 - echo "sudo rm core" >> $1 - echo "rm ci-lte-basic-sim.conf" >> $1 - echo "sync" >> $1 - ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1 - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/ran_build/build/basic-simulator-enb-core-${TC}.bz2 $4 - rm -f $1 - fi -} - -function full_terminate { - echo "############################################################" - echo "Terminate enb/ue simulators" - echo "############################################################" - terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR 0 - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC - recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - sleep 10 -} - -function install_epc_on_vm { - local LOC_EPC_VM_NAME=$1 - local LOC_EPC_VM_CMDS=$2 - - if [ -d /opt/ltebox-archives/ ] - then - # Checking if all ltebox archives are available to run ltebx epc on a brand new VM - if [ -f /opt/ltebox-archives/ltebox_2.2.70_16_04_amd64.deb ] && [ -f /opt/ltebox-archives/etc-conf.zip ] && [ -f /opt/ltebox-archives/hss-sim-develop.zip ] - then - echo "############################################################" - echo "Test EPC on VM ($EPC_VM_NAME) will be using ltebox" - echo "############################################################" - LTEBOX=1 - fi - fi - # Here we could have other types of EPC detection - - # Do we need to start the EPC VM - echo "EPC_VM_CMD_FILE = $LOC_EPC_VM_CMDS" - IS_EPC_VM_ALIVE=`uvt-kvm list | grep -c $LOC_EPC_VM_NAME` - if [ $IS_EPC_VM_ALIVE -eq 0 ] - then - echo "############################################################" - echo "Creating test EPC VM ($LOC_EPC_VM_NAME) on Ubuntu Cloud Image base" - echo "############################################################" - acquire_vm_create_lock - uvt-kvm create $LOC_EPC_VM_NAME release=$VM_OSREL --unsafe-caching - echo "Waiting for VM to be started" - uvt-kvm wait $LOC_EPC_VM_NAME --insecure - release_vm_create_lock - else - echo "Waiting for VM to be started" - uvt-kvm wait $LOC_EPC_VM_NAME --insecure - fi - - local LOC_EPC_VM_IP_ADDR=`uvt-kvm ip $LOC_EPC_VM_NAME` - - echo "$LOC_EPC_VM_NAME has for IP addr = $LOC_EPC_VM_IP_ADDR" - [ -f /etc/apt/apt.conf.d/01proxy ] && scp -o StrictHostKeyChecking=no /etc/apt/apt.conf.d/01proxy ubuntu@$LOC_EPC_VM_IP_ADDR:/home/ubuntu - - # ltebox specific actions (install and start) - LTE_BOX_TO_INSTALL=1 - if [ $LTEBOX -eq 1 ] - then - echo "ls -ls /opt/ltebox/tools/start_ltebox" > $LOC_EPC_VM_CMDS - RESPONSE=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_EPC_VM_IP_ADDR < $LOC_EPC_VM_CMDS` - NB_EXES=`echo $RESPONSE | grep -c ltebox` - if [ $NB_EXES -eq 1 ]; then LTE_BOX_TO_INSTALL=0; fi - fi - - if [ $LTEBOX -eq 1 ] && [ $LTE_BOX_TO_INSTALL -eq 1 ] - then - echo "############################################################" - echo "Copying ltebox archives into EPC VM ($LOC_EPC_VM_NAME)" - echo "############################################################" - scp -o StrictHostKeyChecking=no /opt/ltebox-archives/ltebox_2.2.70_16_04_amd64.deb ubuntu@$LOC_EPC_VM_IP_ADDR:/home/ubuntu - scp -o StrictHostKeyChecking=no /opt/ltebox-archives/etc-conf.zip ubuntu@$LOC_EPC_VM_IP_ADDR:/home/ubuntu - scp -o StrictHostKeyChecking=no /opt/ltebox-archives/hss-sim-develop.zip ubuntu@$LOC_EPC_VM_IP_ADDR:/home/ubuntu - - echo "############################################################" - echo "Install EPC on EPC VM ($LOC_EPC_VM_NAME)" - echo "############################################################" - echo "[ -f 01proxy ] && sudo cp 01proxy /etc/apt/apt.conf.d/" > $LOC_EPC_VM_CMDS - echo "touch /home/ubuntu/.hushlogin" >> $LOC_EPC_VM_CMDS - echo "echo \"sudo apt-get --yes --quiet install zip openjdk-8-jre libconfuse-dev libreadline-dev liblog4c-dev libgcrypt-dev libsctp-dev python2.7 python2.7-dev iperf\"" >> $LOC_EPC_VM_CMDS - echo "sudo apt-get update > zip-install.txt 2>&1" >> $LOC_EPC_VM_CMDS - echo "sudo apt-get --yes install zip openjdk-8-jre libconfuse-dev libreadline-dev liblog4c-dev libgcrypt-dev libsctp-dev python2.7 python2.7-dev iperf >> zip-install.txt 2>&1" >> $LOC_EPC_VM_CMDS - - # Installing HSS - echo "echo \"cd /opt\"" >> $LOC_EPC_VM_CMDS - echo "cd /opt" >> $LOC_EPC_VM_CMDS - echo "echo \"sudo unzip -qq /home/ubuntu/hss-sim-develop.zip\"" >> $LOC_EPC_VM_CMDS - echo "sudo unzip -qq /home/ubuntu/hss-sim-develop.zip" >> $LOC_EPC_VM_CMDS - echo "echo \"cd /opt/hss_sim0609\"" >> $LOC_EPC_VM_CMDS - echo "cd /opt/hss_sim0609" >> $LOC_EPC_VM_CMDS - - # Installing ltebox - echo "echo \"cd /home/ubuntu\"" >> $LOC_EPC_VM_CMDS - echo "cd /home/ubuntu" >> $LOC_EPC_VM_CMDS - echo "echo \"sudo dpkg -i ltebox_2.2.70_16_04_amd64.deb \"" >> $LOC_EPC_VM_CMDS - echo "sudo dpkg -i ltebox_2.2.70_16_04_amd64.deb >> zip-install.txt 2>&1" >> $LOC_EPC_VM_CMDS - - echo "echo \"cd /opt/ltebox/etc/\"" >> $LOC_EPC_VM_CMDS - echo "cd /opt/ltebox/etc/" >> $LOC_EPC_VM_CMDS - echo "echo \"sudo unzip -qq -o /home/ubuntu/etc-conf.zip\"" >> $LOC_EPC_VM_CMDS - echo "sudo unzip -qq -o /home/ubuntu/etc-conf.zip" >> $LOC_EPC_VM_CMDS - echo "sudo sed -i -e 's#EPC_VM_IP_ADDRESS#$LOC_EPC_VM_IP_ADDR#' gw.conf" >> $LOC_EPC_VM_CMDS - echo "sudo sed -i -e 's#EPC_VM_IP_ADDRESS#$LOC_EPC_VM_IP_ADDR#' mme.conf" >> $LOC_EPC_VM_CMDS - - ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_EPC_VM_IP_ADDR < $LOC_EPC_VM_CMDS - rm -f $LOC_EPC_VM_CMDS - fi -} - -function add_user_to_epc_lists { - local LOC_EPC_VM_CMDS=$1 - local LOC_EPC_VM_IP_ADDR=$2 - local LOC_NB_USERS=$3 - if [ $LTEBOX -eq 1 ] - then - scp -o StrictHostKeyChecking=no $JENKINS_WKSP/ci-scripts/add_user_to_subscriber_list.awk ubuntu@$LOC_EPC_VM_IP_ADDR:/home/ubuntu/ - echo "cd /opt/hss_sim0609" > $LOC_EPC_VM_CMDS - echo "if [ -e subscriber.data.orig ]; then sudo mv subscriber.data.orig subscriber.data; fi" >> $1 - echo "if [ -e profile.data.orig ]; then sudo mv profile.data.orig profile.data; fi" >> $1 - echo "sudo cp subscriber.data subscriber.data.orig" >> $LOC_EPC_VM_CMDS - echo "sudo cp profile.data profile.data.orig" >> $LOC_EPC_VM_CMDS - echo "sudo awk -v num_ues=$LOC_NB_USERS -f /home/ubuntu/add_user_to_subscriber_list.awk subscriber.data.orig > /tmp/subscriber.data" >> $LOC_EPC_VM_CMDS - echo "sudo awk -v num_ues=$LOC_NB_USERS -f /home/ubuntu/add_user_to_subscriber_list.awk profile.data.orig > /tmp/profile.data" >> $LOC_EPC_VM_CMDS - echo "sudo cp /tmp/subscriber.data subscriber.data" >> $LOC_EPC_VM_CMDS - echo "sudo cp /tmp/profile.data profile.data" >> $LOC_EPC_VM_CMDS - - ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_EPC_VM_IP_ADDR < $LOC_EPC_VM_CMDS - rm -f $LOC_EPC_VM_CMDS - fi -} - -function start_epc { - local LOC_EPC_VM_NAME=$1 - local LOC_EPC_VM_CMDS=$2 - local LOC_EPC_VM_IP_ADDR=$3 - - if [ $LTEBOX -eq 1 ] - then - echo "############################################################" - echo "Start EPC on EPC VM ($LOC_EPC_VM_NAME)" - echo "############################################################" - echo "echo \"cd /opt/hss_sim0609\"" > $LOC_EPC_VM_CMDS - echo "cd /opt/hss_sim0609" >> $LOC_EPC_VM_CMDS - echo "sudo rm -f hss.log" >> $LOC_EPC_VM_CMDS - echo "echo \"screen -dm -S simulated_hss ./starthss_real\"" >> $LOC_EPC_VM_CMDS - echo "sudo su -c \"screen -dm -S simulated_hss ./starthss_real\"" >> $LOC_EPC_VM_CMDS - - echo "echo \"cd /opt/ltebox/tools/\"" >> $LOC_EPC_VM_CMDS - echo "cd /opt/ltebox/tools/" >> $LOC_EPC_VM_CMDS - echo "echo \"sudo ./start_ltebox\"" >> $LOC_EPC_VM_CMDS - echo "nohup sudo ./start_ltebox > /home/ubuntu/ltebox.txt" >> $LOC_EPC_VM_CMDS - echo "touch /home/ubuntu/try.txt" >> $LOC_EPC_VM_CMDS - echo "sudo rm -f /home/ubuntu/*.txt" >> $LOC_EPC_VM_CMDS - - ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_EPC_VM_IP_ADDR < $LOC_EPC_VM_CMDS - rm -f $LOC_EPC_VM_CMDS - - i="0" - echo "ifconfig tun5 | egrep -c \"inet addr\"" > $LOC_EPC_VM_CMDS - while [ $i -lt 10 ] - do - sleep 2 - CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_EPC_VM_IP_ADDR < $LOC_EPC_VM_CMDS` - if [ $CONNECTED -eq 1 ] - then - i="100" - else - i=$[$i+1] - fi - done - rm $LOC_EPC_VM_CMDS - if [ $i -lt 50 ] - then - echo "Problem w/ starting ltebox EPC" - echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log - exit -1 - fi - fi - - # HERE ADD ANY INSTALL ACTIONS FOR ANOTHER EPC - -} - -function retrieve_real_epc_ip_addr { - local LOC_EPC_VM_NAME=$1 - local LOC_EPC_VM_CMDS=$2 - local LOC_EPC_VM_IP_ADDR=$3 - - if [[ "$EPC_IPADDR" == "" ]] - then - if [ $LTEBOX -eq 1 ] - then - # in our configuration file, we are using pool 5 - echo "ifconfig tun5 | egrep \"inet addr\" | sed -e 's#^.*inet addr:##' -e 's# P-t-P:.*\$##'" > $LOC_EPC_VM_CMDS - REAL_EPC_IP_ADDR=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_EPC_VM_IP_ADDR < $LOC_EPC_VM_CMDS` - rm $LOC_EPC_VM_CMDS - fi - else - REAL_EPC_IP_ADDR=$EPC_TUN_IPADDR - fi - echo "EPC IP Address is : $REAL_EPC_IP_ADDR" -} - -function terminate_epc { - if [ $LTEBOX -eq 1 ] - then - echo "echo \"cd /opt/ltebox/tools\"" > $1 - echo "cd /opt/ltebox/tools" >> $1 - echo "echo \"sudo ./stop_ltebox\"" >> $1 - echo "sudo ./stop_ltebox" >> $1 - echo "echo \"sudo killall --signal SIGKILL hss_sim\"" >> $1 - echo "sudo killall --signal SIGKILL hss_sim" >> $1 - ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1 - rm $1 - fi -} - -function build_ue_on_separate_folder { - echo "mkdir tmp-ue" > $1 - echo "cd tmp-ue" >> $1 - echo "echo \"unzip -qq -DD ../localZip.zip\"" >> $1 - echo "unzip -qq -DD ../localZip.zip" >> $1 - echo "echo \"source oaienv\"" >> $1 - echo "source oaienv" >> $1 - echo "cd cmake_targets/" >> $1 - echo "mkdir log" >> $1 - echo "chmod 777 log" >> $1 - echo "echo \"./build_oai --UE \"" >> $1 - echo "./build_oai --UE > log/ue-build.txt 2>&1" >> $1 - echo "cd tools" >> $1 - echo "sudo ifconfig lo: 127.0.0.2 netmask 255.0.0.0 up" >> $1 - echo "sudo chmod 666 /etc/iproute2/rt_tables" >> $1 - echo "source init_nas_s1 UE" >> $1 - echo "ifconfig" >> $1 - ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1 - rm -f $1 -} - -function start_l2_sim_enb { - local LOC_ENB_VM_IP_ADDR=$2 - local LOC_EPC_IP_ADDR=$3 - local LOC_UE_VM_IP_ADDR=$4 - local LOC_LOG_FILE=$5 - local LOC_NB_RBS=$6 - local LOC_CONF_FILE=$7 - # 1 is with S1 and 0 without S1 aka noS1 - local LOC_S1_CONFIGURATION=$8 - echo "cd /home/ubuntu/tmp" > $1 - echo "echo \"sudo apt-get --yes --quiet install daemon \"" >> $1 - echo "sudo apt-get --yes install daemon >> /home/ubuntu/tmp/cmake_targets/log/daemon-install.txt 2>&1" >> $1 - echo "echo \"source oaienv\"" >> $1 - echo "source oaienv" >> $1 - echo "cd ci-scripts/conf_files/" >> $1 - echo "cp $LOC_CONF_FILE ci-$LOC_CONF_FILE" >> $1 - echo "sed -i -e 's#N_RB_DL.*=.*;#N_RB_DL = $LOC_NB_RBS;#' -e 's#CI_MME_IP_ADDR#$LOC_EPC_IP_ADDR#' -e 's#CI_ENB_IP_ADDR#$LOC_ENB_VM_IP_ADDR#' -e 's#CI_UE_IP_ADDR#$LOC_UE_VM_IP_ADDR#' ci-$LOC_CONF_FILE" >> $1 - echo "echo \"grep N_RB_DL ci-$LOC_CONF_FILE\"" >> $1 - echo "grep N_RB_DL ci-$LOC_CONF_FILE | sed -e 's#N_RB_DL.*=#N_RB_DL =#'" >> $1 - echo "echo \"cd /home/ubuntu/tmp/cmake_targets/ran_build/build/\"" >> $1 - echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1 - echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1 - if [ $LOC_S1_CONFIGURATION -eq 0 ] - then - echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor,time --noS1\" > ./my-lte-softmodem-run.sh " >> $1 - else - echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor,time \" > ./my-lte-softmodem-run.sh " >> $1 - fi - echo "chmod 775 ./my-lte-softmodem-run.sh" >> $1 - echo "cat ./my-lte-softmodem-run.sh" >> $1 - echo "if [ -e /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE; fi" >> $1 - echo "sudo -E daemon --inherit --unsafe --name=enb_daemon --chdir=/home/ubuntu/tmp/cmake_targets/ran_build/build/ -o /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ./my-lte-softmodem-run.sh" >> $1 - - ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_ENB_VM_IP_ADDR < $1 - rm $1 - - local i="0" - echo "egrep -c \"Waiting for PHY_config_req\" /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE" > $1 - while [ $i -lt 10 ] - do - sleep 5 - CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_ENB_VM_IP_ADDR < $1` - if [ $CONNECTED -ne 0 ] - then - i="100" - else - i=$[$i+1] - fi - done - echo "echo \"free -m\"" > $1 - echo "free -m" >> $1 - ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_ENB_VM_IP_ADDR < $1 - rm $1 - ENB_SYNC=1 - if [ $i -lt 50 ] - then - ENB_SYNC=0 - echo "L2-SIM eNB is NOT sync'ed: process still alive?" - else - echo "L2-SIM eNB is sync'ed: waiting for UE(s) to connect" - fi - if [ $LOC_S1_CONFIGURATION -eq 0 ] - then - echo "ifconfig oaitun_enb1 | egrep -c \"inet addr\"" > $1 - # Checking oaitun_enb1 interface has now an IP address - i="0" - while [ $i -lt 10 ] - do - CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_ENB_VM_IP_ADDR < $1` - if [ $CONNECTED -eq 1 ] - then - i="100" - else - i=$[$i+1] - sleep 5 - fi - done - rm $1 - if [ $i -lt 50 ] - then - ENB_SYNC=0 - echo "L2-SIM eNB oaitun_enb1 is DOWN or NOT CONFIGURED" - else - echo "L2-SIM eNB oaitun_enb1 is UP and CONFIGURED" - fi - fi - sleep 10 -} - -function add_ue_l2_sim_ue { - local LOC_UE_VM_IP_ADDR=$2 - local LOC_NB_UES=$3 - echo "cd /home/ubuntu/tmp/" > $1 - echo "source oaienv" >> $1 - if [ $LOC_NB_UES -gt 1 ] - then - echo "echo \"cd openair3/NAS/TOOLS/\"" >> $1 - echo "cd openair3/NAS/TOOLS/" >> $1 - echo "echo \"awk -v num_ues=$LOC_NB_UES -f /home/ubuntu/tmp/ci-scripts/add_user_to_conf_file.awk ue_eurecom_test_sfr.conf > ue_eurecom_test_sfr_multi_ues.conf\"" >> $1 - echo "awk -v num_ues=$LOC_NB_UES -f /home/ubuntu/tmp/ci-scripts/add_user_to_conf_file.awk ue_eurecom_test_sfr.conf > ue_eurecom_test_sfr_multi_ues.conf" >> $1 - fi - echo "echo \"cd /home/ubuntu/tmp/cmake_targets/ran_build/build/\"" >> $1 - echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1 - echo "sudo rm -f *.u*" >> $1 - if [ $LOC_NB_UES -eq 1 ] - then - echo "echo \"sudo ../../nas_sim_tools/build/conf2uedata -c ../../../openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf -o .\"" >> $1 - echo "sudo ../../nas_sim_tools/build/conf2uedata -c ../../../openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf -o . > /home/ubuntu/tmp/cmake_targets/log/ue_adapt.txt 2>&1" >> $1 - else - echo "echo \"sudo ../../nas_sim_tools/build/conf2uedata -c ../../../openair3/NAS/TOOLS/ue_eurecom_test_sfr_multi_ues.conf -o .\"" >> $1 - echo "sudo ../../nas_sim_tools/build/conf2uedata -c ../../../openair3/NAS/TOOLS/ue_eurecom_test_sfr_multi_ues.conf -o . > /home/ubuntu/tmp/cmake_targets/log/ue_adapt.txt 2>&1" >> $1 - fi - - ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_UE_VM_IP_ADDR < $1 - rm $1 -} - -function start_l2_sim_ue { - local LOC_UE_VM_IP_ADDR=$2 - local LOC_ENB_VM_IP_ADDR=$3 - local LOC_LOG_FILE=$4 - local LOC_CONF_FILE=$5 - local LOC_NB_UES=$6 - # 1 is with S1 and 0 without S1 aka noS1 - local LOC_S1_CONFIGURATION=$7 - echo "echo \"sudo apt-get --yes --quiet install daemon \"" > $1 - echo "sudo apt-get --yes install daemon >> /home/ubuntu/tmp/cmake_targets/log/daemon-install.txt 2>&1" >> $1 - echo "cd /home/ubuntu/tmp/ci-scripts/conf_files/" >> $1 - echo "cp $LOC_CONF_FILE ci-$LOC_CONF_FILE" >> $1 - echo "sed -i -e 's#CI_ENB_IP_ADDR#$LOC_ENB_VM_IP_ADDR#' -e 's#CI_UE_IP_ADDR#$LOC_UE_VM_IP_ADDR#' ci-$LOC_CONF_FILE" >> $1 - echo "echo \"cd /home/ubuntu/tmp/cmake_targets/ran_build/build/\"" >> $1 - echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1 - echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1 - if [ $LOC_S1_CONFIGURATION -eq 0 ] - then - echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --L2-emul 3 --num-ues $LOC_NB_UES --nums_ue_thread 1 --nokrnmod 1 --log_config.global_log_options level,nocolor,time --noS1\" > ./my-lte-softmodem-run.sh " >> $1 - else - echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --L2-emul 3 --num-ues $LOC_NB_UES --nums_ue_thread 1 --nokrnmod 1 --log_config.global_log_options level,nocolor,time\" > ./my-lte-softmodem-run.sh " >> $1 - fi - echo "chmod 775 ./my-lte-softmodem-run.sh" >> $1 - echo "cat ./my-lte-softmodem-run.sh" >> $1 - echo "if [ -e /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE; fi" >> $1 - echo "sudo -E daemon --inherit --unsafe --name=ue_daemon --chdir=/home/ubuntu/tmp/cmake_targets/ran_build/build/ -o /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ./my-lte-softmodem-run.sh" >> $1 - - ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_UE_VM_IP_ADDR < $1 - rm $1 - - local i="0" - echo "egrep -c \"Received NFAPI_START_REQ\" /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE" > $1 - while [ $i -lt 10 ] - do - sleep 5 - CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_UE_VM_IP_ADDR < $1` - if [ $CONNECTED -eq 1 ] - then - i="100" - else - i=$[$i+1] - fi - done - echo "echo \"free -m\"" > $1 - echo "free -m" >> $1 - ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_UE_VM_IP_ADDR < $1 - rm $1 - UE_SYNC=1 - if [ $i -lt 50 ] - then - UE_SYNC=0 - echo "L2-SIM UE is NOT sync'ed w/ eNB" - return - else - echo "L2-SIM UE is sync'ed w/ eNB" - fi - local max_interfaces_to_check=$LOC_NB_UES - #local max_interfaces_to_check=1 - #if [ $LOC_S1_CONFIGURATION -eq 0 ]; then max_interfaces_to_check=$LOC_NB_UES; fi - local j="1" - while [ $j -le $max_interfaces_to_check ] - do - echo "ifconfig oaitun_ue${j} | egrep -c \"inet addr\"" > $1 - # Checking oaitun_ue1 interface has now an IP address - i="0" - while [ $i -lt 10 ] - do - CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_UE_VM_IP_ADDR < $1` - if [ $CONNECTED -eq 1 ] - then - i="100" - else - i=$[$i+1] - sleep 5 - fi - done - rm $1 - if [ $i -lt 50 ] - then - UE_SYNC=0 - echo "L2-SIM UE oaitun_ue${j} is DOWN or NOT CONFIGURED" - else - echo "L2-SIM UE oaitun_ue${j} is UP and CONFIGURED" - fi - j=$[$j+1] - done - sleep 10 - # for debug - if [ $LOC_S1_CONFIGURATION -eq 1 ] - then - echo "ifconfig" > $1 - ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_UE_VM_IP_ADDR < $1 - rm $1 - else - echo "Setting Routes for all UEs" - echo "cd /home/ubuntu/tmp/cmake_targets/tools" > $1 - echo "./setup_routes.sh $LOC_NB_UES" >> $1 - ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_UE_VM_IP_ADDR < $1 - rm $1 - fi -} - -function full_l2_sim_destroy { - if [ $KEEP_VM_ALIVE -eq 0 ] - then - echo "############################################################" - echo "Destroying VMs" - echo "############################################################" - uvt-kvm destroy $ENB_VM_NAME - ssh-keygen -R $ENB_VM_IP_ADDR - uvt-kvm destroy $UE_VM_NAME - ssh-keygen -R $UE_VM_IP_ADDR - fi -} - -function start_rf_sim_enb { - local LOC_ENB_VM_IP_ADDR=$2 - local LOC_EPC_IP_ADDR=$3 - local LOC_LOG_FILE=$4 - local LOC_NB_RBS=$5 - local LOC_CONF_FILE=$6 - # 1 is with S1 and 0 without S1 aka noS1 - local LOC_S1_CONFIGURATION=$7 - echo "cd /home/ubuntu/tmp" > $1 - echo "echo \"sudo apt-get --yes --quiet install daemon \"" >> $1 - echo "sudo apt-get --yes install daemon >> /home/ubuntu/tmp/cmake_targets/log/daemon-install.txt 2>&1" >> $1 - echo "echo \"export RFSIMULATOR=enb\"" >> $1 - echo "export RFSIMULATOR=enb" >> $1 - echo "echo \"source oaienv\"" >> $1 - echo "source oaienv" >> $1 - echo "cd ci-scripts/conf_files/" >> $1 - echo "cp $LOC_CONF_FILE ci-$LOC_CONF_FILE" >> $1 - echo "sed -i -e 's#N_RB_DL.*=.*;#N_RB_DL = $LOC_NB_RBS;#' -e 's#CI_MME_IP_ADDR#$LOC_EPC_IP_ADDR#' -e 's#CI_ENB_IP_ADDR#$LOC_ENB_VM_IP_ADDR#' -e 's#CI_UE_IP_ADDR#$LOC_UE_VM_IP_ADDR#' ci-$LOC_CONF_FILE" >> $1 - echo "echo \"grep N_RB_DL ci-$LOC_CONF_FILE\"" >> $1 - echo "grep N_RB_DL ci-$LOC_CONF_FILE | sed -e 's#N_RB_DL.*=#N_RB_DL =#'" >> $1 - echo "echo \"cd /home/ubuntu/tmp/cmake_targets/ran_build/build/\"" >> $1 - echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1 - echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1 - if [ $LOC_S1_CONFIGURATION -eq 0 ] - then - echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --rfsim --log_config.global_log_options level,nocolor,time --noS1 --eNBs.[0].rrc_inactivity_threshold 0\" > ./my-lte-softmodem-run.sh " >> $1 - else - echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --rfsim --log_config.global_log_options level,nocolor,time --eNBs.[0].rrc_inactivity_threshold 0 --eNBs.[0].plmn_list.[0].mnc 93\" > ./my-lte-softmodem-run.sh " >> $1 - fi - echo "chmod 775 ./my-lte-softmodem-run.sh" >> $1 - echo "cat ./my-lte-softmodem-run.sh" >> $1 - echo "if [ -e /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE; fi" >> $1 - echo "sudo -E daemon --inherit --unsafe --name=enb_daemon --chdir=/home/ubuntu/tmp/cmake_targets/ran_build/build/ -o /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ./my-lte-softmodem-run.sh" >> $1 - - ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_ENB_VM_IP_ADDR < $1 - rm $1 - - local i="0" - echo "egrep -c \"got sync\" /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE" > $1 - while [ $i -lt 10 ] - do - sleep 5 - CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_ENB_VM_IP_ADDR < $1` - if [ $CONNECTED -ne 0 ] - then - i="100" - else - i=$[$i+1] - fi - done - echo "echo \"free -m\"" > $1 - echo "free -m" >> $1 - ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_ENB_VM_IP_ADDR < $1 - rm $1 - if [ $i -lt 50 ] - then - ENB_SYNC=0 - echo "RF-SIM eNB is NOT sync'ed: process still alive?" - else - ENB_SYNC=1 - echo "RF-SIM eNB is sync'ed: waiting for UE(s) to connect" - fi - if [ $LOC_S1_CONFIGURATION -eq 0 ] - then - echo "ifconfig oaitun_enb1 | egrep -c \"inet addr\"" > $1 - # Checking oaitun_enb1 interface has now an IP address - i="0" - while [ $i -lt 10 ] - do - CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_ENB_VM_IP_ADDR < $1` - if [ $CONNECTED -eq 1 ] - then - i="100" - else - i=$[$i+1] - sleep 5 - fi - done - rm $1 - if [ $i -lt 50 ] - then - ENB_SYNC=0 - echo "RF-SIM eNB oaitun_enb1 is DOWN or NOT CONFIGURED" - else - echo "RF-SIM eNB oaitun_enb1 is UP and CONFIGURED" - fi - if [[ $LOC_CONF_FILE =~ .*mbms.* ]] - then - echo "ifconfig oaitun_enm1 | egrep -c \"inet addr\"" > $1 - # Checking oaitun_enm1 interface has now an IP address - i="0" - while [ $i -lt 10 ] - do - CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_ENB_VM_IP_ADDR < $1` - if [ $CONNECTED -eq 1 ] - then - i="100" - else - i=$[$i+1] - sleep 5 - fi - done - rm $1 - if [ $i -lt 50 ] - then - ENB_SYNC=0 - echo "RF-SIM eNB oaitun_enm1 is DOWN or NOT CONFIGURED" - else - echo "RF-SIM eNB oaitun_enm1 is UP and CONFIGURED" - fi - fi - fi - sleep 10 -} - -function start_rf_sim_ue { - local LOC_UE_VM_IP_ADDR=$2 - local LOC_ENB_VM_IP_ADDR=$3 - local LOC_LOG_FILE=$4 - local LOC_PRB=$5 - local LOC_FREQUENCY=$6 - # 1 is with S1 and 0 without S1 aka noS1 - local LOC_S1_CONFIGURATION=$7 - local LOC_MBMS_CONFIGURATION=$8 - echo "echo \"sudo apt-get --yes --quiet install daemon \"" > $1 - echo "sudo apt-get --yes install daemon >> /home/ubuntu/tmp/cmake_targets/log/daemon-install.txt 2>&1" >> $1 - echo "echo \"export RFSIMULATOR=${LOC_ENB_VM_IP_ADDR}\"" >> $1 - echo "export RFSIMULATOR=${LOC_ENB_VM_IP_ADDR}" >> $1 - echo "echo \"cd /home/ubuntu/tmp/cmake_targets/ran_build/build/\"" >> $1 - echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1 - echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1 - echo "echo \"sudo ../../nas_sim_tools/build/conf2uedata -c ../../../openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf -o .\"" >> $1 - echo "sudo ../../nas_sim_tools/build/conf2uedata -c ../../../openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf -o ." >> $1 - if [ $LOC_S1_CONFIGURATION -eq 0 ] - then - echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_PRB --ue-rxgain 140 --ue-txgain 120 --nokrnmod 1 --rfsim --log_config.global_log_options level,nocolor,time --noS1\" > ./my-lte-softmodem-run.sh " >> $1 - else - echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_PRB --ue-rxgain 140 --ue-txgain 120 --nokrnmod 1 --rfsim --log_config.global_log_options level,nocolor,time\" > ./my-lte-softmodem-run.sh " >> $1 - fi - echo "chmod 775 ./my-lte-softmodem-run.sh" >> $1 - echo "cat ./my-lte-softmodem-run.sh" >> $1 - echo "if [ -e /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE; fi" >> $1 - echo "sudo -E daemon --inherit --unsafe --name=ue_daemon --chdir=/home/ubuntu/tmp/cmake_targets/ran_build/build/ -o /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ./my-lte-softmodem-run.sh" >> $1 - - ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_UE_VM_IP_ADDR < $1 - rm $1 - - local i="0" - echo "egrep -c \"got sync\" /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE" > $1 - while [ $i -lt 10 ] - do - sleep 5 - CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_UE_VM_IP_ADDR < $1` - if [ $CONNECTED -ne 0 ] - then - i="100" - else - i=$[$i+1] - fi - done - UE_SYNC=1 - rm $1 - if [ $i -lt 50 ] - then - UE_SYNC=0 - echo "RF-SIM UE is NOT sync'ed w/ eNB" - return - else - echo "RF-SIM UE is sync'ed w/ eNB" - fi - # Checking oaitun_ue1 interface has now an IP address - i="0" - echo "ifconfig oaitun_ue1 | egrep -c \"inet addr\"" > $1 - while [ $i -lt 10 ] - do - sleep 5 - CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_UE_VM_IP_ADDR < $1` - if [ $CONNECTED -eq 1 ] - then - i="100" - else - i=$[$i+1] - fi - done - echo "echo \"free -m\"" > $1 - echo "free -m" >> $1 - ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_UE_VM_IP_ADDR < $1 - rm $1 - if [ $i -lt 50 ] - then - UE_SYNC=0 - echo "RF-SIM UE oaitun_ue1 is DOWN or NOT CONFIGURED" - else - echo "RF-SIM UE oaitun_ue1 is UP and CONFIGURED" - fi - if [ $LOC_MBMS_CONFIGURATION -eq 1 ] - then - # Checking oaitun_uem1 interface has now an IP address - i="0" - echo "ifconfig oaitun_uem1 | egrep -c \"inet addr\"" > $1 - while [ $i -lt 10 ] - do - sleep 5 - CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_UE_VM_IP_ADDR < $1` - if [ $CONNECTED -eq 1 ] - then - i="100" - else - i=$[$i+1] - fi - done - rm $1 - if [ $i -lt 50 ] - then - UE_SYNC=0 - echo "RF-SIM UE oaitun_uem1 is DOWN or NOT CONFIGURED" - else - echo "RF-SIM UE oaitun_uem1 is UP and CONFIGURED" - fi - fi - sleep 10 -} - - -function start_rf_sim_gnb { - local LOC_GNB_VM_IP_ADDR=$2 - local LOC_LOG_FILE=$3 - local LOC_NB_RBS=$4 - local LOC_CONF_FILE=$5 - # 1 is with S1 and 0 without S1 aka noS1 - local LOC_S1_CONFIGURATION=$6 - #LOC_RA_SA_TEST=1 will run the RA test check ; =2 will run the SA test - local LOC_RA_SA_TEST=$7 - - if [ -e rbconfig.raw ]; then rm -f rbconfig.raw; fi - if [ -e reconfig.raw ]; then rm -f reconfig.raw; fi - - echo "cd /home/ubuntu/tmp" > $1 - echo "echo \"sudo apt-get --yes --quiet install daemon \"" >> $1 - echo "sudo apt-get --yes install daemon >> /home/ubuntu/tmp/cmake_targets/log/daemon-install.txt 2>&1" >> $1 - echo "echo \"source oaienv\"" >> $1 - echo "source oaienv" >> $1 - echo "echo \"export RFSIMULATOR=server\"" >> $1 - echo "export RFSIMULATOR=server" >> $1 - echo "cd ci-scripts/conf_files/" >> $1 - echo "cp $LOC_CONF_FILE ci-$LOC_CONF_FILE" >> $1 - #echo "sed -i -e 's#N_RB_DL.*=.*;#N_RB_DL = $LOC_NB_RBS;#' -e 's#CI_MME_IP_ADDR#$LOC_EPC_IP_ADDR#' -e 's#CI_ENB_IP_ADDR#$LOC_ENB_VM_IP_ADDR#' -e 's#CI_UE_IP_ADDR#$LOC_UE_VM_IP_ADDR#' ci-$LOC_CONF_FILE" >> $1 - #echo "echo \"grep N_RB_DL ci-$LOC_CONF_FILE\"" >> $1 - #echo "grep N_RB_DL ci-$LOC_CONF_FILE | sed -e 's#N_RB_DL.*=#N_RB_DL =#'" >> $1 - echo "echo \"cd /home/ubuntu/tmp/cmake_targets/ran_build/build/\"" >> $1 - echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1 - echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1 - echo "sudo rm -f r*config.raw" >> $1 - if [ $LOC_S1_CONFIGURATION -eq 0 ] - then - if [ $LOC_RA_SA_TEST -eq 0 ] #no RA test => use --phy-test option - then - echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor,time --parallel-config PARALLEL_SINGLE_THREAD --noS1 --nokrnmod 1 --rfsim --phy-test --noS1\" > ./my-nr-softmodem-run.sh " >> $1 - elif [ $LOC_RA_SA_TEST -eq 1 ] #RA test => use --do-ra option - then - echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor,time --parallel-config PARALLEL_SINGLE_THREAD --rfsim --do-ra --noS1\" > ./my-nr-softmodem-run.sh " >> $1 - else #SA test => use --sa option - echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor,time --parallel-config PARALLEL_SINGLE_THREAD --rfsim --sa \" > ./my-nr-softmodem-run.sh " >> $1 - fi - fi - echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1 - echo "cat ./my-nr-softmodem-run.sh" >> $1 - echo "if [ -e /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE; fi" >> $1 - echo "sudo -E daemon --inherit --unsafe --name=gnb_daemon --chdir=/home/ubuntu/tmp/cmake_targets/ran_build/build/ -o /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ./my-nr-softmodem-run.sh" >> $1 - - ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_GNB_VM_IP_ADDR < $1 - rm $1 - - - local i="0" - echo "egrep -c \"got sync\" /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE" > $1 - while [ $i -lt 10 ] - do - sleep 5 - CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_GNB_VM_IP_ADDR < $1` - if [ $CONNECTED -ne 0 ] - then - i="100" - else - i=$[$i+1] - fi - done - rm $1 - if [ $i -lt 50 ] - then - GNB_SYNC=0 - echo "RF-SIM gNB is NOT sync'ed: process still alive?" - else - GNB_SYNC=1 - echo "RF-SIM gNB is sync'ed: waiting for UE(s) to connect" - fi - - # check noS1 config only outside RA test (as it does not support noS1) - if [ $LOC_S1_CONFIGURATION -eq 0 ] && [ $LOC_RA_SA_TEST -eq 0 ] - then - echo "ifconfig oaitun_enb1 | egrep -c \"inet addr\"" > $1 - # Checking oaitun_enb1 interface has now an IP address - i="0" - while [ $i -lt 10 ] - do - CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_GNB_VM_IP_ADDR < $1` - if [ $CONNECTED -eq 1 ] - then - i="100" - else - i=$[$i+1] - sleep 5 - fi - done - rm $1 - if [ $i -lt 50 ] - then - GNB_SYNC=0 - echo "RF-SIM gNB oaitun_enb1 is DOWN or NOT CONFIGURED" - else - echo "RF-SIM gNB oaitun_enb1 is UP and CONFIGURED" - fi - fi - - - sleep 10 - echo "echo \"free -m\"" > $1 - echo "free -m" >> $1 - ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_GNB_VM_IP_ADDR < $1 - rm $1 - # Copy the RAW files from the gNB run for the NR-UE - if [ $LOC_RA_SA_TEST -ne 2 ] - then - scp -o StrictHostKeyChecking=no ubuntu@$LOC_GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/ran_build/build/rbconfig.raw . - scp -o StrictHostKeyChecking=no ubuntu@$LOC_GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/ran_build/build/reconfig.raw . - fi -} - -function start_rf_sim_nr_ue { - local LOC_NR_UE_VM_IP_ADDR=$2 - local LOC_GNB_VM_IP_ADDR=$3 - local LOC_LOG_FILE=$4 - local LOC_PRB=$5 - local LOC_FREQUENCY=$6 - # 1 is with S1 and 0 without S1 aka noS1 - local LOC_S1_CONFIGURATION=$7 - #LOC_RA_SA_TEST=1 will run the RA test check ; =2 will run the SA test - local LOC_RA_SA_TEST=$8 - - # Copy the RAW files from the gNB run - if [ $LOC_RA_SA_TEST -ne 2 ] - then - scp -o StrictHostKeyChecking=no rbconfig.raw ubuntu@$LOC_NR_UE_VM_IP_ADDR:/home/ubuntu/tmp - scp -o StrictHostKeyChecking=no reconfig.raw ubuntu@$LOC_NR_UE_VM_IP_ADDR:/home/ubuntu/tmp - fi - - echo "echo \"sudo apt-get --yes --quiet install daemon \"" > $1 - echo "sudo apt-get --yes install daemon >> /home/ubuntu/tmp/cmake_targets/log/daemon-install.txt 2>&1" >> $1 - echo "echo \"export RFSIMULATOR=${LOC_GNB_VM_IP_ADDR}\"" >> $1 - echo "export RFSIMULATOR=${LOC_GNB_VM_IP_ADDR}" >> $1 - echo "echo \"cd /home/ubuntu/tmp/cmake_targets/ran_build/build/\"" >> $1 - echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1 - echo "sudo rm -f /home/ubuntu/tmp/cmake_targets/ran_build/build/r*config.raw" >> $1 - if [ $LOC_RA_SA_TEST -ne 2 ] - then - echo "sudo cp /home/ubuntu/tmp/r*config.raw /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1 - echo "sudo chmod 666 /home/ubuntu/tmp/cmake_targets/ran_build/build/r*config.raw" >> $1 - fi - echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1 - if [ $LOC_S1_CONFIGURATION -eq 0 ] - then - if [ $LOC_RA_SA_TEST -eq 0 ] #no RA test => use --phy-test option - then - echo "echo \"./nr-uesoftmodem --nokrnmod 1 --rfsim --phy-test --rrc_config_path /home/ubuntu/tmp/cmake_targets/ran_build/build/ --log_config.global_log_options level,nocolor,time --noS1\" > ./my-nr-softmodem-run.sh " >> $1 - elif [ $LOC_RA_SA_TEST -eq 1 ] #RA test => use --do-ra option - then - echo "echo \"./nr-uesoftmodem --rfsim --do-ra --log_config.global_log_options level,nocolor,time --rrc_config_path /home/ubuntu/tmp/cmake_targets/ran_build/build/\" > ./my-nr-softmodem-run.sh " >> $1 - elif [ $LOC_RA_SA_TEST -eq 2 ] #SA test 106PRB => use --sa option - then - echo "echo \"./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --sa --log_config.global_log_options level,nocolor,time\" > ./my-nr-softmodem-run.sh " >> $1 - else # -eq 3 SA test 24PRB - echo "echo \"./nr-uesoftmodem -r 24 --ssb 24 --numerology 1 --band 78 -C 3604320000 --rfsim --sa --log_config.global_log_options level,nocolor,time\" > ./my-nr-softmodem-run.sh " >> $1 - fi - fi - echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1 - echo "cat ./my-nr-softmodem-run.sh" >> $1 - echo "if [ -e /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE; fi" >> $1 - echo "sudo -E daemon --inherit --unsafe --name=nr_ue_daemon --chdir=/home/ubuntu/tmp/cmake_targets/ran_build/build/ -o /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ./my-nr-softmodem-run.sh" >> $1 - - ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_NR_UE_VM_IP_ADDR < $1 - rm $1 - - local i="0" - echo "egrep -c \"Initial sync: pbch decoded sucessfully\" /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE" > $1 - while [ $i -lt 10 ] - do - sleep 5 - CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_NR_UE_VM_IP_ADDR < $1` - if [ $CONNECTED -ne 0 ] - then - i="100" - else - i=$[$i+1] - fi - done - NR_UE_SYNC=1 - rm $1 - if [ $i -lt 50 ] - then - NR_UE_SYNC=0 - echo "RF-SIM NR-UE is NOT sync'ed w/ gNB" - return - else - echo "RF-SIM NR-UE is sync'ed w/ gNB" - fi - # Checking oaitun_ue1 interface has now an IP address (only outside RA test) - if [ $LOC_RA_SA_TEST -eq 0 ] - then - i="0" - echo "ifconfig oaitun_ue1 | egrep -c \"inet addr\"" > $1 - while [ $i -lt 10 ] - do - sleep 5 - CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_NR_UE_VM_IP_ADDR < $1` - if [ $CONNECTED -eq 1 ] - then - i="100" - else - i=$[$i+1] - fi - done - echo "echo \"free -m\"" > $1 - echo "free -m" >> $1 - ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_NR_UE_VM_IP_ADDR < $1 - rm $1 - if [ $i -lt 50 ] - then - NR_UE_SYNC=0 - echo "RF-SIM NR-UE oaitun_ue1 is DOWN or NOT CONFIGURED" - else - echo "RF-SIM NR-UE oaitun_ue1 is UP and CONFIGURED" - fi - sleep 10 - fi -} - - -function run_test_on_vm { - echo "############################################################" - echo "OAI CI VM script" - echo "############################################################" - if [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-l2-sim.* )) ]] - then - echo "This VM test type is no longer supported in the pipeline framework" - return - fi - if [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-basic-sim.* )) ]] - then - echo "This VM test type is no longer supported in the pipeline framework" - return - fi - if [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-rf-sim.* )) ]] - then - echo "This VM test type is no longer supported in the pipeline framework" - return - elif [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-rf5g-sim.* )) ]] - then - echo "This VM test type is no longer supported in the pipeline framework" - return - else - echo "VM_NAME = $VM_NAME" - echo "VM_CMD_FILE = $VM_CMDS" - fi - echo "JENKINS_WKSP = $JENKINS_WKSP" - echo "ARCHIVES_LOC = $ARCHIVES_LOC" - - if [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-rf-sim.* )) ]] - then - echo "############################################################" - echo "Waiting for ENB VM to be started" - echo "############################################################" - uvt-kvm wait $ENB_VM_NAME --insecure - - ENB_VM_IP_ADDR=`uvt-kvm ip $ENB_VM_NAME` - echo "$ENB_VM_NAME has for IP addr = $ENB_VM_IP_ADDR" - - echo "############################################################" - echo "Waiting for UE VM to be started" - echo "############################################################" - uvt-kvm wait $UE_VM_NAME --insecure - - UE_VM_IP_ADDR=`uvt-kvm ip $UE_VM_NAME` - echo "$UE_VM_NAME has for IP addr = $UE_VM_IP_ADDR" - - elif [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-rf5g-sim.* )) ]] - then - echo "############################################################" - echo "Waiting for GNB VM to be started" - echo "############################################################" - uvt-kvm wait $GNB_VM_NAME --insecure - - GNB_VM_IP_ADDR=`uvt-kvm ip $GNB_VM_NAME` - echo "$GNB_VM_NAME has for IP addr = $GNB_VM_IP_ADDR" - - echo "############################################################" - echo "Waiting for NR-UE VM to be started" - echo "############################################################" - uvt-kvm wait $NR_UE_VM_NAME --insecure - - NR_UE_VM_IP_ADDR=`uvt-kvm ip $NR_UE_VM_NAME` - echo "$NR_UE_VM_NAME has for IP addr = $NR_UE_VM_IP_ADDR" - else - echo "############################################################" - echo "Waiting for VM to be started" - echo "############################################################" - uvt-kvm wait $VM_NAME --insecure - - VM_IP_ADDR=`uvt-kvm ip $VM_NAME` - echo "$VM_NAME has for IP addr = $VM_IP_ADDR" - fi - - if [ "$RUN_OPTIONS" == "none" ] || [[ $RUN_OPTIONS =~ .*run_exec_autotests.* ]] - then - echo "No run on VM testing for this variant currently" - return - fi - - if [[ $RUN_OPTIONS =~ .*run_XXXX_autotests.* ]] - then - echo "############################################################" - echo "Running test script on VM ($VM_NAME)" - echo "############################################################" - echo "echo \"sudo apt-get --yes --quiet install bc \"" > $VM_CMDS - echo "sudo apt-get update > bc-install.txt 2>&1" >> $VM_CMDS - echo "sudo apt-get --yes install bc >> bc-install.txt 2>&1" >> $VM_CMDS - echo "cd tmp" >> $VM_CMDS - echo "echo \"source oaienv\"" >> $VM_CMDS - echo "source oaienv" >> $VM_CMDS - echo "echo \"cd cmake_targets/autotests\"" >> $VM_CMDS - echo "cd cmake_targets/autotests" >> $VM_CMDS - echo "echo \"rm -Rf log\"" >> $VM_CMDS - echo "rm -Rf log" >> $VM_CMDS - echo "$RUN_OPTIONS" | sed -e 's@"@\\"@g' -e 's@^@echo "@' -e 's@$@"@' >> $VM_CMDS - echo "$RUN_OPTIONS" >> $VM_CMDS - echo "cp /home/ubuntu/bc-install.txt log" >> $VM_CMDS - echo "cd log" >> $VM_CMDS - echo "zip -r -qq tmp.zip *.* 0*" >> $VM_CMDS - echo "echo \"############################################################\"" >> $VM_CMDS - echo "echo \"Evaluating remaining memory on disk!\"" >> $VM_CMDS - echo "echo \"############################################################\"" >> $VM_CMDS - echo "echo \"df -h\"" >> $VM_CMDS - echo "df -h" >> $VM_CMDS - - ssh -T -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR < $VM_CMDS - - echo "############################################################" - echo "Creating a tmp folder to store results and artifacts" - echo "############################################################" - - if [ -d $ARCHIVES_LOC ] - then - rm -Rf $ARCHIVES_LOC - fi - mkdir --parents $ARCHIVES_LOC - - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/autotests/log/tmp.zip $ARCHIVES_LOC - pushd $ARCHIVES_LOC - unzip -qq -DD tmp.zip - rm tmp.zip - if [ -f results_autotests.xml ] - then - FUNCTION=`echo $VM_NAME | sed -e "s@$VM_TEMPLATE@@"` - NEW_NAME=`echo "results_autotests.xml" | sed -e "s@results_autotests@results_autotests-$FUNCTION@"` - echo "" > $NEW_NAME - echo "" >> $NEW_NAME - cat results_autotests.xml >> $NEW_NAME - sed -e "s@TEMPLATE@$FUNCTION@" $JENKINS_WKSP/ci-scripts/template.xsl > $FUNCTION.xsl - #mv results_autotests.xml $NEW_NAME - rm results_autotests.xml - fi - popd - - if [ $KEEP_VM_ALIVE -eq 0 ] - then - echo "############################################################" - echo "Destroying VM" - echo "############################################################" - uvt-kvm destroy $VM_NAME - ssh-keygen -R $VM_IP_ADDR - fi - rm -f $VM_CMDS - - echo "############################################################" - echo "Checking run status" - echo "############################################################" - - LOG_FILES=`ls $ARCHIVES_LOC/results_autotests*.xml` - NB_FOUND_FILES=0 - NB_RUNS=0 - NB_FAILURES=0 - - for FULLFILE in $LOG_FILES - do - TESTSUITES=`egrep "testsuite errors" $FULLFILE` - for TESTSUITE in $TESTSUITES - do - if [[ "$TESTSUITE" == *"tests="* ]] - then - RUNS=`echo $TESTSUITE | awk 'BEGIN{FS="="}{print $2}END{}' | sed -e "s@'@@g" ` - NB_RUNS=$((NB_RUNS + RUNS)) - fi - if [[ "$TESTSUITE" == *"failures="* ]] - then - FAILS=`echo $TESTSUITE | awk 'BEGIN{FS="="}{print $2}END{}' | sed -e "s@'@@g" ` - NB_FAILURES=$((NB_FAILURES + FAILS)) - fi - done - NB_FOUND_FILES=$((NB_FOUND_FILES + 1)) - done - - echo "NB_FOUND_FILES = $NB_FOUND_FILES" - echo "NB_RUNS = $NB_RUNS" - echo "NB_FAILURES = $NB_FAILURES" - - if [ $NB_FOUND_FILES -eq 0 ]; then STATUS=-1; fi - if [ $NB_RUNS -eq 0 ]; then STATUS=-1; fi - if [ $NB_FAILURES -ne 0 ]; then STATUS=-1; fi - - if [ $STATUS -eq 0 ] - then - echo "TEST_OK" > $ARCHIVES_LOC/test_final_status.log - else - echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log - fi - fi - - if [[ "$RUN_OPTIONS" == "complex" ]] && [[ $VM_NAME =~ .*-rf-sim.* ]] - then - PING_STATUS=0 - IPERF_STATUS=0 - if [ -d $ARCHIVES_LOC ] - then - rm -Rf $ARCHIVES_LOC - fi - mkdir --parents $ARCHIVES_LOC - if [[ "$EPC_IPADDR" == "" ]] - then - # Creating a VM for EPC and installing SW - EPC_VM_NAME=`echo $VM_NAME | sed -e "s#rf-sim#epc#"` - EPC_VM_CMDS=${EPC_VM_NAME}_cmds.txt - LTEBOX=0 - install_epc_on_vm $EPC_VM_NAME $EPC_VM_CMDS - EPC_VM_IP_ADDR=`uvt-kvm ip $EPC_VM_NAME` - fi - #EPC_CONFIGS=("wS1" "noS1") - #TRANS_MODES=("fdd" "tdd") - #BW_CASES=(05 10 20) - EPC_CONFIGS=("wS1" "noS1") - TRANS_MODES=("fdd") - BW_CASES=(05 10) - for CN_CONFIG in ${EPC_CONFIGS[@]} - do - if [[ $CN_CONFIG =~ .*wS1.* ]] - then - if [[ "$EPC_IPADDR" == "" ]] - then - echo "############################################################" - echo "Start EPC for the wS1 configuration" - echo "############################################################" - start_epc $EPC_VM_NAME $EPC_VM_CMDS $EPC_VM_IP_ADDR - # Retrieve EPC real IP address - retrieve_real_epc_ip_addr $EPC_VM_NAME $EPC_VM_CMDS $EPC_VM_IP_ADDR - S1_NOS1_CFG=1 - else - echo "############################################################" - echo "Using external EPC " $EPC_IPADDR - echo "############################################################" - $EPC_VM_IP_ADDR=$EPC_IPADDR - S1_NOS1_CFG=1 - LTEBOX=0 - fi - else - if [[ "$EPC_IPADDR" == "" ]] - then - echo "############################################################" - echo "Terminate EPC" - echo "############################################################" - terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR - - echo "############################################################" - echo "Running now in a no-S1 " - echo "############################################################" - S1_NOS1_CFG=0 - fi - fi - for TMODE in ${TRANS_MODES[@]} - do - if [[ $TMODE =~ .*fdd.* ]] - then - CONF_FILE=enb.band7.tm1.50PRB.usrpb210.conf - FREQUENCY=2680 - else - CONF_FILE=enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf - FREQUENCY=2350 - fi - for BW in ${BW_CASES[@]} - do - if [[ $BW =~ .*05.* ]]; then PRB=25; fi - if [[ $BW =~ .*10.* ]]; then PRB=50; fi - if [[ $BW =~ .*20.* ]]; then PRB=100; fi - - echo "############################################################" - echo "${CN_CONFIG} : Starting the eNB in ${TMODE}-${BW}MHz mode" - echo "############################################################" - CURRENT_ENB_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_enb.log - start_rf_sim_enb $ENB_VM_CMDS "$ENB_VM_IP_ADDR" "$EPC_VM_IP_ADDR" $CURRENT_ENB_LOG_FILE $PRB $CONF_FILE $S1_NOS1_CFG - - echo "############################################################" - echo "${CN_CONFIG} : Starting the UE" - echo "############################################################" - CURRENT_UE_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_ue.log - start_rf_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_VM_IP_ADDR $CURRENT_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG 0 - if [ $UE_SYNC -eq 0 ] - then - echo "Problem w/ eNB and UE not syncing" - terminate_enb_ue_basic_sim $ENB_VM_CMDS $ENB_VM_IP_ADDR 1 - terminate_enb_ue_basic_sim $UE_VM_CMDS $UE_VM_IP_ADDR 2 - scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC - #if [ $S1_NOS1_CFG -eq 1 ] - #then - # terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR - #fi - # Now we keep running - STATUS=-1 - break - fi - - if [ $S1_NOS1_CFG -eq 1 ] - then - get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR 1 - - echo "############################################################" - echo "${CN_CONFIG} : Pinging the EPC from UE" - echo "############################################################" - PING_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_ping_epc.log - ping_epc_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $REAL_EPC_IP_ADDR $PING_LOG_FILE 1 0 - scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC - check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 - else - get_enb_noS1_ip_addr $ENB_VM_CMDS $ENB_VM_IP_ADDR - - echo "############################################################" - echo "${CN_CONFIG} : Pinging the eNB from UE" - echo "############################################################" - PING_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_ping_enb_from_ue.log - ping_epc_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_IP_ADDR $PING_LOG_FILE 1 0 - scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC - check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 - fi - - if [ $S1_NOS1_CFG -eq 1 ] - then - echo "############################################################" - echo "${CN_CONFIG} : Pinging the UE from EPC" - echo "############################################################" - PING_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_ping_ue.log - ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE 0 - scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC - check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 - else - echo "############################################################" - echo "${CN_CONFIG} : Pinging the UE from eNB" - echo "############################################################" - get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR 1 - PING_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_ping_from_enb_ue.log - ping_enb_ip_addr $ENB_VM_CMDS $ENB_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE 0 - scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC - check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 - fi - - if [ $S1_NOS1_CFG -eq 1 ] - then - echo "############################################################" - echo "${CN_CONFIG} : iperf DL -- UE is server and EPC is client" - echo "############################################################" - IPERF_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_iperf_dl - get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR 1 - THROUGHPUT=10 - generic_iperf $UE_VM_CMDS $UE_VM_IP_ADDR $UE_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR $REAL_EPC_IP_ADDR $THROUGHPUT $IPERF_LOG_FILE 1 0 - scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/${IPERF_LOG_FILE}_server.txt $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${IPERF_LOG_FILE}_client.txt $ARCHIVES_LOC - check_iperf $ARCHIVES_LOC/$IPERF_LOG_FILE $THROUGHPUT - - echo "############################################################" - echo "${CN_CONFIG} : iperf UL -- EPC is server and UE is client" - echo "############################################################" - IPERF_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_iperf_ul - THROUGHPUT=2 - get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR 1 - generic_iperf $EPC_VM_CMDS $EPC_VM_IP_ADDR $REAL_EPC_IP_ADDR $UE_VM_CMDS $UE_VM_IP_ADDR $UE_IP_ADDR $THROUGHPUT $IPERF_LOG_FILE 1 0 - scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${IPERF_LOG_FILE}_server.txt $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/${IPERF_LOG_FILE}_client.txt $ARCHIVES_LOC - check_iperf $ARCHIVES_LOC/$IPERF_LOG_FILE $THROUGHPUT - else - echo "############################################################" - echo "${CN_CONFIG} : iperf DL -- UE is server and eNB is client" - echo "############################################################" - get_enb_noS1_ip_addr $ENB_VM_CMDS $ENB_VM_IP_ADDR - IPERF_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_iperf_dl - get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR 1 - THROUGHPUT=10 - generic_iperf $UE_VM_CMDS $UE_VM_IP_ADDR $UE_IP_ADDR $ENB_VM_CMDS $ENB_VM_IP_ADDR $ENB_IP_ADDR $THROUGHPUT $IPERF_LOG_FILE 1 0 - scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/${IPERF_LOG_FILE}_server.txt $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/${IPERF_LOG_FILE}_client.txt $ARCHIVES_LOC - check_iperf $ARCHIVES_LOC/$IPERF_LOG_FILE $THROUGHPUT - - echo "############################################################" - echo "${CN_CONFIG} : iperf UL -- eNB is server and UE is client" - echo "############################################################" - IPERF_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_iperf_ul - THROUGHPUT=2 - get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR 1 - generic_iperf $ENB_VM_CMDS $ENB_VM_IP_ADDR $ENB_IP_ADDR $UE_VM_CMDS $UE_VM_IP_ADDR $UE_IP_ADDR $THROUGHPUT $IPERF_LOG_FILE 1 0 - scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/${IPERF_LOG_FILE}_server.txt $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/${IPERF_LOG_FILE}_client.txt $ARCHIVES_LOC - check_iperf $ARCHIVES_LOC/$IPERF_LOG_FILE $THROUGHPUT - fi - - echo "############################################################" - echo "${CN_CONFIG} : Terminate enb/ue simulators" - echo "############################################################" - terminate_enb_ue_basic_sim $ENB_VM_CMDS $ENB_VM_IP_ADDR 1 - terminate_enb_ue_basic_sim $UE_VM_CMDS $UE_VM_IP_ADDR 2 - scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC - - done - done - done - - #################### - ## MSMS CASE noS1 ## - #################### - CONF_FILE=lte-fdd-mbms-basic-sim.conf - CN_CONFIG="noS1" - S1_NOS1_CFG=0 - LTEBOX=0 - TMODE="fdd" - FREQUENCY=2680 - BW_CASES=(05) - MBMS_STATUS=0 - - for BW in ${BW_CASES[@]} - do - if [[ $BW =~ .*05.* ]]; then PRB=25; fi - if [[ $BW =~ .*10.* ]]; then PRB=50; fi - if [[ $BW =~ .*20.* ]]; then PRB=100; fi - - echo "############################################################" - echo "${CN_CONFIG} : Starting the eNB with MSMS in ${TMODE}-${BW}MHz mode" - echo "############################################################" - CURRENT_ENB_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_enb_mbms.log - start_rf_sim_enb $ENB_VM_CMDS "$ENB_VM_IP_ADDR" "$EPC_VM_IP_ADDR" $CURRENT_ENB_LOG_FILE $PRB $CONF_FILE $S1_NOS1_CFG - - echo "############################################################" - echo "${CN_CONFIG} : Starting the UE" - echo "############################################################" - CURRENT_UE_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_ue_mbms.log - start_rf_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_VM_IP_ADDR $CURRENT_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG 1 - if [ $UE_SYNC -eq 0 ] - then - echo "Problem w/ eNB and UE not syncing" - terminate_enb_ue_basic_sim $ENB_VM_CMDS $ENB_VM_IP_ADDR 1 - terminate_enb_ue_basic_sim $UE_VM_CMDS $UE_VM_IP_ADDR 2 - scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC - STATUS=-1 - break - fi - - echo "############################################################" - echo "${CN_CONFIG} : iperf DL -- UE is server and eNB is client" - echo "############################################################" - get_enb_mbms_noS1_ip_addr $ENB_VM_CMDS $ENB_VM_IP_ADDR - IPERF_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_iperf_dl_mbms - get_ue_mbms_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR 1 - THROUGHPUT=2 - generic_iperf $UE_VM_CMDS $UE_VM_IP_ADDR $UE_IP_ADDR $ENB_VM_CMDS $ENB_VM_IP_ADDR $ENB_IP_ADDR $THROUGHPUT $IPERF_LOG_FILE 1 0 - scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/${IPERF_LOG_FILE}_server.txt $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/${IPERF_LOG_FILE}_client.txt $ARCHIVES_LOC - #check_iperf $ARCHIVES_LOC/$IPERF_LOG_FILE $THROUGHPUT - - echo "############################################################" - echo "${CN_CONFIG} : Terminate enb/ue simulators" - echo "############################################################" - terminate_enb_ue_basic_sim $ENB_VM_CMDS $ENB_VM_IP_ADDR 1 - terminate_enb_ue_basic_sim $UE_VM_CMDS $UE_VM_IP_ADDR 2 - scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC - NB_UE_MBMS_MESSAGES=`egrep -c "TRIED TO PUSH MBMS DATA TO" $ARCHIVES_LOC/$CURRENT_UE_LOG_FILE` - if [ $NB_UE_MBMS_MESSAGES -eq 0 ]; then MBMS_STATUS=-1; fi - - done - - #################### - ## FeMBMS CASE noS1 ## - #################### - CONF_FILE=lte-fdd-fembms-basic-sim.conf - CN_CONFIG="noS1" - S1_NOS1_CFG=0 - LTEBOX=0 - TMODE="fdd" - FREQUENCY=2680 - BW_CASES=(05) - FeMBMS_STATUS=0 - - for BW in ${BW_CASES[@]} - do - if [[ $BW =~ .*05.* ]]; then PRB=25; fi - if [[ $BW =~ .*10.* ]]; then PRB=50; fi - if [[ $BW =~ .*20.* ]]; then PRB=100; fi - - echo "############################################################" - echo "${CN_CONFIG} : Starting the eNB with MSMS in ${TMODE}-${BW}MHz mode" - echo "############################################################" - CURRENT_ENB_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_enb_fembms.log - start_rf_sim_enb $ENB_VM_CMDS "$ENB_VM_IP_ADDR" "$EPC_VM_IP_ADDR" $CURRENT_ENB_LOG_FILE $PRB $CONF_FILE $S1_NOS1_CFG - - echo "############################################################" - echo "${CN_CONFIG} : Starting the UE" - echo "############################################################" - CURRENT_UE_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_ue_fembms.log - start_rf_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_VM_IP_ADDR $CURRENT_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG 1 - if [ $UE_SYNC -eq 0 ] - then - echo "Problem w/ eNB and UE not syncing" - terminate_enb_ue_basic_sim $ENB_VM_CMDS $ENB_VM_IP_ADDR 1 - terminate_enb_ue_basic_sim $UE_VM_CMDS $UE_VM_IP_ADDR 2 - scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC - STATUS=-1 - break - fi - - echo "############################################################" - echo "${CN_CONFIG} : iperf DL -- UE is server and eNB is client" - echo "############################################################" - get_enb_mbms_noS1_ip_addr $ENB_VM_CMDS $ENB_VM_IP_ADDR - IPERF_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_iperf_dl_fembms - get_ue_mbms_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR 1 - THROUGHPUT=2 - generic_iperf $UE_VM_CMDS $UE_VM_IP_ADDR $UE_IP_ADDR $ENB_VM_CMDS $ENB_VM_IP_ADDR $ENB_IP_ADDR $THROUGHPUT $IPERF_LOG_FILE 1 0 - scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/${IPERF_LOG_FILE}_server.txt $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/${IPERF_LOG_FILE}_client.txt $ARCHIVES_LOC - #check_iperf $ARCHIVES_LOC/$IPERF_LOG_FILE $THROUGHPUT - - echo "############################################################" - echo "${CN_CONFIG} : Terminate enb/ue simulators" - echo "############################################################" - terminate_enb_ue_basic_sim $ENB_VM_CMDS $ENB_VM_IP_ADDR 1 - terminate_enb_ue_basic_sim $UE_VM_CMDS $UE_VM_IP_ADDR 2 - scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC - NB_UE_FeMBMS_MESSAGES=`egrep -c "TRIED TO PUSH MBMS DATA TO" $ARCHIVES_LOC/$CURRENT_UE_LOG_FILE` - if [ $NB_UE_FeMBMS_MESSAGES -eq 0 ]; then FeMBMS_STATUS=-1; fi - - done - - full_l2_sim_destroy - - echo "############################################################" - echo "Checking run status" - echo "############################################################" - - if [ $PING_STATUS -ne 0 ]; then STATUS=-1; fi - if [ $IPERF_STATUS -ne 0 ]; then STATUS=-1; fi - if [ $MBMS_STATUS -eq 0 ] - then - echo "LTE MBMS RFSIM seems OK" - else - echo "LTE MBMS RFSIM seems to FAIL" - STATUS=-1 - fi - if [ $FeMBMS_STATUS -eq 0 ] - then - echo "LTE FeMBMS RFSIM seems OK" - else - echo "LTE FeMBMS RFSIM seems to FAIL" - STATUS=-1 - fi - if [ $STATUS -eq 0 ] - then - echo "LTE RFSIM seems OK" - echo "LTE: TEST_OK" > $ARCHIVES_LOC/test_final_status.log - else - echo "LTE RFSIM seems to FAIL" - echo "LTE: TEST_KO" > $ARCHIVES_LOC/test_final_status.log - fi - - fi - - if [[ "$RUN_OPTIONS" == "complex" ]] && [[ $VM_NAME =~ .*-rf5g-sim.* ]] - then - PING_STATUS=0 - IPERF_STATUS=0 - NR_STATUS=0 - if [ -d $ARCHIVES_LOC ] - then - rm -Rf $ARCHIVES_LOC - fi - mkdir --parents $ARCHIVES_LOC - - echo "############################################################" - echo "SA TEST 106PRB" - echo "############################################################" - #SA test, attention : has a different config file from the rest of the test - CN_CONFIG="noS1" - CONF_FILE=gnb.band78.sa.fr1.106PRB.usrpn310.conf - S1_NOS1_CFG=0 - PRB=106 - FREQUENCY=3510 - - if [ ! -d $ARCHIVES_LOC ] - then - mkdir --parents $ARCHIVES_LOC - fi - - local try_cnt=0 - - ######### start of SA TEST loop - while [ $try_cnt -lt 5 ] #5 because it hardly succeed within CI - do - - SYNC_STATUS=0 - SA_STATUS=0 - rm -f $ARCHIVES_LOC/tdd_${PRB}prb_${CN_CONFIG}*sa_test.log - - echo "############################################################" - echo "${CN_CONFIG} : Starting the gNB" - echo "############################################################" - CURRENT_GNB_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_gnb_sa_test.log - #last argument = 2 is to enable --sa for SA test - start_rf_sim_gnb $GNB_VM_CMDS "$GNB_VM_IP_ADDR" $CURRENT_GNB_LOG_FILE $PRB $CONF_FILE $S1_NOS1_CFG 2 - - echo "############################################################" - echo "${CN_CONFIG} : Starting the NR-UE" - echo "############################################################" - CURRENT_NR_UE_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_ue_sa_test.log - #last argument = 2 is to enable --sa for SA test for 106PRB - start_rf_sim_nr_ue $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $GNB_VM_IP_ADDR $CURRENT_NR_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG 2 - if [ $GNB_SYNC -eq 0 ] || [ $NR_UE_SYNC -eq 0 ] - then - echo "Problem w/ gNB and NR-UE not syncing" - terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2 - terminate_enb_ue_basic_sim $GNB_VM_CMDS $GNB_VM_IP_ADDR 1 - scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_NR_UE_LOG_FILE $ARCHIVES_LOC - SYNC_STATUS=-1 - try_cnt=$((try_cnt+1)) - continue - fi - - echo "############################################################" - echo "${CN_CONFIG} : Terminate gNB/NR-UE simulators" - echo "############################################################" - sleep 20 - terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2 - terminate_enb_ue_basic_sim $GNB_VM_CMDS $GNB_VM_IP_ADDR 1 - scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_NR_UE_LOG_FILE $ARCHIVES_LOC - - #check SA markers in gNB and NR UE log files - echo "############################################################" - echo "${CN_CONFIG} : Checking SA on gNB / NR-UE" - echo "############################################################" - - # Proper check to be done when SA test is working! - check_sa_result $ARCHIVES_LOC/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC/$CURRENT_NR_UE_LOG_FILE - if [ $SA_STATUS -ne 0 ] - then - echo "SA test NOT OK" - echo "try_cnt = " $try_cnt - try_cnt=$((try_cnt+1)) - SA_106PRB_STATUS=-1 - else - echo "SA test OK" - try_cnt=$((try_cnt+10)) - SA_106PRB_STATUS=0 - fi - done - #manage SYNC issue after try_cnt - if [ $SYNC_STATUS -ne 0 ] - then - echo "SA 106PRB test NOT OK, NOT SYNC'ED" - SA_106PRB_STATUS=-1 - fi - ########### end SA test - - sleep 30 - - - echo "############################################################" - echo "SA TEST 24PRB" - echo "############################################################" - #SA test, attention : has a different config file from the rest of the test - CN_CONFIG="noS1" - CONF_FILE=gnb.sa.band78.fr1.24PRB.usrpb210.conf - S1_NOS1_CFG=0 - PRB=24 - FREQUENCY=3600 - - if [ ! -d $ARCHIVES_LOC ] - then - mkdir --parents $ARCHIVES_LOC - fi - - local try_cnt=0 - - ######### start of SA TEST loop - while [ $try_cnt -lt 5 ] #5 because it hardly succeed within CI - do - - SYNC_STATUS=0 - SA_STATUS=0 - rm -f $ARCHIVES_LOC/tdd_${PRB}prb_${CN_CONFIG}*sa_test.log - - echo "############################################################" - echo "${CN_CONFIG} : Starting the gNB" - echo "############################################################" - CURRENT_GNB_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_gnb_sa_test.log - #last argument = 2 is to enable --sa for SA test - start_rf_sim_gnb $GNB_VM_CMDS "$GNB_VM_IP_ADDR" $CURRENT_GNB_LOG_FILE $PRB $CONF_FILE $S1_NOS1_CFG 2 - - echo "############################################################" - echo "${CN_CONFIG} : Starting the NR-UE" - echo "############################################################" - CURRENT_NR_UE_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_ue_sa_test.log - #last argument = 3 is to enable --sa for SA test for 24PRB - start_rf_sim_nr_ue $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $GNB_VM_IP_ADDR $CURRENT_NR_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG 3 - if [ $GNB_SYNC -eq 0 ] || [ $NR_UE_SYNC -eq 0 ] - then - echo "Problem w/ gNB and NR-UE not syncing" - terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2 - terminate_enb_ue_basic_sim $GNB_VM_CMDS $GNB_VM_IP_ADDR 1 - scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_NR_UE_LOG_FILE $ARCHIVES_LOC - SYNC_STATUS=-1 - try_cnt=$((try_cnt+1)) - continue - fi - - echo "############################################################" - echo "${CN_CONFIG} : Terminate gNB/NR-UE simulators" - echo "############################################################" - sleep 20 - terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2 - terminate_enb_ue_basic_sim $GNB_VM_CMDS $GNB_VM_IP_ADDR 1 - scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_NR_UE_LOG_FILE $ARCHIVES_LOC - - #check SA markers in gNB and NR UE log files - echo "############################################################" - echo "${CN_CONFIG} : Checking SA on gNB / NR-UE" - echo "############################################################" - - # Proper check to be done when SA test is working! - check_sa_result $ARCHIVES_LOC/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC/$CURRENT_NR_UE_LOG_FILE - if [ $SA_STATUS -ne 0 ] - then - echo "SA test NOT OK" - echo "try_cnt = " $try_cnt - try_cnt=$((try_cnt+1)) - SA_24PRB_STATUS=-1 - else - echo "SA test OK" - try_cnt=$((try_cnt+10)) - SA_24PRB_STATUS=0 - fi - done - #manage SYNC issue after try_cnt - if [ $SYNC_STATUS -ne 0 ] - then - echo "SA 24PRB test NOT OK, NOT SYNC'ED" - SA_24PRB_STATUS=-1 - fi - ########### end SA test - - sleep 30 - - - - - - - echo "############################################################" - echo "RA TEST FR2" - echo "############################################################" - #RA FR2 test, attention : has a different config file from the rest of the test - CN_CONFIG="noS1" - CONF_FILE=gnb.band261.tm1.32PRB.usrpn300.conf - S1_NOS1_CFG=0 - PRB=32 - FREQUENCY=28000 #28GHz - - if [ ! -d $ARCHIVES_LOC ] - then - mkdir --parents $ARCHIVES_LOC - fi - - local try_cnt=0 - - ######### start of RA TEST loop - RA_FR2_STATUS=0 - while [ $try_cnt -lt 5 ] #5 because it hardly succeed within CI - do - - SYNC_STATUS=0 - RA_STATUS=0 - rm -f $ARCHIVES_LOC/tdd_${PRB}prb_${CN_CONFIG}*ra_fr2_test.log - - echo "############################################################" - echo "${CN_CONFIG} : Starting the gNB" - echo "############################################################" - CURRENT_GNB_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_gnb_ra_fr2_test.log - #last argument = 1 is to enable --do-ra for RA test - start_rf_sim_gnb $GNB_VM_CMDS "$GNB_VM_IP_ADDR" $CURRENT_GNB_LOG_FILE $PRB $CONF_FILE $S1_NOS1_CFG 1 - - echo "############################################################" - echo "${CN_CONFIG} : Starting the NR-UE" - echo "############################################################" - CURRENT_NR_UE_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_ue_ra_fr2_test.log - #last argument = 1 is to enable --do-ra for RA test - start_rf_sim_nr_ue $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $GNB_VM_IP_ADDR $CURRENT_NR_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG 1 - if [ $GNB_SYNC -eq 0 ] || [ $NR_UE_SYNC -eq 0 ] - then - echo "Problem w/ gNB and NR-UE not syncing" - terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2 - terminate_enb_ue_basic_sim $GNB_VM_CMDS $GNB_VM_IP_ADDR 1 - scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_NR_UE_LOG_FILE $ARCHIVES_LOC - SYNC_STATUS=-1 - try_cnt=$((try_cnt+1)) - continue - fi - - echo "############################################################" - echo "${CN_CONFIG} : Terminate gNB/NR-UE simulators" - echo "############################################################" - sleep 20 - terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2 - terminate_enb_ue_basic_sim $GNB_VM_CMDS $GNB_VM_IP_ADDR 1 - scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_NR_UE_LOG_FILE $ARCHIVES_LOC - - #check RA markers in gNB and NR UE log files - echo "############################################################" - echo "${CN_CONFIG} : Checking FR2 RA on gNB / NR-UE" - echo "############################################################" - - # Proper check to be done when RA test is working! - check_ra_result $ARCHIVES_LOC/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC/$CURRENT_NR_UE_LOG_FILE - if [ $RA_STATUS -ne 0 ] - then - echo "RA FR2 test NOT OK" - echo "try_cnt = " $try_cnt - try_cnt=$((try_cnt+1)) - RA_FR2_STATUS=-1 - else - echo "RA FR2 test OK" - RA_FR2_STATUS=0 - try_cnt=$((try_cnt+10)) - fi - done - #manage SYNC issue after try_cnt - if [ $SYNC_STATUS -ne 0 ] - then - echo "RA FR2 test NOT OK, NOT SYNC'ED" - RA_FR2_STATUS=-1 - fi - ########### end RA FR2 test - - sleep 30 - - - echo "############################################################" - echo "RA TEST FR1" - echo "############################################################" - ######### redefine config for the rest of the test - - CN_CONFIG="noS1" - CONF_FILE=gnb.band78.tm1.106PRB.usrpn300.conf - S1_NOS1_CFG=0 - PRB=106 - FREQUENCY=3510 - - if [ ! -d $ARCHIVES_LOC ] - then - mkdir --parents $ARCHIVES_LOC - fi - - CN_CONFIG="noS1" - S1_NOS1_CFG=0 - - ######### start of RA TEST loop - # for the moment only TDD - TRANS_MODES=("tdd") - for TMODE in ${TRANS_MODES[@]} - do - if [[ $TMODE =~ .*fdd.* ]] - then - CONF_FILE=gnb.band66.tm1.106PRB.usrpn300.conf - PRB=106 - FREQUENCY=37000 - else - CONF_FILE=gnb.band78.tm1.106PRB.usrpn300.conf - PRB=106 - FREQUENCY=3510 - fi - - RA_FR1_STATUS=0 - local try_cnt=0 - while [ $try_cnt -lt 5 ] #5 because it hardly succeed within CI - - do - SYNC_STATUS=0 - RA_STATUS=0 - rm -f $ARCHIVES_LOC/${TMODE}_${PRB}prb_${CN_CONFIG}*ra_test.log - - echo "############################################################" - echo "${CN_CONFIG} : Starting the gNB in ${TMODE} mode (RA TEST)" - echo "############################################################" - CURRENT_GNB_LOG_FILE=${TMODE}_${PRB}prb_${CN_CONFIG}_gnb_ra_test.log - #last argument = 1 is to enable --do-ra for RA test - start_rf_sim_gnb $GNB_VM_CMDS "$GNB_VM_IP_ADDR" $CURRENT_GNB_LOG_FILE $PRB $CONF_FILE $S1_NOS1_CFG 1 - - echo "############################################################" - echo "${CN_CONFIG} : Starting the NR-UE in ${TMODE} mode (RA TEST)" - echo "############################################################" - CURRENT_NR_UE_LOG_FILE=${TMODE}_${PRB}prb_${CN_CONFIG}_ue_ra_test.log - #last argument = 1 is to enable --do-ra for RA test - start_rf_sim_nr_ue $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $GNB_VM_IP_ADDR $CURRENT_NR_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG 1 - if [ $GNB_SYNC -eq 0 ] || [ $NR_UE_SYNC -eq 0 ] - then - echo "Problem w/ gNB and NR-UE not syncing" - terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2 - terminate_enb_ue_basic_sim $GNB_VM_CMDS $GNB_VM_IP_ADDR 1 - scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_NR_UE_LOG_FILE $ARCHIVES_LOC - SYNC_STATUS=-1 - try_cnt=$((try_cnt+1)) - continue - fi - - echo "############################################################" - echo "${CN_CONFIG} : Terminate gNB/NR-UE simulators" - echo "############################################################" - sleep 20 - terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2 - terminate_enb_ue_basic_sim $GNB_VM_CMDS $GNB_VM_IP_ADDR 1 - scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_NR_UE_LOG_FILE $ARCHIVES_LOC - - #check RA markers in gNB and NR UE log files - echo "############################################################" - echo "${CN_CONFIG} : Checking FR1 RA on gNB / NR-UE" - echo "############################################################" - - # Proper check to be done when RA test is working! - check_ra_result $ARCHIVES_LOC/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC/$CURRENT_NR_UE_LOG_FILE - if [ $RA_STATUS -ne 0 ] - then - echo "RA FR1 test NOT OK" - echo "try_cnt = " $try_cnt - RA_FR1_STATUS=-1 - try_cnt=$((try_cnt+1)) - else - echo "RA FR1 test OK" - RA_FR1_STATUS=0 - try_cnt=$((try_cnt+10)) - fi - done - #manage SYNC issue after try_cnt - if [ $SYNC_STATUS -ne 0 ] - then - echo "RA FR1 test NOT OK, NOT SYNC'ED" - RA_FR1_STATUS=-1 - fi - - done - ########### end RA test - - sleep 30 - - ######### start of PHY TEST loop - SYNC_STATUS=0 - PING_STATUS=0 - IPERF_STATUS=0 - TRANS_MODES=("fdd tdd") - for TMODE in ${TRANS_MODES[@]} - do - if [[ $TMODE =~ .*fdd.* ]] - then - CONF_FILE=gnb.band66.tm1.106PRB.usrpn300.conf - PRB=106 - FREQUENCY=37000 - else - CONF_FILE=gnb.band78.tm1.106PRB.usrpn300.conf - PRB=106 - FREQUENCY=3510 - fi - - try_cnt=0 - while [ $try_cnt -lt 4 ] - do - rm -f $ARCHIVES_LOC/${TMODE}_${PRB}prb_${CN_CONFIG}_gnb.log $ARCHIVES_LOC/${TMODE}_${PRB}prb_${CN_CONFIG}_ue.log - rm -f $ARCHIVES_LOC/${TMODE}_${PRB}prb_${CN_CONFIG}_ping_gnb_from_nrue.log $ARCHIVES_LOC/${TMODE}_${PRB}prb_${CN_CONFIG}_ping_from_gnb_nrue.log - rm -f $ARCHIVES_LOC/${TMODE}_${PRB}prb_${CN_CONFIG}_iperf_dl*txt $ARCHIVES_LOC/${TMODE}_${PRB}prb_${CN_CONFIG}_iperf_ul*txt - - echo "############################################################" - echo "${CN_CONFIG} : Starting the gNB in ${TMODE} mode (PHY TEST)" - echo "############################################################" - CURRENT_GNB_LOG_FILE=${TMODE}_${PRB}prb_${CN_CONFIG}_gnb.log - start_rf_sim_gnb $GNB_VM_CMDS "$GNB_VM_IP_ADDR" $CURRENT_GNB_LOG_FILE $PRB $CONF_FILE $S1_NOS1_CFG 0 - - echo "############################################################" - echo "${CN_CONFIG} : Starting the NR-UE in ${TMODE} mode (PHY TEST)" - echo "############################################################" - CURRENT_NR_UE_LOG_FILE=${TMODE}_${PRB}prb_${CN_CONFIG}_ue.log - start_rf_sim_nr_ue $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $GNB_VM_IP_ADDR $CURRENT_NR_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG 0 - if [ $GNB_SYNC -eq 0 ] || [ $NR_UE_SYNC -eq 0 ] - then - echo "Problem w/ gNB and NR-UE not syncing" - terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2 - terminate_enb_ue_basic_sim $GNB_VM_CMDS $GNB_VM_IP_ADDR 1 - scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_NR_UE_LOG_FILE $ARCHIVES_LOC - SYNC_STATUS=-1 - try_cnt=$((try_cnt+1)) - continue - fi - - echo "############################################################" - echo "${CN_CONFIG} : Pinging the gNB from NR-UE" - echo "############################################################" - get_enb_noS1_ip_addr $GNB_VM_CMDS $GNB_VM_IP_ADDR - PING_LOG_FILE=${TMODE}_${PRB}prb_${CN_CONFIG}_ping_gnb_from_nrue.log - ping_epc_ip_addr $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $ENB_IP_ADDR $PING_LOG_FILE 1 0 - scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC - check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 - - echo "############################################################" - echo "${CN_CONFIG} : Pinging the NR-UE from gNB" - echo "############################################################" - get_ue_ip_addr $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 1 - PING_LOG_FILE=${TMODE}_${PRB}prb_${CN_CONFIG}_ping_from_gnb_nrue.log - ping_enb_ip_addr $GNB_VM_CMDS $GNB_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE 0 - scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC - check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 - - echo "############################################################" - echo "${CN_CONFIG} : iperf DL -- NR-UE is server and gNB is client" - echo "############################################################" - THROUGHPUT="30K" - CURR_IPERF_LOG_BASE=${TMODE}_${PRB}prb_${CN_CONFIG}_iperf_dl - get_enb_noS1_ip_addr $GNB_VM_CMDS $GNB_VM_IP_ADDR - get_ue_ip_addr $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 1 - generic_iperf $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $UE_IP_ADDR $GNB_VM_CMDS $GNB_VM_IP_ADDR $ENB_IP_ADDR $THROUGHPUT $CURR_IPERF_LOG_BASE 1 0 - scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC - check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE $THROUGHPUT - if [ $IPERF_STATUS -ne 0 ] - then - echo "DL test not OK" - terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2 - terminate_enb_ue_basic_sim $GNB_VM_CMDS $GNB_VM_IP_ADDR 1 - scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_NR_UE_LOG_FILE $ARCHIVES_LOC - try_cnt=$((try_cnt+1)) - continue - fi - - echo "############################################################" - echo "${CN_CONFIG} : iperf UL -- gNB is server and NR-UE is client" - echo "############################################################" - THROUGHPUT="30K" - CURR_IPERF_LOG_BASE=${TMODE}_${PRB}prb_${CN_CONFIG}_iperf_ul - get_enb_noS1_ip_addr $GNB_VM_CMDS $GNB_VM_IP_ADDR - get_ue_ip_addr $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 1 - generic_iperf $GNB_VM_CMDS $GNB_VM_IP_ADDR $ENB_IP_ADDR $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $UE_IP_ADDR $THROUGHPUT $CURR_IPERF_LOG_BASE 1 0 - scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC - check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE $THROUGHPUT - - echo "############################################################" - echo "${CN_CONFIG} : Terminate gNB/NR-UE simulators" - echo "############################################################" - terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2 - terminate_enb_ue_basic_sim $GNB_VM_CMDS $GNB_VM_IP_ADDR 1 - scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_NR_UE_LOG_FILE $ARCHIVES_LOC - if [ $IPERF_STATUS -ne 0 ] - then - echo "UL test not OK" - try_cnt=$((try_cnt+1)) - else - try_cnt=$((try_cnt+10)) - fi - done - #manage SYNC issue after try_cnt - if [ $SYNC_STATUS -ne 0 ] - then - echo "PHY test NOT OK, NOT SYNC'ED" - IPERF_STATUS=-1 - fi - - done - ######### end of loop - full_l2_sim_destroy - - - echo "############################################################" - echo "Checking run status" - echo "############################################################" - - if [ $SA_106PRB_STATUS -ne 0 ]; then NR_STATUS=-1; fi - if [ $SA_24PRB_STATUS -ne 0 ]; then NR_STATUS=-1; fi - if [ $RA_FR2_STATUS -ne 0 ]; then NR_STATUS=-1; fi - if [ $RA_FR1_STATUS -ne 0 ]; then NR_STATUS=-1; fi - if [ $PING_STATUS -ne 0 ]; then NR_STATUS=-1; fi - if [ $IPERF_STATUS -ne 0 ]; then NR_STATUS=-1; fi - if [ $NR_STATUS -eq 0 ] - then - echo "5G-NR RFSIM seems OK" - echo "5G-NR: TEST_OK" > $ARCHIVES_LOC/test_final_status.log - else - echo "5G-NR RFSIM seems to FAIL" - echo "5G-NR: TEST_KO" > $ARCHIVES_LOC/test_final_status.log - STATUS=-1 - fi - fi - - if [[ "$RUN_OPTIONS" == "complex" ]] && [[ $VM_NAME =~ .*-l2-sim.* ]] - then - PING_STATUS=0 - IPERF_STATUS=0 - if [ -d $ARCHIVES_LOC ] - then - rm -Rf $ARCHIVES_LOC - fi - mkdir --parents $ARCHIVES_LOC - - # Building UE elsewhere in VM - #build_ue_on_separate_folder $VM_CMDS $VM_IP_ADDR - - # Creating a VM for EPC and installing SW - EPC_VM_NAME=`echo $VM_NAME | sed -e "s#l2-sim#epc#"` - EPC_VM_CMDS=${EPC_VM_NAME}_cmds.txt - LTEBOX=0 - install_epc_on_vm $EPC_VM_NAME $EPC_VM_CMDS - EPC_VM_IP_ADDR=`uvt-kvm ip $EPC_VM_NAME` - - # adding 16 users to EPC subscriber lists - add_user_to_epc_lists $EPC_VM_CMDS $EPC_VM_IP_ADDR 16 - - EPC_CONFIGS=("wS1" "noS1") - TRANS_MODES=("fdd") - BW_CASES=(05) - NB_USERS=(01 04) - for CN_CONFIG in ${EPC_CONFIGS[@]} - do - if [[ $CN_CONFIG =~ .*wS1.* ]] - then - echo "############################################################" - echo "Start EPC for the wS1 configuration" - echo "############################################################" - start_epc $EPC_VM_NAME $EPC_VM_CMDS $EPC_VM_IP_ADDR - - # Retrieve EPC real IP address - retrieve_real_epc_ip_addr $EPC_VM_NAME $EPC_VM_CMDS $EPC_VM_IP_ADDR - S1_NOS1_CFG=1 - else - echo "############################################################" - echo "Terminate EPC" - echo "############################################################" - terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR - - echo "############################################################" - echo "Running now in a no-S1 configuration" - echo "############################################################" - S1_NOS1_CFG=0 - fi - for TMODE in ${TRANS_MODES[@]} - do - for BW in ${BW_CASES[@]} - do - for UES in ${NB_USERS[@]} - do - INT_NB_UES=`echo $UES | sed -e "s#^0*##"` - echo "############################################################" - echo "${CN_CONFIG} : Adding ${INT_NB_UES} UE(s) to conf file and recompile" - echo "############################################################" - add_ue_l2_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR $INT_NB_UES - - echo "############################################################" - echo "${CN_CONFIG} : Starting the eNB in ${TMODE}-${BW}MHz mode" - echo "############################################################" - CURRENT_ENB_LOG_FILE=${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_enb.log - start_l2_sim_enb $ENB_VM_CMDS $ENB_VM_IP_ADDR $EPC_VM_IP_ADDR $UE_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 25 rcc.band7.tm1.nfapi.conf $S1_NOS1_CFG - - echo "############################################################" - echo "${CN_CONFIG} : Starting the UE for ${INT_NB_UES} user(s)" - echo "############################################################" - CURRENT_UE_LOG_FILE=${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_ue.log - start_l2_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_VM_IP_ADDR $CURRENT_UE_LOG_FILE ue.nfapi.conf $INT_NB_UES $S1_NOS1_CFG - if [ $UE_SYNC -eq 0 ] - then - echo "Problem w/ eNB and UE not syncing" - terminate_enb_ue_basic_sim $ENB_VM_CMDS $ENB_VM_IP_ADDR 1 - terminate_enb_ue_basic_sim $UE_VM_CMDS $UE_VM_IP_ADDR 2 - scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC - STATUS=-1 - continue - fi - - if [ $S1_NOS1_CFG -eq 1 ] - then - - echo "############################################################" - echo "${CN_CONFIG} : Pinging the EPC from UE(s)" - echo "############################################################" - echo " --- Sequentially ---" - local j="1" - while [ $j -le $INT_NB_UES ] - do - PING_LOG_FILE=${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_ping_epc_seq_from_ue${j}.log - ping_epc_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $REAL_EPC_IP_ADDR $PING_LOG_FILE ${j} 0 - scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC - check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 - j=$[$j+1] - done - if [ $INT_NB_UES -gt 1 ] - then - echo " --- In parallel ---" - j="1" - while [ $j -le $INT_NB_UES ] - do - PING_LOG_FILE=${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_ping_epc_para_from_ue${j}.log - ping_epc_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $REAL_EPC_IP_ADDR $PING_LOG_FILE ${j} 1 - j=$[$j+1] - done - sleep 25 - j="1" - while [ $j -le $INT_NB_UES ] - do - PING_LOG_FILE=${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_ping_epc_para_from_ue${j}.log - scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC - tail -3 $ARCHIVES_LOC/$PING_LOG_FILE - check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 - j=$[$j+1] - done - fi - else - get_enb_noS1_ip_addr $ENB_VM_CMDS $ENB_VM_IP_ADDR - - echo "############################################################" - echo "${CN_CONFIG} : Pinging the eNB from UE(s)" - echo "############################################################" - echo " --- Sequentially ---" - local j="1" - while [ $j -le $INT_NB_UES ] - do - PING_LOG_FILE=${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_ping_enb_seq_from_ue${j}.log - ping_epc_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_IP_ADDR $PING_LOG_FILE ${j} 0 - scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC - check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 - j=$[$j+1] - done - if [ $INT_NB_UES -gt 1 ] - then - echo " --- In parallel ---" - j="1" - while [ $j -le $INT_NB_UES ] - do - PING_LOG_FILE=${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_ping_enb_para_from_ue${j}.log - ping_epc_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_IP_ADDR $PING_LOG_FILE ${j} 1 - j=$[$j+1] - done - sleep 25 - j="1" - while [ $j -le $INT_NB_UES ] - do - PING_LOG_FILE=${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_ping_enb_para_from_ue${j}.log - scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC - tail -3 $ARCHIVES_LOC/$PING_LOG_FILE - check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 - j=$[$j+1] - done - fi - fi - - if [ $S1_NOS1_CFG -eq 1 ] - then - echo "############################################################" - echo "${CN_CONFIG} : Pinging the UE(s) from EPC" - echo "############################################################" - echo " --- Sequentially ---" - local j="1" - while [ $j -le $INT_NB_UES ] - do - get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $j - PING_LOG_FILE=${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_ping_from_epc_seq_ue${j}.log - ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE 0 - scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC - check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 - j=$[$j+1] - done - if [ $INT_NB_UES -gt 1 ] - then - echo " --- In parallel ---" - j="1" - while [ $j -le $INT_NB_UES ] - do - get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $j - PING_LOG_FILE=${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_ping_from_epc_para_ue${j}.log - ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE 1 - j=$[$j+1] - done - sleep 25 - j="1" - while [ $j -le $INT_NB_UES ] - do - PING_LOG_FILE=${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_ping_from_epc_para_ue${j}.log - scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC - check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 - j=$[$j+1] - done - fi - else - echo "############################################################" - echo "${CN_CONFIG} : Pinging the UE(s) from eNB" - echo "############################################################" - echo " --- Sequentially ---" - local j="1" - while [ $j -le $INT_NB_UES ] - do - get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $j - PING_LOG_FILE=${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_ping_from_enb_seq_ue${j}.log - ping_enb_ip_addr $ENB_VM_CMDS $ENB_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE 0 - scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC - check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 - j=$[$j+1] - done - if [ $INT_NB_UES -gt 1 ] - then - echo " --- In parallel ---" - j="1" - while [ $j -le $INT_NB_UES ] - do - get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $j - PING_LOG_FILE=${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_ping_from_enb_para_ue${j}.log - ping_enb_ip_addr $ENB_VM_CMDS $ENB_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE 1 - j=$[$j+1] - done - sleep 25 - j="1" - while [ $j -le $INT_NB_UES ] - do - PING_LOG_FILE=${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_ping_from_enb_para_ue${j}.log - scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC - tail -3 $ARCHIVES_LOC/$PING_LOG_FILE - check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 - j=$[$j+1] - done - fi - fi - - if [ $S1_NOS1_CFG -eq 0 ] - then - get_enb_noS1_ip_addr $ENB_VM_CMDS $ENB_VM_IP_ADDR - echo "############################################################" - echo "${CN_CONFIG} : iperf DL -- UE is server and eNB is client" - echo "############################################################" - echo " --- Sequentially ---" - local j="1" - while [ $j -le $INT_NB_UES ] - do - IPERF_LOG_FILE=${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_iperf_dl_seq_ue${j} - get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $j - THROUGHPUT=3 - generic_iperf $UE_VM_CMDS $UE_VM_IP_ADDR $UE_IP_ADDR $ENB_VM_CMDS $ENB_VM_IP_ADDR $ENB_IP_ADDR $THROUGHPUT $IPERF_LOG_FILE $j 0 - scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/${IPERF_LOG_FILE}_server.txt $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/${IPERF_LOG_FILE}_client.txt $ARCHIVES_LOC - check_iperf $ARCHIVES_LOC/$IPERF_LOG_FILE $THROUGHPUT - j=$[$j+1] - done - if [ $INT_NB_UES -gt 1 ] - then - echo " --- In parallel ---" - j="1" - while [ $j -le $INT_NB_UES ] - do - IPERF_LOG_FILE=${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_iperf_dl_para_ue${j} - THROUGHPUT=1 - get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $j - generic_iperf $UE_VM_CMDS $UE_VM_IP_ADDR $UE_IP_ADDR $ENB_VM_CMDS $ENB_VM_IP_ADDR $ENB_IP_ADDR $THROUGHPUT $IPERF_LOG_FILE $j 1 - j=$[$j+1] - done - sleep 35 - echo "killall --signal SIGKILL iperf" - echo "killall --signal SIGKILL iperf" > $UE_VM_CMDS - ssh -T -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR < $UE_VM_CMDS - rm $UE_VM_CMDS - j="1" - while [ $j -le $INT_NB_UES ] - do - IPERF_LOG_FILE=${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_iperf_dl_para_ue${j} - scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/${IPERF_LOG_FILE}_server.txt $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/${IPERF_LOG_FILE}_client.txt $ARCHIVES_LOC - tail -3 $ARCHIVES_LOC/${IPERF_LOG_FILE}_client.txt | grep -v datagram - #check_iperf $ARCHIVES_LOC/$IPERF_LOG_FILE $THROUGHPUT - j=$[$j+1] - done - fi - - echo "############################################################" - echo "${CN_CONFIG} : iperf UL -- eNB is server and UE is client" - echo "############################################################" - echo " --- Sequentially ---" - local j="1" - while [ $j -le $INT_NB_UES ] - do - IPERF_LOG_FILE=${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_iperf_ul_seq_ue${j} - THROUGHPUT=2 - get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $j - generic_iperf $ENB_VM_CMDS $ENB_VM_IP_ADDR $ENB_IP_ADDR $UE_VM_CMDS $UE_VM_IP_ADDR $UE_IP_ADDR $THROUGHPUT $IPERF_LOG_FILE $j 0 - scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/${IPERF_LOG_FILE}_server.txt $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/${IPERF_LOG_FILE}_client.txt $ARCHIVES_LOC - check_iperf $ARCHIVES_LOC/$IPERF_LOG_FILE $THROUGHPUT - j=$[$j+1] - done - if [ $INT_NB_UES -gt 1 ] - then - echo " --- In parallel ---" - j="1" - while [ $j -le $INT_NB_UES ] - do - IPERF_LOG_FILE=${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_iperf_ul_para_ue${j} - THROUGHPUT=1 - get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $j - generic_iperf $ENB_VM_CMDS $ENB_VM_IP_ADDR $ENB_IP_ADDR $UE_VM_CMDS $UE_VM_IP_ADDR $UE_IP_ADDR $THROUGHPUT $IPERF_LOG_FILE $j 1 - j=$[$j+1] - done - sleep 35 - echo "killall --signal SIGKILL iperf" - echo "killall --signal SIGKILL iperf" > $UE_VM_CMDS - ssh -T -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR < $UE_VM_CMDS - rm $UE_VM_CMDS - j="1" - while [ $j -le $INT_NB_UES ] - do - IPERF_LOG_FILE=${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_iperf_ul_para_ue${j} - scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/${IPERF_LOG_FILE}_server.txt $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/${IPERF_LOG_FILE}_client.txt $ARCHIVES_LOC - tail -3 $ARCHIVES_LOC/${IPERF_LOG_FILE}_client.txt | grep -v datagram - #check_iperf $ARCHIVES_LOC/$IPERF_LOG_FILE $THROUGHPUT - j=$[$j+1] - done - fi - fi - - echo "############################################################" - echo "${CN_CONFIG} : Terminate enb/ue simulators" - echo "############################################################" - terminate_enb_ue_basic_sim $ENB_VM_CMDS $ENB_VM_IP_ADDR 1 - terminate_enb_ue_basic_sim $UE_VM_CMDS $UE_VM_IP_ADDR 2 - scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC - - done - done - done - done - - full_l2_sim_destroy - - echo "############################################################" - echo "Checking run status" - echo "############################################################" - - if [ $PING_STATUS -ne 0 ]; then STATUS=-1; fi - if [ $IPERF_STATUS -ne 0 ]; then STATUS=-1; fi - if [ $STATUS -eq 0 ] - then - echo "TEST_OK" > $ARCHIVES_LOC/test_final_status.log - else - echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log - fi - fi -} diff --git a/ci-scripts/waitBuildOnVM.sh b/ci-scripts/waitBuildOnVM.sh deleted file mode 100755 index 8199215e2e..0000000000 --- a/ci-scripts/waitBuildOnVM.sh +++ /dev/null @@ -1,205 +0,0 @@ -#!/bin/bash -#/* -# * 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 -# */ - -function wait_usage { - echo "OAI CI VM script" - echo " Original Author: Raphael Defosseux" - echo " Requirements:" - echo " -- uvtool uvtool-libvirt apt-cacher" - echo " -- $VM_OSREL image already synced" - echo " Default:" - echo " -- eNB with USRP" - echo "" - echo "Usage:" - echo "------" - echo " oai-ci-vm-tool wait [OPTIONS]" - echo "" - command_options_usage -} - -function wait_on_vm_build { - echo "############################################################" - echo "OAI CI VM script" - echo "############################################################" - - echo "VM_NAME = $VM_NAME" - echo "VM_CMD_FILE = $VM_CMDS" - echo "JENKINS_WKSP = $JENKINS_WKSP" - echo "ARCHIVES_LOC = $ARCHIVES_LOC" - echo "BUILD_OPTIONS = $BUILD_OPTIONS" - - if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]] || [[ "$VM_NAME" == *"-basic-sim"* ]] || [[ "$VM_NAME" == *"-flexran-rtc"* ]] || [[ "$VM_NAME" == *"-rf-sim"* ]] || [[ "$VM_NAME" == *"-ethernet"* ]] || [[ "$VM_NAME" == *"rf5g-sim"* ]] || [[ "$VM_NAME" == *"gnb-usrp"* ]] || [[ "$VM_NAME" == *"nr-ue-usrp"* ]] - then - echo "This VM type is no longer supported in the pipeline framework" - return - fi - - IS_VM_ALIVE=`uvt-kvm list | grep -c $VM_NAME` - - if [ $IS_VM_ALIVE -eq 0 ] - then - echo "############################################################" - echo "You should have created the VM before doing anything" - echo "############################################################" - STATUS=1 - return - fi - - echo "Waiting for VM to be started" - uvt-kvm wait $VM_NAME --insecure - - VM_IP_ADDR=`uvt-kvm ip $VM_NAME` - echo "$VM_NAME has for IP addr = $VM_IP_ADDR" - - echo "############################################################" - echo "Waiting build process to end on VM ($VM_NAME)" - echo "############################################################" - # Since the last VM was cppcheck and is removed - # we are going too fast in wait and the build_oai is not yet started - sleep 120 - - if [[ "$VM_NAME" == *"-cppcheck"* ]] - then - echo "echo \"ps -aux | grep cppcheck \"" >> $VM_CMDS - echo "while [ \$(ps -aux | grep --color=never cppcheck | grep -v grep | wc -l) -gt 0 ]; do sleep 3; done" >> $VM_CMDS - else - echo "echo \"ps -aux | grep build \"" >> $VM_CMDS - echo "while [ \$(ps -aux | grep --color=never build_oai | grep -v grep | wc -l) -gt 0 ]; do sleep 3; done" >> $VM_CMDS - fi - echo "echo \"df -h\"" >> $VM_CMDS - echo "df -h" >> $VM_CMDS - - ssh -T -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR < $VM_CMDS - rm -f $VM_CMDS -} - -function check_on_vm_build { - if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]] || [[ "$VM_NAME" == *"-basic-sim"* ]] || [[ "$VM_NAME" == *"-flexran-rtc"* ]] || [[ "$VM_NAME" == *"-rf-sim"* ]] || [[ "$VM_NAME" == *"-ethernet"* ]] || [[ "$VM_NAME" == *"rf5g-sim"* ]] || [[ "$VM_NAME" == *"gnb-usrp"* ]] || [[ "$VM_NAME" == *"nr-ue-usrp"* ]] - then - echo "This VM type is no longer supported in the pipeline framework" - return - fi - - echo "############################################################" - echo "Creating a tmp folder to store results and artifacts" - echo "############################################################" - if [ ! -d $JENKINS_WKSP/archives ] - then - mkdir $JENKINS_WKSP/archives - fi - - if [ ! -d $ARCHIVES_LOC ] - then - mkdir $ARCHIVES_LOC - fi - - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/*.txt $ARCHIVES_LOC - if [[ "$VM_NAME" == *"-cppcheck"* ]] - then - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/*.xml $ARCHIVES_LOC - fi - - if [ $KEEP_VM_ALIVE -eq 0 ] - then - if [[ "$VM_NAME" == *"-enb-ethernet"* ]] || [[ "$VM_NAME" == *"-ue-ethernet"* ]] - then - echo "Hack to not destroy in current pipeline" - else - echo "############################################################" - echo "Destroying VM" - echo "############################################################" - uvt-kvm destroy $VM_NAME - ssh-keygen -R $VM_IP_ADDR - fi - fi - rm -f $VM_CMDS - - echo "############################################################" - echo "Checking build status" - echo "############################################################" - - if [[ "$VM_NAME" == *"-cppcheck"* ]] - then - LOG_FILES=`ls $ARCHIVES_LOC/*.txt $ARCHIVES_LOC/*.xml` - else - LOG_FILES=`ls $ARCHIVES_LOC/*.txt` - fi - echo "LOG_FILES=$LOG_FILES" - echo "expecting NB_PATTERN_FILES=$NB_PATTERN_FILES" - STATUS=0 - NB_FOUND_FILES=0 - - for FULLFILE in $LOG_FILES - do - if [[ $FULLFILE == *"$LOG_PATTERN"* ]] - then - filename=$(basename -- "$FULLFILE") - if [ "$LOG_PATTERN" == ".txt" ] - then - PASS_PATTERN=`echo $filename | sed -e "s#$LOG_PATTERN##"` - fi - if [ "$LOG_PATTERN" == "cppcheck.xml" ] - then - PASS_PATTERN="results version" - LOCAL_STAT=`egrep -c "$PASS_PATTERN" $FULLFILE` - else - LOCAL_STAT=`egrep -c "Built target $PASS_PATTERN" $FULLFILE` - fi - if [ $LOCAL_STAT -eq 0 ]; then - echo "WARNING: file $filename does not contain pass pattern" - else - NB_FOUND_FILES=$((NB_FOUND_FILES + 1)) - fi - fi - done - - if [ $NB_PATTERN_FILES -ne $NB_FOUND_FILES ] - then - echo "Expecting $NB_PATTERN_FILES log files and found $NB_FOUND_FILES" - STATUS=-1 - fi - - # If we were building the FlexRan Controller, flag-touch for basic-simulator to continue - #if [[ "$VM_NAME" == *"-flexran-rtc"* ]] - #then - # if [[ $STATUS -eq 0 ]] - # then - # touch $JENKINS_WKSP/flexran/flexran_build_complete.txt - # fi - #fi - - if [[ "$VM_NAME" == *"-cppcheck"* ]] - then - echo "COMMAND: cppcheck $BUILD_OPTIONS . 2> cppcheck.xml" > $ARCHIVES_LOC/build_final_status.log - elif [[ "$VM_NAME" == *"-flexran-rtc"* ]] - then - echo "COMMAND: $BUILD_OPTIONS" > $ARCHIVES_LOC/build_final_status.log - else - echo "COMMAND: build_oai -I $BUILD_OPTIONS" > $ARCHIVES_LOC/build_final_status.log - fi - if [[ $STATUS -eq 0 ]] - then - echo "BUILD_OK" >> $ARCHIVES_LOC/build_final_status.log - else - echo "BUILD_KO" >> $ARCHIVES_LOC/build_final_status.log - fi -} From c4963ed16d91318ee95b5aa9c521df763c3f8c7a Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 22 Dec 2022 10:49:52 +0100 Subject: [PATCH 03/18] CI: support cmd_prefix for OAI UE --- ci-scripts/cls_oaicitest.py | 3 ++- ci-scripts/main.py | 2 ++ ci-scripts/xml_files/fr1_sa_oaiue_n310.xml | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index dbf720cf64..e21176c176 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -193,6 +193,7 @@ class OaiCiTest(): self.expectedNbOfConnectedUEs = 0 self.ue_id = '' #used for module identification self.ue_trace ='' #used to enable QLog trace for Module UE, passed to Module UE object at InitializeUE() + self.cmd_prefix = '' # prefix before {lte,nr}-uesoftmodem def BuildOAIUE(self,HTML): @@ -489,7 +490,7 @@ class OaiCiTest(): copyin_res = SSH.copyin(RAN.eNBIPAddress, RAN.eNBUserName, RAN.eNBPassword, RAN.eNBSourceCodePath + '/cmake_targets/reconfig.raw', '.') if (copyin_res == 0): SSH.copyout(self.UEIPAddress, self.UEUserName, self.UEPassword, './reconfig.raw', self.UESourceCodePath + '/cmake_targets/ran_build/build') - SSH.command('echo "ulimit -c unlimited && ./'+ self.air_interface +' ' + self.Initialize_OAI_UE_args + '" > ./my-lte-uesoftmodem-run' + str(self.UE_instance) + '.sh', '\$', 5) + SSH.command(f'echo "ulimit -c unlimited && {self.cmd_prefix} ./{self.air_interface} {self.Initialize_OAI_UE_args}" > ./my-lte-uesoftmodem-run{self.UE_instance}.sh', '\$', 5) SSH.command('chmod 775 ./my-lte-uesoftmodem-run' + str(self.UE_instance) + '.sh', '\$', 5) SSH.command('echo ' + self.UEPassword + ' | sudo -S rm -Rf ' + self.UESourceCodePath + '/cmake_targets/ue_' + self.testCase_id + '.log', '\$', 5) self.UELogFile = 'ue_' + self.testCase_id + '.log' diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 76fd6830e9..322b6a5c72 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -287,6 +287,8 @@ def GetParametersFromXML(action): #CiTestObj.air_interface = 'ocp-enb' logging.error('OCP UE -- NOT SUPPORTED') + CiTestObj.cmd_prefix = test.findtext('cmd_prefix') or "" + elif action == 'Terminate_OAI_UE': UE_instance=test.findtext('UE_instance') if (UE_instance is None): diff --git a/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml b/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml index 468005f54f..b0eb281b6d 100644 --- a/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml +++ b/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml @@ -61,6 +61,7 @@ yes yes 172.21.19.14 + numactl --cpunodebind=netdev:ens2f0np0 --membind=netdev:ens2f0np0 From cc04996bd5e45ef454a5ed37650a6fff40ca6a2a Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 20 Dec 2022 11:18:01 +0100 Subject: [PATCH 04/18] CI: docker-compose file for RFsim 2x2 test --- .../gnb.sa.band78.106prb.rfsim.2x2.conf | 334 ++++++++++++++++++ .../5g_rfsimulator_2x2/docker-compose.yaml | 301 ++++++++++++++++ 2 files changed, 635 insertions(+) create mode 100644 ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.2x2.conf create mode 100644 ci-scripts/yaml_files/5g_rfsimulator_2x2/docker-compose.yaml diff --git a/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.2x2.conf b/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.2x2.conf new file mode 100644 index 0000000000..6ea35b4b87 --- /dev/null +++ b/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.2x2.conf @@ -0,0 +1,334 @@ +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe00; + gNB_name = "gNB-OAI"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ({ mcc = 208; mnc = 99; mnc_length = 2; snssaiList = ({ sst = 1 }) }); + + nr_cellid = 12345678L; + + ////////// Physical parameters: + + pdsch_AntennaPorts_XP = 2; + pusch_AntennaPorts = 2; + do_CSIRS = 1; + do_SRS = 1; + min_rxtxtime = 5; + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 12; + searchSpaceZero = 0; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68 + absoluteFrequencySSB = 621312; # 641280 + dl_frequencyBand = 78; + # this is 3300.60 MHz + dl_absoluteFrequencyPointA = 620040; # 640008 + #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=27,L=48 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952 +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 12; + 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 = -96; +#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 = -70; +# 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; + } + + ); + +# Dedicated Serving Cell Configuration +servingCellConfigDedicated = ({ + # BWP-Downlink + # BWP 1 Configuration + dl_bwp-Id_1 = 1; + dl_bwp1_locationAndBandwidth = 28875; // RBstart=0, L=106 (40 MHz BW) + # subcarrierSpacing + # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_bwp1_subcarrierSpacing = 1; + + # BWP 2 Configuration + dl_bwp-Id_2 = 2; + dl_bwp2_locationAndBandwidth = 13750; // RBstart=0, L=51 (20 MHz BW) + # subcarrierSpacing + # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_bwp2_subcarrierSpacing = 1; + + # BWP 3 Configuration + dl_bwp-Id_3 = 3; + dl_bwp3_locationAndBandwidth = 6325; // RBstart=0, L=24 (10 MHz BW) + # subcarrierSpacing + # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_bwp3_subcarrierSpacing = 1; + + firstActiveDownlinkBWP-Id = 1; #BWP-Id + defaultDownlinkBWP-Id = 1; #BWP-Id + + # bwp-InactivityTimer ENUMERATED {ms2, ms3, ms4, ms5, ms6, ms8, ms10, ms20, ms30, + # ms40,ms50, ms60, ms80,ms100, ms200,ms300, ms500, + # ms750, ms1280, ms1920, ms2560, spare10, spare9, spare8, + # spare7, spare6, spare5, spare4, spare3, spare2, spare1 } + + # UplinkConfig + # BWP-Uplink + # BWP 1 Configuration + ul_bwp-Id_1 = 1; + ul_bwp1_locationAndBandwidth = 28875; // RBstart=0, L=106 (40 MHz BW) + # subcarrierSpacing + # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_bwp1_subcarrierSpacing = 1; + + # BWP 2 Configuration + ul_bwp-Id_2 = 2; + ul_bwp2_locationAndBandwidth = 13750; // RBstart=0, L=51 (20 MHz BW) + # subcarrierSpacing + # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_bwp2_subcarrierSpacing = 1; + + # BWP 3 Configuration + ul_bwp-Id_3 = 3; + ul_bwp3_locationAndBandwidth = 6325; // RBstart=0, L=24 (10 MHz BW) + # subcarrierSpacing + # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_bwp3_subcarrierSpacing = 1; + + firstActiveUplinkBWP-Id = 1; #BWP-Id + } +); + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "192.168.71.132"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + + NETWORK_INTERFACES : + { + GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.71.140/24"; + GNB_INTERFACE_NAME_FOR_NGU = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.71.140/24"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( +{ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + #pusch_TargetSNRx10 = 150; + #pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 0; +} +); + +L1s = ( +{ + num_cc = 1; + tr_n_preference = "local_mac"; + prach_dtx_threshold = 120; + #pucch0_dtx_threshold = 120; +} +); + +RUs = ( +{ + local_rf = "yes" + nb_tx = 2 + nb_rx = 2 + 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]; + #clock_src = "internal"; + sdr_addrs = "mgmt_addr=192.168.10.2,addr=192.168.10.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"; +} +); + +rfsimulator : +{ + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; +}; + +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"; + hw_log_level ="info"; + phy_log_level ="info"; + mac_log_level ="info"; + rlc_log_level ="info"; + pdcp_log_level ="info"; + rrc_log_level ="info"; + ngap_log_level ="debug"; + f1ap_log_level ="debug"; +}; diff --git a/ci-scripts/yaml_files/5g_rfsimulator_2x2/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator_2x2/docker-compose.yaml new file mode 100644 index 0000000000..6161f223f8 --- /dev/null +++ b/ci-scripts/yaml_files/5g_rfsimulator_2x2/docker-compose.yaml @@ -0,0 +1,301 @@ +version: '3.8' +services: + oai-nrf: + container_name: "rfsim5g-oai-nrf" + image: oai-nrf:august-dev + environment: + - NRF_INTERFACE_NAME_FOR_SBI=eth0 + - NRF_INTERFACE_PORT_FOR_SBI=80 + - NRF_INTERFACE_HTTP2_PORT_FOR_SBI=9090 + - NRF_API_VERSION=v1 + - INSTANCE=0 + - PID_DIRECTORY=/var/run + networks: + public_net: + ipv4_address: 192.168.71.130 + volumes: + - ../5g_rfsimulator/nrf-healthcheck.sh:/openair-nrf/bin/nrf-healthcheck.sh + healthcheck: + test: /bin/bash -c "/openair-nrf/bin/nrf-healthcheck.sh" + interval: 10s + timeout: 5s + retries: 5 + + mysql: + container_name: "rfsim5g-mysql" + image: mysql:5.7 + volumes: + - ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql + - ../5g_rfsimulator/mysql-healthcheck.sh:/tmp/mysql-healthcheck.sh + environment: + - TZ=Europe/Paris + - MYSQL_DATABASE=oai_db + - MYSQL_USER=test + - MYSQL_PASSWORD=test + - MYSQL_ROOT_PASSWORD=linux + healthcheck: + test: /bin/bash -c "/tmp/mysql-healthcheck.sh" + interval: 10s + timeout: 5s + retries: 5 + networks: + public_net: + ipv4_address: 192.168.71.131 + + oai-amf: + container_name: "rfsim5g-oai-amf" + image: oai-amf:august-dev + environment: + - TZ=Europe/paris + - INSTANCE=0 + - PID_DIRECTORY=/var/run + - MCC=208 + - MNC=99 + - REGION_ID=128 + - AMF_SET_ID=1 + - SERVED_GUAMI_MCC_0=208 + - SERVED_GUAMI_MNC_0=99 + - SERVED_GUAMI_REGION_ID_0=128 + - SERVED_GUAMI_AMF_SET_ID_0=1 + - SERVED_GUAMI_MCC_1=460 + - SERVED_GUAMI_MNC_1=11 + - SERVED_GUAMI_REGION_ID_1=10 + - SERVED_GUAMI_AMF_SET_ID_1=1 + - PLMN_SUPPORT_MCC=208 + - PLMN_SUPPORT_MNC=99 + - PLMN_SUPPORT_TAC=0x0001 + - SST_0=1 + - SD_0=0xffffff + - SST_1=1 + - SD_1=1 + - AMF_INTERFACE_NAME_FOR_NGAP=eth0 + - AMF_INTERFACE_NAME_FOR_N11=eth0 + - SMF_INSTANCE_ID_0=1 + - SMF_FQDN_0=oai-smf + - SMF_IPV4_ADDR_0=0.0.0.0 + - SMF_HTTP_VERSION_0=v1 + - SELECTED_0=true + - SMF_INSTANCE_ID_1=2 + - SMF_FQDN_1=oai-smf + - SMF_IPV4_ADDR_1=0.0.0.0 + - SMF_HTTP_VERSION_1=v1 + - SELECTED_1=false + - MYSQL_SERVER=192.168.71.131 + - MYSQL_USER=root + - MYSQL_PASS=linux + - MYSQL_DB=oai_db + - OPERATOR_KEY=c42449363bbad02b66d16bc975d77cc1 + - NRF_IPV4_ADDRESS=192.168.71.130 + - NRF_PORT=80 + - NF_REGISTRATION=yes + - SMF_SELECTION=yes + - USE_FQDN_DNS=yes + - NRF_API_VERSION=v1 + - NRF_FQDN=oai-nrf + - EXTERNAL_AUSF=no + - AUSF_IPV4_ADDRESS=0.0.0.0 + - AUSF_PORT=80 + - AUSF_API_VERSION=v1 + - AUSF_FQDN=localhost + depends_on: + - oai-nrf + - mysql + volumes: + - ../5g_rfsimulator/amf-healthcheck.sh:/openair-amf/bin/amf-healthcheck.sh + healthcheck: + test: /bin/bash -c "/openair-amf/bin/amf-healthcheck.sh" + interval: 10s + timeout: 15s + retries: 5 + networks: + public_net: + ipv4_address: 192.168.71.132 + + oai-smf: + container_name: "rfsim5g-oai-smf" + image: oai-smf:august-dev + environment: + - TZ=Europe/Paris + - INSTANCE=0 + - PID_DIRECTORY=/var/run + - SMF_INTERFACE_NAME_FOR_N4=eth0 + - SMF_INTERFACE_NAME_FOR_SBI=eth0 + - SMF_INTERFACE_PORT_FOR_SBI=80 + - SMF_INTERFACE_HTTP2_PORT_FOR_SBI=9090 + - SMF_API_VERSION=v1 + - DEFAULT_DNS_IPV4_ADDRESS=172.21.3.100 + - DEFAULT_DNS_SEC_IPV4_ADDRESS=4.4.4.4 + - AMF_IPV4_ADDRESS=0.0.0.0 + - AMF_PORT=80 + - AMF_API_VERSION=v1 + - AMF_FQDN=oai-amf + - UDM_IPV4_ADDRESS=127.0.0.1 + - UDM_PORT=80 + - UDM_API_VERSION=v1 + - UDM_FQDN=localhost + - UPF_IPV4_ADDRESS=192.168.71.134 + - UPF_FQDN_0=oai-spgwu + - NRF_IPV4_ADDRESS=192.168.71.130 + - NRF_PORT=80 + - NRF_API_VERSION=v1 + - NRF_FQDN=oai-nrf + - REGISTER_NRF=yes + - DISCOVER_UPF=yes + - USE_FQDN_DNS=yes + - DNN_NI0=oai + - TYPE0=IPv4 + - DNN_RANGE0=12.1.1.2 - 12.1.1.127 + - NSSAI_SST0=1 + - NSSAI_SD0=0xFFFFFF + - SESSION_AMBR_UL0=200Mbps + - SESSION_AMBR_DL0=400Mbps + - DNN_NI2=oai.ipv4 + depends_on: + - oai-nrf + - oai-amf + volumes: + - ../5g_rfsimulator/smf-healthcheck.sh:/openair-smf/bin/smf-healthcheck.sh + healthcheck: + test: /bin/bash -c "/openair-smf/bin/smf-healthcheck.sh" + interval: 10s + timeout: 5s + retries: 5 + networks: + public_net: + ipv4_address: 192.168.71.133 + + oai-spgwu: + container_name: "rfsim5g-oai-spgwu" + image: oai-spgwu-tiny:august-dev + environment: + - TZ=Europe/Paris + - PID_DIRECTORY=/var/run + - SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP=eth0 + - SGW_INTERFACE_NAME_FOR_SX=eth0 + - PGW_INTERFACE_NAME_FOR_SGI=eth0 + - NETWORK_UE_NAT_OPTION=yes + - NETWORK_UE_IP=12.1.1.0/24 + - SPGWC0_IP_ADDRESS=192.168.71.133 + - BYPASS_UL_PFCP_RULES=no + - MCC=208 + - MNC=99 + - MNC03=099 + - TAC=1 + - GTP_EXTENSION_HEADER_PRESENT=yes + - GW_ID=1 + - REALM=openairinterface.org + - ENABLE_5G_FEATURES=yes + - REGISTER_NRF=yes + - USE_FQDN_NRF=yes + - UPF_FQDN_5G=oai-spgwu + - NRF_IPV4_ADDRESS=192.168.71.130 + - NRF_PORT=80 + - NRF_API_VERSION=v1 + - NRF_FQDN=oai-nrf + - NSSAI_SST_0=1 + - NSSAI_SD_0=0xffffff + - DNN_0=oai + depends_on: + - oai-nrf + - oai-smf + cap_add: + - NET_ADMIN + - SYS_ADMIN + cap_drop: + - ALL + privileged: true + volumes: + - ../5g_rfsimulator/spgwu-healthcheck.sh:/openair-spgwu-tiny/bin/spgwu-healthcheck.sh + healthcheck: + test: /bin/bash -c "/openair-spgwu-tiny/bin/spgwu-healthcheck.sh" + interval: 10s + timeout: 5s + retries: 5 + networks: + public_net: + ipv4_address: 192.168.71.134 + traffic_net: + ipv4_address: 192.168.72.134 + + oai-ext-dn: + image: ubuntu:bionic + privileged: true + container_name: rfsim5g-oai-ext-dn + entrypoint: /bin/bash -c \ + "apt update; apt install -y procps iptables iproute2 iperf iputils-ping;"\ + "iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\ + "ip route add 12.1.1.0/24 via 192.168.72.134 dev eth0; sleep infinity" + depends_on: + - oai-spgwu + networks: + traffic_net: + ipv4_address: 192.168.72.135 + healthcheck: + test: /bin/bash -c "ping -c 2 192.168.72.134" + interval: 10s + timeout: 5s + retries: 5 + + oai-gnb: + image: oai-gnb:develop + privileged: true + container_name: rfsim5g-oai-gnb + environment: + RFSIMULATOR: server + USE_VOLUMED_CONF: 'yes' + USE_ADDITIONAL_OPTIONS: --sa --rfsim --log_config.global_log_options level,nocolor,time + depends_on: + - oai-ext-dn + networks: + public_net: + ipv4_address: 192.168.71.140 + volumes: + - ../../conf_files/gnb.sa.band78.106prb.rfsim.2x2.conf:/opt/oai-gnb/etc/mounted.conf + healthcheck: + test: /bin/bash -c "pgrep nr-softmodem" + interval: 10s + timeout: 5s + retries: 5 + + oai-nr-ue: + image: oai-nr-ue:develop + privileged: true + container_name: rfsim5g-oai-nr-ue + environment: + RFSIMULATOR: 192.168.71.140 + FULL_IMSI: '208990100001100' + FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f' + OPC: 'C42449363BBAD02B66D16BC975D77CC1' + DNN: oai + NSSAI_SST: 1 + USE_ADDITIONAL_OPTIONS: --sa --rfsim -r 106 --numerology 1 --band 78 -C 3319680000 --nokrnmod --ue-nb-ant-tx 2 --ue-nb-ant-rx 2 --uecap_file /opt/oai-nr-ue/etc/uecap.xml --log_config.global_log_options level,nocolor,time + depends_on: + - oai-gnb + networks: + public_net: + ipv4_address: 192.168.71.150 + volumes: + - ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap_ports2.xml:/opt/oai-nr-ue/etc/uecap.xml + healthcheck: + test: /bin/bash -c "pgrep nr-uesoftmodem" + interval: 10s + timeout: 5s + retries: 5 + +networks: + public_net: + driver: bridge + name: rfsim5g-oai-public-net + ipam: + config: + - subnet: 192.168.71.128/26 + driver_opts: + com.docker.network.bridge.name: "rfsim5g-public" + traffic_net: + driver: bridge + name: rfsim5g-oai-traffic-net + ipam: + config: + - subnet: 192.168.72.128/26 + driver_opts: + com.docker.network.bridge.name: "rfsim5g-traffic" From a74ced54a2d07d4c2e9298e2914037cadd8c2d80 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 22 Dec 2022 11:56:52 +0100 Subject: [PATCH 05/18] CI: Add 5G RFsim 2x2 test --- .../xml_files/container_5g_rfsim_2x2.xml | 124 ++++++++++++++++++ .../xml_files/container_5g_rfsim_2x2_down.xml | 45 +++++++ 2 files changed, 169 insertions(+) create mode 100644 ci-scripts/xml_files/container_5g_rfsim_2x2.xml create mode 100644 ci-scripts/xml_files/container_5g_rfsim_2x2_down.xml diff --git a/ci-scripts/xml_files/container_5g_rfsim_2x2.xml b/ci-scripts/xml_files/container_5g_rfsim_2x2.xml new file mode 100644 index 0000000000..5c5b5a8d8b --- /dev/null +++ b/ci-scripts/xml_files/container_5g_rfsim_2x2.xml @@ -0,0 +1,124 @@ + + + rfsim-5gnr-tdd-2x2 + Monolithic SA TDD 2x2 gNB + wrench + 1 + + 111111 + 100001 + 000000 + 000001 + 000002 + 000003 + 020001 + 020002 + 030001 + 030002 + 100001 + + + + + Pull_Local_Registry + Pull Images from Local Registry + 0 + oai-gnb oai-nr-ue + + + + DeployGenObject + Deploy MySql Database + yaml_files/5g_rfsimulator_2x2 + mysql + 1 + + + + DeployGenObject + Deploy OAI 5G CoreNetwork + yaml_files/5g_rfsimulator_2x2 + oai-nrf oai-amf oai-smf oai-spgwu oai-ext-dn + 6 + + + + DeployGenObject + Deploy OAI 5G gNB RF sim SA + yaml_files/5g_rfsimulator_2x2 + oai-gnb + 7 + + + + DeployGenObject + Deploy OAI 5G NR-UE RF sim SA + yaml_files/5g_rfsimulator_2x2 + oai-nr-ue + 8 + + + + PingFromContainer + Ping ext-dn from NR-UE + rfsim5g-oai-nr-ue + -I oaitun_ue1 -c 20 192.168.72.135 + 5 + + + + PingFromContainer + Ping NR-UE from ext-dn + rfsim5g-oai-ext-dn + -c 20 12.1.1.2 + 5 + + + + IperfFromContainer + Iperf UDP Downlink + 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 10 -b 3M + + + + IperfFromContainer + Iperf UDP Uplink + 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 10 -b 1M + + + + UndeployGenObject + Undeploy all OAI 5G stack + yaml_files/5g_rfsimulator_2x2 + 1,0,0,0 + 1,0,0,0 + + + diff --git a/ci-scripts/xml_files/container_5g_rfsim_2x2_down.xml b/ci-scripts/xml_files/container_5g_rfsim_2x2_down.xml new file mode 100644 index 0000000000..62ed318782 --- /dev/null +++ b/ci-scripts/xml_files/container_5g_rfsim_2x2_down.xml @@ -0,0 +1,45 @@ + + + rfsim-5gnr-2x2-down + CleanUp SA Monolithic TDD 2x2 gNB + trash + + 100002 + 222222 + + + + + UndeployGenObject + Undeploy all OAI 5G stack + yaml_files/5g_rfsimulator_2x2 + + + + Clean_Test_Server_Images + Clean Test Images on Test Server + 0 + + + From 69b6d7ed5b625e0651949647d850d78ae7ef1fcd Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 22 Dec 2022 12:34:13 +0100 Subject: [PATCH 06/18] CI: docker-compose file for RFsim u0/25prb --- .../docker-compose.yaml | 299 ++++++++++++++++++ 1 file changed, 299 insertions(+) create mode 100644 ci-scripts/yaml_files/5g_rfsimulator_u0_25prb/docker-compose.yaml diff --git a/ci-scripts/yaml_files/5g_rfsimulator_u0_25prb/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator_u0_25prb/docker-compose.yaml new file mode 100644 index 0000000000..973a687e87 --- /dev/null +++ b/ci-scripts/yaml_files/5g_rfsimulator_u0_25prb/docker-compose.yaml @@ -0,0 +1,299 @@ +version: '3.8' +services: + oai-nrf: + container_name: "rfsim5g-oai-nrf" + image: oai-nrf:august-dev + environment: + - NRF_INTERFACE_NAME_FOR_SBI=eth0 + - NRF_INTERFACE_PORT_FOR_SBI=80 + - NRF_INTERFACE_HTTP2_PORT_FOR_SBI=9090 + - NRF_API_VERSION=v1 + - INSTANCE=0 + - PID_DIRECTORY=/var/run + networks: + public_net: + ipv4_address: 192.168.71.130 + volumes: + - ../5g_rfsimulator/nrf-healthcheck.sh:/openair-nrf/bin/nrf-healthcheck.sh + healthcheck: + test: /bin/bash -c "/openair-nrf/bin/nrf-healthcheck.sh" + interval: 10s + timeout: 5s + retries: 5 + + mysql: + container_name: "rfsim5g-mysql" + image: mysql:5.7 + volumes: + - ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql + - ../5g_rfsimulator/mysql-healthcheck.sh:/tmp/mysql-healthcheck.sh + environment: + - TZ=Europe/Paris + - MYSQL_DATABASE=oai_db + - MYSQL_USER=test + - MYSQL_PASSWORD=test + - MYSQL_ROOT_PASSWORD=linux + healthcheck: + test: /bin/bash -c "/tmp/mysql-healthcheck.sh" + interval: 10s + timeout: 5s + retries: 5 + networks: + public_net: + ipv4_address: 192.168.71.131 + + oai-amf: + container_name: "rfsim5g-oai-amf" + image: oai-amf:august-dev + environment: + - TZ=Europe/paris + - INSTANCE=0 + - PID_DIRECTORY=/var/run + - MCC=208 + - MNC=99 + - REGION_ID=128 + - AMF_SET_ID=1 + - SERVED_GUAMI_MCC_0=208 + - SERVED_GUAMI_MNC_0=99 + - SERVED_GUAMI_REGION_ID_0=128 + - SERVED_GUAMI_AMF_SET_ID_0=1 + - SERVED_GUAMI_MCC_1=460 + - SERVED_GUAMI_MNC_1=11 + - SERVED_GUAMI_REGION_ID_1=10 + - SERVED_GUAMI_AMF_SET_ID_1=1 + - PLMN_SUPPORT_MCC=208 + - PLMN_SUPPORT_MNC=99 + - PLMN_SUPPORT_TAC=0x0001 + - SST_0=1 + - SD_0=0xffffff + - SST_1=1 + - SD_1=1 + - AMF_INTERFACE_NAME_FOR_NGAP=eth0 + - AMF_INTERFACE_NAME_FOR_N11=eth0 + - SMF_INSTANCE_ID_0=1 + - SMF_FQDN_0=oai-smf + - SMF_IPV4_ADDR_0=0.0.0.0 + - SMF_HTTP_VERSION_0=v1 + - SELECTED_0=true + - SMF_INSTANCE_ID_1=2 + - SMF_FQDN_1=oai-smf + - SMF_IPV4_ADDR_1=0.0.0.0 + - SMF_HTTP_VERSION_1=v1 + - SELECTED_1=false + - MYSQL_SERVER=192.168.71.131 + - MYSQL_USER=root + - MYSQL_PASS=linux + - MYSQL_DB=oai_db + - OPERATOR_KEY=c42449363bbad02b66d16bc975d77cc1 + - NRF_IPV4_ADDRESS=192.168.71.130 + - NRF_PORT=80 + - NF_REGISTRATION=yes + - SMF_SELECTION=yes + - USE_FQDN_DNS=yes + - NRF_API_VERSION=v1 + - NRF_FQDN=oai-nrf + - EXTERNAL_AUSF=no + - AUSF_IPV4_ADDRESS=0.0.0.0 + - AUSF_PORT=80 + - AUSF_API_VERSION=v1 + - AUSF_FQDN=localhost + depends_on: + - oai-nrf + - mysql + volumes: + - ../5g_rfsimulator/amf-healthcheck.sh:/openair-amf/bin/amf-healthcheck.sh + healthcheck: + test: /bin/bash -c "/openair-amf/bin/amf-healthcheck.sh" + interval: 10s + timeout: 15s + retries: 5 + networks: + public_net: + ipv4_address: 192.168.71.132 + + oai-smf: + container_name: "rfsim5g-oai-smf" + image: oai-smf:august-dev + environment: + - TZ=Europe/Paris + - INSTANCE=0 + - PID_DIRECTORY=/var/run + - SMF_INTERFACE_NAME_FOR_N4=eth0 + - SMF_INTERFACE_NAME_FOR_SBI=eth0 + - SMF_INTERFACE_PORT_FOR_SBI=80 + - SMF_INTERFACE_HTTP2_PORT_FOR_SBI=9090 + - SMF_API_VERSION=v1 + - DEFAULT_DNS_IPV4_ADDRESS=172.21.3.100 + - DEFAULT_DNS_SEC_IPV4_ADDRESS=4.4.4.4 + - AMF_IPV4_ADDRESS=0.0.0.0 + - AMF_PORT=80 + - AMF_API_VERSION=v1 + - AMF_FQDN=oai-amf + - UDM_IPV4_ADDRESS=127.0.0.1 + - UDM_PORT=80 + - UDM_API_VERSION=v1 + - UDM_FQDN=localhost + - UPF_IPV4_ADDRESS=192.168.71.134 + - UPF_FQDN_0=oai-spgwu + - NRF_IPV4_ADDRESS=192.168.71.130 + - NRF_PORT=80 + - NRF_API_VERSION=v1 + - NRF_FQDN=oai-nrf + - REGISTER_NRF=yes + - DISCOVER_UPF=yes + - USE_FQDN_DNS=yes + - DNN_NI0=oai + - TYPE0=IPv4 + - DNN_RANGE0=12.1.1.2 - 12.1.1.127 + - NSSAI_SST0=1 + - NSSAI_SD0=0xFFFFFF + - SESSION_AMBR_UL0=200Mbps + - SESSION_AMBR_DL0=400Mbps + - DNN_NI2=oai.ipv4 + depends_on: + - oai-nrf + - oai-amf + volumes: + - ../5g_rfsimulator/smf-healthcheck.sh:/openair-smf/bin/smf-healthcheck.sh + healthcheck: + test: /bin/bash -c "/openair-smf/bin/smf-healthcheck.sh" + interval: 10s + timeout: 5s + retries: 5 + networks: + public_net: + ipv4_address: 192.168.71.133 + + oai-spgwu: + container_name: "rfsim5g-oai-spgwu" + image: oai-spgwu-tiny:august-dev + environment: + - TZ=Europe/Paris + - PID_DIRECTORY=/var/run + - SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP=eth0 + - SGW_INTERFACE_NAME_FOR_SX=eth0 + - PGW_INTERFACE_NAME_FOR_SGI=eth0 + - NETWORK_UE_NAT_OPTION=yes + - NETWORK_UE_IP=12.1.1.0/24 + - SPGWC0_IP_ADDRESS=192.168.71.133 + - BYPASS_UL_PFCP_RULES=no + - MCC=208 + - MNC=99 + - MNC03=099 + - TAC=1 + - GTP_EXTENSION_HEADER_PRESENT=yes + - GW_ID=1 + - REALM=openairinterface.org + - ENABLE_5G_FEATURES=yes + - REGISTER_NRF=yes + - USE_FQDN_NRF=yes + - UPF_FQDN_5G=oai-spgwu + - NRF_IPV4_ADDRESS=192.168.71.130 + - NRF_PORT=80 + - NRF_API_VERSION=v1 + - NRF_FQDN=oai-nrf + - NSSAI_SST_0=1 + - NSSAI_SD_0=0xffffff + - DNN_0=oai + depends_on: + - oai-nrf + - oai-smf + cap_add: + - NET_ADMIN + - SYS_ADMIN + cap_drop: + - ALL + privileged: true + volumes: + - ../5g_rfsimulator/spgwu-healthcheck.sh:/openair-spgwu-tiny/bin/spgwu-healthcheck.sh + healthcheck: + test: /bin/bash -c "/openair-spgwu-tiny/bin/spgwu-healthcheck.sh" + interval: 10s + timeout: 5s + retries: 5 + networks: + public_net: + ipv4_address: 192.168.71.134 + traffic_net: + ipv4_address: 192.168.72.134 + + oai-ext-dn: + image: ubuntu:bionic + privileged: true + container_name: rfsim5g-oai-ext-dn + entrypoint: /bin/bash -c \ + "apt update; apt install -y procps iptables iproute2 iperf iputils-ping;"\ + "iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\ + "ip route add 12.1.1.0/24 via 192.168.72.134 dev eth0; sleep infinity" + depends_on: + - oai-spgwu + networks: + traffic_net: + ipv4_address: 192.168.72.135 + healthcheck: + test: /bin/bash -c "ping -c 2 192.168.72.134" + interval: 10s + timeout: 5s + retries: 5 + + oai-gnb: + image: oai-gnb:develop + privileged: true + container_name: rfsim5g-oai-gnb + environment: + RFSIMULATOR: server + USE_VOLUMED_CONF: 'yes' + USE_ADDITIONAL_OPTIONS: --sa --rfsim --log_config.global_log_options level,nocolor,time + depends_on: + - oai-ext-dn + networks: + public_net: + ipv4_address: 192.168.71.140 + volumes: + - ../../conf_files/gnb.sa.band66.u0.25prb.rfsim.conf:/opt/oai-gnb/etc/mounted.conf + healthcheck: + test: /bin/bash -c "pgrep nr-softmodem" + interval: 10s + timeout: 5s + retries: 5 + + oai-nr-ue: + image: oai-nr-ue:develop + privileged: true + container_name: rfsim5g-oai-nr-ue + environment: + RFSIMULATOR: 192.168.71.140 + FULL_IMSI: '208990100001100' + FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f' + OPC: 'C42449363BBAD02B66D16BC975D77CC1' + DNN: oai + NSSAI_SST: 1 + USE_ADDITIONAL_OPTIONS: --sa --rfsim -r 25 --numerology 0 --band 66 -C 2152250000 --CO -400000000 --ssb 48 --nokrnmod --nokrnmod --log_config.global_log_options level,nocolor,time + depends_on: + - oai-gnb + networks: + public_net: + ipv4_address: 192.168.71.150 + healthcheck: + test: /bin/bash -c "pgrep nr-uesoftmodem" + interval: 10s + timeout: 5s + retries: 5 + +networks: + public_net: + driver: bridge + name: rfsim5g-oai-public-net + ipam: + config: + - subnet: 192.168.71.128/26 + driver_opts: + com.docker.network.bridge.name: "rfsim5g-public" + traffic_net: + driver: bridge + name: rfsim5g-oai-traffic-net + ipam: + config: + - subnet: 192.168.72.128/26 + driver_opts: + com.docker.network.bridge.name: "rfsim5g-traffic" From 387ff92ab3b65ca05fcca8aab28518c1584cd6db Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 22 Dec 2022 12:52:42 +0100 Subject: [PATCH 07/18] CI: Add 5G RFsim u0/25prb test --- .../xml_files/container_5g_rfsim_u0_25prb.xml | 124 ++++++++++++++++++ .../container_5g_rfsim_u0_25prb_down.xml | 45 +++++++ 2 files changed, 169 insertions(+) create mode 100644 ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml create mode 100644 ci-scripts/xml_files/container_5g_rfsim_u0_25prb_down.xml diff --git a/ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml b/ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml new file mode 100644 index 0000000000..c24831ee5b --- /dev/null +++ b/ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml @@ -0,0 +1,124 @@ + + + rfsim-5gnr-tdd-u0-25prb + Monolithic SA TDD u0/25prb gNB + wrench + 1 + + 111111 + 100001 + 000000 + 000001 + 000002 + 000003 + 020001 + 020002 + 030001 + 030002 + 100001 + + + + + Pull_Local_Registry + Pull Images from Local Registry + 0 + oai-gnb oai-nr-ue + + + + DeployGenObject + Deploy MySql Database + yaml_files/5g_rfsimulator_u0_25prb + mysql + 1 + + + + DeployGenObject + Deploy OAI 5G CoreNetwork + yaml_files/5g_rfsimulator_u0_25prb + oai-nrf oai-amf oai-smf oai-spgwu oai-ext-dn + 6 + + + + DeployGenObject + Deploy OAI 5G gNB RF sim SA + yaml_files/5g_rfsimulator_u0_25prb + oai-gnb + 7 + + + + DeployGenObject + Deploy OAI 5G NR-UE RF sim SA + yaml_files/5g_rfsimulator_u0_25prb + oai-nr-ue + 8 + + + + PingFromContainer + Ping ext-dn from NR-UE + rfsim5g-oai-nr-ue + -I oaitun_ue1 -c 20 192.168.72.135 + 5 + + + + PingFromContainer + Ping NR-UE from ext-dn + rfsim5g-oai-ext-dn + -c 20 12.1.1.2 + 5 + + + + IperfFromContainer + Iperf UDP Downlink + 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 10 -b 3M + + + + IperfFromContainer + Iperf UDP Uplink + 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 10 -b 1M + + + + UndeployGenObject + Undeploy all OAI 5G stack + yaml_files/5g_rfsimulator_u0_25prb + 1,0,0,0 + 1,0,0,0 + + + diff --git a/ci-scripts/xml_files/container_5g_rfsim_u0_25prb_down.xml b/ci-scripts/xml_files/container_5g_rfsim_u0_25prb_down.xml new file mode 100644 index 0000000000..99e944d72e --- /dev/null +++ b/ci-scripts/xml_files/container_5g_rfsim_u0_25prb_down.xml @@ -0,0 +1,45 @@ + + + rfsim-5gnr-u0-25prb-down + CleanUp SA Monolithic TDD u0/25prb gNB + trash + + 100002 + 222222 + + + + + UndeployGenObject + Undeploy all OAI 5G stack + yaml_files/5g_rfsimulator_u0_25prb + + + + Clean_Test_Server_Images + Clean Test Images on Test Server + 0 + + + From 10e9474e677524a22e9b4df5422fa9344e73d6cb Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 22 Dec 2022 13:02:03 +0100 Subject: [PATCH 08/18] Add forgotten file --- .../gnb.sa.band66.u0.25prb.rfsim.conf | 284 ++++++++++++++++++ 1 file changed, 284 insertions(+) create mode 100644 ci-scripts/conf_files/gnb.sa.band66.u0.25prb.rfsim.conf diff --git a/ci-scripts/conf_files/gnb.sa.band66.u0.25prb.rfsim.conf b/ci-scripts/conf_files/gnb.sa.band66.u0.25prb.rfsim.conf new file mode 100644 index 0000000000..1656d3bcd1 --- /dev/null +++ b/ci-scripts/conf_files/gnb.sa.band66.u0.25prb.rfsim.conf @@ -0,0 +1,284 @@ +Active_gNBs = ( "5G-GOA-gNB"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe00; + gNB_name = "5G-GOA-gNB"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ({ mcc = 208; mnc = 99; mnc_length = 2; snssaiList = ({ sst = 1 }) }); + + nr_cellid = 12345678L; + + ////////// Physical parameters: + + sib1_tda = 5; + min_rxtxtime = 6; + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 2; + searchSpaceZero = 0; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 2150 MHz + 14 PRBs@15kHz SCS (same as initial BWP), points to Subcarrier 0 of RB#10 of SSB block + absoluteFrequencySSB = 430504; + dl_frequencyBand = 66; + # this is 2150 MHz + dl_absoluteFrequencyPointA = 430000; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 0; + dl_carrierBandwidth = 25; + #initialDownlinkBWP + #genericParameters + # this is RBstart=0,L=25 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 6600; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 0; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 2; + initialDLBWPsearchSpaceZero = 0; + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 66; + # this is 1750 MHz + ul_absoluteFrequencyPointA = 350000; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 0; + ul_carrierBandwidth = 25; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 6600; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 0; + #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 = 13; + preambleReceivedTargetPower = -118; +#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 = 4; +#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 = 0; +# 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 = 0; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 0; + # 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 = "192.168.71.132"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + GNB_INTERFACE_NAME_FOR_NG_AMF = "eno1"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.71.140/26"; + GNB_INTERFACE_NAME_FOR_NGU = "eno1"; + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.71.140/26"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( +{ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 150; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 0; +} +); + +L1s = ( +{ + num_cc = 1; + tr_n_preference = "local_mac"; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} +); + +RUs = ( + { + local_rf = "yes"; + nb_tx = 1; + nb_rx = 1; + att_tx = 0; + att_rx = 0; + bands = [7]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 114; + sf_extension = 0; + 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]; + sdr_addrs = "type=x300"; + clock_src = "internal"; + # if_freq = 3700000000L; + # if_offset = 1000000; + } +); + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_RU_L1_TRX_SPLIT"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_DISABLE"; + } +); + +rfsimulator : +{ + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; +}; + +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"; + hw_log_level ="info"; + phy_log_level ="info"; + mac_log_level ="info"; + rlc_log_level ="info"; + pdcp_log_level ="info"; + rrc_log_level ="info"; + ngap_log_level ="debug"; + f1ap_log_level ="debug"; +}; From 9de7f5838b7ecb70db29bb1402346969e7efcaa9 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 22 Dec 2022 16:42:39 +0100 Subject: [PATCH 09/18] Correct naming: slash interferes with sed --- ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml | 2 +- ci-scripts/xml_files/container_5g_rfsim_u0_25prb_down.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml b/ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml index c24831ee5b..ad5866dad7 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml @@ -22,7 +22,7 @@ --> rfsim-5gnr-tdd-u0-25prb - Monolithic SA TDD u0/25prb gNB + Monolithic SA TDD u0 25PRB gNB wrench 1 diff --git a/ci-scripts/xml_files/container_5g_rfsim_u0_25prb_down.xml b/ci-scripts/xml_files/container_5g_rfsim_u0_25prb_down.xml index 99e944d72e..88bb46be24 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_u0_25prb_down.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_u0_25prb_down.xml @@ -22,7 +22,7 @@ --> rfsim-5gnr-u0-25prb-down - CleanUp SA Monolithic TDD u0/25prb gNB + CleanUp SA Monolithic TDD u0 25PRB gNB trash 100002 From b780c9db80222c37b9278fb8742cc87280a916c3 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 12 Jan 2023 17:26:49 +0100 Subject: [PATCH 10/18] Workaround: MCS>16 leads to retx in 2x2 --- ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.2x2.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.2x2.conf b/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.2x2.conf index 6ea35b4b87..e35a6b1d4d 100644 --- a/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.2x2.conf +++ b/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.2x2.conf @@ -255,6 +255,7 @@ MACRLCs = ( #pusch_TargetSNRx10 = 150; #pucch_TargetSNRx10 = 200; ulsch_max_frame_inactivity = 0; + dl_max_mcs = 16; # there are retransmissions if more } ); From f9f6283cc33aaf65ba8b5d4ea1685092bf2b50f9 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 20 Dec 2022 15:21:08 +0100 Subject: [PATCH 11/18] schedule SRS K2 slots in advance --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 6 +-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c | 39 +++++++++++++------ openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 2 +- openair2/RRC/NR/nr_rrc_config.c | 22 +++++------ 4 files changed, 41 insertions(+), 28 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 008e0c02fa..3009dc6b6c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -192,7 +192,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, schedule_nr_mib(module_idP, frame, slot); // This schedules SIB1 - if ( get_softmodem_params()->sa == 1 ) + if (get_softmodem_params()->sa == 1) schedule_nr_sib1(module_idP, frame, slot); @@ -216,9 +216,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, // Schedule CSI measurement reporting nr_csi_meas_reporting(module_idP, frame, slot); - // Schedule SRS: check in slot 0 for the whole frame - if (slot == 0) - nr_schedule_srs(module_idP, frame); + nr_schedule_srs(module_idP, frame, slot); // This schedule RA procedure if not in phy_test mode // Otherwise consider 5G already connected diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c index a403414222..ef98c82eab 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c @@ -222,7 +222,8 @@ void nr_fill_nfapi_srs(int module_id, int CC_id, NR_UE_info_t* UE, sub_frame_t s * Only for periodic scheduling yet. * *********************************************************************/ -void nr_schedule_srs(int module_id, frame_t frame) { +void nr_schedule_srs(int module_id, frame_t frame, int slot) + { gNB_MAC_INST *nrmac = RC.nrmac[module_id]; NR_UEs_t *UE_info = &nrmac->UE_info; @@ -232,9 +233,11 @@ void nr_schedule_srs(int module_id, frame_t frame) { NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl; NR_UE_UL_BWP_t *current_BWP = &UE->current_UL_BWP; - sched_ctrl->sched_srs.frame = -1; - sched_ctrl->sched_srs.slot = -1; - sched_ctrl->sched_srs.srs_scheduled = false; + if(sched_ctrl->sched_srs.srs_scheduled && sched_ctrl->sched_srs.frame == frame && sched_ctrl->sched_srs.slot == slot) { + sched_ctrl->sched_srs.frame = -1; + sched_ctrl->sched_srs.slot = -1; + sched_ctrl->sched_srs.srs_scheduled = false; + } if((sched_ctrl->ul_failure == 1 && get_softmodem_params()->phy_test==0) || sched_ctrl->rrc_processing_timer > 0) { @@ -271,16 +274,28 @@ void nr_schedule_srs(int module_id, frame_t frame) { continue; } - uint16_t period = srs_period[srs_resource->resourceType.choice.periodic->periodicityAndOffset_p.present]; - uint16_t offset = get_nr_srs_offset(srs_resource->resourceType.choice.periodic->periodicityAndOffset_p); - int n_slots_frame = nr_slots_per_frame[current_BWP->scs]; + const int num_tda = current_BWP->tdaList->list.count; + int max_k2 = 0; + // avoid last one in the list (for msg3) + for (int i = 0; i < num_tda - 1; i++) { + int k2 = get_K2(current_BWP->tdaList, i, current_BWP->scs); + max_k2 = k2 > max_k2 ? k2 : max_k2; + } + + // we are sheduling SRS max_k2 slot in advance for the presence of SRS to be taken into account when scheduling PUSCH + const int n_slots_frame = nr_slots_per_frame[current_BWP->scs]; + const int sched_slot = (slot + max_k2) % n_slots_frame; + const int sched_frame = (frame + ((slot + max_k2) / n_slots_frame)) % 1024; + + const uint16_t period = srs_period[srs_resource->resourceType.choice.periodic->periodicityAndOffset_p.present]; + const uint16_t offset = get_nr_srs_offset(srs_resource->resourceType.choice.periodic->periodicityAndOffset_p); // Check if UE will transmit the SRS in this frame - if (((frame - offset / n_slots_frame) * n_slots_frame) % period == 0) { - LOG_D(NR_MAC,"Scheduling SRS reception for %d.%d\n", frame, offset%n_slots_frame); - nr_fill_nfapi_srs(module_id, CC_id, UE, offset%n_slots_frame, srs_resource_set, srs_resource); - sched_ctrl->sched_srs.frame = frame; - sched_ctrl->sched_srs.slot = offset%n_slots_frame; + if ((sched_frame * n_slots_frame + sched_slot - offset) % period == 0) { + LOG_D(NR_MAC," %d.%d Scheduling SRS reception for %d.%d\n", frame, slot, sched_frame, sched_slot); + nr_fill_nfapi_srs(module_id, CC_id, UE, sched_slot, srs_resource_set, srs_resource); + sched_ctrl->sched_srs.frame = sched_frame; + sched_ctrl->sched_srs.slot = sched_slot; sched_ctrl->sched_srs.srs_scheduled = true; } } diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 2e997d42a7..cae73f091a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -199,7 +199,7 @@ void nr_srs_ri_computation(const nfapi_nr_srs_normalized_channel_iq_matrix_t *nr const NR_UE_UL_BWP_t *current_BWP, uint8_t *ul_ri); -void nr_schedule_srs(int module_id, frame_t frame); +void nr_schedule_srs(int module_id, frame_t frame, int slot); void nr_csirs_scheduling(int Mod_idP, frame_t frame, diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index 1a81d1fa67..c0d3b730be 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -710,18 +710,18 @@ void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay){ // UL TDA index 0 is basic slot configuration starting in symbol 0 til the last but one symbol struct NR_PUSCH_TimeDomainResourceAllocation *pusch_timedomainresourceallocation = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation)); - pusch_timedomainresourceallocation->k2 = CALLOC(1,sizeof(long)); + pusch_timedomainresourceallocation->k2 = CALLOC(1,sizeof(long)); *pusch_timedomainresourceallocation->k2 = k2; pusch_timedomainresourceallocation->mappingType = NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - pusch_timedomainresourceallocation->startSymbolAndLength = get_SLIV(0,13); + pusch_timedomainresourceallocation->startSymbolAndLength = get_SLIV(0, 13); asn1cSeqAdd(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation); // UL TDA index 1 in case of SRS struct NR_PUSCH_TimeDomainResourceAllocation *pusch_timedomainresourceallocation1 = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation)); - pusch_timedomainresourceallocation1->k2 = CALLOC(1,sizeof(long)); + pusch_timedomainresourceallocation1->k2 = CALLOC(1,sizeof(long)); *pusch_timedomainresourceallocation1->k2 = k2; pusch_timedomainresourceallocation1->mappingType = NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - pusch_timedomainresourceallocation1->startSymbolAndLength = get_SLIV(0,12); + pusch_timedomainresourceallocation1->startSymbolAndLength = get_SLIV(0, 12); asn1cSeqAdd(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation1); if(frame_type==TDD) { @@ -730,28 +730,28 @@ void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay){ if (ul_symb>1) { // UL TDA index 2 for mixed slot (TDD) pusch_timedomainresourceallocation = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation)); - pusch_timedomainresourceallocation->k2 = CALLOC(1,sizeof(long)); + pusch_timedomainresourceallocation->k2 = CALLOC(1,sizeof(long)); *pusch_timedomainresourceallocation->k2 = k2; pusch_timedomainresourceallocation->mappingType = NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - pusch_timedomainresourceallocation->startSymbolAndLength = get_SLIV(14-ul_symb,ul_symb-1); // starting in fist ul symbol til the last but one + pusch_timedomainresourceallocation->startSymbolAndLength = get_SLIV(14 - ul_symb, ul_symb - 1); // starting in fist ul symbol til the last but one asn1cSeqAdd(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation); } // UL TDA index 3 for msg3 in the mixed slot (TDD) int nb_periods_per_frame = get_nb_periods_per_frame(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity); - int nb_slots_per_period = ((1<k2 = CALLOC(1,sizeof(long)); + pusch_timedomainresourceallocation_msg3->k2 = CALLOC(1,sizeof(long)); int no_mix_slot = ul_symb < 3 ? 1 : 0; // we need at least 2 symbols for scheduling Msg3 *pusch_timedomainresourceallocation_msg3->k2 = nb_slots_per_period - DELTA[mu] + no_mix_slot; if(*pusch_timedomainresourceallocation_msg3->k2 < min_fb_delay) *pusch_timedomainresourceallocation_msg3->k2 += nb_slots_per_period; - AssertFatal(*pusch_timedomainresourceallocation_msg3->k2<33,"Computed k2 for msg3 %ld is larger than the range allowed by RRC (0..32)\n", + AssertFatal(*pusch_timedomainresourceallocation_msg3->k2 < 33,"Computed k2 for msg3 %ld is larger than the range allowed by RRC (0..32)\n", *pusch_timedomainresourceallocation_msg3->k2); pusch_timedomainresourceallocation_msg3->mappingType = NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; if(no_mix_slot) - pusch_timedomainresourceallocation_msg3->startSymbolAndLength = get_SLIV(0,13); // full allocation if there is no mixed slot + pusch_timedomainresourceallocation_msg3->startSymbolAndLength = get_SLIV(0, 13); // full allocation if there is no mixed slot else - pusch_timedomainresourceallocation_msg3->startSymbolAndLength = get_SLIV(14-ul_symb,ul_symb-1); // starting in fist ul symbol til the last but one + pusch_timedomainresourceallocation_msg3->startSymbolAndLength = get_SLIV(14 - ul_symb, ul_symb - 1); // starting in fist ul symbol til the last but one asn1cSeqAdd(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation_msg3); } } From 90a836a022c092dcd699f52c71f9dc7d57dcb922 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 17 Jan 2023 11:38:57 +0100 Subject: [PATCH 12/18] Correctly encode DNN length/APN name --- openair3/NAS/NR_UE/nr_nas_msg_sim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair3/NAS/NR_UE/nr_nas_msg_sim.c b/openair3/NAS/NR_UE/nr_nas_msg_sim.c index 890af23d1f..8a600e0cf9 100644 --- a/openair3/NAS/NR_UE/nr_nas_msg_sim.c +++ b/openair3/NAS/NR_UE/nr_nas_msg_sim.c @@ -751,7 +751,7 @@ static void generatePduSessionEstablishRequest(int Mod_id, uicc_t * uicc, as_nas int dnnSize=strlen(uicc->dnnStr); mm_msg->uplink_nas_transport.dnn.value=calloc(1,dnnSize+1); mm_msg->uplink_nas_transport.dnn.length = dnnSize + 1; - mm_msg->uplink_nas_transport.dnn.value[0] = dnnSize + 1; + mm_msg->uplink_nas_transport.dnn.value[0] = dnnSize; memcpy(mm_msg->uplink_nas_transport.dnn.value+1,uicc->dnnStr, dnnSize); size += (1+1+dnnSize+1); From 924d88bbf94ae4467dcc23917ad083b1caf33683 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Tue, 17 Jan 2023 13:06:25 +0100 Subject: [PATCH 13/18] bugfix: avoid a crash when oai_exit is set There was a crash when we exit the nr softmodem with AW2S device. The array rxbase[] was surely freed() by some other thread, so let's not access it after detecting oai_exit != 0. We also need to unblock a possible reader thread. The chosen way to do may be not the best. To be checked. --- radio/ETHERNET/USERSPACE/LIB/eth_udp.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/radio/ETHERNET/USERSPACE/LIB/eth_udp.c b/radio/ETHERNET/USERSPACE/LIB/eth_udp.c index ca62ceab6c..c098d4f539 100644 --- a/radio/ETHERNET/USERSPACE/LIB/eth_udp.c +++ b/radio/ETHERNET/USERSPACE/LIB/eth_udp.c @@ -451,6 +451,11 @@ void *udp_read_thread(void *arg) { buffer,sizeof(buffer),0, (struct sockaddr *)&((eth_state_t*)device->priv)->dest_addrd, (socklen_t *)&((eth_state_t*)device->priv)->addr_len); + /* if oai_exit is 1 here, don't access the array rxbase, + * it may have been freed(), so let's break at this point + */ + if (oai_exit) + break; aid = *(uint16_t*)(&buffer[ECPRICOMMON_BYTES]); TS = *(openair0_timestamp *)(&buffer[ECPRICOMMON_BYTES+ECPRIPCID_BYTES]); // convert TS to samples, /6 for AW2S @ 30.72 Ms/s, this is converted for other sample rates in OAI application @@ -475,6 +480,11 @@ void *udp_read_thread(void *arg) { } sleep(1); } + + /* let's unblock reader (maybe not the best way to do it) */ + fhstate->first_read = 0; + fhstate->r[0] = 1; + return(0); } From 3674a6f0f2b5e7885f6023148a0cbc1050dd79f0 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Tue, 17 Jan 2023 12:26:53 +0100 Subject: [PATCH 14/18] bugfix: initialize all variables of the 'context' thing There was a problem in rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND() where we PROTOCOL_CTXT_SET_BY_INSTANCE() that does not initialize eNB_index leading to a crash later on in pdcp. So let's initialize everything. Plus, while we're here, use do { } while(0) in the macros, just to avoid problems like: if (condition) macro; Without do { } while(0) only the first statement of the macro is done in the if. (Not sure if the code has the problem somewhere, but doesn't hurt to fix.) --- openair2/COMMON/platform_types.h | 47 ++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/openair2/COMMON/platform_types.h b/openair2/COMMON/platform_types.h index 8aebd0374b..99eede13ea 100644 --- a/openair2/COMMON/platform_types.h +++ b/openair2/COMMON/platform_types.h @@ -234,16 +234,14 @@ typedef struct protocol_ctxt_s { #define GNB_INSTANCE_TO_MODULE_ID( iNSTANCE )iNSTANCE #define MODULE_ID_TO_INSTANCE(mODULE_iD, iNSTANCE, eNB_fLAG) \ - if(eNB_fLAG == ENB_FLAG_YES) \ - iNSTANCE = ENB_MODULE_ID_TO_INSTANCE(mODULE_iD); \ - else \ - iNSTANCE = UE_MODULE_ID_TO_INSTANCE(mODULE_iD) + do { \ + iNSTANCE = eNB_fLAG == ENB_FLAG_YES ? ENB_MODULE_ID_TO_INSTANCE(mODULE_iD) : UE_MODULE_ID_TO_INSTANCE(mODULE_iD); \ + } while (0) #define INSTANCE_TO_MODULE_ID(iNSTANCE, mODULE_iD, eNB_fLAG) \ - if(eNB_fLAG == ENB_FLAG_YES) \ - mODULE_iD = ENB_INSTANCE_TO_MODULE_ID(iNSTANCE); \ - else \ - mODULE_iD = UE_INSTANCE_TO_MODULE_ID(iNSTANCE) + do { \ + mODULE_iD = eNB_fLAG == ENB_FLAG_YES ? ENB_INSTANCE_TO_MODULE_ID(iNSTANCE) : UE_INSTANCE_TO_MODULE_ID(iNSTANCE); \ + } while (0) #define PROTOCOL_CTXT_COMPUTE_MODULE_ID(CtXt_h) \ INSTANCE_TO_MODULE_ID( (CtXt_h)->instance , (CtXt_h)->module_id , (CtXt_h)->enb_flag ) @@ -253,21 +251,28 @@ typedef struct protocol_ctxt_s { MODULE_ID_TO_INSTANCE( (CtXt_h)->module_id , (CtXt_h)->instance , (CtXt_h)->enb_flag ) #define PROTOCOL_CTXT_SET_BY_MODULE_ID(Ctxt_Pp, mODULE_iD, eNB_fLAG, rNTI, fRAME, sUBfRAME, eNB_iNDEX) \ - (Ctxt_Pp)->module_id = mODULE_iD; \ - (Ctxt_Pp)->enb_flag = eNB_fLAG; \ - (Ctxt_Pp)->rntiMaybeUEid = rNTI; \ - (Ctxt_Pp)->frame = fRAME; \ - (Ctxt_Pp)->subframe = sUBfRAME; \ - (Ctxt_Pp)->eNB_index = eNB_iNDEX; \ - PROTOCOL_CTXT_COMPUTE_INSTANCE(Ctxt_Pp) + do { \ + (Ctxt_Pp)->module_id = mODULE_iD; \ + (Ctxt_Pp)->enb_flag = eNB_fLAG; \ + (Ctxt_Pp)->rntiMaybeUEid = rNTI; \ + (Ctxt_Pp)->frame = fRAME; \ + (Ctxt_Pp)->subframe = sUBfRAME; \ + (Ctxt_Pp)->eNB_index = eNB_iNDEX; \ + (Ctxt_Pp)->brOption = false; /* set a default value */ \ + PROTOCOL_CTXT_COMPUTE_INSTANCE(Ctxt_Pp); \ + } while (0) #define PROTOCOL_CTXT_SET_BY_INSTANCE(Ctxt_Pp, iNSTANCE, eNB_fLAG, rNTI, fRAME, sUBfRAME) \ - (Ctxt_Pp)->instance = iNSTANCE; \ - (Ctxt_Pp)->enb_flag = eNB_fLAG; \ - (Ctxt_Pp)->rntiMaybeUEid = rNTI; \ - (Ctxt_Pp)->frame = fRAME; \ - (Ctxt_Pp)->subframe = sUBfRAME; \ - PROTOCOL_CTXT_COMPUTE_MODULE_ID(Ctxt_Pp) + do { \ + (Ctxt_Pp)->instance = iNSTANCE; \ + (Ctxt_Pp)->enb_flag = eNB_fLAG; \ + (Ctxt_Pp)->rntiMaybeUEid = rNTI; \ + (Ctxt_Pp)->frame = fRAME; \ + (Ctxt_Pp)->subframe = sUBfRAME; \ + (Ctxt_Pp)->eNB_index = 0; /* set a default value */ \ + (Ctxt_Pp)->brOption = false; /* set a default value */ \ + PROTOCOL_CTXT_COMPUTE_MODULE_ID(Ctxt_Pp); \ + } while (0) #define PROTOCOL_CTXT_FMT "[FRAME %05u][%s][MOD %02d][RNTI %" PRIx64 "]" #define PROTOCOL_CTXT_ARGS(CTXT_Pp) (CTXT_Pp)->frame, ((CTXT_Pp)->enb_flag == ENB_FLAG_YES) ? "eNB" : " UE", (CTXT_Pp)->module_id, (CTXT_Pp)->rntiMaybeUEid From 08e57ca3132726dc3cddf22de457bdaf3d4a06fa Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Tue, 17 Jan 2023 13:10:08 +0100 Subject: [PATCH 15/18] bugfix: use correct size in malloc() --- radio/ETHERNET/USERSPACE/LIB/eth_udp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/ETHERNET/USERSPACE/LIB/eth_udp.c b/radio/ETHERNET/USERSPACE/LIB/eth_udp.c index c098d4f539..45cc75bd4d 100644 --- a/radio/ETHERNET/USERSPACE/LIB/eth_udp.c +++ b/radio/ETHERNET/USERSPACE/LIB/eth_udp.c @@ -417,7 +417,7 @@ extern int oai_exit; void *udp_write_thread(void *arg) { udp_ctx_t *utx = (udp_ctx_t *)arg; - utx->resp = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_elt_t)); + utx->resp = malloc(sizeof(*utx->resp)); initNotifiedFIFO(utx->resp); LOG_D(PHY,"UDP write thread started on core %d\n",sched_getcpu()); reset_meas(&utx->device->tx_fhaul); From fc7bcceca9fedb383aeadde7d2a9db1b1d1ce1b8 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Wed, 18 Jan 2023 09:54:38 +0100 Subject: [PATCH 16/18] fix a small bug and add a log for when recvfrom() fails recvfrom() returns ssize_t, not size_t. --- radio/ETHERNET/USERSPACE/LIB/eth_udp.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/radio/ETHERNET/USERSPACE/LIB/eth_udp.c b/radio/ETHERNET/USERSPACE/LIB/eth_udp.c index 45cc75bd4d..31971f1d1a 100644 --- a/radio/ETHERNET/USERSPACE/LIB/eth_udp.c +++ b/radio/ETHERNET/USERSPACE/LIB/eth_udp.c @@ -447,10 +447,20 @@ void *udp_read_thread(void *arg) { while (oai_exit == 0) { LOG_I(PHY,"UDP read thread %d, waiting for start sampling_rate_d %d, sampling_rate_n %d\n",u->thread_id,device->sampling_rate_ratio_n,device->sampling_rate_ratio_d); while (fhstate->active > 0) { - size_t count = recvfrom(((eth_state_t*)device->priv)->sockfdd[0], - buffer,sizeof(buffer),0, - (struct sockaddr *)&((eth_state_t*)device->priv)->dest_addrd, - (socklen_t *)&((eth_state_t*)device->priv)->addr_len); + ssize_t count = recvfrom(((eth_state_t*)device->priv)->sockfdd[0], + buffer,sizeof(buffer),0, + (struct sockaddr *)&((eth_state_t*)device->priv)->dest_addrd, + (socklen_t *)&((eth_state_t*)device->priv)->addr_len); + /* log and skip processing in case of error from recvfrom */ + /* (to be refined if needed) */ + if (count == 0) { + LOG_E(PHY, "recvfrom returned 0\n"); + continue; + } + if (count < 0) { + LOG_E(PHY, "recvfrom failed (%s)\n", strerror(errno)); + continue; + } /* if oai_exit is 1 here, don't access the array rxbase, * it may have been freed(), so let's break at this point */ @@ -460,7 +470,6 @@ void *udp_read_thread(void *arg) { TS = *(openair0_timestamp *)(&buffer[ECPRICOMMON_BYTES+ECPRIPCID_BYTES]); // convert TS to samples, /6 for AW2S @ 30.72 Ms/s, this is converted for other sample rates in OAI application TS = (device->sampling_rate_ratio_n*TS)/(device->sampling_rate_ratio_d*6); - if ((int)count <= 0) continue; AssertFatal(aid < 8,"Cannot handle more than 8 antennas, got aid %d\n",aid); fhstate->r[aid]=1; if (aid==0 && first_read == 0) fhstate->TS0 = TS; From 565b8482f926bea13b5b72e4a6651032fdac7083 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Wed, 18 Jan 2023 13:01:37 +0100 Subject: [PATCH 17/18] remove patch in install_simde_from_source() upstream took it --- cmake_targets/tools/build_helper | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 744a46f76b..ed02847387 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -838,21 +838,6 @@ install_simde_from_source(){ cd /tmp/simde # brute force copy into /usr/include $SUDO \cp -rv ../simde /usr/include - $SUDO patch /usr/include/simde/x86/avx.h << FIN ---- /usr/include/simde/x86/avx.h.old 2022-10-03 19:17:39.828223432 +0200 -+++ /usr/include/simde/x86/avx.h 2022-10-05 16:19:55.086019445 +0200 -@@ -3643,6 +3643,9 @@ - simde__m256i simde_mm256_insertf128_si256(simde__m256i a, simde__m128i b, int im - - return simde__m256i_from_private(a_); - } -+#if defined(SIMDE_X86_AVX_NATIVE) -+ #define simde_mm256_insertf128_si256(a, b, imm8) _mm256_insertf128_si256(a, b, imm8) -+#endif - #if defined(SIMDE_X86_AVX_ENABLE_NATIVE_ALIASES) - #undef _mm256_insertf128_si256 - #define _mm256_insertf128_si256(a, b, imm8) simde_mm256_insertf128_si256(a, b, imm8) -FIN } ################################################# From b74ba0fb92fa8ffecde787ff919b3eb2cd6b342f Mon Sep 17 00:00:00 2001 From: laurent Date: Thu, 22 Dec 2022 19:23:22 +0100 Subject: [PATCH 18/18] cleaning only --- common/platform_constants.h | 155 ++++++ common/ran_context.h | 3 +- .../telnetsrv/telnetsrv_enb_measurements.c | 3 +- doc/Doxyfile | 2 - executables/lte-softmodem.c | 3 +- executables/lte-softmodem.h | 8 +- executables/lte-ue.c | 2 +- executables/lte-uesoftmodem.c | 23 +- executables/main-ocp.c | 1 - executables/main_ru.c | 2 - executables/nr-softmodem.c | 4 +- executables/nr-uesoftmodem.c | 6 +- executables/rfsim.c | 9 +- nfapi/open-nFAPI/pnf/src/pnf.c | 2 +- .../CODING/TESTBENCH/coding_unitary_defs.h | 2 +- openair1/PHY/INIT/init_top.c | 2 + .../PHY/LTE_ESTIMATION/lte_estimation_vars.h | 21 - .../lte_ul_channel_estimation.c | 4 +- openair1/PHY/LTE_REFSIG/lte_ul_ref.c | 6 +- openair1/PHY/LTE_TRANSPORT/dci.c | 2 +- openair1/PHY/LTE_TRANSPORT/dlsch_tbs.h | 56 +-- openair1/PHY/LTE_TRANSPORT/dlsch_tbs_full.h | 140 ++++-- openair1/PHY/LTE_TRANSPORT/lte_mcs.c | 1 + openair1/PHY/LTE_TRANSPORT/pcfich.c | 9 +- openair1/PHY/LTE_TRANSPORT/sss.c | 1 + openair1/PHY/LTE_TRANSPORT/transport_extern.h | 52 -- openair1/PHY/LTE_TRANSPORT/transport_proto.h | 10 - openair1/PHY/LTE_TRANSPORT/transport_vars.h | 75 +-- openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c | 5 +- openair1/PHY/LTE_UE_TRANSPORT/dci_ue.c | 16 +- .../PHY/LTE_UE_TRANSPORT/drs_modulation.c | 1 + openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c | 6 +- openair1/PHY/LTE_UE_TRANSPORT/ulsch_coding.c | 2 +- openair1/PHY/MODULATION/modulation_extern.h | 6 +- openair1/PHY/MODULATION/ul_7_5_kHz_ue.c | 4 - openair1/PHY/TOOLS/oai_dfts.c | 34 -- openair1/PHY/TOOLS/tools_vars.h | 21 - openair1/PHY/phy_extern.h | 3 +- openair1/PHY/phy_extern_ue.h | 3 +- openair1/PHY/phy_vars.h | 5 - openair1/PHY/phy_vars_nr_ue.h | 3 - openair1/PHY/phy_vars_ue.h | 4 - openair1/SCHED/fapi_l1.c | 3 +- openair1/SCHED/sched_common_extern.h | 13 +- openair1/SCHED/sched_common_vars.h | 29 -- openair1/SCHED_UE/srs_pc.c | 1 + .../ETH_TRANSPORT/bypass_session_layer.c | 6 +- .../SIMULATION/ETH_TRANSPORT/emu_transport.c | 21 + openair1/SIMULATION/ETH_TRANSPORT/extern.h | 3 - .../SIMULATION/ETH_TRANSPORT/netlink_init.c | 2 +- openair1/SIMULATION/ETH_TRANSPORT/vars.h | 64 --- openair1/SIMULATION/LTE_PHY/dlsim.c | 2 - openair1/SIMULATION/LTE_PHY/dlsim_tm7.c | 3 - openair1/SIMULATION/LTE_PHY/mbmssim.c | 1 - openair1/SIMULATION/LTE_PHY/ulsim.c | 2 - openair1/SIMULATION/LTE_PHY/unitary_defs.h | 4 - openair1/SIMULATION/NR_PHY/dlschsim.c | 2 +- openair1/SIMULATION/NR_PHY/dlsim.c | 3 +- openair1/SIMULATION/NR_PHY/pbchsim.c | 2 +- openair1/SIMULATION/NR_PHY/prachsim.c | 3 +- openair1/SIMULATION/NR_PHY/pucchsim.c | 2 +- openair1/SIMULATION/NR_PHY/ulschsim.c | 2 +- openair1/SIMULATION/NR_PHY/ulsim.c | 4 +- .../NR_UE_PHY/unit_tests/src/pss_util_test.c | 2 - openair1/SIMULATION/TOOLS/channel_sim.c | 25 +- openair1/SIMULATION/TOOLS/sim.h | 10 +- openair2/COMMON/gtpv1_u_messages_types.h | 2 +- openair2/COMMON/mac_rrc_primitives.h | 49 +- openair2/COMMON/platform_constants.h | 159 ------ openair2/COMMON/platform_types.h | 4 +- openair2/COMMON/rrm_constants.h | 2 +- openair2/ENB_APP/enb_app.c | 1 - openair2/ENB_APP/enb_config.h | 2 +- openair2/GNB_APP/gnb_config.h | 2 +- openair2/LAYER2/MAC/config.c | 3 +- openair2/LAYER2/MAC/config_ue.c | 2 +- openair2/LAYER2/MAC/defs_NB_IoT.h | 3 +- openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 22 +- openair2/LAYER2/MAC/eNB_scheduler_fairRR.c | 49 +- openair2/LAYER2/MAC/eNB_scheduler_phytest.c | 5 - .../LAYER2/MAC/eNB_scheduler_primitives.c | 60 ++- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 24 - openair2/LAYER2/MAC/mac.h | 76 +-- openair2/LAYER2/MAC/mac_extern.h | 31 +- openair2/LAYER2/MAC/mac_proto.h | 11 - openair2/LAYER2/MAC/mac_vars.h | 141 ------ openair2/LAYER2/MAC/main.c | 14 - openair2/LAYER2/MAC/main_ue.c | 7 - openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h | 19 - openair2/LAYER2/NR_MAC_gNB/config.c | 2 +- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 2 +- openair2/LAYER2/PDCP_v10.1.0/pdcp.c | 2 +- openair2/LAYER2/PDCP_v10.1.0/pdcp.h | 2 +- openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c | 2 +- .../LAYER2/PDCP_v10.1.0/pdcp_primitives.c | 2 +- openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c | 2 +- openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_entity.h | 2 +- openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_init.h | 2 +- .../LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.h | 2 +- .../RLC/AM_v9.3.0/rlc_am_status_report.h | 2 +- .../LAYER2/RLC/AM_v9.3.0/rlc_am_structs.h | 2 +- .../AM_v9.3.0/rlc_am_timer_poll_retransmit.c | 2 +- .../RLC/AM_v9.3.0/rlc_am_timer_reordering.c | 2 +- .../AM_v9.3.0/rlc_am_timer_status_prohibit.c | 2 +- openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm.c | 2 +- openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm_entity.h | 2 +- openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c | 2 +- openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_entity.h | 2 +- .../LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c | 2 +- openair2/LAYER2/RLC/rlc.h | 2 +- openair2/LAYER2/RLC/rlc_mac.c | 1 + openair2/LAYER2/RLC/rlc_primitives.h | 2 +- openair2/MCE_APP/mce_config.h | 2 +- openair2/NETWORK_DRIVER/MESH/netlink.c | 2 +- openair2/NR_PHY_INTERFACE/NR_IF_Module.h | 2 +- openair2/RRC/LITE/rrc_common.c | 466 ------------------ openair2/RRC/LTE/L2_interface_ue.c | 2 +- openair2/RRC/LTE/MESSAGES/asn1_msg.c | 3 - openair2/RRC/LTE/defs_NB_IoT.h | 2 +- openair2/RRC/LTE/rrc_UE.c | 10 + openair2/RRC/LTE/rrc_common.c | 15 +- openair2/RRC/LTE/rrc_defs.h | 5 +- openair2/RRC/LTE/rrc_extern.h | 15 +- openair2/RRC/LTE/rrc_proto.h | 4 +- openair2/RRC/LTE/rrc_vars.h | 153 +----- openair2/RRC/NR/MESSAGES/asn1_msg.c | 4 - openair2/RRC/NR/nr_rrc_defs.h | 2 +- openair2/RRC/NR/nr_rrc_extern.h | 16 +- openair2/RRC/NR_UE/rrc_UE.c | 8 +- .../RRC/common.h | 11 +- openair2/UTIL/MEM/mem_block.h | 2 +- openair2/UTIL/OTG/otg_defs.h | 2 +- openair2/UTIL/OTG/otg_form.c | 1 - openair2/UTIL/OTG/otg_kpi.c | 1 - openair2/UTIL/OTG/otg_rx.c | 1 - openair2/UTIL/OTG/otg_tx.c | 1 - openair2/UTIL/OTG/otg_tx.h | 3 - openair3/MME_APP/mme_config.h | 2 +- openair3/NAS/UE/nas_itti_messaging.c | 5 +- openair3/NAS/UE/nas_ue_task.c | 2 +- targets/TEST/PACKET_TRACER/pt.c | 5 +- targets/TEST/PDCP/with_rlc/test_pdcp_rlc.c | 1 - 142 files changed, 565 insertions(+), 1842 deletions(-) create mode 100644 common/platform_constants.h delete mode 100644 openair1/PHY/LTE_ESTIMATION/lte_estimation_vars.h delete mode 100644 openair1/PHY/LTE_TRANSPORT/transport_extern.h delete mode 100644 openair1/PHY/TOOLS/tools_vars.h delete mode 100644 openair1/SCHED/sched_common_vars.h delete mode 100644 openair1/SIMULATION/ETH_TRANSPORT/vars.h delete mode 100644 openair2/COMMON/platform_constants.h delete mode 100644 openair2/LAYER2/MAC/mac_vars.h delete mode 100644 openair2/RRC/LITE/rrc_common.c rename openair1/PHY/MODULATION/modulation_vars.h => openair2/RRC/common.h (71%) diff --git a/common/platform_constants.h b/common/platform_constants.h new file mode 100644 index 0000000000..9d67b76cd7 --- /dev/null +++ b/common/platform_constants.h @@ -0,0 +1,155 @@ +/* + * 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 + */ + +/* + platform_constants.h + ------------------- + AUTHOR : Lionel GAUTHIER and Navid Nikaein + COMPANY : EURECOM + EMAIL : Lionel.Gauthier@eurecom.fr + + ***************************************************************************/ + +#ifndef __PLATFORM_CONSTANTS_H__ +#define __PLATFORM_CONSTANTS_H__ +#include "LTE_asn_constant.h" +#include "NR_asn_constant.h" +#define NR_MAXDRB 14 + +#ifdef JUMBO_FRAME +#define NL_MAX_PAYLOAD 18000 /* this should cover the max mtu size*/ +#else +#define NL_MAX_PAYLOAD 9000 /* this should cover the max mtu size*/ +#endif + +#ifdef LARGE_SCALE +#define NB_MODULES_MAX 128 +#define NB_NODE_MAX 128 +#else +#define NB_MODULES_MAX 32 +#define NB_NODE_MAX 32 +#endif + +#ifdef JUMBO_FRAME +#define MAX_IP_PACKET_SIZE 10000 // 9000 +#else +#if defined(OAI_NW_DRIVER_TYPE_ETHERNET) +/* SR: When using ethernet network driver the packet size is 1512 : + * 1500 bytes IP packet + 14 bytes ethernet header + */ +#define MAX_IP_PACKET_SIZE 1514 +#else +#define MAX_IP_PACKET_SIZE 1500 // 3000 +#endif +#endif +// overwrite the previous deinitions + +#define MAX_MODULES NB_MODULES_MAX +#define MAX_NR_RRC_UE_CONTEXTS 64 + +#ifndef UE_EXPANSION +#ifdef LARGE_SCALE +#define MAX_MOBILES_PER_ENB 128 +#define MAX_MOBILES_PER_ENB_NB_IoT 128 +#define MAX_MOBILES_PER_GNB 128 +#define MAX_eNB 2 +#define MAX_gNB 2 +#else +#define MAX_MOBILES_PER_ENB 40 +#define MAX_MOBILES_PER_ENB_NB_IoT 40 +#define MAX_MOBILES_PER_GNB 16 +#define MAX_eNB 2 +#define MAX_gNB 2 +#endif +#else +#define MAX_MOBILES_PER_ENB 256 +#define MAX_MOBILES_PER_ENB_NB_IoT 256 +#define MAX_MOBILES_PER_GNB 256 +#define MAX_eNB 2 +#define MAX_gNB 2 +#endif + +#define NUMBER_OF_NR_UCI_STATS_MAX 16 +#define MAX_MANAGED_ENB_PER_MOBILE 2 +#define MAX_MANAGED_GNB_PER_MOBILE 2 + +/// NB-IOT +#define NB_RB_MAX_NB_IOT (LTE_maxDRB_NB_r13 + 3) // MP: NB_IoT --> 2(DRB)+3(SRBs - 2 is not used) = 5 + +#define DEFAULT_RAB_ID 1 + +#define NB_RB_MAX (LTE_maxDRB + 3) /* was 11, now 14, maxDRB comes from asn1_constants.h, + 3 because of 3 SRB, one invisible id 0, then id 1 and 2 */ +#define NR_NB_RB_MAX (NR_maxDRB + 3) + +#define NGAP_MAX_PDU_SESSION (256) /* As defined in TS 38.413 9.2.1.1 Range Bound for PDU Sessions. */ +#define NGAP_MAX_DRBS_PER_UE (32) /* As defined in TS 38.413 9.2.1.1 - maxnoofDRBs */ + +#define NB_RB_MBMS_MAX (LTE_maxSessionPerPMCH * LTE_maxServiceCount) + +#define NB_RAB_MAX LTE_maxDRB /* was 8, now 11 */ +#define RAB_SHIFT1 9 +#define RAB_SHIFT2 3 +//#define RAB_OFFSET 0x0007 +#define RAB_OFFSET 0x000F +#define RAB_OFFSET1 0x7E00 +#define RAB_OFFSET2 0x01F8 +#define DIR_OFFSET 0x8000 +#define DIR_SHIFT 15 +#define CH_OFFSET 0x0004 +#define CH_SHIFT 2 + +// RLC Entity +#define RLC_TX_MAXSIZE 10000000 +#define RLC_RX_MAXSIZE 10000000 + +// RLC_AM_SEND_MRW +#define SEND_MRW_OFF 15 +#define SEND_MRW_ON 240 + +// RLC_SEGMENTATION_INDICATION +#define SEGMENTATION_NOT_ALLOWED 0 +#define SEGMENTATION_ALLOWED 1 + +// RLC_DELIVERY_OF_ERRONEOUS_SDU +#define DELIVERY_OF_ERRONEOUS_SDU_NO 0 +#define DELIVERY_OF_ERRONEOUS_SDU_YES 1 +#define DELIVERY_OF_ERRONEOUS_SDU_NO_DETECT 2 + +// CBA constant +#define NUM_MAX_CBA_GROUP 4 + +#ifndef __cplusplus +#ifndef NULL +#define NULL 0 +#endif +#ifndef null +#define null 0 +#endif +#endif + +#define UNUSED_PARAM_MBMS_SESSION_ID 0 +#define UNUSED_PARAM_MBMS_SERVICE_ID 0 + +#define printk printf + +#define UNUSED_VARIABLE(vARIABLE) (void)(vARIABLE) + +#endif /* __PLATFORM_CONSTANTS_H__ */ diff --git a/common/ran_context.h b/common/ran_context.h index ae8d5b02c4..320d431e73 100644 --- a/common/ran_context.h +++ b/common/ran_context.h @@ -34,7 +34,7 @@ #define __RAN_CONTEXT_H__ #include -#include "COMMON/platform_constants.h" +#include "common/platform_constants.h" #include "PHY/defs_eNB.h" #include "PHY/types.h" #include "PHY/impl_defs_top.h" @@ -111,4 +111,5 @@ typedef struct { extern RAN_CONTEXT_t RC; +#define NB_eNB_INST RC.nb_inst #endif diff --git a/common/utils/telnetsrv/telnetsrv_enb_measurements.c b/common/utils/telnetsrv/telnetsrv_enb_measurements.c index 8830173e6d..b3f52a5e27 100644 --- a/common/utils/telnetsrv/telnetsrv_enb_measurements.c +++ b/common/utils/telnetsrv/telnetsrv_enb_measurements.c @@ -165,8 +165,7 @@ void measurcmd_display_rlcstats(telnet_printfunc_t prnt) { statsptr[i].vptr = rlcstats + i; } - for (int UE_id=UE_info->list.head; UE_id>=0; UE_id=UE_info->list.next[UE_id]) { -#define NB_eNB_INST 1 + for (int UE_id = UE_info->list.head; UE_id >= 0; UE_id = UE_info->list.next[UE_id]) { PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt,eNB_id, ENB_FLAG_YES,UE_info->eNB_UE_stats[0][UE_id].crnti, eNB->frame,eNB->subframe,eNB_id); measurcmd_display_one_rlcstat(prnt, UE_id, statsptr, num_rlcmeasure, rlcstats, "DCCH", &ctxt, SRB_FLAG_YES, DCCH); diff --git a/doc/Doxyfile b/doc/Doxyfile index 5b849ccaa4..ef21662ec9 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -2110,7 +2110,6 @@ INPUT = \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/SCHED/nfapi_lte_dummy.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/SCHED/sched_eNB.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/SCHED/phy_procedures_lte_common.c \ -@CMAKE_CURRENT_SOURCE_DIR@/../openair1/SCHED/sched_common_vars.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/SCHED/phy_procedures_lte_eNb.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/SCHED/sched_common_extern.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/SCHED/nfapi_nr_dummy.c \ @@ -2438,7 +2437,6 @@ INPUT = \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/MODULATION/nr_modulation.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/MODULATION/slot_fep.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/MODULATION/ul_7_5_kHz.c \ -@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/MODULATION/modulation_vars.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/MODULATION/slot_fep_ul.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/phy_extern.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/defs_UE.h \ diff --git a/executables/lte-softmodem.c b/executables/lte-softmodem.c index 678f1e5e0c..be5416c7fd 100644 --- a/executables/lte-softmodem.c +++ b/executables/lte-softmodem.c @@ -55,8 +55,6 @@ #include #include "PHY/phy_vars.h" -#include "SCHED/sched_common_vars.h" -#include "LAYER2/MAC/mac_vars.h" #include "LAYER2/MAC/mac.h" #include "LAYER2/MAC/mac_proto.h" @@ -107,6 +105,7 @@ uint16_t runtime_phy_tx[29][6]; // SISO [MCS 0-28][RBs 0-5 : 6, 15, 25, 50, 75, int oai_exit = 0; +int NB_UE_INST = 0; uint64_t downlink_frequency[MAX_NUM_CCs][4]; int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; diff --git a/executables/lte-softmodem.h b/executables/lte-softmodem.h index 97bc2d166b..7f347bbee5 100644 --- a/executables/lte-softmodem.h +++ b/executables/lte-softmodem.h @@ -88,9 +88,9 @@ /* command line parameters specific to UE */ /* optname helpstr paramflags XXXptr defXXXval type numelt */ /*-------------------------------------------------------------------------------------------------------------------------------------------------------*/ - +// clang-format off #define CMDLINE_UEPARAMS_DESC { \ - {"U", CONFIG_HLP_NUMUE, 0, u16ptr:&NB_UE_INST, defuintval:1, TYPE_UINT16, 0}, \ + {"U", CONFIG_HLP_NUMUE, 0, iptr:&NB_UE_INST, defuintval:1, TYPE_INT, 0}, \ {"ue-rxgain", CONFIG_HLP_UERXG, 0, dblptr:&(rx_gain[0][0]), defdblval:130, TYPE_DOUBLE, 0}, \ {"ue-rxgain-off", CONFIG_HLP_UERXGOFF, 0, dblptr:&rx_gain_off, defdblval:0, TYPE_DOUBLE, 0}, \ {"ue-txgain", CONFIG_HLP_UETXG, 0, dblptr:&(tx_gain[0][0]), defdblval:0, TYPE_DOUBLE, 0}, \ @@ -100,8 +100,7 @@ {"ue-max-power", NULL, 0, iptr:&(tx_max_power[0]), defintval:23, TYPE_INT, 0}, \ {"emul-iface", CONFIG_HLP_EMULIFACE, 0, strptr:&emul_iface, defstrval:"lo", TYPE_STRING, 100}, \ {"L2-emul", NULL, 0, u8ptr:&nfapi_mode, defuintval:3, TYPE_UINT8, 0}, \ - {"num-ues", NULL, 0, u16ptr:&(NB_UE_INST), defuintval:1, TYPE_UINT16, 0}, \ - {"nums_ue_thread", NULL, 0, u16ptr:&(NB_THREAD_INST), defuintval:1, TYPE_UINT16, 0}, \ + {"num-ues", NULL, 0, iptr:&(NB_UE_INST), defuintval:1, TYPE_INT, 0}, \ {"r" , CONFIG_HLP_PRB, 0, u8ptr:&(frame_parms[0]->N_RB_DL), defintval:25, TYPE_UINT8, 0}, \ {"dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \ {"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:&usrp_args, defstrval:"type=b200",TYPE_STRING, 0}, \ @@ -111,6 +110,7 @@ {"ue-idx-standalone", NULL, 0, u16ptr:&ue_idx_standalone, defuintval:0xFFFF, TYPE_UINT16, 0}, \ {"node-number", NULL, 0, u16ptr:&node_number, defuintval:2, TYPE_UINT16, 0}, \ } +// clang-format on /*-----------------------------------------------------------------------------------------------------------------------------*/ /* command line parameters specific to UE threads */ diff --git a/executables/lte-ue.c b/executables/lte-ue.c index 270e5b1d4e..bc44820444 100644 --- a/executables/lte-ue.c +++ b/executables/lte-ue.c @@ -69,7 +69,7 @@ extern double cpuf; #define FRAME_PERIOD 100000000ULL #define DAQ_PERIOD 66667ULL #define FIFO_PRIORITY 40 - +#define NB_THREAD_INST 1 typedef enum { pss=0, pbch=1, diff --git a/executables/lte-uesoftmodem.c b/executables/lte-uesoftmodem.c index 16f8b0b2b9..04358c7ec9 100644 --- a/executables/lte-uesoftmodem.c +++ b/executables/lte-uesoftmodem.c @@ -54,11 +54,8 @@ #include "PHY/phy_vars_ue.h" #include "PHY/LTE_TRANSPORT/transport_vars.h" -#include "SCHED/sched_common_vars.h" -#include "PHY/MODULATION/modulation_vars.h" #include "LAYER2/MAC/mac.h" -#include "LAYER2/MAC/mac_vars.h" #include "LAYER2/MAC/mac_proto.h" #include "RRC/LTE/rrc_vars.h" #include "PHY_INTERFACE/phy_interface_vars.h" @@ -102,7 +99,7 @@ uint16_t runtime_phy_tx[29][6]; // SISO [MCS 0-28][RBs 0-5 : 6, 15, 25, 50, 75, int oai_exit = 0; unsigned int mmapped_dma=0; - +UE_MAC_INST *UE_mac_inst = NULL; uint64_t downlink_frequency[MAX_NUM_CCs][4]; int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; @@ -518,14 +515,14 @@ AssertFatal(false,""); return NULL; } +int NB_UE_INST = 1; + int main( int argc, char **argv ) { int CC_id; uint8_t abstraction_flag=0; // Default value for the number of UEs. It will hold, // if not changed from the command line option --num-ues - NB_UE_INST=1; - NB_THREAD_INST=1; configmodule_interface_t *config_mod; start_background_system(); config_mod = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY); @@ -552,18 +549,6 @@ int main( int argc, char **argv ) { EPC_MODE_ENABLED = !IS_SOFTMODEM_NOS1; printf("Running with %d UE instances\n",NB_UE_INST); - // Checking option of nums_ue_thread. - if(NB_THREAD_INST < 1) { - printf("Running with 0 UE rxtx thread, exiting.\n"); - abort(); - } - - // Checking option's relation between nums_ue_thread and num-ues - if(NB_UE_INST nb_antenna_ports_eNB = 1; //initial value overwritten by initial sync later } - NB_INST=1; - if(NFAPI_MODE==NFAPI_UE_STUB_PNF || NFAPI_MODE==NFAPI_MODE_STANDALONE_PNF) { PHY_vars_UE_g = malloc(sizeof(PHY_VARS_UE **)*NB_UE_INST); diff --git a/executables/main-ocp.c b/executables/main-ocp.c index 9f6c3574ec..8cd23b7159 100644 --- a/executables/main-ocp.c +++ b/executables/main-ocp.c @@ -60,7 +60,6 @@ static int DEFENBS[] = {0}; #include #include #include -#include #include #include diff --git a/executables/main_ru.c b/executables/main_ru.c index 891b98b090..9f9df6e84c 100644 --- a/executables/main_ru.c +++ b/executables/main_ru.c @@ -48,9 +48,7 @@ #include "radio/COMMON/common_lib.h" #include "radio/ETHERNET/USERSPACE/LIB/if_defs.h" - #include "PHY/phy_vars.h" -#include "SCHED/sched_common_vars.h" #include "PHY/TOOLS/phy_scope_interface.h" #include "common/utils/LOG/log.h" #include "common/utils/LOG/vcd_signal_dumper.h" diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index cf603b7478..0ecd46e5e0 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -45,8 +45,6 @@ //#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all #include "PHY/phy_vars.h" -#include "SCHED/sched_common_vars.h" -#include "LAYER2/MAC/mac_vars.h" #include "RRC/LTE/rrc_vars.h" #include "PHY_INTERFACE/phy_interface_vars.h" #include "gnb_config.h" @@ -95,6 +93,8 @@ int config_sync_var=-1; volatile int start_gNB = 0; int oai_exit = 0; +int NB_UE_INST = 0; + static int wait_for_sync = 0; unsigned int mmapped_dma=0; diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index 0a9afc5f9a..4aef4e56a3 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -42,12 +42,9 @@ #include "openair1/PHY/MODULATION/nr_modulation.h" #include "PHY/phy_vars_nr_ue.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" -#include "SCHED/sched_common_vars.h" -#include "PHY/MODULATION/modulation_vars.h" #include "PHY/NR_TRANSPORT/nr_dlsch.h" //#include "../../SIMU/USER/init_lte.h" -#include "LAYER2/MAC/mac_vars.h" #include "RRC/LTE/rrc_vars.h" #include "PHY_INTERFACE/phy_interface_vars.h" #include "NR_IF_Module.h" @@ -403,6 +400,7 @@ static void get_channel_model_mode() { init_bler_table("NR_AWGN_RESULTS_DIR"); } +int NB_UE_INST = 1; int main( int argc, char **argv ) { int set_exe_prio = 1; @@ -469,8 +467,6 @@ int main( int argc, char **argv ) { } } - NB_UE_INST=1; - NB_INST=1; PHY_vars_UE_g = malloc(sizeof(PHY_VARS_NR_UE **)); PHY_vars_UE_g[0] = malloc(sizeof(PHY_VARS_NR_UE *)*MAX_NUM_CCs); if (get_softmodem_params()->emulate_l1) { diff --git a/executables/rfsim.c b/executables/rfsim.c index df604d247a..c7ab4ccb66 100644 --- a/executables/rfsim.c +++ b/executables/rfsim.c @@ -45,7 +45,7 @@ #include "openair1/SIMULATION/TOOLS/sim.h" #include "enb_config.h" #include "enb_paramdef.h" -#include "platform_constants.h" +#include "common/platform_constants.h" #include "common/config/config_paramdesc.h" #include "common/config/config_userapi.h" #include "common/ran_context.h" @@ -180,11 +180,12 @@ int ru_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void ** VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SIM_DO_UL_SIGNAL,1); do_UL_sig(&sim, subframe, - 0, // abstraction_flag + 0, // abstraction_flag RC.ru[ru_id]->frame_parms, - 0, // frame is only used for abstraction + 0, // frame is only used for abstraction ru_id, - CC_id); + CC_id, + 1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SIM_DO_UL_SIGNAL,0); } diff --git a/nfapi/open-nFAPI/pnf/src/pnf.c b/nfapi/open-nFAPI/pnf/src/pnf.c index b4158dbb40..a74c8daca6 100644 --- a/nfapi/open-nFAPI/pnf/src/pnf.c +++ b/nfapi/open-nFAPI/pnf/src/pnf.c @@ -32,7 +32,7 @@ # if 1 // for hard-code (remove later) #include "COMMON/platform_types.h" -#include "COMMON/platform_constants.h" +#include "common/platform_constants.h" #include "common/ran_context.h" #include "common/utils/LOG/log.h" diff --git a/openair1/PHY/CODING/TESTBENCH/coding_unitary_defs.h b/openair1/PHY/CODING/TESTBENCH/coding_unitary_defs.h index f77ffff2eb..be37f06b8d 100644 --- a/openair1/PHY/CODING/TESTBENCH/coding_unitary_defs.h +++ b/openair1/PHY/CODING/TESTBENCH/coding_unitary_defs.h @@ -22,7 +22,7 @@ #ifndef __CODING_UNITARY_DEFS__h__ #define __CODING_UNITARY_DEFS__h__ int oai_exit=0; -unsigned int NB_UE_INST = 1; +const int NB_UE_INST = 1; #include "openair1/PHY/defs_UE.h" PHY_VARS_UE ***PHY_vars_UE_g; #include "common/ran_context.h" diff --git a/openair1/PHY/INIT/init_top.c b/openair1/PHY/INIT/init_top.c index 81fb28cc98..15b27b4db1 100644 --- a/openair1/PHY/INIT/init_top.c +++ b/openair1/PHY/INIT/init_top.c @@ -26,7 +26,9 @@ #include "PHY/LTE_ESTIMATION/lte_estimation.h" #include "PHY/LTE_REFSIG/lte_refsig.h" #include "PHY/LTE_TRANSPORT/transport_common_proto.h" +#include "openair1/PHY/LTE_TRANSPORT/transport_vars.h" +int qam64_table[8], qam16_table[4], qpsk_table[2]; void init_sss(void); void generate_64qam_table(void) { diff --git a/openair1/PHY/LTE_ESTIMATION/lte_estimation_vars.h b/openair1/PHY/LTE_ESTIMATION/lte_estimation_vars.h deleted file mode 100644 index 4690bba42e..0000000000 --- a/openair1/PHY/LTE_ESTIMATION/lte_estimation_vars.h +++ /dev/null @@ -1,21 +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 - */ - diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c index 380dce2c4f..152a298398 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c @@ -26,6 +26,7 @@ #include "common/utils/LOG/log.h" #include "PHY/LTE_TRANSPORT/transport_common_proto.h" #include "lte_estimation.h" +#include "openair1/PHY/LTE_TRANSPORT/transport_vars.h" // round(exp(sqrt(-1)*(pi/2)*[0:1:N-1]/N)*pow2(15)) static int16_t ru_90[2*128] = {32767, 0,32766, 402,32758, 804,32746, 1206,32729, 1608,32706, 2009,32679, 2411,32647, 2811,32610, 3212,32568, 3612,32522, 4011,32470, 4410,32413, 4808,32352, 5205,32286, 5602,32214, 5998,32138, 6393,32058, 6787,31972, 7180,31881, 7571,31786, 7962,31686, 8351,31581, 8740,31471, 9127,31357, 9512,31238, 9896,31114, 10279,30986, 10660,30853, 11039,30715, 11417,30572, 11793,30425, 12167,30274, 12540,30118, 12910,29957, 13279,29792, 13646,29622, 14010,29448, 14373,29269, 14733,29086, 15091,28899, 15447,28707, 15800,28511, 16151,28311, 16500,28106, 16846,27897, 17190,27684, 17531,27467, 17869,27246, 18205,27020, 18538,26791, 18868,26557, 19195,26320, 19520,26078, 19841,25833, 20160,25583, 20475,25330, 20788,25073, 21097,24812, 21403,24548, 21706,24279, 22006,24008, 22302,23732, 22595,23453, 22884,23170, 23170,22884, 23453,22595, 23732,22302, 24008,22006, 24279,21706, 24548,21403, 24812,21097, 25073,20788, 25330,20475, 25583,20160, 25833,19841, 26078,19520, 26320,19195, 26557,18868, 26791,18538, 27020,18205, 27246,17869, 27467,17531, 27684,17190, 27897,16846, 28106,16500, 28311,16151, 28511,15800, 28707,15447, 28899,15091, 29086,14733, 29269,14373, 29448,14010, 29622,13646, 29792,13279, 29957,12910, 30118,12540, 30274,12167, 30425,11793, 30572,11417, 30715,11039, 30853,10660, 30986,10279, 31114,9896, 31238,9512, 31357,9127, 31471,8740, 31581,8351, 31686,7962, 31786,7571, 31881,7180, 31972,6787, 32058,6393, 32138,5998, 32214,5602, 32286,5205, 32352,4808, 32413,4410, 32470,4011, 32522,3612, 32568,3212, 32610,2811, 32647,2411, 32679,2009, 32706,1608, 32729,1206, 32746,804, 32758,402, 32766}; @@ -36,9 +37,6 @@ static int16_t ru_90c[2*128] = {32767, 0,32766, -402,32758, -804,32746, -1206,32 static const short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1}; -extern unsigned short dftsizes[34]; -extern int16_t *ul_ref_sigs_rx[30][2][34]; - int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms, L1_rxtx_proc_t *proc, LTE_eNB_ULSCH_t * ulsch, diff --git a/openair1/PHY/LTE_REFSIG/lte_ul_ref.c b/openair1/PHY/LTE_REFSIG/lte_ul_ref.c index be090214f8..4c80d7561e 100644 --- a/openair1/PHY/LTE_REFSIG/lte_ul_ref.c +++ b/openair1/PHY/LTE_REFSIG/lte_ul_ref.c @@ -26,11 +26,9 @@ #endif #include "lte_refsig.h" #include "PHY/defs_eNB.h" +#include "openair1/PHY/LTE_TRANSPORT/transport_vars.h" -uint16_t dftsizes[34] = {12,24,36,48,60,72,96,108,120,144,180,192,216,240,288,300,324,360,384,432,480,540,576,600,648,720,768,864,900,960,972,1080,1152,1200}; - -uint16_t ref_primes[34] = {11,23,31,47,59,71,89,107,113,139,179,191,211,239,283,293,317,359,383,431,479,523,571,599,647,719,761,863,887,953,971,1069,1151,1193}; - +const uint16_t ref_primes[34] = {11, 23, 31, 47, 59, 71, 89, 107, 113, 139, 179, 191, 211, 239, 283, 293, 317, 359, 383, 431, 479, 523, 571, 599, 647, 719, 761, 863, 887, 953, 971, 1069, 1151, 1193}; int16_t *ul_ref_sigs[30][2][34]; int16_t *ul_ref_sigs_rx[30][2][34]; //these contain the sequences in repeated format and quantized to QPSK ifdef IFFT_FPGA diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index 3f43a1cc42..c3dffffd46 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -43,7 +43,7 @@ #include "T.h" #include "common/utils/LOG/log.h" #include "common/utils/LOG/vcd_signal_dumper.h" -#include "PHY/LTE_TRANSPORT/transport_extern.h" +#include "PHY/LTE_TRANSPORT/transport_vars.h" #include "PHY/LTE_REFSIG/lte_refsig.h" #include "executables/lte-softmodem.h" //#define DEBUG_DCI_ENCODING 1 diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_tbs.h b/openair1/PHY/LTE_TRANSPORT/dlsch_tbs.h index 5480338728..3a18924fe4 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_tbs.h +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_tbs.h @@ -19,31 +19,31 @@ * contact@openairinterface.org */ -unsigned int dlsch_tbs25[27][25] = {{16,32,56,88,120,152,176,208,224,256,288,328,344,376,392,424,456,488,504,536,568,600,616,648,680}, - {24,56,88,144,176,208,224,256,328,344,376,424,456,488,520,568,600,632,680,712,744,776,808,872,904}, - {32,72,144,176,208,256,296,328,376,424,472,520,568,616,648,696,744,776,840,872,936,968,1000,1064,1096}, - {40,104,176,208,256,328,392,440,504,568,616,680,744,808,872,904,968,1032,1096,1160,1224,1256,1320,1384,1416}, - {56,120,208,256,328,408,488,552,632,696,776,840,904,1000,1064,1128,1192,1288,1352,1416,1480,1544,1608,1736,1800}, - {72,144,224,328,424,504,600,680,776,872,968,1032,1128,1224,1320,1384,1480,1544,1672,1736,1864,1928,2024,2088,2216}, - {328,176,256,392,504,600,712,808,936,1032,1128,1224,1352,1480,1544,1672,1736,1864,1992,2088,2216,2280,2408,2472,2600}, - {104,224,328,472,584,712,840,968,1096,1224,1320,1480,1608,1672,1800,1928,2088,2216,2344,2472,2536,2664,2792,2984,3112}, - {120,256,392,536,680,808,968,1096,1256,1384,1544,1672,1800,1928,2088,2216,2344,2536,2664,2792,2984,3112,3240,3368,3496}, - {136,296,456,616,776,936,1096,1256,1416,1544,1736,1864,2024,2216,2344,2536,2664,2856,2984,3112,3368,3496,3624,3752,4008}, - {144,328,504,680,872,1032,1224,1384,1544,1736,1928,2088,2280,2472,2664,2792,2984,3112,3368,3496,3752,3880,4008,4264,4392}, - {176,376,584,776,1000,1192,1384,1608,1800,2024,2216,2408,2600,2792,2984,3240,3496,3624,3880,4008,4264,4392,4584,4776,4968}, - {208,440,680,904,1128,1352,1608,1800,2024,2280,2472,2728,2984,3240,3368,3624,3880,4136,4392,4584,4776,4968,5352,5544,5736}, - {224,488,744,1000,1256,1544,1800,2024,2280,2536,2856,3112,3368,3624,3880,4136,4392,4584,4968,5160,5352,5736,5992,6200,6456}, - {256,552,840,1128,1416,1736,1992,2280,2600,2856,3112,3496,3752,4008,4264,4584,4968,5160,5544,5736,5992,6200,6456,6968,7224}, - {280,600,904,1224,1544,1800,2152,2472,2728,3112,3368,3624,4008,4264,4584,4968,5160,5544,5736,6200,6456,6712,6968,7224,7736}, - {328,632,968,1288,1608,1928,2280,2600,2984,3240,3624,3880,4264,4584,4968,5160,5544,5992,6200,6456,6712,7224,7480,7736,7992}, - {336,696,1064,1416,1800,2152,2536,2856,3240,3624,4008,4392,4776,5160,5352,5736,6200,6456,6712,7224,7480,7992,8248,8760,9144}, - {376,776,1160,1544,1992,2344,2792,3112,3624,4008,4392,4776,5160,5544,5992,6200,6712,7224,7480,7992,8248,8760,9144,9528,9912}, - {408,840,1288,1736,2152,2600,2984,3496,3880,4264,4776,5160,5544,5992,6456,6968,7224,7736,8248,8504,9144,9528,9912,10296,10680}, - {440,904,1384,1864,2344,2792,3240,3752,4136,4584,5160,5544,5992,6456,6968,7480,7992,8248,8760,9144,9912,10296,10680,11064,11448}, - {488,1000,1480,1992,2472,2984,3496,4008,4584,4968,5544,5992,6456,6968,7480,7992,8504,9144,9528,9912,10680,11064,11448,12216,12576}, - {520,1064,1608,2152,2664,3240,3752,4264,4776,5352,5992,6456,6968,7480,7992,8504,9144,9528,10296,10680,11448,11832,12576,12960,13536}, - {552,1128,1736,2280,2856,3496,4008,4584,5160,5736,6200,6968,7480,7992,8504,9144,9912,10296,11064,11448,12216,12576,12960,13536,14112}, - {584,1192,1800,2408,2984,3624,4264,4968,5544,5992,6712,7224,7992,8504,9144,9912,10296,11064,11448,12216,12960,13536,14112,14688,15264}, - {616,1256,1864,2536,3112,3752,4392,5160,5736,6200,6968,7480,8248,8760,9528,10296,10680,11448,12216,12576,13536,14112,14688,15264,15840}, - {712,1480,2216,2984,3752,4392,5160,5992,6712,7480,8248,8760,9528,10296,11064,11832,12576,13536,14112,14688,15264,16416,16992,17568,18336} -}; +static const unsigned int dlsch_tbs25[27][25] = { + {16, 32, 56, 88, 120, 152, 176, 208, 224, 256, 288, 328, 344, 376, 392, 424, 456, 488, 504, 536, 568, 600, 616, 648, 680}, + {24, 56, 88, 144, 176, 208, 224, 256, 328, 344, 376, 424, 456, 488, 520, 568, 600, 632, 680, 712, 744, 776, 808, 872, 904}, + {32, 72, 144, 176, 208, 256, 296, 328, 376, 424, 472, 520, 568, 616, 648, 696, 744, 776, 840, 872, 936, 968, 1000, 1064, 1096}, + {40, 104, 176, 208, 256, 328, 392, 440, 504, 568, 616, 680, 744, 808, 872, 904, 968, 1032, 1096, 1160, 1224, 1256, 1320, 1384, 1416}, + {56, 120, 208, 256, 328, 408, 488, 552, 632, 696, 776, 840, 904, 1000, 1064, 1128, 1192, 1288, 1352, 1416, 1480, 1544, 1608, 1736, 1800}, + {72, 144, 224, 328, 424, 504, 600, 680, 776, 872, 968, 1032, 1128, 1224, 1320, 1384, 1480, 1544, 1672, 1736, 1864, 1928, 2024, 2088, 2216}, + {328, 176, 256, 392, 504, 600, 712, 808, 936, 1032, 1128, 1224, 1352, 1480, 1544, 1672, 1736, 1864, 1992, 2088, 2216, 2280, 2408, 2472, 2600}, + {104, 224, 328, 472, 584, 712, 840, 968, 1096, 1224, 1320, 1480, 1608, 1672, 1800, 1928, 2088, 2216, 2344, 2472, 2536, 2664, 2792, 2984, 3112}, + {120, 256, 392, 536, 680, 808, 968, 1096, 1256, 1384, 1544, 1672, 1800, 1928, 2088, 2216, 2344, 2536, 2664, 2792, 2984, 3112, 3240, 3368, 3496}, + {136, 296, 456, 616, 776, 936, 1096, 1256, 1416, 1544, 1736, 1864, 2024, 2216, 2344, 2536, 2664, 2856, 2984, 3112, 3368, 3496, 3624, 3752, 4008}, + {144, 328, 504, 680, 872, 1032, 1224, 1384, 1544, 1736, 1928, 2088, 2280, 2472, 2664, 2792, 2984, 3112, 3368, 3496, 3752, 3880, 4008, 4264, 4392}, + {176, 376, 584, 776, 1000, 1192, 1384, 1608, 1800, 2024, 2216, 2408, 2600, 2792, 2984, 3240, 3496, 3624, 3880, 4008, 4264, 4392, 4584, 4776, 4968}, + {208, 440, 680, 904, 1128, 1352, 1608, 1800, 2024, 2280, 2472, 2728, 2984, 3240, 3368, 3624, 3880, 4136, 4392, 4584, 4776, 4968, 5352, 5544, 5736}, + {224, 488, 744, 1000, 1256, 1544, 1800, 2024, 2280, 2536, 2856, 3112, 3368, 3624, 3880, 4136, 4392, 4584, 4968, 5160, 5352, 5736, 5992, 6200, 6456}, + {256, 552, 840, 1128, 1416, 1736, 1992, 2280, 2600, 2856, 3112, 3496, 3752, 4008, 4264, 4584, 4968, 5160, 5544, 5736, 5992, 6200, 6456, 6968, 7224}, + {280, 600, 904, 1224, 1544, 1800, 2152, 2472, 2728, 3112, 3368, 3624, 4008, 4264, 4584, 4968, 5160, 5544, 5736, 6200, 6456, 6712, 6968, 7224, 7736}, + {328, 632, 968, 1288, 1608, 1928, 2280, 2600, 2984, 3240, 3624, 3880, 4264, 4584, 4968, 5160, 5544, 5992, 6200, 6456, 6712, 7224, 7480, 7736, 7992}, + {336, 696, 1064, 1416, 1800, 2152, 2536, 2856, 3240, 3624, 4008, 4392, 4776, 5160, 5352, 5736, 6200, 6456, 6712, 7224, 7480, 7992, 8248, 8760, 9144}, + {376, 776, 1160, 1544, 1992, 2344, 2792, 3112, 3624, 4008, 4392, 4776, 5160, 5544, 5992, 6200, 6712, 7224, 7480, 7992, 8248, 8760, 9144, 9528, 9912}, + {408, 840, 1288, 1736, 2152, 2600, 2984, 3496, 3880, 4264, 4776, 5160, 5544, 5992, 6456, 6968, 7224, 7736, 8248, 8504, 9144, 9528, 9912, 10296, 10680}, + {440, 904, 1384, 1864, 2344, 2792, 3240, 3752, 4136, 4584, 5160, 5544, 5992, 6456, 6968, 7480, 7992, 8248, 8760, 9144, 9912, 10296, 10680, 11064, 11448}, + {488, 1000, 1480, 1992, 2472, 2984, 3496, 4008, 4584, 4968, 5544, 5992, 6456, 6968, 7480, 7992, 8504, 9144, 9528, 9912, 10680, 11064, 11448, 12216, 12576}, + {520, 1064, 1608, 2152, 2664, 3240, 3752, 4264, 4776, 5352, 5992, 6456, 6968, 7480, 7992, 8504, 9144, 9528, 10296, 10680, 11448, 11832, 12576, 12960, 13536}, + {552, 1128, 1736, 2280, 2856, 3496, 4008, 4584, 5160, 5736, 6200, 6968, 7480, 7992, 8504, 9144, 9912, 10296, 11064, 11448, 12216, 12576, 12960, 13536, 14112}, + {584, 1192, 1800, 2408, 2984, 3624, 4264, 4968, 5544, 5992, 6712, 7224, 7992, 8504, 9144, 9912, 10296, 11064, 11448, 12216, 12960, 13536, 14112, 14688, 15264}, + {616, 1256, 1864, 2536, 3112, 3752, 4392, 5160, 5736, 6200, 6968, 7480, 8248, 8760, 9528, 10296, 10680, 11448, 12216, 12576, 13536, 14112, 14688, 15264, 15840}, + {712, 1480, 2216, 2984, 3752, 4392, 5160, 5992, 6712, 7480, 8248, 8760, 9528, 10296, 11064, 11832, 12576, 13536, 14112, 14688, 15264, 16416, 16992, 17568, 18336}}; diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_tbs_full.h b/openair1/PHY/LTE_TRANSPORT/dlsch_tbs_full.h index 5a08b7a402..3947ffc31d 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_tbs_full.h +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_tbs_full.h @@ -27,34 +27,116 @@ /** \brief "Transport block size table" * (Table 7.1.7.2.1-1 in 3GPP TS 36.213 V8.6.0) */ -unsigned int TBStable[TBStable_rowCnt][110] = {{16,32,56,88,120,152,176,208,224,256,288,328,344,376,392,424,456,488,504,536,568,600,616,648,680,712,744,776,776,808,840,872,904,936,968,1000,1032,1032,1064,1096,1128,1160,1192,1224,1256,1256,1288,1320,1352,1384,1416,1416,1480,1480,1544,1544,1608,1608,1608,1672,1672,1736,1736,1800,1800,1800,1864,1864,1928,1928,1992,1992,2024,2088,2088,2088,2152,2152,2216,2216,2280,2280,2280,2344,2344,2408,2408,2472,2472,2536,2536,2536,2600,2600,2664,2664,2728,2728,2728,2792,2792,2856,2856,2856,2984,2984,2984,2984,2984,3112}, - {24,56,88,144,176,208,224,256,328,344,376,424,456,488,520,568,600,632,680,712,744,776,808,872,904,936,968,1000,1032,1064,1128,1160,1192,1224,1256,1288,1352,1384,1416,1416,1480,1544,1544,1608,1608,1672,1736,1736,1800,1800,1864,1864,1928,1992,1992,2024,2088,2088,2152,2152,2216,2280,2280,2344,2344,2408,2472,2472,2536,2536,2600,2600,2664,2728,2728,2792,2792,2856,2856,2856,2984,2984,2984,3112,3112,3112,3240,3240,3240,3240,3368,3368,3368,3496,3496,3496,3496,3624,3624,3624,3752,3752,3752,3752,3880,3880,3880,4008,4008,4008}, - {32,72,144,176,208,256,296,328,376,424,472,520,568,616,648,696,744,776,840,872,936,968,1000,1064,1096,1160,1192,1256,1288,1320,1384,1416,1480,1544,1544,1608,1672,1672,1736,1800,1800,1864,1928,1992,2024,2088,2088,2152,2216,2216,2280,2344,2344,2408,2472,2536,2536,2600,2664,2664,2728,2792,2856,2856,2856,2984,2984,3112,3112,3112,3240,3240,3240,3368,3368,3368,3496,3496,3496,3624,3624,3624,3752,3752,3880,3880,3880,4008,4008,4008,4136,4136,4136,4264,4264,4264,4392,4392,4392,4584,4584,4584,4584,4584,4776,4776,4776,4776,4968,4968}, - {40,104,176,208,256,328,392,440,504,568,616,680,744,808,872,904,968,1032,1096,1160,1224,1256,1320,1384,1416,1480,1544,1608,1672,1736,1800,1864,1928,1992,2024,2088,2152,2216,2280,2344,2408,2472,2536,2536,2600,2664,2728,2792,2856,2856,2984,2984,3112,3112,3240,3240,3368,3368,3496,3496,3624,3624,3624,3752,3752,3880,3880,4008,4008,4136,4136,4264,4264,4392,4392,4392,4584,4584,4584,4776,4776,4776,4776,4968,4968,4968,5160,5160,5160,5352,5352,5352,5352,5544,5544,5544,5736,5736,5736,5736,5992,5992,5992,5992,6200,6200,6200,6200,6456,6456}, - {56,120,208,256,328,408,488,552,632,696,776,840,904,1000,1064,1128,1192,1288,1352,1416,1480,1544,1608,1736,1800,1864,1928,1992,2088,2152,2216,2280,2344,2408,2472,2600,2664,2728,2792,2856,2984,2984,3112,3112,3240,3240,3368,3496,3496,3624,3624,3752,3752,3880,4008,4008,4136,4136,4264,4264,4392,4392,4584,4584,4584,4776,4776,4968,4968,4968,5160,5160,5160,5352,5352,5544,5544,5544,5736,5736,5736,5992,5992,5992,5992,6200,6200,6200,6456,6456,6456,6456,6712,6712,6712,6968,6968,6968,6968,7224,7224,7224,7480,7480,7480,7480,7736,7736,7736,7992}, - {72,144,224,328,424,504,600,680,776,872,968,1032,1128,1224,1320,1384,1480,1544,1672,1736,1864,1928,2024,2088,2216,2280,2344,2472,2536,2664,2728,2792,2856,2984,3112,3112,3240,3368,3496,3496,3624,3752,3752,3880,4008,4008,4136,4264,4392,4392,4584,4584,4776,4776,4776,4968,4968,5160,5160,5352,5352,5544,5544,5736,5736,5736,5992,5992,5992,6200,6200,6200,6456,6456,6712,6712,6712,6968,6968,6968,7224,7224,7224,7480,7480,7480,7736,7736,7736,7992,7992,7992,8248,8248,8248,8504,8504,8760,8760,8760,8760,9144,9144,9144,9144,9528,9528,9528,9528,9528}, - {328,176,256,392,504,600,712,808,936,1032,1128,1224,1352,1480,1544,1672,1736,1864,1992,2088,2216,2280,2408,2472,2600,2728,2792,2984,2984,3112,3240,3368,3496,3496,3624,3752,3880,4008,4136,4136,4264,4392,4584,4584,4776,4776,4968,4968,5160,5160,5352,5352,5544,5736,5736,5992,5992,5992,6200,6200,6456,6456,6456,6712,6712,6968,6968,6968,7224,7224,7480,7480,7736,7736,7736,7992,7992,8248,8248,8248,8504,8504,8760,8760,8760,9144,9144,9144,9144,9528,9528,9528,9528,9912,9912,9912,10296,10296,10296,10296,10680,10680,10680,10680,11064,11064,11064,11448,11448,11448}, - {104,224,328,472,584,712,840,968,1096,1224,1320,1480,1608,1672,1800,1928,2088,2216,2344,2472,2536,2664,2792,2984,3112,3240,3368,3368,3496,3624,3752,3880,4008,4136,4264,4392,4584,4584,4776,4968,4968,5160,5352,5352,5544,5736,5736,5992,5992,6200,6200,6456,6456,6712,6712,6712,6968,6968,7224,7224,7480,7480,7736,7736,7992,7992,8248,8248,8504,8504,8760,8760,8760,9144,9144,9144,9528,9528,9528,9912,9912,9912,10296,10296,10296,10680,10680,10680,11064,11064,11064,11448,11448,11448,11448,11832,11832,11832,12216,12216,12216,12576,12576,12576,12960,12960,12960,12960,13536,13536}, - {120,256,392,536,680,808,968,1096,1256,1384,1544,1672,1800,1928,2088,2216,2344,2536,2664,2792,2984,3112,3240,3368,3496,3624,3752,3880,4008,4264,4392,4584,4584,4776,4968,4968,5160,5352,5544,5544,5736,5992,5992,6200,6200,6456,6456,6712,6968,6968,7224,7224,7480,7480,7736,7736,7992,7992,8248,8504,8504,8760,8760,9144,9144,9144,9528,9528,9528,9912,9912,9912,10296,10296,10680,10680,10680,11064,11064,11064,11448,11448,11448,11832,11832,12216,12216,12216,12576,12576,12576,12960,12960,12960,13536,13536,13536,13536,14112,14112,14112,14112,14688,14688,14688,14688,15264,15264,15264,15264}, - {136,296,456,616,776,936,1096,1256,1416,1544,1736,1864,2024,2216,2344,2536,2664,2856,2984,3112,3368,3496,3624,3752,4008,4136,4264,4392,4584,4776,4968,5160,5160,5352,5544,5736,5736,5992,6200,6200,6456,6712,6712,6968,6968,7224,7480,7480,7736,7992,7992,8248,8248,8504,8760,8760,9144,9144,9144,9528,9528,9912,9912,10296,10296,10296,10680,10680,11064,11064,11064,11448,11448,11832,11832,11832,12216,12216,12576,12576,12960,12960,12960,13536,13536,13536,13536,14112,14112,14112,14112,14688,14688,14688,15264,15264,15264,15264,15840,15840,15840,16416,16416,16416,16416,16992,16992,16992,16992,17568}, - {144,328,504,680,872,1032,1224,1384,1544,1736,1928,2088,2280,2472,2664,2792,2984,3112,3368,3496,3752,3880,4008,4264,4392,4584,4776,4968,5160,5352,5544,5736,5736,5992,6200,6200,6456,6712,6712,6968,7224,7480,7480,7736,7992,7992,8248,8504,8504,8760,9144,9144,9144,9528,9528,9912,9912,10296,10296,10680,10680,11064,11064,11448,11448,11448,11832,11832,12216,12216,12576,12576,12960,12960,12960,13536,13536,13536,14112,14112,14112,14688,14688,14688,14688,15264,15264,15264,15840,15840,15840,16416,16416,16416,16992,16992,16992,16992,17568,17568,17568,18336,18336,18336,18336,18336,19080,19080,19080,19080}, - {176,376,584,776,1000,1192,1384,1608,1800,2024,2216,2408,2600,2792,2984,3240,3496,3624,3880,4008,4264,4392,4584,4776,4968,5352,5544,5736,5992,5992,6200,6456,6712,6968,6968,7224,7480,7736,7736,7992,8248,8504,8760,8760,9144,9144,9528,9528,9912,9912,10296,10680,10680,11064,11064,11448,11448,11832,11832,12216,12216,12576,12576,12960,12960,13536,13536,13536,14112,14112,14112,14688,14688,14688,15264,15264,15840,15840,15840,16416,16416,16416,16992,16992,16992,17568,17568,17568,18336,18336,18336,18336,19080,19080,19080,19080,19848,19848,19848,19848,20616,20616,20616,21384,21384,21384,21384,22152,22152,22152}, - {208,440,680,904,1128,1352,1608,1800,2024,2280,2472,2728,2984,3240,3368,3624,3880,4136,4392,4584,4776,4968,5352,5544,5736,5992,6200,6456,6712,6712,6968,7224,7480,7736,7992,8248,8504,8760,8760,9144,9528,9528,9912,9912,10296,10680,10680,11064,11064,11448,11832,11832,12216,12216,12576,12576,12960,12960,13536,13536,14112,14112,14112,14688,14688,15264,15264,15264,15840,15840,16416,16416,16416,16992,16992,17568,17568,17568,18336,18336,18336,19080,19080,19080,19080,19848,19848,19848,20616,20616,20616,21384,21384,21384,21384,22152,22152,22152,22920,22920,22920,23688,23688,23688,23688,24496,24496,24496,24496,25456}, - {224,488,744,1000,1256,1544,1800,2024,2280,2536,2856,3112,3368,3624,3880,4136,4392,4584,4968,5160,5352,5736,5992,6200,6456,6712,6968,7224,7480,7736,7992,8248,8504,8760,9144,9144,9528,9912,9912,10296,10680,10680,11064,11448,11448,11832,12216,12216,12576,12960,12960,13536,13536,14112,14112,14688,14688,14688,15264,15264,15840,15840,16416,16416,16992,16992,16992,17568,17568,18336,18336,18336,19080,19080,19080,19848,19848,19848,20616,20616,20616,21384,21384,21384,22152,22152,22152,22920,22920,22920,23688,23688,23688,24496,24496,24496,25456,25456,25456,25456,26416,26416,26416,26416,27376,27376,27376,27376,28336,28336}, - {256,552,840,1128,1416,1736,1992,2280,2600,2856,3112,3496,3752,4008,4264,4584,4968,5160,5544,5736,5992,6200,6456,6968,7224,7480,7736,7992,8248,8504,8760,9144,9528,9912,9912,10296,10680,11064,11064,11448,11832,12216,12216,12576,12960,12960,13536,13536,14112,14112,14688,14688,15264,15264,15840,15840,16416,16416,16992,16992,17568,17568,18336,18336,18336,19080,19080,19848,19848,19848,20616,20616,20616,21384,21384,22152,22152,22152,22920,22920,22920,23688,23688,24496,24496,24496,25456,25456,25456,25456,26416,26416,26416,27376,27376,27376,28336,28336,28336,28336,29296,29296,29296,29296,30576,30576,30576,30576,31704,31704}, - {280,600,904,1224,1544,1800,2152,2472,2728,3112,3368,3624,4008,4264,4584,4968,5160,5544,5736,6200,6456,6712,6968,7224,7736,7992,8248,8504,8760,9144,9528,9912,10296,10296,10680,11064,11448,11832,11832,12216,12576,12960,12960,13536,13536,14112,14688,14688,15264,15264,15840,15840,16416,16416,16992,16992,17568,17568,18336,18336,18336,19080,19080,19848,19848,20616,20616,20616,21384,21384,22152,22152,22152,22920,22920,23688,23688,23688,24496,24496,24496,25456,25456,25456,26416,26416,26416,27376,27376,27376,28336,28336,28336,29296,29296,29296,29296,30576,30576,30576,30576,31704,31704,31704,31704,32856,32856,32856,34008,34008}, - {328,632,968,1288,1608,1928,2280,2600,2984,3240,3624,3880,4264,4584,4968,5160,5544,5992,6200,6456,6712,7224,7480,7736,7992,8504,8760,9144,9528,9912,9912,10296,10680,11064,11448,11832,12216,12216,12576,12960,13536,13536,14112,14112,14688,14688,15264,15840,15840,16416,16416,16992,16992,17568,17568,18336,18336,19080,19080,19848,19848,19848,20616,20616,21384,21384,22152,22152,22152,22920,22920,23688,23688,24496,24496,24496,25456,25456,25456,26416,26416,26416,27376,27376,27376,28336,28336,28336,29296,29296,29296,30576,30576,30576,30576,31704,31704,31704,31704,32856,32856,32856,34008,34008,34008,34008,35160,35160,35160,35160}, - {336,696,1064,1416,1800,2152,2536,2856,3240,3624,4008,4392,4776,5160,5352,5736,6200,6456,6712,7224,7480,7992,8248,8760,9144,9528,9912,10296,10296,10680,11064,11448,11832,12216,12576,12960,13536,13536,14112,14688,14688,15264,15264,15840,16416,16416,16992,17568,17568,18336,18336,19080,19080,19848,19848,20616,20616,20616,21384,21384,22152,22152,22920,22920,23688,23688,24496,24496,24496,25456,25456,26416,26416,26416,27376,27376,27376,28336,28336,29296,29296,29296,30576,30576,30576,30576,31704,31704,31704,32856,32856,32856,34008,34008,34008,35160,35160,35160,35160,36696,36696,36696,36696,37888,37888,37888,39232,39232,39232,39232}, - {376,776,1160,1544,1992,2344,2792,3112,3624,4008,4392,4776,5160,5544,5992,6200,6712,7224,7480,7992,8248,8760,9144,9528,9912,10296,10680,11064,11448,11832,12216,12576,12960,13536,14112,14112,14688,15264,15264,15840,16416,16416,16992,17568,17568,18336,18336,19080,19080,19848,19848,20616,21384,21384,22152,22152,22920,22920,23688,23688,24496,24496,24496,25456,25456,26416,26416,27376,27376,27376,28336,28336,29296,29296,29296,30576,30576,30576,31704,31704,31704,32856,32856,32856,34008,34008,34008,35160,35160,35160,36696,36696,36696,37888,37888,37888,37888,39232,39232,39232,40576,40576,40576,40576,42368,42368,42368,42368,43816,43816}, - {408,840,1288,1736,2152,2600,2984,3496,3880,4264,4776,5160,5544,5992,6456,6968,7224,7736,8248,8504,9144,9528,9912,10296,10680,11064,11448,12216,12576,12960,13536,13536,14112,14688,15264,15264,15840,16416,16992,16992,17568,18336,18336,19080,19080,19848,20616,20616,21384,21384,22152,22152,22920,22920,23688,24496,24496,25456,25456,25456,26416,26416,27376,27376,28336,28336,29296,29296,29296,30576,30576,30576,31704,31704,32856,32856,32856,34008,34008,34008,35160,35160,35160,36696,36696,36696,37888,37888,37888,39232,39232,39232,40576,40576,40576,40576,42368,42368,42368,43816,43816,43816,43816,45352,45352,45352,46888,46888,46888,46888}, - {440,904,1384,1864,2344,2792,3240,3752,4136,4584,5160,5544,5992,6456,6968,7480,7992,8248,8760,9144,9912,10296,10680,11064,11448,12216,12576,12960,13536,14112,14688,14688,15264,15840,16416,16992,16992,17568,18336,18336,19080,19848,19848,20616,20616,21384,22152,22152,22920,22920,23688,24496,24496,25456,25456,26416,26416,27376,27376,28336,28336,29296,29296,29296,30576,30576,31704,31704,31704,32856,32856,34008,34008,34008,35160,35160,35160,36696,36696,36696,37888,37888,39232,39232,39232,40576,40576,40576,42368,42368,42368,42368,43816,43816,43816,45352,45352,45352,46888,46888,46888,46888,48936,48936,48936,48936,48936,51024,51024,51024}, - {488,1000,1480,1992,2472,2984,3496,4008,4584,4968,5544,5992,6456,6968,7480,7992,8504,9144,9528,9912,10680,11064,11448,12216,12576,12960,13536,14112,14688,15264,15840,15840,16416,16992,17568,18336,18336,19080,19848,19848,20616,21384,21384,22152,22920,22920,23688,24496,24496,25456,25456,26416,26416,27376,27376,28336,28336,29296,29296,30576,30576,31704,31704,31704,32856,32856,34008,34008,35160,35160,35160,36696,36696,36696,37888,37888,39232,39232,39232,40576,40576,40576,42368,42368,42368,43816,43816,43816,45352,45352,45352,46888,46888,46888,46888,48936,48936,48936,48936,51024,51024,51024,51024,52752,52752,52752,52752,55056,55056,55056}, - {520,1064,1608,2152,2664,3240,3752,4264,4776,5352,5992,6456,6968,7480,7992,8504,9144,9528,10296,10680,11448,11832,12576,12960,13536,14112,14688,15264,15840,16416,16992,16992,17568,18336,19080,19080,19848,20616,21384,21384,22152,22920,22920,23688,24496,24496,25456,25456,26416,27376,27376,28336,28336,29296,29296,30576,30576,31704,31704,32856,32856,34008,34008,34008,35160,35160,36696,36696,36696,37888,37888,39232,39232,40576,40576,40576,42368,42368,42368,43816,43816,43816,45352,45352,45352,46888,46888,46888,48936,48936,48936,48936,51024,51024,51024,51024,52752,52752,52752,55056,55056,55056,55056,57336,57336,57336,57336,59256,59256,59256}, - {552,1128,1736,2280,2856,3496,4008,4584,5160,5736,6200,6968,7480,7992,8504,9144,9912,10296,11064,11448,12216,12576,12960,13536,14112,14688,15264,15840,16416,16992,17568,18336,19080,19848,19848,20616,21384,22152,22152,22920,23688,24496,24496,25456,25456,26416,27376,27376,28336,28336,29296,29296,30576,30576,31704,31704,32856,32856,34008,34008,35160,35160,36696,36696,37888,37888,37888,39232,39232,40576,40576,40576,42368,42368,43816,43816,43816,45352,45352,45352,46888,46888,46888,48936,48936,48936,51024,51024,51024,51024,52752,52752,52752,55056,55056,55056,55056,57336,57336,57336,57336,59256,59256,59256,59256,61664,61664,61664,61664,63776}, - {584,1192,1800,2408,2984,3624,4264,4968,5544,5992,6712,7224,7992,8504,9144,9912,10296,11064,11448,12216,12960,13536,14112,14688,15264,15840,16416,16992,17568,18336,19080,19848,19848,20616,21384,22152,22920,22920,23688,24496,25456,25456,26416,26416,27376,28336,28336,29296,29296,30576,31704,31704,32856,32856,34008,34008,35160,35160,36696,36696,36696,37888,37888,39232,39232,40576,40576,42368,42368,42368,43816,43816,45352,45352,45352,46888,46888,46888,48936,48936,48936,51024,51024,51024,52752,52752,52752,52752,55056,55056,55056,57336,57336,57336,57336,59256,59256,59256,61664,61664,61664,61664,63776,63776,63776,63776,66592,66592,66592,66592}, - {616,1256,1864,2536,3112,3752,4392,5160,5736,6200,6968,7480,8248,8760,9528,10296,10680,11448,12216,12576,13536,14112,14688,15264,15840,16416,16992,17568,18336,19080,19848,20616,20616,21384,22152,22920,23688,24496,24496,25456,26416,26416,27376,28336,28336,29296,29296,30576,31704,31704,32856,32856,34008,34008,35160,35160,36696,36696,37888,37888,39232,39232,40576,40576,40576,42368,42368,43816,43816,43816,45352,45352,46888,46888,46888,48936,48936,48936,51024,51024,51024,52752,52752,52752,55056,55056,55056,55056,57336,57336,57336,59256,59256,59256,61664,61664,61664,61664,63776,63776,63776,63776,66592,66592,66592,66592,68808,68808,68808,71112}, - {712,1480,2216,2984,3752,4392,5160,5992,6712,7480,8248,8760,9528,10296,11064,11832,12576,13536,14112,14688,15264,16416,16992,17568,18336,19080,19848,20616,21384,22152,22920,23688,24496,25456,25456,26416,27376,28336,29296,29296,30576,30576,31704,32856,32856,34008,35160,35160,36696,36696,37888,37888,39232,40576,40576,40576,42368,42368,43816,43816,45352,45352,46888,46888,48936,48936,48936,51024,51024,52752,52752,52752,55056,55056,55056,55056,57336,57336,57336,59256,59256,59256,61664,61664,61664,63776,63776,63776,66592,66592,66592,68808,68808,68808,71112,71112,71112,73712,73712,75376,75376,75376,75376,75376,75376,75376,75376,75376,75376,75376} -}; +static const unsigned int TBStable[TBStable_rowCnt][110] = { + {16, 32, 56, 88, 120, 152, 176, 208, 224, 256, 288, 328, 344, 376, 392, 424, 456, 488, 504, 536, 568, 600, 616, 648, 680, 712, 744, 776, + 776, 808, 840, 872, 904, 936, 968, 1000, 1032, 1032, 1064, 1096, 1128, 1160, 1192, 1224, 1256, 1256, 1288, 1320, 1352, 1384, 1416, 1416, 1480, 1480, 1544, 1544, + 1608, 1608, 1608, 1672, 1672, 1736, 1736, 1800, 1800, 1800, 1864, 1864, 1928, 1928, 1992, 1992, 2024, 2088, 2088, 2088, 2152, 2152, 2216, 2216, 2280, 2280, 2280, 2344, + 2344, 2408, 2408, 2472, 2472, 2536, 2536, 2536, 2600, 2600, 2664, 2664, 2728, 2728, 2728, 2792, 2792, 2856, 2856, 2856, 2984, 2984, 2984, 2984, 2984, 3112}, + {24, 56, 88, 144, 176, 208, 224, 256, 328, 344, 376, 424, 456, 488, 520, 568, 600, 632, 680, 712, 744, 776, 808, 872, 904, 936, 968, 1000, + 1032, 1064, 1128, 1160, 1192, 1224, 1256, 1288, 1352, 1384, 1416, 1416, 1480, 1544, 1544, 1608, 1608, 1672, 1736, 1736, 1800, 1800, 1864, 1864, 1928, 1992, 1992, 2024, + 2088, 2088, 2152, 2152, 2216, 2280, 2280, 2344, 2344, 2408, 2472, 2472, 2536, 2536, 2600, 2600, 2664, 2728, 2728, 2792, 2792, 2856, 2856, 2856, 2984, 2984, 2984, 3112, + 3112, 3112, 3240, 3240, 3240, 3240, 3368, 3368, 3368, 3496, 3496, 3496, 3496, 3624, 3624, 3624, 3752, 3752, 3752, 3752, 3880, 3880, 3880, 4008, 4008, 4008}, + {32, 72, 144, 176, 208, 256, 296, 328, 376, 424, 472, 520, 568, 616, 648, 696, 744, 776, 840, 872, 936, 968, 1000, 1064, 1096, 1160, 1192, 1256, + 1288, 1320, 1384, 1416, 1480, 1544, 1544, 1608, 1672, 1672, 1736, 1800, 1800, 1864, 1928, 1992, 2024, 2088, 2088, 2152, 2216, 2216, 2280, 2344, 2344, 2408, 2472, 2536, + 2536, 2600, 2664, 2664, 2728, 2792, 2856, 2856, 2856, 2984, 2984, 3112, 3112, 3112, 3240, 3240, 3240, 3368, 3368, 3368, 3496, 3496, 3496, 3624, 3624, 3624, 3752, 3752, + 3880, 3880, 3880, 4008, 4008, 4008, 4136, 4136, 4136, 4264, 4264, 4264, 4392, 4392, 4392, 4584, 4584, 4584, 4584, 4584, 4776, 4776, 4776, 4776, 4968, 4968}, + {40, 104, 176, 208, 256, 328, 392, 440, 504, 568, 616, 680, 744, 808, 872, 904, 968, 1032, 1096, 1160, 1224, 1256, 1320, 1384, 1416, 1480, 1544, 1608, + 1672, 1736, 1800, 1864, 1928, 1992, 2024, 2088, 2152, 2216, 2280, 2344, 2408, 2472, 2536, 2536, 2600, 2664, 2728, 2792, 2856, 2856, 2984, 2984, 3112, 3112, 3240, 3240, + 3368, 3368, 3496, 3496, 3624, 3624, 3624, 3752, 3752, 3880, 3880, 4008, 4008, 4136, 4136, 4264, 4264, 4392, 4392, 4392, 4584, 4584, 4584, 4776, 4776, 4776, 4776, 4968, + 4968, 4968, 5160, 5160, 5160, 5352, 5352, 5352, 5352, 5544, 5544, 5544, 5736, 5736, 5736, 5736, 5992, 5992, 5992, 5992, 6200, 6200, 6200, 6200, 6456, 6456}, + {56, 120, 208, 256, 328, 408, 488, 552, 632, 696, 776, 840, 904, 1000, 1064, 1128, 1192, 1288, 1352, 1416, 1480, 1544, 1608, 1736, 1800, 1864, 1928, 1992, + 2088, 2152, 2216, 2280, 2344, 2408, 2472, 2600, 2664, 2728, 2792, 2856, 2984, 2984, 3112, 3112, 3240, 3240, 3368, 3496, 3496, 3624, 3624, 3752, 3752, 3880, 4008, 4008, + 4136, 4136, 4264, 4264, 4392, 4392, 4584, 4584, 4584, 4776, 4776, 4968, 4968, 4968, 5160, 5160, 5160, 5352, 5352, 5544, 5544, 5544, 5736, 5736, 5736, 5992, 5992, 5992, + 5992, 6200, 6200, 6200, 6456, 6456, 6456, 6456, 6712, 6712, 6712, 6968, 6968, 6968, 6968, 7224, 7224, 7224, 7480, 7480, 7480, 7480, 7736, 7736, 7736, 7992}, + {72, 144, 224, 328, 424, 504, 600, 680, 776, 872, 968, 1032, 1128, 1224, 1320, 1384, 1480, 1544, 1672, 1736, 1864, 1928, 2024, 2088, 2216, 2280, 2344, 2472, + 2536, 2664, 2728, 2792, 2856, 2984, 3112, 3112, 3240, 3368, 3496, 3496, 3624, 3752, 3752, 3880, 4008, 4008, 4136, 4264, 4392, 4392, 4584, 4584, 4776, 4776, 4776, 4968, + 4968, 5160, 5160, 5352, 5352, 5544, 5544, 5736, 5736, 5736, 5992, 5992, 5992, 6200, 6200, 6200, 6456, 6456, 6712, 6712, 6712, 6968, 6968, 6968, 7224, 7224, 7224, 7480, + 7480, 7480, 7736, 7736, 7736, 7992, 7992, 7992, 8248, 8248, 8248, 8504, 8504, 8760, 8760, 8760, 8760, 9144, 9144, 9144, 9144, 9528, 9528, 9528, 9528, 9528}, + {328, 176, 256, 392, 504, 600, 712, 808, 936, 1032, 1128, 1224, 1352, 1480, 1544, 1672, 1736, 1864, 1992, 2088, 2216, 2280, 2408, 2472, 2600, 2728, 2792, 2984, + 2984, 3112, 3240, 3368, 3496, 3496, 3624, 3752, 3880, 4008, 4136, 4136, 4264, 4392, 4584, 4584, 4776, 4776, 4968, 4968, 5160, 5160, 5352, 5352, 5544, 5736, 5736, 5992, + 5992, 5992, 6200, 6200, 6456, 6456, 6456, 6712, 6712, 6968, 6968, 6968, 7224, 7224, 7480, 7480, 7736, 7736, 7736, 7992, 7992, 8248, 8248, 8248, 8504, 8504, 8760, 8760, + 8760, 9144, 9144, 9144, 9144, 9528, 9528, 9528, 9528, 9912, 9912, 9912, 10296, 10296, 10296, 10296, 10680, 10680, 10680, 10680, 11064, 11064, 11064, 11448, 11448, 11448}, + {104, 224, 328, 472, 584, 712, 840, 968, 1096, 1224, 1320, 1480, 1608, 1672, 1800, 1928, 2088, 2216, 2344, 2472, 2536, 2664, 2792, 2984, 3112, 3240, 3368, 3368, + 3496, 3624, 3752, 3880, 4008, 4136, 4264, 4392, 4584, 4584, 4776, 4968, 4968, 5160, 5352, 5352, 5544, 5736, 5736, 5992, 5992, 6200, 6200, 6456, 6456, 6712, 6712, 6712, + 6968, 6968, 7224, 7224, 7480, 7480, 7736, 7736, 7992, 7992, 8248, 8248, 8504, 8504, 8760, 8760, 8760, 9144, 9144, 9144, 9528, 9528, 9528, 9912, 9912, 9912, 10296, 10296, + 10296, 10680, 10680, 10680, 11064, 11064, 11064, 11448, 11448, 11448, 11448, 11832, 11832, 11832, 12216, 12216, 12216, 12576, 12576, 12576, 12960, 12960, 12960, 12960, 13536, 13536}, + {120, 256, 392, 536, 680, 808, 968, 1096, 1256, 1384, 1544, 1672, 1800, 1928, 2088, 2216, 2344, 2536, 2664, 2792, 2984, 3112, 3240, 3368, 3496, 3624, 3752, 3880, + 4008, 4264, 4392, 4584, 4584, 4776, 4968, 4968, 5160, 5352, 5544, 5544, 5736, 5992, 5992, 6200, 6200, 6456, 6456, 6712, 6968, 6968, 7224, 7224, 7480, 7480, 7736, 7736, + 7992, 7992, 8248, 8504, 8504, 8760, 8760, 9144, 9144, 9144, 9528, 9528, 9528, 9912, 9912, 9912, 10296, 10296, 10680, 10680, 10680, 11064, 11064, 11064, 11448, 11448, 11448, 11832, + 11832, 12216, 12216, 12216, 12576, 12576, 12576, 12960, 12960, 12960, 13536, 13536, 13536, 13536, 14112, 14112, 14112, 14112, 14688, 14688, 14688, 14688, 15264, 15264, 15264, 15264}, + {136, 296, 456, 616, 776, 936, 1096, 1256, 1416, 1544, 1736, 1864, 2024, 2216, 2344, 2536, 2664, 2856, 2984, 3112, 3368, 3496, 3624, 3752, 4008, 4136, 4264, 4392, + 4584, 4776, 4968, 5160, 5160, 5352, 5544, 5736, 5736, 5992, 6200, 6200, 6456, 6712, 6712, 6968, 6968, 7224, 7480, 7480, 7736, 7992, 7992, 8248, 8248, 8504, 8760, 8760, + 9144, 9144, 9144, 9528, 9528, 9912, 9912, 10296, 10296, 10296, 10680, 10680, 11064, 11064, 11064, 11448, 11448, 11832, 11832, 11832, 12216, 12216, 12576, 12576, 12960, 12960, 12960, 13536, + 13536, 13536, 13536, 14112, 14112, 14112, 14112, 14688, 14688, 14688, 15264, 15264, 15264, 15264, 15840, 15840, 15840, 16416, 16416, 16416, 16416, 16992, 16992, 16992, 16992, 17568}, + {144, 328, 504, 680, 872, 1032, 1224, 1384, 1544, 1736, 1928, 2088, 2280, 2472, 2664, 2792, 2984, 3112, 3368, 3496, 3752, 3880, 4008, 4264, 4392, 4584, 4776, 4968, + 5160, 5352, 5544, 5736, 5736, 5992, 6200, 6200, 6456, 6712, 6712, 6968, 7224, 7480, 7480, 7736, 7992, 7992, 8248, 8504, 8504, 8760, 9144, 9144, 9144, 9528, 9528, 9912, + 9912, 10296, 10296, 10680, 10680, 11064, 11064, 11448, 11448, 11448, 11832, 11832, 12216, 12216, 12576, 12576, 12960, 12960, 12960, 13536, 13536, 13536, 14112, 14112, 14112, 14688, 14688, 14688, + 14688, 15264, 15264, 15264, 15840, 15840, 15840, 16416, 16416, 16416, 16992, 16992, 16992, 16992, 17568, 17568, 17568, 18336, 18336, 18336, 18336, 18336, 19080, 19080, 19080, 19080}, + {176, 376, 584, 776, 1000, 1192, 1384, 1608, 1800, 2024, 2216, 2408, 2600, 2792, 2984, 3240, 3496, 3624, 3880, 4008, 4264, 4392, 4584, 4776, 4968, 5352, 5544, 5736, + 5992, 5992, 6200, 6456, 6712, 6968, 6968, 7224, 7480, 7736, 7736, 7992, 8248, 8504, 8760, 8760, 9144, 9144, 9528, 9528, 9912, 9912, 10296, 10680, 10680, 11064, 11064, 11448, + 11448, 11832, 11832, 12216, 12216, 12576, 12576, 12960, 12960, 13536, 13536, 13536, 14112, 14112, 14112, 14688, 14688, 14688, 15264, 15264, 15840, 15840, 15840, 16416, 16416, 16416, 16992, 16992, + 16992, 17568, 17568, 17568, 18336, 18336, 18336, 18336, 19080, 19080, 19080, 19080, 19848, 19848, 19848, 19848, 20616, 20616, 20616, 21384, 21384, 21384, 21384, 22152, 22152, 22152}, + {208, 440, 680, 904, 1128, 1352, 1608, 1800, 2024, 2280, 2472, 2728, 2984, 3240, 3368, 3624, 3880, 4136, 4392, 4584, 4776, 4968, 5352, 5544, 5736, 5992, 6200, 6456, + 6712, 6712, 6968, 7224, 7480, 7736, 7992, 8248, 8504, 8760, 8760, 9144, 9528, 9528, 9912, 9912, 10296, 10680, 10680, 11064, 11064, 11448, 11832, 11832, 12216, 12216, 12576, 12576, + 12960, 12960, 13536, 13536, 14112, 14112, 14112, 14688, 14688, 15264, 15264, 15264, 15840, 15840, 16416, 16416, 16416, 16992, 16992, 17568, 17568, 17568, 18336, 18336, 18336, 19080, 19080, 19080, + 19080, 19848, 19848, 19848, 20616, 20616, 20616, 21384, 21384, 21384, 21384, 22152, 22152, 22152, 22920, 22920, 22920, 23688, 23688, 23688, 23688, 24496, 24496, 24496, 24496, 25456}, + {224, 488, 744, 1000, 1256, 1544, 1800, 2024, 2280, 2536, 2856, 3112, 3368, 3624, 3880, 4136, 4392, 4584, 4968, 5160, 5352, 5736, 5992, 6200, 6456, 6712, 6968, 7224, + 7480, 7736, 7992, 8248, 8504, 8760, 9144, 9144, 9528, 9912, 9912, 10296, 10680, 10680, 11064, 11448, 11448, 11832, 12216, 12216, 12576, 12960, 12960, 13536, 13536, 14112, 14112, 14688, + 14688, 14688, 15264, 15264, 15840, 15840, 16416, 16416, 16992, 16992, 16992, 17568, 17568, 18336, 18336, 18336, 19080, 19080, 19080, 19848, 19848, 19848, 20616, 20616, 20616, 21384, 21384, 21384, + 22152, 22152, 22152, 22920, 22920, 22920, 23688, 23688, 23688, 24496, 24496, 24496, 25456, 25456, 25456, 25456, 26416, 26416, 26416, 26416, 27376, 27376, 27376, 27376, 28336, 28336}, + {256, 552, 840, 1128, 1416, 1736, 1992, 2280, 2600, 2856, 3112, 3496, 3752, 4008, 4264, 4584, 4968, 5160, 5544, 5736, 5992, 6200, 6456, 6968, 7224, 7480, 7736, 7992, + 8248, 8504, 8760, 9144, 9528, 9912, 9912, 10296, 10680, 11064, 11064, 11448, 11832, 12216, 12216, 12576, 12960, 12960, 13536, 13536, 14112, 14112, 14688, 14688, 15264, 15264, 15840, 15840, + 16416, 16416, 16992, 16992, 17568, 17568, 18336, 18336, 18336, 19080, 19080, 19848, 19848, 19848, 20616, 20616, 20616, 21384, 21384, 22152, 22152, 22152, 22920, 22920, 22920, 23688, 23688, 24496, + 24496, 24496, 25456, 25456, 25456, 25456, 26416, 26416, 26416, 27376, 27376, 27376, 28336, 28336, 28336, 28336, 29296, 29296, 29296, 29296, 30576, 30576, 30576, 30576, 31704, 31704}, + {280, 600, 904, 1224, 1544, 1800, 2152, 2472, 2728, 3112, 3368, 3624, 4008, 4264, 4584, 4968, 5160, 5544, 5736, 6200, 6456, 6712, 6968, 7224, 7736, 7992, 8248, 8504, + 8760, 9144, 9528, 9912, 10296, 10296, 10680, 11064, 11448, 11832, 11832, 12216, 12576, 12960, 12960, 13536, 13536, 14112, 14688, 14688, 15264, 15264, 15840, 15840, 16416, 16416, 16992, 16992, + 17568, 17568, 18336, 18336, 18336, 19080, 19080, 19848, 19848, 20616, 20616, 20616, 21384, 21384, 22152, 22152, 22152, 22920, 22920, 23688, 23688, 23688, 24496, 24496, 24496, 25456, 25456, 25456, + 26416, 26416, 26416, 27376, 27376, 27376, 28336, 28336, 28336, 29296, 29296, 29296, 29296, 30576, 30576, 30576, 30576, 31704, 31704, 31704, 31704, 32856, 32856, 32856, 34008, 34008}, + {328, 632, 968, 1288, 1608, 1928, 2280, 2600, 2984, 3240, 3624, 3880, 4264, 4584, 4968, 5160, 5544, 5992, 6200, 6456, 6712, 7224, 7480, 7736, 7992, 8504, 8760, 9144, + 9528, 9912, 9912, 10296, 10680, 11064, 11448, 11832, 12216, 12216, 12576, 12960, 13536, 13536, 14112, 14112, 14688, 14688, 15264, 15840, 15840, 16416, 16416, 16992, 16992, 17568, 17568, 18336, + 18336, 19080, 19080, 19848, 19848, 19848, 20616, 20616, 21384, 21384, 22152, 22152, 22152, 22920, 22920, 23688, 23688, 24496, 24496, 24496, 25456, 25456, 25456, 26416, 26416, 26416, 27376, 27376, + 27376, 28336, 28336, 28336, 29296, 29296, 29296, 30576, 30576, 30576, 30576, 31704, 31704, 31704, 31704, 32856, 32856, 32856, 34008, 34008, 34008, 34008, 35160, 35160, 35160, 35160}, + {336, 696, 1064, 1416, 1800, 2152, 2536, 2856, 3240, 3624, 4008, 4392, 4776, 5160, 5352, 5736, 6200, 6456, 6712, 7224, 7480, 7992, 8248, 8760, 9144, 9528, 9912, 10296, + 10296, 10680, 11064, 11448, 11832, 12216, 12576, 12960, 13536, 13536, 14112, 14688, 14688, 15264, 15264, 15840, 16416, 16416, 16992, 17568, 17568, 18336, 18336, 19080, 19080, 19848, 19848, 20616, + 20616, 20616, 21384, 21384, 22152, 22152, 22920, 22920, 23688, 23688, 24496, 24496, 24496, 25456, 25456, 26416, 26416, 26416, 27376, 27376, 27376, 28336, 28336, 29296, 29296, 29296, 30576, 30576, + 30576, 30576, 31704, 31704, 31704, 32856, 32856, 32856, 34008, 34008, 34008, 35160, 35160, 35160, 35160, 36696, 36696, 36696, 36696, 37888, 37888, 37888, 39232, 39232, 39232, 39232}, + {376, 776, 1160, 1544, 1992, 2344, 2792, 3112, 3624, 4008, 4392, 4776, 5160, 5544, 5992, 6200, 6712, 7224, 7480, 7992, 8248, 8760, 9144, 9528, 9912, 10296, 10680, 11064, + 11448, 11832, 12216, 12576, 12960, 13536, 14112, 14112, 14688, 15264, 15264, 15840, 16416, 16416, 16992, 17568, 17568, 18336, 18336, 19080, 19080, 19848, 19848, 20616, 21384, 21384, 22152, 22152, + 22920, 22920, 23688, 23688, 24496, 24496, 24496, 25456, 25456, 26416, 26416, 27376, 27376, 27376, 28336, 28336, 29296, 29296, 29296, 30576, 30576, 30576, 31704, 31704, 31704, 32856, 32856, 32856, + 34008, 34008, 34008, 35160, 35160, 35160, 36696, 36696, 36696, 37888, 37888, 37888, 37888, 39232, 39232, 39232, 40576, 40576, 40576, 40576, 42368, 42368, 42368, 42368, 43816, 43816}, + {408, 840, 1288, 1736, 2152, 2600, 2984, 3496, 3880, 4264, 4776, 5160, 5544, 5992, 6456, 6968, 7224, 7736, 8248, 8504, 9144, 9528, 9912, 10296, 10680, 11064, 11448, 12216, + 12576, 12960, 13536, 13536, 14112, 14688, 15264, 15264, 15840, 16416, 16992, 16992, 17568, 18336, 18336, 19080, 19080, 19848, 20616, 20616, 21384, 21384, 22152, 22152, 22920, 22920, 23688, 24496, + 24496, 25456, 25456, 25456, 26416, 26416, 27376, 27376, 28336, 28336, 29296, 29296, 29296, 30576, 30576, 30576, 31704, 31704, 32856, 32856, 32856, 34008, 34008, 34008, 35160, 35160, 35160, 36696, + 36696, 36696, 37888, 37888, 37888, 39232, 39232, 39232, 40576, 40576, 40576, 40576, 42368, 42368, 42368, 43816, 43816, 43816, 43816, 45352, 45352, 45352, 46888, 46888, 46888, 46888}, + {440, 904, 1384, 1864, 2344, 2792, 3240, 3752, 4136, 4584, 5160, 5544, 5992, 6456, 6968, 7480, 7992, 8248, 8760, 9144, 9912, 10296, 10680, 11064, 11448, 12216, 12576, 12960, + 13536, 14112, 14688, 14688, 15264, 15840, 16416, 16992, 16992, 17568, 18336, 18336, 19080, 19848, 19848, 20616, 20616, 21384, 22152, 22152, 22920, 22920, 23688, 24496, 24496, 25456, 25456, 26416, + 26416, 27376, 27376, 28336, 28336, 29296, 29296, 29296, 30576, 30576, 31704, 31704, 31704, 32856, 32856, 34008, 34008, 34008, 35160, 35160, 35160, 36696, 36696, 36696, 37888, 37888, 39232, 39232, + 39232, 40576, 40576, 40576, 42368, 42368, 42368, 42368, 43816, 43816, 43816, 45352, 45352, 45352, 46888, 46888, 46888, 46888, 48936, 48936, 48936, 48936, 48936, 51024, 51024, 51024}, + {488, 1000, 1480, 1992, 2472, 2984, 3496, 4008, 4584, 4968, 5544, 5992, 6456, 6968, 7480, 7992, 8504, 9144, 9528, 9912, 10680, 11064, 11448, 12216, 12576, 12960, 13536, 14112, + 14688, 15264, 15840, 15840, 16416, 16992, 17568, 18336, 18336, 19080, 19848, 19848, 20616, 21384, 21384, 22152, 22920, 22920, 23688, 24496, 24496, 25456, 25456, 26416, 26416, 27376, 27376, 28336, + 28336, 29296, 29296, 30576, 30576, 31704, 31704, 31704, 32856, 32856, 34008, 34008, 35160, 35160, 35160, 36696, 36696, 36696, 37888, 37888, 39232, 39232, 39232, 40576, 40576, 40576, 42368, 42368, + 42368, 43816, 43816, 43816, 45352, 45352, 45352, 46888, 46888, 46888, 46888, 48936, 48936, 48936, 48936, 51024, 51024, 51024, 51024, 52752, 52752, 52752, 52752, 55056, 55056, 55056}, + {520, 1064, 1608, 2152, 2664, 3240, 3752, 4264, 4776, 5352, 5992, 6456, 6968, 7480, 7992, 8504, 9144, 9528, 10296, 10680, 11448, 11832, 12576, 12960, 13536, 14112, 14688, 15264, + 15840, 16416, 16992, 16992, 17568, 18336, 19080, 19080, 19848, 20616, 21384, 21384, 22152, 22920, 22920, 23688, 24496, 24496, 25456, 25456, 26416, 27376, 27376, 28336, 28336, 29296, 29296, 30576, + 30576, 31704, 31704, 32856, 32856, 34008, 34008, 34008, 35160, 35160, 36696, 36696, 36696, 37888, 37888, 39232, 39232, 40576, 40576, 40576, 42368, 42368, 42368, 43816, 43816, 43816, 45352, 45352, + 45352, 46888, 46888, 46888, 48936, 48936, 48936, 48936, 51024, 51024, 51024, 51024, 52752, 52752, 52752, 55056, 55056, 55056, 55056, 57336, 57336, 57336, 57336, 59256, 59256, 59256}, + {552, 1128, 1736, 2280, 2856, 3496, 4008, 4584, 5160, 5736, 6200, 6968, 7480, 7992, 8504, 9144, 9912, 10296, 11064, 11448, 12216, 12576, 12960, 13536, 14112, 14688, 15264, 15840, + 16416, 16992, 17568, 18336, 19080, 19848, 19848, 20616, 21384, 22152, 22152, 22920, 23688, 24496, 24496, 25456, 25456, 26416, 27376, 27376, 28336, 28336, 29296, 29296, 30576, 30576, 31704, 31704, + 32856, 32856, 34008, 34008, 35160, 35160, 36696, 36696, 37888, 37888, 37888, 39232, 39232, 40576, 40576, 40576, 42368, 42368, 43816, 43816, 43816, 45352, 45352, 45352, 46888, 46888, 46888, 48936, + 48936, 48936, 51024, 51024, 51024, 51024, 52752, 52752, 52752, 55056, 55056, 55056, 55056, 57336, 57336, 57336, 57336, 59256, 59256, 59256, 59256, 61664, 61664, 61664, 61664, 63776}, + {584, 1192, 1800, 2408, 2984, 3624, 4264, 4968, 5544, 5992, 6712, 7224, 7992, 8504, 9144, 9912, 10296, 11064, 11448, 12216, 12960, 13536, 14112, 14688, 15264, 15840, 16416, 16992, + 17568, 18336, 19080, 19848, 19848, 20616, 21384, 22152, 22920, 22920, 23688, 24496, 25456, 25456, 26416, 26416, 27376, 28336, 28336, 29296, 29296, 30576, 31704, 31704, 32856, 32856, 34008, 34008, + 35160, 35160, 36696, 36696, 36696, 37888, 37888, 39232, 39232, 40576, 40576, 42368, 42368, 42368, 43816, 43816, 45352, 45352, 45352, 46888, 46888, 46888, 48936, 48936, 48936, 51024, 51024, 51024, + 52752, 52752, 52752, 52752, 55056, 55056, 55056, 57336, 57336, 57336, 57336, 59256, 59256, 59256, 61664, 61664, 61664, 61664, 63776, 63776, 63776, 63776, 66592, 66592, 66592, 66592}, + {616, 1256, 1864, 2536, 3112, 3752, 4392, 5160, 5736, 6200, 6968, 7480, 8248, 8760, 9528, 10296, 10680, 11448, 12216, 12576, 13536, 14112, 14688, 15264, 15840, 16416, 16992, 17568, + 18336, 19080, 19848, 20616, 20616, 21384, 22152, 22920, 23688, 24496, 24496, 25456, 26416, 26416, 27376, 28336, 28336, 29296, 29296, 30576, 31704, 31704, 32856, 32856, 34008, 34008, 35160, 35160, + 36696, 36696, 37888, 37888, 39232, 39232, 40576, 40576, 40576, 42368, 42368, 43816, 43816, 43816, 45352, 45352, 46888, 46888, 46888, 48936, 48936, 48936, 51024, 51024, 51024, 52752, 52752, 52752, + 55056, 55056, 55056, 55056, 57336, 57336, 57336, 59256, 59256, 59256, 61664, 61664, 61664, 61664, 63776, 63776, 63776, 63776, 66592, 66592, 66592, 66592, 68808, 68808, 68808, 71112}, + {712, 1480, 2216, 2984, 3752, 4392, 5160, 5992, 6712, 7480, 8248, 8760, 9528, 10296, 11064, 11832, 12576, 13536, 14112, 14688, 15264, 16416, 16992, 17568, 18336, 19080, 19848, 20616, + 21384, 22152, 22920, 23688, 24496, 25456, 25456, 26416, 27376, 28336, 29296, 29296, 30576, 30576, 31704, 32856, 32856, 34008, 35160, 35160, 36696, 36696, 37888, 37888, 39232, 40576, 40576, 40576, + 42368, 42368, 43816, 43816, 45352, 45352, 46888, 46888, 48936, 48936, 48936, 51024, 51024, 52752, 52752, 52752, 55056, 55056, 55056, 55056, 57336, 57336, 57336, 59256, 59256, 59256, 61664, 61664, + 61664, 63776, 63776, 63776, 66592, 66592, 66592, 68808, 68808, 68808, 71112, 71112, 71112, 73712, 73712, 75376, 75376, 75376, 75376, 75376, 75376, 75376, 75376, 75376, 75376, 75376}}; -unsigned int TBStable1C[32] = {40, 56, 72, 120, 136, 144, 176, 208, 224, 256, 280, 296, 328, 336, 392, 488, 552, 600, 632, 696, 776, 840, 904, 1000, 1064, 1128, 1224, 1288, 1384, 1480, 1608, 1736}; +static const unsigned int TBStable1C[32] = {40, 56, 72, 120, 136, 144, 176, 208, 224, 256, 280, 296, 328, 336, 392, 488, + 552, 600, 632, 696, 776, 840, 904, 1000, 1064, 1128, 1224, 1288, 1384, 1480, 1608, 1736}; #endif diff --git a/openair1/PHY/LTE_TRANSPORT/lte_mcs.c b/openair1/PHY/LTE_TRANSPORT/lte_mcs.c index 38914506ee..aca34720d1 100644 --- a/openair1/PHY/LTE_TRANSPORT/lte_mcs.c +++ b/openair1/PHY/LTE_TRANSPORT/lte_mcs.c @@ -33,6 +33,7 @@ #include "PHY/defs_common.h" #include "PHY/phy_extern.h" #include "PHY/LTE_TRANSPORT/transport_common_proto.h" +#include "openair1/PHY/LTE_TRANSPORT/transport_vars.h" unsigned char get_Qm(unsigned char I_MCS) { if (I_MCS < 10) diff --git a/openair1/PHY/LTE_TRANSPORT/pcfich.c b/openair1/PHY/LTE_TRANSPORT/pcfich.c index 0ba63019a1..ac470c5c4e 100644 --- a/openair1/PHY/LTE_TRANSPORT/pcfich.c +++ b/openair1/PHY/LTE_TRANSPORT/pcfich.c @@ -32,15 +32,10 @@ #include "PHY/impl_defs_top.h" #include "PHY/defs_eNB.h" #include "PHY/LTE_REFSIG/lte_refsig.h" +#include "openair1/PHY/LTE_TRANSPORT/transport_vars.h" //#define DEBUG_PCFICH -extern uint8_t pcfich_b[4][32]; - - -void pcfich_scrambling(LTE_DL_FRAME_PARMS *frame_parms, - uint8_t subframe, - uint8_t *b, - uint8_t *bt) +void pcfich_scrambling(LTE_DL_FRAME_PARMS *frame_parms, uint8_t subframe, const uint8_t *b, uint8_t *bt) { uint32_t i; uint8_t reset; diff --git a/openair1/PHY/LTE_TRANSPORT/sss.c b/openair1/PHY/LTE_TRANSPORT/sss.c index bf03c185ef..695083d2fe 100644 --- a/openair1/PHY/LTE_TRANSPORT/sss.c +++ b/openair1/PHY/LTE_TRANSPORT/sss.c @@ -32,6 +32,7 @@ #include "PHY/defs_eNB.h" #include "transport_eNB.h" #include "PHY/phy_extern.h" +#include "openair1/PHY/LTE_TRANSPORT/transport_vars.h" //#define DEBUG_SSS diff --git a/openair1/PHY/LTE_TRANSPORT/transport_extern.h b/openair1/PHY/LTE_TRANSPORT/transport_extern.h deleted file mode 100644 index 8b33449cca..0000000000 --- a/openair1/PHY/LTE_TRANSPORT/transport_extern.h +++ /dev/null @@ -1,52 +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 - */ - -extern unsigned int dlsch_tbs25[27][25],TBStable[27][110],TBStable1C[32]; -extern unsigned short lte_cqi_eff1024[16]; -extern char lte_cqi_snr_dB[15]; -extern const short conjugate[8],conjugate2[8]; -extern short minus_one[8]; -extern short minus_one[8]; -extern short *ul_ref_sigs[30][2][34]; -extern short *ul_ref_sigs_rx[30][2][34]; -extern unsigned short dftsizes[34]; -extern unsigned short ref_primes[34]; - -extern int qam64_table[8],qam16_table[4],qpsk_table[2]; - -extern unsigned char cs_ri_normal[4]; -extern unsigned char cs_ri_extended[4]; -extern unsigned char cs_ack_normal[4]; -extern unsigned char cs_ack_extended[4]; - - -extern unsigned char ue_power_offsets[25]; - -extern unsigned short scfdma_amps[26]; - -extern char dci_format_strings[15][13]; - -extern int16_t *d0_sss,*d5_sss; - -extern uint8_t wACK[5][4]; -extern int8_t wACK_RX[5][4]; - -extern uint32_t bitrev_cc_dci[32]; diff --git a/openair1/PHY/LTE_TRANSPORT/transport_proto.h b/openair1/PHY/LTE_TRANSPORT/transport_proto.h index 12066e3bc6..f18a33ad2d 100644 --- a/openair1/PHY/LTE_TRANSPORT/transport_proto.h +++ b/openair1/PHY/LTE_TRANSPORT/transport_proto.h @@ -510,16 +510,6 @@ void dump_ulsch(PHY_VARS_eNB *phy_vars_eNB,int frame, int subframe, uint8_t UE_i void dump_ulsch_stats(FILE *fd,PHY_VARS_eNB *eNB,int frame); void dump_uci_stats(FILE *fd,PHY_VARS_eNB *eNB,int frame); - - - - -void pcfich_scrambling(LTE_DL_FRAME_PARMS *frame_parms, - uint8_t subframe, - uint8_t *b, - uint8_t *bt); - - void generate_pcfich(uint8_t num_pdcch_symbols, int16_t amp, LTE_DL_FRAME_PARMS *frame_parms, diff --git a/openair1/PHY/LTE_TRANSPORT/transport_vars.h b/openair1/PHY/LTE_TRANSPORT/transport_vars.h index 6ac121dc13..3a4c82989b 100644 --- a/openair1/PHY/LTE_TRANSPORT/transport_vars.h +++ b/openair1/PHY/LTE_TRANSPORT/transport_vars.h @@ -19,66 +19,35 @@ * contact@openairinterface.org */ +#ifndef __TRANSPORT_VARS_H +#define __TRANSPORT_VARS_H + #include "dlsch_tbs.h" -//#include "dlsch_tbs_full.h" +#include "dlsch_tbs_full.h" +static const uint16_t dftsizes[34] = {12, 24, 36, 48, 60, 72, 96, 108, 120, 144, 180, 192, 216, 240, 288, 300, 324, + 360, 384, 432, 480, 540, 576, 600, 648, 720, 768, 864, 900, 960, 972, 1080, 1152, 1200}; -unsigned short lte_cqi_eff1024[16] = {156, //-6, .15234 - 240, //-4 .234 - 386, //-2 .3769 - 616, //1 .6016 - 898, //4 .87695 - 1204, //6 1.1758 - 1512, //8 1.4766 - 1960, //11 1.9141 - 2464, //14 2.4062 - 2796, //16 2.7305 - 3402, //20 3.3223 - 3996, //23 3.9023 - 4632, //27 4.5234 - 5238, //31 5.1152 - 5688 - }; //33 5.5547 +static const unsigned char ue_power_offsets[25] = {14, 11, 9, 8, 7, 6, 6, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 0, 0, 0}; -char lte_cqi_snr_dB[15] = { -2, - 0, - 1, - 2, - 4, - 6, - 10, - 14, - 18, - 22, - 26, - 30, - 34, - 38, - 40 - }; +extern int qam64_table[8], qam16_table[4], qpsk_table[2]; -unsigned char ue_power_offsets[25] = {14,11,9,8,7,6,6,5,4,4,4,3,3,3,2,2,2,1,1,1,1,1,0,0,0}; - -int qam64_table[8],qam16_table[4],qpsk_table[2]; - -unsigned char cs_ri_normal[4] = {1,4,7,10}; -unsigned char cs_ri_extended[4] = {0,3,5,8}; -unsigned char cs_ack_normal[4] = {2,3,8,9}; -unsigned char cs_ack_extended[4] = {1,2,6,7}; +static const unsigned char cs_ri_normal[4] = {1, 4, 7, 10}; +static const unsigned char cs_ri_extended[4] = {0, 3, 5, 8}; +static const unsigned char cs_ack_normal[4] = {2, 3, 8, 9}; +static const unsigned char cs_ack_extended[4] = {1, 2, 6, 7}; //unsigned short scfdma_amps[25] = {0,5120,3620,2956,2560,2290,2090,1935,1810,1706,1619,1544,1478,1420,1368,1322,1280,1242,1207,1175,1145,1117,1092,1068,1045,1024}; -char dci_format_strings[15][13] = {"0","1","1A","1B","1C","1D","1E_2A_M10PRB", - "2","2A","2B","2C","2D", - "3" - }; +static const uint8_t wACK[5][4] = {{1, 1, 1, 1}, {1, 0, 1, 0}, {1, 1, 0, 0}, {1, 0, 0, 1}, {0, 0, 0, 0}}; +static const uint32_t bitrev_cc_dci[32] = {1, 17, 9, 25, 5, 21, 13, 29, 3, 19, 11, 27, 7, 23, 15, 31, 0, 16, 8, 24, 4, 20, 12, 28, 2, 18, 10, 26, 6, 22, 14, 30}; -uint8_t wACK[5][4] = {{1,1,1,1},{1,0,1,0},{1,1,0,0},{1,0,0,1},{0,0,0,0}}; -int8_t wACK_RX[5][4] = {{-1,-1,-1,-1},{-1,1,-1,1},{-1,-1,1,1},{-1,1,1,-1},{1,1,1,1}}; +static const uint8_t pcfich_b[4][32] = {{0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1}, + {1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0}, + {1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; -uint32_t bitrev_cc_dci[32] = {1,17,9,25,5,21,13,29,3,19,11,27,7,23,15,31,0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30}; +extern short *ul_ref_sigs[30][2][34]; +extern short *ul_ref_sigs_rx[30][2][34]; +extern int16_t *d0_sss, *d5_sss; -uint8_t pcfich_b[4][32]= {{0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1}, - {1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0}, - {1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1}, - {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} -}; +#endif diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index 51e4d40a33..4168962046 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -43,10 +43,9 @@ #include "transport_proto.h" #include -extern WORKER_CONF_t get_thread_worker_conf(void); extern int oai_exit; - +static const int8_t wACK_RX[5][4] = {{-1, -1, -1, -1}, {-1, 1, -1, 1}, {-1, -1, 1, 1}, {-1, 1, 1, -1}, {1, 1, 1, 1}}; void free_eNB_ulsch(LTE_eNB_ULSCH_t *ulsch) { int i,r; @@ -412,7 +411,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB, unsigned int ret=0; // uint8_t dummy_channel_output[(3*8*block_length)+12]; int r,Kr; - uint8_t *columnset; + const uint8_t *columnset; unsigned int sumKr=0; unsigned int Qprime,L,G,Q_CQI,Q_RI,H,Hprime,Hpp,Cmux,Rmux_prime,O_RCC; unsigned int Qprime_ACK,Qprime_RI,len_ACK=0,len_RI=0; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dci_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/dci_ue.c index fd851b3abf..2a003019c7 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dci_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dci_ue.c @@ -38,7 +38,7 @@ #include "SCHED_UE/sched_UE.h" #include "SIMULATION/TOOLS/sim.h" // for taus #include "PHY/sse_intrin.h" -#include "PHY/LTE_TRANSPORT/transport_extern.h" +#include "PHY/LTE_TRANSPORT/transport_vars.h" #include "PHY/LTE_REFSIG/lte_refsig.h" #include "SCHED/sched_common.h" @@ -2021,8 +2021,18 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars, } #ifdef DEBUG_DCI_DECODING - LOG_I(PHY,"[DCI search] Found DCI %d rnti %x Aggregation %d length %d format %s in CCE %d (CCEmap %x) candidate %d / %d \n", - *dci_cnt,crc,1< #include "PHY/sse_intrin.h" -extern short conjugate75[8]; -extern short conjugate75_2[8]; -extern short negate[8]; - void apply_7_5_kHz(PHY_VARS_UE *ue,int32_t*txdata,uint8_t slot) { diff --git a/openair1/PHY/TOOLS/oai_dfts.c b/openair1/PHY/TOOLS/oai_dfts.c index b14b64b1a8..56787efd6f 100644 --- a/openair1/PHY/TOOLS/oai_dfts.c +++ b/openair1/PHY/TOOLS/oai_dfts.c @@ -10024,40 +10024,6 @@ int main(int argc, char**argv) printf("\n\n49152-point(%f cycles)\n",(double)ts.diff/(double)ts.trials); LOG_M("y49152.m","y49152",y,49152,1,1); LOG_M("x49152.m","x49152",x,49152,1,1); - /* - int dftsizes[33]={24,36,48,60,72,96,108,120,144,180,192,216,240,288,300,324,360,384,432,480,540,576,600,648,720,768,864,900,960,972,1080,1152,1200}; - void (*dft)(int16_t *x,int16_t *y,uint8_t scale)[33] = {dft24,dft36,dft48,dft60,dft72,dft96,dft108,dft120,dft144,dft180,dft192,dft216,dft240,dft288,dft300,dft324,dft360,dft384,dft432,dft480,dft540,dft576,dft600,dft648,dft720,dft768,dft864,dft900,dft960,dft972,dft1080,dft1152,dft1200}; - for (int n=0;n<33;n++) { - // 4xN-point DFT - memset((void*)x,0,dftsizes[n]*8*sizeof(int16_t)); - for (i=0;i -#include - - -// This is the formula from Section 5.1.1.1 in 36.213 100*10*log10((2^(MPR*Ks)-1)), where MPR is in the range [0,6] and Ks=1.25 -int16_t hundred_times_delta_TF[100] = {-32768,-1268,-956,-768,-631,-523,-431,-352,-282,-219,-161,-107,-57,-9,36,79,120,159,197,234,269,304,337,370,402,434,465,495,525,555,583,612,640,668,696,723,750,777,803,829,856,881,907,933,958,983,1008,1033,1058,1083,1108,1132,1157,1181,1205,1229,1254,1278,1302,1325,1349,1373,1397,1421,1444,1468,1491,1515,1538,1562,1585,1609,1632,1655,1679,1702,1725,1748,1772,1795,1818,1841,1864,1887,1910,1933,1956,1980,2003,2026,2049,2072,2095,2118,2141,2164,2186,2209,2232,2255}; -uint16_t hundred_times_log10_NPRB[100] = {0,301,477,602,698,778,845,903,954,1000,1041,1079,1113,1146,1176,1204,1230,1255,1278,1301,1322,1342,1361,1380,1397,1414,1431,1447,1462,1477,1491,1505,1518,1531,1544,1556,1568,1579,1591,1602,1612,1623,1633,1643,1653,1662,1672,1681,1690,1698,1707,1716,1724,1732,1740,1748,1755,1763,1770,1778,1785,1792,1799,1806,1812,1819,1826,1832,1838,1845,1851,1857,1863,1869,1875,1880,1886,1892,1897,1903,1908,1913,1919,1924,1929,1934,1939,1944,1949,1954,1959,1963,1968,1973,1977,1982,1986,1991,1995,2000}; - diff --git a/openair1/SCHED_UE/srs_pc.c b/openair1/SCHED_UE/srs_pc.c index 9463db2cd6..8026eb8307 100644 --- a/openair1/SCHED_UE/srs_pc.c +++ b/openair1/SCHED_UE/srs_pc.c @@ -34,6 +34,7 @@ #include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h" #include "PHY/phy_extern_ue.h" #include "PHY/LTE_ESTIMATION/lte_estimation.h" +#include "openair1/SCHED/sched_common_extern.h" void srs_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t *pnb_rb_srs, uint8_t abstraction_flag) { diff --git a/openair1/SIMULATION/ETH_TRANSPORT/bypass_session_layer.c b/openair1/SIMULATION/ETH_TRANSPORT/bypass_session_layer.c index e96db24521..a64e02abf7 100644 --- a/openair1/SIMULATION/ETH_TRANSPORT/bypass_session_layer.c +++ b/openair1/SIMULATION/ETH_TRANSPORT/bypass_session_layer.c @@ -39,7 +39,7 @@ #include "UTIL/LOG/log.h" #include "multicast_link.h" - +#include "openair1/SIMULATION/ETH_TRANSPORT/extern.h" char rx_bufferP[BYPASS_RX_BUFFER_SIZE]; unsigned int num_bytesP = 0; int N_P = 0, N_R = 0; @@ -57,6 +57,10 @@ mapping transport_names[] = { {"RELEASE TRANSPORT INFO", EMU_TRANSPORT_INFO_RELEASE}, {NULL, -1} }; +static pthread_mutex_t emul_low_mutex; +static pthread_mutex_t emul_low_mutex; +static pthread_cond_t emul_low_cond; +static char emul_low_mutex_var; void init_bypass (void) { diff --git a/openair1/SIMULATION/ETH_TRANSPORT/emu_transport.c b/openair1/SIMULATION/ETH_TRANSPORT/emu_transport.c index 03fbfeffe0..9d209043fd 100644 --- a/openair1/SIMULATION/ETH_TRANSPORT/emu_transport.c +++ b/openair1/SIMULATION/ETH_TRANSPORT/emu_transport.c @@ -39,6 +39,27 @@ #include "UTIL/OCG/OCG_extern.h" #include "UTIL/LOG/log.h" #include "UTIL/LOG/vcd_signal_dumper.h" +#include "openair1/SIMULATION/ETH_TRANSPORT/extern.h" +unsigned char Emulation_status; +unsigned char emu_tx_status; +unsigned char emu_rx_status; + +#if !defined(ENABLE_NEW_MULTICAST) +pthread_mutex_t Tx_mutex; +pthread_cond_t Tx_cond; +char Tx_mutex_var; +#endif + +/* Handlers for RX and TX */ +rx_handler_t rx_handler; +tx_handler_t tx_handler; + +eNB_transport_info_t eNB_transport_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs]; +uint16_t eNB_transport_info_TB_index[NUMBER_OF_eNB_MAX][MAX_NUM_CCs]; + +UE_transport_info_t UE_transport_info[NUMBER_OF_UE_MAX][MAX_NUM_CCs]; + +UE_cntl ue_cntl_delay[NUMBER_OF_UE_MAX][MAX_NUM_CCs][2]; extern unsigned int Master_list_rx; diff --git a/openair1/SIMULATION/ETH_TRANSPORT/extern.h b/openair1/SIMULATION/ETH_TRANSPORT/extern.h index 826317b538..ecd0d301d6 100644 --- a/openair1/SIMULATION/ETH_TRANSPORT/extern.h +++ b/openair1/SIMULATION/ETH_TRANSPORT/extern.h @@ -42,9 +42,6 @@ extern unsigned char emu_rx_status; //extern unsigned int Is_primary_master; #if !defined(ENABLE_NEW_MULTICAST) -extern pthread_mutex_t emul_low_mutex; -extern pthread_cond_t emul_low_cond; -extern char emul_low_mutex_var; extern pthread_mutex_t Tx_mutex; extern pthread_cond_t Tx_cond; extern char Tx_mutex_var; diff --git a/openair1/SIMULATION/ETH_TRANSPORT/netlink_init.c b/openair1/SIMULATION/ETH_TRANSPORT/netlink_init.c index 988052ca82..837d977f65 100644 --- a/openair1/SIMULATION/ETH_TRANSPORT/netlink_init.c +++ b/openair1/SIMULATION/ETH_TRANSPORT/netlink_init.c @@ -38,7 +38,7 @@ #include #include #include -#include "platform_constants.h" +#include "common/platform_constants.h" #include #include diff --git a/openair1/SIMULATION/ETH_TRANSPORT/vars.h b/openair1/SIMULATION/ETH_TRANSPORT/vars.h deleted file mode 100644 index 9368d622c6..0000000000 --- a/openair1/SIMULATION/ETH_TRANSPORT/vars.h +++ /dev/null @@ -1,64 +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 vars.h -* \brief specifies the variables for phy emulation -* \author Navid Nikaein and Raymomd Knopp and Hicham Anouar -* \date 2011 -* \version 1.0 -* \company Eurecom -* \email: navid.nikaein@eurecom.fr -*/ - -#include -#include "defs.h" - -#ifndef __BYPASS_SESSION_LAYER_VARS_H__ -# define __BYPASS_SESSION_LAYER_VARS_H__ - -unsigned char Emulation_status; -unsigned char emu_tx_status; -unsigned char emu_rx_status; -//unsigned int Master_list=0; -//unsigned short Master_id; -//unsigned int Is_primary_master; - -#if !defined(ENABLE_NEW_MULTICAST) -pthread_mutex_t emul_low_mutex; -pthread_cond_t emul_low_cond; -char emul_low_mutex_var; -pthread_mutex_t Tx_mutex; -pthread_cond_t Tx_cond; -char Tx_mutex_var; -#endif - -/* Handlers for RX and TX */ -rx_handler_t rx_handler; -tx_handler_t tx_handler; - -eNB_transport_info_t eNB_transport_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs]; -uint16_t eNB_transport_info_TB_index[NUMBER_OF_eNB_MAX][MAX_NUM_CCs]; - -UE_transport_info_t UE_transport_info[NUMBER_OF_UE_MAX][MAX_NUM_CCs]; - -UE_cntl ue_cntl_delay[NUMBER_OF_UE_MAX][MAX_NUM_CCs][2]; - -#endif diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index dcaff8f088..0002981f78 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -37,7 +37,6 @@ #include #include "common/config/config_load_configmodule.h" #include "common/utils/LOG/log.h" -#include "LAYER2/MAC/mac_vars.h" #include "nfapi/oai_integration/vendor_ext.h" #include "PHY/types.h" #include "PHY/defs_eNB.h" @@ -51,7 +50,6 @@ #include "PHY/MODULATION/modulation_UE.h" #include "PHY/TOOLS/lte_phy_scope.h" #include "SCHED/sched_eNB.h" -#include "SCHED/sched_common_vars.h" #include "SCHED_UE/sched_UE.h" #include "SIMULATION/TOOLS/sim.h" #include "UTIL/LISTS/list.h" diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm7.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm7.c index 2f254ea3d2..547d2cfa28 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm7.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm7.c @@ -51,9 +51,6 @@ #include "unitary_defs.h" -extern unsigned int dlsch_tbs25[27][25],TBStable[27][110]; -extern unsigned char offset_mumimo_llr_drange_fix; - #include "PHY/TOOLS/lte_phy_scope.h" PHY_VARS_eNB *eNB; diff --git a/openair1/SIMULATION/LTE_PHY/mbmssim.c b/openair1/SIMULATION/LTE_PHY/mbmssim.c index 0f7a1375ff..390bf8c73f 100644 --- a/openair1/SIMULATION/LTE_PHY/mbmssim.c +++ b/openair1/SIMULATION/LTE_PHY/mbmssim.c @@ -43,7 +43,6 @@ #include "PHY/phy_vars.h" #include "SCHED/sched_eNB.h" -#include "SCHED/sched_common_vars.h" #include "LAYER2/MAC/mac_vars.h" #include "OCG_vars.h" diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c index 60c658913e..27a8722ea5 100644 --- a/openair1/SIMULATION/LTE_PHY/ulsim.c +++ b/openair1/SIMULATION/LTE_PHY/ulsim.c @@ -33,7 +33,6 @@ #include #include #include -#include "LAYER2/MAC/mac_vars.h" #include "PHY/types.h" #include "PHY/defs_common.h" #include "PHY/defs_eNB.h" @@ -43,7 +42,6 @@ #include "PHY/LTE_TRANSPORT/transport_proto.h" #include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h" #include "PHY/TOOLS/lte_phy_scope.h" -#include "SCHED/sched_common_vars.h" #include "SCHED/sched_eNB.h" #include "SCHED_UE/sched_UE.h" #include "SIMULATION/TOOLS/sim.h" diff --git a/openair1/SIMULATION/LTE_PHY/unitary_defs.h b/openair1/SIMULATION/LTE_PHY/unitary_defs.h index 342fa18fb9..d77682c89e 100644 --- a/openair1/SIMULATION/LTE_PHY/unitary_defs.h +++ b/openair1/SIMULATION/LTE_PHY/unitary_defs.h @@ -28,8 +28,4 @@ void exit_function(const char* file, const char* function, const int line,const exit(-1); } -extern unsigned int dlsch_tbs25[27][25],TBStable[27][110]; extern unsigned char offset_mumimo_llr_drange_fix; - -extern unsigned short dftsizes[34]; -extern short *ul_ref_sigs[30][2][34]; diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index 5d1cbb7fbe..bacd100114 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -63,7 +63,7 @@ uint64_t downlink_frequency[MAX_NUM_CCs][4]; double cpuf; //uint8_t nfapi_mode = 0; -uint16_t NB_UE_INST = 1; +const int NB_UE_INST = 1; uint8_t const nr_rv_round_map[4] = {0, 2, 3, 1}; const short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1}; diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 43ecec10d2..134174e7cf 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -68,7 +68,6 @@ #include "SIMULATION/LTE_PHY/common_sim.h" #include "PHY/NR_REFSIG/dmrs_nr.h" -#include #include #include @@ -372,6 +371,7 @@ nrUE_params_t *get_nrUE_params(void) { void do_nothing(void *args) { } +int NB_UE_INST = 1; int main(int argc, char **argv) { @@ -414,7 +414,6 @@ int main(int argc, char **argv) SCM_t channel_model = AWGN; // AWGN Rayleigh1 Rayleigh1_anticorr; - NB_UE_INST = 1; //double pbch_sinr; //int pbch_tx_ant; int N_RB_DL=106,mu=1; diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index cb193e83e8..7d0be09585 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -60,7 +60,7 @@ int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; double cpuf; //uint8_t nfapi_mode = 0; -uint16_t NB_UE_INST = 1; +const int NB_UE_INST = 1; // needed for some functions openair0_config_t openair0_cfg[MAX_CARDS]; diff --git a/openair1/SIMULATION/NR_PHY/prachsim.c b/openair1/SIMULATION/NR_PHY/prachsim.c index 2ec2faedde..fd145c568f 100644 --- a/openair1/SIMULATION/NR_PHY/prachsim.c +++ b/openair1/SIMULATION/NR_PHY/prachsim.c @@ -47,7 +47,6 @@ #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" #include "nr_unitary_defs.h" #include "OCG_vars.h" -#include #include #include #include @@ -233,6 +232,7 @@ nrUE_params_t *get_nrUE_params(void) { nr_bler_struct nr_bler_data[NR_NUM_MCS]; void processSlotTX(void *arg) {} +int NB_UE_INST = 1; int main(int argc, char **argv){ @@ -252,7 +252,6 @@ int main(int argc, char **argv){ uint8_t config_period; int prachOccasion = 0; double DS_TDL = .03; - NB_UE_INST=1; // int8_t interf1=-19,interf2=-19; // uint8_t abstraction_flag=0,calibration_flag=0; diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c index 04976c1dc0..ca29219e31 100644 --- a/openair1/SIMULATION/NR_PHY/pucchsim.c +++ b/openair1/SIMULATION/NR_PHY/pucchsim.c @@ -59,7 +59,7 @@ uint64_t downlink_frequency[MAX_NUM_CCs][4]; double cpuf; //uint8_t nfapi_mode = 0; -uint16_t NB_UE_INST = 1; +const int NB_UE_INST = 1; uint8_t const nr_rv_round_map[4] = {0, 2, 3, 1}; const short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1}; const short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1}; diff --git a/openair1/SIMULATION/NR_PHY/ulschsim.c b/openair1/SIMULATION/NR_PHY/ulschsim.c index 54e0f2b87d..39ab2273e7 100644 --- a/openair1/SIMULATION/NR_PHY/ulschsim.c +++ b/openair1/SIMULATION/NR_PHY/ulschsim.c @@ -66,7 +66,7 @@ const short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1}; const short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1}; double cpuf; //uint8_t nfapi_mode = 0; -uint16_t NB_UE_INST = 1; +const int NB_UE_INST = 1; // needed for some functions PHY_VARS_NR_UE *PHY_vars_UE_g[1][1] = { { NULL } }; diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index cd776b009d..210b33774e 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -61,7 +61,6 @@ #define inMicroS(a) (((double)(a))/(get_cpu_freq_GHz()*1000.0)) #include "SIMULATION/LTE_PHY/common_sim.h" -#include #include #include @@ -267,6 +266,7 @@ uint16_t n_rnti = 0x1234; openair0_config_t openair0_cfg[MAX_CARDS]; channel_desc_t *UE2gNB[NUMBER_OF_UE_MAX][NUMBER_OF_gNB_MAX]; +int NB_UE_INST = 1; int main(int argc, char **argv) { @@ -295,8 +295,6 @@ int main(int argc, char **argv) corr_level_t corr_level = CORR_LEVEL_LOW; uint16_t N_RB_DL = 106, N_RB_UL = 106, mu = 1; - NB_UE_INST = 1; - //unsigned char frame_type = 0; NR_DL_FRAME_PARMS *frame_parms; int loglvl = OAILOG_WARNING; diff --git a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.c b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.c index 2302c50ab1..9c96d39534 100644 --- a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.c +++ b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.c @@ -44,8 +44,6 @@ /* to declare ue variables */ #include "PHY/phy_vars_nr_ue.h" #include "PHY/LTE_TRANSPORT/transport_vars.h" -#include "SCHED/sched_common_vars.h" -#include "PHY/MODULATION/modulation_vars.h" #include "PHY/NR_REFSIG/pss_nr.h" #include "PHY/NR_REFSIG/sss_nr.h" diff --git a/openair1/SIMULATION/TOOLS/channel_sim.c b/openair1/SIMULATION/TOOLS/channel_sim.c index de8db5d7cb..7a1a77d3e1 100644 --- a/openair1/SIMULATION/TOOLS/channel_sim.c +++ b/openair1/SIMULATION/TOOLS/channel_sim.c @@ -69,16 +69,16 @@ void do_DL_sig(sim_t *sim, double s_re0[30720]; double s_re1[30720]; - double *s_re[RC.nb_RU]; + double *s_re[NB_ANTENNAS_TX]; double s_im0[30720]; double s_im1[30720]; - double *s_im[RC.nb_RU]; + double *s_im[NB_ANTENNAS_TX]; double r_re00[30720]; double r_re01[30720]; - double *r_re0[RC.nb_RU]; + double *r_re0[NB_ANTENNAS_RX]; double r_im00[30720]; double r_im01[30720]; - double *r_im0[RC.nb_RU]; + double *r_im0[NB_ANTENNAS_RX]; LTE_DL_FRAME_PARMS *frame_parms; s_re[0] = s_re0; @@ -295,14 +295,7 @@ void do_DL_sig(sim_t *sim, } - -void do_UL_sig(sim_t *sim, - uint16_t subframe, - uint8_t abstraction_flag, - LTE_DL_FRAME_PARMS *frame_parms, - uint32_t frame, - int ru_id, - uint8_t CC_id) +void do_UL_sig(sim_t *sim, uint16_t subframe, uint8_t abstraction_flag, LTE_DL_FRAME_PARMS *frame_parms, uint32_t frame, int ru_id, uint8_t CC_id, int NB_UE_INST) { int32_t **txdata,**rxdata; uint8_t UE_id=0; @@ -319,16 +312,16 @@ void do_UL_sig(sim_t *sim, double s_re0[30720]; double s_re1[30720]; - double *s_re[NB_UE_INST]; + double *s_re[NB_ANTENNAS_TX]; double s_im0[30720]; double s_im1[30720]; - double *s_im[NB_UE_INST]; + double *s_im[NB_ANTENNAS_TX]; double r_re00[30720]; double r_re01[30720]; - double *r_re0[NB_UE_INST]; + double *r_re0[NB_ANTENNAS_RX]; double r_im00[30720]; double r_im01[30720]; - double *r_im0[NB_UE_INST]; + double *r_im0[NB_ANTENNAS_RX]; s_re[0] = s_re0; s_im[0] = s_im0; diff --git a/openair1/SIMULATION/TOOLS/sim.h b/openair1/SIMULATION/TOOLS/sim.h index b23aaac4b5..e530a3a3d0 100644 --- a/openair1/SIMULATION/TOOLS/sim.h +++ b/openair1/SIMULATION/TOOLS/sim.h @@ -288,7 +288,7 @@ typedef enum { {CHANNELMOD_MODEL_DT_PNAME, "delay spread for TDL models\n", 0, dblptr:NULL, defdblval:0, TYPE_DOUBLE, 0 }\ } -#include "platform_constants.h" +#include "common/platform_constants.h" typedef struct { channel_desc_t *RU2UE[NUMBER_OF_RU_MAX][NUMBER_OF_UE_MAX][MAX_NUM_CCs]; @@ -573,12 +573,6 @@ void do_DL_sig(sim_t *sim, uint8_t UE_id, int CC_id); -void do_UL_sig(sim_t *sim, - uint16_t subframe, - uint8_t abstraction_flag, - LTE_DL_FRAME_PARMS *frame_parms, - uint32_t frame, - int ru_id, - uint8_t CC_id); +void do_UL_sig(sim_t *sim, uint16_t subframe, uint8_t abstraction_flag, LTE_DL_FRAME_PARMS *frame_parms, uint32_t frame, int ru_id, uint8_t CC_id, int NB_UEs); #endif diff --git a/openair2/COMMON/gtpv1_u_messages_types.h b/openair2/COMMON/gtpv1_u_messages_types.h index 4ba50c47e5..7c784a0c35 100644 --- a/openair2/COMMON/gtpv1_u_messages_types.h +++ b/openair2/COMMON/gtpv1_u_messages_types.h @@ -23,7 +23,7 @@ #define GTPV1_U_MESSAGES_TYPES_H_ #include "LTE_asn_constant.h" - +#include "NR_asn_constant.h" #define GTPV1U_MAX_BEARERS_PER_UE max_val_LTE_DRB_Identity #define NR_GTPV1U_MAX_BEARERS_PER_UE max_val_NR_DRB_Identity diff --git a/openair2/COMMON/mac_rrc_primitives.h b/openair2/COMMON/mac_rrc_primitives.h index d258bb872a..b159b3e11b 100644 --- a/openair2/COMMON/mac_rrc_primitives.h +++ b/openair2/COMMON/mac_rrc_primitives.h @@ -24,7 +24,7 @@ #include "LAYER2/RLC/rlc.h" #include "COMMON/platform_types.h" -#include "COMMON/platform_constants.h" +#include "common/platform_constants.h" #include "openair2/RRC/LTE/rrc_defs.h" #include "LTE_RadioResourceConfigCommonSIB.h" @@ -324,53 +324,6 @@ typedef struct { //RRC_INTERFACE_FUNCTIONS double (*rrc_get_estimated_ue_distance) (module_id_t Mod_id, uint8_t UE_id, uint8_t CC_id, uint8_t loc_type); } RRC_XFACE; - -typedef struct { - //MAC_INTERFACE_FUNCTIONS - unsigned int frame; - unsigned short Node_id[NB_MODULES_MAX]; - char Is_cluster_head[NB_MODULES_MAX]; - void (*macphy_exit)(const char *); /* Pointer function that stops the low-level scheduler due an exit condition */ - unsigned short (*mac_config_req)(uint8_t,uint8_t,MAC_CONFIG_REQ *); - MAC_MEAS_REQ_ENTRY *(*mac_meas_req)(uint8_t, MAC_MEAS_REQ *); - void (*mac_out_of_sync_ind)(uint8_t,uint32_t,unsigned short); - //RLC_INTERFACE_FUNCTIONS - void (*pdcp_run)(void); - void (*pdcp_data_req)(module_id_t, rb_id_t, sdu_size_t, char *); - signed int (*rrc_rlc_config_req)(unsigned int, unsigned int, unsigned int, unsigned int, rlc_info_t ); - int (*rrc_mac_config_req)(uint8_t Mod_id,uint8_t eNB_flag,uint8_t UE_id,uint8_t eNB_index, - LTE_RadioResourceConfigCommonSIB_t *radioResourceConfigCommon, - struct LTE_PhysicalConfigDedicated *physicalConfigDedicated, - LTE_MAC_MainConfig_t *mac_MainConfig, - long logicalChannelIdentity, - LTE_LogicalChannelConfig_t *logicalChannelConfig, - LTE_MeasGapConfig_t *measGapConfig, - LTE_TDD_Config_t *tdd_Config, - uint8_t *SIwindowsize, - uint16_t *SIperiod, - MBMS_flag_t MBMS_Flag, - struct LTE_MBSFN_SubframeConfigList *mbsfn_SubframeConfigList, - LTE_MBSFN_AreaInfoList_r9_t *mbsfn_AreaInfoList, - struct LTE_PMCH_InfoList_r9 *pmch_InfoList - ); - unsigned int (*mac_rlc_data_req)(module_id_t, unsigned int, const unsigned int,char * - ,uint32_t - ,uint32_t - ); - void (*mac_rlc_data_ind)(module_id_t, logical_chan_id_t, char *, tb_size_t, num_tb_t, crc_t * ); - mac_rlc_status_resp_t (*mac_rlc_status_ind) (module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t frameP, sub_frame_t subframeP, eNB_flag_t eNB_flagP, MBMS_flag_t MBMS_flagP, - logical_chan_id_t channel_idP, tb_size_t tb_sizeP - ,uint32_t sourceL2Id - ,uint32_t destinationL2Id - ); - signed int (*rrc_rlc_data_req)(module_id_t, rb_id_t, mui_t, confirm_t, sdu_size_t, char *); - void (*rrc_rlc_register_rrc) (void (*rrc_data_indP)(module_id_t, rb_id_t, sdu_size_t, char * ), - void (*rrc_data_confP) (module_id_t, rb_id_t, mui_t ) ) ; - void (*mrbch_phy_sync_failure) (uint8_t Mod_id, frame_t frame, uint8_t Free_ch_index); - void (*dl_phy_sync_success) (uint8_t Mod_id, frame_t frame, uint8_t eNB_index); -} MAC_RLC_XFACE; - - //#define IDLE 0 #define NEED_RADIO_CONFIG 3 #define RADIO_CONFIG_TX 2 diff --git a/openair2/COMMON/platform_constants.h b/openair2/COMMON/platform_constants.h deleted file mode 100644 index 47dac57832..0000000000 --- a/openair2/COMMON/platform_constants.h +++ /dev/null @@ -1,159 +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 - */ - -/* - platform_constants.h - ------------------- - AUTHOR : Lionel GAUTHIER and Navid Nikaein - COMPANY : EURECOM - EMAIL : Lionel.Gauthier@eurecom.fr - - ***************************************************************************/ - - -#ifndef __PLATFORM_CONSTANTS_H__ -# define __PLATFORM_CONSTANTS_H__ - -#include "LTE_asn_constant.h" -#include "NR_asn_constant.h" -#define NR_MAXDRB 14 - -#ifdef JUMBO_FRAME - #define NL_MAX_PAYLOAD 18000 /* this should cover the max mtu size*/ -#else - #define NL_MAX_PAYLOAD 9000 /* this should cover the max mtu size*/ -#endif - -#ifdef LARGE_SCALE - #define NB_MODULES_MAX 128 - #define NB_NODE_MAX 128 -#else - #define NB_MODULES_MAX 32 - #define NB_NODE_MAX 32 -#endif - -#ifdef JUMBO_FRAME - #define MAX_IP_PACKET_SIZE 10000 // 9000 -#else - #if defined(OAI_NW_DRIVER_TYPE_ETHERNET) - /* SR: When using ethernet network driver the packet size is 1512 : - * 1500 bytes IP packet + 14 bytes ethernet header - */ - #define MAX_IP_PACKET_SIZE 1514 - #else - #define MAX_IP_PACKET_SIZE 1500 // 3000 - #endif -#endif -// overwrite the previous deinitions - -# define MAX_MODULES NB_MODULES_MAX -#define MAX_NR_RRC_UE_CONTEXTS 64 - -#ifndef UE_EXPANSION - #ifdef LARGE_SCALE - #define MAX_MOBILES_PER_ENB 128 - #define MAX_MOBILES_PER_ENB_NB_IoT 128 - #define MAX_MOBILES_PER_GNB 128 - #define MAX_eNB 2 - #define MAX_gNB 2 - #else - #define MAX_MOBILES_PER_ENB 40 - #define MAX_MOBILES_PER_ENB_NB_IoT 40 - #define MAX_MOBILES_PER_GNB 16 - #define MAX_eNB 2 - #define MAX_gNB 2 - #endif -#else - #define MAX_MOBILES_PER_ENB 256 - #define MAX_MOBILES_PER_ENB_NB_IoT 256 - #define MAX_MOBILES_PER_GNB 256 - #define MAX_eNB 2 - #define MAX_gNB 2 -#endif - -#define NUMBER_OF_NR_UCI_STATS_MAX 16 -#define MAX_MANAGED_ENB_PER_MOBILE 2 -#define MAX_MANAGED_GNB_PER_MOBILE 2 - -///NB-IOT -#define NB_RB_MAX_NB_IOT (LTE_maxDRB_NB_r13 + 3) //MP: NB_IoT --> 2(DRB)+3(SRBs - 2 is not used) = 5 - - -#define DEFAULT_RAB_ID 1 - -#define NB_RB_MAX (LTE_maxDRB + 3) /* was 11, now 14, maxDRB comes from asn1_constants.h, + 3 because of 3 SRB, one invisible id 0, then id 1 and 2 */ -#define NR_NB_RB_MAX (NR_maxDRB + 3) - -#define NGAP_MAX_PDU_SESSION (256) /* As defined in TS 38.413 9.2.1.1 Range Bound for PDU Sessions. */ -#define NGAP_MAX_DRBS_PER_UE (32) /* As defined in TS 38.413 9.2.1.1 - maxnoofDRBs */ - -#define NB_RB_MBMS_MAX (LTE_maxSessionPerPMCH*LTE_maxServiceCount) - -#define NB_RAB_MAX LTE_maxDRB /* was 8, now 11 */ -#define RAB_SHIFT1 9 -#define RAB_SHIFT2 3 -//#define RAB_OFFSET 0x0007 -#define RAB_OFFSET 0x000F -#define RAB_OFFSET1 0x7E00 -#define RAB_OFFSET2 0x01F8 -#define DIR_OFFSET 0x8000 -#define DIR_SHIFT 15 -#define CH_OFFSET 0x0004 -#define CH_SHIFT 2 - -// RLC Entity -#define RLC_TX_MAXSIZE 10000000 -#define RLC_RX_MAXSIZE 10000000 - -// RLC_AM_SEND_MRW -# define SEND_MRW_OFF 15 -# define SEND_MRW_ON 240 - -// RLC_SEGMENTATION_INDICATION -# define SEGMENTATION_NOT_ALLOWED 0 -# define SEGMENTATION_ALLOWED 1 - -// RLC_DELIVERY_OF_ERRONEOUS_SDU -# define DELIVERY_OF_ERRONEOUS_SDU_NO 0 -# define DELIVERY_OF_ERRONEOUS_SDU_YES 1 -# define DELIVERY_OF_ERRONEOUS_SDU_NO_DETECT 2 - - -// CBA constant -#define NUM_MAX_CBA_GROUP 4 - -#ifndef __cplusplus - #ifndef NULL - #define NULL 0 - #endif - #ifndef null - #define null 0 - #endif -#endif - -#define UNUSED_PARAM_MBMS_SESSION_ID 0 -#define UNUSED_PARAM_MBMS_SERVICE_ID 0 - -#define printk printf - -#define UNUSED_VARIABLE(vARIABLE) (void)(vARIABLE) - -#endif /* __PLATFORM_CONSTANTS_H__ */ diff --git a/openair2/COMMON/platform_types.h b/openair2/COMMON/platform_types.h index 8aebd0374b..3c2c91c2d8 100644 --- a/openair2/COMMON/platform_types.h +++ b/openair2/COMMON/platform_types.h @@ -224,9 +224,9 @@ typedef struct protocol_ctxt_s { // warning time hardcoded #define PROTOCOL_CTXT_TIME_MILLI_SECONDS(CtXt_h) ((CtXt_h)->frame*10+(CtXt_h)->subframe) -#define UE_MODULE_ID_TO_INSTANCE( mODULE_iD ) mODULE_iD + NB_eNB_INST +#define UE_MODULE_ID_TO_INSTANCE(mODULE_iD) mODULE_iD + RC.nb_inst #define ENB_MODULE_ID_TO_INSTANCE( mODULE_iD ) mODULE_iD -#define UE_INSTANCE_TO_MODULE_ID( iNSTANCE ) iNSTANCE - NB_eNB_INST +#define UE_INSTANCE_TO_MODULE_ID(iNSTANCE) iNSTANCE - RC.nb_inst #define ENB_INSTANCE_TO_MODULE_ID( iNSTANCE )iNSTANCE //NR diff --git a/openair2/COMMON/rrm_constants.h b/openair2/COMMON/rrm_constants.h index 5da8f773c3..1f84637d78 100644 --- a/openair2/COMMON/rrm_constants.h +++ b/openair2/COMMON/rrm_constants.h @@ -31,7 +31,7 @@ ***************************************************************************/ # ifndef __RRM_CONSTANTS_H__ # define __RRM_CONSTANTS_H__ -# include "platform_constants.h" +#include "common/platform_constants.h" /*################################################# CONSTANTS FOR L1/L2/L3 LAYERS diff --git a/openair2/ENB_APP/enb_app.c b/openair2/ENB_APP/enb_app.c index 54fc1bf6be..98ddaebfdc 100644 --- a/openair2/ENB_APP/enb_app.c +++ b/openair2/ENB_APP/enb_app.c @@ -49,7 +49,6 @@ # define X2AP_ENB_REGISTER_RETRY_DELAY 10 #include "openair1/PHY/INIT/phy_init.h" -extern unsigned char NB_eNB_INST; extern RAN_CONTEXT_t RC; diff --git a/openair2/ENB_APP/enb_config.h b/openair2/ENB_APP/enb_config.h index 0ef31d42e6..c7f65f1d0e 100644 --- a/openair2/ENB_APP/enb_config.h +++ b/openair2/ENB_APP/enb_config.h @@ -36,7 +36,7 @@ #include "commonDef.h" #include "platform_types.h" -#include "platform_constants.h" +#include "common/platform_constants.h" #include "PHY/defs_eNB.h" #include "s1ap_messages_types.h" #include "f1ap_messages_types.h" diff --git a/openair2/GNB_APP/gnb_config.h b/openair2/GNB_APP/gnb_config.h index 889a8dfb7b..b2a9ece078 100644 --- a/openair2/GNB_APP/gnb_config.h +++ b/openair2/GNB_APP/gnb_config.h @@ -36,7 +36,7 @@ #include "commonDef.h" #include "platform_types.h" -#include "platform_constants.h" +#include "common/platform_constants.h" #include "PHY/defs_eNB.h" #include "s1ap_messages_types.h" #include "ngap_messages_types.h" diff --git a/openair2/LAYER2/MAC/config.c b/openair2/LAYER2/MAC/config.c index dfc1d28daa..732ebd4d4a 100644 --- a/openair2/LAYER2/MAC/config.c +++ b/openair2/LAYER2/MAC/config.c @@ -29,7 +29,7 @@ */ #include "COMMON/platform_types.h" -#include "COMMON/platform_constants.h" +#include "common/platform_constants.h" #include "LTE_SystemInformationBlockType2.h" //#include "RadioResourceConfigCommonSIB.h" #include "LTE_RadioResourceConfigDedicated.h" @@ -58,6 +58,7 @@ extern int l2_init_eNB(void); extern void mac_top_init_eNB(void); extern void mac_init_cell_params(int Mod_idP,int CC_idP); +SCHEDULER_MODES global_scheduler_mode; typedef struct eutra_bandentry_s { int16_t band; uint32_t ul_min; diff --git a/openair2/LAYER2/MAC/config_ue.c b/openair2/LAYER2/MAC/config_ue.c index 3cfc725fdb..4ede02d330 100644 --- a/openair2/LAYER2/MAC/config_ue.c +++ b/openair2/LAYER2/MAC/config_ue.c @@ -33,7 +33,7 @@ #include "COMMON/platform_types.h" -#include "COMMON/platform_constants.h" +#include "common/platform_constants.h" #include "nfapi/oai_integration/vendor_ext.h" #include "SCHED_UE/sched_UE.h" #include "LTE_SystemInformationBlockType2.h" diff --git a/openair2/LAYER2/MAC/defs_NB_IoT.h b/openair2/LAYER2/MAC/defs_NB_IoT.h index abe780741c..a0edf9374e 100644 --- a/openair2/LAYER2/MAC/defs_NB_IoT.h +++ b/openair2/LAYER2/MAC/defs_NB_IoT.h @@ -12,8 +12,7 @@ #include #include #include -//#include "COMMON/openair_defs.h" -#include "COMMON/platform_constants.h" +#include "common/platform_constants.h" #include "COMMON/mac_rrc_primitives.h" #include "PHY/LTE_TRANSPORT/defs_NB_IoT.h" //#include "PHY/defs.h" diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index 0898622115..2cd1a4167f 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -58,6 +58,7 @@ #include #include "T.h" +#include "openair2/LAYER2/MAC/mac_extern.h" #define ENABLE_MAC_PAYLOAD_DEBUG //#define DEBUG_eNB_SCHEDULER 1 @@ -65,26 +66,7 @@ #include "common/ran_context.h" extern RAN_CONTEXT_t RC; - -//------------------------------------------------------------------------------ -void -add_ue_dlsch_info(module_id_t module_idP, - int CC_id, - int UE_id, - sub_frame_t subframeP, - UE_DLSCH_STATUS status, - rnti_t rnti) -//------------------------------------------------------------------------------ -{ - eNB_DLSCH_INFO *info = &eNB_dlsch_info[module_idP][CC_id][UE_id]; - // LOG_D(MAC, "%s(module_idP:%d, CC_id:%d, UE_id:%d, subframeP:%d, status:%d) serving_num:%d rnti:%x\n", __FUNCTION__, module_idP, CC_id, UE_id, subframeP, status, eNB_dlsch_info[module_idP][CC_id][UE_id].serving_num, UE_RNTI(module_idP,UE_id)); - info->rnti = rnti; - // info->weight = weight; - info->subframe = subframeP; - info->status = status; - info->serving_num++; - return; -} +mac_rlc_am_muilist_t rlc_am_mui; //------------------------------------------------------------------------------ int diff --git a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c index 9836b643d4..1cfc8ee838 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c @@ -295,13 +295,7 @@ void dlsch_scheduler_pre_ue_select_fairRR( // update UL DAI after DLSCH scheduling set_ul_DAI(module_idP,UE_id,CC_id,frameP,subframeP); } - - add_ue_dlsch_info(module_idP, - CC_id, - UE_id, - subframeP, - S_DL_NONE, - rnti); + eNB_dlsch_info[module_idP][CC_id][UE_id].status = S_DL_NONE; end_flag[CC_id] = 1; break; } @@ -423,13 +417,7 @@ void dlsch_scheduler_pre_ue_select_fairRR( // update UL DAI after DLSCH scheduling set_ul_DAI(module_idP,UE_id,CC_id,frameP,subframeP); } - - add_ue_dlsch_info(module_idP, - CC_id, - UE_id, - subframeP, - S_DL_NONE, - rnti); + eNB_dlsch_info[module_idP][CC_id][UE_id].status = S_DL_NONE; end_flag[CC_id] = 1; break; } @@ -551,13 +539,7 @@ void dlsch_scheduler_pre_ue_select_fairRR( // update UL DAI after DLSCH scheduling set_ul_DAI(module_idP,UE_id,CC_id,frameP,subframeP); } - - add_ue_dlsch_info(module_idP, - CC_id, - UE_id, - subframeP, - S_DL_NONE, - rnti); + eNB_dlsch_info[module_idP][CC_id][UE_id].status = S_DL_NONE; end_flag[CC_id] = 1; break; } @@ -1204,7 +1186,6 @@ schedule_ue_spec_fairRR(module_id_t module_idP, } } - //weight = get_ue_weight(module_idP,UE_id); // aggregation = 2; for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { N_RB_DL[CC_id] = to_prb(cc[CC_id].mib->message.dl_Bandwidth); @@ -1503,13 +1484,7 @@ schedule_ue_spec_fairRR(module_id_t module_idP, frameP, subframeP, UE_id, rnti); } } - - add_ue_dlsch_info(module_idP, - CC_id, - UE_id, - subframeP, - S_DL_SCHEDULED, - rnti); + eNB_dlsch_info[module_idP][CC_id][UE_id].status = S_DL_SCHEDULED; UE_info->eNB_UE_stats[CC_id][UE_id].dlsch_rounds[round]++; UE_info->eNB_UE_stats[CC_id][UE_id].num_retransmission += 1; UE_info->eNB_UE_stats[CC_id][UE_id].rbs_used_retx = nb_rb; @@ -1943,12 +1918,7 @@ schedule_ue_spec_fairRR(module_id_t module_idP, T(T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP), T_INT(harq_pid), T_BUFFER(UE_info->DLSCH_pdu[CC_id][0][UE_id].payload[0], TBS)); UE_info->UE_template[CC_id][UE_id].nb_rb[harq_pid] = nb_rb; - add_ue_dlsch_info(module_idP, - CC_id, - UE_id, - subframeP, - S_DL_SCHEDULED, - rnti); + eNB_dlsch_info[module_idP][CC_id][UE_id].status = S_DL_SCHEDULED; // store stats eNB->eNB_stats[CC_id].dlsch_bytes_tx+=sdu_length_total; eNB->eNB_stats[CC_id].dlsch_pdus_tx+=1; @@ -2162,7 +2132,7 @@ fill_DLSCH_dci_fairRR( if (eNB_dlsch_info[module_idP][CC_id][UE_id].status == S_DL_SCHEDULED) { // clear scheduling flag - eNB_dlsch_info[module_idP][CC_id][UE_id].status = S_DL_WAITING; + eNB_dlsch_info[module_idP][CC_id][UE_id].status = S_DL_NONE; rnti = UE_RNTI(module_idP,UE_id); harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frameP,subframeP); nb_rb = UE_info->UE_template[CC_id][UE_id].nb_rb[harq_pid]; @@ -3351,12 +3321,7 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP, uint16_t ul_sched_frame = sched_frame; uint16_t ul_sched_subframeP = sched_subframeP; add_subframe(&ul_sched_frame, &ul_sched_subframeP, 2); - ul_req->sfn_sf = ul_sched_frame<<4|ul_sched_subframeP; - add_ue_ulsch_info(module_idP, - CC_id, - UE_id, - subframeP, - S_UL_SCHEDULED); + ul_req->sfn_sf = ul_sched_frame << 4 | ul_sched_subframeP; LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generated ULSCH DCI for next UE_id %d, format 0\n", module_idP,CC_id,frameP,subframeP,UE_id); // increment first rb for next UE allocation first_rb[CC_id]+=rb_table[rb_table_index]; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_phytest.c b/openair2/LAYER2/MAC/eNB_scheduler_phytest.c index 1e595f11b5..9ade5eb8b2 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_phytest.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_phytest.c @@ -324,11 +324,6 @@ void schedule_ulsch_phy_test(module_id_t module_idP,frame_t frameP,sub_frame_t s ul_req->number_of_pdus = 1; mac->ul_handle++; - add_ue_ulsch_info(module_idP, - CC_id, - UE_id, - subframeP, - S_UL_SCHEDULED); // increment first rb for next UE allocation first_rb[CC_id]+= nb_rb; } // loop of CC_id diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 58abbd7a47..b896e4777a 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -58,10 +58,36 @@ extern uint16_t frame_cnt; #include "common/ran_context.h" #include "SCHED/sched_common.h" +#include "openair2/LAYER2/MAC/mac_extern.h" +/* + * If the CQI is low, then scheduler will use a higher aggregation level and lower aggregation level otherwise + * this is also dependent to transmission mode, where an offset could be defined + */ +// the follwoing three tables are calibrated for TXMODE 1 and 2 +static const uint8_t cqi2fmt0_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE] = { + {3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, // 1.4_DCI0_CRC_Size= 37 bits + //{3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE = 41 + {3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE = 41 + {3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0}, // 10_DCI0_CRC_SIZE = 43 + {3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0} // 20_DCI0_CRC_SIZE = 44 +}; + +static const uint8_t cqi2fmt1x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE] = { + {3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, // 1.4_DCI0_CRC_Size < 38 bits + {3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE < 43 + {3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0}, // 10_DCI0_CRC_SIZE < 47 + {3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0} // 20_DCI0_CRC_SIZE < 55 +}; + +static const uint8_t cqi2fmt2x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE] = { + {3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, // 1.4_DCI0_CRC_Size= 47 bits + {3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE = 55 + {3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0}, // 10_DCI0_CRC_SIZE = 59 + {3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0} // 20_DCI0_CRC_SIZE = 64 +}; extern RAN_CONTEXT_t RC; - - +eNB_DLSCH_INFO eNB_dlsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][MAX_MOBILES_PER_ENB]; // eNBxUE = 8x8 //------------------------------------------------------------------------------ int choose(int n, @@ -1940,8 +1966,6 @@ narrowband_to_first_rb(COMMON_channels_t *cc, return 0; } - -//------------------------------------------------------------------------------ void init_ue_sched_info(void) //------------------------------------------------------------------------------ @@ -1951,15 +1975,7 @@ init_ue_sched_info(void) for (i = 0; i < NUMBER_OF_eNB_MAX; i++) { for (k = 0; k < MAX_NUM_CCs; k++) { for (j = 0; j < MAX_MOBILES_PER_ENB; j++) { - // init DL - eNB_dlsch_info[i][k][j].weight = 0; - eNB_dlsch_info[i][k][j].subframe = 0; - eNB_dlsch_info[i][k][j].serving_num = 0; eNB_dlsch_info[i][k][j].status = S_DL_NONE; - // init UL - eNB_ulsch_info[i][k][j].subframe = 0; - eNB_ulsch_info[i][k][j].serving_num = 0; - eNB_ulsch_info[i][k][j].status = S_UL_NONE; } } } @@ -1967,16 +1983,6 @@ init_ue_sched_info(void) return; } -//------------------------------------------------------------------------------ -unsigned char -get_ue_weight(module_id_t module_idP, - int CC_idP, - int ue_idP) -//------------------------------------------------------------------------------ -{ - return (eNB_dlsch_info[module_idP][CC_idP][ue_idP].weight); -} - //------------------------------------------------------------------------------ int find_UE_id(module_id_t mod_idP, @@ -2239,9 +2245,7 @@ add_new_ue(module_id_t mod_idP, UE_info->UE_sched_ctrl[UE_id].round[cc_idP][j] = 8; UE_info->UE_sched_ctrl[UE_id].round_UL[cc_idP][j] = 0; } - - eNB_ulsch_info[mod_idP][cc_idP][UE_id].status = S_UL_WAITING; - eNB_dlsch_info[mod_idP][cc_idP][UE_id].status = S_DL_WAITING; + eNB_dlsch_info[mod_idP][cc_idP][UE_id].status = S_DL_NONE; LOG_D(MAC, "[eNB %d] Add UE_id %d on Primary CC_id %d: rnti %x\n", mod_idP, UE_id, @@ -2317,13 +2321,7 @@ rrc_mac_remove_ue(module_id_t mod_idP, ue_stats->total_pdu_bytes_rx = 0; ue_stats->total_num_pdus_rx = 0; ue_stats->total_num_errors_rx = 0; - eNB_ulsch_info[mod_idP][pCC_id][UE_id].rnti = NOT_A_RNTI; - eNB_ulsch_info[mod_idP][pCC_id][UE_id].status = S_UL_NONE; - eNB_ulsch_info[mod_idP][pCC_id][UE_id].serving_num = 0; - eNB_dlsch_info[mod_idP][pCC_id][UE_id].rnti = NOT_A_RNTI; eNB_dlsch_info[mod_idP][pCC_id][UE_id].status = S_DL_NONE; - eNB_dlsch_info[mod_idP][pCC_id][UE_id].serving_num = 0; - // check if this has an RA process active if (find_RA_id(mod_idP, pCC_id, diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index efef339702..4832456915 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -1063,24 +1063,6 @@ bytes_to_bsr_index(int32_t nbytes) return (i - 1); } -//----------------------------------------------------------------------------- -/* - * Add ue info in eNB_ulsch_info[module_idP][CC_id][UE_id] struct - */ -void -add_ue_ulsch_info(module_id_t module_idP, - int CC_id, - int UE_id, - sub_frame_t subframeP, - UE_ULSCH_STATUS status) -//----------------------------------------------------------------------------- -{ - eNB_ulsch_info[module_idP][CC_id][UE_id].rnti = UE_RNTI(module_idP, UE_id); - eNB_ulsch_info[module_idP][CC_id][UE_id].subframe = subframeP; - eNB_ulsch_info[module_idP][CC_id][UE_id].status = status; - eNB_ulsch_info[module_idP][CC_id][UE_id].serving_num++; -} - //----------------------------------------------------------------------------- /* * Parse MAC header from ULSCH @@ -1786,7 +1768,6 @@ schedule_ulsch_rnti(module_id_t module_idP, ul_req_tmp_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG; mac->ul_handle++; ul_req_tmp->sfn_sf = sched_frame << 4 | sched_subframeP; - add_ue_ulsch_info(module_idP, CC_id, UE_id, subframeP, S_UL_SCHEDULED); LOG_D(MAC, "[eNB %d] CC_id %d Frame %d, subframeP %d: Generated ULSCH DCI for " "next UE_id %d, format 0\n", @@ -2284,11 +2265,6 @@ void schedule_ulsch_rnti_emtc(module_id_t module_idP, (frameP * 10) + subframeP); ul_req_tmp->number_of_pdus++; eNB->ul_handle++; - add_ue_ulsch_info(module_idP, - CC_id, - UE_id, - subframeP, - S_UL_SCHEDULED); LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generated ULSCH DCI for next UE_id %d, format 0\n", module_idP, CC_id, diff --git a/openair2/LAYER2/MAC/mac.h b/openair2/LAYER2/MAC/mac.h index fe2f877fb3..c958d7cf85 100644 --- a/openair2/LAYER2/MAC/mac.h +++ b/openair2/LAYER2/MAC/mac.h @@ -43,7 +43,7 @@ #include #include -#include "COMMON/platform_constants.h" +#include "common/platform_constants.h" #include "LTE_BCCH-BCH-Message.h" #include "LTE_RadioResourceConfigCommon.h" #include "LTE_RadioResourceConfigCommonSIB.h" @@ -504,66 +504,18 @@ typedef struct { } __attribute__ ((__packed__)) ULDCH_PDU; /*!\brief RA process state*/ -typedef enum { - IDLE = 0, - MSG2, - WAITMSG3, - MSG4, - WAITMSG4ACK, - MSGCRNTI, - MSGCRNTI_ACK -} RA_state; - -/*!\brief UE ULSCH scheduling states*/ -typedef enum { - S_UL_NONE = 0, - S_UL_WAITING, - S_UL_SCHEDULED, - S_UL_BUFFERED, - S_UL_NUM_STATUS -} UE_ULSCH_STATUS; - +typedef enum { IDLE = 0, MSG2, WAITMSG3, MSG4, WAITMSG4ACK, MSGCRNTI, MSGCRNTI_ACK } RA_state; /*!\brief UE DLSCH scheduling states*/ -typedef enum { - S_DL_NONE = 0, - S_DL_WAITING, - S_DL_SCHEDULED, - S_DL_BUFFERED, - S_DL_NUM_STATUS -} UE_DLSCH_STATUS; - -/*!\brief scheduling policy for the contention-based access */ -typedef enum { - CBA_ES = 0, /// equal share of RB among groups w - CBA_ES_S, /// equal share of RB among groups with small allocation - CBA_PF, /// proportional fair (kind of) - CBA_PF_S, /// proportional fair (kind of) with small RB allocation - CBA_RS /// random allocation -} CBA_POLICY; - +typedef enum { S_DL_NONE = 0, S_DL_SCHEDULED } UE_DLSCH_STATUS; /*!\brief scheduler mode */ typedef enum { - SCHED_MODE_DEFAULT = 0, /// default cheduler - SCHED_MODE_FAIR_RR /// fair raund robin + SCHED_MODE_DEFAULT = 0, /// default cheduler + SCHED_MODE_FAIR_RR /// fair raund robin } SCHEDULER_MODES; - -/*! \brief temporary struct for ULSCH sched */ -typedef struct { - rnti_t rnti; - uint16_t subframe; - uint16_t serving_num; - UE_ULSCH_STATUS status; -} eNB_ULSCH_INFO; - /*! \brief temp struct for DLSCH sched */ typedef struct { - rnti_t rnti; - uint16_t weight; - uint16_t subframe; - uint16_t serving_num; UE_DLSCH_STATUS status; } eNB_DLSCH_INFO; - /*! \brief eNB overall statistics */ typedef struct { /// num BCCH PDU per CC @@ -1142,16 +1094,6 @@ typedef struct { int8_t crnti_harq_pid; } RA_t; - -/*! \brief subband bitmap confguration (for ALU icic algo purpose), in test phase */ -typedef struct { - uint8_t sbmap[13]; //13 = number of SB MAX for 100 PRB - uint8_t periodicity; - uint8_t first_subframe; - uint8_t sb_size; - uint8_t nb_active_sb; -} SBMAP_CONF; - /*! \brief UE_list_t is a "list" of users within UE_info_t. Especial useful in * the scheduler and to keep "classes" of users. */ typedef struct { @@ -1403,9 +1345,6 @@ typedef struct eNB_MAC_INST_s { /// UL handle uint32_t ul_handle; UE_info_t UE_info; - - ///subband bitmap configuration - SBMAP_CONF sbmap_conf; /// CCE table used to build DCI scheduling information int CCE_table[NFAPI_CC_MAX][800]; /// active flag for Other lcid @@ -1724,11 +1663,6 @@ typedef struct { eth_params_t eth_params_n; } UE_MAC_INST; -/*! \brief ID of the neighboring cells used for HO*/ -typedef struct { - uint16_t cell_ids[6]; - uint8_t n_adj_cells; -} neigh_cell_id_t; typedef struct { volatile uint8_t flag; diff --git a/openair2/LAYER2/MAC/mac_extern.h b/openair2/LAYER2/MAC/mac_extern.h index 212422898b..3d6bba1550 100644 --- a/openair2/LAYER2/MAC/mac_extern.h +++ b/openair2/LAYER2/MAC/mac_extern.h @@ -36,33 +36,12 @@ #include "mac.h" #include "RRC/LTE/rrc_defs.h" -extern const uint32_t BSR_TABLE[BSR_TABLE_SIZE]; -//extern uint32_t EBSR_Level[63]; -extern const uint32_t Extended_BSR_TABLE[BSR_TABLE_SIZE]; -//extern uint32_t Extended_BSR_TABLE[63]; ----currently not used - -extern const uint8_t cqi2fmt0_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE]; - -extern const uint8_t cqi2fmt1x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE]; - -extern const uint8_t cqi2fmt2x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE]; - extern UE_RRC_INST *UE_rrc_inst; extern UE_MAC_INST *UE_mac_inst; - -extern eNB_ULSCH_INFO eNB_ulsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][MAX_MOBILES_PER_ENB]; // eNBxUE = 8x8 -extern eNB_DLSCH_INFO eNB_dlsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][MAX_MOBILES_PER_ENB]; // eNBxUE = 8x8 - -extern unsigned char NB_INST; -extern unsigned char NB_eNB_INST; -extern uint16_t NB_UE_INST; -extern uint16_t NB_THREAD_INST; -extern unsigned char NB_RN_INST; +extern eNB_DLSCH_INFO eNB_dlsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][MAX_MOBILES_PER_ENB]; +extern int NB_UE_INST; extern const int cqi_to_mcs[16]; - -extern uint32_t RRC_CONNECTION_FLAG; - extern uint8_t rb_table[34]; extern rb_id_t mbms_rab_id; @@ -81,4 +60,10 @@ extern SCHEDULER_MODES global_scheduler_mode; #include "common/ran_context.h" extern RAN_CONTEXT_t RC; extern rb_id_t mbms_rab_id; + +static const uint32_t BSR_TABLE[BSR_TABLE_SIZE] = {0, 10, 12, 14, 17, 19, 22, 26, 31, 36, 42, 49, 57, 67, 78, 91, + 105, 125, 146, 171, 200, 234, 274, 321, 376, 440, 515, 603, 706, 826, 967, 1132, + 1326, 1552, 1817, 2127, 2490, 2915, 3413, 3995, 4677, 5467, 6411, 7505, 8787, 10287, 12043, 14099, + 16507, 19325, 22624, 26487, 31009, 36304, 42502, 49759, 58255, 68201, 79846, 93479, 109439, 128125, 150000, 300000}; + #endif //DEF_H diff --git a/openair2/LAYER2/MAC/mac_proto.h b/openair2/LAYER2/MAC/mac_proto.h index 6e9d36e242..af94ef3ae0 100644 --- a/openair2/LAYER2/MAC/mac_proto.h +++ b/openair2/LAYER2/MAC/mac_proto.h @@ -212,11 +212,6 @@ void mac_switch_node_function(module_id_t module_idP); int mac_init_global_param(void); -void mac_top_cleanup(void); - -void mac_UE_out_of_sync_ind(module_id_t module_idP, frame_t frameP, - uint16_t eNB_index); - void clear_nfapi_information(eNB_MAC_INST *eNB, int CC_idP, frame_t frameP, sub_frame_t subframeP); @@ -391,10 +386,6 @@ MCH_PDU *get_mch_sdu(module_id_t Mod_id, int CC_id, frame_t frame, void ue_mac_reset(module_id_t module_idP, uint8_t eNB_index); void ue_init_mac(module_id_t module_idP); void init_ue_sched_info(void); -void add_ue_ulsch_info(module_id_t module_idP, int CC_id, int UE_id, - sub_frame_t subframe, UE_ULSCH_STATUS status); -void add_ue_dlsch_info(module_id_t module_idP, int CC_id, int UE_id, - sub_frame_t subframe, UE_DLSCH_STATUS status, rnti_t rnti); int find_UE_id(module_id_t module_idP, rnti_t rnti); int find_RA_id(module_id_t mod_idP, int CC_idP, rnti_t rntiP); rnti_t UE_RNTI(module_id_t module_idP, int UE_id); @@ -488,8 +479,6 @@ uint32_t req_new_ulsch(module_id_t module_idP); uint32_t ue_get_SR(module_id_t module_idP, int CC_id, frame_t frameP, uint8_t eNB_id, rnti_t rnti, sub_frame_t subframe); -uint8_t get_ue_weight(module_id_t module_idP, int CC_id, int UE_id); - // UE functions void mac_out_of_sync_ind(module_id_t module_idP, frame_t frameP, uint16_t CH_index); diff --git a/openair2/LAYER2/MAC/mac_vars.h b/openair2/LAYER2/MAC/mac_vars.h deleted file mode 100644 index 3b51820171..0000000000 --- a/openair2/LAYER2/MAC/mac_vars.h +++ /dev/null @@ -1,141 +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 vars.h -* \brief mac vars -* \author Navid Nikaein and Raymond Knopp -* \date 2010 - 2014 -* \version 1.0 -* \email navid.nikaein@eurecom.fr -* @ingroup _mac -*/ - - -#ifndef __MAC_VARS_H__ -#define __MAC_VARS_H__ -#include "PHY/defs_common.h" -#include "mac.h" -#include "COMMON/mac_rrc_primitives.h" - -const uint32_t BSR_TABLE[BSR_TABLE_SIZE] = { - 0, 10, 12, 14, 17, 19, 22, 26, 31, 36, 42, 49, 57, 67, 78, 91, - 105, 125, 146, 171, 200, 234, 274, 321, 376, 440, 515, 603, 706, 826, - 967, 1132, - 1326, 1552, 1817, 2127, 2490, 2915, 3413, 3995, 4677, 5467, 6411, 7505, - 8787, 10287, 12043, 14099, - 16507, 19325, 22624, 26487, 31009, 36304, 42502, 49759, 58255, 68201, - 79846, 93479, 109439, 128125, 150000, 300000 -}; - -// extended bsr table--currently not used -const uint32_t Extended_BSR_TABLE[BSR_TABLE_SIZE] = { - 0, 10, 13, 16, 19, 23, 29, 35, 43, 53, 65, 80, 98, 120, 147, - 181, 223, 274, 337, 414, 509, 625, 769, 945, 1162, 1429, - 1757, 2161, 2657, 3267, 4017, 4940, 6074, 7469, 9185, - 11294, 13888, 17077, 20999, 25822, 31752, 39045, 48012, - 59039, 72598, 89272, 109774, 134986, 165989, 204111, - 250990, 308634, 379519, 466683, 573866, 705666, 867737, - 1067031, 1312097, 1613447, 1984009, 2439678, 3000000, - 6000000 -}; - -//#define MAX_SIZE_OF_AGG3 576 -//#define MAX_SIZE_OF_AGG2 288 -//#define MAX_SIZE_OF_AGG1 144 -//#define MAX_SIZE_OF_AGG0 72 - -/* - * If the CQI is low, then scheduler will use a higher aggregation level and lower aggregation level otherwise - * this is also dependent to transmission mode, where an offset could be defined - */ -// the follwoing three tables are calibrated for TXMODE 1 and 2 -const uint8_t cqi2fmt0_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE] = { - {3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, // 1.4_DCI0_CRC_Size= 37 bits - //{3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE = 41 - {3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE = 41 - {3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0}, // 10_DCI0_CRC_SIZE = 43 - {3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0} // 20_DCI0_CRC_SIZE = 44 -}; - -const uint8_t cqi2fmt1x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE] = { - {3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, // 1.4_DCI0_CRC_Size < 38 bits - {3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE < 43 - {3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0}, // 10_DCI0_CRC_SIZE < 47 - {3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0} // 20_DCI0_CRC_SIZE < 55 -}; - -const uint8_t cqi2fmt2x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE] = { - {3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, // 1.4_DCI0_CRC_Size= 47 bits - {3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE = 55 - {3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0}, // 10_DCI0_CRC_SIZE = 59 - {3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0} // 20_DCI0_CRC_SIZE = 64 -}; - -//uint32_t EBSR_Level[63]={0,10,13,16,19,23,29,35,43,53,65,80,98,120,147,181}; - - -uint32_t RRC_CONNECTION_FLAG; - -UE_MAC_INST *UE_mac_inst = NULL; //[NB_MODULE_MAX]; -MAC_RLC_XFACE *Mac_rlc_xface; - -/// Primary component carrier index of eNB -int pCC_id[NUMBER_OF_eNB_MAX]; - - -eNB_ULSCH_INFO eNB_ulsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][MAX_MOBILES_PER_ENB]; // eNBxUE = 8x8 -eNB_DLSCH_INFO eNB_dlsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][MAX_MOBILES_PER_ENB]; // eNBxUE = 8x8 - - - unsigned char NB_eNB_INST = 0; - uint16_t NB_UE_INST = 0; - uint16_t NB_THREAD_INST = 0; - unsigned char NB_RN_INST = 0; - unsigned char NB_INST = 0; - - -DCI0_5MHz_TDD_1_6_t UL_alloc_pdu; - -DCI1A_5MHz_TDD_1_6_t DLSCH_alloc_pdu1A; -DCI1A_5MHz_TDD_1_6_t RA_alloc_pdu; -DCI1A_5MHz_TDD_1_6_t BCCH_alloc_pdu; - -DCI1A_5MHz_TDD_1_6_t CCCH_alloc_pdu; -DCI1_5MHz_TDD_t DLSCH_alloc_pdu; -DCI1C_5MHz_t MCCH_alloc_pdu; - -DCI0_5MHz_FDD_t UL_alloc_pdu_fdd; - -DCI1A_5MHz_FDD_t DLSCH_alloc_pdu1A_fdd; -DCI1A_5MHz_FDD_t RA_alloc_pdu_fdd; -DCI1A_5MHz_FDD_t BCCH_alloc_pdu_fdd; - -DCI1A_5MHz_FDD_t CCCH_alloc_pdu_fdd; -DCI1_5MHz_FDD_t DLSCH_alloc_pdu_fdd; - -DCI2_5MHz_2A_TDD_t DLSCH_alloc_pdu1; -DCI2_5MHz_2A_TDD_t DLSCH_alloc_pdu2; - -DCI1E_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu1E; - -mac_rlc_am_muilist_t rlc_am_mui; -SCHEDULER_MODES global_scheduler_mode; -#endif diff --git a/openair2/LAYER2/MAC/main.c b/openair2/LAYER2/MAC/main.c index fa647454ba..4c46238b6c 100644 --- a/openair2/LAYER2/MAC/main.c +++ b/openair2/LAYER2/MAC/main.c @@ -249,20 +249,6 @@ int rlcmac_init_global_param(void) return 0; } - -void mac_top_cleanup(void) -{ - - if (NB_UE_INST > 0) { - free(UE_mac_inst); - } - - if (RC.nb_macrlc_inst > 0) { - free(RC.mac); - } - -} - int l2_init_eNB(void) { diff --git a/openair2/LAYER2/MAC/main_ue.c b/openair2/LAYER2/MAC/main_ue.c index 5ea2d26abd..e67d85dd36 100644 --- a/openair2/LAYER2/MAC/main_ue.c +++ b/openair2/LAYER2/MAC/main_ue.c @@ -59,13 +59,6 @@ void dl_phy_sync_success(module_id_t module_idP, frame_t frameP, unsigned char e } } -void -mac_UE_out_of_sync_ind(module_id_t module_idP, frame_t frameP, - uint16_t eNB_index) { - // Mac_rlc_xface->mac_out_of_sync_ind(Mod_id, frameP, eNB_index); -} - - int mac_top_init_ue(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, uint8_t HO_active) { diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h index 3648ad2c91..1b47ea6ede 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h @@ -41,24 +41,6 @@ extern const uint8_t nr_slots_per_frame[5]; extern dci_pdu_rel15_t *def_dci_pdu_rel15; -/* extern const uint32_t BSR_TABLE[BSR_TABLE_SIZE]; -extern const uint32_t Extended_BSR_TABLE[BSR_TABLE_SIZE]; -extern const uint8_t cqi2fmt0_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE]; -extern const uint8_t cqi2fmt1x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE]; -extern const uint8_t cqi2fmt2x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE]; -extern UE_RRC_INST *UE_rrc_inst; -extern const int cqi_to_mcs[16]; -extern uint32_t RRC_CONNECTION_FLAG; -extern uint8_t rb_table[34]; -extern mac_rlc_am_muilist_t rlc_am_mui; -extern SCHEDULER_MODES global_scheduler_mode; -extern unsigned char NB_UE_INST;*/ - - -extern unsigned char NB_INST; -extern unsigned char NB_eNB_INST; -extern unsigned char NB_RN_INST; - /* Scheduler */ extern RAN_CONTEXT_t RC; extern uint8_t nfapi_mode; @@ -67,7 +49,6 @@ extern SCHEDULER_MODES global_scheduler_mode; /*#if defined(PRE_SCD_THREAD) extern const int cqi_to_mcs[16]; -extern uint32_t RRC_CONNECTION_FLAG; extern uint8_t rb_table[34]; #if defined(PRE_SCD_THREAD) diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index e1ec0f6baf..40de95be60 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -31,7 +31,7 @@ */ #include "COMMON/platform_types.h" -#include "COMMON/platform_constants.h" +#include "common/platform_constants.h" #include "common/ran_context.h" #include "common/utils/nr/nr_common.h" #include "common/utils/LOG/log.h" diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 25be7f7c17..37435664da 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -44,7 +44,7 @@ /* Commmon */ #include "radio/COMMON/common_lib.h" -#include "COMMON/platform_constants.h" +#include "common/platform_constants.h" #include "common/ran_context.h" #include "collection/linear_alloc.h" diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c index e39e1dc090..03ff38611a 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c @@ -45,7 +45,7 @@ #include "otg_rx.h" #include "common/utils/LOG/log.h" #include -#include "platform_constants.h" +#include "common/platform_constants.h" #include "nfapi/oai_integration/vendor_ext.h" #include "common/utils/LOG/vcd_signal_dumper.h" #include "common/ngran_types.h" diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.h b/openair2/LAYER2/PDCP_v10.1.0/pdcp.h index 898bf984de..944e641358 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.h +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.h @@ -36,7 +36,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- #include "RRC/LTE/rrc_defs.h" -#include "COMMON/platform_constants.h" +#include "common/platform_constants.h" #include "COMMON/platform_types.h" #include "LTE_DRB-ToAddMod.h" #include "LTE_DRB-ToAddModList.h" diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c index d6e022f4f1..a909343965 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c @@ -57,7 +57,7 @@ extern int otg_enabled; #include "UTIL/OTG/otg_tx.h" #include "nfapi/oai_integration/vendor_ext.h" #include "common/utils/LOG/vcd_signal_dumper.h" -#include "platform_constants.h" +#include "common/platform_constants.h" #include "pdcp.h" #include "assertions.h" diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_primitives.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_primitives.c index 77d3cf3857..675fbd8a57 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_primitives.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_primitives.c @@ -28,7 +28,7 @@ #include "common/utils/LOG/log.h" #include "platform_types.h" -#include "platform_constants.h" +#include "common/platform_constants.h" #include "pdcp.h" #include "pdcp_primitives.h" diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c index ddc7bf85e8..aed00e578a 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c @@ -23,7 +23,7 @@ #define RLC_AM_C 1 //----------------------------------------------------------------------------- #include "platform_types.h" -#include "platform_constants.h" +#include "common/platform_constants.h" //----------------------------------------------------------------------------- #include "assertions.h" diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_entity.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_entity.h index 95c47943a4..e6bcd0f4ba 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_entity.h +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_entity.h @@ -38,7 +38,7 @@ //----------------------------------------------------------------------------- # include # include "platform_types.h" -# include "platform_constants.h" +#include "common/platform_constants.h" # include "list.h" # include "rlc_primitives.h" # include "rlc_def_lte.h" diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_init.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_init.h index 9de54cd3d5..df140f0326 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_init.h +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_init.h @@ -39,7 +39,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- #include "platform_types.h" -#include "platform_constants.h" +#include "common/platform_constants.h" //#include "PHY/defs.h" diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.h index 18e423312c..f86b1810ca 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.h +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.h @@ -39,7 +39,7 @@ # include "UTIL/MEM/mem_block.h" //----------------------------------------------------------------------------- #include "platform_types.h" -#include "platform_constants.h" +#include "common/platform_constants.h" //#include "PHY/defs.h" //----------------------------------------------------------------------------- diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_status_report.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_status_report.h index a84b25c8e5..861e152123 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_status_report.h +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_status_report.h @@ -39,7 +39,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- #include "platform_types.h" -#include "platform_constants.h" +#include "common/platform_constants.h" //#include "PHY/defs.h" //----------------------------------------------------------------------------- diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_structs.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_structs.h index 147fd44d07..cc2e3b9c1b 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_structs.h +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_structs.h @@ -32,7 +32,7 @@ # define __RLC_AM_STRUCTS_H__ # include "platform_types.h" -# include "platform_constants.h" +#include "common/platform_constants.h" # include "list.h" # include "mem_block.h" # include "rlc_am_constants.h" diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c index 7aead2f30a..7e3e120477 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c @@ -24,7 +24,7 @@ //----------------------------------------------------------------------------- //#include "rtos_header.h" #include "platform_types.h" -#include "platform_constants.h" +#include "common/platform_constants.h" //----------------------------------------------------------------------------- #include "rlc_am.h" #include "LAYER2/MAC/mac_extern.h" diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_reordering.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_reordering.c index d161d29a65..e46f9c5377 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_reordering.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_reordering.c @@ -23,7 +23,7 @@ #define RLC_AM_TIMER_POLL_REORDERING_C 1 //----------------------------------------------------------------------------- #include "platform_types.h" -#include "platform_constants.h" +#include "common/platform_constants.h" //----------------------------------------------------------------------------- #include "rlc_am.h" # include "LAYER2/MAC/mac_extern.h" diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_status_prohibit.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_status_prohibit.c index aae7465bcf..7359b6a07f 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_status_prohibit.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_status_prohibit.c @@ -23,7 +23,7 @@ #define RLC_AM_TIMER_STATUS_PROHIBIT_C 1 //----------------------------------------------------------------------------- #include "platform_types.h" -#include "platform_constants.h" +#include "common/platform_constants.h" //----------------------------------------------------------------------------- #include "rlc_am.h" #include "LAYER2/MAC/mac_extern.h" diff --git a/openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm.c b/openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm.c index f079696aa9..d699d1d6a4 100644 --- a/openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm.c +++ b/openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm.c @@ -23,7 +23,7 @@ #define RLC_TM_C 1 //----------------------------------------------------------------------------- #include "platform_types.h" -#include "platform_constants.h" +#include "common/platform_constants.h" //----------------------------------------------------------------------------- #include "rlc_tm.h" #include "mac_primitives.h" diff --git a/openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm_entity.h b/openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm_entity.h index 3c2f1804be..b6795d4488 100644 --- a/openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm_entity.h +++ b/openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm_entity.h @@ -32,7 +32,7 @@ # define __RLC_TM_ENTITY_H__ //----------------------------------------------------------------------------- # include "platform_types.h" -# include "platform_constants.h" +#include "common/platform_constants.h" # include "rlc_tm_structs.h" # include "rlc_def.h" //----------------------------------------------------------------------------- diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c index 1d40b12cc8..a77280ffd2 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c @@ -24,7 +24,7 @@ //----------------------------------------------------------------------------- //#include "rtos_header.h" #include "platform_types.h" -#include "platform_constants.h" +#include "common/platform_constants.h" //----------------------------------------------------------------------------- #if ENABLE_ITTI #include "intertask_interface.h" diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_entity.h b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_entity.h index 7bfa3d60ff..34ead65822 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_entity.h +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_entity.h @@ -33,7 +33,7 @@ # include # include "platform_types.h" -# include "platform_constants.h" +#include "common/platform_constants.h" # include "list.h" # include "rlc_primitives.h" # include "rlc_def.h" diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c index 7b77152e32..5252a8a121 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c @@ -23,7 +23,7 @@ #define RLC_UM_SEGMENT_C 1 //----------------------------------------------------------------------------- #include "platform_types.h" -#include "platform_constants.h" +#include "common/platform_constants.h" //----------------------------------------------------------------------------- #include #include "assertions.h" diff --git a/openair2/LAYER2/RLC/rlc.h b/openair2/LAYER2/RLC/rlc.h index 1e17ff96bf..561a664d85 100644 --- a/openair2/LAYER2/RLC/rlc.h +++ b/openair2/LAYER2/RLC/rlc.h @@ -36,7 +36,7 @@ # define __RLC_H__ # include "platform_types.h" -# include "COMMON/platform_constants.h" +#include "common/platform_constants.h" # include "hashtable.h" # include "rlc_am.h" # include "rlc_um.h" diff --git a/openair2/LAYER2/RLC/rlc_mac.c b/openair2/LAYER2/RLC/rlc_mac.c index 0e1cb89fd7..2e308fc0e1 100644 --- a/openair2/LAYER2/RLC/rlc_mac.c +++ b/openair2/LAYER2/RLC/rlc_mac.c @@ -37,6 +37,7 @@ #include "hashtable.h" #include "assertions.h" #include "common/utils/LOG/vcd_signal_dumper.h" +#include "openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h" //#define DEBUG_MAC_INTERFACE 1 diff --git a/openair2/LAYER2/RLC/rlc_primitives.h b/openair2/LAYER2/RLC/rlc_primitives.h index bb83852775..0e751855d5 100644 --- a/openair2/LAYER2/RLC/rlc_primitives.h +++ b/openair2/LAYER2/RLC/rlc_primitives.h @@ -34,7 +34,7 @@ # include # include # include "platform_types.h" -# include "platform_constants.h" +#include "common/platform_constants.h" # include "mem_block.h" diff --git a/openair2/MCE_APP/mce_config.h b/openair2/MCE_APP/mce_config.h index 3078b64e49..dbed65221a 100644 --- a/openair2/MCE_APP/mce_config.h +++ b/openair2/MCE_APP/mce_config.h @@ -36,7 +36,7 @@ #include "commonDef.h" #include "platform_types.h" -#include "platform_constants.h" +#include "common/platform_constants.h" #include "PHY/impl_defs_top.h" #include "PHY/defs_eNB.h" #include "s1ap_messages_types.h" diff --git a/openair2/NETWORK_DRIVER/MESH/netlink.c b/openair2/NETWORK_DRIVER/MESH/netlink.c index 4908e00758..7c4223e4e8 100644 --- a/openair2/NETWORK_DRIVER/MESH/netlink.c +++ b/openair2/NETWORK_DRIVER/MESH/netlink.c @@ -39,7 +39,7 @@ #include "local.h" #include "proto_extern.h" -//#include "platform_constants.h" +//#include "common/platform_constants.h" //#define NETLINK_DEBUG 1 diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.h b/openair2/NR_PHY_INTERFACE/NR_IF_Module.h index dec6bf5b4e..1fb08d6ba8 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.h +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.h @@ -36,7 +36,7 @@ #include #include "nfapi_nr_interface.h" #include "nfapi_nr_interface_scf.h" -#include "platform_constants.h" +#include "common/platform_constants.h" #include "platform_types.h" #define MAX_NUM_DL_PDU 100 diff --git a/openair2/RRC/LITE/rrc_common.c b/openair2/RRC/LITE/rrc_common.c deleted file mode 100644 index f0c4e94c99..0000000000 --- a/openair2/RRC/LITE/rrc_common.c +++ /dev/null @@ -1,466 +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 rrc_common.c - * \brief rrc common procedures for eNB and UE - * \author Navid Nikaein and Raymond Knopp - * \date 2011 - 2014 - * \version 1.0 - * \company Eurecom - * \email: navid.nikaein@eurecom.fr and raymond.knopp@eurecom.fr - */ - -#include "defs.h" -#include "extern.h" -#include "LAYER2/MAC/extern.h" -#include "COMMON/openair_defs.h" -#include "COMMON/platform_types.h" -#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" -#include "LAYER2/RLC/rlc.h" -#include "COMMON/mac_rrc_primitives.h" -#include "UTIL/LOG/log.h" -#include "asn1_msg.h" -#include "pdcp.h" -#include "UTIL/LOG/vcd_signal_dumper.h" -#include "rrc_eNB_UE_context.h" -#include "common/ran_context.h" - -#ifdef LOCALIZATION -#include -#endif - -#define DEBUG_RRC 1 -extern RAN_CONTEXT_t RC; -extern UE_MAC_INST *UE_mac_inst; - -extern mui_t rrc_eNB_mui; - -//configure BCCH & CCCH Logical Channels and associated rrc_buffers, configure associated SRBs -//----------------------------------------------------------------------------- -void -openair_rrc_on( - const protocol_ctxt_t* const ctxt_pP -) -//----------------------------------------------------------------------------- -{ - unsigned short i; - int CC_id; - - if (ctxt_pP->enb_flag == ENB_FLAG_YES) { - LOG_I(RRC, PROTOCOL_RRC_CTXT_FMT" OPENAIR RRC IN....\n", - PROTOCOL_RRC_CTXT_ARGS(ctxt_pP)); - for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { - rrc_config_buffer (&RC.rrc[ctxt_pP->module_id]->carrier[CC_id].SI, BCCH, 1); - RC.rrc[ctxt_pP->module_id]->carrier[CC_id].SI.Active = 1; - rrc_config_buffer (&RC.rrc[ctxt_pP->module_id]->carrier[CC_id].Srb0, CCCH, 1); - RC.rrc[ctxt_pP->module_id]->carrier[CC_id].Srb0.Active = 1; - } - } else { - LOG_I(RRC, PROTOCOL_RRC_CTXT_FMT" OPENAIR RRC IN....\n", - PROTOCOL_RRC_CTXT_ARGS(ctxt_pP)); - - for (i = 0; i < NB_eNB_INST; i++) { - LOG_D(RRC, PROTOCOL_RRC_CTXT_FMT" Activating CCCH (eNB %d)\n", - PROTOCOL_RRC_CTXT_ARGS(ctxt_pP), i); - UE_rrc_inst[ctxt_pP->module_id].Srb0[i].Srb_id = CCCH; - memcpy (&UE_rrc_inst[ctxt_pP->module_id].Srb0[i].Lchan_desc[0], &CCCH_LCHAN_DESC, LCHAN_DESC_SIZE); - memcpy (&UE_rrc_inst[ctxt_pP->module_id].Srb0[i].Lchan_desc[1], &CCCH_LCHAN_DESC, LCHAN_DESC_SIZE); - rrc_config_buffer (&UE_rrc_inst[ctxt_pP->module_id].Srb0[i], CCCH, 1); - UE_rrc_inst[ctxt_pP->module_id].Srb0[i].Active = 1; - } - } -} - -//----------------------------------------------------------------------------- -int -rrc_init_global_param( - void -) -//----------------------------------------------------------------------------- -{ - - rrc_rlc_register_rrc (rrc_data_ind, NULL); //register with rlc - - DCCH_LCHAN_DESC.transport_block_size = 4; - DCCH_LCHAN_DESC.max_transport_blocks = 16; - DCCH_LCHAN_DESC.Delay_class = 1; - DTCH_DL_LCHAN_DESC.transport_block_size = 52; - DTCH_DL_LCHAN_DESC.max_transport_blocks = 20; - DTCH_DL_LCHAN_DESC.Delay_class = 1; - DTCH_UL_LCHAN_DESC.transport_block_size = 52; - DTCH_UL_LCHAN_DESC.max_transport_blocks = 20; - DTCH_UL_LCHAN_DESC.Delay_class = 1; - - Rlc_info_um.rlc_mode = RLC_MODE_UM; - Rlc_info_um.rlc.rlc_um_info.timer_reordering = 5; - Rlc_info_um.rlc.rlc_um_info.sn_field_length = 10; - Rlc_info_um.rlc.rlc_um_info.is_mXch = 0; - //Rlc_info_um.rlc.rlc_um_info.sdu_discard_mode=16; - - Rlc_info_am_config.rlc_mode = RLC_MODE_AM; - Rlc_info_am_config.rlc.rlc_am_info.max_retx_threshold = 50; - Rlc_info_am_config.rlc.rlc_am_info.poll_pdu = 8; - Rlc_info_am_config.rlc.rlc_am_info.poll_byte = 1000; - Rlc_info_am_config.rlc.rlc_am_info.t_poll_retransmit = 15; - Rlc_info_am_config.rlc.rlc_am_info.t_reordering = 50; - Rlc_info_am_config.rlc.rlc_am_info.t_status_prohibit = 10; - - return 0; -} - -//----------------------------------------------------------------------------- -void -rrc_config_buffer( - SRB_INFO* Srb_info, - uint8_t Lchan_type, - uint8_t Role -) -//----------------------------------------------------------------------------- -{ - - Srb_info->Rx_buffer.payload_size = 0; - Srb_info->Tx_buffer.payload_size = 0; -} - - -//----------------------------------------------------------------------------- -void -rrc_t310_expiration( - const protocol_ctxt_t* const ctxt_pP, - const uint8_t eNB_index -) -//----------------------------------------------------------------------------- -{ - - if (UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].State != RRC_CONNECTED) { - LOG_D(RRC, "Timer 310 expired, going to RRC_IDLE\n"); - UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].State = RRC_IDLE; - UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].UE_index = 0xffff; - UE_rrc_inst[ctxt_pP->module_id].Srb0[eNB_index].Rx_buffer.payload_size = 0; - UE_rrc_inst[ctxt_pP->module_id].Srb0[eNB_index].Tx_buffer.payload_size = 0; - UE_rrc_inst[ctxt_pP->module_id].Srb1[eNB_index].Srb_info.Rx_buffer.payload_size = 0; - UE_rrc_inst[ctxt_pP->module_id].Srb1[eNB_index].Srb_info.Tx_buffer.payload_size = 0; - - if (UE_rrc_inst[ctxt_pP->module_id].Srb2[eNB_index].Active == 1) { - msg ("[RRC Inst %d] eNB_index %d, Remove RB %d\n ", ctxt_pP->module_id, eNB_index, - UE_rrc_inst[ctxt_pP->module_id].Srb2[eNB_index].Srb_info.Srb_id); - rrc_pdcp_config_req (ctxt_pP, - SRB_FLAG_YES, - CONFIG_ACTION_REMOVE, - UE_rrc_inst[ctxt_pP->module_id].Srb2[eNB_index].Srb_info.Srb_id, - 0); - rrc_rlc_config_req (ctxt_pP, - SRB_FLAG_YES, - MBMS_FLAG_NO, - CONFIG_ACTION_REMOVE, - UE_rrc_inst[ctxt_pP->module_id].Srb2[eNB_index].Srb_info.Srb_id, - Rlc_info_um); - UE_rrc_inst[ctxt_pP->module_id].Srb2[eNB_index].Active = 0; - UE_rrc_inst[ctxt_pP->module_id].Srb2[eNB_index].Status = IDLE; - UE_rrc_inst[ctxt_pP->module_id].Srb2[eNB_index].Next_check_frame = 0; - } - } else { // Restablishment procedure - LOG_D(RRC, "Timer 310 expired, trying RRCRestablishment ...\n"); - } -} - -//----------------------------------------------------------------------------- -RRC_status_t -rrc_rx_tx( - protocol_ctxt_t* const ctxt_pP, - const uint8_t enb_indexP, - const int CC_id -) -//----------------------------------------------------------------------------- -{ - //uint8_t UE_id; - int32_t current_timestamp_ms, ref_timestamp_ms; - struct timeval ts; - struct rrc_eNB_ue_context_s *ue_context_p = NULL,*ue_to_be_removed = NULL; - -#ifdef LOCALIZATION - double estimated_distance; - protocol_ctxt_t ctxt; -#endif - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX,VCD_FUNCTION_IN); - - if(ctxt_pP->enb_flag == ENB_FLAG_NO) { - // check timers - - if (UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T300_active == 1) { - if ((UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T300_cnt % 10) == 0) - LOG_D(RRC, - "[UE %d][RAPROC] Frame %d T300 Count %d ms\n", ctxt_pP->module_id, ctxt_pP->frame, UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T300_cnt); - - if (UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T300_cnt - == T300[UE_rrc_inst[ctxt_pP->module_id].sib2[enb_indexP]->ue_TimersAndConstants.t300]) { - UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T300_active = 0; - // ALLOW CCCH to be used - UE_rrc_inst[ctxt_pP->module_id].Srb0[enb_indexP].Tx_buffer.payload_size = 0; - rrc_ue_generate_RRCConnectionRequest (ctxt_pP, enb_indexP); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX,VCD_FUNCTION_OUT); - return (RRC_ConnSetup_failed); - } - - UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T300_cnt++; - } - - if ((UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].SIStatus&2)>0) { - if (UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].N310_cnt - == N310[UE_rrc_inst[ctxt_pP->module_id].sib2[enb_indexP]->ue_TimersAndConstants.n310]) { - LOG_I(RRC,"Activating T310\n"); - UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T310_active = 1; - } - } else { // in case we have not received SIB2 yet - /* if (UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].N310_cnt == 100) { - UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].N310_cnt = 0; - - }*/ - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX,VCD_FUNCTION_OUT); - return RRC_OK; - } - - if (UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T310_active == 1) { - if (UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].N311_cnt - == N311[UE_rrc_inst[ctxt_pP->module_id].sib2[enb_indexP]->ue_TimersAndConstants.n311]) { - UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T310_active = 0; - UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].N311_cnt = 0; - } - - if ((UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T310_cnt % 10) == 0) { - LOG_D(RRC, "[UE %d] Frame %d T310 Count %d ms\n", ctxt_pP->module_id, ctxt_pP->frame, UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T310_cnt); - } - - if (UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T310_cnt == T310[UE_rrc_inst[ctxt_pP->module_id].sib2[enb_indexP]->ue_TimersAndConstants.t310]) { - UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T310_active = 0; - rrc_t310_expiration (ctxt_pP, enb_indexP); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX,VCD_FUNCTION_OUT); - LOG_I(RRC,"Returning RRC_PHY_RESYNCH: T310 expired\n"); - return RRC_PHY_RESYNCH; - } - - UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T310_cnt++; - } - - if (UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T304_active==1) { - if ((UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T304_cnt % 10) == 0) - LOG_D(RRC,"[UE %d][RAPROC] Frame %d T304 Count %d ms\n",ctxt_pP->module_id,ctxt_pP->frame, - UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T304_cnt); - - if (UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T304_cnt == 0) { - UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T304_active = 0; - UE_rrc_inst[ctxt_pP->module_id].HandoverInfoUe.measFlag = 1; - LOG_E(RRC,"[UE %d] Handover failure..initiating connection re-establishment procedure... \n", - ctxt_pP->module_id); - //Implement 36.331, section 5.3.5.6 here - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX,VCD_FUNCTION_OUT); - return(RRC_Handover_failed); - } - - UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T304_cnt--; - } - - // Layer 3 filtering of RRC measurements - if (UE_rrc_inst[ctxt_pP->module_id].QuantityConfig[0] != NULL) { - ue_meas_filtering(ctxt_pP,enb_indexP); - } - - ue_measurement_report_triggering(ctxt_pP,enb_indexP); - - if (UE_rrc_inst[ctxt_pP->module_id].Info[0].handoverTarget > 0) { - LOG_I(RRC,"[UE %d] Frame %d : RRC handover initiated\n", ctxt_pP->module_id, ctxt_pP->frame); - } - - if((UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].State == RRC_HO_EXECUTION) && - (UE_rrc_inst[ctxt_pP->module_id].HandoverInfoUe.targetCellId != 0xFF)) { - UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].State= RRC_IDLE; - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX,VCD_FUNCTION_OUT); - return(RRC_HO_STARTED); - } - - } else { // eNB - check_handovers(ctxt_pP); - // counetr, and get the value and aggregate - - - // check for UL failure - RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(RC.rrc[ctxt_pP->module_id]->rrc_ue_head)) { - LOG_D(RRC,"SFN.SN %d.%d => release timer %d/%d\n",ctxt_pP->frame,ctxt_pP->subframe, - ue_context_p->ue_context.ue_release_timer,ue_context_p->ue_context.ue_release_timer_thres); - if ((ctxt_pP->frame == 0) && (ctxt_pP->subframe==0)) { - if (ue_context_p->ue_context.Initialue_identity_s_TMSI.presence == true) { - LOG_I(RRC,"UE rnti %x:S-TMSI %x failure timer %d/20000\n", - ue_context_p->ue_context.rnti, - ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi, - ue_context_p->ue_context.ul_failure_timer); - } - else { - LOG_I(RRC,"UE rnti %x failure timer %d/20000\n", - ue_context_p->ue_context.rnti, - ue_context_p->ue_context.ul_failure_timer); - } - } - if (ue_context_p->ue_context.ul_failure_timer>0) { - ue_context_p->ue_context.ul_failure_timer++; - if (ue_context_p->ue_context.ul_failure_timer >= 20000) { - // remove UE after 20 seconds after MAC has indicated UL failure - LOG_I(RRC,"Removing UE %x instance (failure)\n",ue_context_p->ue_context.rnti); - ue_to_be_removed = ue_context_p; - break; - } - } - if (ue_context_p->ue_context.ue_release_timer>0) { - ue_context_p->ue_context.ue_release_timer++; - if (ue_context_p->ue_context.ue_release_timer >= - ue_context_p->ue_context.ue_release_timer_thres) { - LOG_I(RRC,"Removing UE %x instance (release timer %d)\n",ue_context_p->ue_context.rnti,ue_context_p->ue_context.ue_release_timer); - ue_to_be_removed = ue_context_p; - exit(-1); - break; - } - } - } - if (ue_to_be_removed) - rrc_eNB_free_UE(ctxt_pP->module_id,ue_to_be_removed); - -#ifdef RRC_LOCALIZATION - - /* for the localization, only primary CC_id might be relevant*/ - gettimeofday(&ts, NULL); - current_timestamp_ms = ts.tv_sec * 1000 + ts.tv_usec / 1000; - ref_timestamp_ms = RC.rrc[ctxt_pP->module_id]->reference_timestamp_ms; - RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(RC.rrc[ctxt_pP->module_id]->rrc_ue_head)) { - ctxt = *ctxt_pP; - ctxt.rnti = ue_context_p->ue_context.rnti; - estimated_distance = rrc_get_estimated_ue_distance( - &ctxt, - CC_id, - RC.rrc[ctxt_pP->module_id]->loc_type); - - if ((current_timestamp_ms - ref_timestamp_ms > RC.rrc[ctxt_pP->module_id]->aggregation_period_ms) && - estimated_distance != -1) { - LOG_D(LOCALIZE, " RRC [UE/id %d -> eNB/id %d] timestamp %d frame %d estimated r = %f\n", - ctxt.rnti, - ctxt_pP->module_id, - current_timestamp_ms, - ctxt_pP->frame, - estimated_distance); - LOG_D(LOCALIZE, " RRC status %d\n", ue_context_p->ue_context.StatusRrc); - push_front(&RC.rrc[ctxt_pP->module_id]->loc_list, - estimated_distance); - RC.rrc[ctxt_pP->module_id]->reference_timestamp_ms = current_timestamp_ms; - } - } - -#endif - (void)ts; /* remove gcc warning "unused variable" */ - (void)ref_timestamp_ms; /* remove gcc warning "unused variable" */ - (void)current_timestamp_ms; /* remove gcc warning "unused variable" */ - } - - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX,VCD_FUNCTION_OUT); - return (RRC_OK); -} - -//----------------------------------------------------------------------------- -long -binary_search_int( - int elements[], - long numElem, - int value -) -//----------------------------------------------------------------------------- -{ - long first, last, middle, search = -1; - first = 0; - last = numElem-1; - middle = (first+last)/2; - - if(value < elements[0]) { - return first; - } - - if(value > elements[last]) { - return last; - } - - while (first <= last) { - if (elements[middle] < value) { - first = middle+1; - } else if (elements[middle] == value) { - search = middle+1; - break; - } else { - last = middle -1; - } - - middle = (first+last)/2; - } - - if (first > last) { - LOG_E(RRC,"Error in binary search!"); - } - - return search; -} - -/* This is a binary search routine which operates on an array of floating - point numbers and returns the index of the range the value lies in - Used for RSRP and RSRQ measurement mapping. Can potentially be used for other things -*/ -//----------------------------------------------------------------------------- -long -binary_search_float( - float elements[], - long numElem, - float value -) -//----------------------------------------------------------------------------- -{ - long first, last, middle; - first = 0; - last = numElem-1; - middle = (first+last)/2; - - if(value <= elements[0]) { - return first; - } - - if(value >= elements[last]) { - return last; - } - - while (last - first > 1) { - if (elements[middle] > value) { - last = middle; - } else { - first = middle; - } - - middle = (first+last)/2; - } - - if (first < 0 || first >= numElem) { - LOG_E(RRC,"\n Error in binary search float!"); - } - - return first; -} diff --git a/openair2/RRC/LTE/L2_interface_ue.c b/openair2/RRC/LTE/L2_interface_ue.c index 71f9abc63e..e7f18d355f 100644 --- a/openair2/RRC/LTE/L2_interface_ue.c +++ b/openair2/RRC/LTE/L2_interface_ue.c @@ -44,7 +44,7 @@ #include "common/utils/LOG/log.h" #include "rrc_eNB_UE_context.h" #include "pdcp.h" - +#include "common/ran_context.h" #include "intertask_interface.h" diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c index ec3f42ee22..8b3d4d6070 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c @@ -116,9 +116,6 @@ typedef struct xer_sprint_string_s { size_t string_index; } xer_sprint_string_t; -extern unsigned char NB_eNB_INST; - - extern RAN_CONTEXT_t RC; uint16_t two_tier_hexagonal_cellIds[7] = {0,1,2,4,5,7,8}; diff --git a/openair2/RRC/LTE/defs_NB_IoT.h b/openair2/RRC/LTE/defs_NB_IoT.h index 8f19d62cea..656f5334a6 100644 --- a/openair2/RRC/LTE/defs_NB_IoT.h +++ b/openair2/RRC/LTE/defs_NB_IoT.h @@ -40,7 +40,7 @@ #include "collection/tree.h" #include "rrc_types_NB_IoT.h" -#include "COMMON/platform_constants.h" +#include "common/platform_constants.h" #include "COMMON/platform_types.h" #include "common/openairinterface5g_limits.h" diff --git a/openair2/RRC/LTE/rrc_UE.c b/openair2/RRC/LTE/rrc_UE.c index 3bb86d93b5..327099c1c9 100644 --- a/openair2/RRC/LTE/rrc_UE.c +++ b/openair2/RRC/LTE/rrc_UE.c @@ -99,7 +99,17 @@ static int from_nr_ue_fd = -1; static int to_nr_ue_fd = -1; int slrb_id; int send_ue_information = 0; +// TimeToTrigger enum mapping table (36.331 TimeToTrigger IE) +static const uint32_t timeToTrigger_ms[16] = {0, 40, 64, 80, 100, 128, 160, 256, 320, 480, 512, 640, 1024, 1280, 2560, 5120}; +/* 36.133 Section 9.1.4 RSRP Measurement Report Mapping, Table: 9.1.4-1 */ +static const float RSRP_meas_mapping[98] = {-140, -139, -138, -137, -136, -135, -134, -133, -132, -131, -130, -129, -128, -127, -126, -125, -124, -123, -122, -121, -120, -119, -118, -117, -116, + -115, -114, -113, -112, -111, -110, -109, -108, -107, -106, -105, -104, -103, -102, -101, -100, -99, -98, -97, -96, -95, -94, -93, -92, -91, + -90, -89, -88, -87, -86, -85, -84, -83, -82, -81, -80, -79, -78, -77, -76, -75, -74, -73, -72, -71, -70, -69, -68, -67, -66, + -65, -64, -63, -62, -61, -60, -59, -58, -57, -56, -55, -54, -53, -52, -51, -50, -49, -48, -47, -46, -45, -44, -43}; + +static const float RSRQ_meas_mapping[35] = {-19, -18.5, -18, -17.5, -17, -16.5, -16, -15.5, -15, -14.5, -14, -13.5, -13, -12.5, -12, -11.5, -11, -10.5, + -10, -9.5, -9, -8.5, -8, -7.5, -7, -6.5, -6, -5.5, -5, -4.5, -4, -3.5, -3, -2.5, -2}; // for malloc_clear #include "PHY/defs_UE.h" diff --git a/openair2/RRC/LTE/rrc_common.c b/openair2/RRC/LTE/rrc_common.c index 1744719308..c40d0ff766 100644 --- a/openair2/RRC/LTE/rrc_common.c +++ b/openair2/RRC/LTE/rrc_common.c @@ -42,6 +42,7 @@ #include "common/utils/LOG/vcd_signal_dumper.h" #include "rrc_eNB_UE_context.h" #include "common/ran_context.h" +#include "openair2/RRC/LTE/rrc_proto.h" extern RAN_CONTEXT_t RC; extern UE_MAC_INST *UE_mac_inst; @@ -95,12 +96,7 @@ rrc_config_buffer( //----------------------------------------------------------------------------- -long -binary_search_int( - int elements[], - long numElem, - int value -) +long binary_search_int(const int elements[], long numElem, int value) //----------------------------------------------------------------------------- { long first, last, middle, search = -1; @@ -141,12 +137,7 @@ binary_search_int( Used for RSRP and RSRQ measurement mapping. Can potentially be used for other things */ //----------------------------------------------------------------------------- -long -binary_search_float( - float elements[], - long numElem, - float value -) +long binary_search_float(const float elements[], long numElem, float value) //----------------------------------------------------------------------------- { long first, last, middle; diff --git a/openair2/RRC/LTE/rrc_defs.h b/openair2/RRC/LTE/rrc_defs.h index f0fc2275ac..ecf2cd12f1 100644 --- a/openair2/RRC/LTE/rrc_defs.h +++ b/openair2/RRC/LTE/rrc_defs.h @@ -44,12 +44,11 @@ #include "NR_UE-MRDC-Capability.h" #include "NR_UE-NR-Capability.h" - -#include "COMMON/platform_constants.h" +#include "common/platform_constants.h" #include "COMMON/platform_types.h" #include "LAYER2/MAC/mac.h" - +#include "openair2/RRC/common.h" //for D2D #define DEBUG_CTRL_SOCKET diff --git a/openair2/RRC/LTE/rrc_extern.h b/openair2/RRC/LTE/rrc_extern.h index 7f7fd6579e..14de4d8dcc 100644 --- a/openair2/RRC/LTE/rrc_extern.h +++ b/openair2/RRC/LTE/rrc_extern.h @@ -34,6 +34,7 @@ #include "COMMON/mac_rrc_primitives.h" #include "LAYER2/MAC/mac.h" #include "LAYER2/RLC/rlc.h" +#include "openair2/RRC/LTE/rrc_defs.h" extern UE_RRC_INST *UE_rrc_inst; @@ -43,10 +44,7 @@ extern uint8_t DRB2LCHAN[8]; extern LTE_LogicalChannelConfig_t SRB1_logicalChannelConfig_defaultValue; extern LTE_LogicalChannelConfig_t SRB2_logicalChannelConfig_defaultValue; - -extern unsigned char NB_INST; -extern unsigned char NB_eNB_INST; -extern uint16_t NB_UE_INST; +extern int NB_UE_INST; extern void* bigphys_malloc(int); @@ -59,15 +57,6 @@ extern LCHAN_DESC BCCH_LCHAN_DESC,CCCH_LCHAN_DESC,DCCH_LCHAN_DESC,DTCH_DL_LCHAN_ extern MAC_MEAS_T BCCH_MEAS_TRIGGER,CCCH_MEAS_TRIGGER,DCCH_MEAS_TRIGGER,DTCH_MEAS_TRIGGER; extern MAC_AVG_T BCCH_MEAS_AVG,CCCH_MEAS_AVG,DCCH_MEAS_AVG, DTCH_MEAS_AVG; -extern uint16_t T300[8]; -extern uint16_t T310[8]; -extern uint16_t N310[8]; -extern uint16_t N311[8]; -extern uint32_t T304[8]; -extern uint32_t timeToTrigger_ms[16]; -extern float RSRP_meas_mapping[98]; -extern float RSRQ_meas_mapping[35]; - extern UE_PF_PO_t UE_PF_PO[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB]; extern pthread_mutex_t ue_pf_po_mutex; diff --git a/openair2/RRC/LTE/rrc_proto.h b/openair2/RRC/LTE/rrc_proto.h index fa469503af..a54a7a7336 100644 --- a/openair2/RRC/LTE/rrc_proto.h +++ b/openair2/RRC/LTE/rrc_proto.h @@ -655,9 +655,9 @@ rrc_eNB_free_UE( const struct rrc_eNB_ue_context_s *const ue_context_pP ); -long binary_search_int(int elements[], long numElem, int value); +long binary_search_int(const int elements[], long numElem, int value); -long binary_search_float(float elements[], long numElem, float value); +long binary_search_float(const float elements[], long numElem, float value); void openair_rrc_top_init_eNB(int eMBMS_active,uint8_t HO_active); diff --git a/openair2/RRC/LTE/rrc_vars.h b/openair2/RRC/LTE/rrc_vars.h index dfb019193c..f0495a7649 100644 --- a/openair2/RRC/LTE/rrc_vars.h +++ b/openair2/RRC/LTE/rrc_vars.h @@ -35,13 +35,12 @@ #include "LAYER2/RLC/rlc.h" #include "COMMON/mac_rrc_primitives.h" #include "LAYER2/MAC/mac.h" +#include "openair2/RRC/NR/nr_rrc_extern.h" UE_PF_PO_t UE_PF_PO[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB]; pthread_mutex_t ue_pf_po_mutex; UE_RRC_INST *UE_rrc_inst = NULL; #include "LAYER2/MAC/mac_extern.h" -#define MAX_U32 0xFFFFFFFF - extern uint16_t ue_id_g; uint8_t DRB2LCHAN[8]; @@ -86,156 +85,6 @@ LCHAN_DESC BCCH_LCHAN_DESC,CCCH_LCHAN_DESC,DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DT MAC_MEAS_T BCCH_MEAS_TRIGGER,CCCH_MEAS_TRIGGER,DCCH_MEAS_TRIGGER,DTCH_MEAS_TRIGGER; MAC_AVG_T BCCH_MEAS_AVG, CCCH_MEAS_AVG,DCCH_MEAS_AVG, DTCH_MEAS_AVG; -// timers -uint16_t T300[8] = {100,200,300,400,600,1000,1500,2000}; -uint16_t T310[8] = {0,50,100,200,500,1000,2000}; -uint16_t N310[8] = {1,2,3,4,6,8,10,20}; -uint16_t N311[8] = {1,2,3,4,6,8,10,20}; -uint32_t T304[8] = {50,100,150,200,500,1000,2000,MAX_U32}; - -// TimeToTrigger enum mapping table (36.331 TimeToTrigger IE) -uint32_t timeToTrigger_ms[16] = {0,40,64,80,100,128,160,256,320,480,512,640,1024,1280,2560,5120}; - -/* 36.133 Section 9.1.4 RSRP Measurement Report Mapping, Table: 9.1.4-1 */ -float RSRP_meas_mapping[98] = { - -140, - -139, - -138, - -137, - -136, - -135, - -134, - -133, - -132, - -131, - -130, - -129, - -128, - -127, - -126, - -125, - -124, - -123, - -122, - -121, - -120, - -119, - -118, - -117, - -116, - -115, - -114, - -113, - -112, - -111, - -110, - -109, - -108, - -107, - -106, - -105, - -104, - -103, - -102, - -101, - -100, - -99, - -98, - -97, - -96, - -95, - -94, - -93, - -92, - -91, - -90, - -89, - -88, - -87, - -86, - -85, - -84, - -83, - -82, - -81, - -80, - -79, - -78, - -77, - -76, - -75, - -74, - -73, - -72, - -71, - -70, - -69, - -68, - -67, - -66, - -65, - -64, - -63, - -62, - -61, - -60, - -59, - -58, - -57, - -56, - -55, - -54, - -53, - -52, - -51, - -50, - -49, - -48, - -47, - -46, - -45, - -44, - -43 - }; - -float RSRQ_meas_mapping[35] = { - -19, - -18.5, - -18, - -17.5, - -17, - -16.5, - -16, - -15.5, - -15, - -14.5, - -14, - -13.5, - -13, - -12.5, - -12, - -11.5, - -11, - -10.5, - -10, - -9.5, - -9, - -8.5, - -8, - -7.5, - -7, - -6.5, - -6, - -5.5, - -5, - -4.5, - -4, - -3.5, - -3, - -2.5, - -2 - }; - // only used for RRC connection re-establishment procedure TS36.331 5.3.7 // [0]: current C-RNTI, [1]: prior C-RNTI // insert one when eNB received RRCConnectionReestablishmentRequest message diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index e52e637dd8..299e0acaa9 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -148,10 +148,6 @@ typedef struct xer_sprint_string_s { size_t string_index; } xer_sprint_string_t; -//replace LTE -//extern unsigned char NB_eNB_INST; -extern unsigned char NB_gNB_INST; - extern RAN_CONTEXT_t RC; /* diff --git a/openair2/RRC/NR/nr_rrc_defs.h b/openair2/RRC/NR/nr_rrc_defs.h index a8245dd66d..6b60d64842 100644 --- a/openair2/RRC/NR/nr_rrc_defs.h +++ b/openair2/RRC/NR/nr_rrc_defs.h @@ -40,7 +40,7 @@ #include "nr_rrc_types.h" #include "common/ngran_types.h" -#include "COMMON/platform_constants.h" +#include "common/platform_constants.h" #include "COMMON/platform_types.h" #include "mac_rrc_dl.h" diff --git a/openair2/RRC/NR/nr_rrc_extern.h b/openair2/RRC/NR/nr_rrc_extern.h index af2cfdd2c8..85faa60697 100644 --- a/openair2/RRC/NR/nr_rrc_extern.h +++ b/openair2/RRC/NR/nr_rrc_extern.h @@ -34,6 +34,8 @@ #include "COMMON/mac_rrc_primitives.h" #include "LAYER2/MAC/mac.h" #include "LAYER2/RLC/rlc.h" +#include "openair2/RRC/LTE/rrc_defs.h" +#include "openair2/RRC/common.h" #define NR_MAX_SIB_LENGTH 2976 // 3GPP TS 38.331 section 5.2.1 - The physical layer imposes a limit to the maximum size a SIB can take. The maximum SIB1 or SI message size is 2976 bits. @@ -45,10 +47,7 @@ extern NR_LogicalChannelConfig_t NR_SRB1_logicalChannelConfig_defaultValue; extern NR_LogicalChannelConfig_t NR_SRB2_logicalChannelConfig_defaultValue; extern NR_LogicalChannelConfig_t NR_SRB3_logicalChannelConfig_defaultValue; - -extern unsigned char NB_INST; -extern unsigned char NB_eNB_INST; -extern uint16_t NB_UE_INST; +extern int NB_UE_INST; extern void* bigphys_malloc(int); @@ -61,15 +60,6 @@ extern LCHAN_DESC BCCH_LCHAN_DESC,CCCH_LCHAN_DESC,DCCH_LCHAN_DESC,DTCH_DL_LCHAN_ extern MAC_MEAS_T BCCH_MEAS_TRIGGER,CCCH_MEAS_TRIGGER,DCCH_MEAS_TRIGGER,DTCH_MEAS_TRIGGER; extern MAC_AVG_T BCCH_MEAS_AVG,CCCH_MEAS_AVG,DCCH_MEAS_AVG, DTCH_MEAS_AVG; -extern uint16_t T300[8]; -extern uint16_t T310[8]; -extern uint16_t N310[8]; -extern uint16_t N311[8]; -extern uint32_t T304[8]; -extern uint32_t timeToTrigger_ms[16]; -extern float RSRP_meas_mapping[98]; -extern float RSRQ_meas_mapping[35]; - extern UE_PF_PO_t UE_PF_PO[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB]; extern pthread_mutex_t ue_pf_po_mutex; diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index a9c03885f7..93d459b3ed 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -1345,7 +1345,13 @@ static void rrc_ue_generate_RRCSetupComplete( ctxt_pP->module_id,ctxt_pP->frame, size, gNB_index); LOG_D(NR_RRC, "[FRAME %05d][RRC_UE][MOD %02d][][--- PDCP_DATA_REQ/%d Bytes (RRCSetupComplete to gNB %d MUI %d) --->][PDCP][MOD %02d][RB %02d]\n", - ctxt_pP->frame, ctxt_pP->module_id+NB_RN_INST, size, gNB_index, nr_rrc_mui, ctxt_pP->module_id+NB_eNB_INST, DCCH); + ctxt_pP->frame, + ctxt_pP->module_id, + size, + gNB_index, + nr_rrc_mui, + ctxt_pP->module_id + NB_eNB_INST, + DCCH); //for (int i=0;i +#include #include "otg_config.h" /** diff --git a/openair2/UTIL/OTG/otg_form.c b/openair2/UTIL/OTG/otg_form.c index 7a421eef60..928e8efeaf 100644 --- a/openair2/UTIL/OTG/otg_form.c +++ b/openair2/UTIL/OTG/otg_form.c @@ -35,7 +35,6 @@ #include "otg_externs.h" #include "otg_kpi.h" -extern unsigned char NB_eNB_INST; extern uint16_t NB_UE_INST; FD_otg *form_dl, *form_ul; diff --git a/openair2/UTIL/OTG/otg_kpi.c b/openair2/UTIL/OTG/otg_kpi.c index c55aecf239..52aaa4e436 100644 --- a/openair2/UTIL/OTG/otg_kpi.c +++ b/openair2/UTIL/OTG/otg_kpi.c @@ -40,7 +40,6 @@ unsigned int start_log_jitter=0; #include "otg_kpi.h" #include "otg_externs.h" -extern unsigned char NB_eNB_INST; extern uint16_t NB_UE_INST; void tx_throughput(int src, int dst, int application) { diff --git a/openair2/UTIL/OTG/otg_rx.c b/openair2/UTIL/OTG/otg_rx.c index 4cd0496bde..135378ff3b 100644 --- a/openair2/UTIL/OTG/otg_rx.c +++ b/openair2/UTIL/OTG/otg_rx.c @@ -43,7 +43,6 @@ #include #endif -extern unsigned char NB_eNB_INST; extern uint16_t NB_UE_INST; //#include "LAYER2/MAC/extern.h" diff --git a/openair2/UTIL/OTG/otg_tx.c b/openair2/UTIL/OTG/otg_tx.c index a8ba83bc40..a43160ccd8 100644 --- a/openair2/UTIL/OTG/otg_tx.c +++ b/openair2/UTIL/OTG/otg_tx.c @@ -35,7 +35,6 @@ #include "otg_tx.h" #include "otg_externs.h" -extern unsigned char NB_eNB_INST; extern uint16_t NB_UE_INST; diff --git a/openair2/UTIL/OTG/otg_tx.h b/openair2/UTIL/OTG/otg_tx.h index c5b0c01dfc..355294a8f4 100644 --- a/openair2/UTIL/OTG/otg_tx.h +++ b/openair2/UTIL/OTG/otg_tx.h @@ -41,10 +41,7 @@ #include #include - #include "otg.h" -//#include "COMMON/platform_constants.h" - /*! \fn int time_dist(const int src, const int dst, const int state) * \brief compute Inter Departure Time, in ms diff --git a/openair3/MME_APP/mme_config.h b/openair3/MME_APP/mme_config.h index 2eb0a66e85..6500404d63 100644 --- a/openair3/MME_APP/mme_config.h +++ b/openair3/MME_APP/mme_config.h @@ -36,7 +36,7 @@ #include "commonDef.h" #include "platform_types.h" -#include "platform_constants.h" +#include "common/platform_constants.h" #include "PHY/impl_defs_top.h" #include "PHY/defs_eNB.h" #include "s1ap_messages_types.h" diff --git a/openair3/NAS/UE/nas_itti_messaging.c b/openair3/NAS/UE/nas_itti_messaging.c index c6762a7128..2f9c8114d8 100644 --- a/openair3/NAS/UE/nas_itti_messaging.c +++ b/openair3/NAS/UE/nas_itti_messaging.c @@ -23,6 +23,7 @@ #include "intertask_interface.h" #include "nas_itti_messaging.h" +#include "common/ran_context.h" # define TASK_ORIGIN TASK_NAS_UE @@ -95,10 +96,6 @@ int nas_itti_protected_msg(const char *buffer, const nas_message_t *msg, const i } #endif - - -extern unsigned char NB_eNB_INST; - int nas_itti_kenb_refresh_req(const Byte_t kenb[32], int user_id) { MessageDef *message_p; message_p = itti_alloc_new_message(TASK_NAS_UE, 0, NAS_KENB_REFRESH_REQ); diff --git a/openair3/NAS/UE/nas_ue_task.c b/openair3/NAS/UE/nas_ue_task.c index f47af8cb66..b4e096c929 100644 --- a/openair3/NAS/UE/nas_ue_task.c +++ b/openair3/NAS/UE/nas_ue_task.c @@ -32,11 +32,11 @@ # include "memory.h" #include "nas_user.h" +#include "common/ran_context.h" // FIXME make command line option for NAS_UE_AUTOSTART # define NAS_UE_AUTOSTART 1 // FIXME review these externs -extern unsigned char NB_eNB_INST; extern uint16_t NB_UE_INST; uint16_t ue_idx_standalone = 0xFFFF; diff --git a/targets/TEST/PACKET_TRACER/pt.c b/targets/TEST/PACKET_TRACER/pt.c index cc3b62728c..54f3a09405 100644 --- a/targets/TEST/PACKET_TRACER/pt.c +++ b/targets/TEST/PACKET_TRACER/pt.c @@ -476,6 +476,7 @@ u16 attach_ue4(char *dcch_sdu_eNB, char dcch_sdu_eNB_len, char *dcch_sdu_ue) } //u8 NB_INST=2; +const int NB_UE_INST = 1; int main (int argc, char **argv) { @@ -492,10 +493,6 @@ int main (int argc, char **argv) logInit(); - NB_UE_INST = 1; - NB_eNB_INST = 1; - NB_INST=2; - // Parse arguments if(parse_args(argc, argv, &args) > 0) { print_usage(argv[0]); diff --git a/targets/TEST/PDCP/with_rlc/test_pdcp_rlc.c b/targets/TEST/PDCP/with_rlc/test_pdcp_rlc.c index 7b80171724..507521ee1e 100644 --- a/targets/TEST/PDCP/with_rlc/test_pdcp_rlc.c +++ b/targets/TEST/PDCP/with_rlc/test_pdcp_rlc.c @@ -224,7 +224,6 @@ int main(int argc, char **argv) char * g_log_level = "trace"; // by default global log level is set to trace mac_xface = malloc(sizeof(MAC_xface)); - Mac_rlc_xface = (MAC_RLC_XFACE*)malloc16(sizeof(MAC_RLC_XFACE)); rlc_module_init (1); pdcp_module_init();