From 9f45f1d76917c0bdb55d7c35044a955de311bac0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 9 Aug 2023 17:32:40 +0200 Subject: [PATCH] Deprecate NR-UE --rrc_config_path, use --r{e,b}config-file instead Config options --reconfig_file and --rbconfig-file have been introduced to modify the filenames of reconfig.raw and rbconfig.raw (e.g., in the case of multiple UEs). These filen*ames* were to be prepended with --rrc_config_path to set the path. In summary, three options were necessary, when two are sufficient. In this commit, change to the options --reconfig-file and --rbconfig-file (slight change for harmonization with other options, which mostly use dashes) to give the full path to the corresponding files, and avoid to surprise users who would not expect to have three options. --rrc_config_path has been deprecated and an error will be printed if a user attempts to use it. --- ci-scripts/xml_files/gnb_nr_ue_usrp_run.xml | 2 +- .../gnb_nr_ue_usrp_run_multi_thread.xml | 2 +- .../docker-compose.yaml | 2 +- .../docker-compose.yaml | 2 +- .../docker-compose.yaml | 2 +- doc/RUN_NR_NFAPI.md | 4 +-- executables/nr-ue.c | 4 +-- executables/nr-uesoftmodem.c | 4 ++- executables/nr-uesoftmodem.h | 8 +++--- openair2/RRC/NR_UE/main_ue.c | 4 +-- openair2/RRC/NR_UE/rrc_UE.c | 26 ++++++------------- openair2/RRC/NR_UE/rrc_proto.h | 4 +-- radio/rfsimulator/README.md | 2 +- 13 files changed, 29 insertions(+), 37 deletions(-) diff --git a/ci-scripts/xml_files/gnb_nr_ue_usrp_run.xml b/ci-scripts/xml_files/gnb_nr_ue_usrp_run.xml index 1c4faaf99f..b07bd2b6dd 100644 --- a/ci-scripts/xml_files/gnb_nr_ue_usrp_run.xml +++ b/ci-scripts/xml_files/gnb_nr_ue_usrp_run.xml @@ -52,7 +52,7 @@ Initialize_OAI_UE Initialize NR UE USRP - --phy-test --usrp-args "addr=192.168.30.2,second_addr=192.168.50.2,clock_source=external,time_source=external" --ue-rxgain 50 --rrc_config_path . --log_config.global_log_options level,nocolor,time + --phy-test --usrp-args "addr=192.168.30.2,second_addr=192.168.50.2,clock_source=external,time_source=external" --ue-rxgain 50 --log_config.global_log_options level,nocolor,time NR diff --git a/ci-scripts/xml_files/gnb_nr_ue_usrp_run_multi_thread.xml b/ci-scripts/xml_files/gnb_nr_ue_usrp_run_multi_thread.xml index 2122f8651c..dfc088fc34 100644 --- a/ci-scripts/xml_files/gnb_nr_ue_usrp_run_multi_thread.xml +++ b/ci-scripts/xml_files/gnb_nr_ue_usrp_run_multi_thread.xml @@ -52,7 +52,7 @@ Initialize_OAI_UE Initialize NR UE USRP - --phy-test --usrp-args "addr=192.168.30.2,second_addr=192.168.50.2,clock_source=external,time_source=external" --ue-rxgain 75 --rrc_config_path . --log_config.global_log_options level,nocolor,time + --phy-test --usrp-args "addr=192.168.30.2,second_addr=192.168.50.2,clock_source=external,time_source=external" --ue-rxgain 75 --log_config.global_log_options level,nocolor,time NR diff --git a/ci-scripts/yaml_files/5g_rfsimulator_fdd_phytest/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator_fdd_phytest/docker-compose.yaml index a23c823019..5ead5b485e 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator_fdd_phytest/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_rfsimulator_fdd_phytest/docker-compose.yaml @@ -23,7 +23,7 @@ services: privileged: true container_name: rfsim5g-oai-nr-ue environment: - USE_ADDITIONAL_OPTIONS: --phy-test --rfsim --noS1 --rrc_config_path etc/rrc/ --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time + USE_ADDITIONAL_OPTIONS: --phy-test --rfsim --noS1 --reconfig-file etc/rrc/reconfig.raw --rbconfig-file etc/rrc/rbconfig.raw --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time volumes: - ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf - rrc.config:/opt/oai-nr-ue/etc/rrc/ diff --git a/ci-scripts/yaml_files/5g_rfsimulator_fr2_32prb/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator_fr2_32prb/docker-compose.yaml index 4875f88eb9..10d57983b8 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator_fr2_32prb/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_rfsimulator_fr2_32prb/docker-compose.yaml @@ -23,7 +23,7 @@ services: privileged: true container_name: rfsim5g-oai-nr-ue environment: - USE_ADDITIONAL_OPTIONS: --do-ra --rfsim --noS1 --rrc_config_path etc/rrc/ --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time + USE_ADDITIONAL_OPTIONS: --do-ra --rfsim --noS1 --reconfig-file etc/rrc/reconfig.raw --rbconfig-file etc/rrc/rbconfig.raw --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time volumes: - ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf - rrc.config:/opt/oai-nr-ue/etc/rrc/ diff --git a/ci-scripts/yaml_files/5g_rfsimulator_tdd_dora/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator_tdd_dora/docker-compose.yaml index da3f8eaf31..dc1998dffa 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator_tdd_dora/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_rfsimulator_tdd_dora/docker-compose.yaml @@ -23,7 +23,7 @@ services: privileged: true container_name: rfsim5g-oai-nr-ue environment: - USE_ADDITIONAL_OPTIONS: --do-ra --rfsim --noS1 --rrc_config_path etc/rrc/ --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time + USE_ADDITIONAL_OPTIONS: --do-ra --rfsim --noS1 --reconfig-file etc/rrc/reconfig.raw --rbconfig-file etc/rrc/rbconfig.raw --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time volumes: - ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf - rrc.config:/opt/oai-nr-ue/etc/rrc/ diff --git a/doc/RUN_NR_NFAPI.md b/doc/RUN_NR_NFAPI.md index 503fead0ed..5b597aa326 100644 --- a/doc/RUN_NR_NFAPI.md +++ b/doc/RUN_NR_NFAPI.md @@ -31,7 +31,7 @@ sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfap ``` ### UE command ``` -sudo ./nr-uesoftmodem --rfsim --phy-test --rrc_config_path . -d --rfsimulator.serveraddr 127.0.0.1 +sudo ./nr-uesoftmodem --rfsim --phy-test -d --rfsimulator.serveraddr 127.0.0.1 ``` ## Procedure to run NR nFAPI using Hardware (tested with USRP x310) @@ -48,7 +48,7 @@ sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfap ``` ### UE command ``` -sudo ./nr-uesoftmodem --usrp-args "addr=*USRP_ADDRESS*,clock_source=external,time_source=external" --phy-test --rrc_config_path ../../../ci-scripts/rrc-files +sudo ./nr-uesoftmodem --usrp-args "addr=*USRP_ADDRESS*,clock_source=external,time_source=external" --phy-test ``` diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 8eae392f96..1c6bca50b4 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -944,14 +944,14 @@ void *UE_thread(void *arg) return NULL; } -void init_NR_UE(int nb_inst, char *uecap_file, char *rrc_config_path, char *reconfig_file, char *rbconfig_file) +void init_NR_UE(int nb_inst, char *uecap_file, char *reconfig_file, char *rbconfig_file) { int inst; NR_UE_MAC_INST_t *mac_inst; NR_UE_RRC_INST_t* rrc_inst; for (inst=0; inst < nb_inst; inst++) { - AssertFatal((rrc_inst = nr_l3_init_ue(uecap_file, rrc_config_path, reconfig_file, rbconfig_file)) != NULL, "can not initialize RRC module\n"); + AssertFatal((rrc_inst = nr_l3_init_ue(uecap_file, reconfig_file, rbconfig_file)) != NULL, "can not initialize RRC module\n"); AssertFatal((mac_inst = nr_l2_init_ue(rrc_inst)) != NULL, "can not initialize L2 module\n"); AssertFatal((mac_inst->if_module = nr_ue_if_module_init(inst)) != NULL, "can not initialize IF module\n"); } diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index e746f66e9c..35a9f9a473 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -264,6 +264,8 @@ static void get_options(void) { int numparams = sizeof(cmdline_params)/sizeof(paramdef_t); config_get(cmdline_params,numparams,NULL); + AssertFatal(rrc_config_path == NULL, "the option \"rrc_config_path\" is deprecated. Please use --reconfig-file and --rbconfig-file separately to point to files reconfig.raw and rbconfig.raw\n"); + if (vcdflag > 0) ouput_vcd = 1; } @@ -474,7 +476,7 @@ int main( int argc, char **argv ) { #endif LOG_I(HW, "Version: %s\n", PACKAGE_VERSION); - init_NR_UE(1, uecap_file, rrc_config_path, reconfig_file, rbconfig_file); + init_NR_UE(1, uecap_file, reconfig_file, rbconfig_file); int mode_offset = get_softmodem_params()->nsa ? NUMBER_OF_UE_MAX : 1; uint16_t node_number = get_softmodem_params()->node_number; diff --git a/executables/nr-uesoftmodem.h b/executables/nr-uesoftmodem.h index f104aaea93..3549a7fae1 100644 --- a/executables/nr-uesoftmodem.h +++ b/executables/nr-uesoftmodem.h @@ -40,9 +40,9 @@ {"nr-dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, .iptr=(int32_t *)&nr_dlsch_demod_shift, .defintval=0, TYPE_INT, 0}, \ {"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, .iptr=&vcdflag, .defintval=0, TYPE_INT, 0}, \ {"uecap_file", CONFIG_HLP_UECAP_FILE, 0, .strptr=&uecap_file, .defstrval="./uecap_ports1.xml", TYPE_STRING, 0}, \ - {"rrc_config_path", CONFIG_HLP_RRC_CFG_PATH, 0, .strptr=&rrc_config_path, .defstrval="./", TYPE_STRING, 0}, \ - {"reconfig_file", CONFIG_HLP_RE_CFG_FILE, 0, .strptr=&reconfig_file, .defstrval="reconfig.raw", TYPE_STRING, 0}, \ - {"rbconfig_file", CONFIG_HLP_RB_CFG_FILE, 0, .strptr=&rbconfig_file, .defstrval="rbconfig.raw", TYPE_STRING, 0}, \ + {"rrc_config_path", CONFIG_HLP_RRC_CFG_PATH, 0, .strptr=&rrc_config_path, .defstrval=NULL, TYPE_STRING, 0}, \ + {"reconfig-file", CONFIG_HLP_RE_CFG_FILE, 0, .strptr=&reconfig_file, .defstrval="./reconfig.raw", TYPE_STRING, 0}, \ + {"rbconfig-file", CONFIG_HLP_RB_CFG_FILE, 0, .strptr=&rbconfig_file, .defstrval="./rbconfig.raw", TYPE_STRING, 0}, \ {"ue-idx-standalone", NULL, 0, .u16ptr=&ue_idx_standalone, .defuintval=0xFFFF, TYPE_UINT16, 0}, \ {"ue-rxgain", CONFIG_HLP_UERXG, 0, .dblptr=&(rx_gain[0][0]), .defdblval=110, TYPE_DOUBLE, 0}, \ {"ue-rxgain-off", CONFIG_HLP_UERXGOFF, 0, .dblptr=&rx_gain_off, .defdblval=0, TYPE_DOUBLE, 0}, \ @@ -93,7 +93,7 @@ extern nrUE_params_t *get_nrUE_params(void); // In nr-ue.c extern int setup_nr_ue_buffers(PHY_VARS_NR_UE **phy_vars_ue, openair0_config_t *openair0_cfg); extern void fill_ue_band_info(void); -extern void init_NR_UE(int, char *, char *, char *, char *); +extern void init_NR_UE(int, char *, char *, char *); extern void init_NR_UE_threads(int); extern void reset_opp_meas(void); extern void print_opp_meas(void); diff --git a/openair2/RRC/NR_UE/main_ue.c b/openair2/RRC/NR_UE/main_ue.c index 37aff4ff9b..72853cd278 100644 --- a/openair2/RRC/NR_UE/main_ue.c +++ b/openair2/RRC/NR_UE/main_ue.c @@ -34,9 +34,9 @@ #include "rrc_proto.h" #include "common/utils/LOG/log.h" -NR_UE_RRC_INST_t* nr_l3_init_ue(char* uecap, char* rrc_config_path, char* reconfig_file, char* rbconfig_file) +NR_UE_RRC_INST_t* nr_l3_init_ue(char* uecap, char* reconfig_file, char* rbconfig_file) { // LOG_I(RRC, "[MAIN] NR UE MAC initialization...\n"); - return openair_rrc_top_init_ue_nr(uecap, rrc_config_path, reconfig_file, rbconfig_file); + return openair_rrc_top_init_ue_nr(uecap, reconfig_file, rbconfig_file); } diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index e13274b14a..01a0178b62 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -344,7 +344,7 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type, } -NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* uecap_file, char* rrc_config_path, char* reconfig_file, char* rbconfig_file) +NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* uecap_file, char* reconfig_file, char* rbconfig_file) { if(NB_NR_UE_INST > 0) { NR_UE_rrc_inst = (NR_UE_RRC_INST_t *)calloc(NB_NR_UE_INST , sizeof(NR_UE_RRC_INST_t)); @@ -367,34 +367,24 @@ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* uecap_file, char* rrc_config_ if (get_softmodem_params()->phy_test==1 || get_softmodem_params()->do_ra==1) { // read in files for RRCReconfiguration and RBconfig - FILE *fd; - char filename[1024]; - if (rrc_config_path && reconfig_file) - sprintf(filename, "%s/%s", rrc_config_path, reconfig_file); - else - sprintf(filename,"reconfig.raw"); - LOG_I(NR_RRC, "using %s for rrc init[1/2]\n", filename); - fd = fopen(filename,"r"); - char buffer[1024]; + LOG_I(NR_RRC, "using %s for rrc init[1/2]\n", reconfig_file); + FILE *fd = fopen(reconfig_file,"r"); AssertFatal(fd, "cannot read file %s: errno %d, %s\n", - filename, + reconfig_file, errno, strerror(errno)); + char buffer[1024]; int msg_len=fread(buffer,1,1024,fd); fclose(fd); process_nsa_message(NR_UE_rrc_inst, nr_SecondaryCellGroupConfig_r15, buffer,msg_len); - if (rrc_config_path && rbconfig_file) - sprintf(filename, "%s/%s", rrc_config_path, rbconfig_file); - else - sprintf(filename,"rbconfig.raw"); - LOG_I(NR_RRC, "using %s for rrc init[2/2]\n", filename); - fd = fopen(filename,"r"); + LOG_I(NR_RRC, "using %s for rrc init[2/2]\n", rbconfig_file); + fd = fopen(rbconfig_file,"r"); AssertFatal(fd, "cannot read file %s: errno %d, %s\n", - filename, + rbconfig_file, errno, strerror(errno)); msg_len=fread(buffer,1,1024,fd); diff --git a/openair2/RRC/NR_UE/rrc_proto.h b/openair2/RRC/NR_UE/rrc_proto.h index 94ea697c87..df2d44a996 100644 --- a/openair2/RRC/NR_UE/rrc_proto.h +++ b/openair2/RRC/NR_UE/rrc_proto.h @@ -56,14 +56,14 @@ extern queue_t nr_ul_tti_req_queue; // main_rrc.c // /**\brief Layer 3 initialization*/ -NR_UE_RRC_INST_t *nr_l3_init_ue(char *, char *, char *, char *); +NR_UE_RRC_INST_t *nr_l3_init_ue(char *, char *, char *); // // UE_rrc.c // /**\brief Initial the top level RRC structure instance*/ -NR_UE_RRC_INST_t *openair_rrc_top_init_ue_nr(char *, char *, char *, char *); +NR_UE_RRC_INST_t *openair_rrc_top_init_ue_nr(char *, char *, char *); /**\brief Decode RRC Connection Reconfiguration, sent from E-UTRA RRC Connection Reconfiguration v1510 carring EN-DC config \param buffer encoded NR-RRC-Connection-Reconfiguration/Secondary-Cell-Group-Config message. diff --git a/radio/rfsimulator/README.md b/radio/rfsimulator/README.md index e8baff472c..ca05343c4f 100644 --- a/radio/rfsimulator/README.md +++ b/radio/rfsimulator/README.md @@ -119,7 +119,7 @@ sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78 ### Launch UE in another window ```bash -sudo ./nr-uesoftmodem --rfsim --phy-test --rrc_config_path . --rfsimulator.serveraddr +sudo ./nr-uesoftmodem --rfsim --phy-test --rfsimulator.serveraddr ``` Notes: