mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-16 22:20:31 +00:00
Compare commits
234 Commits
t2-offload
...
test-slice
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d47ded101e | ||
|
|
f326c15d67 | ||
|
|
88daeb39db | ||
|
|
e2f35a2dcd | ||
|
|
bdfea1d001 | ||
|
|
8954a140fd | ||
|
|
289c87d238 | ||
|
|
5bb186229e | ||
|
|
dbb08a9c85 | ||
|
|
3faaf888e7 | ||
|
|
3bc87342c6 | ||
|
|
3544c35c7a | ||
|
|
b5177eb796 | ||
|
|
8eb350c5c8 | ||
|
|
d0b00aa53d | ||
|
|
477510cb53 | ||
|
|
3c8a95e767 | ||
|
|
f02f3af722 | ||
|
|
8f544acf20 | ||
|
|
09a2643518 | ||
|
|
2350bf56dd | ||
|
|
790c3b999d | ||
|
|
5249dd9670 | ||
|
|
d24a3d1a98 | ||
|
|
6cb52cf2ef | ||
|
|
889a116497 | ||
|
|
7cd6d36716 | ||
|
|
6c2194038a | ||
|
|
a402e11b6f | ||
|
|
84ee651784 | ||
|
|
175e835d05 | ||
|
|
eac9ec0547 | ||
|
|
f92617b772 | ||
|
|
e161ca227f | ||
|
|
f0df1ccb53 | ||
|
|
4f653c8471 | ||
|
|
1f0e5bd664 | ||
|
|
ff758dd029 | ||
|
|
01c6377331 | ||
|
|
b240bc485f | ||
|
|
c5aeaf03dc | ||
|
|
d61c4f1042 | ||
|
|
f69f419a13 | ||
|
|
6bf954d35d | ||
|
|
3979879e9e | ||
|
|
8b118fd875 | ||
|
|
ada4e8ebd8 | ||
|
|
3580ddb546 | ||
|
|
b4b2389753 | ||
|
|
fecb4bc3a9 | ||
|
|
5440d6671f | ||
|
|
39468ca98e | ||
|
|
581f280cd7 | ||
|
|
aa555f9125 | ||
|
|
6ef5d27c08 | ||
|
|
c80fc07719 | ||
|
|
ed29252c6d | ||
|
|
8e990850c3 | ||
|
|
72b485a2fe | ||
|
|
6104dbc749 | ||
|
|
39df275fa4 | ||
|
|
aec6170df4 | ||
|
|
41c491a0fa | ||
|
|
107c0c8d65 | ||
|
|
e13a4813ee | ||
|
|
89b776925d | ||
|
|
5168ef72d9 | ||
|
|
deac180224 | ||
|
|
7c6c4fc7d3 | ||
|
|
79c920cd81 | ||
|
|
6f14b11847 | ||
|
|
ec24b9c3e9 | ||
|
|
463115bf19 | ||
|
|
6a91f49e9f | ||
|
|
b5e2c76d93 | ||
|
|
124c86f7b8 | ||
|
|
7d7dced70e | ||
|
|
463dfc6658 | ||
|
|
11c853e760 | ||
|
|
8e35d8fe5b | ||
|
|
4db8dfaf5d | ||
|
|
85befc1c71 | ||
|
|
2a82e36e71 | ||
|
|
6debc5dd21 | ||
|
|
31740f0d71 | ||
|
|
466f753eb0 | ||
|
|
7c5b945766 | ||
|
|
7bb529dcdf | ||
|
|
10d7fe9cc6 | ||
|
|
697a7871d0 | ||
|
|
4defabeb8d | ||
|
|
cf97acb8c7 | ||
|
|
99ca87a1c1 | ||
|
|
e945b260f8 | ||
|
|
ee287d62f4 | ||
|
|
79a1b1cf69 | ||
|
|
728fc34296 | ||
|
|
f3ff41befe | ||
|
|
ff38130196 | ||
|
|
9acfaaabcb | ||
|
|
b04e166e59 | ||
|
|
3e9d310093 | ||
|
|
67b0c006f5 | ||
|
|
ec3de01377 | ||
|
|
1b1c8e22a2 | ||
|
|
18e59d3c2e | ||
|
|
d6abd0117a | ||
|
|
b704f45daa | ||
|
|
e24145fd85 | ||
|
|
75d8c05c24 | ||
|
|
3217a3745b | ||
|
|
041758a13a | ||
|
|
38d46be372 | ||
|
|
d241506043 | ||
|
|
59125df278 | ||
|
|
65bcbabdca | ||
|
|
ea369e403d | ||
|
|
9ab67ad87c | ||
|
|
c6e5ead2a9 | ||
|
|
207f65992e | ||
|
|
088bdf234e | ||
|
|
9e46a6a6ae | ||
|
|
273562f345 | ||
|
|
2715c7efdd | ||
|
|
848f5767d7 | ||
|
|
df917624db | ||
|
|
4d8bb4ef25 | ||
|
|
5661b20e9e | ||
|
|
8013d5d8cc | ||
|
|
4599969f89 | ||
|
|
36479a0ac5 | ||
|
|
623092e130 | ||
|
|
2c2915dad8 | ||
|
|
7ae790afb6 | ||
|
|
107913d6b2 | ||
|
|
7a7d8a1766 | ||
|
|
470af5f497 | ||
|
|
f265b04593 | ||
|
|
7203e5aba8 | ||
|
|
07ee33f024 | ||
|
|
69a2f103ea | ||
|
|
13757862fb | ||
|
|
578cd23d59 | ||
|
|
31a63bc919 | ||
|
|
b0b8c90fd2 | ||
|
|
f248b2fdff | ||
|
|
e5ab3e022e | ||
|
|
43036eb83d | ||
|
|
0accb601e4 | ||
|
|
5e5ab86d47 | ||
|
|
18951bad4d | ||
|
|
e989ae834a | ||
|
|
23597c9193 | ||
|
|
b07691643d | ||
|
|
0c51db05ad | ||
|
|
ad93072e0a | ||
|
|
e98acd7c5a | ||
|
|
1111eccac6 | ||
|
|
610a886da7 | ||
|
|
3fd45922b7 | ||
|
|
dd059343d9 | ||
|
|
3bede49b9b | ||
|
|
8e4ff595a0 | ||
|
|
45dd4813c9 | ||
|
|
c2255a4168 | ||
|
|
0d85903d09 | ||
|
|
58edc4a57b | ||
|
|
8551260243 | ||
|
|
196e0a2c85 | ||
|
|
39274212fe | ||
|
|
1e565f6b7b | ||
|
|
eefffef55b | ||
|
|
a6c95537fb | ||
|
|
01a095a268 | ||
|
|
e9d91de50b | ||
|
|
41c5ea94ae | ||
|
|
96dfb44ae7 | ||
|
|
59a25c48ff | ||
|
|
6520dbc95a | ||
|
|
97d574229d | ||
|
|
7c4ec50e23 | ||
|
|
ac5c4efd4e | ||
|
|
6fe68a574b | ||
|
|
f50d5f5a9b | ||
|
|
3a7f17ebb8 | ||
|
|
fff5497f45 | ||
|
|
c36eb7c9b4 | ||
|
|
c812cea143 | ||
|
|
e155080ece | ||
|
|
a377e5231c | ||
|
|
e5684d217c | ||
|
|
843a1dc0a3 | ||
|
|
1af4e81951 | ||
|
|
8cdb23639b | ||
|
|
3a5cff17d7 | ||
|
|
9a092c1433 | ||
|
|
1153e62e45 | ||
|
|
c00b287c60 | ||
|
|
4c2bfe7a1f | ||
|
|
474c3507f1 | ||
|
|
05aefb9aaa | ||
|
|
808b7684a8 | ||
|
|
11df08a8f0 | ||
|
|
4ad7e9c5c0 | ||
|
|
e6d3a367de | ||
|
|
f993b075f8 | ||
|
|
0a05622a20 | ||
|
|
dc7743c4e8 | ||
|
|
e1e8e10d91 | ||
|
|
31ed25acd7 | ||
|
|
102cbf0d0c | ||
|
|
230258370b | ||
|
|
629825aca6 | ||
|
|
d247abb53d | ||
|
|
a05baa3c77 | ||
|
|
5b5b0f9595 | ||
|
|
3ae665388a | ||
|
|
fb1dc668e5 | ||
|
|
3d63dc0a7e | ||
|
|
c22fe2bab6 | ||
|
|
8f79b4aeed | ||
|
|
128bd3d3db | ||
|
|
21b269fa99 | ||
|
|
dc95e838eb | ||
|
|
19551d1254 | ||
|
|
950becb423 | ||
|
|
5f78fa6eed | ||
|
|
f381e93237 | ||
|
|
2bf40fbd17 | ||
|
|
89fa5a18a8 | ||
|
|
279a55c976 | ||
|
|
6a1a17bcff | ||
|
|
e0ff84f67c | ||
|
|
73244eae4d |
@@ -60,6 +60,8 @@ ForEachMacros:
|
||||
- foreach
|
||||
- Q_FOREACH
|
||||
- BOOST_FOREACH
|
||||
- RB_FOREACH
|
||||
- UE_iterator
|
||||
IncludeBlocks: Preserve
|
||||
IncludeCategories:
|
||||
- Regex: '^<ext/.*\.h>'
|
||||
|
||||
@@ -193,6 +193,13 @@ if (SANITIZE_ADDRESS)
|
||||
# wrong in the pthread library, or something subtly wrong in this CMakeLists.txt. Use Ubuntu 20.04 instead.
|
||||
endif ()
|
||||
|
||||
add_boolean_option(SANITIZE_THREAD False "enable the address sanitizer (TSan)" ON)
|
||||
if (SANITIZE_THREAD)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=thread -fno-omit-frame-pointer -fno-common")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread -fno-omit-frame-pointer -fno-common")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=thread")
|
||||
endif()
|
||||
|
||||
add_boolean_option(SANITIZE_UNDEFINED False "enable the undefined behavior sanitizer (UBSan)" ON)
|
||||
if (SANITIZE_UNDEFINED)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined -fno-sanitize-recover=all")
|
||||
@@ -293,8 +300,8 @@ set(E2AP_VERSION "E2AP_V2" CACHE STRING "E2AP version")
|
||||
set_property(CACHE E2AP_VERSION PROPERTY STRINGS "E2AP_V1" "E2AP_V2" "E2AP_V3")
|
||||
message(STATUS "Selected E2AP_VERSION: ${E2AP_VERSION}")
|
||||
|
||||
set(KPM_VERSION "KPM_V2" CACHE STRING "The KPM SM version to use")
|
||||
set_property(CACHE KPM_VERSION PROPERTY STRINGS "KPM_V2" "KPM_V3")
|
||||
set(KPM_VERSION "KPM_V2_03" CACHE STRING "The KPM SM version to use")
|
||||
set_property(CACHE KPM_VERSION PROPERTY STRINGS "KPM_V2_03" "KPM_V3_00")
|
||||
message(STATUS "Selected KPM Version: ${KPM_VERSION}")
|
||||
|
||||
|
||||
@@ -463,19 +470,23 @@ add_list1_option(NB_ANTENNAS_RX "4" "Number of antennas in reception" "1" "2" "4
|
||||
add_list1_option(NB_ANTENNAS_TX "4" "Number of antennas in transmission" "1" "2" "4")
|
||||
|
||||
set (CONFIG_ROOTDIR ${OPENAIR_DIR}/common/config)
|
||||
add_library(config_internals OBJECT
|
||||
${CONFIG_ROOTDIR}/config_common.c
|
||||
)
|
||||
|
||||
add_library(CONFIG_LIB
|
||||
${CONFIG_ROOTDIR}/config_load_configmodule.c
|
||||
${CONFIG_ROOTDIR}/config_userapi.c
|
||||
${CONFIG_ROOTDIR}/config_cmdline.c
|
||||
)
|
||||
target_link_libraries(CONFIG_LIB PRIVATE config_internals dl UTIL)
|
||||
|
||||
# CONFIG_LIB is a wrapper around a particular config implementation, default is
|
||||
# libconfig in params_libconfig below
|
||||
pkg_check_modules(libconfig REQUIRED libconfig)
|
||||
target_link_libraries(CONFIG_LIB PRIVATE dl UTIL)
|
||||
add_library(params_libconfig MODULE ${CONFIG_ROOTDIR}/libconfig/config_libconfig.c)
|
||||
target_include_directories(params_libconfig PRIVATE ${libconfig_INCLUDE_DIRS})
|
||||
target_link_libraries(params_libconfig PRIVATE ${libconfig_LIBRARIES})
|
||||
target_link_libraries(params_libconfig PRIVATE config_internals ${libconfig_LIBRARIES})
|
||||
|
||||
# shared library loader
|
||||
add_library(shlib_loader OBJECT common/utils/load_module_shlib.c)
|
||||
@@ -483,20 +494,21 @@ target_link_libraries(shlib_loader PRIVATE CONFIG_LIB)
|
||||
|
||||
##########################################################
|
||||
|
||||
# LDPC offload library
|
||||
# LDPC offload library - AMD T2 Accelerator Card
|
||||
##########################################################
|
||||
|
||||
add_boolean_option(ENABLE_LDPC_T1 OFF "Build support for LDPC Offload to T1 library" OFF)
|
||||
if (ENABLE_LDPC_T1)
|
||||
pkg_check_modules(LIBDPDK_T1 REQUIRED libdpdk=20.05.0)
|
||||
find_library(T1 NAMES rte_pmd_hpac_sdfec_pmd REQUIRED)
|
||||
if (NOT T1)
|
||||
message(FATAL_ERROR "Library rte_pmd_hpac_sdfec_pmd for T1 offload not found")
|
||||
add_boolean_option(ENABLE_LDPC_T2 OFF "Build support for LDPC Offload to T2 library" OFF)
|
||||
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/lib/x86_64-linux-gnu/pkgconfig")
|
||||
if (ENABLE_LDPC_T2)
|
||||
pkg_check_modules(LIBDPDK_T2 REQUIRED libdpdk=20.11.7)
|
||||
find_library(PMD_T2 NAMES rte_baseband_accl_ldpc HINTS "/opt/dpdk-t2/lib/x86_64-linux-gnu/")
|
||||
if (NOT PMD_T2)
|
||||
message(FATAL_ERROR "could not find PMD T2")
|
||||
endif()
|
||||
add_library(ldpc_t1 MODULE ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c)
|
||||
set_target_properties(ldpc_t1 PROPERTIES COMPILE_FLAGS "-DALLOW_EXPERIMENTAL_API")
|
||||
target_compile_options(ldpc_t1 PRIVATE ${LIBDPDK_T1_CFLAGS})
|
||||
target_link_libraries(ldpc_t1 ${LIBDPDK_T1_LDFLAGS} ${T1})
|
||||
message(STATUS "T2 build: use ${PMD_T2}")
|
||||
add_library(ldpc_t2 MODULE ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c)
|
||||
set_target_properties(ldpc_t2 PROPERTIES COMPILE_FLAGS "-DALLOW_EXPERIMENTAL_API")
|
||||
target_link_libraries(ldpc_t2 ${LIBDPDK_T2_LDFLAGS} ${PMD_T2})
|
||||
endif()
|
||||
|
||||
##########################################################
|
||||
@@ -808,19 +820,30 @@ set(PHY_LDPC_ORIG_SRC
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_encoder/ldpc_encoder.c
|
||||
)
|
||||
add_library(ldpc_orig MODULE ${PHY_LDPC_ORIG_SRC} )
|
||||
target_link_libraries(ldpc_orig PRIVATE ldpc_gen_HEADERS)
|
||||
|
||||
set(PHY_LDPC_OPTIM_SRC
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim.c
|
||||
)
|
||||
)
|
||||
add_library(ldpc_optim MODULE ${PHY_LDPC_OPTIM_SRC} )
|
||||
target_link_libraries(ldpc_optim PRIVATE ldpc_gen_HEADERS)
|
||||
|
||||
set(PHY_LDPC_OPTIM8SEG_SRC
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c
|
||||
)
|
||||
add_library(ldpc_optim8seg MODULE ${PHY_LDPC_OPTIM8SEG_SRC} )
|
||||
target_link_libraries(ldpc_optim8seg PRIVATE ldpc_gen_HEADERS)
|
||||
|
||||
set(PHY_LDPC_OPTIM8SEGMULTI_SRC
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c
|
||||
)
|
||||
)
|
||||
add_library(ldpc MODULE ${PHY_LDPC_OPTIM8SEGMULTI_SRC} )
|
||||
target_link_libraries(ldpc PRIVATE ldpc_gen_HEADERS)
|
||||
|
||||
set(PHY_LDPC_CUDA_SRC
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder_LYC/nrLDPC_decoder_LYC.cu
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c
|
||||
@@ -834,21 +857,13 @@ add_custom_target( nrLDPC_decoder_kernels_CL
|
||||
COMMAND gcc ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_CL.c -dD -DNRLDPC_KERNEL_SOURCE -E -o ${CMAKE_CURRENT_BINARY_DIR}/nrLDPC_decoder_kernels_CL.clc
|
||||
SOURCES ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_CL.c
|
||||
)
|
||||
|
||||
set(PHY_NR_CODINGIF
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_load.c;
|
||||
)
|
||||
|
||||
add_library(ldpc_orig MODULE ${PHY_LDPC_ORIG_SRC} )
|
||||
target_link_libraries(ldpc_orig PRIVATE ldpc_gen_HEADERS)
|
||||
add_library(ldpc_optim MODULE ${PHY_LDPC_OPTIM_SRC} )
|
||||
target_link_libraries(ldpc_optim PRIVATE ldpc_gen_HEADERS)
|
||||
add_library(ldpc_optim8seg MODULE ${PHY_LDPC_OPTIM8SEG_SRC} )
|
||||
target_link_libraries(ldpc_optim8seg PRIVATE ldpc_gen_HEADERS)
|
||||
add_library(ldpc_cl MODULE ${PHY_LDPC_CL_SRC} )
|
||||
target_link_libraries(ldpc_cl OpenCL)
|
||||
add_dependencies(ldpc_cl nrLDPC_decoder_kernels_CL)
|
||||
|
||||
set(PHY_NR_CODINGIF
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_load.c
|
||||
)
|
||||
|
||||
##############################################
|
||||
# Base CUDA setting
|
||||
@@ -866,13 +881,6 @@ if (ENABLE_LDPC_CUDA)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_library(ldpc MODULE ${PHY_LDPC_OPTIM8SEGMULTI_SRC} )
|
||||
target_link_libraries(ldpc PRIVATE ldpc_gen_HEADERS)
|
||||
|
||||
add_library(ldpc_parityCheck MODULE ${PHY_LDPC_OPTIM8SEGMULTI_SRC} )
|
||||
target_compile_definitions(ldpc_parityCheck PUBLIC NR_LDPC_ENABLE_PARITY_CHECK)
|
||||
target_link_libraries(ldpc_parityCheck PRIVATE ldpc_gen_HEADERS)
|
||||
|
||||
add_library(coding MODULE ${PHY_TURBOSRC} )
|
||||
|
||||
add_library(dfts MODULE ${OPENAIR1_DIR}/PHY/TOOLS/oai_dfts.c ${OPENAIR1_DIR}/PHY/TOOLS/oai_dfts_neon.c)
|
||||
@@ -1271,7 +1279,6 @@ set(L2_NR_SRC
|
||||
${NR_SDAP_SRC}
|
||||
${NR_RRC_DIR}/rrc_gNB.c
|
||||
${NR_RRC_DIR}/nr_rrc_common.c
|
||||
${NR_RRC_DIR}/L2_nr_interface.c
|
||||
${NR_RRC_DIR}/mac_rrc_dl_direct.c
|
||||
${NR_RRC_DIR}/mac_rrc_dl_f1ap.c
|
||||
${NR_RRC_DIR}/nr_rrc_config.c
|
||||
@@ -1282,6 +1289,7 @@ set(L2_NR_SRC
|
||||
${NR_RRC_DIR}/rrc_gNB_NGAP.c
|
||||
${NR_RRC_DIR}/rrc_gNB_radio_bearers.c
|
||||
${NR_RRC_DIR}/rrc_gNB_cuup.c
|
||||
${NR_RRC_DIR}/rrc_gNB_du.c
|
||||
)
|
||||
|
||||
set(L2_SRC_UE
|
||||
@@ -1358,6 +1366,7 @@ set (MAC_NR_SRC
|
||||
${NR_GNB_MAC_DIR}/mac_rrc_dl_handler.c
|
||||
${NR_GNB_MAC_DIR}/mac_rrc_ul_direct.c
|
||||
${NR_GNB_MAC_DIR}/mac_rrc_ul_f1ap.c
|
||||
${NR_GNB_MAC_DIR}/slicing/nr_slicing.c
|
||||
)
|
||||
|
||||
|
||||
@@ -1879,8 +1888,6 @@ set (SIMUSRC
|
||||
)
|
||||
add_library(SIMU STATIC ${SIMUSRC} )
|
||||
target_include_directories(SIMU PUBLIC ${OPENAIR1_DIR}/SIMULATION/TOOLS ${OPENAIR1_DIR}/SIMULATION/RF)
|
||||
target_link_libraries(SIMU PRIVATE ${blas_LIBRARIES} ${cblas_LIBRARIES} ${lapacke_LIBRARIES})
|
||||
target_include_directories(SIMU PRIVATE ${blas_INCLUDE_DIRS} ${lapacke_INCLUDE_DIRS})
|
||||
|
||||
# Qt-based scope
|
||||
add_boolean_option(ENABLE_NRQTSCOPE OFF "Build the Qt-Scope" OFF)
|
||||
@@ -2081,8 +2088,8 @@ endif()
|
||||
|
||||
add_dependencies(nr-softmodem ldpc_orig ldpc_optim ldpc_optim8seg ldpc)
|
||||
|
||||
if (ENABLE_LDPC_T1)
|
||||
add_dependencies(nr-softmodem ldpc_t1)
|
||||
if (ENABLE_LDPC_T2)
|
||||
add_dependencies(nr-softmodem ldpc_t2)
|
||||
endif()
|
||||
|
||||
# force the generation of ASN.1 so that we don't need to wait during the build
|
||||
@@ -2203,12 +2210,12 @@ add_executable(ldpctest
|
||||
${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/ldpctest.c
|
||||
)
|
||||
|
||||
add_dependencies( ldpctest ldpc_orig ldpc_optim ldpc_optim8seg ldpc ldpc_parityCheck)
|
||||
add_dependencies(ldpctest ldpc_orig ldpc_optim ldpc_optim8seg ldpc)
|
||||
if (ENABLE_LDPC_CUDA)
|
||||
add_dependencies(ldpctest ldpc_cuda)
|
||||
endif()
|
||||
target_link_libraries(ldpctest PRIVATE
|
||||
-Wl,--start-group UTIL SIMU PHY_NR PHY_COMMON PHY_NR_COMMON -Wl,--end-group
|
||||
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON -Wl,--end-group
|
||||
m pthread dl shlib_loader ${T_LIB}
|
||||
)
|
||||
|
||||
@@ -2298,8 +2305,8 @@ add_executable(nr_ulsim
|
||||
${PHY_INTERFACE_DIR}/queue_t.c
|
||||
)
|
||||
|
||||
if (ENABLE_LDPC_T1)
|
||||
add_dependencies(nr_ulsim ldpc_t1)
|
||||
if (ENABLE_LDPC_T2)
|
||||
add_dependencies(nr_ulsim ldpc_t2)
|
||||
endif()
|
||||
|
||||
target_link_libraries(nr_ulsim PRIVATE
|
||||
@@ -2367,7 +2374,7 @@ if (${T_TRACER})
|
||||
PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU PHY_MEX
|
||||
L2 L2_LTE L2_NR L2_LTE_NR L2_UE NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON MAC_UE_NR ngap
|
||||
CN_UTILS GTPV1U SCTP_CLIENT MME_APP LIB_NAS_UE NB_IoT SIMU SIMU_ETH OPENAIR0_LIB
|
||||
ldpc_orig ldpc_optim ldpc_optim8seg ldpc dfts)
|
||||
ldpc_orig ldpc_optim ldpc_optim8seg ldpc_t2 ldpc_cl ldpc_cuda ldpc dfts config_internals)
|
||||
if (TARGET ${i})
|
||||
add_dependencies(${i} generate_T)
|
||||
endif()
|
||||
|
||||
@@ -49,75 +49,75 @@ adb_ue_2:
|
||||
|
||||
amarisoft_ue:
|
||||
Host: amariue
|
||||
InitScript: /root/2023-06-10/lteue-linux-2023-06-10/lteue /root/oaicicd/ran_sa_aw2s_asue/aw2s-multi-20897-2x2.cfg &
|
||||
TermScript: /root/2023-06-10/libs/ws.js -t 10 127.0.0.1:9002 '{"message":"quit"}' || killall -KILL lteue-avx2
|
||||
InitScript: /root/lteue-linux-2023-10-27/ue/lteue /root/oaicicd/ran_sa_aw2s_asue/aw2s-multi-20897-2x2.cfg &
|
||||
TermScript: /root/2023-10-27/libs/ws.js -t 10 127.0.0.1:9002 '{"message":"quit"}' || killall -KILL lteue-avx2
|
||||
amarisoft_ue_1:
|
||||
Host: amariue
|
||||
AttachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":1}'
|
||||
DetachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":1}'
|
||||
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":1}'
|
||||
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":1}'
|
||||
NetworkScript: ip netns exec ue1 ip a show dev pdn0
|
||||
CmdPrefix: ip netns exec ue1
|
||||
MTU: 1500
|
||||
amarisoft_ue_2:
|
||||
Host: amariue
|
||||
AttachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":2}'
|
||||
DetachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":2}'
|
||||
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":2}'
|
||||
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":2}'
|
||||
NetworkScript: ip netns exec ue2 ip a show dev pdn0
|
||||
CmdPrefix: ip netns exec ue2
|
||||
MTU: 1500
|
||||
amarisoft_ue_3:
|
||||
Host: amariue
|
||||
AttachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":3}'
|
||||
DetachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":3}'
|
||||
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":3}'
|
||||
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":3}'
|
||||
NetworkScript: ip netns exec ue3 ip a show dev pdn0
|
||||
CmdPrefix: ip netns exec ue3
|
||||
MTU: 1500
|
||||
amarisoft_ue_4:
|
||||
Host: amariue
|
||||
AttachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":4}'
|
||||
DetachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":4}'
|
||||
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":4}'
|
||||
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":4}'
|
||||
NetworkScript: ip netns exec ue4 ip a show dev pdn0
|
||||
CmdPrefix: ip netns exec ue4
|
||||
MTU: 1500
|
||||
amarisoft_ue_5:
|
||||
Host: amariue
|
||||
AttachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":5}'
|
||||
DetachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":5}'
|
||||
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":5}'
|
||||
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":5}'
|
||||
NetworkScript: ip netns exec ue5 ip a show dev pdn0
|
||||
CmdPrefix: ip netns exec ue5
|
||||
MTU: 1500
|
||||
amarisoft_ue_6:
|
||||
Host: amariue
|
||||
AttachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":6}'
|
||||
DetachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":6}'
|
||||
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":6}'
|
||||
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":6}'
|
||||
NetworkScript: ip netns exec ue6 ip a show dev pdn0
|
||||
CmdPrefix: ip netns exec ue6
|
||||
MTU: 1500
|
||||
amarisoft_ue_7:
|
||||
Host: amariue
|
||||
AttachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":7}'
|
||||
DetachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":7}'
|
||||
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":7}'
|
||||
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":7}'
|
||||
NetworkScript: ip netns exec ue7 ip a show dev pdn0
|
||||
CmdPrefix: ip netns exec ue7
|
||||
MTU: 1500
|
||||
amarisoft_ue_8:
|
||||
Host: amariue
|
||||
AttachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":8}'
|
||||
DetachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":8}'
|
||||
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":8}'
|
||||
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":8}'
|
||||
NetworkScript: ip netns exec ue8 ip a show dev pdn0
|
||||
CmdPrefix: ip netns exec ue8
|
||||
MTU: 1500
|
||||
amarisoft_ue_9:
|
||||
Host: amariue
|
||||
AttachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":9}'
|
||||
DetachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":9}'
|
||||
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":9}'
|
||||
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":9}'
|
||||
NetworkScript: ip netns exec ue9 ip a show dev pdn0
|
||||
CmdPrefix: ip netns exec ue9
|
||||
MTU: 1500
|
||||
amarisoft_ue_10:
|
||||
Host: amariue
|
||||
AttachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":10}'
|
||||
DetachScript: /root/2023-06-10/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":10}'
|
||||
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":10}'
|
||||
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":10}'
|
||||
NetworkScript: ip netns exec ue10 ip a show dev pdn0
|
||||
CmdPrefix: ip netns exec ue10
|
||||
MTU: 1500
|
||||
|
||||
@@ -58,7 +58,7 @@ import cls_oaicitest
|
||||
# Helper functions used here and in other classes
|
||||
# (e.g., cls_cluster.py)
|
||||
#-----------------------------------------------------------
|
||||
IMAGES = ['oai-enb', 'oai-lte-ru', 'oai-lte-ue', 'oai-gnb', 'oai-nr-cuup', 'oai-gnb-aw2s', 'oai-nr-ue']
|
||||
IMAGES = ['oai-enb', 'oai-lte-ru', 'oai-lte-ue', 'oai-gnb', 'oai-nr-cuup', 'oai-gnb-aw2s', 'oai-nr-ue', 'oai-gnb-asan', 'oai-nr-ue-asan', 'oai-nr-cuup-asan']
|
||||
|
||||
def CreateWorkspace(sshSession, sourcePath, ranRepository, ranCommitID, ranTargetBranch, ranAllowMerge):
|
||||
if ranCommitID == '':
|
||||
@@ -364,25 +364,30 @@ class Containerize():
|
||||
self.cliBuildOptions = '--no-cache --disable-compression'
|
||||
|
||||
# we always build the ran-build image with all targets
|
||||
imageNames = [('ran-build', 'build')]
|
||||
# Creating a tupple with the imageName, the DockerFile prefix pattern, targetName and sanitized option
|
||||
imageNames = [('ran-build', 'build', 'ran-build', '')]
|
||||
result = re.search('eNB', self.imageKind)
|
||||
# Creating a tupple with the imageName and the DockerFile prefix pattern on obelix
|
||||
if result is not None:
|
||||
imageNames.append(('oai-enb', 'eNB'))
|
||||
imageNames.append(('oai-enb', 'eNB', 'oai-enb', ''))
|
||||
result = re.search('gNB', self.imageKind)
|
||||
if result is not None:
|
||||
imageNames.append(('oai-gnb', 'gNB'))
|
||||
imageNames.append(('oai-gnb', 'gNB', 'oai-gnb', ''))
|
||||
result = re.search('all', self.imageKind)
|
||||
if result is not None:
|
||||
imageNames.append(('oai-enb', 'eNB'))
|
||||
imageNames.append(('oai-gnb', 'gNB'))
|
||||
imageNames.append(('oai-nr-cuup', 'nr-cuup'))
|
||||
imageNames.append(('oai-lte-ue', 'lteUE'))
|
||||
imageNames.append(('oai-nr-ue', 'nrUE'))
|
||||
imageNames.append(('oai-enb', 'eNB', 'oai-enb', ''))
|
||||
imageNames.append(('oai-gnb', 'gNB', 'oai-gnb', ''))
|
||||
imageNames.append(('oai-nr-cuup', 'nr-cuup', 'oai-nr-cuup', ''))
|
||||
imageNames.append(('oai-lte-ue', 'lteUE', 'oai-lte-ue', ''))
|
||||
imageNames.append(('oai-nr-ue', 'nrUE', 'oai-nr-ue', ''))
|
||||
if self.host == 'Red Hat':
|
||||
imageNames.append(('oai-physim', 'phySim'))
|
||||
imageNames.append(('oai-physim', 'phySim', 'oai-physim', ''))
|
||||
if self.host == 'Ubuntu':
|
||||
imageNames.append(('oai-lte-ru', 'lteRU'))
|
||||
imageNames.append(('oai-lte-ru', 'lteRU', 'oai-lte-ru', ''))
|
||||
# Building again the 5G images with Address Sanitizer
|
||||
imageNames.append(('ran-build', 'build', 'ran-build-asan', '--build-arg "BUILD_OPTION=--sanitize"'))
|
||||
imageNames.append(('oai-gnb', 'gNB', 'oai-gnb-asan', '--build-arg "BUILD_OPTION=--sanitize"'))
|
||||
imageNames.append(('oai-nr-ue', 'nrUE', 'oai-nr-ue-asan', '--build-arg "BUILD_OPTION=--sanitize"'))
|
||||
imageNames.append(('oai-nr-cuup', 'nr-cuup', 'oai-nr-cuup-asan', '--build-arg "BUILD_OPTION=--sanitize"'))
|
||||
result = re.search('build_cross_arm64', self.imageKind)
|
||||
if result is not None:
|
||||
self.dockerfileprefix = '.ubuntu20.cross-arm64'
|
||||
@@ -421,8 +426,8 @@ class Containerize():
|
||||
cmd.run(f"{self.cli} image prune --force")
|
||||
if forceBaseImageBuild:
|
||||
cmd.run(f"{self.cli} image rm {baseImage}:{baseTag}")
|
||||
for image,pattern in imageNames:
|
||||
cmd.run(f"{self.cli} image rm {image}:{imageTag}")
|
||||
for image,pattern,name,option in imageNames:
|
||||
cmd.run(f"{self.cli} image rm {name}:{imageTag}")
|
||||
|
||||
# Build the base image only on Push Events (not on Merge Requests)
|
||||
# On when the base image docker file is being modified.
|
||||
@@ -460,46 +465,50 @@ class Containerize():
|
||||
# Build the target image(s)
|
||||
status = True
|
||||
attemptedImages = ['ran-base']
|
||||
for image,pattern in imageNames:
|
||||
attemptedImages += [image]
|
||||
for image,pattern,name,option in imageNames:
|
||||
attemptedImages += [name]
|
||||
# the archived Dockerfiles have "ran-base:latest" as base image
|
||||
# we need to update them with proper tag
|
||||
cmd.run(f'git checkout -- docker/Dockerfile.{pattern}{self.dockerfileprefix}')
|
||||
cmd.run(f'sed -i -e "s#{baseImage}:latest#{baseImage}:{baseTag}#" docker/Dockerfile.{pattern}{self.dockerfileprefix}')
|
||||
if image != 'ran-build':
|
||||
# target images should use the proper ran-build image
|
||||
if image != 'ran-build' and "-asan" in name:
|
||||
cmd.run(f'sed -i -e "s#ran-build:latest#ran-build-asan:{imageTag}#" docker/Dockerfile.{pattern}{self.dockerfileprefix}')
|
||||
elif image != 'ran-build':
|
||||
cmd.run(f'sed -i -e "s#ran-build:latest#ran-build:{imageTag}#" docker/Dockerfile.{pattern}{self.dockerfileprefix}')
|
||||
ret = cmd.run(f'{self.cli} build {self.cliBuildOptions} --target {image} --tag {image}:{imageTag} --file docker/Dockerfile.{pattern}{self.dockerfileprefix} . > cmake_targets/log/{image}.log 2>&1', timeout=1200)
|
||||
ret = cmd.run(f'{self.cli} build {self.cliBuildOptions} --target {image} --tag {name}:{imageTag} --file docker/Dockerfile.{pattern}{self.dockerfileprefix} {option} . > cmake_targets/log/{name}.log 2>&1', timeout=1200)
|
||||
if image == 'ran-build' and ret.returncode == 0:
|
||||
cmd.run(f"docker run --name test-log -d {image}:{imageTag} /bin/true")
|
||||
cmd.run(f"docker cp test-log:/oai-ran/cmake_targets/log/ cmake_targets/log/{image}/")
|
||||
cmd.run(f"docker run --name test-log -d {name}:{imageTag} /bin/true")
|
||||
cmd.run(f"docker cp test-log:/oai-ran/cmake_targets/log/ cmake_targets/log/{name}/")
|
||||
cmd.run(f"docker rm -f test-log")
|
||||
else:
|
||||
cmd.run(f"mkdir -p cmake_targets/log/{image}")
|
||||
cmd.run(f"mkdir -p cmake_targets/log/{name}")
|
||||
# check the status of the build
|
||||
ret = cmd.run(f"{self.cli} image inspect --format=\'Size = {{{{.Size}}}} bytes\' {image}:{imageTag}")
|
||||
ret = cmd.run(f"{self.cli} image inspect --format=\'Size = {{{{.Size}}}} bytes\' {name}:{imageTag}")
|
||||
if ret.returncode != 0:
|
||||
logging.error('\u001B[1m Could not build properly ' + image + '\u001B[0m')
|
||||
logging.error('\u001B[1m Could not build properly ' + name + '\u001B[0m')
|
||||
status = False
|
||||
# Here we should check if the last container corresponds to a failed command and destroy it
|
||||
cmd.run(f"{self.cli} ps --quiet --filter \"status=exited\" -n1 | xargs --no-run-if-empty {self.cli} rm -f")
|
||||
allImagesSize[image] = 'N/A -- Build Failed'
|
||||
allImagesSize[name] = 'N/A -- Build Failed'
|
||||
break
|
||||
else:
|
||||
result = re.search('Size *= *(?P<size>[0-9\-]+) *bytes', cmd.getBefore())
|
||||
if result is not None:
|
||||
size = float(result.group("size")) / 1000000 # convert to MB
|
||||
imageSizeStr = f'{size:.1f}'
|
||||
logging.debug(f'\u001B[1m {image} size is {imageSizeStr} Mbytes\u001B[0m')
|
||||
allImagesSize[image] = f'{imageSizeStr} Mbytes'
|
||||
logging.debug(f'\u001B[1m {name} size is {imageSizeStr} Mbytes\u001B[0m')
|
||||
allImagesSize[name] = f'{imageSizeStr} Mbytes'
|
||||
else:
|
||||
logging.debug(f'{image} size is unknown')
|
||||
allImagesSize[image] = 'unknown'
|
||||
logging.debug(f'{name} size is unknown')
|
||||
allImagesSize[name] = 'unknown'
|
||||
# Now pruning dangling images in between target builds
|
||||
cmd.run(f"{self.cli} image prune --force")
|
||||
|
||||
# Remove all intermediate build images and clean up
|
||||
if self.ranAllowMerge and forceBaseImageBuild:
|
||||
cmd.run(f"{self.cli} image rm {baseImage}:{baseTag}")
|
||||
cmd.run(f"{self.cli} image rm ran-build:{imageTag}")
|
||||
cmd.run(f"{self.cli} image rm ran-build:{imageTag} ran-build-asan:{imageTag}")
|
||||
cmd.run(f"{self.cli} volume prune --force")
|
||||
|
||||
# create a zip with all logs
|
||||
@@ -698,10 +707,11 @@ class Containerize():
|
||||
orgTag = 'develop'
|
||||
if self.ranAllowMerge:
|
||||
orgTag = 'ci-temp'
|
||||
imageNames = ['oai-enb', 'oai-gnb', 'oai-lte-ue', 'oai-nr-ue', 'oai-lte-ru', 'oai-nr-cuup']
|
||||
for image in imageNames:
|
||||
for image in IMAGES:
|
||||
tagToUse = ImageTagToUse(image, self.ranCommitID, self.ranBranch, self.ranAllowMerge)
|
||||
mySSH.command(f'docker image tag {image}:{orgTag} {imagePrefix}/{tagToUse}', '\$', 5)
|
||||
if re.search('Error response from daemon: No such image:', mySSH.getBefore()) is not None:
|
||||
continue
|
||||
mySSH.command(f'docker push {imagePrefix}/{tagToUse}', '\$', 120)
|
||||
if re.search(': digest:', mySSH.getBefore()) is None:
|
||||
logging.debug(mySSH.getBefore())
|
||||
@@ -1061,6 +1071,16 @@ class Containerize():
|
||||
imageNames = ['oai-enb', 'oai-gnb', 'oai-lte-ue', 'oai-nr-ue', 'oai-lte-ru', 'oai-nr-cuup']
|
||||
for image in imageNames:
|
||||
tagToUse = ImageTagToUse(image, self.ranCommitID, self.ranBranch, self.ranAllowMerge)
|
||||
# In the scenario, for 5G images, we have the choice of either pulling normal images
|
||||
# or -asan images. We need to detect which kind we did pull.
|
||||
if image == 'oai-gnb' or image == 'oai-nr-ue' or image == 'oai-nr-cuup':
|
||||
ret = myCmd.run(f'docker image inspect oai-ci/{tagToUse}', reportNonZero=False, silent=self.displayedNewTags)
|
||||
if ret.returncode != 0:
|
||||
tagToUse = tagToUse.replace('oai-gnb', 'oai-gnb-asan')
|
||||
tagToUse = tagToUse.replace('oai-nr-ue', 'oai-nr-ue-asan')
|
||||
tagToUse = tagToUse.replace('oai-nr-cuup', 'oai-nr-cuup-asan')
|
||||
if not self.displayedNewTags:
|
||||
logging.debug(f'\u001B[1m Using sanitized version of {image} with {tagToUse}\u001B[0m')
|
||||
cmd = f'sed -i -e "s@oaisoftwarealliance/{image}:develop@oai-ci/{tagToUse}@" docker-compose-ci.yml'
|
||||
myCmd.run(cmd, silent=self.displayedNewTags)
|
||||
self.displayedNewTags = True
|
||||
@@ -1199,12 +1219,7 @@ class Containerize():
|
||||
logPath = '../cmake_targets/log/' + ymlPath[1]
|
||||
myCmd = cls_cmd.LocalCmd(d = self.yamlPath[0])
|
||||
cmd = 'cp docker-compose.y*ml docker-compose-ci.yml'
|
||||
myCmd.run(cmd, silent=self.displayedNewTags)
|
||||
for image in IMAGES:
|
||||
tagToUse = ImageTagToUse(image, self.ranCommitID, self.ranBranch, self.ranAllowMerge)
|
||||
cmd = f'sed -i -e "s@oaisoftwarealliance/{image}:develop@oai-ci/{tagToUse}@" docker-compose-ci.yml'
|
||||
myCmd.run(cmd, silent=self.displayedNewTags)
|
||||
self.displayedNewTags = True
|
||||
myCmd.run(cmd)
|
||||
|
||||
# check which containers are running for log recovery later
|
||||
cmd = 'docker-compose -f docker-compose-ci.yml ps --all'
|
||||
@@ -1245,7 +1260,7 @@ class Containerize():
|
||||
fullStatus = True
|
||||
if anyLogs:
|
||||
# Analyzing log file(s)!
|
||||
listOfPossibleRanContainers = ['enb', 'gnb', 'cu', 'du']
|
||||
listOfPossibleRanContainers = ['enb*', 'gnb*', 'cu*', 'du*']
|
||||
for container in listOfPossibleRanContainers:
|
||||
filenames = './*-oai-' + container + '.log'
|
||||
cmd = f'ls {filenames}'
|
||||
|
||||
@@ -75,15 +75,11 @@ security = {
|
||||
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 ="debug";
|
||||
pdcp_log_level ="info";
|
||||
rrc_log_level ="info";
|
||||
f1ap_log_level ="debug";
|
||||
ngap_log_level ="debug";
|
||||
};
|
||||
|
||||
log_config : {
|
||||
global_log_level = "info";
|
||||
pdcp_log_level = "info";
|
||||
rrc_log_level = "info";
|
||||
f1ap_log_level = "info";
|
||||
ngap_log_level = "info";
|
||||
};
|
||||
|
||||
@@ -78,12 +78,8 @@ security = {
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
hw_log_level ="info";
|
||||
phy_log_level ="info";
|
||||
mac_log_level ="info";
|
||||
rlc_log_level ="debug";
|
||||
pdcp_log_level ="info";
|
||||
rrc_log_level ="info";
|
||||
f1ap_log_level ="debug";
|
||||
ngap_log_level ="debug";
|
||||
f1ap_log_level ="info";
|
||||
ngap_log_level ="info";
|
||||
};
|
||||
@@ -8,6 +8,7 @@ gNBs =
|
||||
{
|
||||
////////// Identification parameters:
|
||||
gNB_ID = 0xe00;
|
||||
gNB_CU_UP_ID = 0xe00;
|
||||
|
||||
# cell_type = "CELL_MACRO_GNB";
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ gNBs =
|
||||
{
|
||||
////////// Identification parameters:
|
||||
gNB_ID = 0xe00;
|
||||
gNB_CU_UP_ID = 0xe00;
|
||||
|
||||
# cell_type = "CELL_MACRO_GNB";
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ gNBs =
|
||||
{
|
||||
////////// Identification parameters:
|
||||
gNB_ID = 0xe00;
|
||||
gNB_DU_ID = 0xe00;
|
||||
|
||||
# cell_type = "CELL_MACRO_GNB";
|
||||
|
||||
@@ -217,7 +218,7 @@ THREAD_STRUCT = (
|
||||
|
||||
rfsimulator: {
|
||||
serveraddr = "server";
|
||||
serverport = "4043";
|
||||
serverport = 4043;
|
||||
options = (); #("saviq"); or/and "chanmod"
|
||||
modelname = "AWGN";
|
||||
IQfile = "/tmp/rfsimulator.iqs"
|
||||
|
||||
218
ci-scripts/conf_files/gnb-du.sa.band1.52prb.usrpb210.conf
Normal file
218
ci-scripts/conf_files/gnb-du.sa.band1.52prb.usrpb210.conf
Normal file
@@ -0,0 +1,218 @@
|
||||
Active_gNBs = ( "gNB-Eurecom-DU");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
gNBs =
|
||||
(
|
||||
{
|
||||
////////// Identification parameters:
|
||||
gNB_ID = 0xe00;
|
||||
gNB_DU_ID = 0xe00;
|
||||
|
||||
# cell_type = "CELL_MACRO_GNB";
|
||||
|
||||
gNB_name = "gNB-Eurecom-DU";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = 1;
|
||||
plmn_list = ({ mcc = 222; mnc = 01; mnc_length = 2; snssaiList = ({ sst = 1, sd = 0xffffff }) });
|
||||
|
||||
|
||||
nr_cellid = 12345678L;
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
min_rxtxtime = 6;
|
||||
|
||||
|
||||
servingCellConfigCommon = (
|
||||
{
|
||||
#spCellConfigCommon
|
||||
|
||||
physCellId = 0;
|
||||
|
||||
# downlinkConfigCommon
|
||||
#frequencyInfoDL
|
||||
# this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP)
|
||||
absoluteFrequencySSB = 423130;
|
||||
dl_frequencyBand = 1;
|
||||
# this is 3600 MHz
|
||||
dl_absoluteFrequencyPointA = 422194;
|
||||
#scs-SpecificCarrierList
|
||||
dl_offstToCarrier = 0;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
dl_subcarrierSpacing = 0;
|
||||
dl_carrierBandwidth = 52;
|
||||
#initialDownlinkBWP
|
||||
#genericParameters
|
||||
# this is RBstart=27,L=48 (275*(L-1))+RBstart
|
||||
initialDLBWPlocationAndBandwidth = 14025; # 6366 12925 12956 28875 12952
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialDLBWPsubcarrierSpacing = 0;
|
||||
#pdcch-ConfigCommon
|
||||
initialDLBWPcontrolResourceSetZero = 7;
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
ul_frequencyBand = 1;
|
||||
ul_absoluteFrequencyPointA = 384194;
|
||||
#scs-SpecificCarrierList
|
||||
ul_offstToCarrier = 0;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
ul_subcarrierSpacing = 0;
|
||||
ul_carrierBandwidth = 52;
|
||||
pMax = 20;
|
||||
#initialUplinkBWP
|
||||
#genericParameters
|
||||
initialULBWPlocationAndBandwidth = 14025;
|
||||
# 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 = 12;
|
||||
preambleReceivedTargetPower = -90;
|
||||
#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 = 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 = -70;
|
||||
n_TimingAdvanceOffset = 0;
|
||||
# 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;
|
||||
ssPBCH_BlockPower = -25;
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
|
||||
# ------- SCTP definitions
|
||||
SCTP :
|
||||
{
|
||||
# Number of streams to use in input/output
|
||||
SCTP_INSTREAMS = 2;
|
||||
SCTP_OUTSTREAMS = 2;
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
MACRLCs = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_s_preference = "local_L1";
|
||||
tr_n_preference = "f1";
|
||||
local_n_if_name = "eth0";
|
||||
local_n_address = "192.168.68.195";
|
||||
remote_n_address = "192.168.68.194";
|
||||
local_n_portc = 500;
|
||||
local_n_portd = 2153;
|
||||
remote_n_portc = 501;
|
||||
remote_n_portd = 2153;
|
||||
pusch_TargetSNRx10 = 200;
|
||||
pucch_TargetSNRx10 = 200;
|
||||
ulsch_max_frame_inactivity = 1;
|
||||
}
|
||||
);
|
||||
|
||||
L1s = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_n_preference = "local_mac";
|
||||
prach_dtx_threshold = 200;
|
||||
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
|
||||
# The higher att for TX than RX is because we use a circulator (as for TDD),
|
||||
# while we should use a duplexer in the FDD case. However, it uses the same setup.
|
||||
att_tx = 18
|
||||
att_rx = 0;
|
||||
bands = [1];
|
||||
max_pdschReferenceSignalPower = -27;
|
||||
max_rxgain = 108;
|
||||
eNB_instances = [0];
|
||||
#beamforming 1x4 matrix:
|
||||
bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000];
|
||||
clock_src = "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";
|
||||
}
|
||||
);
|
||||
|
||||
log_config : {
|
||||
global_log_level = "info";
|
||||
};
|
||||
@@ -7,6 +7,7 @@ gNBs =
|
||||
{
|
||||
////////// Identification parameters:
|
||||
gNB_ID = 0xe00;
|
||||
gNB_DU_ID = 0xe00;
|
||||
|
||||
# cell_type = "CELL_MACRO_GNB";
|
||||
|
||||
@@ -217,21 +218,17 @@ THREAD_STRUCT = (
|
||||
);
|
||||
rfsimulator: {
|
||||
serveraddr = "server";
|
||||
serverport = "4043";
|
||||
serverport = 4043;
|
||||
options = (); #("saviq"); or/and "chanmod"
|
||||
modelname = "AWGN";
|
||||
IQfile = "/tmp/rfsimulator.iqs"
|
||||
}
|
||||
|
||||
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";
|
||||
f1ap_log_level ="debug";
|
||||
ngap_log_level ="debug";
|
||||
};
|
||||
log_config: {
|
||||
global_log_level = "info";
|
||||
hw_log_level = "info";
|
||||
phy_log_level = "info";
|
||||
mac_log_level = "info";
|
||||
rlc_log_level = "info";
|
||||
f1ap_log_level = "info";
|
||||
};
|
||||
|
||||
@@ -7,6 +7,7 @@ gNBs =
|
||||
{
|
||||
////////// Identification parameters:
|
||||
gNB_ID = 0xe00;
|
||||
gNB_DU_ID = 0xe00;
|
||||
|
||||
# cell_type = "CELL_MACRO_GNB";
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@ gNBs =
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialULBWPsubcarrierSpacing = 1;
|
||||
initialDLBWPcontrolResourceSetZero = 0;
|
||||
#rach-ConfigCommon
|
||||
#rach-ConfigGeneric
|
||||
prach_ConfigurationIndex = 98;
|
||||
|
||||
@@ -230,7 +230,7 @@ THREAD_STRUCT = (
|
||||
rfsimulator :
|
||||
{
|
||||
serveraddr = "server";
|
||||
serverport = "4043";
|
||||
serverport = 4043;
|
||||
options = (); #("saviq"); or/and "chanmod"
|
||||
modelname = "AWGN";
|
||||
IQfile = "/tmp/rfsimulator.iqs";
|
||||
|
||||
@@ -240,7 +240,7 @@ THREAD_STRUCT = (
|
||||
rfsimulator :
|
||||
{
|
||||
serveraddr = "server";
|
||||
serverport = "4043";
|
||||
serverport = 4043;
|
||||
options = (); #("saviq"); or/and "chanmod"
|
||||
modelname = "AWGN";
|
||||
IQfile = "/tmp/rfsimulator.iqs";
|
||||
|
||||
@@ -220,7 +220,7 @@ RUs = (
|
||||
att_rx = 0;
|
||||
bands = [78];
|
||||
max_pdschReferenceSignalPower = -27;
|
||||
max_rxgain = 75;
|
||||
max_rxgain = 65;
|
||||
eNB_instances = [0];
|
||||
##beamforming 1x2 matrix: 1 layer x 2 antennas
|
||||
bf_weights = [0x00007fff, 0x0000];
|
||||
|
||||
@@ -232,7 +232,7 @@ THREAD_STRUCT = (
|
||||
rfsimulator :
|
||||
{
|
||||
serveraddr = "server";
|
||||
serverport = "4043";
|
||||
serverport = 4043;
|
||||
options = (); #("saviq"); or/and "chanmod"
|
||||
modelname = "AWGN";
|
||||
IQfile = "/tmp/rfsimulator.iqs";
|
||||
|
||||
@@ -75,7 +75,7 @@ gNBs =
|
||||
initialULBWPsubcarrierSpacing = 1;
|
||||
#rach-ConfigCommon
|
||||
#rach-ConfigGeneric
|
||||
prach_ConfigurationIndex = 98;
|
||||
prach_ConfigurationIndex = 100;
|
||||
#prach_msg1_FDM
|
||||
#0 = one, 1=two, 2=four, 3=eight
|
||||
prach_msg1_FDM = 0;
|
||||
|
||||
@@ -230,7 +230,7 @@ THREAD_STRUCT = (
|
||||
rfsimulator :
|
||||
{
|
||||
serveraddr = "server";
|
||||
serverport = "4043";
|
||||
serverport = 4043;
|
||||
options = (); #("saviq"); or/and "chanmod"
|
||||
modelname = "AWGN";
|
||||
IQfile = "/tmp/rfsimulator.iqs";
|
||||
|
||||
@@ -229,7 +229,7 @@ THREAD_STRUCT = (
|
||||
rfsimulator :
|
||||
{
|
||||
serveraddr = "server";
|
||||
serverport = "4043";
|
||||
serverport = 4043;
|
||||
options = (); #("saviq"); or/and "chanmod"
|
||||
modelname = "AWGN";
|
||||
IQfile = "/tmp/rfsimulator.iqs";
|
||||
|
||||
@@ -8,7 +8,7 @@ ColNames :
|
||||
- Average vs Reference Deviation (Reference Value; Acceptability Threshold)
|
||||
Ref :
|
||||
feprx : 84.0
|
||||
feptx_prec : 11.0
|
||||
feptx_prec : 14.0
|
||||
feptx_ofdm : 35.0
|
||||
feptx_total : 100.0
|
||||
L1 Tx processing : 400.0
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<class>Pull_Local_Registry</class>
|
||||
<desc>Pull Images from Local Registry</desc>
|
||||
<test_svr_id>0</test_svr_id>
|
||||
<images_to_pull>oai-gnb oai-nr-cuup oai-nr-ue</images_to_pull>
|
||||
<images_to_pull>oai-gnb-asan oai-nr-cuup-asan oai-nr-ue-asan</images_to_pull>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000020">
|
||||
|
||||
@@ -32,9 +32,8 @@
|
||||
000022
|
||||
000023
|
||||
000024
|
||||
000025
|
||||
020021
|
||||
020022
|
||||
030021
|
||||
100021
|
||||
</TestCaseRequestedList>
|
||||
<TestCaseExclusionList></TestCaseExclusionList>
|
||||
@@ -43,7 +42,7 @@
|
||||
<class>Pull_Local_Registry</class>
|
||||
<desc>Pull Images from Local Registry</desc>
|
||||
<test_svr_id>0</test_svr_id>
|
||||
<images_to_pull>oai-gnb oai-nr-ue</images_to_pull>
|
||||
<images_to_pull>oai-gnb-asan oai-nr-ue-asan</images_to_pull>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000020">
|
||||
@@ -72,33 +71,33 @@
|
||||
|
||||
<testCase id="000023">
|
||||
<class>DeployGenObject</class>
|
||||
<desc>Deploy OAI 5G DU RF sim SA</desc>
|
||||
<desc>Deploy 3 OAI 5G DUs RF sim SA</desc>
|
||||
<yaml_path>yaml_files/5g_f1_rfsimulator</yaml_path>
|
||||
<services>oai-du</services>
|
||||
<nb_healthy>8</nb_healthy>
|
||||
<services>oai-du oai-du2 oai-du3</services>
|
||||
<nb_healthy>10</nb_healthy>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000024">
|
||||
<class>DeployGenObject</class>
|
||||
<desc>Deploy OAI 5G NR-UE RF sim SA</desc>
|
||||
<yaml_path>yaml_files/5g_f1_rfsimulator</yaml_path>
|
||||
<services>oai-nr-ue</services>
|
||||
<nb_healthy>9</nb_healthy>
|
||||
<services>oai-nr-ue oai-nr-ue2</services>
|
||||
<nb_healthy>12</nb_healthy>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000025">
|
||||
<class>DeployGenObject</class>
|
||||
<desc>Deploy OAI 5G NR-UE RF sim SA</desc>
|
||||
<yaml_path>yaml_files/5g_f1_rfsimulator</yaml_path>
|
||||
<services>oai-nr-ue3</services>
|
||||
<nb_healthy>13</nb_healthy>
|
||||
</testCase>
|
||||
|
||||
<testCase id="020021">
|
||||
<class>Ping</class>
|
||||
<desc>Ping ext-dn from NR-UE</desc>
|
||||
<id>rfsim5g_ue</id>
|
||||
<ping_args> -c 20 192.168.72.135</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="020022">
|
||||
<class>Ping</class>
|
||||
<desc>Ping NR-UE from ext-dn</desc>
|
||||
<id>rfsim5g_ext_dn</id>
|
||||
<ping_args>-c 20 12.1.1.2</ping_args>
|
||||
<desc>Ping ext-dn from all NR-UEs</desc>
|
||||
<id>rfsim5g_ue rfsim5g_ue2 rfsim5g_ue3</id>
|
||||
<ping_args> -c 20 192.168.72.135 -i0.25</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<class>Pull_Local_Registry</class>
|
||||
<desc>Pull Images from Local Registry</desc>
|
||||
<test_svr_id>0</test_svr_id>
|
||||
<images_to_pull>oai-gnb oai-nr-ue</images_to_pull>
|
||||
<images_to_pull>oai-gnb-asan oai-nr-ue-asan</images_to_pull>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000010">
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<class>Pull_Local_Registry</class>
|
||||
<desc>Pull Images from Local Registry</desc>
|
||||
<test_svr_id>0</test_svr_id>
|
||||
<images_to_pull>oai-gnb oai-nr-ue</images_to_pull>
|
||||
<images_to_pull>oai-gnb-asan oai-nr-ue-asan</images_to_pull>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000000">
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
<class>Pull_Local_Registry</class>
|
||||
<desc>Pull Images from Local Registry</desc>
|
||||
<test_svr_id>0</test_svr_id>
|
||||
<images_to_pull>oai-gnb oai-nr-ue</images_to_pull>
|
||||
<images_to_pull>oai-gnb-asan oai-nr-ue-asan</images_to_pull>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000000">
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<class>Pull_Local_Registry</class>
|
||||
<desc>Pull Images from Local Registry</desc>
|
||||
<test_svr_id>0</test_svr_id>
|
||||
<images_to_pull>oai-gnb oai-nr-ue</images_to_pull>
|
||||
<images_to_pull>oai-gnb-asan oai-nr-ue-asan</images_to_pull>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000000">
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<class>Pull_Local_Registry</class>
|
||||
<desc>Pull Images from Local Registry</desc>
|
||||
<test_svr_id>0</test_svr_id>
|
||||
<images_to_pull>oai-gnb oai-nr-ue</images_to_pull>
|
||||
<images_to_pull>oai-gnb-asan oai-nr-ue-asan</images_to_pull>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000000">
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<class>Pull_Local_Registry</class>
|
||||
<desc>Pull Images from Local Registry</desc>
|
||||
<test_svr_id>0</test_svr_id>
|
||||
<images_to_pull>oai-gnb oai-nr-ue</images_to_pull>
|
||||
<images_to_pull>oai-gnb-asan oai-nr-ue-asan</images_to_pull>
|
||||
</testCase>
|
||||
|
||||
<testCase id="004000">
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<class>Pull_Local_Registry</class>
|
||||
<desc>Pull Images from Local Registry</desc>
|
||||
<test_svr_id>0</test_svr_id>
|
||||
<images_to_pull>oai-gnb oai-nr-ue</images_to_pull>
|
||||
<images_to_pull>oai-gnb-asan oai-nr-ue-asan</images_to_pull>
|
||||
</testCase>
|
||||
|
||||
<testCase id="004000">
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<class>Pull_Local_Registry</class>
|
||||
<desc>Pull Images from Local Registry</desc>
|
||||
<test_svr_id>0</test_svr_id>
|
||||
<images_to_pull>oai-gnb oai-nr-ue</images_to_pull>
|
||||
<images_to_pull>oai-gnb-asan oai-nr-ue-asan</images_to_pull>
|
||||
</testCase>
|
||||
|
||||
<testCase id="004000">
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<class>Pull_Local_Registry</class>
|
||||
<desc>Pull Images from Local Registry</desc>
|
||||
<test_svr_id>0</test_svr_id>
|
||||
<images_to_pull>oai-gnb oai-nr-ue</images_to_pull>
|
||||
<images_to_pull>oai-gnb-asan oai-nr-ue-asan</images_to_pull>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000000">
|
||||
|
||||
@@ -35,6 +35,11 @@
|
||||
002003
|
||||
002004
|
||||
002005
|
||||
002006
|
||||
002007
|
||||
002008
|
||||
002009
|
||||
002010
|
||||
000100
|
||||
000010
|
||||
000020
|
||||
@@ -97,12 +102,42 @@
|
||||
<id>amarisoft_ue_5</id>
|
||||
</testCase>
|
||||
|
||||
<testCase id="002006">
|
||||
<class>Attach_UE</class>
|
||||
<desc>Attach UE</desc>
|
||||
<id>amarisoft_ue_6</id>
|
||||
</testCase>
|
||||
|
||||
<testCase id="002007">
|
||||
<class>Attach_UE</class>
|
||||
<desc>Attach UE</desc>
|
||||
<id>amarisoft_ue_7</id>
|
||||
</testCase>
|
||||
|
||||
<testCase id="002008">
|
||||
<class>Attach_UE</class>
|
||||
<desc>Attach UE</desc>
|
||||
<id>amarisoft_ue_8</id>
|
||||
</testCase>
|
||||
|
||||
<testCase id="002009">
|
||||
<class>Attach_UE</class>
|
||||
<desc>Attach UE</desc>
|
||||
<id>amarisoft_ue_9</id>
|
||||
</testCase>
|
||||
|
||||
<testCase id="002010">
|
||||
<class>Attach_UE</class>
|
||||
<desc>Attach UE</desc>
|
||||
<id>amarisoft_ue_10</id>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000010">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (DL/20Mbps/UDP)(30 sec)(multi-ue profile)</desc>
|
||||
<iperf_args>-u -b 60M -t 30 -i 1 -R</iperf_args>
|
||||
<desc>iperf (DL/7Mbps/UDP)(30 sec)(multi-ue profile)</desc>
|
||||
<iperf_args>-u -b 70M -t 30 -i 1 -R</iperf_args>
|
||||
<direction>IPERF3</direction>
|
||||
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3</id>
|
||||
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10</id>
|
||||
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>
|
||||
<iperf_profile>balanced</iperf_profile>
|
||||
@@ -110,10 +145,10 @@
|
||||
|
||||
<testCase id="000020">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (UL/5Mbps/UDP)(30 sec)(multi-ue profile)</desc>
|
||||
<iperf_args>-u -b 15M -t 30 -i 1 </iperf_args>
|
||||
<desc>iperf (UL/2Mbps/UDP)(30 sec)(multi-ue profile)</desc>
|
||||
<iperf_args>-u -b 20M -t 30 -i 1 </iperf_args>
|
||||
<direction>IPERF3</direction>
|
||||
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3</id>
|
||||
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10</id>
|
||||
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>
|
||||
<iperf_profile>balanced</iperf_profile>
|
||||
@@ -122,7 +157,7 @@
|
||||
<testCase id="000100">
|
||||
<class>Ping</class>
|
||||
<desc>Ping: 20pings in 20sec, multi-ue</desc>
|
||||
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5</id>
|
||||
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10</id>
|
||||
<ping_args>-c 20 %cn_ip%</ping_args>
|
||||
<ping_packetloss_threshold>1</ping_packetloss_threshold>
|
||||
<ping_rttavg_threshold>25</ping_rttavg_threshold>
|
||||
@@ -131,7 +166,7 @@
|
||||
<testCase id="000200">
|
||||
<class>Ping</class>
|
||||
<desc>Ping: 100pings in 20sec, multi-ue</desc>
|
||||
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5</id>
|
||||
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10</id>
|
||||
<ping_args>-c 100 -i 0.2 %cn_ip%</ping_args>
|
||||
<ping_packetloss_threshold>1</ping_packetloss_threshold>
|
||||
<ping_rttavg_threshold>30</ping_rttavg_threshold>
|
||||
@@ -140,7 +175,7 @@
|
||||
<testCase id="003000">
|
||||
<class>Detach_UE</class>
|
||||
<desc>Detach UE</desc>
|
||||
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5</id>
|
||||
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10</id>
|
||||
</testCase>
|
||||
|
||||
<testCase id="004000">
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
-->
|
||||
<testCaseList>
|
||||
<htmlTabRef>TEST-SA-FR1-F1-B200</htmlTabRef>
|
||||
<htmlTabName>40 MHz TDD F1 SA</htmlTabName>
|
||||
<htmlTabName>10 MHz FDD F1 SA</htmlTabName>
|
||||
<htmlTabIcon>tasks</htmlTabIcon>
|
||||
<repeatCount>1</repeatCount>
|
||||
<TestCaseRequestedList>
|
||||
@@ -89,11 +89,11 @@
|
||||
|
||||
<testCase id="130102">
|
||||
<class>Deploy_Object</class>
|
||||
<desc>Deploy gNB-DU (TDD/Band78/40MHz/B200) in a container</desc>
|
||||
<desc>Deploy gNB-DU (FDD/Band1/10MHz/B200) in a container</desc>
|
||||
<yaml_path>ci-scripts/yaml_files/sa_f1_b200_gnb</yaml_path>
|
||||
<eNB_instance>0</eNB_instance>
|
||||
<eNB_serverId>0</eNB_serverId>
|
||||
<services>gnb_du_tdd</services>
|
||||
<services>gnb_du_fdd</services>
|
||||
</testCase>
|
||||
|
||||
<testCase id="100000">
|
||||
@@ -159,8 +159,8 @@
|
||||
|
||||
<testCase id="170000">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (DL/80Mbps/UDP)(30 sec)</desc>
|
||||
<iperf_args>-u -b 80M -t 30 -i 1 -fm</iperf_args>
|
||||
<desc>iperf (DL/50Mbps/UDP)(30 sec)</desc>
|
||||
<iperf_args>-u -b 50M -t 30 -i 1 -fm</iperf_args>
|
||||
<direction>DL</direction>
|
||||
<id>idefix</id>
|
||||
<iperf_packetloss_threshold>10</iperf_packetloss_threshold>
|
||||
@@ -170,8 +170,8 @@
|
||||
|
||||
<testCase id="170001">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (UL/8Mbps/UDP)(30 sec)</desc>
|
||||
<iperf_args>-u -b 8M -t 30 -i 1 -fm</iperf_args>
|
||||
<desc>iperf (UL/25Mbps/UDP)(30 sec)</desc>
|
||||
<iperf_args>-u -b 25M -t 30 -i 1 -fm</iperf_args>
|
||||
<direction>UL</direction>
|
||||
<id>idefix</id>
|
||||
<iperf_packetloss_threshold>1</iperf_packetloss_threshold>
|
||||
@@ -181,8 +181,8 @@
|
||||
|
||||
<testCase id="170002">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (BIDIR TCP)(20 sec)(single-ue profile)</desc>
|
||||
<iperf_args>-t 20 --bidir</iperf_args>
|
||||
<desc>iperf (BIDIR TCP)(60 sec)(single-ue profile)</desc>
|
||||
<iperf_args>-t 60 --bidir</iperf_args>
|
||||
<direction>BIDIR</direction>
|
||||
<id>idefix</id>
|
||||
<iperf_profile>single-ue</iperf_profile>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<mode>TesteNB</mode>
|
||||
<class>Build_eNB</class>
|
||||
<desc>Build gNB (USRP)</desc>
|
||||
<Build_eNB_args>--gNB -w USRP --ninja -c -P --build-lib "ldpc_cuda ldpc_t1" --cmake-opt -DASN1C_EXEC=/opt/asn1c/bin/asn1c</Build_eNB_args>
|
||||
<Build_eNB_args>--gNB -w USRP --ninja -c -P --build-lib "ldpc_cuda" --cmake-opt -DASN1C_EXEC=/opt/asn1c/bin/asn1c</Build_eNB_args>
|
||||
<forced_workspace_cleanup>True</forced_workspace_cleanup>
|
||||
</testCase>
|
||||
|
||||
|
||||
@@ -1,102 +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
|
||||
-->
|
||||
|
||||
<testCaseList>
|
||||
<htmlTabRef>test-t1-offload</htmlTabRef>
|
||||
<htmlTabName>Test T1 Offload</htmlTabName>
|
||||
<htmlTabIcon>tasks</htmlTabIcon>
|
||||
<repeatCount>1</repeatCount>
|
||||
<TestCaseRequestedList>000111 000112 000121 000122 000131 000132 000211 000212 000221 000222 000231 000232</TestCaseRequestedList>
|
||||
<TestCaseExclusionList></TestCaseExclusionList>
|
||||
|
||||
<testCase id="000111">
|
||||
<class>Run_LDPCt1Test</class>
|
||||
<desc>Run nr_ulsim with CPU</desc>
|
||||
<physim_run_args>-n100 -s30 -m5 -r106 -R106 -C10 -P</physim_run_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000112">
|
||||
<class>Run_LDPCt1Test</class>
|
||||
<desc>Run nr_ulsim with T1 LDPC offload</desc>
|
||||
<physim_run_args>-n100 -s30 -m5 -r106 -R106 -o -P</physim_run_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000121">
|
||||
<class>Run_LDPCt1Test</class>
|
||||
<desc>Run nr_ulsim with CPU</desc>
|
||||
<physim_run_args>-n100 -s30 -m15 -r106 -R106 -C10 -P</physim_run_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000122">
|
||||
<class>Run_LDPCt1Test</class>
|
||||
<desc>Run nr_ulsim with T1 LDPC offload</desc>
|
||||
<physim_run_args>-n100 -s30 -m15 -r106 -R106 -o -P</physim_run_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000131">
|
||||
<class>Run_LDPCt1Test</class>
|
||||
<desc>Run nr_ulsim with CPU</desc>
|
||||
<physim_run_args>-n100 -s30 -m25 -r106 -R106 -C10 -P</physim_run_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000132">
|
||||
<class>Run_LDPCt1Test</class>
|
||||
<desc>Run nr_ulsim with T1 LDPC offload</desc>
|
||||
<physim_run_args>-n100 -s30 -m25 -r106 -R106 -o -P</physim_run_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000211">
|
||||
<class>Run_LDPCt1Test</class>
|
||||
<desc>Run nr_ulsim with CPU</desc>
|
||||
<physim_run_args>-n100 -s30 -m5 -r273 -R273 -C10 -P</physim_run_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000212">
|
||||
<class>Run_LDPCt1Test</class>
|
||||
<desc>Run nr_ulsim with T1 LDPC offload</desc>
|
||||
<physim_run_args>-n100 -s30 -m5 -r273 -R273 -o -P</physim_run_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000221">
|
||||
<class>Run_LDPCt1Test</class>
|
||||
<desc>Run nr_ulsim with CPU</desc>
|
||||
<physim_run_args>-n100 -s30 -m15 -r273 -R273 -C10 -P</physim_run_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000222">
|
||||
<class>Run_LDPCt1Test</class>
|
||||
<desc>Run nr_ulsim with T1 LDPC offload</desc>
|
||||
<physim_run_args>-n100 -s30 -m15 -r273 -R273 -o -P</physim_run_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000231">
|
||||
<class>Run_LDPCt1Test</class>
|
||||
<desc>Run nr_ulsim with CPU</desc>
|
||||
<physim_run_args>-n100 -s30 -m25 -r273 -R273 -C10 -P</physim_run_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000232">
|
||||
<class>Run_LDPCt1Test</class>
|
||||
<desc>Run nr_ulsim with T1 LDPC offload</desc>
|
||||
<physim_run_args>-n100 -s30 -m25 -r273 -R273 -o -P</physim_run_args>
|
||||
</testCase>
|
||||
|
||||
</testCaseList>
|
||||
@@ -168,6 +168,7 @@ services:
|
||||
container_name: rfsim5g-oai-cu
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --sa --rfsim --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-ext-dn
|
||||
networks:
|
||||
@@ -186,6 +187,7 @@ services:
|
||||
container_name: rfsim5g-oai-du
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --sa --rfsim --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-cu
|
||||
networks:
|
||||
@@ -198,12 +200,51 @@ services:
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
oai-du2:
|
||||
image: oaisoftwarealliance/oai-gnb:develop
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-du2
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --sa --rfsim --gNBs.[0].gNB_DU_ID 0xe01 --gNBs.[0].nr_cellid 87654321 --gNBs.[0].servingCellConfigCommon.[0].physCellId 1 --MACRLCs.[0].local_n_address 192.168.71.143 --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-cu
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.143
|
||||
volumes:
|
||||
- ../../conf_files/gnb-du.sa.band78.106prb.rfsim.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
oai-du3:
|
||||
image: oaisoftwarealliance/oai-gnb:develop
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-du3
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --sa --rfsim --gNBs.[0].gNB_DU_ID 0xe02 --gNBs.[0].nr_cellid 11111111 --gNBs.[0].servingCellConfigCommon.[0].physCellId 2 --MACRLCs.[0].local_n_address 192.168.71.144 --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-cu
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.144
|
||||
volumes:
|
||||
- ../../conf_files/gnb-du.sa.band78.106prb.rfsim.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
oai-nr-ue:
|
||||
image: oaisoftwarealliance/oai-nr-ue:develop
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-nr-ue
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001100 -C 3619200000 --rfsimulator.serveraddr 192.168.71.142 --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-du
|
||||
networks:
|
||||
@@ -216,6 +257,44 @@ services:
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
oai-nr-ue2:
|
||||
image: oaisoftwarealliance/oai-nr-ue:develop
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-nr-ue2
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001101 -C 3619200000 --rfsimulator.serveraddr 192.168.71.143 --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-du2
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.151
|
||||
volumes:
|
||||
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
oai-nr-ue3:
|
||||
image: oaisoftwarealliance/oai-nr-ue:develop
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-nr-ue3
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001102 -C 3619200000 --rfsimulator.serveraddr 192.168.71.144 --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-du3
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.152
|
||||
volumes:
|
||||
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
networks:
|
||||
public_net:
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -168,6 +168,7 @@ services:
|
||||
container_name: rfsim5g-oai-gnb
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --sa -E --rfsim --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-ext-dn
|
||||
networks:
|
||||
@@ -186,6 +187,7 @@ services:
|
||||
container_name: rfsim5g-oai-nr-ue
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001100 --band 66 -C 2169090000 --CO -400000000 --ssb 378 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-gnb
|
||||
networks:
|
||||
|
||||
@@ -170,6 +170,7 @@ services:
|
||||
environment:
|
||||
TZ: Europe/Paris
|
||||
USE_ADDITIONAL_OPTIONS: --sa --nfapi VNF --emulate-l1 --log_config.global_log_options level,time,thread_id,nocolor
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-spgwu
|
||||
- oai-amf
|
||||
@@ -206,6 +207,7 @@ services:
|
||||
TZ: Europe/Paris
|
||||
OPENAIR_DIR: /opt/oai-nr-ue
|
||||
USE_ADDITIONAL_OPTIONS: --nfapi STANDALONE_PNF --node-number 2 --sa --emulate-l1 --log_config.global_log_options level,time,thread_id,nocolor
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
volumes:
|
||||
- ../../conf_files/nrue.band78.106prb.l2sim.conf:/opt/oai-nr-ue/etc/nr-ue.conf
|
||||
- ../../../openair1/SIMULATION/LTE_PHY/BLER_SIMULATIONS/AWGN/AWGN_results:/opt/oai-nr-ue/openair1/SIMULATION/LTE_PHY/BLER_SIMULATIONS/AWGN/AWGN_results
|
||||
|
||||
@@ -168,6 +168,7 @@ services:
|
||||
container_name: rfsim5g-oai-gnb
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --sa -E --rfsim --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-ext-dn
|
||||
networks:
|
||||
@@ -186,6 +187,7 @@ services:
|
||||
container_name: rfsim5g-oai-nr-ue
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001100 -C 3619200000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-gnb
|
||||
networks:
|
||||
@@ -204,6 +206,7 @@ services:
|
||||
container_name: rfsim5g-oai-nr-ue2
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001101 -C 3619200000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-gnb
|
||||
networks:
|
||||
@@ -222,6 +225,7 @@ services:
|
||||
container_name: rfsim5g-oai-nr-ue3
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001102 -C 3619200000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-gnb
|
||||
networks:
|
||||
@@ -240,6 +244,7 @@ services:
|
||||
container_name: rfsim5g-oai-nr-ue4
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001103 -C 3619200000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-gnb
|
||||
networks:
|
||||
@@ -258,6 +263,7 @@ services:
|
||||
container_name: rfsim5g-oai-nr-ue5
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001104 -C 3619200000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-gnb
|
||||
networks:
|
||||
@@ -276,6 +282,7 @@ services:
|
||||
container_name: rfsim5g-oai-nr-ue6
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001105 -C 3619200000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-gnb
|
||||
networks:
|
||||
@@ -294,6 +301,7 @@ services:
|
||||
container_name: rfsim5g-oai-nr-ue7
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001106 -C 3619200000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-gnb
|
||||
networks:
|
||||
@@ -312,6 +320,7 @@ services:
|
||||
container_name: rfsim5g-oai-nr-ue8
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001107 -C 3619200000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-gnb
|
||||
networks:
|
||||
@@ -330,6 +339,7 @@ services:
|
||||
container_name: rfsim5g-oai-nr-ue9
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001108 -C 3619200000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-gnb
|
||||
networks:
|
||||
@@ -348,6 +358,7 @@ services:
|
||||
container_name: rfsim5g-oai-nr-ue10
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001109 -C 3619200000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-gnb
|
||||
networks:
|
||||
|
||||
@@ -168,6 +168,7 @@ services:
|
||||
container_name: rfsim5g-oai-gnb
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --sa --rfsim --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-ext-dn
|
||||
networks:
|
||||
@@ -186,6 +187,7 @@ services:
|
||||
container_name: rfsim5g-oai-nr-ue
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --sa --rfsim -r 24 --ssb 24 --numerology 1 -C 3604800000 --uicc0.imsi 208990100001100 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-gnb
|
||||
networks:
|
||||
|
||||
@@ -168,6 +168,7 @@ services:
|
||||
container_name: rfsim5g-oai-gnb
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --sa --rfsim --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-ext-dn
|
||||
networks:
|
||||
@@ -187,6 +188,7 @@ services:
|
||||
container_name: rfsim5g-oai-nr-ue
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --sa --rfsim -r 106 --numerology 1 --band 78 -C 3319680000 --ue-nb-ant-tx 2 --uicc0.imsi 208990100001100 --ue-nb-ant-rx 2 --uecap_file /opt/oai-nr-ue/etc/uecap.xml --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-gnb
|
||||
networks:
|
||||
|
||||
@@ -170,6 +170,7 @@ services:
|
||||
container_name: rfsim5g-oai-cucp
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --sa --rfsim --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-ext-dn
|
||||
networks:
|
||||
@@ -190,8 +191,8 @@ services:
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-cuup
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --sa --rfsim
|
||||
#--log_config.global_log_options level,nocolor,time
|
||||
USE_ADDITIONAL_OPTIONS: --sa --rfsim --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-cucp
|
||||
networks:
|
||||
@@ -213,6 +214,7 @@ services:
|
||||
container_name: rfsim5g-oai-du
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --sa --rfsim --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
networks:
|
||||
ran_net:
|
||||
ipv4_address: 192.168.72.142
|
||||
@@ -230,6 +232,7 @@ services:
|
||||
container_name: rfsim5g-oai-nr-ue
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --sa --rfsim -r 106 --numerology 1 -C 3619200000 --rfsimulator.serveraddr 192.168.72.142 --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-du
|
||||
networks:
|
||||
|
||||
@@ -6,6 +6,7 @@ services:
|
||||
container_name: rfsim5g-oai-gnb
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --phy-test --rfsim --rfsimulator.wait_timeout 20 --noS1 --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.140
|
||||
@@ -24,6 +25,7 @@ services:
|
||||
container_name: rfsim5g-oai-nr-ue
|
||||
environment:
|
||||
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
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
volumes:
|
||||
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
|
||||
- rrc.config:/opt/oai-nr-ue/etc/rrc/
|
||||
|
||||
@@ -6,6 +6,7 @@ services:
|
||||
container_name: rfsim5g-oai-gnb
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --do-ra --rfsim --rfsimulator.wait_timeout 20 --noS1 --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.140
|
||||
@@ -24,6 +25,7 @@ services:
|
||||
container_name: rfsim5g-oai-nr-ue
|
||||
environment:
|
||||
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
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
volumes:
|
||||
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
|
||||
- rrc.config:/opt/oai-nr-ue/etc/rrc/
|
||||
|
||||
@@ -6,6 +6,7 @@ services:
|
||||
container_name: rfsim5g-oai-gnb
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --do-ra --rfsim --rfsimulator.wait_timeout 20 --noS1 --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.140
|
||||
@@ -24,6 +25,7 @@ services:
|
||||
container_name: rfsim5g-oai-nr-ue
|
||||
environment:
|
||||
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
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
volumes:
|
||||
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
|
||||
- rrc.config:/opt/oai-nr-ue/etc/rrc/
|
||||
|
||||
@@ -168,6 +168,7 @@ services:
|
||||
container_name: rfsim5g-oai-gnb
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --sa --rfsim --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-ext-dn
|
||||
networks:
|
||||
@@ -187,6 +188,7 @@ services:
|
||||
container_name: rfsim5g-oai-nr-ue
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --sa --rfsim -r 25 --numerology 0 --uicc0.imsi 208990100001100 --band 66 -C 2152260000 --CO -400000000 --ssb 76 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
|
||||
ASAN_OPTIONS: detect_leaks=0
|
||||
depends_on:
|
||||
- oai-gnb
|
||||
networks:
|
||||
|
||||
@@ -7,7 +7,7 @@ services:
|
||||
container_name: oai-gnb
|
||||
environment:
|
||||
TZ: Europe/Paris
|
||||
USE_ADDITIONAL_OPTIONS: --sa --tune-offset 20000000 --log_config.global_log_options level,nocolor,time
|
||||
USE_ADDITIONAL_OPTIONS: --sa --tune-offset 20000000 -A 45 --log_config.global_log_options level,nocolor,time
|
||||
volumes:
|
||||
- ../../conf_files/gnb.sa.band78.106prb.n310.7ds2u.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
|
||||
@@ -8,7 +8,7 @@ services:
|
||||
#entrypoint: /bin/bash -c "sleep infinity"
|
||||
environment:
|
||||
TZ: Europe/Paris
|
||||
USE_ADDITIONAL_OPTIONS: --usrp-args type=n3xx,name=ni-n3xx-31641B9,addr=192.168.20.2 -r 106 --numerology 1 --band 78 -C 3511200000 --sa --ue-fo-compensation --ue-rxgain 65 --tune-offset 20000000 --log_config.global_log_options level,nocolor,time --uicc0.imsi 208970000000111 --uicc0.nssai_sd 16777215
|
||||
USE_ADDITIONAL_OPTIONS: --usrp-args type=n3xx,name=ni-n3xx-31641B9,addr=192.168.20.2 -r 106 --numerology 1 --band 78 -C 3511200000 --sa --ue-fo-compensation --ue-rxgain 65 --tune-offset 20000000 -A 45 --log_config.global_log_options level,nocolor,time --uicc0.imsi 208970000000111 --uicc0.nssai_sd 16777215
|
||||
volumes:
|
||||
- ../../conf_files/ue.sa.conf:/opt/oai-nr-ue/etc/nr-ue.conf
|
||||
healthcheck:
|
||||
|
||||
@@ -8,7 +8,7 @@ services:
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --sa --telnetsrv --telnetsrv.shrmod ci --log_config.global_log_options level,nocolor,time,line_num,function
|
||||
volumes:
|
||||
- ../../conf_files/gnb-cu.sa.band78.106prb.usrpb200.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
- ../../conf_files/gnb-cu.sa.f1.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.68.194
|
||||
@@ -20,15 +20,15 @@ services:
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
gnb_du_tdd:
|
||||
gnb_du_fdd:
|
||||
image: oai-gnb:latest
|
||||
privileged: true
|
||||
container_name: sa-du-b200-gnb
|
||||
environment:
|
||||
USE_B2XX: 'yes'
|
||||
USE_ADDITIONAL_OPTIONS: --sa --RUs.[0].sdr_addrs serial=30C51D4 --continuous-tx -E --telnetsrv --telnetsrv.shrmod ci --log_config.global_log_options level,nocolor,time,line_num,function --gNBs.[0].min_rxtxtime 2 --gNBs.[0].do_CSIRS 1 --gNBs.[0].do_SRS 1 --RUs.[0].att_rx 18 --RUs.[0].att_tx 18
|
||||
USE_ADDITIONAL_OPTIONS: --sa --RUs.[0].sdr_addrs serial=30C51D4 --telnetsrv --telnetsrv.shrmod ci --log_config.global_log_options level,nocolor,time,line_num,function --gNBs.[0].min_rxtxtime 2 --gNBs.[0].do_CSIRS 1 --gNBs.[0].do_SRS 0 --MACRLCs.[0].ul_max_mcs 28 --L1s.[0].max_ldpc_iterations 20
|
||||
volumes:
|
||||
- ../../conf_files/gnb-du.sa.band78.106prb.usrpb200.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
- ../../conf_files/gnb-du.sa.band1.52prb.usrpb210.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
- /dev:/dev
|
||||
networks:
|
||||
public_net:
|
||||
|
||||
@@ -46,7 +46,7 @@ BUILD_DOXYGEN=0
|
||||
DISABLE_HARDWARE_DEPENDENCY="False"
|
||||
CMAKE_BUILD_TYPE="RelWithDebInfo"
|
||||
CMAKE_CMD="$CMAKE"
|
||||
OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope nrqtscope ldpc_cuda ldpc_t1 websrv oai_iqplayer"
|
||||
OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope nrqtscope ldpc_cuda ldpc_t2 websrv oai_iqplayer"
|
||||
TARGET_LIST=""
|
||||
|
||||
function print_help() {
|
||||
@@ -158,6 +158,8 @@ Options:
|
||||
Enable the memory sanitizer on all targets. Requires clang, and is
|
||||
incompatible with ASan/UBSan. To build, issue:
|
||||
CC=/usr/bin/clang CXX=/usr/bin/clang++ ./build_oai ... --sanitize-memory
|
||||
--sanitize-thread | -fsanitize=thread
|
||||
Enable the thread sanitizer on all targets
|
||||
-h | --help
|
||||
Print this help"
|
||||
}
|
||||
@@ -416,6 +418,9 @@ function main() {
|
||||
CMAKE_CMD="$CMAKE_CMD -DTRACE_ASN1C_ENC_DEC=ON"
|
||||
echo_info "Enabling asn1c internal traces via OAI logging system"
|
||||
shift 1;;
|
||||
--sanitize-thread | -fthread=address)
|
||||
CMAKE_CMD="$CMAKE_CMD -DSANITIZE_THREAD=True"
|
||||
shift;;
|
||||
-h | --help)
|
||||
print_help
|
||||
exit 1;;
|
||||
|
||||
@@ -667,6 +667,8 @@ install_asn1c_from_source(){
|
||||
git clone https://github.com/mouse07410/asn1c /tmp/asn1c
|
||||
cd /tmp/asn1c
|
||||
git checkout vlm_master
|
||||
# Showing which version is used
|
||||
git log -n1
|
||||
autoreconf -iv
|
||||
./configure --prefix /opt/asn1c/
|
||||
make -j`nproc`
|
||||
|
||||
@@ -11,7 +11,7 @@ paramdef_t someoptions[] = {
|
||||
{"opt1", "<help opt1>", 0, uptr:&varopt1, defuintval:0, TYPE_UINT, 0 },
|
||||
};
|
||||
|
||||
config_get( someoptions,sizeof(someoptions)/sizeof(paramdef_t),"somesection");
|
||||
config_get( someoptions,sizeofArray(someoptions),"somesection");
|
||||
|
||||
```
|
||||
new code:
|
||||
@@ -31,7 +31,7 @@ paramdef_t someoptions[] = {
|
||||
{"opt2", "<help opt2>", 0, strptr:&varopt2,defstrval:"",TYPE_STRING,0 },
|
||||
};
|
||||
|
||||
config_get( someoptions,sizeof(someoptions)/sizeof(paramdef_t),"somesection");
|
||||
config_get( someoptions,sizeofArray(someoptions),"somesection");
|
||||
|
||||
```
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ character string, used as a prefix for the section name. It has to be specified
|
||||
list to be read is under another section.
|
||||
*/
|
||||
config_getlist( &NbIoT_MacRLC_ParamList,NbIoT_MacRLC_Params,
|
||||
sizeof(NbIoT_MacRLC_Params)/sizeof(paramdef_t),
|
||||
sizeofArray(NbIoT_MacRLC_Params),
|
||||
NULL);
|
||||
|
||||
/*
|
||||
|
||||
@@ -37,9 +37,11 @@
|
||||
#include <errno.h>
|
||||
#include <platform_types.h>
|
||||
#include "config_userapi.h"
|
||||
#include "config_common.h"
|
||||
#include "../utils/LOG/log.h"
|
||||
|
||||
int parse_stringlist(paramdef_t *cfgoptions, char *val) {
|
||||
static int parse_stringlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *val)
|
||||
{
|
||||
char *atoken;
|
||||
char *tokctx = NULL;
|
||||
char *tmpval=strdup(val);
|
||||
@@ -57,21 +59,22 @@ int parse_stringlist(paramdef_t *cfgoptions, char *val) {
|
||||
AssertFatal(MAX_LIST_SIZE > numelt,
|
||||
"This piece of code use fixed size arry of constant #define MAX_LIST_SIZE %d\n",
|
||||
MAX_LIST_SIZE );
|
||||
config_check_valptr(cfgoptions, sizeof(char*), numelt);
|
||||
|
||||
config_check_valptr(cfg, cfgoptions, sizeof(char *), numelt);
|
||||
|
||||
cfgoptions->numelt=numelt;
|
||||
atoken=strtok_r(val, ",",&tokctx);
|
||||
|
||||
for( int i=0; i<cfgoptions->numelt && atoken != NULL ; i++) {
|
||||
snprintf(cfgoptions->strlistptr[i],DEFAULT_EXTRA_SZ,"%s",atoken);
|
||||
printf_params("[LIBCONFIG] %s[%i]: %s\n", cfgoptions->optname,i,cfgoptions->strlistptr[i]);
|
||||
printf_params(cfg, "[LIBCONFIG] %s[%i]: %s\n", cfgoptions->optname, i, cfgoptions->strlistptr[i]);
|
||||
atoken=strtok_r(NULL, ",",&tokctx);
|
||||
}
|
||||
|
||||
return (cfgoptions->numelt > 0);
|
||||
}
|
||||
|
||||
int processoption(paramdef_t *cfgoptions, char *value) {
|
||||
static int processoption(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *value)
|
||||
{
|
||||
char *tmpval = value;
|
||||
int optisset=0;
|
||||
char defbool[2]="1";
|
||||
@@ -79,6 +82,7 @@ int processoption(paramdef_t *cfgoptions, char *value) {
|
||||
if ( value == NULL) {
|
||||
if( (cfgoptions->paramflags &PARAMFLAG_BOOL) == 0 ) { /* not a boolean, argument required */
|
||||
CONFIG_PRINTF_ERROR("[CONFIG] command line, option %s requires an argument\n",cfgoptions->optname);
|
||||
AssertFatal(false, "[CONFIG] command line, requires an argument\n");
|
||||
} else { /* boolean value option without argument, set value to true*/
|
||||
tmpval = defbool;
|
||||
}
|
||||
@@ -89,19 +93,18 @@ int processoption(paramdef_t *cfgoptions, char *value) {
|
||||
|
||||
case TYPE_STRING:
|
||||
if (cfgoptions->numelt == 0 )
|
||||
config_check_valptr(cfgoptions, 1,
|
||||
strlen(tmpval)+1);
|
||||
config_check_valptr(cfg, cfgoptions, 1, strlen(tmpval) + 1);
|
||||
if (cfgoptions->numelt < (strlen(tmpval)+1)) {
|
||||
CONFIG_PRINTF_ERROR("[CONFIG] command line option %s value too long\n",
|
||||
cfgoptions->optname);
|
||||
}
|
||||
snprintf(*cfgoptions->strptr, cfgoptions->numelt ,"%s",tmpval);
|
||||
printf_cmdl("[CONFIG] %s set to %s from command line\n", cfgoptions->optname, tmpval);
|
||||
printf_cmdl(cfg, "[CONFIG] %s set to %s from command line\n", cfgoptions->optname, tmpval);
|
||||
optisset=1;
|
||||
break;
|
||||
|
||||
case TYPE_STRINGLIST:
|
||||
optisset=parse_stringlist(cfgoptions,tmpval);
|
||||
optisset = parse_stringlist(cfg, cfgoptions, tmpval);
|
||||
break;
|
||||
|
||||
case TYPE_UINT32:
|
||||
@@ -110,8 +113,8 @@ int processoption(paramdef_t *cfgoptions, char *value) {
|
||||
case TYPE_INT16:
|
||||
case TYPE_UINT8:
|
||||
case TYPE_INT8:
|
||||
config_check_valptr(cfgoptions, sizeof(*cfgoptions->iptr), 1);
|
||||
config_assign_int(cfgoptions,cfgoptions->optname,(int32_t)strtol(tmpval,&charptr,0));
|
||||
config_check_valptr(cfg, cfgoptions, sizeof(*cfgoptions->iptr), 1);
|
||||
config_assign_int(cfg, cfgoptions, cfgoptions->optname, (int32_t)strtol(tmpval, &charptr, 0));
|
||||
|
||||
if( *charptr != 0) {
|
||||
CONFIG_PRINTF_ERROR("[CONFIG] command line, option %s requires an integer argument\n",cfgoptions->optname);
|
||||
@@ -122,14 +125,14 @@ int processoption(paramdef_t *cfgoptions, char *value) {
|
||||
|
||||
case TYPE_UINT64:
|
||||
case TYPE_INT64:
|
||||
config_check_valptr(cfgoptions, sizeof(*cfgoptions->i64ptr), 1);
|
||||
config_check_valptr(cfg, cfgoptions, sizeof(*cfgoptions->i64ptr), 1);
|
||||
*(cfgoptions->i64ptr)=strtoll(tmpval,&charptr,0);
|
||||
|
||||
if( *charptr != 0) {
|
||||
CONFIG_PRINTF_ERROR("[CONFIG] command line, option %s requires an integer argument\n",cfgoptions->optname);
|
||||
}
|
||||
|
||||
printf_cmdl("[CONFIG] %s set to %lli from command line\n", cfgoptions->optname, (long long)*cfgoptions->i64ptr);
|
||||
printf_cmdl(cfg, "[CONFIG] %s set to %lli from command line\n", cfgoptions->optname, (long long)*cfgoptions->i64ptr);
|
||||
optisset=1;
|
||||
break;
|
||||
|
||||
@@ -138,14 +141,14 @@ int processoption(paramdef_t *cfgoptions, char *value) {
|
||||
break;
|
||||
|
||||
case TYPE_DOUBLE:
|
||||
config_check_valptr(cfgoptions, sizeof(*cfgoptions->dblptr), 1);
|
||||
config_check_valptr(cfg, cfgoptions, sizeof(*cfgoptions->dblptr), 1);
|
||||
*cfgoptions->dblptr = strtof(tmpval,&charptr);
|
||||
|
||||
if( *charptr != 0) {
|
||||
CONFIG_PRINTF_ERROR("[CONFIG] command line, option %s requires a double argument\n",cfgoptions->optname);
|
||||
}
|
||||
|
||||
printf_cmdl("[CONFIG] %s set to %lf from command line\n", cfgoptions->optname, *(cfgoptions->dblptr));
|
||||
printf_cmdl(cfg, "[CONFIG] %s set to %lf from command line\n", cfgoptions->optname, *(cfgoptions->dblptr));
|
||||
optisset=1;
|
||||
break;
|
||||
|
||||
@@ -167,7 +170,8 @@ int processoption(paramdef_t *cfgoptions, char *value) {
|
||||
/*--------------------------------------------------------------------*/
|
||||
/* check unknown options in the command line
|
||||
*/
|
||||
int config_check_unknown_cmdlineopt(char *prefix) {
|
||||
int config_check_unknown_cmdlineopt(configmodule_interface_t *cfg, char *prefix)
|
||||
{
|
||||
int unknowndetected=0;
|
||||
char testprefix[CONFIG_MAXOPTLENGTH];
|
||||
int finalcheck = 0;
|
||||
@@ -182,18 +186,21 @@ int config_check_unknown_cmdlineopt(char *prefix) {
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=1; i<config_get_if()->argc ; i++) {
|
||||
if ( !finalcheck && strstr(config_get_if()->argv[i],testprefix) == NULL ) continue;
|
||||
for (int i = 1; i < cfg->argc; i++) {
|
||||
if (!finalcheck && strstr(cfg->argv[i], testprefix) == NULL)
|
||||
continue;
|
||||
|
||||
if ( !finalcheck && testprefix[0]==0 && index(config_get_if()->argv[i],'.') != NULL) continue;
|
||||
if (!finalcheck && testprefix[0] == 0 && index(cfg->argv[i], '.') != NULL)
|
||||
continue;
|
||||
|
||||
if ( !finalcheck && isdigit(config_get_if()->argv[i][0])) continue;
|
||||
if (!finalcheck && isdigit(cfg->argv[i][0]))
|
||||
continue;
|
||||
|
||||
if ( !finalcheck && config_get_if()->argv[i][0] == '-' && isdigit(config_get_if()->argv[i][1])) continue;
|
||||
if (!finalcheck && cfg->argv[i][0] == '-' && isdigit(cfg->argv[i][1]))
|
||||
continue;
|
||||
|
||||
if ( (config_get_if()->argv_info[i] & CONFIG_CMDLINEOPT_PROCESSED) == 0 ) {
|
||||
fprintf(stderr,"[CONFIG] unknown option: %s\n",
|
||||
config_get_if()->argv[i] );
|
||||
if ((cfg->argv_info[i] & CONFIG_CMDLINEOPT_PROCESSED) == 0) {
|
||||
fprintf(stderr, "[CONFIG] unknown option: %s\n", cfg->argv[i]);
|
||||
unknowndetected++;
|
||||
}
|
||||
}
|
||||
@@ -204,10 +211,11 @@ int config_check_unknown_cmdlineopt(char *prefix) {
|
||||
}
|
||||
|
||||
return unknowndetected;
|
||||
} /* config_check_unknown_cmdlineopt */
|
||||
} /* config_check_unknown_cmdlineopt */
|
||||
|
||||
int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix) {
|
||||
int c = config_get_if()->argc;
|
||||
int config_process_cmdline(configmodule_interface_t *cfg, paramdef_t *cfgoptions, int numoptions, char *prefix)
|
||||
{
|
||||
int c = cfg->argc;
|
||||
int i,j;
|
||||
char *pp;
|
||||
char cfgpath[CONFIG_MAXOPTLENGTH];
|
||||
@@ -215,15 +223,16 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
|
||||
i = 0;
|
||||
|
||||
while (c > 0 ) {
|
||||
char *oneargv = strdup(config_get_if()->argv[i]); /* we use strtok_r which modifies its string paramater, and we don't want argv to be modified */
|
||||
char *oneargv =
|
||||
strdup(cfg->argv[i]); /* we use strtok_r which modifies its string paramater, and we don't want argv to be modified */
|
||||
if(!oneargv) abort();
|
||||
/* first check help options, either --help, -h or --help_<section> */
|
||||
if (strncmp(oneargv, "-h",2) == 0 || strncmp(oneargv, "--help",6) == 0 ) {
|
||||
char *tokctx = NULL;
|
||||
pp=strtok_r(oneargv, "_",&tokctx);
|
||||
config_get_if()->argv_info[i] |= CONFIG_CMDLINEOPT_PROCESSED;
|
||||
cfg->argv_info[i] |= CONFIG_CMDLINEOPT_PROCESSED;
|
||||
|
||||
if (pp == NULL || strcasecmp(pp,config_get_if()->argv[i] ) == 0 ) {
|
||||
if (pp == NULL || strcasecmp(pp, cfg->argv[i]) == 0) {
|
||||
if( prefix == NULL) {
|
||||
config_printhelp(cfgoptions,numoptions,"(root section)");
|
||||
|
||||
@@ -263,10 +272,10 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
|
||||
((strlen(oneargv) > 2) && (strcmp(oneargv + 2, cfgoptions[n].optname) == 0 ) && (cfgoptions[n].paramflags & PARAMFLAG_CMDLINE_NOPREFIXENABLED )) ) {
|
||||
char *valptr=NULL;
|
||||
int ret;
|
||||
config_get_if()->argv_info[i] |= CONFIG_CMDLINEOPT_PROCESSED;
|
||||
cfg->argv_info[i] |= CONFIG_CMDLINEOPT_PROCESSED;
|
||||
|
||||
if (c > 0) {
|
||||
pp = config_get_if()->argv[i+1];
|
||||
pp = cfg->argv[i + 1];
|
||||
|
||||
if (pp != NULL ) {
|
||||
ret = strlen(pp);
|
||||
@@ -280,11 +289,11 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
|
||||
}
|
||||
}
|
||||
|
||||
j += processoption(&(cfgoptions[n]), valptr);
|
||||
j += processoption(cfg, &(cfgoptions[n]), valptr);
|
||||
|
||||
if ( valptr != NULL ) {
|
||||
i++;
|
||||
config_get_if()->argv_info[i] |= CONFIG_CMDLINEOPT_PROCESSED;
|
||||
cfg->argv_info[i] |= CONFIG_CMDLINEOPT_PROCESSED;
|
||||
c--;
|
||||
}
|
||||
|
||||
@@ -298,6 +307,6 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
|
||||
c--;
|
||||
} /* fin du while */
|
||||
|
||||
printf_cmdl("[CONFIG] %s %i options set from command line\n",((prefix == NULL) ? "(root)":prefix),j);
|
||||
printf_cmdl(cfg, "[CONFIG] %s %i options set from command line\n", ((prefix == NULL) ? "(root)" : prefix), j);
|
||||
return j;
|
||||
} /* parse_cmdline*/
|
||||
} /* parse_cmdline*/
|
||||
|
||||
313
common/config/config_common.c
Normal file
313
common/config/config_common.c
Normal file
@@ -0,0 +1,313 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <dlfcn.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <platform_types.h>
|
||||
#include "config_common.h"
|
||||
#include "../utils/LOG/log.h"
|
||||
static int managed_ptr_sz(configmodule_interface_t *cfg, void *ptr)
|
||||
{
|
||||
AssertFatal(cfg->numptrs < CONFIG_MAX_ALLOCATEDPTRS,
|
||||
"This code use fixed size array as #define CONFIG_MAX_ALLOCATEDPTRS %d\n",
|
||||
CONFIG_MAX_ALLOCATEDPTRS);
|
||||
int i;
|
||||
pthread_mutex_lock(&cfg->memBlocks_mutex);
|
||||
int numptrs=cfg->numptrs;
|
||||
for (i=0; i<numptrs; i++ )
|
||||
if (cfg->oneBlock[i].ptrs == ptr)
|
||||
break;
|
||||
pthread_mutex_unlock(&cfg->memBlocks_mutex);
|
||||
if ( i == numptrs )
|
||||
return -1;
|
||||
else
|
||||
return cfg->oneBlock[i].sz;
|
||||
}
|
||||
|
||||
void config_check_valptr(configmodule_interface_t *cfg, paramdef_t *cfgoptions, int elt_sz, int nb_elt)
|
||||
{
|
||||
const bool toFree=!(cfgoptions->paramflags & PARAMFLAG_NOFREE);
|
||||
|
||||
// let's see if the value has been read
|
||||
// the datamodel is more difficult than it should be
|
||||
// and it is not thread safe
|
||||
if (cfgoptions->voidptr) {
|
||||
int sz;
|
||||
if ( cfgoptions-> type == TYPE_STRING)
|
||||
sz = managed_ptr_sz(cfg, *cfgoptions->strptr);
|
||||
else
|
||||
sz = managed_ptr_sz(cfg, cfgoptions->voidptr);
|
||||
if ( sz != -1 ) // the same variable pointer has been used!
|
||||
cfgoptions->numelt=sz;
|
||||
}
|
||||
|
||||
if (cfgoptions->voidptr != NULL
|
||||
&& (cfgoptions->type == TYPE_INTARRAY
|
||||
|| cfgoptions->type == TYPE_UINTARRAY
|
||||
|| cfgoptions->type == TYPE_STRINGLIST )) {
|
||||
int sz;
|
||||
if (cfgoptions->type == TYPE_STRING || cfgoptions->type == TYPE_STRINGLIST)
|
||||
sz = managed_ptr_sz(cfg, *cfgoptions->strptr);
|
||||
else
|
||||
sz = managed_ptr_sz(cfg, cfgoptions->voidptr);
|
||||
if ( sz == -1) {
|
||||
fprintf(stderr,"[CONFIG] %s NOT SUPPORTED not NULL pointer with array types", cfgoptions->optname);
|
||||
return ;
|
||||
}
|
||||
}
|
||||
|
||||
if (cfgoptions->voidptr == NULL ) {
|
||||
if (cfgoptions->type == TYPE_STRING) {
|
||||
// difficult datamodel
|
||||
cfgoptions->strptr = config_allocate_new(cfg, sizeof(*cfgoptions->strptr), toFree);
|
||||
} else if ( cfgoptions->type == TYPE_STRINGLIST) {
|
||||
AssertFatal(nb_elt<MAX_LIST_SIZE,
|
||||
"This piece of code use fixed size arry of constant #define MAX_LIST_SIZE %d\n",
|
||||
MAX_LIST_SIZE );
|
||||
cfgoptions->strlistptr = config_allocate_new(cfg, sizeof(char *) * MAX_LIST_SIZE, toFree);
|
||||
for (int i=0; i<MAX_LIST_SIZE; i++)
|
||||
cfgoptions->strlistptr[i] = config_allocate_new(cfg, DEFAULT_EXTRA_SZ, toFree);
|
||||
} else {
|
||||
if ( cfgoptions->type == TYPE_INTARRAY || cfgoptions->type == TYPE_UINTARRAY )
|
||||
nb_elt=max(nb_elt, MAX_LIST_SIZE); // make room if the list is larger than the default one
|
||||
cfgoptions->voidptr = config_allocate_new(cfg, elt_sz * nb_elt, toFree);
|
||||
}
|
||||
}
|
||||
|
||||
if (cfgoptions->type == TYPE_STRING && *cfgoptions->strptr == NULL) {
|
||||
*cfgoptions->strptr = config_allocate_new(cfg, nb_elt + DEFAULT_EXTRA_SZ, toFree);
|
||||
cfgoptions->numelt=nb_elt+DEFAULT_EXTRA_SZ;
|
||||
}
|
||||
}
|
||||
|
||||
void *config_allocate_new(configmodule_interface_t *cfg, int sz, bool autoFree)
|
||||
{
|
||||
void *ptr = calloc(sz, 1);
|
||||
AssertFatal(ptr, "calloc fails\n");
|
||||
// add the memory piece in the managed memory pieces list
|
||||
pthread_mutex_lock(&cfg->memBlocks_mutex);
|
||||
int newBlockIdx=cfg->numptrs++;
|
||||
oneBlock_t* tmp=&cfg->oneBlock[newBlockIdx];
|
||||
tmp->ptrs = (char *)ptr;
|
||||
tmp->ptrsAllocated = true;
|
||||
tmp->sz=sz;
|
||||
tmp->toFree=autoFree;
|
||||
pthread_mutex_unlock(&cfg->memBlocks_mutex);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
int config_setdefault_int(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *prefix)
|
||||
{
|
||||
int status = 0;
|
||||
config_check_valptr(cfg, cfgoptions, sizeof(*cfgoptions->iptr), 1);
|
||||
|
||||
if (((cfgoptions->paramflags & PARAMFLAG_MANDATORY) == 0)) {
|
||||
config_assign_int(cfg, cfgoptions, cfgoptions->optname, cfgoptions->defintval);
|
||||
status=1;
|
||||
printf_params(cfg, "[CONFIG] %s.%s set to default value\n", ((prefix == NULL) ? "" : prefix), cfgoptions->optname);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_setdefault_int64(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *prefix)
|
||||
{
|
||||
int status = 0;
|
||||
config_check_valptr(cfg, cfgoptions, sizeof(*cfgoptions->i64ptr), 1);
|
||||
|
||||
if (((cfgoptions->paramflags & PARAMFLAG_MANDATORY) == 0)) {
|
||||
*(cfgoptions->u64ptr) = cfgoptions->defuintval;
|
||||
status=1;
|
||||
printf_params(cfg,
|
||||
"[CONFIG] %s.%s set to default value %llu\n",
|
||||
((prefix == NULL) ? "" : prefix),
|
||||
cfgoptions->optname,
|
||||
(long long unsigned)(*(cfgoptions->u64ptr)));
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_setdefault_intlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *prefix)
|
||||
{
|
||||
int status = 0;
|
||||
|
||||
if (cfgoptions->defintarrayval != NULL) {
|
||||
config_check_valptr(cfg, cfgoptions, sizeof(cfgoptions->iptr), cfgoptions->numelt);
|
||||
cfgoptions->iptr = cfgoptions->defintarrayval;
|
||||
status=1;
|
||||
|
||||
for (int j = 0; j < cfgoptions->numelt; j++) {
|
||||
printf_params(cfg, "[CONFIG] %s[%i] set to default value %i\n", cfgoptions->optname, j, (int)cfgoptions->iptr[j]);
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_setdefault_string(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *prefix)
|
||||
{
|
||||
int status = 0;
|
||||
|
||||
if (cfgoptions->defstrval != NULL) {
|
||||
status=1;
|
||||
|
||||
if (cfgoptions->numelt == 0)
|
||||
config_check_valptr(cfg, cfgoptions, 1, strlen(cfgoptions->defstrval) + 1);
|
||||
if (cfgoptions->numelt < strlen(cfgoptions->defstrval) + 1) {
|
||||
fprintf(stderr,"[CONFIG] %s size too small\n", cfgoptions->optname);
|
||||
}
|
||||
snprintf(*cfgoptions->strptr, cfgoptions->numelt, "%s", cfgoptions->defstrval);
|
||||
printf_params(cfg,
|
||||
"[CONFIG] %s.%s set to default value \"%s\"\n",
|
||||
((prefix == NULL) ? "" : prefix),
|
||||
cfgoptions->optname,
|
||||
*cfgoptions->strptr);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_setdefault_stringlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *prefix)
|
||||
{
|
||||
int status = 0;
|
||||
|
||||
if (cfgoptions->defstrlistval != NULL) {
|
||||
cfgoptions->strlistptr = cfgoptions->defstrlistval;
|
||||
status=1;
|
||||
|
||||
for (int j = 0; j < cfgoptions->numelt; j++)
|
||||
printf_params(cfg,
|
||||
"[CONFIG] %s.%s[%i] set to default value %s\n",
|
||||
((prefix == NULL) ? "" : prefix),
|
||||
cfgoptions->optname,
|
||||
j,
|
||||
cfgoptions->strlistptr[j]);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_setdefault_double(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *prefix)
|
||||
{
|
||||
int status = 0;
|
||||
config_check_valptr(cfg, cfgoptions, sizeof(*cfgoptions->dblptr), 1);
|
||||
|
||||
if( ((cfgoptions->paramflags & PARAMFLAG_MANDATORY) == 0)) {
|
||||
*(cfgoptions->dblptr)=cfgoptions->defdblval;
|
||||
status=1;
|
||||
printf_params(cfg, "[CONFIG] %s set to default value %lf\n", cfgoptions->optname, *(cfgoptions->dblptr));
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_assign_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *ipv4addr)
|
||||
{
|
||||
config_check_valptr(cfg, cfgoptions, sizeof(*cfgoptions->uptr), 1);
|
||||
int rst=inet_pton(AF_INET, ipv4addr,cfgoptions->uptr );
|
||||
|
||||
if (rst == 1 && *(cfgoptions->uptr) > 0) {
|
||||
printf_params(cfg, "[CONFIG] %s: %s\n", cfgoptions->optname, ipv4addr);
|
||||
return 1;
|
||||
} else {
|
||||
if ( strncmp(ipv4addr,ANY_IPV4ADDR_STRING,sizeof(ANY_IPV4ADDR_STRING)) == 0) {
|
||||
printf_params(cfg, "[CONFIG] %s:%s (INADDR_ANY) \n", cfgoptions->optname, ipv4addr);
|
||||
*cfgoptions->uptr=INADDR_ANY;
|
||||
return 1;
|
||||
} else {
|
||||
fprintf(stderr,"[CONFIG] %s not valid for %s \n", ipv4addr, cfgoptions->optname);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int config_setdefault_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *prefix)
|
||||
{
|
||||
int status = 0;
|
||||
|
||||
if (cfgoptions->defstrval != NULL) {
|
||||
status = config_assign_ipv4addr(cfg, cfgoptions, cfgoptions->defstrval);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void config_assign_int(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *fullname, int val)
|
||||
{
|
||||
int tmpval=val;
|
||||
|
||||
if ( ((cfgoptions->paramflags &PARAMFLAG_BOOL) != 0) && tmpval >0) {
|
||||
tmpval =1;
|
||||
}
|
||||
|
||||
switch (cfgoptions->type) {
|
||||
case TYPE_UINT8:
|
||||
*(cfgoptions->u8ptr) = (uint8_t)tmpval;
|
||||
printf_params(cfg, "[CONFIG] %s: %u\n", fullname, (uint8_t)tmpval);
|
||||
break;
|
||||
|
||||
case TYPE_INT8:
|
||||
*(cfgoptions->i8ptr) = (int8_t)tmpval;
|
||||
printf_params(cfg, "[CONFIG] %s: %i\n", fullname, (int8_t)tmpval);
|
||||
break;
|
||||
|
||||
case TYPE_UINT16:
|
||||
*(cfgoptions->u16ptr) = (uint16_t)tmpval;
|
||||
printf_params(cfg, "[CONFIG] %s: %hu\n", fullname, (uint16_t)tmpval);
|
||||
break;
|
||||
|
||||
case TYPE_INT16:
|
||||
*(cfgoptions->i16ptr) = (int16_t)tmpval;
|
||||
printf_params(cfg, "[CONFIG] %s: %hi\n", fullname, (int16_t)tmpval);
|
||||
break;
|
||||
|
||||
case TYPE_UINT32:
|
||||
*(cfgoptions->uptr) = (uint32_t)tmpval;
|
||||
printf_params(cfg, "[CONFIG] %s: %u\n", fullname, (uint32_t)tmpval);
|
||||
break;
|
||||
|
||||
case TYPE_MASK:
|
||||
*(cfgoptions->uptr) = *(cfgoptions->uptr) | (uint32_t)tmpval;
|
||||
printf_params(cfg, "[CONFIG] %s: 0x%08x\n", fullname, (uint32_t)tmpval);
|
||||
break;
|
||||
|
||||
case TYPE_INT32:
|
||||
*(cfgoptions->iptr) = (int32_t)tmpval;
|
||||
printf_params(cfg, "[CONFIG] %s: %i\n", fullname, (int32_t)tmpval);
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf (stderr,"[CONFIG] %s %i type %i non integer parameter %s not assigned\n",__FILE__, __LINE__,cfgoptions->type,fullname);
|
||||
break;
|
||||
}
|
||||
}
|
||||
58
common/config/config_common.h
Normal file
58
common/config/config_common.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* 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 common/config/config_userapi.h
|
||||
* \brief: configuration module, include file to be used by the source code calling the
|
||||
* configuration module to access configuration parameters
|
||||
* \author Francois TABURET
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
* \company NOKIA BellLabs France
|
||||
* \email: francois.taburet@nokia-bell-labs.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#ifndef INCLUDE_CONFIG_COMMON_H
|
||||
#define INCLUDE_CONFIG_COMMON_H
|
||||
#include "config_load_configmodule.h"
|
||||
#include "common/utils/utils.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
void config_check_valptr(configmodule_interface_t *cfg, paramdef_t *cfgoptions, int elt_sz, int nb_elt);
|
||||
/* functions to set a parameter to its default value */
|
||||
int config_setdefault_int(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *prefix);
|
||||
int config_setdefault_int64(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *prefix);
|
||||
int config_setdefault_intlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *prefix);
|
||||
int config_setdefault_string(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *prefix);
|
||||
int config_setdefault_stringlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *prefix);
|
||||
int config_setdefault_double(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *prefix);
|
||||
int config_setdefault_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *prefix);
|
||||
void *config_allocate_new(configmodule_interface_t *cfg, int sz, bool autoFree);
|
||||
void config_assign_int(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *fullname, int val);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -44,6 +44,25 @@
|
||||
#include "../utils/LOG/log.h"
|
||||
#define CONFIG_SHAREDLIBFORMAT "libparams_%s.so"
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#include "config_common.h"
|
||||
|
||||
// clang-format off
|
||||
static char config_helpstr [] = "\n lte-softmodem -O [config mode]<:dbgl[debugflags]><:incp[path]>\n \
|
||||
debugflags can also be defined in the config section of the config file\n \
|
||||
debugflags: mask, 1->print parameters, 2->print memory allocations debug messages\n \
|
||||
4->print command line processing debug messages\n \
|
||||
incp parameter can be used to define the include path used for config files (@include directive)\n \
|
||||
defaults is set to the path of the main config file.\n";
|
||||
|
||||
static paramdef_t Config_Params[] = {
|
||||
/*--------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* config parameters for config module */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*--------------------------------------------------------------------------------------------------------------------------*/
|
||||
{CONFIGP_DEBUGFLAGS, config_helpstr, 0, .uptr = NULL, .defintval = 0, TYPE_MASK, 0},
|
||||
{CONFIGP_TMPDIR, CONFIG_HELP_TMPDIR, PARAMFLAG_NOFREE, .strptr = NULL, .defstrval = "/tmp", TYPE_STRING, 0},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
int load_config_sharedlib(configmodule_interface_t *cfgptr) {
|
||||
void *lib_handle;
|
||||
@@ -52,7 +71,7 @@ int load_config_sharedlib(configmodule_interface_t *cfgptr) {
|
||||
int st;
|
||||
st=0;
|
||||
sprintf(libname,CONFIG_SHAREDLIBFORMAT,cfgptr->cfgmode);
|
||||
lib_handle = dlopen(libname,RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE);
|
||||
lib_handle = dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_NODELETE);
|
||||
|
||||
if (!lib_handle) {
|
||||
fprintf(stderr,"[CONFIG] %s %d Error calling dlopen(%s): %s\n",__FILE__, __LINE__, libname,dlerror());
|
||||
@@ -65,7 +84,7 @@ int load_config_sharedlib(configmodule_interface_t *cfgptr) {
|
||||
printf("[CONFIG] %s %d no function %s for config mode %s\n",
|
||||
__FILE__, __LINE__,fname, cfgptr->cfgmode);
|
||||
} else {
|
||||
st=cfgptr->init(cfgptr->cfgP,cfgptr->num_cfgP);
|
||||
st = cfgptr->init(cfgptr);
|
||||
printf("[CONFIG] function %s returned %i\n",
|
||||
fname, st);
|
||||
}
|
||||
@@ -121,14 +140,18 @@ int nooptfunc(void) {
|
||||
return 0;
|
||||
};
|
||||
|
||||
int config_cmdlineonly_getlist(paramlist_def_t *ParamList,
|
||||
paramdef_t *params, int numparams, char *prefix) {
|
||||
int config_cmdlineonly_getlist(configmodule_interface_t *cfg,
|
||||
paramlist_def_t *ParamList,
|
||||
paramdef_t *params,
|
||||
int numparams,
|
||||
char *prefix)
|
||||
{
|
||||
ParamList->numelt = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int config_cmdlineonly_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
|
||||
int config_cmdlineonly_get(configmodule_interface_t *cfg, paramdef_t *cfgoptions, int numoptions, char *prefix)
|
||||
{
|
||||
int defval;
|
||||
int fatalerror=0;
|
||||
int numdefvals=0;
|
||||
@@ -138,11 +161,11 @@ int config_cmdlineonly_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
|
||||
|
||||
switch(cfgoptions[i].type) {
|
||||
case TYPE_STRING:
|
||||
defval=config_setdefault_string(&(cfgoptions[i]), prefix);
|
||||
defval = config_setdefault_string(cfg, &cfgoptions[i], prefix);
|
||||
break;
|
||||
|
||||
case TYPE_STRINGLIST:
|
||||
defval=config_setdefault_stringlist(&(cfgoptions[i]), prefix);
|
||||
defval = config_setdefault_stringlist(cfg, &cfgoptions[i], prefix);
|
||||
break;
|
||||
|
||||
case TYPE_UINT8:
|
||||
@@ -152,25 +175,25 @@ int config_cmdlineonly_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
|
||||
case TYPE_UINT32:
|
||||
case TYPE_INT32:
|
||||
case TYPE_MASK:
|
||||
defval=config_setdefault_int(&(cfgoptions[i]), prefix);
|
||||
defval = config_setdefault_int(cfg, &cfgoptions[i], prefix);
|
||||
break;
|
||||
|
||||
case TYPE_UINT64:
|
||||
case TYPE_INT64:
|
||||
defval=config_setdefault_int64(&(cfgoptions[i]), prefix);
|
||||
defval = config_setdefault_int64(cfg, &cfgoptions[i], prefix);
|
||||
break;
|
||||
|
||||
case TYPE_UINTARRAY:
|
||||
case TYPE_INTARRAY:
|
||||
defval=config_setdefault_intlist(&(cfgoptions[i]), prefix);
|
||||
defval = config_setdefault_intlist(cfg, &cfgoptions[i], prefix);
|
||||
break;
|
||||
|
||||
case TYPE_DOUBLE:
|
||||
defval=config_setdefault_double(&(cfgoptions[i]), prefix);
|
||||
defval = config_setdefault_double(cfg, &cfgoptions[i], prefix);
|
||||
break;
|
||||
|
||||
case TYPE_IPV4ADDR:
|
||||
defval=config_setdefault_ipv4addr(&(cfgoptions[i]), prefix);
|
||||
defval = config_setdefault_ipv4addr(cfg, &cfgoptions[i], prefix);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -231,7 +254,7 @@ configmodule_interface_t *load_configmodule(int argc,
|
||||
OWoptIdx = i;
|
||||
}
|
||||
if ( strstr(argv[i], "help_config") != NULL ) {
|
||||
config_printhelp(Config_Params,CONFIG_PARAMLENGTH(Config_Params),CONFIG_SECTIONNAME);
|
||||
config_printhelp(Config_Params, sizeofArray(Config_Params), CONFIG_SECTIONNAME);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
@@ -271,8 +294,12 @@ configmodule_interface_t *load_configmodule(int argc,
|
||||
modeparams=cfgmode;
|
||||
cfgmode=strdup(CONFIG_LIBCONFIGFILE);
|
||||
}
|
||||
if (cfgptr == NULL) {
|
||||
cfgptr = calloc(sizeof(configmodule_interface_t),1);
|
||||
static configmodule_interface_t *cfgptr;
|
||||
if (cfgptr)
|
||||
printf("ERROR: Call load_configmodule more than one time\n");
|
||||
|
||||
// The macros are not thread safe print_params and similar
|
||||
cfgptr = calloc(sizeof(configmodule_interface_t), 1);
|
||||
/* argv_info is used to memorize command line options which have been recognized */
|
||||
/* and to detect unrecognized command line options which might have been specified */
|
||||
cfgptr->argv_info = calloc(sizeof(int32_t), argc+10);
|
||||
@@ -314,11 +341,10 @@ configmodule_interface_t *load_configmodule(int argc,
|
||||
atoken = strtok_r(NULL,":",&strtokctx);
|
||||
}
|
||||
|
||||
printf("[CONFIG] get parameters from %s ",cfgmode);
|
||||
}
|
||||
for (i=0; i<cfgptr->num_cfgP; i++) {
|
||||
printf("%s ",cfgptr->cfgP[i]);
|
||||
}
|
||||
printf("[CONFIG] get parameters from %s ", cfgmode);
|
||||
for (i = 0; i < cfgptr->num_cfgP; i++) {
|
||||
printf("%s ", cfgptr->cfgP[i]);
|
||||
}
|
||||
|
||||
if (cfgptr->rtflags & CONFIG_PRINTPARAMS) {
|
||||
cfgptr->status = malloc(sizeof(configmodule_status_t));
|
||||
@@ -328,11 +354,11 @@ configmodule_interface_t *load_configmodule(int argc,
|
||||
|
||||
if (i == 0) {
|
||||
printf("[CONFIG] config module %s loaded\n",cfgmode);
|
||||
int idx = config_paramidx_fromname(Config_Params, CONFIG_PARAMLENGTH(Config_Params), CONFIGP_DEBUGFLAGS);
|
||||
int idx = config_paramidx_fromname(Config_Params, sizeofArray(Config_Params), CONFIGP_DEBUGFLAGS);
|
||||
Config_Params[idx].uptr = &(cfgptr->rtflags);
|
||||
idx = config_paramidx_fromname(Config_Params, CONFIG_PARAMLENGTH(Config_Params), CONFIGP_TMPDIR);
|
||||
idx = config_paramidx_fromname(Config_Params, sizeofArray(Config_Params), CONFIGP_TMPDIR);
|
||||
Config_Params[idx].strptr = &(cfgptr->tmpdir);
|
||||
config_get(Config_Params,CONFIG_PARAMLENGTH(Config_Params), CONFIG_SECTIONNAME );
|
||||
config_get(cfgptr, Config_Params, sizeofArray(Config_Params), CONFIG_SECTIONNAME);
|
||||
} else {
|
||||
fprintf(stderr,"[CONFIG] %s %d config module \"%s\" couldn't be loaded\n", __FILE__, __LINE__,cfgmode);
|
||||
cfgptr->rtflags = cfgptr->rtflags | CONFIG_HELP | CONFIG_ABORT;
|
||||
@@ -351,7 +377,7 @@ configmodule_interface_t *load_configmodule(int argc,
|
||||
if (cfgmode != NULL) free(cfgmode);
|
||||
|
||||
if (CONFIG_ISFLAGSET(CONFIG_ABORT)) {
|
||||
config_printhelp(Config_Params,CONFIG_PARAMLENGTH(Config_Params),CONFIG_SECTIONNAME );
|
||||
config_printhelp(Config_Params, sizeofArray(Config_Params), CONFIG_SECTIONNAME);
|
||||
// exit(-1);
|
||||
}
|
||||
|
||||
@@ -359,10 +385,11 @@ configmodule_interface_t *load_configmodule(int argc,
|
||||
}
|
||||
|
||||
/* Possibly write config file, with parameters which have been read and after command line parsing */
|
||||
void write_parsedcfg(void)
|
||||
void write_parsedcfg(configmodule_interface_t *cfgptr)
|
||||
{
|
||||
if (cfgptr->status && (cfgptr->rtflags & CONFIG_SAVERUNCFG)) {
|
||||
printf_params("[CONFIG] Runtime params creation status: %i null values, %i errors, %i empty list or array, %i successfull \n",
|
||||
printf_params(cfgptr,
|
||||
"[CONFIG] Runtime params creation status: %i null values, %i errors, %i empty list or array, %i successfull \n",
|
||||
cfgptr->status->num_err_nullvalue,
|
||||
cfgptr->status->num_err_write,
|
||||
cfgptr->status->emptyla,
|
||||
@@ -371,19 +398,20 @@ void write_parsedcfg(void)
|
||||
if (cfgptr != NULL) {
|
||||
if (cfgptr->write_parsedcfg != NULL) {
|
||||
printf("[CONFIG] calling config module write_parsedcfg function...\n");
|
||||
cfgptr->write_parsedcfg();
|
||||
cfgptr->write_parsedcfg(cfgptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* free memory allocated when reading parameters */
|
||||
/* config module could be initialized again after this call */
|
||||
void end_configmodule(void) {
|
||||
write_parsedcfg();
|
||||
void end_configmodule(configmodule_interface_t *cfgptr)
|
||||
{
|
||||
write_parsedcfg(cfgptr);
|
||||
if (cfgptr != NULL) {
|
||||
if (cfgptr->end != NULL) {
|
||||
printf ("[CONFIG] calling config module end function...\n");
|
||||
cfgptr->end();
|
||||
cfgptr->end(cfgptr);
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&cfgptr->memBlocks_mutex);
|
||||
@@ -408,8 +436,3 @@ void end_configmodule(void) {
|
||||
cfgptr=NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -59,11 +59,14 @@
|
||||
#define CONFIG_HELP (1<<20) // print help message
|
||||
#define CONFIG_ABORT (1<<21) // config failed,abort execution
|
||||
#define CONFIG_NOOOPT (1<<22) // no -O option found when parsing command line
|
||||
typedef int(*configmodule_initfunc_t)(char *cfgP[],int numP);
|
||||
typedef int(*configmodule_getfunc_t)(paramdef_t *,int numparams, char *prefix);
|
||||
typedef int(*configmodule_getlistfunc_t)(paramlist_def_t *, paramdef_t *,int numparams, char *prefix);
|
||||
struct configmodule_interface;
|
||||
typedef int (*configmodule_getfunc_t)(struct configmodule_interface *, paramdef_t *, int numparams, char *prefix);
|
||||
typedef int (
|
||||
*configmodule_getlistfunc_t)(struct configmodule_interface *, paramlist_def_t *, paramdef_t *, int numparams, char *prefix);
|
||||
typedef int (*configmodule_setfunc_t)(paramdef_t *cfgoptions, int numoptions, char *prefix);
|
||||
typedef void(*configmodule_endfunc_t)(void);
|
||||
typedef void (*configmodule_endfunc_t)(struct configmodule_interface *cfg);
|
||||
|
||||
typedef int (*configmodule_initfunc_t)(struct configmodule_interface *cfg);
|
||||
|
||||
typedef struct configmodule_status {
|
||||
int num_paramgroups;
|
||||
@@ -105,41 +108,23 @@ typedef struct configmodule_interface {
|
||||
configmodule_status_t *status; // allocated in debug mode only
|
||||
} configmodule_interface_t;
|
||||
|
||||
#ifdef CONFIG_LOADCONFIG_MAIN
|
||||
configmodule_interface_t *cfgptr=NULL;
|
||||
|
||||
static char config_helpstr [] = "\n lte-softmodem -O [config mode]<:dbgl[debugflags]><:incp[path]>\n \
|
||||
debugflags can also be defined in the config section of the config file\n \
|
||||
debugflags: mask, 1->print parameters, 2->print memory allocations debug messages\n \
|
||||
4->print command line processing debug messages\n \
|
||||
incp parameter can be used to define the include path used for config files (@include directive)\n \
|
||||
defaults is set to the path of the main config file.\n";
|
||||
|
||||
#define CONFIG_HELP_TMPDIR "<Repository to create temporary file>"
|
||||
|
||||
#define CONFIG_SECTIONNAME "config"
|
||||
#define CONFIGP_DEBUGFLAGS "debugflags"
|
||||
#define CONFIGP_TMPDIR "tmpdir"
|
||||
|
||||
// clang-format off
|
||||
static paramdef_t Config_Params[] = {
|
||||
/*--------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* config parameters for config module */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*--------------------------------------------------------------------------------------------------------------------------*/
|
||||
{CONFIGP_DEBUGFLAGS, config_helpstr, 0, .uptr = NULL, .defintval = 0, TYPE_MASK, 0},
|
||||
{CONFIGP_TMPDIR, CONFIG_HELP_TMPDIR, PARAMFLAG_NOFREE, .strptr = NULL, .defstrval = "/tmp", TYPE_STRING, 0},
|
||||
};
|
||||
// clang-format on
|
||||
// extern configmodule_interface_t *cfgptr;
|
||||
|
||||
#else
|
||||
extern configmodule_interface_t *cfgptr;
|
||||
#endif
|
||||
#define printf_params(cfg, ...) \
|
||||
if ((cfg->rtflags & (CONFIG_PRINTPARAMS)) != 0) { \
|
||||
printf(__VA_ARGS__); \
|
||||
}
|
||||
|
||||
|
||||
#define printf_params(...) if ( (cfgptr->rtflags & (CONFIG_PRINTPARAMS)) != 0 ) { printf ( __VA_ARGS__ ); }
|
||||
#define printf_ptrs(...) if ( (cfgptr->rtflags & (CONFIG_DEBUGPTR)) != 0 ) { printf ( __VA_ARGS__ ); }
|
||||
#define printf_cmdl(...) if ( (cfgptr->rtflags & (CONFIG_DEBUGCMDLINE)) != 0 ) { printf ( __VA_ARGS__ ); }
|
||||
#define printf_cmdl(cfg, ...) \
|
||||
if ((cfg->rtflags & (CONFIG_DEBUGCMDLINE)) != 0) { \
|
||||
printf(__VA_ARGS__); \
|
||||
}
|
||||
|
||||
#define CONFIG_ENABLECMDLINEONLY (1<<1)
|
||||
extern configmodule_interface_t *load_configmodule(int argc, char **argv, uint32_t initflags);
|
||||
@@ -148,8 +133,8 @@ extern configmodule_interface_t *load_configmodule(int argc, char **argv, uint32
|
||||
* should be used as soon as there is no need to read parameters but doesn't prevent
|
||||
* a new config module init
|
||||
*/
|
||||
extern void end_configmodule(void);
|
||||
extern void write_parsedcfg(void);
|
||||
void end_configmodule(configmodule_interface_t *cfg);
|
||||
void write_parsedcfg(configmodule_interface_t *cfg);
|
||||
|
||||
/* free all config module memory, to be used at end of program as
|
||||
* it will free parameters values even those specified with the PARAMFLAG_NOFREE flag */
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#ifndef INCLUDE_CONFIG_PARAMDESC_H
|
||||
#define INCLUDE_CONFIG_PARAMDESC_H
|
||||
|
||||
|
||||
#define MAX_OPTNAME_SIZE 64
|
||||
#define CONFIG_MAXOPTLENGTH 512 /* max full option length, full option name exemple: (prefix1.[<index>].prefix2.optname */
|
||||
|
||||
@@ -56,42 +55,47 @@
|
||||
/* checkedparam_t is possibly used in paramdef_t for specific parameter value validation */
|
||||
#define CONFIG_MAX_NUMCHECKVAL 20
|
||||
typedef struct paramdef paramdef_t;
|
||||
typedef struct configmodule_interface configmodule_interface_t;
|
||||
typedef union checkedparam {
|
||||
struct {
|
||||
int (*f1)(paramdef_t *param); /* check an integer against a list of authorized values */
|
||||
int (*f1)(configmodule_interface_t *cfg, paramdef_t *param); /* check an integer against a list of authorized values */
|
||||
int okintval[CONFIG_MAX_NUMCHECKVAL]; /* integer array, store possible values */
|
||||
int num_okintval; /* number of valid values in the checkingval array */
|
||||
} s1;
|
||||
struct {
|
||||
int (*f1a)(paramdef_t *param); /* check an integer against a list of authorized values and set param value */
|
||||
int (*f1a)(configmodule_interface_t *cfg,
|
||||
paramdef_t *param); /* check an integer against a list of authorized values and set param value */
|
||||
/* to the corresponding item in setintval array (mainly for RRC params) */
|
||||
int okintval[CONFIG_MAX_NUMCHECKVAL]; /* integer array, store possible values in config file */
|
||||
int setintval[CONFIG_MAX_NUMCHECKVAL]; /* integer array, values set in the paramdef structure */
|
||||
int num_okintval; /* number of valid values in the checkingval array */
|
||||
} s1a;
|
||||
struct {
|
||||
int (*f2)(paramdef_t *param); /* check an integer against an authorized range, defined by its min and max value */
|
||||
int (*f2)(configmodule_interface_t *cfg,
|
||||
paramdef_t *param); /* check an integer against an authorized range, defined by its min and max value */
|
||||
int okintrange[CONFIG_MAX_NUMCHECKVAL]; /* integer array, store min and max values */
|
||||
|
||||
} s2;
|
||||
struct {
|
||||
int (*f3)(paramdef_t *param); /* check a string against a list of authorized values */
|
||||
int (*f3)(configmodule_interface_t *cfg, paramdef_t *param); /* check a string against a list of authorized values */
|
||||
char *okstrval[CONFIG_MAX_NUMCHECKVAL]; /* string array, store possible values */
|
||||
int num_okstrval; /* number of valid values in the checkingval array */
|
||||
} s3;
|
||||
struct {
|
||||
int (*f3a)(paramdef_t *param); /* check a string against a list of authorized values and set param value */
|
||||
int (*f3a)(configmodule_interface_t *cfg,
|
||||
paramdef_t *param); /* check a string against a list of authorized values and set param value */
|
||||
/* to the corresponding item in setintval array (mainly for RRC params) */
|
||||
char *okstrval[CONFIG_MAX_NUMCHECKVAL]; /* string array, store possible values */
|
||||
int setintval[CONFIG_MAX_NUMCHECKVAL]; /* integer array, values set in the paramdef structure */
|
||||
int num_okstrval; /* number of valid values in the checkingval array */
|
||||
} s3a;
|
||||
struct {
|
||||
int (*f4)(paramdef_t *param); /* generic check function, no arguments but the param description */
|
||||
int (*f4)(configmodule_interface_t *cfg,
|
||||
paramdef_t *param); /* generic check function, no arguments but the param description */
|
||||
|
||||
} s4;
|
||||
struct {
|
||||
void (*checkfunc)(void) ;
|
||||
void (*checkfunc)(configmodule_interface_t *cfg);
|
||||
} s5;
|
||||
} checkedparam_t;
|
||||
|
||||
@@ -157,13 +161,10 @@ typedef struct paramdef {
|
||||
#define TYPE_LIST 55
|
||||
|
||||
#define ANY_IPV4ADDR_STRING "0.0.0.0"
|
||||
|
||||
typedef struct paramlist_def {
|
||||
char listname[MAX_OPTNAME_SIZE];
|
||||
paramdef_t **paramarray;
|
||||
int numelt ;
|
||||
} paramlist_def_t;
|
||||
|
||||
/* macro helpers for module users */
|
||||
#define CONFIG_PARAMLENGTH(A) (sizeof(A)/sizeof(paramdef_t))
|
||||
#endif /* INCLUDE_CONFIG_PARAMDESC_H */
|
||||
|
||||
@@ -41,160 +41,12 @@
|
||||
#include <arpa/inet.h>
|
||||
#include <platform_types.h>
|
||||
#include "config_userapi.h"
|
||||
#include "config_common.h"
|
||||
#include "../utils/LOG/log.h"
|
||||
|
||||
configmodule_interface_t *config_get_if(void) {
|
||||
if (cfgptr == NULL) {
|
||||
if (isLogInitDone())
|
||||
LOG_W(ENB_APP,"[CONFIG] %s %d config module not initialized\n",__FILE__,__LINE__);
|
||||
}
|
||||
|
||||
return cfgptr;
|
||||
}
|
||||
|
||||
static int managed_ptr_sz(void* ptr) {
|
||||
configmodule_interface_t * cfg=config_get_if();
|
||||
AssertFatal(cfg->numptrs < CONFIG_MAX_ALLOCATEDPTRS,
|
||||
"This code use fixed size array as #define CONFIG_MAX_ALLOCATEDPTRS %d\n",
|
||||
CONFIG_MAX_ALLOCATEDPTRS);
|
||||
int i;
|
||||
pthread_mutex_lock(&cfg->memBlocks_mutex);
|
||||
int numptrs=cfg->numptrs;
|
||||
for (i=0; i<numptrs; i++ )
|
||||
if (cfg->oneBlock[i].ptrs == ptr)
|
||||
break;
|
||||
pthread_mutex_unlock(&cfg->memBlocks_mutex);
|
||||
if ( i == numptrs )
|
||||
return -1;
|
||||
else
|
||||
return cfg->oneBlock[i].sz;
|
||||
}
|
||||
|
||||
void *config_allocate_new(int sz, bool autoFree) {
|
||||
void *ptr = calloc(sz,1);
|
||||
AssertFatal(ptr, "calloc fails\n");
|
||||
configmodule_interface_t * cfg=config_get_if();
|
||||
// add the memory piece in the managed memory pieces list
|
||||
pthread_mutex_lock(&cfg->memBlocks_mutex);
|
||||
int newBlockIdx=cfg->numptrs++;
|
||||
oneBlock_t* tmp=&cfg->oneBlock[newBlockIdx];
|
||||
tmp->ptrs = (char *)ptr;
|
||||
tmp->ptrsAllocated = true;
|
||||
tmp->sz=sz;
|
||||
tmp->toFree=autoFree;
|
||||
pthread_mutex_unlock(&cfg->memBlocks_mutex);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void config_check_valptr(paramdef_t *cfgoptions, int elt_sz, int nb_elt) {
|
||||
|
||||
const bool toFree=!(cfgoptions->paramflags & PARAMFLAG_NOFREE);
|
||||
|
||||
// let's see if the value has been read
|
||||
// the datamodel is more difficult than it should be
|
||||
// and it is not thread safe
|
||||
if (cfgoptions->voidptr) {
|
||||
int sz;
|
||||
if ( cfgoptions-> type == TYPE_STRING)
|
||||
sz=managed_ptr_sz(*cfgoptions->strptr);
|
||||
else
|
||||
sz=managed_ptr_sz(cfgoptions->voidptr);
|
||||
if ( sz != -1 ) // the same variable pointer has been used!
|
||||
cfgoptions->numelt=sz;
|
||||
}
|
||||
|
||||
if (cfgoptions->voidptr != NULL
|
||||
&& (cfgoptions->type == TYPE_INTARRAY
|
||||
|| cfgoptions->type == TYPE_UINTARRAY
|
||||
|| cfgoptions->type == TYPE_STRINGLIST )) {
|
||||
int sz;
|
||||
if ( cfgoptions->type == TYPE_STRING ||
|
||||
cfgoptions->type == TYPE_STRINGLIST )
|
||||
sz=managed_ptr_sz(*cfgoptions->strptr);
|
||||
else
|
||||
sz=managed_ptr_sz(cfgoptions->voidptr);
|
||||
if ( sz == -1) {
|
||||
CONFIG_PRINTF_ERROR("[CONFIG] %s NOT SUPPORTED not NULL pointer with array types", cfgoptions->optname);
|
||||
return ;
|
||||
}
|
||||
}
|
||||
|
||||
if (cfgoptions->voidptr == NULL ) {
|
||||
if (cfgoptions->type == TYPE_STRING) {
|
||||
// difficult datamodel
|
||||
cfgoptions->strptr = config_allocate_new(sizeof(*cfgoptions->strptr), toFree);
|
||||
} else if ( cfgoptions->type == TYPE_STRINGLIST) {
|
||||
AssertFatal(nb_elt<MAX_LIST_SIZE,
|
||||
"This piece of code use fixed size arry of constant #define MAX_LIST_SIZE %d\n",
|
||||
MAX_LIST_SIZE );
|
||||
cfgoptions->strlistptr= config_allocate_new(sizeof(char*)*MAX_LIST_SIZE, toFree);
|
||||
for (int i=0; i<MAX_LIST_SIZE; i++)
|
||||
cfgoptions->strlistptr[i]= config_allocate_new(DEFAULT_EXTRA_SZ, toFree);
|
||||
} else {
|
||||
if ( cfgoptions->type == TYPE_INTARRAY || cfgoptions->type == TYPE_UINTARRAY )
|
||||
nb_elt=max(nb_elt, MAX_LIST_SIZE); // make room if the list is larger than the default one
|
||||
cfgoptions->voidptr = config_allocate_new(elt_sz*nb_elt, toFree);
|
||||
}
|
||||
}
|
||||
|
||||
if (cfgoptions->type == TYPE_STRING && *cfgoptions->strptr == NULL) {
|
||||
*cfgoptions->strptr = config_allocate_new(nb_elt+DEFAULT_EXTRA_SZ, toFree);
|
||||
cfgoptions->numelt=nb_elt+DEFAULT_EXTRA_SZ;
|
||||
}
|
||||
|
||||
printf_ptrs("[CONFIG] %s ptr: %p requested size: elt_sz: %d, nb_elt: %d\n",cfgoptions->optname, cfgoptions->voidptr, elt_sz, nb_elt);
|
||||
}
|
||||
|
||||
void config_assign_int(paramdef_t *cfgoptions, char *fullname, int val) {
|
||||
int tmpval=val;
|
||||
|
||||
if ( ((cfgoptions->paramflags &PARAMFLAG_BOOL) != 0) && tmpval >0) {
|
||||
tmpval =1;
|
||||
}
|
||||
|
||||
switch (cfgoptions->type) {
|
||||
case TYPE_UINT8:
|
||||
*(cfgoptions->u8ptr) = (uint8_t)tmpval;
|
||||
printf_params("[CONFIG] %s: %u\n", fullname, (uint8_t)tmpval);
|
||||
break;
|
||||
|
||||
case TYPE_INT8:
|
||||
*(cfgoptions->i8ptr) = (int8_t)tmpval;
|
||||
printf_params("[CONFIG] %s: %i\n", fullname, (int8_t)tmpval);
|
||||
break;
|
||||
|
||||
case TYPE_UINT16:
|
||||
*(cfgoptions->u16ptr) = (uint16_t)tmpval;
|
||||
printf_params("[CONFIG] %s: %hu\n", fullname, (uint16_t)tmpval);
|
||||
break;
|
||||
|
||||
case TYPE_INT16:
|
||||
*(cfgoptions->i16ptr) = (int16_t)tmpval;
|
||||
printf_params("[CONFIG] %s: %hi\n", fullname, (int16_t)tmpval);
|
||||
break;
|
||||
|
||||
case TYPE_UINT32:
|
||||
*(cfgoptions->uptr) = (uint32_t)tmpval;
|
||||
printf_params("[CONFIG] %s: %u\n", fullname, (uint32_t)tmpval);
|
||||
break;
|
||||
|
||||
case TYPE_MASK:
|
||||
*(cfgoptions->uptr) = *(cfgoptions->uptr) | (uint32_t)tmpval;
|
||||
printf_params("[CONFIG] %s: 0x%08x\n", fullname, (uint32_t)tmpval);
|
||||
break;
|
||||
|
||||
case TYPE_INT32:
|
||||
*(cfgoptions->iptr) = (int32_t)tmpval;
|
||||
printf_params("[CONFIG] %s: %i\n", fullname, (int32_t)tmpval);
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf (stderr,"[CONFIG] %s %i type %i non integer parameter %s not assigned\n",__FILE__, __LINE__,cfgoptions->type,fullname);
|
||||
break;
|
||||
}
|
||||
}
|
||||
void config_assign_processedint(paramdef_t *cfgoption, int val) {
|
||||
cfgoption->processedvalue = config_allocate_new(sizeof(int),!(cfgoption->paramflags & PARAMFLAG_NOFREE));
|
||||
static void config_assign_processedint(configmodule_interface_t *cfg, paramdef_t *cfgoption, int val)
|
||||
{
|
||||
cfgoption->processedvalue = config_allocate_new(cfg, sizeof(int), !(cfgoption->paramflags & PARAMFLAG_NOFREE));
|
||||
|
||||
if ( cfgoption->processedvalue != NULL) {
|
||||
*(cfgoption->processedvalue) = val;
|
||||
@@ -203,14 +55,15 @@ void config_assign_processedint(paramdef_t *cfgoption, int val) {
|
||||
}
|
||||
}
|
||||
|
||||
int config_get_processedint(paramdef_t *cfgoption) {
|
||||
int config_get_processedint(configmodule_interface_t *cfg, paramdef_t *cfgoption)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if ( cfgoption->processedvalue != NULL) {
|
||||
ret=*(cfgoption->processedvalue);
|
||||
free( cfgoption->processedvalue);
|
||||
cfgoption->processedvalue=NULL;
|
||||
printf_params("[CONFIG] %s: set from %s to %i\n",cfgoption->optname, *cfgoption->strptr, ret);
|
||||
printf_params(cfg, "[CONFIG] %s: set from %s to %i\n", cfgoption->optname, *cfgoption->strptr, ret);
|
||||
} else {
|
||||
fprintf (stderr,"[CONFIG] %s %d %s has no processed integer availablle\n",__FILE__, __LINE__, cfgoption->optname);
|
||||
ret=0;
|
||||
@@ -231,7 +84,8 @@ void config_printhelp(paramdef_t *params,int numparams, char *prefix) {
|
||||
printf("--------------------------------------------------------------------\n\n");
|
||||
}
|
||||
|
||||
int config_execcheck(paramdef_t *params, int numparams, char *prefix) {
|
||||
int config_execcheck(configmodule_interface_t *cfg, paramdef_t *params, int numparams, char *prefix)
|
||||
{
|
||||
int st=0;
|
||||
|
||||
for (int i=0 ; i<numparams ; i++) {
|
||||
@@ -240,7 +94,7 @@ int config_execcheck(paramdef_t *params, int numparams, char *prefix) {
|
||||
}
|
||||
|
||||
if (params[i].chkPptr->s4.f4 != NULL) {
|
||||
st += params[i].chkPptr->s4.f4(&(params[i]));
|
||||
st += params[i].chkPptr->s4.f4(cfg, &(params[i]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,7 +115,8 @@ int config_paramidx_fromname(paramdef_t *params, int numparams, char *name) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int config_get(paramdef_t *params, int numparams, char *prefix) {
|
||||
int config_get(configmodule_interface_t *cfgif, paramdef_t *params, int numparams, char *prefix)
|
||||
{
|
||||
int ret= -1;
|
||||
|
||||
if (CONFIG_ISFLAGSET(CONFIG_ABORT)) {
|
||||
@@ -269,16 +124,15 @@ int config_get(paramdef_t *params, int numparams, char *prefix) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
configmodule_interface_t *cfgif = config_get_if();
|
||||
if (cfgif != NULL) {
|
||||
ret = config_get_if()->get(params, numparams, prefix);
|
||||
ret = cfgif->get(cfgif, params, numparams, prefix);
|
||||
|
||||
if (ret >= 0) {
|
||||
config_process_cmdline(params, numparams, prefix);
|
||||
config_process_cmdline(cfgif, params, numparams, prefix);
|
||||
if (cfgif->rtflags & CONFIG_SAVERUNCFG) {
|
||||
config_get_if()->set(params, numparams, prefix);
|
||||
cfgif->set(params, numparams, prefix);
|
||||
}
|
||||
config_execcheck(params, numparams, prefix);
|
||||
config_execcheck(cfgif, params, numparams, prefix);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -287,16 +141,13 @@ int config_get(paramdef_t *params, int numparams, char *prefix) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
int config_getlist(paramlist_def_t *ParamList, paramdef_t *params, int numparams, char *prefix) {
|
||||
int config_getlist(configmodule_interface_t *cfg, paramlist_def_t *ParamList, paramdef_t *params, int numparams, char *prefix)
|
||||
{
|
||||
if (CONFIG_ISFLAGSET(CONFIG_ABORT)) {
|
||||
fprintf(stderr,"[CONFIG] config_get skipped, config module not properly initialized\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!config_get_if())
|
||||
return -1;
|
||||
|
||||
const int ret = config_get_if()->getlist(ParamList, params, numparams, prefix);
|
||||
const int ret = cfg->getlist(cfg, ParamList, params, numparams, prefix);
|
||||
|
||||
if (ret >= 0 && params) {
|
||||
char *newprefix;
|
||||
@@ -314,11 +165,11 @@ int config_getlist(paramlist_def_t *ParamList, paramdef_t *params, int numparams
|
||||
for (int i = 0; i < ParamList->numelt; ++i) {
|
||||
// TODO config_process_cmdline?
|
||||
sprintf(cfgpath, "%s.[%i]", newprefix, i);
|
||||
config_process_cmdline(ParamList->paramarray[i],numparams,cfgpath);
|
||||
if (config_get_if()->rtflags & CONFIG_SAVERUNCFG) {
|
||||
config_get_if()->set(ParamList->paramarray[i], numparams, cfgpath);
|
||||
config_process_cmdline(cfg, ParamList->paramarray[i], numparams, cfgpath);
|
||||
if (cfg->rtflags & CONFIG_SAVERUNCFG) {
|
||||
cfg->set(ParamList->paramarray[i], numparams, cfgpath);
|
||||
}
|
||||
config_execcheck(ParamList->paramarray[i], numparams, cfgpath);
|
||||
config_execcheck(cfg, ParamList->paramarray[i], numparams, cfgpath);
|
||||
}
|
||||
|
||||
if (prefix)
|
||||
@@ -347,7 +198,8 @@ void print_intvalueerror(paramdef_t *param, char *fname, int *okval, int numokva
|
||||
fprintf(stderr, " \n");
|
||||
}
|
||||
|
||||
int config_check_intval(paramdef_t *param) {
|
||||
int config_check_intval(configmodule_interface_t *cfg, paramdef_t *param)
|
||||
{
|
||||
if ( param == NULL ) {
|
||||
fprintf(stderr,"[CONFIG] config_check_intval: NULL param argument\n");
|
||||
return -1;
|
||||
@@ -363,10 +215,15 @@ int config_check_intval(paramdef_t *param) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int config_check_modify_integer(paramdef_t *param) {
|
||||
int config_check_modify_integer(configmodule_interface_t *cfg, paramdef_t *param)
|
||||
{
|
||||
for (int i=0; i < param->chkPptr->s1a.num_okintval ; i++) {
|
||||
if (*(param->uptr) == param->chkPptr->s1a.okintval[i] ) {
|
||||
printf_params("[CONFIG] %s: read value %i, set to %i\n",param->optname,*(param->uptr),param->chkPptr->s1a.setintval [i]);
|
||||
printf_params(cfg,
|
||||
"[CONFIG] %s: read value %i, set to %i\n",
|
||||
param->optname,
|
||||
*(param->uptr),
|
||||
param->chkPptr->s1a.setintval[i]);
|
||||
*(param->uptr) = param->chkPptr->s1a.setintval [i];
|
||||
return 0;
|
||||
}
|
||||
@@ -376,7 +233,8 @@ int config_check_modify_integer(paramdef_t *param) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int config_check_intrange(paramdef_t *param) {
|
||||
int config_check_intrange(configmodule_interface_t *cfg, paramdef_t *param)
|
||||
{
|
||||
if( *(param->iptr) >= param->chkPptr->s2.okintrange[0] && *(param->iptr) <= param->chkPptr->s2.okintrange[1] ) {
|
||||
return 0;
|
||||
}
|
||||
@@ -397,7 +255,8 @@ void print_strvalueerror(paramdef_t *param, char *fname, char **okval, int numok
|
||||
fprintf(stderr, " \n");
|
||||
}
|
||||
|
||||
int config_check_strval(paramdef_t *param) {
|
||||
int config_check_strval(configmodule_interface_t *cfg, paramdef_t *param)
|
||||
{
|
||||
if ( param == NULL ) {
|
||||
fprintf(stderr,"[CONFIG] config_check_strval: NULL param argument\n");
|
||||
return -1;
|
||||
@@ -413,10 +272,11 @@ int config_check_strval(paramdef_t *param) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int config_checkstr_assign_integer(paramdef_t *param) {
|
||||
int config_checkstr_assign_integer(configmodule_interface_t *cfg, paramdef_t *param)
|
||||
{
|
||||
for (int i=0; i < param->chkPptr->s3a.num_okstrval ; i++) {
|
||||
if (strcasecmp(*param->strptr,param->chkPptr->s3a.okstrval[i] ) == 0) {
|
||||
config_assign_processedint(param, param->chkPptr->s3a.setintval[i]);
|
||||
config_assign_processedint(cfg, param, param->chkPptr->s3a.setintval[i]);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -430,123 +290,3 @@ void config_set_checkfunctions(paramdef_t *params, checkedparam_t *checkfunction
|
||||
params[i].chkPptr = &(checkfunctions[i]);
|
||||
}
|
||||
}
|
||||
|
||||
int config_setdefault_string(paramdef_t *cfgoptions, char *prefix) {
|
||||
int status = 0;
|
||||
|
||||
if( cfgoptions->defstrval != NULL) {
|
||||
status=1;
|
||||
|
||||
if (cfgoptions->numelt == 0 )
|
||||
config_check_valptr(cfgoptions, 1, strlen(cfgoptions->defstrval)+1);
|
||||
if ( cfgoptions->numelt < strlen(cfgoptions->defstrval)+1 ) {
|
||||
CONFIG_PRINTF_ERROR("[CONFIG] %s size too small\n", cfgoptions->optname);
|
||||
}
|
||||
snprintf(*cfgoptions->strptr, cfgoptions->numelt, "%s",cfgoptions->defstrval);
|
||||
printf_params("[CONFIG] %s.%s set to default value \"%s\"\n", ((prefix == NULL) ? "" : prefix), cfgoptions->optname, *cfgoptions->strptr);
|
||||
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_setdefault_stringlist(paramdef_t *cfgoptions, char *prefix) {
|
||||
int status = 0;
|
||||
|
||||
if( cfgoptions->defstrlistval != NULL) {
|
||||
cfgoptions->strlistptr=cfgoptions->defstrlistval;
|
||||
status=1;
|
||||
|
||||
for(int j=0; j<cfgoptions->numelt; j++)
|
||||
printf_params("[CONFIG] %s.%s[%i] set to default value %s\n", ((prefix == NULL) ? "" : prefix), cfgoptions->optname,j, cfgoptions->strlistptr[j]);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_setdefault_int(paramdef_t *cfgoptions, char *prefix) {
|
||||
int status = 0;
|
||||
config_check_valptr(cfgoptions, sizeof(*cfgoptions->iptr), 1);
|
||||
|
||||
if( ((cfgoptions->paramflags & PARAMFLAG_MANDATORY) == 0)) {
|
||||
config_assign_int(cfgoptions,cfgoptions->optname,cfgoptions->defintval);
|
||||
status=1;
|
||||
printf_params("[CONFIG] %s.%s set to default value\n", ((prefix == NULL) ? "" : prefix), cfgoptions->optname);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_setdefault_int64(paramdef_t *cfgoptions, char *prefix) {
|
||||
int status = 0;
|
||||
config_check_valptr(cfgoptions, sizeof(*cfgoptions->i64ptr), 1);
|
||||
|
||||
if( ((cfgoptions->paramflags & PARAMFLAG_MANDATORY) == 0)) {
|
||||
*(cfgoptions->u64ptr)=cfgoptions->defuintval;
|
||||
status=1;
|
||||
printf_params("[CONFIG] %s.%s set to default value %llu\n", ((prefix == NULL) ? "" : prefix), cfgoptions->optname, (long long unsigned)(*(cfgoptions->u64ptr)));
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_setdefault_intlist(paramdef_t *cfgoptions, char *prefix) {
|
||||
int status = 0;
|
||||
|
||||
if( cfgoptions->defintarrayval != NULL) {
|
||||
config_check_valptr(cfgoptions, sizeof(cfgoptions->iptr), cfgoptions->numelt);
|
||||
cfgoptions->iptr=cfgoptions->defintarrayval;
|
||||
status=1;
|
||||
|
||||
for (int j=0; j<cfgoptions->numelt ; j++) {
|
||||
printf_params("[CONFIG] %s[%i] set to default value %i\n",cfgoptions->optname,j,(int)cfgoptions->iptr[j]);
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_setdefault_double(paramdef_t *cfgoptions, char *prefix) {
|
||||
int status = 0;
|
||||
config_check_valptr(cfgoptions, sizeof(*cfgoptions->dblptr), 1);
|
||||
|
||||
if( ((cfgoptions->paramflags & PARAMFLAG_MANDATORY) == 0)) {
|
||||
*(cfgoptions->dblptr)=cfgoptions->defdblval;
|
||||
status=1;
|
||||
printf_params("[CONFIG] %s set to default value %lf\n",cfgoptions->optname, *(cfgoptions->dblptr));
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_assign_ipv4addr(paramdef_t *cfgoptions, char *ipv4addr) {
|
||||
config_check_valptr(cfgoptions, sizeof(*cfgoptions->uptr), 1);
|
||||
int rst=inet_pton(AF_INET, ipv4addr,cfgoptions->uptr );
|
||||
|
||||
if (rst == 1 && *(cfgoptions->uptr) > 0) {
|
||||
printf_params("[CONFIG] %s: %s\n",cfgoptions->optname, ipv4addr);
|
||||
return 1;
|
||||
} else {
|
||||
if ( strncmp(ipv4addr,ANY_IPV4ADDR_STRING,sizeof(ANY_IPV4ADDR_STRING)) == 0) {
|
||||
printf_params("[CONFIG] %s:%s (INADDR_ANY) \n",cfgoptions->optname,ipv4addr);
|
||||
*cfgoptions->uptr=INADDR_ANY;
|
||||
return 1;
|
||||
} else {
|
||||
fprintf(stderr,"[CONFIG] %s not valid for %s \n", ipv4addr, cfgoptions->optname);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int config_setdefault_ipv4addr(paramdef_t *cfgoptions, char *prefix) {
|
||||
int status = 0;
|
||||
|
||||
if (cfgoptions->defstrval != NULL) {
|
||||
status = config_assign_ipv4addr(cfgoptions, cfgoptions->defstrval);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -33,60 +33,49 @@
|
||||
#ifndef INCLUDE_CONFIG_USERAPI_H
|
||||
#define INCLUDE_CONFIG_USERAPI_H
|
||||
#include "config_load_configmodule.h"
|
||||
#include "common/utils/utils.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#ifndef NOT_uniqCfg
|
||||
extern configmodule_interface_t *uniqCfg;
|
||||
#define config_get_if() uniqCfg // Existing code implicit uniq configuration context
|
||||
#endif
|
||||
/* utility functions to ease usage of config module structures */
|
||||
#define CONFIG_GETSOURCE ( (config_get_if()==NULL) ? NULL : config_get_if()->cfgmode )
|
||||
#define CONFIG_GETNUMP ( (config_get_if()==NULL) ? 0 : config_get_if()->num_cfgP )
|
||||
#define CONFIG_GETP(P) ( (config_get_if()==NULL) ? NULL : config_get_if()->cfgP[P] )
|
||||
#define CONFIG_GETSOURCE ((config_get_if() == NULL) ? NULL : config_get_if()->cfgmode)
|
||||
#define CONFIG_ISFLAGSET(P) ( (config_get_if()==NULL) ? 0 : !!(config_get_if()->rtflags & P))
|
||||
#define CONFIG_SETRTFLAG(P) if (config_get_if()) { config_get_if()->rtflags |= P; }
|
||||
#define CONFIG_CLEARRTFLAG(P) if (config_get_if()) { config_get_if()->rtflags &= (~P); }
|
||||
#define CONFIG_ISPARAMFLAGSET(P,F) ( !!(P.paramflags & F))
|
||||
extern int config_paramidx_fromname(paramdef_t *params,int numparams, char *name);
|
||||
int config_paramidx_fromname(paramdef_t *params, int numparams, char *name);
|
||||
|
||||
/* utility functions, to be used by configuration module and/or configuration libraries */
|
||||
extern configmodule_interface_t *config_get_if(void);
|
||||
void config_check_valptr(paramdef_t *cfgoptions, int elt_sz, int nb_elt);
|
||||
extern void config_printhelp(paramdef_t *,int numparams, char *prefix);
|
||||
extern int config_process_cmdline(paramdef_t *params,int numparams, char *prefix);
|
||||
extern void config_assign_processedint(paramdef_t *cfgoption, int val);
|
||||
extern void config_assign_int(paramdef_t *cfgoptions, char *fullname, int val);
|
||||
extern int config_assign_ipv4addr(paramdef_t *cfgoptions, char *ipv4addr);
|
||||
void config_printhelp(paramdef_t *, int numparams, char *prefix);
|
||||
int config_process_cmdline(configmodule_interface_t *cfg, paramdef_t *params, int numparams, char *prefix);
|
||||
int config_assign_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *ipv4addr);
|
||||
|
||||
/* apis to get/check parameters, to be used by oai modules, at configuration time */
|
||||
#define CONFIG_CHECKALLSECTIONS "ALLSECTIONS"
|
||||
extern int config_check_unknown_cmdlineopt(char *prefix);
|
||||
extern int config_get(paramdef_t *params,int numparams, char *prefix);
|
||||
extern int config_getlist(paramlist_def_t *ParamList, paramdef_t *params, int numparams, char *prefix);
|
||||
int config_check_unknown_cmdlineopt(configmodule_interface_t *cfg, char *prefix);
|
||||
int config_get(configmodule_interface_t *cfg, paramdef_t *params, int numparams, char *prefix);
|
||||
int config_getlist(configmodule_interface_t *cfg, paramlist_def_t *ParamList, paramdef_t *params, int numparams, char *prefix);
|
||||
|
||||
/* apis to set some of the paramdef_t fields before using the get/getlist api's */
|
||||
extern void config_set_checkfunctions(paramdef_t *params, checkedparam_t *checkfunctions, int numparams);
|
||||
void config_set_checkfunctions(paramdef_t *params, checkedparam_t *checkfunctions, int numparams);
|
||||
|
||||
/* apis to retrieve parameters info after calling get or getlist functions */
|
||||
extern int config_isparamset(paramdef_t *params,int paramidx);
|
||||
extern int config_get_processedint(paramdef_t *cfgoption);
|
||||
int config_isparamset(paramdef_t *params, int paramidx);
|
||||
int config_get_processedint(configmodule_interface_t *cfg, paramdef_t *cfgoption);
|
||||
|
||||
/* functions to be used in parameters definition, to check parameters values */
|
||||
extern int config_check_intval(paramdef_t *param);
|
||||
extern int config_check_modify_integer(paramdef_t *param);
|
||||
extern int config_check_intrange(paramdef_t *param);
|
||||
extern int config_check_strval(paramdef_t *param);
|
||||
extern int config_checkstr_assign_integer(paramdef_t *param);
|
||||
int config_check_intval(configmodule_interface_t *cfg, paramdef_t *param);
|
||||
int config_check_modify_integer(configmodule_interface_t *cfg, paramdef_t *param);
|
||||
int config_check_intrange(configmodule_interface_t *cfg, paramdef_t *param);
|
||||
int config_check_strval(configmodule_interface_t *cfg, paramdef_t *param);
|
||||
int config_checkstr_assign_integer(configmodule_interface_t *cfg, paramdef_t *param);
|
||||
|
||||
/* functions to set a parameter to its default value */
|
||||
extern int config_setdefault_string(paramdef_t *cfgoptions, char *prefix);
|
||||
extern int config_setdefault_stringlist(paramdef_t *cfgoptions, char *prefix);
|
||||
extern int config_setdefault_int(paramdef_t *cfgoptions, char *prefix);
|
||||
extern int config_setdefault_int64(paramdef_t *cfgoptions, char *prefix);
|
||||
extern int config_setdefault_intlist(paramdef_t *cfgoptions, char *prefix);
|
||||
extern int config_setdefault_double(paramdef_t *cfgoptions, char *prefix);
|
||||
extern int config_setdefault_ipv4addr(paramdef_t *cfgoptions, char *prefix);
|
||||
void *config_allocate_new(int sz, bool autoFree);
|
||||
#define CONFIG_GETCONFFILE (config_get_if()->cfgP[0])
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
|
||||
#include "config_libconfig.h"
|
||||
#include "config_libconfig_private.h"
|
||||
#define NOT_uniqCfg
|
||||
#include "../config_common.h"
|
||||
#include "../config_userapi.h"
|
||||
#include "errno.h"
|
||||
#include "assertions.h"
|
||||
@@ -51,14 +53,15 @@
|
||||
#define config_setting_lookup config_lookup_from
|
||||
#endif
|
||||
|
||||
void config_libconfig_end(void );
|
||||
void config_libconfig_end(configmodule_interface_t *cfg);
|
||||
|
||||
int read_strlist(paramdef_t *cfgoptions,config_setting_t *setting, char *cfgpath) {
|
||||
int read_strlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions, config_setting_t *setting, char *cfgpath)
|
||||
{
|
||||
const char *str;
|
||||
int st;
|
||||
int numelt;
|
||||
numelt=config_setting_length(setting);
|
||||
config_check_valptr(cfgoptions, sizeof(char *), numelt);
|
||||
config_check_valptr(cfg, cfgoptions, sizeof(char *), numelt);
|
||||
st=0;
|
||||
AssertFatal(MAX_LIST_SIZE > numelt,
|
||||
"This piece of code use fixed size arry of constant #define MAX_LIST_SIZE %d\n",
|
||||
@@ -71,7 +74,7 @@ int read_strlist(paramdef_t *cfgoptions,config_setting_t *setting, char *cfgpath
|
||||
} else {
|
||||
snprintf(cfgoptions->strlistptr[i], DEFAULT_EXTRA_SZ, "%s",str);
|
||||
st++;
|
||||
printf_params("[LIBCONFIG] %s%i: %s\n", cfgpath,i,cfgoptions->strlistptr[i]);
|
||||
printf_params(cfg, "[LIBCONFIG] %s%i: %s\n", cfgpath, i, cfgoptions->strlistptr[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,22 +82,27 @@ int read_strlist(paramdef_t *cfgoptions,config_setting_t *setting, char *cfgpath
|
||||
return st;
|
||||
}
|
||||
|
||||
int read_intarray(paramdef_t *cfgoptions,config_setting_t *setting, char *cfgpath) {
|
||||
static int read_intarray(configmodule_interface_t *cfg, paramdef_t *cfgoptions, config_setting_t *setting, char *cfgpath)
|
||||
{
|
||||
cfgoptions->numelt=config_setting_length(setting);
|
||||
|
||||
if (cfgoptions->numelt > 0) {
|
||||
cfgoptions->iptr=config_allocate_new(cfgoptions->numelt*sizeof(*cfgoptions->iptr),
|
||||
!(cfgoptions->paramflags & PARAMFLAG_NOFREE) );
|
||||
cfgoptions->iptr =
|
||||
config_allocate_new(cfg, cfgoptions->numelt * sizeof(*cfgoptions->iptr), !(cfgoptions->paramflags & PARAMFLAG_NOFREE));
|
||||
|
||||
for (int i=0; i< cfgoptions->numelt && cfgoptions->iptr != NULL; i++) {
|
||||
cfgoptions->iptr[i]=config_setting_get_int_elem(setting,i);
|
||||
printf_params("[LIBCONFIG] %s[%i]: %i\n", cfgpath,i,cfgoptions->iptr[i]);
|
||||
printf_params(cfg, "[LIBCONFIG] %s[%i]: %i\n", cfgpath, i, cfgoptions->iptr[i]);
|
||||
} /* for loop on array element... */
|
||||
}
|
||||
|
||||
return cfgoptions->numelt;
|
||||
}
|
||||
int config_libconfig_setparams(paramdef_t *cfgoptions, int numoptions, config_setting_t *asetting, char *prefix)
|
||||
int config_libconfig_setparams(configmodule_interface_t *cfg,
|
||||
paramdef_t *cfgoptions,
|
||||
int numoptions,
|
||||
config_setting_t *asetting,
|
||||
char *prefix)
|
||||
{
|
||||
int status;
|
||||
int errors = 0;
|
||||
@@ -106,7 +114,7 @@ int config_libconfig_setparams(paramdef_t *cfgoptions, int numoptions, config_se
|
||||
for (int i = 0; i < numoptions; i++) {
|
||||
if (cfgoptions[i].paramflags & PARAMFLAG_CMDLINEONLY) {
|
||||
continue;
|
||||
printf_params("[LIBCONFIG] setting %s.%s skipped (command line only) \n", secprefix, cfgoptions[i].optname);
|
||||
printf_params(cfg, "[LIBCONFIG] setting %s.%s skipped (command line only) \n", secprefix, cfgoptions[i].optname);
|
||||
}
|
||||
status = CONFIG_FALSE;
|
||||
config_setting_t *psetting;
|
||||
@@ -115,7 +123,7 @@ int config_libconfig_setparams(paramdef_t *cfgoptions, int numoptions, config_se
|
||||
psetting = config_lookup(&(libconfig_privdata.runtcfg), spath);
|
||||
free(spath);
|
||||
if (psetting != NULL) {
|
||||
printf_params("[LIBCONFIG] setting %s.%s already created \n", secprefix, cfgoptions[i].optname);
|
||||
printf_params(cfg, "[LIBCONFIG] setting %s.%s already created \n", secprefix, cfgoptions[i].optname);
|
||||
continue;
|
||||
}
|
||||
switch (cfgoptions[i].type) {
|
||||
@@ -137,7 +145,7 @@ int config_libconfig_setparams(paramdef_t *cfgoptions, int numoptions, config_se
|
||||
if (psetting != NULL) {
|
||||
if (cfgoptions[i].numelt <= 0) {
|
||||
emptyla++;
|
||||
printf_params("[LIBCONFIG], no element in list %s\n", cfgoptions[i].optname);
|
||||
printf_params(cfg, "[LIBCONFIG], no element in list %s\n", cfgoptions[i].optname);
|
||||
status = CONFIG_TRUE;
|
||||
}
|
||||
for (int j = 0; j < cfgoptions[i].numelt; j++) {
|
||||
@@ -176,7 +184,7 @@ int config_libconfig_setparams(paramdef_t *cfgoptions, int numoptions, config_se
|
||||
if (psetting != NULL) {
|
||||
if (cfgoptions[i].numelt <= 0) {
|
||||
emptyla++;
|
||||
printf_params("[LIBCONFIG], no element in array %s.%s\n", secprefix, cfgoptions[i].optname);
|
||||
printf_params(cfg, "[LIBCONFIG], no element in array %s.%s\n", secprefix, cfgoptions[i].optname);
|
||||
status = CONFIG_TRUE;
|
||||
}
|
||||
for (int j = 0; j < cfgoptions[i].numelt; j++) {
|
||||
@@ -222,24 +230,24 @@ int config_libconfig_setparams(paramdef_t *cfgoptions, int numoptions, config_se
|
||||
fprintf(stderr, "[LIBCONFIG] Error creating setting %i: %s.%s type %i\n", i, secprefix, cfgoptions[i].optname, cfgoptions[i].type);
|
||||
}
|
||||
}
|
||||
printf_params("[LIBCONFIG], in group \"%s\" %i settings \n", secprefix, numoptions);
|
||||
printf_params(cfg, "[LIBCONFIG], in group \"%s\" %i settings \n", secprefix, numoptions);
|
||||
if (notused > 0)
|
||||
printf_params("[LIBCONFIG], ..... %i settings with NULL value pointer\n", notused);
|
||||
printf_params(cfg, "[LIBCONFIG], ..... %i settings with NULL value pointer\n", notused);
|
||||
if (errors > 0)
|
||||
fprintf(stderr, "[LIBCONFIG] .....%i settings creation errors \n", errors);
|
||||
if (emptyla > 0)
|
||||
fprintf(stderr, "[LIBCONFIG] .....%i empty lists or arrays settings \n", emptyla);
|
||||
|
||||
if (cfgptr->status) {
|
||||
cfgptr->status->num_err_nullvalue += notused;
|
||||
cfgptr->status->num_err_write += errors;
|
||||
cfgptr->status->num_write += numoptions;
|
||||
cfgptr->status->emptyla += emptyla;
|
||||
if (cfg->status) {
|
||||
cfg->status->num_err_nullvalue += notused;
|
||||
cfg->status->num_err_write += errors;
|
||||
cfg->status->num_write += numoptions;
|
||||
cfg->status->emptyla += emptyla;
|
||||
}
|
||||
return errors;
|
||||
}
|
||||
|
||||
int config_libconfig_set(paramdef_t *cfgoptions, int numoptions, char *prefix)
|
||||
int config_libconfig_set(configmodule_interface_t *cfg, paramdef_t *cfgoptions, int numoptions, char *prefix)
|
||||
{
|
||||
char *tokctx1 = NULL;
|
||||
int listidx = -1;
|
||||
@@ -250,13 +258,13 @@ int config_libconfig_set(paramdef_t *cfgoptions, int numoptions, char *prefix)
|
||||
prefixbck = strdup(prefix);
|
||||
prefix_elem1 = strtok_r(prefixbck, ".", &tokctx1);
|
||||
}
|
||||
printf_params("[LIBCONFIG], processing prefix %s\n", (prefix == NULL) ? "NULL" : prefix);
|
||||
printf_params(cfg, "[LIBCONFIG], processing prefix %s\n", (prefix == NULL) ? "NULL" : prefix);
|
||||
|
||||
/* parse the prefix , possibly creating groups, lists and list elements */
|
||||
while (prefix_elem1 != NULL) {
|
||||
int n1 = strlen(prefix_elem1);
|
||||
char *prefix_elem2 = prefix_elem1 + n1 + 1;
|
||||
printf_params("[LIBCONFIG], processing elem1 %s elem2 %s\n", prefix_elem1, prefix_elem2);
|
||||
printf_params(cfg, "[LIBCONFIG], processing elem1 %s elem2 %s\n", prefix_elem1, prefix_elem2);
|
||||
/* prefix (the path to the parameter name) may contain groups and elements from a list, which are specified with [] */
|
||||
if (prefix_elem2[0] != '[') { // not a list
|
||||
|
||||
@@ -265,11 +273,11 @@ int config_libconfig_set(paramdef_t *cfgoptions, int numoptions, char *prefix)
|
||||
asetting = config_setting_add(asetting, prefix_elem1, CONFIG_TYPE_GROUP);
|
||||
else
|
||||
asetting = tmpset;
|
||||
printf_params("[LIBCONFIG], creating or looking for group %s: %s\n", prefix_elem1, (asetting == NULL) ? "NOK" : "OK");
|
||||
printf_params(cfg, "[LIBCONFIG], creating or looking for group %s: %s\n", prefix_elem1, (asetting == NULL) ? "NOK" : "OK");
|
||||
} else { // a list
|
||||
listidx = (int)strtol(prefix_elem2 + 1, NULL, 10);
|
||||
if (errno == EINVAL || errno == ERANGE) {
|
||||
printf_params("[LIBCONFIG], Error %s looking for list index in %s \n", strerror(errno), prefix_elem2);
|
||||
printf_params(cfg, "[LIBCONFIG], Error %s looking for list index in %s \n", strerror(errno), prefix_elem2);
|
||||
break;
|
||||
}
|
||||
config_setting_t *tmpset = config_setting_lookup(asetting, prefix_elem1);
|
||||
@@ -277,14 +285,17 @@ int config_libconfig_set(paramdef_t *cfgoptions, int numoptions, char *prefix)
|
||||
asetting = config_setting_add(asetting, prefix_elem1, CONFIG_TYPE_LIST);
|
||||
else
|
||||
asetting = tmpset;
|
||||
printf_params("[LIBCONFIG], creating or looking for list %s: %s\n", prefix_elem1, (asetting == NULL) ? "NOK" : "OK");
|
||||
printf_params(cfg, "[LIBCONFIG], creating or looking for list %s: %s\n", prefix_elem1, (asetting == NULL) ? "NOK" : "OK");
|
||||
if (asetting != NULL) {
|
||||
tmpset = config_setting_get_elem(asetting, listidx);
|
||||
if (tmpset == NULL)
|
||||
asetting = config_setting_add(asetting, NULL, CONFIG_TYPE_GROUP);
|
||||
else
|
||||
asetting = tmpset;
|
||||
printf_params("[LIBCONFIG], creating or looking for list element %i: %s\n", listidx, (asetting == NULL) ? "NOK" : "OK");
|
||||
printf_params(cfg,
|
||||
"[LIBCONFIG], creating or looking for list element %i: %s\n",
|
||||
listidx,
|
||||
(asetting == NULL) ? "NOK" : "OK");
|
||||
}
|
||||
prefix_elem1 = strtok_r(NULL, ".", &tokctx1); // skip the [x] elements we already took care of it
|
||||
if (prefix_elem1 == NULL) {
|
||||
@@ -299,8 +310,8 @@ int config_libconfig_set(paramdef_t *cfgoptions, int numoptions, char *prefix)
|
||||
}
|
||||
free(prefixbck);
|
||||
if (asetting != NULL) {
|
||||
config_libconfig_setparams(cfgoptions, numoptions, asetting, prefix);
|
||||
printf_params("[LIBCONFIG] %i settings added in group %s\n", numoptions, (prefix == NULL) ? "" : prefix);
|
||||
config_libconfig_setparams(cfg, cfgoptions, numoptions, asetting, prefix);
|
||||
printf_params(cfg, "[LIBCONFIG] %i settings added in group %s\n", numoptions, (prefix == NULL) ? "" : prefix);
|
||||
return 0;
|
||||
} else {
|
||||
fprintf(stderr, "[LIBCONFIG] Error parsing %s params, skipped...\n", (prefix == NULL) ? "" : prefix);
|
||||
@@ -308,7 +319,8 @@ int config_libconfig_set(paramdef_t *cfgoptions, int numoptions, char *prefix)
|
||||
}
|
||||
}
|
||||
|
||||
int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
|
||||
int config_libconfig_get(configmodule_interface_t *cfg, paramdef_t *cfgoptions, int numoptions, char *prefix)
|
||||
{
|
||||
config_setting_t *setting;
|
||||
char *str;
|
||||
int i,u;
|
||||
@@ -330,7 +342,7 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
|
||||
}
|
||||
|
||||
if( (cfgoptions->paramflags & PARAMFLAG_DONOTREAD) != 0) {
|
||||
printf_params("[LIBCONFIG] %s.%s ignored\n", cfgpath,cfgoptions[i].optname );
|
||||
printf_params(cfg, "[LIBCONFIG] %s.%s ignored\n", cfgpath, cfgoptions[i].optname);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -340,14 +352,14 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
|
||||
switch(cfgoptions[i].type) {
|
||||
case TYPE_STRING:
|
||||
if ( config_lookup_string(&(libconfig_privdata.cfg), cfgpath, (const char**)&str)) {
|
||||
config_check_valptr(&(cfgoptions[i]), 1, strlen(str)+1);
|
||||
config_check_valptr(cfg, &cfgoptions[i], 1, strlen(str) + 1);
|
||||
if ( strlen(str)+1 > cfgoptions[i].numelt )
|
||||
fprintf(stderr,"[LIBCONFIG] %s: %s exceeds maximum length of %i bytes, value truncated\n",
|
||||
cfgpath,str,cfgoptions[i].numelt);
|
||||
snprintf( *cfgoptions[i].strptr , cfgoptions[i].numelt, "%s", str);
|
||||
printf_params("[LIBCONFIG] %s: \"%s\"\n", cfgpath, *cfgoptions[i].strptr);
|
||||
printf_params(cfg, "[LIBCONFIG] %s: \"%s\"\n", cfgpath, *cfgoptions[i].strptr);
|
||||
} else {
|
||||
defval=config_setdefault_string(&cfgoptions[i],prefix);
|
||||
defval = config_setdefault_string(cfg, &cfgoptions[i], prefix);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -356,9 +368,9 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
|
||||
setting = config_setting_lookup (config_root_setting(&(libconfig_privdata.cfg)),cfgpath );
|
||||
|
||||
if ( setting != NULL) {
|
||||
read_strlist(&cfgoptions[i],setting,cfgpath);
|
||||
read_strlist(cfg, &cfgoptions[i], setting, cfgpath);
|
||||
} else {
|
||||
defval=config_setdefault_stringlist(&(cfgoptions[i]),prefix);
|
||||
defval = config_setdefault_stringlist(cfg, &(cfgoptions[i]), prefix);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -371,10 +383,10 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
|
||||
case TYPE_INT32:
|
||||
case TYPE_MASK:
|
||||
if ( config_lookup_int(&(libconfig_privdata.cfg),cfgpath, &u)) {
|
||||
config_check_valptr(&(cfgoptions[i]), sizeof(*cfgoptions[i].iptr), 1);
|
||||
config_assign_int(&(cfgoptions[i]),cfgpath,u);
|
||||
config_check_valptr(cfg, &(cfgoptions[i]), sizeof(*cfgoptions[i].iptr), 1);
|
||||
config_assign_int(cfg, &(cfgoptions[i]), cfgpath, u);
|
||||
} else {
|
||||
defval=config_setdefault_int(&(cfgoptions[i]),prefix);
|
||||
defval = config_setdefault_int(cfg, &(cfgoptions[i]), prefix);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -382,17 +394,17 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
|
||||
case TYPE_UINT64:
|
||||
case TYPE_INT64:
|
||||
if ( config_lookup_int64(&(libconfig_privdata.cfg),cfgpath, &llu)) {
|
||||
config_check_valptr(&cfgoptions[i], sizeof(*cfgoptions[i].i64ptr), 1);
|
||||
config_check_valptr(cfg, &cfgoptions[i], sizeof(*cfgoptions[i].i64ptr), 1);
|
||||
|
||||
if(cfgoptions[i].type==TYPE_UINT64) {
|
||||
*(cfgoptions[i].u64ptr) = (uint64_t)llu;
|
||||
printf_params("[LIBCONFIG] %s: %lu\n", cfgpath,*cfgoptions[i].u64ptr);
|
||||
printf_params(cfg, "[LIBCONFIG] %s: %lu\n", cfgpath, *cfgoptions[i].u64ptr);
|
||||
} else {
|
||||
*(cfgoptions[i].i64ptr) = llu;
|
||||
printf_params("[LIBCONFIG] %s: %ld\n", cfgpath,*cfgoptions[i].i64ptr);
|
||||
printf_params(cfg, "[LIBCONFIG] %s: %ld\n", cfgpath, *cfgoptions[i].i64ptr);
|
||||
}
|
||||
} else {
|
||||
defval=config_setdefault_int64(&(cfgoptions[i]),prefix);
|
||||
defval = config_setdefault_int64(cfg, &(cfgoptions[i]), prefix);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -402,29 +414,29 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
|
||||
setting = config_setting_lookup (config_root_setting(&(libconfig_privdata.cfg)),cfgpath );
|
||||
|
||||
if ( setting != NULL) {
|
||||
read_intarray(&cfgoptions[i],setting,cfgpath);
|
||||
read_intarray(cfg, &cfgoptions[i], setting, cfgpath);
|
||||
} else {
|
||||
defval=config_setdefault_intlist(&(cfgoptions[i]),prefix);
|
||||
defval = config_setdefault_intlist(cfg, &(cfgoptions[i]), prefix);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case TYPE_DOUBLE:
|
||||
if ( config_lookup_float(&(libconfig_privdata.cfg),cfgpath, &dbl)) {
|
||||
config_check_valptr(&cfgoptions[i],sizeof(*cfgoptions[i].dblptr), 1);
|
||||
config_check_valptr(cfg, &cfgoptions[i], sizeof(*cfgoptions[i].dblptr), 1);
|
||||
*cfgoptions[i].dblptr = dbl;
|
||||
printf_params("[LIBCONFIG] %s: %lf\n", cfgpath,*(cfgoptions[i].dblptr) );
|
||||
printf_params(cfg, "[LIBCONFIG] %s: %lf\n", cfgpath, *(cfgoptions[i].dblptr));
|
||||
} else {
|
||||
defval=config_setdefault_double(&(cfgoptions[i]),prefix);
|
||||
defval = config_setdefault_double(cfg, &(cfgoptions[i]), prefix);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case TYPE_IPV4ADDR:
|
||||
if ( !config_lookup_string(&(libconfig_privdata.cfg),cfgpath, (const char **)&str)) {
|
||||
defval=config_setdefault_ipv4addr(&(cfgoptions[i]),prefix);
|
||||
defval = config_setdefault_ipv4addr(cfg, &(cfgoptions[i]), prefix);
|
||||
} else {
|
||||
rst=config_assign_ipv4addr(cfgoptions, str);
|
||||
rst = config_assign_ipv4addr(cfg, cfgoptions, str);
|
||||
|
||||
if (rst < 0) {
|
||||
fprintf(stderr,"[LIBCONFIG] %s not valid for %s \n", str, cfgpath);
|
||||
@@ -478,15 +490,19 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
|
||||
|
||||
if (fatalerror == 1) {
|
||||
fprintf(stderr,"[LIBCONFIG] fatal errors found when processing %s \n", libconfig_privdata.configfile );
|
||||
config_libconfig_end();
|
||||
end_configmodule();
|
||||
config_libconfig_end(cfg);
|
||||
end_configmodule(cfg);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_libconfig_getlist(paramlist_def_t *ParamList,
|
||||
paramdef_t *params, int numparams, char *prefix) {
|
||||
int config_libconfig_getlist(configmodule_interface_t *cfg,
|
||||
paramlist_def_t *ParamList,
|
||||
paramdef_t *params,
|
||||
int numparams,
|
||||
char *prefix)
|
||||
{
|
||||
config_setting_t *setting;
|
||||
int i,j,status;
|
||||
char *listpath=NULL;
|
||||
@@ -502,8 +518,7 @@ int config_libconfig_getlist(paramlist_def_t *ParamList,
|
||||
|
||||
if ( setting) {
|
||||
status = ParamList->numelt = config_setting_length(setting);
|
||||
printf_params("[LIBCONFIG] %i %s in config file %s \n",
|
||||
ParamList->numelt,listpath,libconfig_privdata.configfile );
|
||||
printf_params(cfg, "[LIBCONFIG] %i %s in config file %s \n", ParamList->numelt, listpath, libconfig_privdata.configfile);
|
||||
} else {
|
||||
printf("[LIBCONFIG] list %s not found in config file %s \n",
|
||||
listpath,libconfig_privdata.configfile );
|
||||
@@ -512,10 +527,10 @@ int config_libconfig_getlist(paramlist_def_t *ParamList,
|
||||
}
|
||||
|
||||
if (ParamList->numelt > 0 && params != NULL) {
|
||||
ParamList->paramarray = config_allocate_new(ParamList->numelt * sizeof(paramdef_t *), true);
|
||||
ParamList->paramarray = config_allocate_new(cfg, ParamList->numelt * sizeof(paramdef_t *), true);
|
||||
|
||||
for (i=0 ; i < ParamList->numelt ; i++) {
|
||||
ParamList->paramarray[i] = config_allocate_new(numparams * sizeof(paramdef_t), true);
|
||||
ParamList->paramarray[i] = config_allocate_new(cfg, numparams * sizeof(paramdef_t), true);
|
||||
memcpy(ParamList->paramarray[i], params, sizeof(paramdef_t)*numparams);
|
||||
|
||||
for (j=0; j<numparams; j++) {
|
||||
@@ -523,7 +538,7 @@ int config_libconfig_getlist(paramlist_def_t *ParamList,
|
||||
}
|
||||
|
||||
sprintf(cfgpath,"%s.[%i]",listpath,i);
|
||||
config_libconfig_get(ParamList->paramarray[i], numparams, cfgpath );
|
||||
config_libconfig_get(cfg, ParamList->paramarray[i], numparams, cfgpath);
|
||||
} /* for i... */
|
||||
} /* ParamList->numelt > 0 && params != NULL */
|
||||
|
||||
@@ -533,12 +548,15 @@ int config_libconfig_getlist(paramlist_def_t *ParamList,
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_libconfig_init(char *cfgP[], int numP) {
|
||||
int config_libconfig_init(configmodule_interface_t *cfg)
|
||||
{
|
||||
char **cfgP = cfg->cfgP;
|
||||
int numP = cfg->num_cfgP;
|
||||
config_init(&(libconfig_privdata.cfg));
|
||||
libconfig_privdata.configfile = strdup((char *)cfgP[0]);
|
||||
config_get_if()->numptrs=0;
|
||||
pthread_mutex_init(&config_get_if()->memBlocks_mutex, NULL);
|
||||
memset(config_get_if()->oneBlock,0,sizeof(config_get_if()->oneBlock));
|
||||
cfg->numptrs = 0;
|
||||
pthread_mutex_init(&cfg->memBlocks_mutex, NULL);
|
||||
memset(cfg->oneBlock, 0, sizeof(cfg->oneBlock));
|
||||
/* search for include path parameter and set config file include path accordingly */
|
||||
for (int i=0; i<numP; i++) {
|
||||
if (strncmp(cfgP[i],"incp",4) == 0) {
|
||||
@@ -569,7 +587,7 @@ int config_libconfig_init(char *cfgP[], int numP) {
|
||||
}
|
||||
|
||||
/* possibly init a libconfig struct for saving really used params */
|
||||
if (cfgptr->rtflags & CONFIG_SAVERUNCFG) {
|
||||
if (cfg->rtflags & CONFIG_SAVERUNCFG) {
|
||||
config_init(&(libconfig_privdata.runtcfg));
|
||||
// config_set_options (&(libconfig_privdata.runtcfg), CONFIG_OPTION_ALLOW_OVERRIDES, CONFIG_TRUE);
|
||||
}
|
||||
@@ -577,25 +595,34 @@ int config_libconfig_init(char *cfgP[], int numP) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void config_libconfig_write_parsedcfg(void)
|
||||
void config_libconfig_write_parsedcfg(configmodule_interface_t *cfg)
|
||||
{
|
||||
if (cfgptr->rtflags & CONFIG_SAVERUNCFG) {
|
||||
if (cfg->rtflags & CONFIG_SAVERUNCFG) {
|
||||
char *fname = strdup(libconfig_privdata.configfile);
|
||||
int newcfgflen = strlen(libconfig_privdata.configfile) + strlen(cfgptr->tmpdir) + 20;
|
||||
cfgptr->status->debug_cfgname = realloc(cfgptr->status->debug_cfgname, newcfgflen);
|
||||
int newcfgflen = strlen(libconfig_privdata.configfile) + strlen(cfg->tmpdir) + 20;
|
||||
cfg->status->debug_cfgname = realloc(cfg->status->debug_cfgname, newcfgflen);
|
||||
time_t t = time(NULL);
|
||||
struct tm tm = *localtime(&t);
|
||||
snprintf(cfgptr->status->debug_cfgname, newcfgflen, "%s/%s-run%d_%02d_%02d_%02d%02d", cfgptr->tmpdir, basename(fname), tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min);
|
||||
if (config_write_file(&(libconfig_privdata.runtcfg), cfgptr->status->debug_cfgname) != CONFIG_TRUE) {
|
||||
snprintf(cfg->status->debug_cfgname,
|
||||
newcfgflen,
|
||||
"%s/%s-run%d_%02d_%02d_%02d%02d",
|
||||
cfg->tmpdir,
|
||||
basename(fname),
|
||||
tm.tm_year + 1900,
|
||||
tm.tm_mon + 1,
|
||||
tm.tm_mday,
|
||||
tm.tm_hour,
|
||||
tm.tm_min);
|
||||
if (config_write_file(&(libconfig_privdata.runtcfg), cfg->status->debug_cfgname) != CONFIG_TRUE) {
|
||||
fprintf(stderr,
|
||||
"[LIBCONFIG] %s %d file %s - line %d: %s\n",
|
||||
__FILE__,
|
||||
__LINE__,
|
||||
cfgptr->status->debug_cfgname,
|
||||
cfg->status->debug_cfgname,
|
||||
config_error_line(&(libconfig_privdata.runtcfg)),
|
||||
config_error_text(&(libconfig_privdata.runtcfg)));
|
||||
} else {
|
||||
printf("[LIBCONFIG] file %s created successfully\n", cfgptr->status->debug_cfgname);
|
||||
printf("[LIBCONFIG] file %s created successfully\n", cfg->status->debug_cfgname);
|
||||
}
|
||||
free(fname);
|
||||
} else {
|
||||
@@ -603,9 +630,10 @@ void config_libconfig_write_parsedcfg(void)
|
||||
}
|
||||
}
|
||||
|
||||
void config_libconfig_end(void ) {
|
||||
void config_libconfig_end(configmodule_interface_t *cfg)
|
||||
{
|
||||
config_destroy(&(libconfig_privdata.cfg));
|
||||
if (cfgptr->rtflags & CONFIG_SAVERUNCFG) {
|
||||
if (cfg->rtflags & CONFIG_SAVERUNCFG) {
|
||||
config_destroy(&(libconfig_privdata.runtcfg));
|
||||
}
|
||||
if ( libconfig_privdata.configfile != NULL ) {
|
||||
|
||||
@@ -89,7 +89,7 @@ const mapping log_options[] = {{"nocolor", FLAG_NOCOLOR},
|
||||
{"wall_clock", FLAG_REAL_TIME},
|
||||
{NULL, -1}};
|
||||
|
||||
mapping log_maskmap[] = LOG_MASKMAP_INIT;
|
||||
const mapping log_maskmap[] = LOG_MASKMAP_INIT;
|
||||
|
||||
static const char *const log_level_highlight_start[] =
|
||||
{LOG_RED, LOG_ORANGE, LOG_GREEN, "", LOG_BLUE, LOG_CYBL}; /*!< \brief Optional start-format strings for highlighting */
|
||||
@@ -283,7 +283,7 @@ void log_getconfig(log_t *g_log)
|
||||
paramdef_t logparams_logfile[MAX_LOG_PREDEF_COMPONENTS];
|
||||
paramdef_t logparams_debug[sizeof(log_maskmap)/sizeof(mapping)];
|
||||
paramdef_t logparams_dump[sizeof(log_maskmap)/sizeof(mapping)];
|
||||
int ret = config_get( logparams_defaults,sizeof(logparams_defaults)/sizeof(paramdef_t),CONFIG_STRING_LOG_PREFIX);
|
||||
int ret = config_get(config_get_if(), logparams_defaults, sizeofArray(logparams_defaults), CONFIG_STRING_LOG_PREFIX);
|
||||
|
||||
if (ret <0) {
|
||||
fprintf(stderr,"[LOG] init aborted, configuration couldn't be performed\n");
|
||||
@@ -337,8 +337,8 @@ void log_getconfig(log_t *g_log)
|
||||
}
|
||||
|
||||
/* read the per component parameters */
|
||||
config_get( logparams_level, MAX_LOG_PREDEF_COMPONENTS,CONFIG_STRING_LOG_PREFIX);
|
||||
config_get( logparams_logfile, MAX_LOG_PREDEF_COMPONENTS,CONFIG_STRING_LOG_PREFIX);
|
||||
config_get(config_get_if(), logparams_level, MAX_LOG_PREDEF_COMPONENTS, CONFIG_STRING_LOG_PREFIX);
|
||||
config_get(config_get_if(), logparams_logfile, MAX_LOG_PREDEF_COMPONENTS, CONFIG_STRING_LOG_PREFIX);
|
||||
|
||||
/* now set the log levels and infile option, according to what we read */
|
||||
for (int i=MIN_LOG_COMPONENTS; i < MAX_LOG_PREDEF_COMPONENTS; i++) {
|
||||
@@ -367,10 +367,10 @@ void log_getconfig(log_t *g_log)
|
||||
logparams_dump[i].numelt = 0;
|
||||
}
|
||||
|
||||
config_get( logparams_debug,(sizeof(log_maskmap)/sizeof(mapping)) - 1,CONFIG_STRING_LOG_PREFIX);
|
||||
config_get( logparams_dump,(sizeof(log_maskmap)/sizeof(mapping)) - 1,CONFIG_STRING_LOG_PREFIX);
|
||||
config_get(config_get_if(), logparams_debug, sizeofArray(log_maskmap) - 1, CONFIG_STRING_LOG_PREFIX);
|
||||
config_get(config_get_if(), logparams_dump, sizeofArray(log_maskmap) - 1, CONFIG_STRING_LOG_PREFIX);
|
||||
|
||||
if (config_check_unknown_cmdlineopt(CONFIG_STRING_LOG_PREFIX) > 0)
|
||||
if (config_check_unknown_cmdlineopt(config_get_if(), CONFIG_STRING_LOG_PREFIX) > 0)
|
||||
exit(1);
|
||||
|
||||
/* set the debug mask according to the debug parameters values */
|
||||
|
||||
@@ -25,7 +25,7 @@ extern log_t *g_log;
|
||||
|
||||
extern const mapping log_level_names[];
|
||||
extern const mapping log_options[];
|
||||
extern mapping log_maskmap[];
|
||||
extern const mapping log_maskmap[];
|
||||
extern int log_mem_flag;
|
||||
extern char * log_mem_filename;
|
||||
extern char logmem_filename[1024];
|
||||
|
||||
3
common/utils/T/.gitignore
vendored
3
common/utils/T/.gitignore
vendored
@@ -1,7 +1,5 @@
|
||||
*.o
|
||||
*.a
|
||||
T_IDs.h
|
||||
T_messages.txt.h
|
||||
genids
|
||||
tracer/enb
|
||||
tracer/gnb
|
||||
@@ -18,3 +16,4 @@ tracer/extract_output_subframe
|
||||
tracer/extract
|
||||
tracer/multi
|
||||
tracee/tracee
|
||||
incgen
|
||||
|
||||
@@ -8,11 +8,12 @@ else()
|
||||
endif()
|
||||
add_custom_command(OUTPUT T_IDs.h
|
||||
COMMAND genids ${CMAKE_CURRENT_SOURCE_DIR}/T_messages.txt T_IDs.h
|
||||
DEPENDS genids
|
||||
DEPENDS genids T_messages.txt
|
||||
COMMENT "Generating T_IDs.h from T_messages.txt"
|
||||
)
|
||||
add_custom_command(OUTPUT T_messages.txt.h
|
||||
COMMAND xxd -i T_messages.txt ${CMAKE_CURRENT_BINARY_DIR}/T_messages.txt.h
|
||||
DEPENDS T_messages.txt
|
||||
COMMENT "Generating T_messages.txt.h from T_messages.txt"
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
CC=gcc
|
||||
CFLAGS=-Wall -g
|
||||
CFLAGS=-Wall -g -Iincgen
|
||||
|
||||
GENIDS=genids
|
||||
GENIDS_OBJS=genids.o
|
||||
|
||||
all : $(GENIDS) T_messages.txt.h T_IDs.h
|
||||
all : $(GENIDS) incgen/T_messages.txt.h incgen/T_IDs.h
|
||||
|
||||
$(GENIDS): $(GENIDS_OBJS)
|
||||
$(CC) $(CFLAGS) -o $(GENIDS) $(GENIDS_OBJS)
|
||||
@@ -12,21 +12,24 @@ $(GENIDS): $(GENIDS_OBJS)
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
T_messages.txt.h: T_messages.txt
|
||||
xxd -i T_messages.txt T_messages.txt.h
|
||||
incgen/T_messages.txt.h: T_messages.txt
|
||||
mkdir -p incgen
|
||||
xxd -i T_messages.txt incgen/T_messages.txt.h
|
||||
|
||||
T_IDs.h: $(GENIDS) T_messages.txt
|
||||
./$(GENIDS) T_messages.txt T_IDs.h
|
||||
incgen/T_IDs.h: $(GENIDS) T_messages.txt
|
||||
mkdir -p incgen
|
||||
./$(GENIDS) T_messages.txt incgen/T_IDs.h
|
||||
|
||||
check_vcd: T_IDs.h T_messages.txt.h
|
||||
check_vcd: incgen/T_IDs.h incgen/T_messages.txt.h
|
||||
gcc -Wall -I. -I.. -I../itti -I../../../openair2/COMMON -Itracer -o _check_vcd check_vcd.c tracer/database.c tracer/utils.c -lm -pthread
|
||||
./_check_vcd T_messages.txt ../LOG/vcd_signal_dumper.h || (rm -f ./_check_vcd ./T_IDs.h ./T_messages.txt.h && false)
|
||||
./_check_vcd T_messages.txt ../LOG/vcd_signal_dumper.h || (rm -rf ./_check_vcd ./incgen && false)
|
||||
rm -f ./_check_vcd
|
||||
|
||||
.PHONY: check_vcd
|
||||
|
||||
clean:
|
||||
rm -f *.o $(GENIDS) core T_IDs.h T_messages.txt.h _check_vcd
|
||||
rm -f *.o $(GENIDS) core _check_vcd
|
||||
rm -rf incgen
|
||||
|
||||
cleanall: clean
|
||||
cd tracer && $(MAKE) clean
|
||||
|
||||
@@ -192,13 +192,9 @@ void T_Config_Init(void)
|
||||
int T_nowait = 0;
|
||||
paramdef_t ttraceparams[] = CMDLINE_TTRACEPARAMS_DESC;
|
||||
|
||||
config_get(ttraceparams,
|
||||
sizeof(ttraceparams) / sizeof(paramdef_t),
|
||||
TTRACER_CONFIG_PREFIX);
|
||||
config_get(config_get_if(), ttraceparams, sizeofArray(ttraceparams), TTRACER_CONFIG_PREFIX);
|
||||
/* compatibility: look for TTracer command line options in root section */
|
||||
config_process_cmdline(ttraceparams,
|
||||
sizeof(ttraceparams) / sizeof(paramdef_t),
|
||||
NULL);
|
||||
config_process_cmdline(config_get_if(), ttraceparams, sizeofArray(ttraceparams), NULL);
|
||||
|
||||
if (T_stdout < 0 || T_stdout > 2) {
|
||||
printf("fatal error: T_stdout = %d but only values 0, 1, or 2 are allowed\n", T_stdout);
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
CC=gcc
|
||||
CFLAGS=-Wall -g -pthread -DT_TRACER -I.
|
||||
CFLAGS=-Wall -g -pthread -DT_TRACER -I. -I../incgen
|
||||
|
||||
PROG=tracee
|
||||
OBJS=tracee.o ../T.o ../local_tracer.o
|
||||
OBJS=tracee.o T.o ../local_tracer.o
|
||||
|
||||
all: T_dep $(PROG)
|
||||
|
||||
$(PROG): $(OBJS)
|
||||
$(CC) $(CFLAGS) -o $(PROG) $(OBJS) -lrt
|
||||
@@ -10,5 +12,11 @@ $(PROG): $(OBJS)
|
||||
tracee.o: tracee.c
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
T.o: ../T.c
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
T_dep:
|
||||
cd .. && make
|
||||
|
||||
clean:
|
||||
rm -f *.o $(PROG) core
|
||||
|
||||
14
common/utils/T/tracee/common/config/config_userapi.h
Normal file
14
common/utils/T/tracee/common/config/config_userapi.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef _CONFIG_USERAPI_H_
|
||||
#define _CONFIG_USERAPI_H_
|
||||
|
||||
typedef int paramdef_t;
|
||||
|
||||
#ifdef CMDLINE_TTRACEPARAMS_DESC
|
||||
#undef CMDLINE_TTRACEPARAMS_DESC
|
||||
#endif
|
||||
#define CMDLINE_TTRACEPARAMS_DESC {}
|
||||
|
||||
#define config_get(dummy, ...) (void)(dummy)
|
||||
#define config_process_cmdline(...) /**/
|
||||
|
||||
#endif /* _CONFIG_USERAPI_H_ */
|
||||
@@ -6,7 +6,8 @@
|
||||
int main(void)
|
||||
{
|
||||
int frame = 0;
|
||||
T_init(2021, 1, 0);
|
||||
T_init(2021, 1);
|
||||
T_stdout = 0;
|
||||
while (1) {
|
||||
getchar();
|
||||
T(T_ENB_PHY_PUCCH_1AB_IQ, T_INT(0), T_INT(0), T_INT(frame), T_INT(0), T_INT(0), T_INT(0));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
CC=gcc
|
||||
CFLAGS=-Wall -g -pthread -DT_TRACER -I.
|
||||
CFLAGS=-Wall -g -pthread -DT_TRACER -I. -I../incgen
|
||||
|
||||
#CFLAGS += -O3 -ffast-math -fomit-frame-pointer
|
||||
|
||||
@@ -66,9 +66,9 @@ gnb: utils.o gnb.o database.o event.o handler.o configuration.o \
|
||||
filter/filter.a
|
||||
$(CC) $(CFLAGS) -o gnb $^ $(LIBS) $(XLIBS)
|
||||
|
||||
multi.o: ../T_IDs.h
|
||||
multi.o: ../incgen/T_IDs.h
|
||||
|
||||
../T_IDs.h:
|
||||
../incgen/T_IDs.h: ../T_messages.txt
|
||||
cd .. && $(MAKE)
|
||||
|
||||
.PHONY: all gui/gui.a view/view.a logger/logger.a filter/filter.a
|
||||
|
||||
@@ -46,7 +46,7 @@ void loader_init(void) {
|
||||
paramdef_t LoaderParams[] = LOADER_PARAMS_DESC;
|
||||
|
||||
loader_data.mainexec_buildversion = PACKAGE_VERSION;
|
||||
int ret = config_get( LoaderParams,sizeof(LoaderParams)/sizeof(paramdef_t),LOADER_CONFIG_PREFIX);
|
||||
int ret = config_get(config_get_if(), LoaderParams, sizeofArray(LoaderParams), LOADER_CONFIG_PREFIX);
|
||||
if (ret <0) {
|
||||
printf("[LOADER] configuration couldn't be performed via config module, parameters set to default values\n");
|
||||
if (loader_data.shlibpath == NULL) {
|
||||
@@ -82,7 +82,7 @@ static char *loader_format_shlibpath(char *modname, char *version)
|
||||
/* shared lib name is formatted as lib<module name><module version>.so */
|
||||
char cfgprefix[sizeof(LOADER_CONFIG_PREFIX)+strlen(modname)+16];
|
||||
sprintf(cfgprefix,LOADER_CONFIG_PREFIX ".%s",modname);
|
||||
ret = config_get(LoaderParams, sizeofArray(LoaderParams), cfgprefix);
|
||||
ret = config_get(config_get_if(), LoaderParams, sizeofArray(LoaderParams), cfgprefix);
|
||||
if (ret <0) {
|
||||
fprintf(stderr, "[LOADER] %s %d couldn't retrieve config from section %s\n", __FILE__, __LINE__, cfgprefix);
|
||||
}
|
||||
@@ -214,7 +214,7 @@ int load_module_version_shlib(char *modname, char *version, loader_shlibfunc_t *
|
||||
int j = 0;
|
||||
for (; j < shlib->numfunc; ++j) {
|
||||
if (shlib->funcarray[j].fptr == farray[i].fptr) {
|
||||
int rc = strcmp(shlib->funcarray[i].fname, farray[i].fname);
|
||||
int rc = strcmp(shlib->funcarray[j].fname, farray[i].fname);
|
||||
AssertFatal(rc == 0,
|
||||
"reloading the same fptr with different fnames (%s, %s)\n",
|
||||
shlib->funcarray[i].fname, farray[i].fname);
|
||||
|
||||
@@ -450,7 +450,7 @@ int get_nr_table_idx(int nr_bandP, uint8_t scs_index) {
|
||||
break;
|
||||
}
|
||||
|
||||
AssertFatal(i > 0 && i < sizeofArray(nr_bandtable), "band is not existing: %d\n",nr_bandP);
|
||||
AssertFatal(i >= 0 && i < sizeofArray(nr_bandtable), "band is not existing: %d\n",nr_bandP);
|
||||
LOG_D(PHY, "NR band table index %d (Band %d, dl_min %lu, ul_min %lu)\n", i, nr_bandtable[i].band, nr_bandtable[i].dl_min,nr_bandtable[i].ul_min);
|
||||
|
||||
return i;
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
#define NR_NB_REG_PER_CCE 6
|
||||
#define NR_NB_SC_PER_RB 12
|
||||
#define NR_MAX_NUM_LCID 32
|
||||
#define NR_MAX_NUM_QFI 64
|
||||
#define NR_MAX_NUM_SLICES 10
|
||||
|
||||
typedef enum {
|
||||
nr_FR1 = 0,
|
||||
|
||||
@@ -844,7 +844,7 @@ static bool exec_moduleinit(char *modname) {
|
||||
|
||||
int add_embeddedmodules(void) {
|
||||
int ret=0;
|
||||
int pindex = config_paramidx_fromname(telnetoptions,sizeof(telnetoptions)/sizeof(paramdef_t), TELNETSRV_OPTNAME_STATICMOD);
|
||||
int pindex = config_paramidx_fromname(telnetoptions, sizeofArray(telnetoptions), TELNETSRV_OPTNAME_STATICMOD);
|
||||
for(int i=0; i<telnetoptions[pindex].numelt; i++) {
|
||||
bool success = exec_moduleinit(telnetoptions[pindex].strlistptr[i]);
|
||||
if (success)
|
||||
@@ -856,7 +856,7 @@ int add_embeddedmodules(void) {
|
||||
|
||||
int add_sharedmodules(void) {
|
||||
int ret=0;
|
||||
int pindex = config_paramidx_fromname(telnetoptions,sizeof(telnetoptions)/sizeof(paramdef_t), TELNETSRV_OPTNAME_SHRMOD);
|
||||
int pindex = config_paramidx_fromname(telnetoptions, sizeofArray(telnetoptions), TELNETSRV_OPTNAME_SHRMOD);
|
||||
for(int i=0; i<telnetoptions[pindex].numelt; i++) {
|
||||
char *name = telnetoptions[pindex].strlistptr[i];
|
||||
char libname[256];
|
||||
@@ -875,7 +875,7 @@ int add_sharedmodules(void) {
|
||||
*/
|
||||
int telnetsrv_autoinit(void) {
|
||||
memset(&telnetparams,0,sizeof(telnetparams));
|
||||
config_get( telnetoptions,sizeof(telnetoptions)/sizeof(paramdef_t),"telnetsrv");
|
||||
config_get(config_get_if(), telnetoptions, sizeofArray(telnetoptions), "telnetsrv");
|
||||
/* possibly load a exec specific shared lib */
|
||||
char *execfunc=get_softmodem_function(NULL);
|
||||
char libname[64];
|
||||
|
||||
@@ -71,7 +71,7 @@ int add_bearer(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
}
|
||||
|
||||
// verify it exists in RRC as well
|
||||
rrc_gNB_ue_context_t *rrcue = rrc_gNB_get_ue_context_by_rnti(RC.nrrrc[0], rnti);
|
||||
rrc_gNB_ue_context_t *rrcue = rrc_gNB_get_ue_context_by_rnti_any_du(RC.nrrrc[0], rnti);
|
||||
if (!rrcue)
|
||||
ERROR_MSG_RET("could not find UE with RNTI %04x\n", rnti);
|
||||
|
||||
@@ -95,7 +95,7 @@ int release_bearer(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
}
|
||||
|
||||
// verify it exists in RRC as well
|
||||
rrc_gNB_ue_context_t *rrcue = rrc_gNB_get_ue_context_by_rnti(RC.nrrrc[0], rnti);
|
||||
rrc_gNB_ue_context_t *rrcue = rrc_gNB_get_ue_context_by_rnti_any_du(RC.nrrrc[0], rnti);
|
||||
if (!rrcue)
|
||||
ERROR_MSG_RET("could not find UE with RNTI %04x\n", rnti);
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ int get_reestab_count(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
rnti = strtol(buf, NULL, 16);
|
||||
if (rnti < 1 || rnti >= 0xfffe)
|
||||
ERROR_MSG_RET("RNTI needs to be [1,0xfffe]\n");
|
||||
ue = rrc_gNB_get_ue_context_by_rnti(RC.nrrrc[0], rnti);
|
||||
ue = rrc_gNB_get_ue_context_by_rnti_any_du(RC.nrrrc[0], rnti);
|
||||
if (!ue)
|
||||
ERROR_MSG_RET("could not find UE with RNTI %04x in RRC\n");
|
||||
}
|
||||
|
||||
@@ -511,9 +511,9 @@ int proccmd_exit(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
int proccmd_restart(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
if (debug > 0)
|
||||
prnt("process module received %s\n", buf);
|
||||
end_configmodule();
|
||||
prnt("process module received %s\n", buf);
|
||||
configmodule_interface_t *cfg = config_get_if();
|
||||
end_configmodule(cfg);
|
||||
execvpe(cfg->argv[0], cfg->argv, environ);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ void initFloatingCoresTpool(int nbThreads,tpool_t *pool, bool performanceMeas, c
|
||||
}
|
||||
|
||||
#ifdef TEST_THREAD_POOL
|
||||
volatile int oai_exit=0;
|
||||
int oai_exit = 0;
|
||||
|
||||
void exit_function(const char *file, const char *function, const int line, const char *s, const int assert)
|
||||
{
|
||||
|
||||
@@ -278,8 +278,8 @@ void run_cpumeasur(void) {
|
||||
void init_meas(void) {
|
||||
pthread_t thid;
|
||||
paramdef_t cpumeasur_params[] = CPUMEASUR_PARAMS_DESC;
|
||||
int numparams=sizeof(cpumeasur_params)/sizeof(paramdef_t);
|
||||
int rt = config_get( cpumeasur_params,numparams,CPUMEASUR_SECTION);
|
||||
int numparams = sizeofArray(cpumeasur_params);
|
||||
int rt = config_get(config_get_if(), cpumeasur_params, numparams, CPUMEASUR_SECTION);
|
||||
AssertFatal(rt >= 0, "cpumeasur configuration couldn't be performed");
|
||||
measur_table=calloc(max_cpumeasur,sizeof( time_stats_t *));
|
||||
AssertFatal(measur_table!=NULL, "couldn't allocate %u cpu measurements entries\n",max_cpumeasur);
|
||||
|
||||
@@ -753,7 +753,7 @@ int websrv_callback_get_softmodemstatus(const struct _u_request *request, struct
|
||||
}
|
||||
websrv_add_modeminfo(modemvars, "command line", cmdline, "string");
|
||||
if ((config_get_if()->rtflags & CONFIG_SAVERUNCFG) && (config_get_if()->write_parsedcfg != NULL)) {
|
||||
config_get_if()->write_parsedcfg();
|
||||
config_get_if()->write_parsedcfg(config_get_if());
|
||||
|
||||
websrv_add_modeminfo(modemvars, "Parsed config file", config_get_if()->status->debug_cfgname, "configfile");
|
||||
}
|
||||
@@ -819,7 +819,7 @@ void *websrv_autoinit()
|
||||
{
|
||||
int ret;
|
||||
memset(&websrvparams, 0, sizeof(websrvparams));
|
||||
config_get(websrvoptions, sizeof(websrvoptions) / sizeof(paramdef_t), "websrv");
|
||||
config_get(config_get_if(), websrvoptions, sizeofArray(websrvoptions), "websrv");
|
||||
/* check if telnet server is loaded or not */
|
||||
add_telnetcmd_func_t addcmd = (add_telnetcmd_func_t)get_shlibmodule_fptr("telnetsrv", TELNET_ADDCMD_FNAME);
|
||||
if (addcmd != NULL) {
|
||||
|
||||
@@ -183,7 +183,6 @@ Some libraries have further dependencies and might not build on every system:
|
||||
- `enbscope`, `uescope`, `nrscope`: libforms/X
|
||||
- `nrqtscope`: Qt5
|
||||
- `ldpc_cuda`: CUDA
|
||||
- `ldpc_t1`: DPDK and VVDN T1
|
||||
- `websrv`: npm and others
|
||||
|
||||
# Running `cmake` directly
|
||||
|
||||
@@ -1901,7 +1901,6 @@ INPUT = \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/nr_rrc_config.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/rrc_gNB_radio_bearers.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/nr_rrc_extern.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/L2_nr_interface.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/rrc_gNB_reconfig.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/rrc_gNB_NGAP.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/mac_rrc_dl_f1ap.c \
|
||||
|
||||
450
doc/F1-design.md
450
doc/F1-design.md
@@ -12,204 +12,44 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
# 1. Introduction
|
||||
[[_TOC_]]
|
||||
|
||||
We use OpenAirInterface source code, and it's regular deployment scheme.
|
||||
# Introduction
|
||||
|
||||
F1 specification is in 3GPP documents: TS 38.470 header document and all documents listed in chapter 2 References of TS 38.470.
|
||||
The F1 interface is the functional split of 3GPP between the CU (centralized
|
||||
unit: PDCP, RRC, SDAP) and the DU (distributed unit: RLC, MAC, PHY). It is
|
||||
standardized in TS 38.470 - 38.473 for 5G NR. No equivalent for 4G exists.
|
||||
|
||||
This document explains how the source code works.
|
||||
We assume that each DU handles only one cell. Multiple DUs connected to one CU
|
||||
are supported. Mobility over F1 is not yet supported.
|
||||
|
||||
Offered features and deployment instructions are described in:
|
||||
https://gitlab.eurecom.fr/oai/openairinterface5g/-/wikis/f1-interface
|
||||
# Control plane status (F1-C)
|
||||
|
||||
# 2. Common multi-threading architecture #
|
||||
## Implementation Status
|
||||
|
||||
The CU and DU interfaces are based on ITTI threads (see oai/common/utils/ocp_itti/itti.md)
|
||||
Note that OAI uses F1 "internally". That means, that even if you run a
|
||||
monolithic gNB, the internal information exchange uses F1. You can therefore
|
||||
expect that everything working in a monolithic deployment should also work in
|
||||
F1. The current implementation is based on R16.3.
|
||||
|
||||
All OAI upper layers use the ITTI framework to run isolated threads dedicated to one feature.
|
||||
The lower layers adopt case by case specific software architecture.
|
||||
Note that NSA does NOT follow this logic yet, and does not work with F1.
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
Linux[configuration file] --> APP[gNB_app_task]
|
||||
Socks[Linux UDP] --> GTP[nr_gtpv1u_gNB_task]
|
||||
APP --> CU
|
||||
APP --> DU
|
||||
A[Linux SCTP] -->|sockets| SCTP(OAI itti thread TASK_SCTP)
|
||||
SCTP-->|TASK_NGAP| NG[ngap_gNB_task]
|
||||
NG-->|TASK_SCTP| SCTP
|
||||
SCTP-->|TASK_DU_F1| DU[F1AP_DU_task]
|
||||
SCTP-->|TASK_CU_F1| CU[F1AP_CU_task]
|
||||
CU-->|TASK_RRC_GNB| RRC
|
||||
RRC -->|non ITTI| PHY[OAI L1+L2]
|
||||
RRC -->|API calls to create tunnels| GTP
|
||||
PHY --> |user plane| GTP
|
||||
CU --> |TASK_GTPV1_U| GTP
|
||||
DU --> |TASK_GTPV1_U| GTP
|
||||
```
|
||||
A "task" is a Linux thread running infinite waiting loop on one ITTI queue
|
||||
The following messages are currently implemented:
|
||||
|
||||
app task manages the initial configuration
|
||||
- F1 Setup Request and F1 Setup Response/Failure
|
||||
- Initial UL RRC, UL/DL RRC Message Transfer
|
||||
- F1 UE Context management messages for the "good case"
|
||||
* Setup Request/Response
|
||||
* Modification Request/Response
|
||||
* Release Request/Command/Complete
|
||||
|
||||
sctp task mamanges the SCTP Linux sockets
|
||||
All other messages are not implemented or not working reliably:
|
||||
|
||||
CU code runs in the task F1AP_CU_task. It stores it's private data context in a static variable. No mutex is used, as the single interface to CU ITTI tast in incoming ITTI messages. CU task is a single ITTI queue, but multiple CU could exist in one Linux process, using the "instance id" (called "module id" also) to create separate contextual information for each CU instance.
|
||||
- F1 CU/DU configuration updade
|
||||
- Paging messages
|
||||
- Warning Message transmissions
|
||||
|
||||
DU code runs in the task F1AP_DU_task. The design is similar to CU task
|
||||
|
||||
All GTP-U tunnels are managed in a Linux Thread, that have partially ITTI design:
|
||||
|
||||
1. tunnel creation/deletion is by C API functions direct calls (a mutex protects it)
|
||||
2. outgoing packets are pushed in a ITTI queue to the gtp thread
|
||||
3. incoming packets are sent to the tunnel creator using a C callback (the callback function is given in tunnel creation order). The callback should not block
|
||||
|
||||
|
||||
# 3. CU F1AP messages #
|
||||
|
||||
## startup
|
||||
|
||||
CU thread starts when the CU starts. It opens listening socket on F1AP_PORT_NUMBER by sending the appropriate message to TASK_SCTP.
|
||||
|
||||
It will accept the first incoming connection on this port
|
||||
|
||||
## F1 SETUP
|
||||
|
||||
DU has connected, and sent this message.
|
||||
|
||||
The CU receives, decode it and send relevant information to RRC thread by message F1AP_SETUP_REQ
|
||||
|
||||
## F1 SETUP response
|
||||
|
||||
RRC sends two messages to CU F1 task: the information to encode the F1 setup response and a second message to encode F1AP_GNB_CU_CONFIGURATION_UPDATE
|
||||
|
||||
Upon reception of these two messages the CU task encodes and sends the messages to the DU
|
||||
|
||||
## UE entry
|
||||
|
||||
When CCH channel decoding finds a new UE identity, it call rrc_gNB_generate_RRCSetup() that will send F1AP_DL_RRC_MESSAGE to the CU task.
|
||||
|
||||
The CU encodes and sends to DU DLRRCMessageTransfer
|
||||
|
||||
## UE attach/detach
|
||||
|
||||
When rrc_gNB_process_RRCReconfigurationComplete() occurs, the RRC sends to CU task the message F1AP_UE_CONTEXT_SETUP_REQ. The CU task encodes the F1 message UEContextSetup and send it to the DU over F1AP.
|
||||
|
||||
This function rrc_gNB_process_RRCReconfigurationComplete() also creates the GTP-U user plane bearers.
|
||||
|
||||
## F1AP incoming messages
|
||||
|
||||
SCTP tasks sends a ITTI message SCTP_DATA_IND to the CU task.
|
||||
|
||||
A array of functions pointers and the F1AP standard identifier "procedureCode", the CU calls the appropriate function
|
||||
|
||||
Hereafter the most significant messages processing
|
||||
|
||||
### CU_handle_F1_SETUP_REQUEST
|
||||
|
||||
Transcodes information to the same message toward RRC (F1AP_SETUP_REQ)
|
||||
|
||||
### CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER
|
||||
|
||||
Transcodes information to the same message toward RRC (NR_RRC_MAC_CCCH_DATA_IND)
|
||||
|
||||
### CU_handle_UL_RRC_MESSAGE_TRANSFER
|
||||
|
||||
Encode and send data to PDCP (calling pdcp_data_ind ()) for processing UL data.
|
||||
|
||||
# DU F1 Messages
|
||||
|
||||
## Startup
|
||||
|
||||
The task "gNB app" after rzading the configuration file, sends a first message F1AP_SETUP_REQ to DU task
|
||||
|
||||
Using this message, the uniq DU task (Linux Thread) creates a DU instance context memory space, calls SCTP task to create a socket to the CU.
|
||||
|
||||
When it receives from the SCTP task the socket creation success, the DU task encodes+sends the F1 setup message to the CU.
|
||||
|
||||
## F1AP_INITIAL_UL_RRC_MESSAGE
|
||||
|
||||
When MAC layer push UL data to DU task, the DU sends to CU the message InitialULRRCMessageTransfer
|
||||
|
||||
## F1AP_UL_RRC_MESSAGE
|
||||
|
||||
In case of SRB bearer, the RLC layer use this message to push rlc bearer payload to DU task, that forward to CU
|
||||
|
||||
## pdcp_data_ind
|
||||
|
||||
This function call in RLC, when it is a DRB will be replaced by F1-U transport to CU
|
||||
|
||||
## F1AP incoming messages
|
||||
|
||||
SCTP tasks sends a ITTI message SCTP_DATA_IND to the DU task.
|
||||
|
||||
A array of functions pointers and the F1AP standard identifier "procedureCode", the DU calls the appropriate function
|
||||
|
||||
Hereafter the most significant messages processing
|
||||
|
||||
### DU_send_F1_SETUP_RESPONSE
|
||||
|
||||
Decode the CU message, then encode a message to TASK_GNB_APP. The thread "APP" extracts the system information block and reconfigure the DU with: du_extract_and_decode_SI(), configure_gnb_du_mac()
|
||||
|
||||
### DU_handle_gNB_CU_CONFIGURATION_UPDATE
|
||||
|
||||
No developped
|
||||
|
||||
### DU_handle_UE_CONTEXT_SETUP_REQUEST
|
||||
|
||||
Push data to RLC layer for transmisstion in DL (to the UE) by calling enqueue_rlc_data_req()
|
||||
|
||||
### DU_handle_DL_RRC_MESSAGE_TRANSFER
|
||||
|
||||
Depending on the content, adds UE context in DU low layers and/or send data to the UE with rlc_data_req()
|
||||
|
||||
# F1-U messages
|
||||
|
||||
The data path by itself doesn't make any difficulty:
|
||||
1. for UL, rlc calls pdcp_data_ind (DRB) or sends a message to RRC (SRB). So, we can replace pdcp_data_ind() by du_pdcp_data_ind() that will push the message in the GTP tunnel. In CU, assuming the tunnel is in place, the right call back decapsulate the transport (cu_ul_recv()), then calls pdcp_data_ind() in CU
|
||||
The SRB are sent in DU RRC tasks via itti F1AP_UL_RRC_MESSAGE (see above the processing)
|
||||
2. For DL, pdcp (in CU for DRBs) calls rlc_data_req (by a decoupling queue and thread rlc_data_req_thread, so function du_rlc_data_req() or enqueue_rlc_data_req()). in DU, assuming the gtp-u tunnel exists, a reception call back (du_dl_recv()) decapsulate the gtp-u packet and calls du_rlc_data_req()
|
||||
|
||||
Hereafter the processing design, that doesn't require to setup a new context storage, as we can use the GTP-U internal tables: rnti+rb=>teid for outgoing gtp-u packets and teid=>rnti+rb for incoming gtp-u packets
|
||||
|
||||
In CU case, the DRB tunnel to DU and the tunnel on N3 have the same key (rnti, rb id), but they run in two different GTP-U instances.
|
||||
Each instance binds on diffrent sockets.
|
||||
|
||||
For F1-U, both DU and CU binds on the full quadruplet (IP source, port source, IP destination, port destination) from the configuration file parameters:
|
||||
local_s_address, remote_s_address,local_s_portd, remote_s_portd
|
||||
|
||||
These 4 values are in:
|
||||
CU: at cell level (same level as nr_cellid parameter), they are read if tr_s_preference = "f1"; is set
|
||||
DU: in block MACRLCs, if tr_n_preference = "f1"; is set in this block
|
||||
|
||||
## tunnels setup
|
||||
In GTP-U, TS 29.281 specifies a option header (NR RAN Container This extension header may be transmitted in a G-PDU over the X2-U, Xn-U and F1-U user plane interfaces), but it is not mandatory optional header (as is the N3 one).
|
||||
|
||||
So, we can use this header a something reliable with other vendors implementation.
|
||||
|
||||
In DL, we need to associate the packet with: rnti, rb (radio bearer) and "mui" (a OAI internal id that is optional and may be removed soon) to call rlc_data_req()
|
||||
|
||||
In UL, we need also the RNTI, the rb
|
||||
|
||||
So, we need to create a gtp-u tunnel for each rb over F1, then manage in CU and DU the association between a uniq TEid and the pair(rnti, rb). This is already what we have in existing OAI GTP-U layer interface.
|
||||
|
||||
In F1AP, for each "DRB to Be Setup Item IEs", we have a field TNL (transport network layer) to set a specific GTP tunnel (@IP, TEid, udp port is always 2152). This is the same for each message related to DRBs. (F1AP carries the SRB payload inside F1AP).
|
||||
|
||||
So, For each F1AP containing DRB setup/modification/deletion, the related GTP-U tunnels will be modified one to one.
|
||||
The exception is the intialisation of new tunnel: in the call to tunnel creation, we need to send the remote TEID, but we don't know yet if we are the initial source. In this case, we issue a dummy (0xFFFF) remote teid; when we receive the remote answer, we get the source teid, that we can inform GTP-U with (using update tunnel).
|
||||
|
||||
## processing on GTP-U incoming message
|
||||
|
||||
Du_dl_recv() or cu_ul_recv() are called because we have set this callbacks in creat/update tunnel calls to gtp-u. As gtp-u maintains a pair(rnti,rbid) associated to each tunnel, the functions can be very simple stateless callback that calls pdcp_data_ind() or rlc_data_req() to get back in normal processing path
|
||||
|
||||
## CU/DU outgoing
|
||||
|
||||
DU rlc north output goes to du_pdcp_data_ind() that push a outgoing packet request to gtp-u, using the rnti+rb as ids. GTP-U must have the tunnel existing, then it simply implement the same as in N3 for exemple.
|
||||
|
||||
CU pdcp south output calls cu_rlc_data_ind() that do the same symetric processing.
|
||||
|
||||
|
||||
# High-level F1-C code structure
|
||||
## High-level F1-C code structure
|
||||
|
||||
The F1 interface is used internally between CU (mostly RRC) and DU (mostly MAC)
|
||||
to exchange information. In DL, the CU sends messages as defined by the
|
||||
@@ -252,3 +92,241 @@ Monolithic: mac_rrc_dl_direct.c | |
|
||||
| |
|
||||
+-------------+
|
||||
```
|
||||
|
||||
# Data plane status (F1-U)
|
||||
|
||||
F1-U uses GTP-U for information exchange. The GTP protocol uses some extensions
|
||||
for NR-U protocol to report buffer status, but this is not properly tested and
|
||||
might malfunction. One limitation is that the current implementation
|
||||
acknowledges each packet individually.
|
||||
|
||||
Multiple DUs at one CU are supported in the data plane (as in the control plane).
|
||||
|
||||
# How to run
|
||||
|
||||
As mentioned earlier, OAI uses F1 internally. It is always compiled in.
|
||||
To start CU/DU, you use `./nr-softmodem` with the appropriate configuration
|
||||
files, for instance:
|
||||
|
||||
```
|
||||
sudo cmake_targets/ran_build/build/nr-softmodem --sa -O ci-scripts/conf_files/gnb-cu.sa.band78.106prb.conf
|
||||
sudo cmake_targets/ran_build/build/nr-softmodem --sa -O ci-scripts/conf_files/gnb-du.sa.band78.106prb.rfsim.conf
|
||||
```
|
||||
|
||||
These files are tested in the CI, and are configured for use in docker,
|
||||
see [this `docker-compose` file](../ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml).
|
||||
|
||||
The rules to decide if a config triggers a start of a DU, CU, or monolithic
|
||||
gNB, are, in order:
|
||||
1. If the `MACRLCs` section lists `f1` as northbound transport preference
|
||||
(`tr_n_preference`), it is a DU.
|
||||
2. If the `gNBs` section lists `f1` as a southound transport preference
|
||||
(`tr_s_preference`), it is a CU.
|
||||
3. It is a (monolithic) gNB.
|
||||
|
||||
## Configuration of F1 IP/port information
|
||||
|
||||
For a local deployment, you should update the following fields.
|
||||
We assume that the CU will bind on `192.168.70.129` towards the core,
|
||||
`127.0.0.3` towards the DU, and the DU `127.0.0.4` towards the CU.
|
||||
|
||||
In the CU file:
|
||||
- Update the `gNBs.[0].amf_ip_address` and `gNBs.[0].NETWORK_INTERFACES`
|
||||
section towards the core (typically, OAI CN is configured to provide a docker
|
||||
bridge on `192.168.70.129` and the AMF is on `192.168.70.132`):
|
||||
- `gNBs.[0].amf_ip_address.[0].ipv4 192.168.70.132`
|
||||
- `gNBs.[0].NETWORK_INTERFACES.GNB_IPV4_ADDRESS_FOR_NG_AMF 192.168.70.129`
|
||||
- `gNBs.[0].NETWORK_INTERFACES.GNB_IPV4_ADDRESS_FOR_NGU 192.168.70.132`
|
||||
- Set `gNBs.[0].tr_s_preference` (transport south-bound) to `f1`
|
||||
- Update the `gNBs.[0].local_s_address` (CU-local south address) for the F1-C
|
||||
south-bound interface: `127.0.0.3`
|
||||
- Note: the `gNBs.[0].remote_s_address` (CU-remote/DU south address) is
|
||||
ignored, but we recommend to put `0.0.0.0` ("any")
|
||||
- Ports should match the ones in the DU config, but for simplicity and
|
||||
standards-conformity, simply set all to 2152:
|
||||
- `local_s_portc` in CU should match `remote_n_portc` in DU
|
||||
- `local_s_portd` in CU should match `remote_n_portd` in DU
|
||||
- `remote_s_portc` in CU should match `local_n_portc` in DU
|
||||
- `remote_s_portd` in CU should match `local_n_portd` in DU
|
||||
|
||||
In the DU file:
|
||||
- Set `MACRLCs.[0].tr_n_preference` to `f1`
|
||||
- Update `MACRLCs.[0].local_n_address` (local north-bound address of the DU) to
|
||||
`127.0.0.4`
|
||||
- Update `MACRLCs.[].remote_n_address` (remote north-bound address of the CU)
|
||||
to `127.0.0.3`
|
||||
|
||||
Note: all `local_*_if_name` parameters are ignored.
|
||||
|
||||
## Configuration of multiple DUs
|
||||
|
||||
Upon F1 Setup Request of a new DU, the CU cross-checks that
|
||||
|
||||
- no DUs have the same gNB-DU IDs, taken from `gNBs.[0].gNB_ID`, and
|
||||
- no cells have the same NR Cell ID, taken from `gNBs.[0].nr_cellid`, and
|
||||
- no cells have the same physical cell IDs, taken from `gNBs.[0].servingCellConfigCommon.[0].physCellId`.
|
||||
|
||||
If any of these are the same, the CU will reject the DU with an F1 Setup
|
||||
Failure. Thus, you should make sure that in the DU's configs, these parameters
|
||||
are set differently.
|
||||
|
||||
You have to of course make sure that the local interface of the DU
|
||||
(`MACRLCs.[0].local_n_address`) is different as well.
|
||||
|
||||
Assuming you use RFsim, you should make the RFsimulator server side (typically
|
||||
the gNB) bind on different hosts (`rfsimulator.serverport`).
|
||||
|
||||
# Code documentation
|
||||
|
||||
## Common multi-threading architecture
|
||||
|
||||
The CU and DU interfaces are based on ITTI threads (see `common/utils/ocp_itti/itti.md`)
|
||||
adopted by all OAI upper layers to run isolated threads dedicated to one feature.
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
Linux[configuration file] --> APP[gNB_app_task]
|
||||
Socks[Linux UDP] --> GTP[nr_gtpv1u_gNB_task]
|
||||
APP --> CU
|
||||
APP --> DU
|
||||
A[Linux SCTP] -->|sockets| SCTP(OAI itti thread TASK_SCTP)
|
||||
SCTP-->|TASK_NGAP| NG[ngap_gNB_task]
|
||||
NG-->|TASK_SCTP| SCTP
|
||||
SCTP-->|TASK_DU_F1| DU[F1AP_DU_task]
|
||||
SCTP-->|TASK_CU_F1| CU[F1AP_CU_task]
|
||||
CU-->|TASK_RRC_GNB| RRC
|
||||
RRC -->|non ITTI| PHY[OAI L1+L2]
|
||||
RRC -->|API calls to create tunnels| GTP
|
||||
PHY --> |user plane| GTP
|
||||
CU --> |TASK_GTPV1_U| GTP
|
||||
DU --> |TASK_GTPV1_U| GTP
|
||||
```
|
||||
|
||||
A "task" is a Linux thread running an infinite waiting loop on one ITTI queue.
|
||||
|
||||
The `app` task manages the initial configuration; the `sctp` task manages the
|
||||
SCTP Linux sockets.
|
||||
|
||||
The CU encoding/decoding runs in the task executing `F1AP_CU_task()`. It stores its private data context in a static variable.
|
||||
The DU encoding/decoding runs in the task executing `F1AP_DU_task()`. The design is similar to CU task.
|
||||
|
||||
All GTP-U tunnels are managed in a Linux Thread, that have partially ITTI design:
|
||||
|
||||
1. tunnel creation/deletion is by C API functions direct calls (a mutex protects it)
|
||||
2. outgoing packets are pushed in a ITTI queue to the gtp thread
|
||||
3. incoming packets are sent to the tunnel creator using a C callback (the callback function is given in tunnel creation order). The callback should not block
|
||||
|
||||
|
||||
## F1-C messages towards the CU
|
||||
|
||||
The CU thread starts when the CU starts. It opens listening socket on the
|
||||
configuration-specified IP/port by sending the appropriate message to
|
||||
`TASK_SCTP`. It will accept any incoming connection and forward any F1 message
|
||||
to RRC.
|
||||
|
||||
You can trace any message by looking up the handler
|
||||
`cu_task_handle_sctp_data_ind()`, which ultimately triggers a corresponding
|
||||
ITTI message sent to RRC. All ITTI messages arriving are dispatched in the ITTI
|
||||
message handling function in `rrc_gNB.c`. For your convenience, find below a
|
||||
table of same messages that might arrive from the DU and how they are
|
||||
forwarded.
|
||||
|
||||
After handling messages, the RRC uses a callback that determines if messages go
|
||||
directly to the MAC or are sent to the CU ITTI task (see
|
||||
[above](#high-level-f1-c-code-structure))
|
||||
|
||||
You might also want to consult TS 38.401 regarding the message exchange.
|
||||
|
||||
| Incoming F1 message | ITTI message to RRC | RRC handler | Comments |
|
||||
|---------------------|---------------------|-------------|----------|
|
||||
| F1 Setup Request | `F1AP_SETUP_REQ` | `rrc_gNB_process_f1_setup_req()` | will trigger either a response or failure |
|
||||
| Initial UL RRC Message Transfer | `F1AP_INITIAL_UL_RRC_MESSAGE` | `rrc_gNB_process_initial_ul_rrc_message()` | first message from UE, follows up with RRC Setup or Reestablishment |
|
||||
| UL RRC Message Transfer | `F1AP_UL_RRC_MESSAGE` | `rrc_gNB_decode_dcch()` | UL RRC messages contain DCCH |
|
||||
| UE Context Response | `F1AP_UE_CONTEXT_SETUP_RESP` | `rrc_CU_process_ue_context_setup_response()` | does not trigger a follow-up, as UE sends Security Response |
|
||||
| UE Context Modification Response | `F1AP_UE_CONTEXT_MODIFICATION_RESP` | `rrc_CU_process_ue_context_modification_response()` | triggers Reconfiguration if CellGroup in answer |
|
||||
| UE Context Modification Required | `F1AP_UE_CONTEXT_MODIFICATION_REQUIRED` | `rrc_CU_process_ue_modification_required()` | triggers Reconfiguration |
|
||||
| UE Context Release Request | `F1AP_UE_CONTEXT_RELEASE_REQ` | `rrc_CU_process_ue_context_release_request()` | RRC will trigger UE release |
|
||||
| UE Context Release Complete | `F1AP_UE_CONTEXT_RELEASE_COMPLETE` | `rrc_CU_process_ue_context_release_complete()` | frees UE Context, signals to NGAP |
|
||||
|
||||
## F1-C Messages towards the DU
|
||||
|
||||
The task "gNB app", after reading the configuration file, sends a message
|
||||
`F1AP_DU_REGISTER_REQ` to the DU task. This message contains network
|
||||
configuration for the establishment of the SCTP connection, as well as the F1
|
||||
Setup Request to be sent to the CU.
|
||||
|
||||
Using the network configuration, the DU task sets up an SCTP connection via the
|
||||
SCTP task. When it receives from the SCTP task the socket creation success,
|
||||
the DU task encodes and sends the F1 setup message to the CU.
|
||||
|
||||
Similarly as for the CU, you can trace any message by looking up the handler
|
||||
`du_task_handle_sctp_data_ind()`. Unlike in the CU, the decoders do NOT send an
|
||||
ITTI message, but directly call into the scheduler via a message handling
|
||||
function. This handler acquires the scheduler mutex and executes the
|
||||
corresponding message handling functionality. All handlers are in
|
||||
`mac_rrc_dl_handler.c`.
|
||||
|
||||
After handling messages, the MAC uses a callback that determines if messages
|
||||
are sent back to RRC via ITTI, or are sent to the DU ITTI task (see
|
||||
[above](#high-level-f1-c-code-structure))
|
||||
|
||||
You might also want to consult TS 38.401 regarding the message exchange.
|
||||
|
||||
| Incoming F1 message | MAC handler | Comments |
|
||||
|---------------------|-------------|----------|
|
||||
| F1 Setup Response | `f1_setup_response()` | the DU does not start the radio before receiving this message |
|
||||
| DL RRC Message Transfer | `dl_rrc_message_transfer()` | Processing timer started if reconfiguration is present[^footnote-reconfig] |
|
||||
| UE Context Setup Request | `ue_context_setup_request()` | |
|
||||
| UE Context Modification Request | `ue_context_modification_request()` | |
|
||||
| UE Context Modification Confirm | `ue_context_modification_confirm()` | |
|
||||
| UE Context Modification Refuse | `ue_context_modification_refuse()` | Will trigger release request |
|
||||
| UE Context Release Command | `ue_context_release_command()` | Starts timer for release if UE in sync |
|
||||
|
||||
[^footnote-reconfig]: The DU does not decode RRC messages, and does not know
|
||||
whether an RRC message is a reconfiguration. However, the spec mandates that
|
||||
a reconfiguration has to be triggered if the CU receives a CellGroupConfig,
|
||||
originating at the DU. See also flag `expect_reconfiguration`.
|
||||
|
||||
## F1-U messages
|
||||
|
||||
### General
|
||||
|
||||
In the DU in UL, RLC checks in `deliver_sdu()` if we are operating in split
|
||||
mode, and either (direct) calls `pdcp_data_ind` (DRB) or (f1ap) sends an
|
||||
`GTPV1U_TUNNEL_DATA_REQ` ITTI message to the GTP task.
|
||||
|
||||
In the CU in UL, assuming the tunnel is in place, GTP decapsulates the packet
|
||||
and calls the callback `cu_f1u_data_req()`, which calls `pdcp_data_ind()` in CU.
|
||||
|
||||
In the CU in DL, the PDCP function `deliver_pdu_drb_gnb()` either (direct) calls
|
||||
into the RLC via `enqueue_rlc_data_req()`, or (f1ap) sends a
|
||||
`GTPV1U_TUNNEL_DATA_REQ` ITTI message to the GTP task.
|
||||
|
||||
In the DU in DL, assuming the GTP-U tunnel exists, GTP decapsulates the packet
|
||||
and calls the reception call back `du_rlc_data_req()`, which calls
|
||||
`enqueue_rlc_data_req()` in turn.
|
||||
|
||||
## Tunnel Setup
|
||||
|
||||
In GTP-U, TS 29.281 specifies a optional header (NR RAN Container). This
|
||||
extension header may be transmitted in a G-PDU over the X2-U, Xn-U and F1-U user
|
||||
plane interfaces, but it is not mandatory.
|
||||
|
||||
Note that the GTP-U uses internal tables. Instead of exposing TEIDs, it uses the
|
||||
UE ID (RNTI, RRC UE ID) and Radio Bearer ID to map to a TEID for outgoing GTP-U
|
||||
packets. Upon receiving, it does the reverse and calls the callbacks. In the CU
|
||||
case, the DRB tunnel to DU and the tunnel on N3 have the same keys (RRC UE ID,
|
||||
RB ID), but they run in two different GTP-U instances. Each instance binds on
|
||||
diffrent sockets, which is the reason you cannot have the same interface for
|
||||
F1-U and N3/NG-U interfaces (this can be considered a design flaw).
|
||||
|
||||
In F1AP, for each "DRB to Be Setup Item IEs", we have a field TNL (transport
|
||||
network layer) to set a specific GTP tunnel (@IP, TEid). This is the same for
|
||||
each message related to DRBs.
|
||||
|
||||
So, For each F1AP containing DRB setup/modification/deletion, the related GTP-U
|
||||
tunnels will be modified one to one. The exception is the intialisation of new
|
||||
tunnel: in the call to tunnel creation, we need to send the remote TEID, but we
|
||||
don't know yet if we are the initial source. In this case, we issue a dummy
|
||||
(0xFFFF) remote TEID; when we receive the remote answer, we get the source teid,
|
||||
with which the GTP-U endpoint is updadet.
|
||||
|
||||
@@ -305,6 +305,7 @@ Furthermore, the gNB and UE support
|
||||
- HARQ procedures
|
||||
* ULSCH scheduler
|
||||
- Configuration of fapi PDU according to DCI
|
||||
- Logical channel prioritization of 'data from any logical channel'
|
||||
* NR-CSIRS scheduler
|
||||
- Scheduling of NR-CSIRS reception
|
||||
- Fill UCI for CSI measurement reporting
|
||||
|
||||
149
doc/LDPC_T2_OFFLOAD_SETUP.md
Normal file
149
doc/LDPC_T2_OFFLOAD_SETUP.md
Normal file
@@ -0,0 +1,149 @@
|
||||
<table style="border-collapse: collapse; border: none;">
|
||||
<tr style="border-collapse: collapse; border: none;">
|
||||
<td style="border-collapse: collapse; border: none;">
|
||||
<a href="http://www.openairinterface.org/">
|
||||
<img src="./images/oai_final_logo.png" alt="" border=3 height=50 width=150>
|
||||
</img>
|
||||
</a>
|
||||
</td>
|
||||
<td style="border-collapse: collapse; border: none; vertical-align: center;">
|
||||
<b><font size = "5">OAI T1/T2 LDPC offload</font></b>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
**Table of Contents**
|
||||
|
||||
[[_TOC_]]
|
||||
|
||||
This documentation aims to provide a tutorial for AMD Xilinx T2 Telco card integration into OAI and its usage.
|
||||
|
||||
# Requirements
|
||||
|
||||
- bitstream image and PMD driver for the T2 card provided by AccelerComm
|
||||
- DPDK 20.11.7 with patch from Accelercomm (also tested with DPDK 20.11.3)
|
||||
- tested on RHEL7.9, RHEL9.2, Ubuntu 20.04, Ubuntu 22.04
|
||||
|
||||
# DPDK setup
|
||||
## DPDK installation
|
||||
```
|
||||
# Get DPDK source code
|
||||
git clone https://github.com/DPDK/dpdk-stable.git ~/dpdk-stable
|
||||
cd ~/dpdk-stable
|
||||
git checkout v20.11.7
|
||||
git apply ~/ACL_BBDEV_DPDK20.11.3_xxx.patch
|
||||
```
|
||||
Replace `~/ACL_BBDEV_DPDK20.11.3_xxx.patch` by patch file provided by
|
||||
Accelercomm.
|
||||
```
|
||||
cd ~/dpdk-stable
|
||||
meson setup build
|
||||
# meson setup --prefix=/opt/dpdk-t2 build for installation with non-default installation prefix
|
||||
cd build
|
||||
ninja
|
||||
sudo ninja install
|
||||
sudo ldconfig
|
||||
```
|
||||
## DPDK configuration
|
||||
- load required kernel module
|
||||
```
|
||||
sudo modprobe igb_uio
|
||||
sudo insmod ~/dpdk-stable/kernel/linux/igb_uio/igb_uio.ko
|
||||
```
|
||||
- check presence of the card and its PCI addres on the host machine
|
||||
```
|
||||
lspci | grep "Xilinx"
|
||||
```
|
||||
- bind the card with igb_uio driver
|
||||
```
|
||||
sudo python3 ~/dpdk-stable/usertools/dpdk-devbind.py -b igb_uio 41:00.0
|
||||
```
|
||||
Replace PCI address of the card *41:00.0* by address detected by *lspci | grep "Xilinx"* command
|
||||
- hugepages setup (10 x 1GB hugepages)
|
||||
```
|
||||
sudo python3 ~/dpdk-stable/usertools/dpdk-hugepages.py -p 1G --setup 10G`
|
||||
```
|
||||
|
||||
*Note: device binding and hugepages setup has to be done after every reboot of
|
||||
the host machine*
|
||||
|
||||
# Modifications in the OAI code
|
||||
## PMD path specification
|
||||
Path to the PMD for operating the card is specified in `CMakeLists.txt` file in
|
||||
*LDPC OFFLOAD library* section. Modify following line based on the location of
|
||||
the PMD on your system. By deafult, path to the PMD is set to `/opt/dpdk-t2/lib/x86_64-linux-gnu/`.
|
||||
```
|
||||
find_library(PMD_T2 NAMES rte_baseband_accl_ldpc HINTS "/opt/dpdk-t2/lib/x86_64-linux-gnu/")
|
||||
```
|
||||
|
||||
## T2 card DPDK initialization
|
||||
Following lines in `openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c` file has to be
|
||||
modified based on your system requirements. By default, PCI address of the T2 card is set to 41:00.0 and cores 14 and 15 are assigned to the DPDK.
|
||||
```
|
||||
char *dpdk_dev = "41:00.0"; //PCI address of the card
|
||||
char *argv_re[] = {"bbdev", "-a", dpdk_dev, "-l", "14-15", "--file-prefix=b6", "--"};
|
||||
```
|
||||
For the DPDK EAL initialization, device is specified by `-a` option and list
|
||||
of cores to run the DPDK application on is selected by `-l` option. PCI adress of
|
||||
the T2 card can be detected by `lspci | grep "Xilinx"` command.
|
||||
|
||||
# OAI Build
|
||||
OTA deployment is precisely described in the following tutorial:
|
||||
- [NR_SA_Tutorial_COTS_UE](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/NR_SA_Tutorial_COTS_UE.md)
|
||||
Instead of section *3.2 Build OAI gNB* from the tutorial, run following commands:
|
||||
|
||||
```
|
||||
# Get openairinterface5g source code
|
||||
git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git ~/openairinterface5g
|
||||
cd ~/openairinterface5g
|
||||
git checkout develop
|
||||
|
||||
# Install OAI dependencies
|
||||
cd ~/openairinterface5g/cmake_targets
|
||||
./build_oai -I
|
||||
|
||||
# Build OAI gNB
|
||||
cd ~/openairinterface5g
|
||||
source oaienv
|
||||
cd cmake_targets
|
||||
./build_oai -w USRP --ninja --gNB -P -C --build-lib "ldpc_t2"
|
||||
```
|
||||
Shared object file *libldpc_t2.so* is created during the compilation. This object is conditionally compiled. Selection of the library to compile is done using *--build-lib ldpc_t2*.
|
||||
|
||||
*Required poll mode driver has to be present on the host machine and required DPDK version has to be installed on the host, prior to the build of OAI*
|
||||
|
||||
# 5G PHY simulators
|
||||
## nr_ulsim test
|
||||
Offload of the channel decoding to the T2 card is in nr_ulsim specified by *-o* option. Example command for running nr_ulsim with LDPC decoding offload to the T2 card:
|
||||
```
|
||||
cd ~/openairinterface5g
|
||||
source oaienv
|
||||
cd cmake_targets/ran_build/build
|
||||
sudo ./nr_ulsim -n100 -s20 -m20 -r273 -R273 -o
|
||||
```
|
||||
## nr_dlsim test
|
||||
Offload of the channel encoding to the AMD Xilinx T2 card is in nr_dlsim specified by *-c* option. Example command for running nr_dlsim with LDPC encoding offload to the T2 card:
|
||||
```
|
||||
cd ~/openairinterface5g
|
||||
source oaienv
|
||||
cd cmake_targets/ran_build/build
|
||||
sudo ./nr_dlsim -n300 -s30 -R 106 -e 27 -c
|
||||
```
|
||||
|
||||
# OTA test
|
||||
Offload of the channel encoding and decoding to the AMD Xilinx T2 card is enabled by *--ldpc-offload-enable 1* option.
|
||||
|
||||
## Run OAI gNB with USRP B210
|
||||
```
|
||||
cd ~/openairinterface5g
|
||||
source oaienv
|
||||
cd cmake_targets/ran_build/build
|
||||
sudo ./nr-softmodem --sa -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --ldpc-offload-enable 1
|
||||
```
|
||||
|
||||
# Limitations
|
||||
## AMD Xilinx T2 card
|
||||
- offload of the LDPC encoding implemented for MCS > 2, OAI CPU encoder is used for MCS =< 2
|
||||
- functionality of the LDPC encoding and decoding offload verified in OTA SISO setup with USRP N310 and Quectel RM500Q, blocking of the card reported for MIMO setup (2 layers)
|
||||
|
||||
*Note: AMD Xilinx T1 Telco card is not supported anymore.*
|
||||
@@ -207,3 +207,8 @@ sudo ethtool -G enp1s0f0 tx 4096 rx 4096
|
||||
|
||||
## 6.3 Uplink issues related with noise on the DC carriers
|
||||
- There is noise on the DC carriers on N300 and especially the X300 in UL. To avoid their use or shift them away from the center to use more UL spectrum, use the `--tune-offset <Hz>` command line switch, where `<Hz>` is ideally half the bandwidth, or possibly less.
|
||||
|
||||
## 6.4 Timing-related Problems
|
||||
- Sometimes, the nrUE would keep repeating RA procedure because of Msg3 failure at the gNB. If it happens, add the `-A` option at the nrUE and/or gNB side, e.g., `-A 45`. This modifies the timing advance (in samples). Adjust +/-5 if the issue persists.
|
||||
- This can be necessary since certain USRPs have larger signal delays than others; it is therefore specific to the used USRP model.
|
||||
- The x310 and B210 are found to work with the default configuration; N310 and x410 can benefit from setting this timing advance.
|
||||
|
||||
@@ -95,7 +95,7 @@ Command line parameters for UE in --sa mode:
|
||||
- `--numerology` : numerology index (default value 1)
|
||||
- `-r` : bandwidth in terms of RBs (default value 106)
|
||||
- `--band` : NR band number (default value 78)
|
||||
- `--ssb` : SSB start subcarrier (default value 512)
|
||||
- `--ssb` : SSB start subcarrier (default value 516)
|
||||
|
||||
You can run this, using USRPs, on two separate machines:
|
||||
|
||||
|
||||
@@ -274,7 +274,7 @@ nr_preprocessor_phytest()], multiple users in FR1
|
||||
2) Checks the quantity of waiting data in RLC
|
||||
3) Either set up resource allocation directly (e.g., for a single UE,
|
||||
phytest), or call into a function to perform actual resource allocation.
|
||||
Currently, this is done using pf_dl() which implements a basic
|
||||
Currently, this is done using nr_pf_dl() which implements a basic
|
||||
proportional fair scheduler:
|
||||
* for every UE, check for retransmission and allocate as necessary
|
||||
* Calculate the PF coefficient and put eligible UEs into a list
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
| Machine | IP address | Lockable Resource | Function | Connected devices |
|
||||
| ------------- | --------------- | --------------------- | ------------------ | ----------------------------------------------------- |
|
||||
| asterix | 172.21.16.127 | CI-Asterix-Usage | gNB (n78) | 172.21.19.14 |
|
||||
| asterix | 172.21.16.127 | CI-Asterix-Usage | *unused* | 172.21.19.14 |
|
||||
| obelix | 172.21.16.128 | CI-Obelix-Usage | eNB (n40, n78), nrUE | 172.21.19.13, X300 (192.168.60.2) |
|
||||
| porcepix | 172.21.16.136 | CI-Porcepix | Executor, EPC, 5GC | -- |
|
||||
| nrmodule2 | 172.21.16.139 | CI-NrModule2 | Quectel | Quectel module |
|
||||
@@ -15,25 +15,19 @@
|
||||
| idefix | 172.21.16.135 | CI-Idefix | Quectel | Quectel module |
|
||||
| caracal | 172.21.16.132 | CI-Caracal | gNB/phytest | N300 (192.168.10.2) |
|
||||
| amariue | 172.21.16.144 | CI-Amarisoft-UE-Usage | nrUE | Amarisoft UE simulator |
|
||||
| manarola | 172.21.8.116 | _None_ | gNB | AW2S |
|
||||
| nano | 172.21.18.48 | CI-Nano-Legacy-EPC | Executor, EPC, adb | 2x COTS (adb) |
|
||||
| hutch | 172.21.18.46 | CI-Hutch-Legacy-FDD-eNB | eNB (B7) | B200mini (30C5239) |
|
||||
| starsky | 172.21.18.45 | CI-Starsky-Legacy-TDD-eNB | eNB (B40) | b200mini (30A3E3C) |
|
||||
| carabe | 172.21.18.47 | CI-Carabe-Legacy-FDD-OAI-LTE-UE | UE (B7UE) | B200mini (30AE8C9) |
|
||||
| nokiabox | 172.21.19.39 | _None_ | gNB (Nokia), 5GC | _Nokia RF integrated_ |
|
||||
| avra | 172.21.16.124 | CI-Avra-Usage | gNB (n78) | AW2S Jaguar (192.168.80.239) |
|
||||
| orion | 172.21.16.134 | CI-Orion-Build-Sanity-Check-Deploy-Test, CI-Orion-DsTester-Deploy-Test | Build | |
|
||||
| bellatrix | 172.21.16.104 | CI-Bellatrix-RAN-Docker | Static Code Analysis | -- |
|
||||
|
||||
Note: The available resources, and their current usage, is indicated here:
|
||||
- [Lockable resources of jenkins-oai](https://jenkins-oai.eurecom.fr/lockable-resources/):
|
||||
"New" Jenkins, i.e., with RAN-Container-Parent
|
||||
|
||||
## Networked devices
|
||||
|
||||
| Type | IP address (mgmt) |
|
||||
| ------------- | ----------------- |
|
||||
| USRP N310 | 172.21.19.14 |
|
||||
| USRP N310 | 172.21.19.13 |
|
||||
|
||||
## Testbenches
|
||||
|
||||
### 5G OTA Testbench
|
||||
@@ -82,61 +76,116 @@ Note: The available resources, and their current usage, is indicated here:
|
||||
### [RAN-Container-Parent](https://jenkins-oai.eurecom.fr/job/RAN-Container-Parent/)
|
||||
|
||||
**Purpose**: automatically triggered tests on MR creation or push, from Gitlab
|
||||
Webhook
|
||||
Webhook ~documentation ~BUILD-ONLY ~4G-LTE ~5G-NR
|
||||
|
||||
- [RAN-cppcheck](https://jenkins-oai.eurecom.fr/job/RAN-cppcheck/1664/)
|
||||
- obelix
|
||||
This pipeline has basically two main stages, as follows. For the image build,
|
||||
please also refer to the [dedicated documentation](../docker/README.md) for
|
||||
information on how the images are built.
|
||||
|
||||
#### Image Build pipelines
|
||||
|
||||
- [RAN-ARM-Cross-Compile-Builder](https://jenkins-oai.eurecom.fr/job/RAN-ARM-Cross-Compile-Builder/)
|
||||
~BUILD-ONLY ~4G-LTE ~5G-NR
|
||||
- orion: Cross-compilation from Intel to ARM
|
||||
- base image from `Dockerfile.base.ubuntu20.cross-arm64`
|
||||
- build image from `Dockerfile.build.ubuntu20.cross-arm64` (no target images)
|
||||
- [RAN-cppcheck](https://jenkins-oai.eurecom.fr/job/RAN-cppcheck/)
|
||||
~BUILD-ONLY ~4G-LTE ~5G-NR
|
||||
- bellatrix
|
||||
- performs static code analysis, currently not actively enforced
|
||||
- [RAN-RHEL8-Cluster-Image-Builder](https://jenkins-oai.eurecom.fr/job/RAN-RHEL8-Cluster-Image-Builder/)
|
||||
~BUILD-ONLY ~4G-LTE ~5G-NR
|
||||
- cluster (`Asterix-OC-oaicicd-session` resource): RHEL image build using the OpenShift Cluster (using gcc/clang)
|
||||
- base image from `Dockerfile.build.rhel9`
|
||||
- build image from `Dockerfile.build.rhel9`, followed by
|
||||
- target image from `Dockerfile.eNB.rhel9`
|
||||
- target image from `Dockerfile.gNB.rhel9`,
|
||||
- target image from `Dockerfile.gNB.aw2s.rhel9`
|
||||
- target image from `Dockerfile.nr-cuup.rhel9`
|
||||
- target image from `Dockerfile.lteUE.rhel9`
|
||||
- target image from `Dockerfile.nrUE.rhel9`
|
||||
- build image from `Dockerfile.phySim.rhel9` (creates as direct target physical simulator
|
||||
image)
|
||||
- build image from `Dockerfile.clang.rhel9` (compilation only, artifacts not used currently)
|
||||
- [RAN-Ubuntu18-Image-Builder](https://jenkins-oai.eurecom.fr/job/RAN-Ubuntu18-Image-Builder/)
|
||||
~BUILD-ONLY ~4G-LTE ~5G-NR
|
||||
- obelix: Ubuntu 20 image build using docker (Note: builds U20 images while pipeline is named U18!)
|
||||
- base image from `Dockerfile.base.ubuntu20`
|
||||
- build image from `Dockerfile.build.ubuntu20`, followed by
|
||||
- target image from `Dockerfile.eNB.ubuntu20`
|
||||
- target image from `Dockerfile.gNB.ubuntu20`
|
||||
- target image from `Dockerfile.nr-cuup.ubuntu20`
|
||||
- target image from `Dockerfile.nrUE.ubuntu20`
|
||||
- target image from `Dockerfile.lteUE.ubuntu20`
|
||||
- target image from `Dockerfile.lteRU.ubuntu20`
|
||||
|
||||
#### Image Test pipelines
|
||||
|
||||
- [OAI-CN5G-COTS-UE-Test](https://jenkins-oai.eurecom.fr/job/OAI-CN5G-COTS-UE-Test/)
|
||||
~5G-NR
|
||||
- using 5GC bench (resources `CI-Cetautomatix-OC-oaicicd-session`, `CI-Dogmatix-CN5G-gNB`): Attach/Detach of UE with multiple PDU sessions
|
||||
- [RAN-gNB-N300-Timing-Phytest-LDPC](https://jenkins-oai.eurecom.fr/view/RAN/job/RAN-gNB-N300-Timing-Phytest-LDPC/)
|
||||
~5G-NR
|
||||
- caracal + N310
|
||||
- pure performance test through phy-test scheduler, see command line for more details
|
||||
- [RAN-Interop-F1](https://jenkins-oai.eurecom.fr/job/RAN-Interop-F1/)
|
||||
~5G-NR
|
||||
- ofqot (DU, 1x UE)
|
||||
- F1 interoperability testing: sets up connection to Accelleran CU, UE connection and connectivity test
|
||||
- F1 interoperability: set up connection between Accelleran CU and OAI DU and pass all traffic over F1
|
||||
- 3rd-party gNB/CU interoperability: set up connection between Accelleran CU and OAI UE and test connectivity
|
||||
- [RAN-L2-Sim-Test-4G](https://jenkins-oai.eurecom.fr/job/RAN-L2-Sim-Test-4G/)
|
||||
~4G-LTE
|
||||
- obelix (eNB, 1x UE, OAI EPC)
|
||||
- L2simulator: skips physical layer and uses proxy between eNB and UE
|
||||
- [RAN-L2-Sim-Test-5G](https://jenkins-oai.eurecom.fr/job/RAN-L2-Sim-Test-5G/)
|
||||
~5G-NR
|
||||
- obelix (gNB, 1x UE, OAI 5GC)
|
||||
- L2simulator: skips physical layer and uses proxy between gNB and UE, currently only ping
|
||||
- [RAN-LTE-FDD-LTEBOX-Container](https://jenkins-oai.eurecom.fr/job/RAN-LTE-FDD-LTEBOX-Container/)
|
||||
~4G-LTE
|
||||
- hutch + B210, nano w/ ltebox + 2x UE
|
||||
- tests RRC inactivity timers, different bandwidths, IF4p5 fronthaul
|
||||
- [RAN-LTE-FDD-OAIUE-OAICN4G-Container](https://jenkins-oai.eurecom.fr/job/RAN-LTE-FDD-OAIUE-OAICN4G-Container/)
|
||||
~4G-LTE
|
||||
- hutch + B210 (eNB), carabe + B210 (4G UE), nano w/ OAI 4GC
|
||||
- tests OAI 4G for 10 MHz/TM1; known to be unstable
|
||||
- [RAN-LTE-TDD-2x2-Container](https://jenkins-oai.eurecom.fr/view/RAN/job/RAN-LTE-TDD-2x2-Container/)
|
||||
~4G-LTE
|
||||
- obelix + N310, porcepix, nrmodule2 + Quectel
|
||||
- TM1 and TM2 test, IF4p5 fronthaul
|
||||
- [RAN-LTE-TDD-LTEBOX-Container](https://jenkins-oai.eurecom.fr/job/RAN-LTE-TDD-LTEBOX-Container/)
|
||||
~4G-LTE
|
||||
- starsky + B210, nano w/ ltebox + 2x UE
|
||||
- TM1 over bandwidths 5, 10, 20 MHz in Band 40, default scheduler for 20 MHz
|
||||
- [RAN-NSA-B200-Module-LTEBOX-Container](https://jenkins-oai.eurecom.fr/job/RAN-NSA-B200-Module-LTEBOX-Container/)
|
||||
~4G-LTE ~5G-NR
|
||||
- nepes + B200 (eNB), ofqot + B200 (gNB), idefix + Quectel, nepes w/ ltebox
|
||||
- basic NSA test
|
||||
- [RAN-PhySim-Cluster](https://jenkins-oai.eurecom.fr/job/RAN-PhySim-Cluster/)
|
||||
~4G-LTE ~5G-NR
|
||||
- cluster (`Asterix-OC-oaicicd-session` resource), tests in OpenShift Cluster
|
||||
- unitary simulators (`nr_dlsim`, etc.)
|
||||
- [RAN-RF-Sim-Test-4G](https://jenkins-oai.eurecom.fr/job/RAN-RF-Sim-Test-4G/)
|
||||
~4G-LTE
|
||||
- obelix (eNB, lteUE, OAI EPC)
|
||||
- uses RFsimulator, for FDD 5, 10, 20MHz with core, 5MHz noS1
|
||||
- [RAN-RF-Sim-Test-5G](https://jenkins-oai.eurecom.fr/job/RAN-RF-Sim-Test-5G/)
|
||||
~5G-NR
|
||||
- obelix (gNB, nrUE, OAI 5GC)
|
||||
- uses RFsimulator, TDD 40MHz, FDD 40MHz, F1 split
|
||||
- [RAN-RHEL8-Cluster-Image-Builder](https://jenkins-oai.eurecom.fr/job/RAN-RHEL8-Cluster-Image-Builder/)
|
||||
- cluster (`Asterix-OC-oaicicd-session` resource): RHEL 8 image build using the OpenShift Cluster
|
||||
- [RAN-SA-AW2S-CN5G](https://jenkins-oai.eurecom.fr/job/RAN-SA-AW2S-CN5G/)
|
||||
~5G-NR
|
||||
- 5G-NR SA test setup: avra(RHEL9.1) + AW2S, amariue, OAI CN5G
|
||||
- uses OpenShift cluster for CN deployment and container images for gNB deployment
|
||||
- multi UE testing
|
||||
- multi UE testing using Amarisoft UE simulator
|
||||
- [RAN-SA-B200-Module-SABOX-Container](https://jenkins-oai.eurecom.fr/job/RAN-SA-B200-Module-SABOX-Container/)
|
||||
~5G-NR
|
||||
- ofqot + B200, idefix + Quectel, nepes w/ sabox
|
||||
- basic SA test (20 MHz TDD), F1, reestablishment, ...
|
||||
- [RAN-SA-OAIUE-CN5G](https://jenkins-oai.eurecom.fr/job/RAN-SA-OAIUE-CN5G/)
|
||||
~5G-NR
|
||||
- 5G-NR SA test setup: gNB on avra(RHEL9.2) + N310, OAIUE on caracal(RHEL9.1) + N310, OAI CN5G
|
||||
- OpenShift cluster for CN deployment and container images for gNB and UE deployment
|
||||
- [RAN-Ubuntu18-Image-Builder](https://jenkins-oai.eurecom.fr/job/RAN-Ubuntu18-Image-Builder/)
|
||||
- obelix: Ubuntu 20 image build using docker (Note: builds U20 images while pipeline is named U18!)
|
||||
|
||||
### RAN-CI-NSA-Trigger
|
||||
|
||||
@@ -148,6 +197,53 @@ Webhook
|
||||
- [RAN-SA-Module-CN5G](https://jenkins-oai.eurecom.fr/view/RAN/job/RAN-SA-Module-CN5G/)
|
||||
- asterix + N310 (gNB), nrmodule2 + Quectel, porcepix w/ OAI 5GC
|
||||
- NR 2x2 (standalone)
|
||||
- [RAN-SA-AmariS-CN5G](https://jenkins-oai.eurecom.fr/view/RAN/job/RAN-SA-AmariS-CN5G/)
|
||||
- asterix + N310, amariue (1x UE), porcepix w/ OAI 5GC
|
||||
- Amarisoft UE simulator: expected to be increased to more UEs
|
||||
|
||||
## How to reproduce CI results
|
||||
|
||||
The CI builds docker images at the beginning of every test run. To see the
|
||||
exact command line steps, please refer to the `docker/Dockerfile.build.*`
|
||||
files. Note that the console log of each pipeline run also lists the used
|
||||
docker files.
|
||||
|
||||
The CI uses these images for *most* of the pipelines. It uses docker-compose to
|
||||
orchestrate the images. To identify the docker-compose file, follow these
|
||||
steps:
|
||||
|
||||
1. Each CI test run HTML lists the XML file used for a particular test run.
|
||||
Open the corresponding XML file under `ci-scripts/xml_files/`.
|
||||
2. The XML file has a "test case" that refers to deployment of the image; it
|
||||
will reference a directory containing a YAML file (the docker-compose file)
|
||||
using option `yaml_path`, which will be under `ci-scripts/yaml_files/`. Go
|
||||
to this directory and open the docker-compose file.
|
||||
3. The docker-compose file can be used to run images locally, or you can infer
|
||||
the used configuration file and possible additional options that are to be
|
||||
passed to the executable to run from source.
|
||||
|
||||
For instance, to see how the CI runs the multi-UE 5G RFsim test case, the above
|
||||
steps look like this:
|
||||
|
||||
1. The first tab in the 5G RFsim test mentions
|
||||
`xml_files/container_5g_rfsim.xml`, so open
|
||||
`ci-scripts/xml_files/container_5g_rfsim.xml`.
|
||||
2. This XML file has a `DeployGenObject` test case, referencing the directory
|
||||
`yaml_files/5g_rfsimulator`. The corresponding docker-compose file path is
|
||||
`ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml`.
|
||||
3. To know how to run the gNB, realize that there is a section `oai-gnb`. It
|
||||
mounts the configuration
|
||||
`ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.conf` (note that the path
|
||||
is relative to the directory in which the docker-compose file is located).
|
||||
Further, an environment variable `USE_ADDITIONAL_OPTIONS` is declared,
|
||||
referencing the relevant options `--sa -E --rfsim` (you can ignore logging
|
||||
options). You would therefore run the gNB from source like this:
|
||||
```
|
||||
sudo ./cmake_targets/ran_build/build/nr-softmodem -O ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.conf --sa -E --rfsim
|
||||
```
|
||||
To run this on your local machine, assuming you have a 5GC installed, you
|
||||
might need to change IP information in the config to match your core.
|
||||
|
||||
If you wish, you can rebuild CI images locally following [these
|
||||
steps](../docker/README.md) and then use the docker-compose file directly.
|
||||
|
||||
Some tests are run from source (e.g.
|
||||
`ci-scripts/xml_files/gnb_phytest_usrp_run.xml`), which directly give the
|
||||
options they are run with.
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
FROM ran-base:latest as ran-build
|
||||
ARG BUILD_OPTION
|
||||
|
||||
RUN rm -Rf /oai-ran
|
||||
WORKDIR /oai-ran
|
||||
@@ -35,4 +36,12 @@ COPY . .
|
||||
RUN /bin/sh oaienv && \
|
||||
cd cmake_targets && \
|
||||
mkdir -p log && \
|
||||
./build_oai --eNB --gNB --RU --UE --nrUE --ninja --build-lib "telnetsrv enbscope uescope nrscope nrqtscope" -w USRP -t Ethernet --noavx512 -c --cmake-opt -DCMAKE_C_FLAGS=-Werror --cmake-opt -DCMAKE_CXX_FLAGS=-Werror
|
||||
./build_oai -c --ninja \
|
||||
--eNB --gNB --RU --UE --nrUE \
|
||||
--build-lib "telnetsrv enbscope uescope nrscope nrqtscope" \
|
||||
-w USRP -t Ethernet \
|
||||
--build-e2 --cmake-opt -DXAPP_MULTILANGUAGE=OFF \
|
||||
--noavx512 \
|
||||
--cmake-opt -DCMAKE_C_FLAGS=-Werror --cmake-opt -DCMAKE_CXX_FLAGS=-Werror $BUILD_OPTION && \
|
||||
# Mainly to see if the sanitize option was perfectly executed
|
||||
ldd ran_build/build/nr-softmodem
|
||||
|
||||
@@ -32,6 +32,7 @@ FROM ran-build:latest AS enb-build
|
||||
|
||||
#start from scratch for target executable
|
||||
FROM ubuntu:focal as oai-enb
|
||||
ARG BUILD_OPTION
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV TZ=Europe/Paris
|
||||
|
||||
@@ -57,6 +58,11 @@ RUN apt-get update && \
|
||||
python3-six \
|
||||
python3-requests \
|
||||
libusb-1.0-0 && \
|
||||
# if the --sanitize option was used to build, additional packages are required
|
||||
/bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \
|
||||
libasan5 \
|
||||
libubsan1 \
|
||||
liblapacke; fi' && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /opt/oai-enb/bin
|
||||
@@ -93,8 +99,8 @@ COPY --from=enb-base \
|
||||
|
||||
RUN /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so /usr/local/lib/liboai_device.so" && \
|
||||
/bin/bash -c "ln -s /usr/local/lib/liboai_eth_transpro.so /usr/local/lib/liboai_transpro.so" && \
|
||||
ldconfig
|
||||
|
||||
ldconfig && \
|
||||
ldd /opt/oai-enb/bin/lte-softmodem
|
||||
|
||||
WORKDIR /opt/oai-enb
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ FROM ran-build:latest AS gnb-build
|
||||
|
||||
#start from scratch for target executable
|
||||
FROM ubuntu:focal as oai-gnb
|
||||
ARG BUILD_OPTION
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV TZ=Europe
|
||||
|
||||
@@ -56,6 +57,11 @@ RUN apt-get update && \
|
||||
python3-six \
|
||||
python3-requests \
|
||||
libusb-1.0-0 && \
|
||||
# if the --sanitize option was used to build, additional packages are required
|
||||
/bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \
|
||||
libasan5 \
|
||||
libubsan1 \
|
||||
liblapacke; fi' && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /opt/oai-gnb/bin
|
||||
@@ -91,7 +97,8 @@ COPY --from=gnb-base \
|
||||
/usr/lib/x86_64-linux-gnu/
|
||||
|
||||
RUN /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so /usr/local/lib/liboai_device.so" && \
|
||||
ldconfig
|
||||
ldconfig && \
|
||||
ldd /opt/oai-gnb/bin/nr-softmodem
|
||||
|
||||
WORKDIR /opt/oai-gnb
|
||||
#EXPOSE 2152/udp # S1U, GTP/UDP
|
||||
|
||||
@@ -32,6 +32,7 @@ FROM ran-build:latest AS lte-ue-build
|
||||
|
||||
#start from scratch for target executable
|
||||
FROM ubuntu:focal as oai-lte-ue
|
||||
ARG BUILD_OPTION
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV TZ=Europe/Paris
|
||||
|
||||
@@ -56,6 +57,11 @@ RUN apt-get update && \
|
||||
iputils-ping \
|
||||
iproute2 \
|
||||
iperf && \
|
||||
# if the --sanitize option was used to build, additional packages are required
|
||||
/bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \
|
||||
libasan5 \
|
||||
libubsan1 \
|
||||
liblapacke; fi' && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /opt/oai-lte-ue/bin
|
||||
@@ -94,7 +100,8 @@ COPY --from=lte-ue-base \
|
||||
/usr/lib/x86_64-linux-gnu/
|
||||
|
||||
RUN /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so /usr/local/lib/liboai_device.so" && \
|
||||
ldconfig
|
||||
ldconfig && \
|
||||
ldd /opt/oai-lte-ue/bin/lte-uesoftmodem
|
||||
|
||||
WORKDIR /opt/oai-lte-ue
|
||||
CMD ["/opt/oai-lte-ue/bin/lte-uesoftmodem"]
|
||||
|
||||
@@ -31,6 +31,7 @@ FROM ran-build:latest AS gnb-build
|
||||
|
||||
|
||||
FROM ubuntu:focal as oai-nr-cuup
|
||||
ARG BUILD_OPTION
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV TZ=Europe
|
||||
|
||||
@@ -40,6 +41,11 @@ RUN apt-get update && \
|
||||
libsctp1 \
|
||||
libconfig9 \
|
||||
openssl && \
|
||||
# if the --sanitize option was used to build, additional packages are required
|
||||
/bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \
|
||||
libasan5 \
|
||||
libubsan1 \
|
||||
liblapacke; fi' && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /opt/oai-gnb/bin
|
||||
|
||||
@@ -32,6 +32,7 @@ FROM ran-build:latest AS nr-ue-build
|
||||
|
||||
#start from scratch for target executable
|
||||
FROM ubuntu:focal as oai-nr-ue
|
||||
ARG BUILD_OPTION
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV TZ=Europe/Paris
|
||||
|
||||
@@ -56,6 +57,10 @@ RUN apt-get update && \
|
||||
iputils-ping \
|
||||
iproute2 \
|
||||
iperf && \
|
||||
# if the --sanitize option was used to build, additional packages are required
|
||||
/bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \
|
||||
libasan5 \
|
||||
libubsan1; fi' && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /opt/oai-nr-ue/bin
|
||||
@@ -95,7 +100,8 @@ COPY --from=nr-ue-base \
|
||||
/usr/lib/x86_64-linux-gnu/
|
||||
|
||||
RUN /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so /usr/local/lib/liboai_device.so" && \
|
||||
ldconfig
|
||||
ldconfig && \
|
||||
ldd /opt/oai-nr-ue/bin/nr-uesoftmodem
|
||||
|
||||
WORKDIR /opt/oai-nr-ue
|
||||
CMD ["/opt/oai-nr-ue/bin/nr-uesoftmodem", "-O", "/opt/oai-nr-ue/etc/nr-ue.conf"]
|
||||
|
||||
@@ -46,16 +46,15 @@ For all platforms, the strategy for building docker/podman images is the same:
|
||||
- Some tools (such as `ping`, `ifconfig`)
|
||||
|
||||
Note that on every push to develop (i.e., typically after integrating merge
|
||||
requests), we build all images and push them to [Docker
|
||||
Hub](https://hub.docker.com/u/oaisoftwarealliance). To pull them, do
|
||||
requests), we build all images and push them to [Docker Hub](https://hub.docker.com/u/oaisoftwarealliance). To pull them, do
|
||||
|
||||
```
|
||||
docker pull oaisoftwarealliance/oai-gnb:develop
|
||||
docker pull oaisoftwarealliance/oai-nr-ue:develop
|
||||
docker pull oaisoftwarealliance/oai-enb:develop
|
||||
docker pull oaisoftwarealliance/oai-lte-ue:develop
|
||||
```
|
||||
Have a look at [this
|
||||
README](../ci-scripts/yaml_files/5g_rfsimulator/README.md) to get some
|
||||
Have a look at [this README](../ci-scripts/yaml_files/5g_rfsimulator/README.md) to get some
|
||||
information on how to use the images.
|
||||
|
||||
# 2. File organization #
|
||||
@@ -114,6 +113,34 @@ ran-base latest 5c9c02a5b4a8 1 minute ago
|
||||
|
||||
Note that the steps are identical for `rocky-linux`.
|
||||
|
||||
### 3.2.1. Additional build otions
|
||||
|
||||
This is only available for the Ubuntu-20 version.
|
||||
|
||||
You can, for example, create a `sanitizer` version of the ran-build image.
|
||||
|
||||
```bash
|
||||
docker build --target ran-build --tag ran-build:latest --file docker/Dockerfile.build.ubuntu20 --build-arg "BUILD_OPTION=--sanitize" .
|
||||
```
|
||||
|
||||
Currently the `--sanitize` option for `build_oai` enables:
|
||||
|
||||
* [Address Sanitizer](https://github.com/google/sanitizers/wiki/AddressSanitizer)
|
||||
* [Undefined Behavior Sanitizer](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html)
|
||||
|
||||
After building:
|
||||
|
||||
```bash
|
||||
docker image ls
|
||||
REPOSITORY TAG IMAGE ID CREATED SIZE
|
||||
ran-build latest f2633a7f5102 1 minute ago 8.78GB
|
||||
...
|
||||
```
|
||||
|
||||
Note that the image is much bigger.
|
||||
|
||||
You can also use this docker build arguments to pass any available option(s) on the `build-oai` script.
|
||||
|
||||
## 3.3. Building any target image ##
|
||||
|
||||
For example, the eNB:
|
||||
@@ -141,6 +168,14 @@ docker image prune --force
|
||||
|
||||
Note that the steps are identical for `rocky-linux`.
|
||||
|
||||
If you have used the sanitizer option, then you should also pass it when building the target image:
|
||||
|
||||
```bash
|
||||
docker build --target oai-gnb --tag oai-gnb:latest --file docker/Dockerfile.gNB.ubuntu20 --build-arg "BUILD_OPTION=--sanitize" .
|
||||
```
|
||||
|
||||
Normally the target image will be around 200 Mbytes bigger.
|
||||
|
||||
# 4. Building using `podman` under Red Hat Entreprise Linux 8.2 #
|
||||
|
||||
Analogous to the above steps:
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user