diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aa11892fa6a90593c848a84833f861dd7025fd80..15c44aed22a46638543af94ca08ac8c5a99798c5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -34,4 +34,5 @@ job1: - sshpass -p "$OAI_PASS" rsync -az -e "ssh -o StrictHostKeyChecking=no " --rsync-path="mkdir -p $NFS_TEST_RESULTS_DIR && rsync" $OPENAIR_DIR/cmake_targets/autotests/log $OAI_USER@localhost:$NFS_TEST_RESULTS_DIR - sshpass -p "$OAI_PASS" rsync -az -e "ssh -o StrictHostKeyChecking=no " --rsync-path="mkdir -p $EXTERNAL_SHARE_DIR && rsync" $OPENAIR_DIR/cmake_targets/autotests/log $OAI_USER@localhost:$EXTERNAL_SHARE_DIR - cat $OPENAIR_DIR/cmake_targets/autotests/log/results_autotests.xml - when: manual + only: + - triggers diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 72254ab775e0df757d18ba07078714e599847a2b..07d92a1b0585f6c96c28f1211011c1d9cf38f442 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -621,7 +621,7 @@ add_boolean_option(MESSAGE_CHART_GENERATOR False "For generating sequenc add_boolean_option(MESSAGE_CHART_GENERATOR_RLC_MAC False "trace RLC-MAC exchanges in sequence diagrams") add_boolean_option(MESSAGE_CHART_GENERATOR_PHY False "trace some PHY exchanges in sequence diagrams") -add_boolean_option(ENB_AGENT True "enable eNB agent to inteface with a SDN contrller") +add_boolean_option(FLEXRAN_AGENT_SB_IF False "enable FlexRAN agent to inteface with a SDN controller") ######################## # Include order @@ -817,8 +817,10 @@ include_directories("${OPENAIR_DIR}/targets/ARCH/COMMON") include_directories("${OPENAIR_DIR}/targets/ARCH/EXMIMO/USERSPACE/LIB/") include_directories("${OPENAIR_DIR}/targets/ARCH/EXMIMO/DEFS") include_directories("${OPENAIR2_DIR}/ENB_APP") +include_directories("${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/MAC") include_directories("${OPENAIR2_DIR}/UTIL/OSA") include_directories("${OPENAIR2_DIR}/UTIL/LFDS/liblfds6.1.1/liblfds611/inc") +include_directories("${OPENAIR2_DIR}/UTIL/LFDS/liblfds7.0.0/liblfds700/inc") include_directories("${OPENAIR2_DIR}/UTIL/MEM") include_directories("${OPENAIR2_DIR}/UTIL/LISTS") include_directories("${OPENAIR2_DIR}/UTIL/FIFO") @@ -837,6 +839,94 @@ include_directories("${OPENAIR_DIR}") # Utilities Library ################ +if (FLEXRAN_AGENT_SB_IF) + # set the version of protobuf messages, V3 not supported yet + add_list1_option(FLPT_VERSION V2 "FLPT MSG protobuf grammar version" V2 V3) + + if (${FLPT_VERSION} STREQUAL "V2") + set (FLPTDIR V2) + elseif (${FLPT_VERSION} STREQUAL "V3") + set (FLPTDIR V3) + endif(${FLPT_VERSION} STREQUAL "V2") + + set(FLPT_MSG_DIR ${OPENAIR2_DIR}/ENB_APP/MESSAGES/${FLPTDIR} ) + set(FLPT_MSG_FILES + ${FLPT_MSG_DIR}/header.proto + ${FLPT_MSG_DIR}/flexran.proto + ${FLPT_MSG_DIR}/stats_common.proto + ${FLPT_MSG_DIR}/stats_messages.proto + ${FLPT_MSG_DIR}/time_common.proto + ${FLPT_MSG_DIR}/controller_commands.proto + ${FLPT_MSG_DIR}/mac_primitives.proto + ${FLPT_MSG_DIR}/config_messages.proto + ${FLPT_MSG_DIR}/config_common.proto + ${FLPT_MSG_DIR}/control_delegation.proto + ) + + set(FLPT_C_DIR ${protobuf_generated_dir}/${FLPTDIR}) + #message("calling protoc_call=${protoc_call} FLPT_C_DIR=${FLPT_C_DIR} FLPT_MSG_FILES=${FLPT_MSG_FILES}") + execute_process(COMMAND ${protoc_call} ${FLPT_C_DIR} ${FLPT_MSG_DIR} ${FLPT_MSG_FILES}) + file(GLOB FLPT_source ${FLPT_C_DIR}/*.c) + set(FLPT_OAI_generated + ${FLPT_C_DIR}/header.pb-c.c + ${FLPT_C_DIR}/flexran.pb-c.c + ${FLPT_C_DIR}/stats_common.pb-c.c + ${FLPT_C_DIR}/stats_messages.pb-c.c + ${FLPT_C_DIR}/time_common.pb-c.c + ${FLPT_C_DIR}/controller_commands.pb-c.c + ${FLPT_C_DIR}/mac_primitives.pb-c.c + ${FLPT_C_DIR}/config_messages.pb-c.c + ${FLPT_C_DIR}/config_common.pb-c.c + ${FLPT_C_DIR}/control_delegation.pb-c.c + ) + + file(GLOB flpt_h ${FLPT_C_DIR}/*.h) + set(flpt_h ${flpt_h} ) + + add_library(FLPT_MSG + ${FLPT_OAI_generated} + ${FLPT_source} + ) + set(FLPT_MSG_LIB FLPT_MSG) + #message("prpt c dir is : ${FLPT_C_DIR}") + include_directories (${FLPT_C_DIR}) + + add_library(ASYNC_IF + ${OPENAIR2_DIR}/UTIL/ASYNC_IF/socket_link.c + ${OPENAIR2_DIR}/UTIL/ASYNC_IF/link_manager.c + ${OPENAIR2_DIR}/UTIL/ASYNC_IF/message_queue.c + ${OPENAIR2_DIR}/UTIL/ASYNC_IF/ringbuffer_queue.c + ) + set(ASYNC_IF_LIB ASYNC_IF) + include_directories(${OPENAIR2_DIR}/UTIL/ASYNC_IF) + + add_library(FLEXRAN_AGENT + ${OPENAIR2_DIR}/ENB_APP/flexran_agent_handler.c + ${OPENAIR2_DIR}/ENB_APP/flexran_agent_common.c + ${OPENAIR2_DIR}/ENB_APP/flexran_agent_common_internal.c + ${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c + ${OPENAIR2_DIR}/ENB_APP/flexran_agent.c + ${OPENAIR2_DIR}/ENB_APP/flexran_agent_task_manager.c + ${OPENAIR2_DIR}/ENB_APP/flexran_agent_net_comm.c + ${OPENAIR2_DIR}/ENB_APP/flexran_agent_async.c + ${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_internal.c + ) + set(FLEXRAN_AGENT_LIB FLEXRAN_AGENT) + #include_directories(${OPENAIR2_DIR}/ENB_APP) + + set(PROTOBUF_LIB "protobuf-c") + + FIND_PATH(LIBYAML_INCLUDE_DIR NAMES yaml.h) + FIND_LIBRARY(LIBYAML_LIBRARIES NAMES yaml libyaml) + + INCLUDE(FindPackageHandleStandardArgs) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(Yaml DEFAULT_MSG LIBYAML_LIBRARIES LIBYAML_INCLUDE_DIR) + MARK_AS_ADVANCED(LIBYAML_INCLUDE_DIR LIBYAML_LIBRARIES) + + #set(PROTOBUF_LIB "protobuf") #for Cpp +endif() + + add_library(HASHTABLE ${OPENAIR_DIR}/common/utils/hashtable/hashtable.c ${OPENAIR_DIR}/common/utils/hashtable/obj_hashtable.c @@ -1096,7 +1186,17 @@ set (MAC_SRC ${MAC_DIR}/eNB_scheduler_RA.c ${MAC_DIR}/pre_processor.c ${MAC_DIR}/config.c - ) + ) + +if (FLEXRAN_AGENT_SB_IF) + +set (MAC_SRC ${MAC_SRC} + ${MAC_DIR}/flexran_agent_scheduler_dlsch_ue.c + ${MAC_DIR}/flexran_agent_scheduler_dataplane.c + ${MAC_DIR}/flexran_agent_scheduler_dlsch_ue_remote.c +) + +endif() set (ENB_APP_SRC ${OPENAIR2_DIR}/ENB_APP/enb_app.c @@ -1109,6 +1209,14 @@ add_library(L2 ${ENB_APP_SRC}) # ${OPENAIR2_DIR}/RRC/L2_INTERFACE/openair_rrc_L2_interface.c) +if (FLEXRAN_AGENT_SB_IF) + +#Test for adding a shared library +add_library(default_sched SHARED ${MAC_DIR}/flexran_agent_scheduler_dlsch_ue.c) +add_library(remote_sched SHARED ${MAC_DIR}/flexran_agent_scheduler_dlsch_ue_remote.c) + +endif() + # L3 Libs ########################## @@ -1469,6 +1577,23 @@ add_library(LFDS ${lfds}/lfds611_abstraction/lfds611_abstraction_malloc.c ) +set(lfds7 ${OPENAIR2_DIR}/UTIL/LFDS/liblfds7.0.0/liblfds700/src/) +file(GLOB lfds7_queue ${lfds7}/lfds700_queue/*.c) +file(GLOB lfds7_ring ${lfds7}/lfds700_ringbuffer/*.c) +file(GLOB lfds7_qbss ${lfds7}/lfds700_queue_bounded_singleconsumer_singleproducer/*.c) +file(GLOB lfds7_stack ${lfds7}/lfds700_stack/*.c) +file(GLOB lfds7_freelist ${lfds7}/lfds700_freelist/*.c) +file(GLOB lfds7_btree ${lfds7}/lfds700_btree_addonly_unbalanced/*.c) +file(GLOB lfds7_hash ${lfds7}/lfds700_hash_addonly/*.c) +file(GLOB lfds7_ordered_list ${lfds7}/lfds700_list_addonly_ordered_singlylinked/*.c) +file(GLOB lfds7_unordered_list ${lfds7}/lfds700_list_addonly_singlylinked_unordered/*.c) +file(GLOB lfds7_misc ${lfds7}/lfds700_misc/*.c) + +include_directories(${lfds7}) +add_library(LFDS7 + ${lfds7_queue} ${lfds7_ring} ${lfds7_qbss} ${lfds7_stack} ${lfds7_freelist} ${lfds7_btree} ${lfds7_hash} ${lfds7_ordered_list} ${lfds7_unordered_list} ${lfds7_misc} +) + # Simulation library ########################## add_library(SIMU @@ -1645,11 +1770,11 @@ add_executable(lte-softmodem target_link_libraries (lte-softmodem -ldl -Wl,--start-group - RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${MIH_LIB} + RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 -Wl,--end-group ) target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES}) -target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${option_HW_lib} ${option_TP_lib} ${XFORMS_LIBRARIES} ) +target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${option_HW_lib} ${option_TP_lib} ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES}) target_link_libraries (lte-softmodem ${LIB_LMS_LIBRARIES}) target_link_libraries (lte-softmodem ${T_LIB}) @@ -1679,11 +1804,11 @@ add_executable(lte-softmodem-nos1 ) target_link_libraries (lte-softmodem-nos1 -Wl,--start-group - RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${ITTI_LIB} ${MIH_LIB} + RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${ITTI_LIB} ${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 -Wl,--end-group ) target_link_libraries (lte-softmodem-nos1 ${LIBXML2_LIBRARIES}) -target_link_libraries (lte-softmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${option_HW_lib} ${option_TP_lib} ${XFORMS_LIBRARIES} ) +target_link_libraries (lte-softmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${option_HW_lib} ${option_TP_lib} ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES}) target_link_libraries (lte-softmodem-nos1 ${LIB_LMS_LIBRARIES}) target_link_libraries (lte-softmodem-nos1 ${T_LIB}) @@ -1824,16 +1949,20 @@ add_executable(oaisim_nos1 target_include_directories(oaisim_nos1 PUBLIC ${OPENAIR_TARGETS}/SIMU/USER) target_link_libraries (oaisim_nos1 -Wl,--start-group - RRC_LIB X2AP_LIB SECU_CN UTIL HASHTABLE SCHED_LIB PHY LFDS ${MSC_LIB} L2 ${RAL_LIB} SIMU SIMU_ETH SECU_OSA ${ITTI_LIB} ${MIH_LIB} + RRC_LIB X2AP_LIB SECU_CN UTIL HASHTABLE SCHED_LIB PHY LFDS ${MSC_LIB} L2 ${RAL_LIB} SIMU SIMU_ETH SECU_OSA ${ITTI_LIB} ${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 -Wl,--end-group ) target_link_libraries (oaisim_nos1 ${LIBXML2_LIBRARIES} ${LAPACK_LIBRARIES}) -target_link_libraries (oaisim_nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${option_HW_lib} ${option_TP_lib} - ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${OPENPGM_LIBRARIES}) +target_link_libraries (oaisim_nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${option_HW_lib} ${option_TP_lib} + ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${OPENPGM_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES}) #Force link with forms, regardless XFORMS option target_link_libraries (oaisim_nos1 forms) + +#message("protobuflib is ${PROTOBUF_LIB}") + target_link_libraries (oaisim_nos1 ${T_LIB}) + # Unitary tests for each piece of L1: example, mbmssim is MBMS L1 simulator ##################################### @@ -1845,7 +1974,8 @@ foreach(myExe dlsim ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim syn ${T_SOURCE} ) target_link_libraries (${myExe} - -Wl,--start-group SIMU UTIL SCHED_LIB PHY LFDS ${ITTI_LIB} -Wl,--end-group + + -Wl,--start-group SIMU UTIL SCHED_LIB PHY LFDS ${ITTI_LIB} LFDS7 -Wl,--end-group pthread m rt ${CONFIG_LIBRARIES} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB} ) endforeach(myExe) diff --git a/cmake_targets/autotests/README.txt b/cmake_targets/autotests/README.txt index 2a1b57c0b236cdfc223021d43dee3f55049cc3ba..5841ed6dc20fe1e0212ee8124ac7ac95ee6d8dca 100644 --- a/cmake_targets/autotests/README.txt +++ b/cmake_targets/autotests/README.txt @@ -218,7 +218,7 @@ Obj.# Case# Test# Description 01 70 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX -01 75 00 lte-softmodem + RRH tests with B210 RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX +01 75 00 lte-softmodem + RRU (NGFI IF4P5, RAW) tests with B210 RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX 01 75 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX 01 75 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX 01 75 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX @@ -226,7 +226,7 @@ Obj.# Case# Test# Description 01 75 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX 01 75 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX -01 80 00 lte-softmodem + RRH tests with BladeRF RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX +01 80 00 lte-softmodem + RRU (NGFI) tests with BladeRF RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX 01 80 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX 01 80 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX 01 80 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX @@ -234,7 +234,7 @@ Obj.# Case# Test# Description 01 80 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX 01 80 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX -01 85 00 lte-softmodem + RRH tests with USRP X310 RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX +01 85 00 lte-softmodem + RRU (NGFI) tests with USRP X310 RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX 01 85 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX 01 85 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX 01 85 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX @@ -268,6 +268,15 @@ Obj.# Case# Test# Description 02 55 22 Band 7 FDD 10MHz DL Throughput (TCP) for 300 sec for 2TX/2RX (TM2) 02 55 23 Band 7 FDD 20MHz DL Throughput (TCP) for 300 sec for 2TX/2RX (TM2) +02 57 lte-softmodem tests with USRP B210 RF as eNB and OAI EPC (eNB and EPC are on different machines) w/ OAI UE +02 57 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX +02 57 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX +02 57 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX +02 57 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX +02 57 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX +02 57 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX + + 01 64 lte-softmodem-noS1 tests 02 Functional test case diff --git a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py index 796235a77f767f01932396f9fc1366f1cf28bb30..ada0cf09326c1d774ab9b71e76144dc5c8c33a28 100755 --- a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py +++ b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py @@ -552,7 +552,7 @@ def wait_testcaseclass_generic_threads(threadListGeneric, timeout = 1): # \param CleanupAluLteBox string that contains commands to stop ALU Bell Labs LTEBox (specified in test_case_list.xml) # \param ExmimoRfStop command to stop EXMIMO Card # \param nruns_lte-softmodem global parameter to override number of runs (nruns) within the test case -def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , logdirOpenaircnRepo, MachineList, user, password, CleanUpAluLteBox, ExmimoRfStop, nruns_lte_softmodem, timeout_cmd): +def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , logdirOpenaircnRepo, MachineList, user, password, CleanUpAluLteBox, ExmimoRfStop, nruns_lte_softmodem, GitOAI5GRepoBranch, GitOpenaircnRepoBranch,timeout_cmd): #We ignore the password sent to this function for secuirity reasons for password present in log files #It is recommended to add a line in /etc/sudoers that looks something like below. The line below will run sudo without password prompt # your_user_name ALL=(ALL:ALL) NOPASSWD: ALL @@ -575,6 +575,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , tags = testcase.findtext('tags',default='') RRHMachine = testcase.findtext('RRH',default='') + RRH_config_file = testcase.findtext('RRH_config_file',default='') RRH_compile_prog = testcase.findtext('RRH_compile_prog',default='') RRH_compile_prog_args = testcase.findtext('RRH_compile_prog_args',default='') RRH_pre_exec = testcase.findtext('RRH_pre_exec',default='') @@ -582,7 +583,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , RRH_main_exec = testcase.findtext('RRH_main_exec',default='') RRH_main_exec_args = testcase.findtext('RRH_main_exec_args',default='') RRH_terminate_missing_procs = testcase.findtext('RRH_terminate_missing_procs',default='False') - + RRH_branch = testcase.findtext('RRH_branch',default=GitOAI5GRepoBranch) eNBMachine = testcase.findtext('eNB',default='') eNB_config_file = testcase.findtext('eNB_config_file',default='') @@ -598,6 +599,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , eNB_search_expr_true = testcase.findtext('eNB_search_expr_true','') if re.compile('\w+').match(eNB_search_expr_true) != None: eNB_search_expr_true = eNB_search_expr_true + ' duration=' + str(timeout_cmd-90) + 's' + eNB_branch = testcase.findtext('eNB_branch',default=GitOAI5GRepoBranch) UEMachine = testcase.findtext('UE',default='') UE_config_file = testcase.findtext('UE_config_file',default='') @@ -614,6 +616,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , UE_stop_script = testcase.findtext('UE_stop_script','') if re.compile('\w+').match(UE_search_expr_true) != None: UE_search_expr_true = UE_search_expr_true + ' duration=' + str(timeout_cmd-90) + 's' + UE_branch = testcase.findtext('UE_branch',default=GitOAI5GRepoBranch) EPCMachine = testcase.findtext('EPC',default='') EPC_config_file = testcase.findtext('EPC_config_file',default='') @@ -632,6 +635,8 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , EPC_traffic_exec_args = testcase.findtext('EPC_traffic_exec_args',default='') EPC_terminate_missing_procs = testcase.findtext('EPC_terminate_missing_procs',default='False') EPC_search_expr_true = testcase.findtext('EPC_search_expr_true','') + EPC_branch = testcase.findtext('EPC_branch',default=GitOpenaircnRepoBranch) + if re.compile('\w+').match(EPC_search_expr_true) != None: EPC_search_expr_true = EPC_search_expr_true + ' duration=' + str(timeout_cmd-90) + 's' @@ -688,7 +693,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , logdir_local_testcase = logdir_local + '/cmake_targets/autotests/log/'+ testcasename + '/run_' + str(run) #Make the log directory of test case if RRHMachine != '': - cmd = 'rm -fr ' + logdir_RRH + ' ; mkdir -p ' + logdir_RRH + cmd = 'rm -fr ' + logdir_RRH + ' ; mkdir -p ' + logdir_RRH result = oai_RRH.send_recv(cmd) cmd = 'rm -fr ' + logdir_eNB + ' ; mkdir -p ' + logdir_eNB result = oai_eNB.send_recv(cmd) @@ -708,8 +713,10 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , logfile_task_RRH_out = logdir_RRH + '/RRH_task_out' + '_' + str(run) + '_.log' logfile_task_RRH = logdir_local_testcase + '/RRH_task' + '_' + str(run) + '_.log' task_RRH_compile = ' ( uname -a ; date \n' - task_RRH_compile = task_RRH_compile + 'cd ' + logdirOAI5GRepo + ' ; source oaienv ; source cmake_targets/tools/build_helper \n' + task_RRH_compile = task_RRH_compile + 'cd ' + logdirOAI5GRepo + '; git reset --hard HEAD ; git checkout ' + RRH_branch + ' ; source oaienv \n' + task_RRH_compile = task_RRH_compile + ' source cmake_targets/tools/build_helper \n' task_RRH_compile = task_RRH_compile + 'env |grep OPENAIR \n' + task_RRH_compile = task_RRH_compile + update_config_file(oai_RRH, RRH_config_file, logdirOAI5GRepo, '$OPENAIR_DIR/cmake_targets/autotests/tools/search_repl.py') + '\n' if RRH_compile_prog != "": task_RRH_compile = task_RRH_compile + ' ( ' + RRH_compile_prog + ' '+ RRH_compile_prog_args + ' ) > ' + logfile_compile_RRH + ' 2>&1 \n' task_RRH_compile = task_RRH_compile + ' date ) > ' + logfile_task_RRH_compile_out + ' 2>&1 ' @@ -747,7 +754,8 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , logfile_pcap_tmp_eNB = '/tmp/' + '/eNB_tshark' + '_' + str(run) + '_.pcap' task_eNB_compile = ' ( uname -a ; date \n' - task_eNB_compile = task_eNB_compile + 'cd ' + logdirOAI5GRepo + ' ; source oaienv ; source cmake_targets/tools/build_helper \n' + task_eNB_compile = task_eNB_compile + 'cd ' + logdirOAI5GRepo + '; git reset --hard HEAD ; git checkout ' + eNB_branch + ' ; source oaienv \n' + task_eNB_compile = task_eNB_compile + ' source cmake_targets/tools/build_helper \n' task_eNB_compile = task_eNB_compile + 'env |grep OPENAIR \n' task_eNB_compile = task_eNB_compile + update_config_file(oai_eNB, eNB_config_file, logdirOAI5GRepo, '$OPENAIR_DIR/cmake_targets/autotests/tools/search_repl.py') + '\n' if eNB_compile_prog != "": @@ -797,8 +805,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , task_UE_compile = ' ( uname -a ; date \n' task_UE_compile = task_UE_compile + 'array_exec_pid=()' + '\n' - task_UE_compile = task_UE_compile + 'cd ' + logdirOAI5GRepo + '\n' - task_UE_compile = task_UE_compile + 'source oaienv \n' + task_UE_compile = task_UE_compile + 'cd ' + logdirOAI5GRepo + '; git reset --hard HEAD ; git checkout ' + UE_branch + ' ; source oaienv \n' task_UE_compile = task_UE_compile + 'source cmake_targets/tools/build_helper \n' task_UE_compile = task_UE_compile + 'env |grep OPENAIR \n' task_UE_compile = task_UE_compile + update_config_file(oai_UE, UE_config_file, logdirOAI5GRepo, '$OPENAIR_DIR/cmake_targets/autotests/tools/search_repl.py') + '\n' @@ -848,7 +855,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , task_EPC_compile = ' ( uname -a ; date \n' task_EPC_compile = task_EPC_compile + 'array_exec_pid=()' + '\n' - task_EPC_compile = task_EPC_compile + 'cd ' + logdirOpenaircnRepo + ' ; source oaienv \n' + task_EPC_compile = task_EPC_compile + 'cd ' + logdirOpenaircnRepo + '; git reset --hard HEAD ; git checkout ' + EPC_branch + ' ; source oaienv \n' task_EPC_compile = task_EPC_compile + update_config_file(oai_EPC, EPC_config_file, logdirOpenaircnRepo, logdirOpenaircnRepo+'/TEST/autotests/tools/search_repl.py') + '\n' task_EPC_compile = task_EPC_compile + 'source BUILD/TOOLS/build_helper \n' if EPC_compile_prog != "": @@ -2188,6 +2195,8 @@ for testcase in testcaseList: #print "Machine list top level = " + ','.join(MachineList) if search_test_case_group(testcasename, testcasegroup, TestCaseExclusionList) == True: if testcaseclass == 'lte-softmodem' : + #First we wait for all the test cases in generic test case class to finish as they are running in parallel + threadListGlobal = wait_testcaseclass_generic_threads(threadListGlobal, Timeout_execution) eNBMachine = testcase.findtext('eNB',default='') UEMachine = testcase.findtext('UE',default='') EPCMachine = testcase.findtext('EPC',default='') @@ -2198,9 +2207,8 @@ for testcase in testcaseList: print "One of the machines is not in the machine list" print "eNBMachine : " + eNBMachine + "UEMachine : " + UEMachine + "EPCMachine : " + EPCMachine + "MachineList : " + ','.join(MachineList) print "testcasename = " + testcasename + " class = " + testcaseclass - threadListGlobal = wait_testcaseclass_generic_threads(threadListGlobal, Timeout_execution) #cleanOldProgramsAllMachines(oai_list, CleanUpOldProgs, CleanUpAluLteBox, ExmimoRfStop) - handle_testcaseclass_softmodem (testcase, CleanUpOldProgs, logdirOAI5GRepo, logdirOpenaircnRepo, MachineList, user, pw, CleanUpAluLteBox, ExmimoRfStop, nruns_lte_softmodem, Timeout_cmd ) + handle_testcaseclass_softmodem (testcase, CleanUpOldProgs, logdirOAI5GRepo, logdirOpenaircnRepo, MachineList, user, pw, CleanUpAluLteBox, ExmimoRfStop, nruns_lte_softmodem, GitOAI5GRepoBranch, GitOpenaircnRepoBranch, Timeout_cmd ) #The lines below are copied from below to trace the failure of some of the machines in test setup. These lines below need to be removed in long term print "Creating xml file for overall results..." diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index f882ea7ee81223dd2f89e08433d5d68e00d20315..bf2a1ed36c929ee19188c90aebad5031c74b5c84 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -1,7 +1,7 @@ <testCaseList> -<MachineList>mozart hutch starsky stevens amerique calisson nano </MachineList> +<MachineList>amerique mozart hutch starsky stevens calisson nano superserver </MachineList> <NFSResultsShare>/mnt/sradio/TEST_RESULTS/</NFSResultsShare> <GitOAI5GRepo>https://gitlab.eurecom.fr/oai/openairinterface5g.git</GitOAI5GRepo> <GitOpenair-cnRepo>https://gitlab.eurecom.fr/oai/openair-cn.git</GitOpenair-cnRepo> @@ -11,9 +11,9 @@ <CleanUpAluLteBox>sudo -S -E /opt/ltebox/tools/stop_ltebox</CleanUpAluLteBox> <ExmimoRfStop>exmimo_pci=`lspci -m | grep Xilinx`; if [ -n "$exmimo_pci" ] ; then $OPENAIR_DIR/cmake_targets/build_oai -w EXMIMO -c; sudo -S -E $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; fi; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py --reset-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue; uname -a; sudo -E dmesg</ExmimoRfStop> <Timeout_execution>36000</Timeout_execution> - <TestCaseExclusionList>010141 0102+ 010301 010303 010304 010305 0104+ 015508 015511 015520 015523 015518 015519 015520 015521 015522 015523 015602 015605 015702 015705 015818 015819 015820 015821 015822 015823 016102 016105 016502 016505 017002 017005 017502 017505 018002 018005 018502 018505 025514 025517 025520 025523 025518 025519 025520 025521 025522 025523</TestCaseExclusionList> + <TestCaseExclusionList>010141 0102+ 010301 010303 010304 010305 0104+ 015508 015511 015520 015523 015518 015519 015520 015521 015522 015523 015602 015605 015818 015819 015820 015821 015822 015823 016102 016105 016502 016505 017002 017005 018002 018005 018502 018505 025514 025517 025520 025523 025518 025519 025520 025521 025522 025523</TestCaseExclusionList> <nruns_lte-softmodem>3</nruns_lte-softmodem> - <MachineListGeneric>mozart hutch starsky stevens amerique calisson </MachineListGeneric> + <MachineListGeneric>amerique mozart hutch starsky stevens calisson superserver </MachineListGeneric> <testCase id="010101" > <class>compilation</class> <desc>Build oaisim.Rel8</desc> @@ -952,17 +952,17 @@ <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec> <pre_exec_args></pre_exec_args> <main_exec> $OPENAIR_DIR/cmake_targets/lte-simulators/build/dlsim</main_exec> - <main_exec_args> -m5 -gF -s-1 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70 -L + <main_exec_args> -m5 -gF -s-1 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70 -m4 -gF -s0 -w1.0 -f.2 -n500 -B6 -c4 -z2 -O70 - -m15 -gF -s6.7 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70 -L - -m14 -gF -s6.7 -w1.0 -f.2 -n500 -B25 -c3 -z2 -O70 -L - -m15 -gG -s6.7 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O30 -L - -m14 -gG -s1.4 -w1.0 -f.2 -n500 -B25 -c3 -z2 -O30 -L - -m25 -gF -s17.4 -w1.0 -f.2 -n500 -B25 -c3 -z2 -O70 -L - -m25 -gF -s17.5 -w1.0 -f.2 -n500 -B25 -c3 -z2 -r1022 -O70 -L - -m26 -gF -s17.7 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70 -L - -m14 -gF -s6.8 -w1.0 -f.2 -n500 -B50 -c2 -x2 -y2 -z2 -O70 -L - -m13 -gF -s5.9 -w1.0 -f.2 -n500 -B25 -c3 -x2 -y2 -z2 -O70 -L</main_exec_args> + -m15 -gF -s6.7 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70 + -m14 -gF -s6.7 -w1.0 -f.2 -n500 -B25 -c3 -z2 -O70 + -m15 -gG -s6.7 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O30 + -m14 -gG -s1.4 -w1.0 -f.2 -n500 -B25 -c3 -z2 -O30 + -m25 -gF -s17.4 -w1.0 -f.2 -n500 -B25 -c3 -z2 -O70 + -m25 -gF -s17.5 -w1.0 -f.2 -n500 -B25 -c3 -z2 -r1022 -O70 + -m26 -gF -s17.7 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70 + -m14 -gF -s6.8 -w1.0 -f.2 -n500 -B50 -c2 -x2 -y2 -z2 -O70 + -m13 -gF -s5.9 -w1.0 -f.2 -n500 -B25 -c3 -x2 -y2 -z2 -O70</main_exec_args> <tags>dlsim.test1 dlsim.test5 dlsim.test6 dlsim.test6b dlsim.test7 dlsim.test7b dlsim.test10 dlsim.test10b dlsim.test11 dlsim.TM2_test1 dlsim.TM2_test1b</tags> <search_expr_true>"passed"</search_expr_true> <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false> @@ -1025,7 +1025,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -1040,7 +1040,7 @@ <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 7Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 7Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -1100,7 +1100,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -1115,7 +1115,7 @@ <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 14Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 14Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -1175,7 +1175,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -1190,7 +1190,7 @@ <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 14M -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 14M </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -1249,7 +1249,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -1322,7 +1322,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -1396,7 +1396,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -1473,7 +1473,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -1550,7 +1550,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -1626,7 +1626,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf --single-thread -E </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf -E </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -1702,7 +1702,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -1778,7 +1778,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -1855,7 +1855,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf --single-thread -E </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf -E </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -1929,7 +1929,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -2004,7 +2004,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -2079,7 +2079,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -2153,7 +2153,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -2226,7 +2226,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -2300,7 +2300,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -2379,7 +2379,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -2456,7 +2456,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -2532,7 +2532,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf --single-thread -E </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf -E </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -2608,7 +2608,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -2684,7 +2684,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -2761,7 +2761,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf --single-thread -E </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf -E </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -2854,7 +2854,7 @@ <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 7Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 7Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -2938,7 +2938,7 @@ <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 14Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 14Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -3022,7 +3022,7 @@ <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -3106,7 +3106,7 @@ <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true>throughput_test min=00.0Mbits/sec max=10.5Mbits/sec average=11.0Mbits/sec </UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -3190,7 +3190,7 @@ <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=21.0Mbits/sec average=22.0Mbits/sec </UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -3274,7 +3274,7 @@ <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=42.0Mbits/sec average=44.0Mbits/sec </UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -3315,7 +3315,7 @@ <testCase id="015700" > <class>lte-softmodem</class> <desc></desc> - <eNB>calisson</eNB> + <eNB>hutch</eNB> <UE>stevens</UE> <EPC>nano</EPC> <TimeOut_cmd>390</TimeOut_cmd> @@ -3333,10 +3333,10 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args> @@ -3356,9 +3356,9 @@ <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 7Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 7Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -3368,30 +3368,35 @@ <EPC_working_dir>/tmp</EPC_working_dir> <EPC_config_file>ETC/hss.conf MYSQL_user \"root\" ETC/hss.conf MYSQL_pass \"linux\" + ETC/hss.conf OPERATOR_key \"1006020f0a478bf6b699f15c062e42b3\" ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"92\";MME_GID=\"4\";MME_CODE=\"1\";}" ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"92\";TAC=\"1\";}" - ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth1\" ETC/mme.conf MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" ETC/mme.conf MME_INTERFACE_NAME_FOR_S11_MME \"lo\" ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME \"127.0.11.1/8\" ETC/mme.conf MME_PORT_FOR_S11_MME 2123 ETC/mme.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" ETC/mme.conf OUTPUT \"CONSOLE\" - ETC/mme.conf HSS_HOSTNAME \"hss\" + ETC/mme.conf HSS_HOSTNAME \"nano\" ETC/mme_fd.conf Identity \"nano.openair4G.eur\" - ETC/hss_fd.conf Identity \"hss.openair4G.eur\" + ETC/mme_fd.conf ConnectPeer nano.openair4G.eur + ETC/hss_fd.conf Identity \"nano.openair4G.eur\" ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11 \"lo\" ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth1\" ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\" ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP 2152 - ETC/spgw.conf PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" - ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" </EPC_config_file> - <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai -vf; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog> + ETC/spgw.conf PGW_INTERFACE_NAME_FOR_SGI \"eth1\" + ETC/spgw.conf PGW_MASQUERADE_SGI \"yes\" + ETC/spgw.conf DEFAULT_DNS_IPV4_ADDRESS \"192.168.12.100\" + ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\" </EPC_config_file> + <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/acl.conf /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai ; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog> <EPC_compile_prog_args></EPC_compile_prog_args> - <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiamter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ hss.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog> + <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog> <HSS_compile_prog_args></HSS_compile_prog_args> c - <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1</EPC_pre_exec> + <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </EPC_pre_exec> <EPC_pre_exec_args></EPC_pre_exec_args> <EPC_main_exec>sleep 10;$OPENAIRCN_DIR/TEST/autotests/tools/run_epc </EPC_main_exec> <EPC_main_exec_args> </EPC_main_exec_args> @@ -3409,7 +3414,7 @@ c <testCase id="015701" > <class>lte-softmodem</class> <desc></desc> - <eNB>calisson</eNB> + <eNB>hutch</eNB> <UE>stevens</UE> <EPC>nano</EPC> <TimeOut_cmd>390</TimeOut_cmd> @@ -3427,10 +3432,10 @@ c targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args> @@ -3450,9 +3455,9 @@ c <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 14Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 14Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -3462,27 +3467,32 @@ c <EPC_working_dir>/tmp</EPC_working_dir> <EPC_config_file>ETC/hss.conf MYSQL_user \"root\" ETC/hss.conf MYSQL_pass \"linux\" + ETC/hss.conf OPERATOR_key \"1006020f0a478bf6b699f15c062e42b3\" ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"92\";MME_GID=\"4\";MME_CODE=\"1\";}" ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"92\";TAC=\"1\";}" - ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth1\" ETC/mme.conf MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" ETC/mme.conf MME_INTERFACE_NAME_FOR_S11_MME \"lo\" ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME \"127.0.11.1/8\" ETC/mme.conf MME_PORT_FOR_S11_MME 2123 ETC/mme.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" ETC/mme.conf OUTPUT \"CONSOLE\" - ETC/mme.conf HSS_HOSTNAME \"hss\" + ETC/mme.conf HSS_HOSTNAME \"nano\" ETC/mme_fd.conf Identity \"nano.openair4G.eur\" - ETC/hss_fd.conf Identity \"hss.openair4G.eur\" + ETC/mme_fd.conf ConnectPeer nano.openair4G.eur + ETC/hss_fd.conf Identity \"nano.openair4G.eur\" ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11 \"lo\" ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth1\" ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\" ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP 2152 - ETC/spgw.conf PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" - ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" </EPC_config_file> - <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai -vf; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog> + ETC/spgw.conf PGW_INTERFACE_NAME_FOR_SGI \"eth1\" + ETC/spgw.conf PGW_MASQUERADE_SGI \"yes\" + ETC/spgw.conf DEFAULT_DNS_IPV4_ADDRESS \"192.168.12.100\" + ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\" </EPC_config_file> + <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/acl.conf /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai ; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog> <EPC_compile_prog_args></EPC_compile_prog_args> - <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiamter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ hss.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog> + <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog> <HSS_compile_prog_args></HSS_compile_prog_args> c <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1</EPC_pre_exec> @@ -3503,7 +3513,7 @@ c <testCase id="015702" > <class>lte-softmodem</class> <desc></desc> - <eNB>calisson</eNB> + <eNB>hutch</eNB> <UE>stevens</UE> <EPC>nano</EPC> <TimeOut_cmd>390</TimeOut_cmd> @@ -3512,7 +3522,7 @@ c targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 100 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -32 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 @@ -3521,10 +3531,10 @@ c targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args> @@ -3544,9 +3554,9 @@ c <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 28Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -3556,27 +3566,32 @@ c <EPC_working_dir>/tmp</EPC_working_dir> <EPC_config_file>ETC/hss.conf MYSQL_user \"root\" ETC/hss.conf MYSQL_pass \"linux\" + ETC/hss.conf OPERATOR_key \"1006020f0a478bf6b699f15c062e42b3\" ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"92\";MME_GID=\"4\";MME_CODE=\"1\";}" ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"92\";TAC=\"1\";}" - ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth1\" ETC/mme.conf MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" ETC/mme.conf MME_INTERFACE_NAME_FOR_S11_MME \"lo\" ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME \"127.0.11.1/8\" ETC/mme.conf MME_PORT_FOR_S11_MME 2123 ETC/mme.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" ETC/mme.conf OUTPUT \"CONSOLE\" - ETC/mme.conf HSS_HOSTNAME \"hss\" + ETC/mme.conf HSS_HOSTNAME \"nano\" ETC/mme_fd.conf Identity \"nano.openair4G.eur\" - ETC/hss_fd.conf Identity \"hss.openair4G.eur\" + ETC/mme_fd.conf ConnectPeer nano.openair4G.eur + ETC/hss_fd.conf Identity \"nano.openair4G.eur\" ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11 \"lo\" ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth1\" ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\" ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP 2152 - ETC/spgw.conf PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" - ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" </EPC_config_file> - <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai -vf; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog> + ETC/spgw.conf PGW_INTERFACE_NAME_FOR_SGI \"eth1\" + ETC/spgw.conf PGW_MASQUERADE_SGI \"yes\" + ETC/spgw.conf DEFAULT_DNS_IPV4_ADDRESS \"192.168.12.100\" + ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\" </EPC_config_file> + <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/acl.conf /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai ; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog> <EPC_compile_prog_args></EPC_compile_prog_args> - <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiamter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ hss.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog> + <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog> <HSS_compile_prog_args></HSS_compile_prog_args> c <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1</EPC_pre_exec> @@ -3597,7 +3612,7 @@ c <testCase id="015703" > <class>lte-softmodem</class> <desc></desc> - <eNB>calisson</eNB> + <eNB>hutch</eNB> <UE>stevens</UE> <EPC>nano</EPC> <TimeOut_cmd>390</TimeOut_cmd> @@ -3615,10 +3630,10 @@ c targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args> @@ -3638,39 +3653,44 @@ c <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 10M -R </UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 lo -s -i 1 -f m -u </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> - <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=9Mbits/sec average=9Mbits/sec </UE_search_expr_true> - <UE_search_expr_false></UE_search_expr_false> <UE_terminate_missing_procs>False</UE_terminate_missing_procs> <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script> + <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec </UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> <EPC_working_dir>/tmp</EPC_working_dir> <EPC_config_file>ETC/hss.conf MYSQL_user \"root\" ETC/hss.conf MYSQL_pass \"linux\" + ETC/hss.conf OPERATOR_key \"1006020f0a478bf6b699f15c062e42b3\" ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"92\";MME_GID=\"4\";MME_CODE=\"1\";}" ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"92\";TAC=\"1\";}" - ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth1\" ETC/mme.conf MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" ETC/mme.conf MME_INTERFACE_NAME_FOR_S11_MME \"lo\" ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME \"127.0.11.1/8\" ETC/mme.conf MME_PORT_FOR_S11_MME 2123 ETC/mme.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" ETC/mme.conf OUTPUT \"CONSOLE\" - ETC/mme.conf HSS_HOSTNAME \"hss\" + ETC/mme.conf HSS_HOSTNAME \"nano\" ETC/mme_fd.conf Identity \"nano.openair4G.eur\" - ETC/hss_fd.conf Identity \"hss.openair4G.eur\" + ETC/mme_fd.conf ConnectPeer nano.openair4G.eur + ETC/hss_fd.conf Identity \"nano.openair4G.eur\" ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11 \"lo\" ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth1\" ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\" ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP 2152 - ETC/spgw.conf PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" - ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" </EPC_config_file> - <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai -vf; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog> + ETC/spgw.conf PGW_INTERFACE_NAME_FOR_SGI \"eth1\" + ETC/spgw.conf PGW_MASQUERADE_SGI \"yes\" + ETC/spgw.conf DEFAULT_DNS_IPV4_ADDRESS \"192.168.12.100\" + ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\" </EPC_config_file> + <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/acl.conf /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai ; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog> <EPC_compile_prog_args></EPC_compile_prog_args> - <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiamter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ hss.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog> + <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog> <HSS_compile_prog_args></HSS_compile_prog_args> c <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1</EPC_pre_exec> @@ -3679,7 +3699,7 @@ c <EPC_main_exec_args> </EPC_main_exec_args> <HSS_main_exec>cp -vf $OPENAIRCN_DIR/ETC/*.conf $OPENAIRCN_TESTDIR/; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m </EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -b 16M -i 1 -f m -u</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_true></EPC_search_expr_true> <EPC_search_expr_false></EPC_search_expr_false> @@ -3691,7 +3711,7 @@ c <testCase id="015704" > <class>lte-softmodem</class> <desc></desc> - <eNB>calisson</eNB> + <eNB>hutch</eNB> <UE>stevens</UE> <EPC>nano</EPC> <TimeOut_cmd>390</TimeOut_cmd> @@ -3709,10 +3729,10 @@ c targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args> @@ -3732,47 +3752,54 @@ c <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 10M -R </UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 lo -s -i 1 -f m -u </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> - <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=9Mbits/sec average=9Mbits/sec </UE_search_expr_true> - <UE_search_expr_false></UE_search_expr_false> <UE_terminate_missing_procs>False</UE_terminate_missing_procs> <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script> + <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=9.0Mbits/sec average=9.0Mbits/sec </UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> <EPC_working_dir>/tmp</EPC_working_dir> <EPC_config_file>ETC/hss.conf MYSQL_user \"root\" ETC/hss.conf MYSQL_pass \"linux\" + ETC/hss.conf OPERATOR_key \"1006020f0a478bf6b699f15c062e42b3\" ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"92\";MME_GID=\"4\";MME_CODE=\"1\";}" ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"92\";TAC=\"1\";}" - ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth1\" ETC/mme.conf MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" ETC/mme.conf MME_INTERFACE_NAME_FOR_S11_MME \"lo\" ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME \"127.0.11.1/8\" ETC/mme.conf MME_PORT_FOR_S11_MME 2123 ETC/mme.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" ETC/mme.conf OUTPUT \"CONSOLE\" - ETC/mme.conf HSS_HOSTNAME \"hss\" + ETC/mme.conf HSS_HOSTNAME \"nano\" ETC/mme_fd.conf Identity \"nano.openair4G.eur\" - ETC/hss_fd.conf Identity \"hss.openair4G.eur\" + ETC/mme_fd.conf ConnectPeer nano.openair4G.eur + ETC/hss_fd.conf Identity \"nano.openair4G.eur\" ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11 \"lo\" ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth1\" ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\" ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP 2152 - ETC/spgw.conf PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" - ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" </EPC_config_file> - <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai -vf; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog> + ETC/spgw.conf PGW_INTERFACE_NAME_FOR_SGI \"eth1\" + ETC/spgw.conf PGW_MASQUERADE_SGI \"yes\" + ETC/spgw.conf DEFAULT_DNS_IPV4_ADDRESS \"192.168.12.100\" + ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\" </EPC_config_file> + <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/acl.conf /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai ; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog> <EPC_compile_prog_args></EPC_compile_prog_args> - <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiamter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ hss.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog> + <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog> <HSS_compile_prog_args></HSS_compile_prog_args> + + <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1</EPC_pre_exec> <EPC_pre_exec_args></EPC_pre_exec_args> <EPC_main_exec>sleep 10;$OPENAIRCN_DIR/TEST/autotests/tools/run_epc </EPC_main_exec> <EPC_main_exec_args> </EPC_main_exec_args> <HSS_main_exec>cp -vf $OPENAIRCN_DIR/ETC/*.conf $OPENAIRCN_TESTDIR/; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m </EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -b33M -i 1 -f m -u </EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_true></EPC_search_expr_true> <EPC_search_expr_false></EPC_search_expr_false> @@ -3784,7 +3811,7 @@ c <testCase id="015705" > <class>lte-softmodem</class> <desc></desc> - <eNB>calisson</eNB> + <eNB>hutch</eNB> <UE>stevens</UE> <EPC>nano</EPC> <TimeOut_cmd>390</TimeOut_cmd> @@ -3793,7 +3820,7 @@ c targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 100 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -32 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 @@ -3802,10 +3829,10 @@ c targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args> @@ -3825,39 +3852,45 @@ c <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 9M -R </UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 lo -s -i 1 -f m -u </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> - <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=9Mbits/sec average=9Mbits/sec </UE_search_expr_true> - <UE_search_expr_false></UE_search_expr_false> <UE_terminate_missing_procs>False</UE_terminate_missing_procs> <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script> + <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=9.0Mbits/sec average=9.0Mbits/sec </UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <EPC_working_dir>/tmp</EPC_working_dir> <EPC_config_file>ETC/hss.conf MYSQL_user \"root\" ETC/hss.conf MYSQL_pass \"linux\" + ETC/hss.conf OPERATOR_key \"1006020f0a478bf6b699f15c062e42b3\" ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"92\";MME_GID=\"4\";MME_CODE=\"1\";}" ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"92\";TAC=\"1\";}" - ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth1\" ETC/mme.conf MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" ETC/mme.conf MME_INTERFACE_NAME_FOR_S11_MME \"lo\" ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME \"127.0.11.1/8\" ETC/mme.conf MME_PORT_FOR_S11_MME 2123 ETC/mme.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" ETC/mme.conf OUTPUT \"CONSOLE\" - ETC/mme.conf HSS_HOSTNAME \"hss\" + ETC/mme.conf HSS_HOSTNAME \"nano\" ETC/mme_fd.conf Identity \"nano.openair4G.eur\" - ETC/hss_fd.conf Identity \"hss.openair4G.eur\" + ETC/mme_fd.conf ConnectPeer nano.openair4G.eur + ETC/hss_fd.conf Identity \"nano.openair4G.eur\" ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11 \"lo\" ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth1\" ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\" ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP 2152 - ETC/spgw.conf PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" - ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" </EPC_config_file> - <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai -vf; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog> + ETC/spgw.conf PGW_INTERFACE_NAME_FOR_SGI \"eth1\" + ETC/spgw.conf PGW_MASQUERADE_SGI \"yes\" + ETC/spgw.conf DEFAULT_DNS_IPV4_ADDRESS \"192.168.12.100\" + ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\" </EPC_config_file> + <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/acl.conf /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai ; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog> <EPC_compile_prog_args></EPC_compile_prog_args> - <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiamter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ hss.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog> + <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog> <HSS_compile_prog_args></HSS_compile_prog_args> c <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1</EPC_pre_exec> @@ -3866,7 +3899,7 @@ c <EPC_main_exec_args> </EPC_main_exec_args> <HSS_main_exec>cp -vf $OPENAIRCN_DIR/ETC/*.conf $OPENAIRCN_TESTDIR/; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m </EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -b55M -i 1 -f m -u</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_true></EPC_search_expr_true> <EPC_search_expr_false></EPC_search_expr_false> @@ -3904,7 +3937,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -3918,7 +3951,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 7Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 7Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -3976,7 +4009,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -3990,7 +4023,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 14Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 14Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -4048,7 +4081,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -4063,7 +4096,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 17Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 17Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -4120,7 +4153,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -4191,7 +4224,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> <eNB_pre_exec_args>sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -4263,7 +4296,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -4334,7 +4367,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -4348,7 +4381,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -c 192.172.0.1 -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -c 192.172.0.1 </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -4406,7 +4439,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -4420,7 +4453,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -c 192.172.0.1 -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -c 192.172.0.1 </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -4478,7 +4511,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -4493,7 +4526,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -c 192.172.0.1 -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -c 192.172.0.1 </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -4550,7 +4583,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -4621,7 +4654,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> <eNB_pre_exec_args>sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -4693,7 +4726,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -4766,7 +4799,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpx310.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpx310.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -4780,7 +4813,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 7Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 7Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -4840,7 +4873,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpx310.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpx310.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -4854,7 +4887,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 14Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 14Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -4914,7 +4947,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpx310.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpx310.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -4929,7 +4962,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 28Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 28Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -4988,7 +5021,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpx310.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpx310.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -5061,7 +5094,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpx310.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpx310.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -5135,7 +5168,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpx310.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpx310.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -5208,7 +5241,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpx310.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpx310.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -5222,7 +5255,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -c 192.172.0.1 -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -c 192.172.0.1 </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -5282,7 +5315,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpx310.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpx310.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -5296,7 +5329,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -c 192.172.0.1 -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -c 192.172.0.1 </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -5356,7 +5389,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpx310.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpx310.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -5371,7 +5404,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -c 192.172.0.1 -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -c 192.172.0.1 </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -5430,7 +5463,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpx310.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpx310.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -5503,7 +5536,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpx310.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpx310.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -5577,7 +5610,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpx310.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpx310.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -5665,7 +5698,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -5748,7 +5781,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -5911,7 +5944,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true>throughput_test min=00.0Mbits/sec max=10.5Mbits/sec average=11.0Mbits/sec </UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -5992,7 +6025,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=21.0Mbits/sec average=22.0Mbits/sec </UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -6074,7 +6107,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=21.0Mbits/sec average=22.0Mbits/sec </UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -6140,7 +6173,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; dmesg|tail </eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -6154,7 +6187,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 7Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 7Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -6212,7 +6245,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2 ; dmesg|tail</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -6227,7 +6260,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 14Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 14Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -6300,7 +6333,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -6357,7 +6390,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2 ; dmesg|tail</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -6428,7 +6461,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2 ; dmesg|tail</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -6499,7 +6532,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2 ; dmesg|tail</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -6588,7 +6621,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -6671,7 +6704,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -6752,7 +6785,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -6833,7 +6866,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true>throughput_test min=00.0Mbits/sec max=10.5Mbits/sec average=11.0Mbits/sec </UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -6914,7 +6947,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=21.0Mbits/sec average=22.0Mbits/sec </UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -6995,7 +7028,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=21.0Mbits/sec average=22.0Mbits/sec </UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -7080,7 +7113,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -7156,7 +7189,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -7231,7 +7264,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -7306,7 +7339,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_terminate_missing_procs>False</UE_terminate_missing_procs> <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script> @@ -7379,7 +7412,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec </UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -7454,7 +7487,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec </UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -7529,7 +7562,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -7605,7 +7638,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -7680,7 +7713,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -7755,7 +7788,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_terminate_missing_procs>False</UE_terminate_missing_procs> <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script> @@ -7828,7 +7861,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec </UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -7903,7 +7936,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec </UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -7935,67 +7968,90 @@ c <testCase id="017500" > <class>lte-softmodem</class> <desc></desc> - <RRH>calisson</RRH> + <RRH>superserver</RRH> <UE>stevens</UE> <EPC>amerique</EPC> - <eNB>mozart</eNB> + <eNB>hutch</eNB> <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf N_RB_DL 25 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf pdsch_referenceSignalPower -26 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_PORT_FOR_S1U 2152 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rrh_gw_config "local_if_name=\"eth0\";remote_address=\"10:60:4b:75:80:83\";local_address=\"98:90:96:df:66:07\";local_port=50000;remote_port=50000;tr_preference=\"raw\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=70;tx_scheduling_advance=9;rrh_gw_active=\"yes\";"</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf node_function \"NGFI_RCC_IF4p5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf node_timing \"synch_to_ext_device\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf node_synch_ref 0 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -24 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf nb_antenna_ports 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ue_TransmissionMode 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf rrh_gw_config "local_if_name=\"em2\";remote_address=\"00:25:90:f0:f1:2f\";local_address=\"0c:c4:7a:82:95:95\";local_port=50000;remote_port=50000;tr_preference=\"raw_if4p5\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=80;tx_scheduling_advance=9;rrh_gw_active=\"yes\";"</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> - <eNB_compile_prog_args>--eNB -w None -t ETHERNET -x -c --disable-deadline </eNB_compile_prog_args> + <eNB_compile_prog_args>--eNB -w None -t ETHERNET -x -c </eNB_compile_prog_args> <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> - <eNB_main_exec>sleep 5; sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf </eNB_main_exec_args> + <eNB_main_exec>sleep 30; sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> <eNB_search_expr_false></eNB_search_expr_false> <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + <RRH_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf node_function \"NGFI_RRU_IF4p5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf node_timing \"synch_to_ext_device\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf node_synch_ref 0 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -24 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf nb_antenna_ports 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf ue_TransmissionMode 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf rrh_gw_config "local_if_name=\"eth3\";remote_address=\"0c:c4:7a:82:95:95\";local_address=\"00:25:90:f0:f1:2f\";local_port=50000;remote_port=50000;tr_preference=\"raw_if4p5\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=80;tx_scheduling_advance=9;rrh_gw_active=\"yes\";"</RRH_config_file> <RRH_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</RRH_compile_prog> - <RRH_compile_prog_args>--RRH -w USRP -t ETHERNET -c --disable-deadline </RRH_compile_prog_args> + <RRH_compile_prog_args>--eNB -w USRP -t ETHERNET -c -x </RRH_compile_prog_args> <RRH_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</RRH_pre_exec> <RRH_pre_exec_args></RRH_pre_exec_args> - <RRH_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw</RRH_main_exec> - <RRH_main_exec_args> -n1 -x -m1 -i eth1 </RRH_main_exec_args> + <RRH_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</RRH_main_exec> + <RRH_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf </RRH_main_exec_args> <RRH_terminate_missing_procs>False</RRH_terminate_missing_procs> - - <UE_working_dir>/tmp</UE_working_dir> <UE_config_file></UE_config_file> <UE_compile_prog></UE_compile_prog> <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 7Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> <UE_terminate_missing_procs>False</UE_terminate_missing_procs> - <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script> + <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue </UE_stop_script> <EPC_working_dir>/tmp</EPC_working_dir> <EPC_config_file></EPC_config_file> @@ -8012,10 +8068,10 @@ c <HSS_main_exec_args></HSS_main_exec_args> <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> - <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> + <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=5.0Mbits/sec average=5.0Mbits/sec </EPC_search_expr_true> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> - <tags>USRPb210.RRH.ALU_EPC.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX</tags> + <tags>USRPb210.RRH.IF4P5.ALU_EPC.SonyExperiaM4.5MHz.FDD.UDP.Band_7.UL.1TX.1RX</tags> <nruns>10</nruns> </testCase> @@ -8023,65 +8079,91 @@ c <testCase id="017501" > <class>lte-softmodem</class> <desc></desc> - <RRH>calisson</RRH> - <eNB>mozart</eNB> + <RRH>superserver</RRH> <UE>stevens</UE> <EPC>amerique</EPC> + <eNB>hutch</eNB> <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf N_RB_DL 50 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf pdsch_referenceSignalPower -29 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_PORT_FOR_S1U 2152 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rrh_gw_config "local_if_name=\"eth0\";remote_address=\"10:60:4b:75:80:83\";local_address=\"98:90:96:df:66:07\";local_port=50000;remote_port=50000;tr_preference=\"raw\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=113;tx_scheduling_advance=9;rrh_gw_active=\"yes\";"</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf node_function \"NGFI_RCC_IF4p5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf node_timing \"synch_to_ext_device\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf node_synch_ref 0 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -27 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf nb_antenna_ports 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ue_TransmissionMode 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf rrh_gw_config "local_if_name=\"em2\";remote_address=\"00:25:90:f0:f1:2f\";local_address=\"0c:c4:7a:82:95:95\";local_port=50000;remote_port=50000;tr_preference=\"raw_if4p5\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=80;tx_scheduling_advance=9;rrh_gw_active=\"yes\";"</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> - <eNB_compile_prog_args>--eNB -w None -t ETHERNET -x -c --disable-deadline </eNB_compile_prog_args> + <eNB_compile_prog_args>--eNB -w None -t ETHERNET -x -c </eNB_compile_prog_args> <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> - <eNB_main_exec>sleep 5; sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf </eNB_main_exec_args> + <eNB_main_exec>sleep 30; sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> <eNB_search_expr_false></eNB_search_expr_false> <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + <RRH_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf node_function \"NGFI_RRU_IF4p5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf node_timing \"synch_to_ext_device\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf node_synch_ref 0 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -27 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf nb_antenna_ports 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf ue_TransmissionMode 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf rrh_gw_config "local_if_name=\"eth3\";remote_address=\"0c:c4:7a:82:95:95\";local_address=\"00:25:90:f0:f1:2f\";local_port=50000;remote_port=50000;tr_preference=\"raw_if4p5\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=80;tx_scheduling_advance=9;rrh_gw_active=\"yes\";"</RRH_config_file> <RRH_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</RRH_compile_prog> - <RRH_compile_prog_args>--RRH -w USRP -t ETHERNET -c --disable-deadline </RRH_compile_prog_args> + <RRH_compile_prog_args>--eNB -w USRP -t ETHERNET -c -x </RRH_compile_prog_args> <RRH_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</RRH_pre_exec> <RRH_pre_exec_args></RRH_pre_exec_args> - <RRH_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw</RRH_main_exec> - <RRH_main_exec_args> -n1 -x -m1 -i eth1 </RRH_main_exec_args> + <RRH_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</RRH_main_exec> + <RRH_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf </RRH_main_exec_args> <RRH_terminate_missing_procs>False</RRH_terminate_missing_procs> + <UE_working_dir>/tmp</UE_working_dir> <UE_config_file></UE_config_file> <UE_compile_prog></UE_compile_prog> <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 14Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> <UE_terminate_missing_procs>False</UE_terminate_missing_procs> - <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script> + <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue </UE_stop_script> <EPC_working_dir>/tmp</EPC_working_dir> <EPC_config_file></EPC_config_file> @@ -8098,59 +8180,84 @@ c <HSS_main_exec_args></HSS_main_exec_args> <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> - <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> + <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=10.0Mbits/sec average=10.0Mbits/sec </EPC_search_expr_true> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> - <tags>USRPb210.RRH.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX</tags> + <tags>USRPb210.RRH.IF4P5.ALU_EPC.SonyExperiaM4.10MHz.FDD.UDP.Band_7.UL.1TX.1RX</tags> <nruns>10</nruns> </testCase> <testCase id="017502" > <class>lte-softmodem</class> <desc></desc> - <RRH>calisson</RRH> - <eNB>mozart</eNB> + <RRH>superserver</RRH> <UE>stevens</UE> <EPC>amerique</EPC> + <eNB>hutch</eNB> <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf N_RB_DL 100 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf pdsch_referenceSignalPower -32 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_PORT_FOR_S1U 2152 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rrh_gw_config "local_if_name=\"eth0\";remote_address=\"10:60:4b:75:80:83\";local_address=\"98:90:96:df:66:07\";local_port=50000;remote_port=50000;tr_preference=\"raw\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=115;tx_scheduling_advance=11;rrh_gw_active=\"yes\";"</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf node_function \"NGFI_RCC_IF4p5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf node_timing \"synch_to_ext_device\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf node_synch_ref 0 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -30 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf nb_antenna_ports 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ue_TransmissionMode 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf rrh_gw_config "local_if_name=\"em2\";remote_address=\"00:25:90:f0:f1:2f\";local_address=\"0c:c4:7a:82:95:95\";local_port=50000;remote_port=50000;tr_preference=\"raw_if4p5\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=80;tx_scheduling_advance=9;rrh_gw_active=\"yes\";"</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> - <eNB_compile_prog_args>--eNB -w None -t ETHERNET -x -c --disable-deadline </eNB_compile_prog_args> + <eNB_compile_prog_args>--eNB -w None -t ETHERNET -x -c </eNB_compile_prog_args> <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> - <eNB_main_exec>sleep 5; sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf </eNB_main_exec_args> + <eNB_main_exec>sleep 30; sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> <eNB_search_expr_false></eNB_search_expr_false> <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + <RRH_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf node_function \"NGFI_RRU_IF4p5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf node_timing \"synch_to_ext_device\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf node_synch_ref 0 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -30 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf nb_antenna_ports 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf ue_TransmissionMode 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf rrh_gw_config "local_if_name=\"eth3\";remote_address=\"0c:c4:7a:82:95:95\";local_address=\"00:25:90:f0:f1:2f\";local_port=50000;remote_port=50000;tr_preference=\"raw_if4p5\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=80;tx_scheduling_advance=9;rrh_gw_active=\"yes\";"</RRH_config_file> <RRH_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</RRH_compile_prog> - <RRH_compile_prog_args>--RRH -w USRP -t ETHERNET -c --disable-deadline </RRH_compile_prog_args> + <RRH_compile_prog_args>--eNB -w USRP -t ETHERNET -c -x </RRH_compile_prog_args> <RRH_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</RRH_pre_exec> <RRH_pre_exec_args></RRH_pre_exec_args> - <RRH_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw</RRH_main_exec> - <RRH_main_exec_args> -n1 -x -m1 -i eth1 </RRH_main_exec_args> + <RRH_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</RRH_main_exec> + <RRH_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf </RRH_main_exec_args> <RRH_terminate_missing_procs>False</RRH_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> @@ -8159,14 +8266,14 @@ c <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 28Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> <UE_terminate_missing_procs>False</UE_terminate_missing_procs> - <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script> + <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue </UE_stop_script> <EPC_working_dir>/tmp</EPC_working_dir> <EPC_config_file></EPC_config_file> @@ -8183,76 +8290,103 @@ c <HSS_main_exec_args></HSS_main_exec_args> <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> - <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> + <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=5.0Mbits/sec average=5.0Mbits/sec </EPC_search_expr_true> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> - <tags>USRPb210.RRH.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX</tags> + <tags>USRPb210.RRH.IF4P5.ALU_EPC.SonyExperiaM4.10MHz.FDD.UDP.Band_7.UL.1TX.1RX</tags> <nruns>10</nruns> </testCase> <testCase id="017503" > <class>lte-softmodem</class> <desc></desc> - <RRH>calisson</RRH> - <eNB>mozart</eNB> + <RRH>superserver</RRH> <UE>stevens</UE> <EPC>amerique</EPC> + <eNB>hutch</eNB> <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf N_RB_DL 25 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf pdsch_referenceSignalPower -26 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_PORT_FOR_S1U 2152 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rrh_gw_config "local_if_name=\"eth0\";remote_address=\"10:60:4b:75:80:83\";local_address=\"98:90:96:df:66:07\";local_port=50000;remote_port=50000;tr_preference=\"raw\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=70;tx_scheduling_advance=9;rrh_gw_active=\"yes\";"</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf node_function \"NGFI_RCC_IF4p5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf node_timing \"synch_to_ext_device\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf node_synch_ref 0 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -24 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf nb_antenna_ports 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ue_TransmissionMode 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf rrh_gw_config "local_if_name=\"em2\";remote_address=\"00:25:90:f0:f1:2f\";local_address=\"0c:c4:7a:82:95:95\";local_port=50000;remote_port=50000;tr_preference=\"raw_if4p5\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=80;tx_scheduling_advance=9;rrh_gw_active=\"yes\";"</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> - <eNB_compile_prog_args>--eNB -w None -t ETHERNET -x -c --disable-deadline </eNB_compile_prog_args> + <eNB_compile_prog_args>--eNB -w None -t ETHERNET -x -c </eNB_compile_prog_args> <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> - <eNB_main_exec>sleep 5; sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf </eNB_main_exec_args> + <eNB_main_exec>sleep 30; sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> <eNB_search_expr_false></eNB_search_expr_false> <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + <RRH_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf node_function \"NGFI_RRU_IF4p5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf node_timing \"synch_to_ext_device\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf node_synch_ref 0 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -24 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf nb_antenna_ports 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf ue_TransmissionMode 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf rrh_gw_config "local_if_name=\"eth3\";remote_address=\"0c:c4:7a:82:95:95\";local_address=\"00:25:90:f0:f1:2f\";local_port=50000;remote_port=50000;tr_preference=\"raw_if4p5\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=80;tx_scheduling_advance=9;rrh_gw_active=\"yes\";"</RRH_config_file> <RRH_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</RRH_compile_prog> - <RRH_compile_prog_args>--RRH -w USRP -t ETHERNET -c --disable-deadline </RRH_compile_prog_args> + <RRH_compile_prog_args>--eNB -w USRP -t ETHERNET -c -x </RRH_compile_prog_args> <RRH_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</RRH_pre_exec> <RRH_pre_exec_args></RRH_pre_exec_args> - <RRH_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw</RRH_main_exec> - <RRH_main_exec_args> -n1 -x -m1 -i eth1 </RRH_main_exec_args> + <RRH_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</RRH_main_exec> + <RRH_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf </RRH_main_exec_args> <RRH_terminate_missing_procs>False</RRH_terminate_missing_procs> + <UE_working_dir>/tmp</UE_working_dir> <UE_config_file></UE_config_file> <UE_compile_prog></UE_compile_prog> <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -s -i 1 -u -f m </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec </UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> <UE_terminate_missing_procs>False</UE_terminate_missing_procs> - <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script> - <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec </UE_search_expr_true> + <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue </UE_stop_script> <UE_search_expr_false></UE_search_expr_false> - + <EPC_working_dir>/tmp</EPC_working_dir> <EPC_config_file></EPC_config_file> <EPC_compile_prog></EPC_compile_prog> @@ -8266,77 +8400,103 @@ c <EPC_main_exec_args></EPC_main_exec_args> <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s </EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -b 16Mbits/s -i 1 -f m -u</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> - <tags>USRPb210.RRH.ALU_EPC.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX</tags> + <tags>USRPb210.RRH.IF4P5.ALU_EPC.SonyExperiaM4.5MHz.FDD.UDP.Band_7.DL.1TX.1RX</tags> <nruns>10</nruns> </testCase> <testCase id="017504" > <class>lte-softmodem</class> <desc></desc> - <RRH>calisson</RRH> - <eNB>mozart</eNB> + <RRH>superserver</RRH> <UE>stevens</UE> <EPC>amerique</EPC> + <eNB>hutch</eNB> <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf N_RB_DL 50 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf pdsch_referenceSignalPower -29 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_PORT_FOR_S1U 2152 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rrh_gw_config "local_if_name=\"eth0\";remote_address=\"10:60:4b:75:80:83\";local_address=\"98:90:96:df:66:07\";local_port=50000;remote_port=50000;tr_preference=\"raw\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=113;tx_scheduling_advance=9;rrh_gw_active=\"yes\";"</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf node_function \"NGFI_RCC_IF4p5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf node_timing \"synch_to_ext_device\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf node_synch_ref 0 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -27 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf nb_antenna_ports 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ue_TransmissionMode 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf rrh_gw_config "local_if_name=\"em2\";remote_address=\"00:25:90:f0:f1:2f\";local_address=\"0c:c4:7a:82:95:95\";local_port=50000;remote_port=50000;tr_preference=\"raw_if4p5\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=80;tx_scheduling_advance=9;rrh_gw_active=\"yes\";"</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> - <eNB_compile_prog_args>--eNB -w None -t ETHERNET -x -c --disable-deadline </eNB_compile_prog_args> + <eNB_compile_prog_args>--eNB -w None -t ETHERNET -x -c </eNB_compile_prog_args> <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> - <eNB_main_exec>sleep 5; sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf </eNB_main_exec_args> + <eNB_main_exec>sleep 30; sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> <eNB_search_expr_false></eNB_search_expr_false> <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + <RRH_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf node_function \"NGFI_RRU_IF4p5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf node_timing \"synch_to_ext_device\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf node_synch_ref 0 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -27 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf nb_antenna_ports 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf ue_TransmissionMode 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf rrh_gw_config "local_if_name=\"eth3\";remote_address=\"0c:c4:7a:82:95:95\";local_address=\"00:25:90:f0:f1:2f\";local_port=50000;remote_port=50000;tr_preference=\"raw_if4p5\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=80;tx_scheduling_advance=9;rrh_gw_active=\"yes\";"</RRH_config_file> <RRH_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</RRH_compile_prog> - <RRH_compile_prog_args>--RRH -w USRP -t ETHERNET -c --disable-deadline </RRH_compile_prog_args> + <RRH_compile_prog_args>--eNB -w USRP -t ETHERNET -c -x </RRH_compile_prog_args> <RRH_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</RRH_pre_exec> <RRH_pre_exec_args></RRH_pre_exec_args> - <RRH_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw</RRH_main_exec> - <RRH_main_exec_args> -n1 -x -m1 -i eth1 </RRH_main_exec_args> + <RRH_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</RRH_main_exec> + <RRH_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf </RRH_main_exec_args> <RRH_terminate_missing_procs>False</RRH_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -s -i 1 -u -f m </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> - <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec </UE_search_expr_true> + <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec </UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> <UE_terminate_missing_procs>False</UE_terminate_missing_procs> - <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script> - - + <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue </UE_stop_script> + <UE_search_expr_false></UE_search_expr_false> + <EPC_working_dir>/tmp</EPC_working_dir> <EPC_config_file></EPC_config_file> <EPC_compile_prog></EPC_compile_prog> @@ -8350,60 +8510,85 @@ c <EPC_main_exec_args></EPC_main_exec_args> <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s </EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -b 32Mbits/s -i 1 -f m -u</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> - <tags>USRPb210.RRH.ALU_EPC.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX</tags> + <tags>USRPb210.RRH.IF4P5.ALU_EPC.SonyExperiaM4.5MHz.FDD.UDP.Band_7.DL.1TX.1RX</tags> <nruns>10</nruns> </testCase> <testCase id="017505" > <class>lte-softmodem</class> <desc></desc> - <RRH>calisson</RRH> - <eNB>mozart</eNB> + <RRH>superserver</RRH> <UE>stevens</UE> <EPC>amerique</EPC> + <eNB>hutch</eNB> <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf N_RB_DL 100 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rx_gain 125 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf pdsch_referenceSignalPower -32 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf ENB_PORT_FOR_S1U 2152 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf rrh_gw_config "local_if_name=\"eth0\";remote_address=\"10:60:4b:75:80:83\";local_address=\"98:90:96:df:66:07\";local_port=50000;remote_port=50000;tr_preference=\"raw\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=115;tx_scheduling_advance=11;rrh_gw_active=\"yes\";"</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf node_function \"NGFI_RCC_IF4p5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf node_timing \"synch_to_ext_device\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf node_synch_ref 0 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -30 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf nb_antenna_ports 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ue_TransmissionMode 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf rrh_gw_config "local_if_name=\"em2\";remote_address=\"00:25:90:f0:f1:2f\";local_address=\"0c:c4:7a:82:95:95\";local_port=50000;remote_port=50000;tr_preference=\"raw_if4p5\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=80;tx_scheduling_advance=9;rrh_gw_active=\"yes\";"</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> - <eNB_compile_prog_args>--eNB -w None -t ETHERNET -x -c --disable-deadline </eNB_compile_prog_args> + <eNB_compile_prog_args>--eNB -w None -t ETHERNET -x -c </eNB_compile_prog_args> <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> - <eNB_main_exec>sleep 5; $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf </eNB_main_exec_args> + <eNB_main_exec>sleep 30; sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> <eNB_search_expr_false></eNB_search_expr_false> <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + <RRH_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf node_function \"NGFI_RRU_IF4p5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf node_timing \"synch_to_ext_device\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf node_synch_ref 0 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -30 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf nb_antenna_ports 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf ue_TransmissionMode 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf rrh_gw_config "local_if_name=\"eth3\";remote_address=\"0c:c4:7a:82:95:95\";local_address=\"00:25:90:f0:f1:2f\";local_port=50000;remote_port=50000;tr_preference=\"raw_if4p5\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=80;tx_scheduling_advance=9;rrh_gw_active=\"yes\";"</RRH_config_file> <RRH_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</RRH_compile_prog> - <RRH_compile_prog_args>--RRH -w USRP -t ETHERNET -c --disable-deadline </RRH_compile_prog_args> + <RRH_compile_prog_args>--eNB -w USRP -t ETHERNET -c -x </RRH_compile_prog_args> <RRH_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</RRH_pre_exec> <RRH_pre_exec_args></RRH_pre_exec_args> - <RRH_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw</RRH_main_exec> - <RRH_main_exec_args> -n1 -x -m1 -i eth1 </RRH_main_exec_args> + <RRH_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</RRH_main_exec> + <RRH_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf </RRH_main_exec_args> <RRH_terminate_missing_procs>False</RRH_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> @@ -8412,16 +8597,16 @@ c <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -s -i 1 -u -f m </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> - <UE_search_expr_true>throughput_test min=00.0Mbits/sec max=10.0Mbits/sec average=10.0Mbits/sec </UE_search_expr_true> + <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec </UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> <UE_terminate_missing_procs>False</UE_terminate_missing_procs> - <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script> - - + <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue </UE_stop_script> + <UE_search_expr_false></UE_search_expr_false> + <EPC_working_dir>/tmp</EPC_working_dir> <EPC_config_file></EPC_config_file> <EPC_compile_prog></EPC_compile_prog> @@ -8435,11 +8620,11 @@ c <EPC_main_exec_args></EPC_main_exec_args> <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 15Mbits/s </EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -b 60Mbits/s -i 1 -f m -u</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> - <tags>USRPb210.RRH.ALU_EPC.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX</tags> + <tags>USRPb210.RRH.IF4P5.ALU_EPC.SonyExperiaM4.5MHz.FDD.UDP.Band_7.DL.1TX.1RX</tags> <nruns>10</nruns> </testCase> @@ -8474,7 +8659,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -8489,7 +8674,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 7Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 7Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -8549,7 +8734,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -8564,7 +8749,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 14Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 14Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -8624,7 +8809,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -8639,7 +8824,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 28Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -8698,7 +8883,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -8772,7 +8957,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -8847,7 +9032,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -8921,7 +9106,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -8936,7 +9121,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -c 192.172.0.1 -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -c 192.172.0.1 </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -8996,7 +9181,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -9011,7 +9196,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -c 192.172.0.1 -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -c 192.172.0.1 </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -9071,7 +9256,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -9086,7 +9271,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -c 192.172.0.1 -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -c 192.172.0.1 </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -9145,7 +9330,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -9219,7 +9404,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -E -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -E -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -9294,7 +9479,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -9371,7 +9556,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -9386,7 +9571,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 7Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 7Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -9448,7 +9633,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -9463,7 +9648,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 14Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 14Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -9525,7 +9710,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf --single-thread -E </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf -E </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -9540,7 +9725,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 14Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 14Mbits/s </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -9601,7 +9786,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -9677,7 +9862,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -9754,7 +9939,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf --single-thread -E </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf -E </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -9830,7 +10015,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -9845,7 +10030,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -c 192.172.0.1 -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -c 192.172.0.1 </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -9907,7 +10092,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -9922,7 +10107,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -c 192.172.0.1 -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -c 192.172.0.1 </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -9984,7 +10169,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf --single-thread -E </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf -E </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -9999,7 +10184,7 @@ c <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -c 192.172.0.1 -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -c 192.172.0.1 </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -10060,7 +10245,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -10136,7 +10321,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf --single-thread </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -10213,7 +10398,7 @@ c <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf --single-thread -E </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf -E </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -10258,5 +10443,610 @@ c </testCase> + <testCase id="025700" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>hutch</eNB> + <UE>starsky</UE> + <EPC>nano</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"93\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -26 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai --eNB --UE -w USRP -c -x </UE_compile_prog> + <UE_branch>develop1B</UE_branch> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo rmmod nasmesh ; sudo rmmod ue_ip; sudo rmmod oai_nw_drv</UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>sleep 50; cd $OPENAIR_DIR/cmake_targets/lte_build_oai/build ; sudo -E $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 90 --ue-rxgain 125 </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 oai0 -u -c 192.172.0.1 -b 7Mbits/s </UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script> </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file>ETC/hss.conf MYSQL_user \"root\" + ETC/hss.conf MYSQL_pass \"linux\" + ETC/hss.conf OPERATOR_key \"1006020f0a478bf6b699f15c062e42b3\" + ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"93\";MME_GID=\"4\";MME_CODE=\"1\";}" + ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"93\";TAC=\"1\";}" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth1\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S11_MME \"lo\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME \"127.0.11.1/8\" + ETC/mme.conf MME_PORT_FOR_S11_MME 2123 + ETC/mme.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/mme.conf OUTPUT \"CONSOLE\" + ETC/mme.conf HSS_HOSTNAME \"nano\" + ETC/mme_fd.conf Identity \"nano.openair4G.eur\" + ETC/mme_fd.conf ConnectPeer nano.openair4G.eur + ETC/hss_fd.conf Identity \"nano.openair4G.eur\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11 \"lo\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth1\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\" + ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP 2152 + ETC/spgw.conf PGW_INTERFACE_NAME_FOR_SGI \"eth1\" + ETC/spgw.conf PGW_MASQUERADE_SGI \"yes\" + ETC/spgw.conf DEFAULT_DNS_IPV4_ADDRESS \"192.168.12.100\" + ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\" </EPC_config_file> + <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/acl.conf /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai ; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> +c + <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>sleep 10;$OPENAIRCN_DIR/TEST/autotests/tools/run_epc </EPC_main_exec> + <EPC_main_exec_args> </EPC_main_exec_args> + <HSS_main_exec>cp -vf $OPENAIRCN_DIR/ETC/*.conf $OPENAIRCN_TESTDIR/; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>USRPb210.OAI_EPC_remote.OAI_UE.5MHz.FDD.Band_7.UL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="025701" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>hutch</eNB> + <UE>starsky</UE> + <EPC>nano</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"93\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai --eNB --UE -w USRP -c -x </UE_compile_prog> + <UE_branch>develop1B</UE_branch> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo rmmod nasmesh ; sudo rmmod ue_ip; sudo rmmod oai_nw_drv</UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>sleep 50; cd $OPENAIR_DIR/cmake_targets/lte_build_oai/build ; sudo -E $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -U -C2660000000 -r50 --ue-scan-carrier --ue-txgain 90 --ue-rxgain 125 </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 oai0 -u -c 192.172.0.1 -b 14Mbits/s </UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script> </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file>ETC/hss.conf MYSQL_user \"root\" + ETC/hss.conf MYSQL_pass \"linux\" + ETC/hss.conf OPERATOR_key \"1006020f0a478bf6b699f15c062e42b3\" + ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"93\";MME_GID=\"4\";MME_CODE=\"1\";}" + ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"93\";TAC=\"1\";}" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth1\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S11_MME \"lo\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME \"127.0.11.1/8\" + ETC/mme.conf MME_PORT_FOR_S11_MME 2123 + ETC/mme.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/mme.conf OUTPUT \"CONSOLE\" + ETC/mme.conf HSS_HOSTNAME \"nano\" + ETC/mme_fd.conf Identity \"nano.openair4G.eur\" + ETC/mme_fd.conf ConnectPeer nano.openair4G.eur + ETC/hss_fd.conf Identity \"nano.openair4G.eur\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11 \"lo\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth1\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\" + ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP 2152 + ETC/spgw.conf PGW_INTERFACE_NAME_FOR_SGI \"eth1\" + ETC/spgw.conf PGW_MASQUERADE_SGI \"yes\" + ETC/spgw.conf DEFAULT_DNS_IPV4_ADDRESS \"192.168.12.100\" + ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\" </EPC_config_file> + <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/acl.conf /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai ; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> +c + <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>sleep 10;$OPENAIRCN_DIR/TEST/autotests/tools/run_epc </EPC_main_exec> + <EPC_main_exec_args> </EPC_main_exec_args> + <HSS_main_exec>cp -vf $OPENAIRCN_DIR/ETC/*.conf $OPENAIRCN_TESTDIR/; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>USRPb210.OAI_EPC_remote.OAI_UE.10MHz.FDD.Band_7.UL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="025702" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>hutch</eNB> + <UE>starsky</UE> + <EPC>nano</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"93\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -32 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai --eNB --UE -w USRP -c -x </UE_compile_prog> + <UE_branch>develop1B</UE_branch> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo rmmod nasmesh ; sudo rmmod ue_ip; sudo rmmod oai_nw_drv</UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>sleep 50; cd $OPENAIR_DIR/cmake_targets/lte_build_oai/build ; sudo -E $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -U -C2660000000 -r100 --ue-scan-carrier --ue-txgain 90 --ue-rxgain 125 </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 oai0 -u -c 192.172.0.1 -b 28Mbits/s </UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script> </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file>ETC/hss.conf MYSQL_user \"root\" + ETC/hss.conf MYSQL_pass \"linux\" + ETC/hss.conf OPERATOR_key \"1006020f0a478bf6b699f15c062e42b3\" + ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"93\";MME_GID=\"4\";MME_CODE=\"1\";}" + ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"93\";TAC=\"1\";}" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth1\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S11_MME \"lo\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME \"127.0.11.1/8\" + ETC/mme.conf MME_PORT_FOR_S11_MME 2123 + ETC/mme.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/mme.conf OUTPUT \"CONSOLE\" + ETC/mme.conf HSS_HOSTNAME \"nano\" + ETC/mme_fd.conf Identity \"nano.openair4G.eur\" + ETC/mme_fd.conf ConnectPeer nano.openair4G.eur + ETC/hss_fd.conf Identity \"nano.openair4G.eur\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11 \"lo\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth1\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\" + ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP 2152 + ETC/spgw.conf PGW_INTERFACE_NAME_FOR_SGI \"eth1\" + ETC/spgw.conf PGW_MASQUERADE_SGI \"yes\" + ETC/spgw.conf DEFAULT_DNS_IPV4_ADDRESS \"192.168.12.100\" + ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\" </EPC_config_file> + <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/acl.conf /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai ; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> +c + <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>sleep 10;$OPENAIRCN_DIR/TEST/autotests/tools/run_epc </EPC_main_exec> + <EPC_main_exec_args> </EPC_main_exec_args> + <HSS_main_exec>cp -vf $OPENAIRCN_DIR/ETC/*.conf $OPENAIRCN_TESTDIR/; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>USRPb210.OAI_EPC_remote.OAI_UE.20MHz.FDD.Band_7.UL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="025703" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>hutch</eNB> + <UE>starsky</UE> + <EPC>nano</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"93\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -24 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai --eNB --UE -w USRP -c -x </UE_compile_prog> + <UE_branch>develop1B</UE_branch> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo rmmod nasmesh ; sudo rmmod ue_ip; sudo rmmod oai_nw_drv</UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>sleep 50; cd $OPENAIR_DIR/cmake_targets/lte_build_oai/build ; sudo -E $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 90 --ue-rxgain 125 </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 lo -s -i 1 -f m -u </UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=1Mbits/sec average=1Mbits/sec</UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script> </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file>ETC/hss.conf MYSQL_user \"root\" + ETC/hss.conf MYSQL_pass \"linux\" + ETC/hss.conf OPERATOR_key \"1006020f0a478bf6b699f15c062e42b3\" + ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"93\";MME_GID=\"4\";MME_CODE=\"1\";}" + ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"93\";TAC=\"1\";}" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth1\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S11_MME \"lo\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME \"127.0.11.1/8\" + ETC/mme.conf MME_PORT_FOR_S11_MME 2123 + ETC/mme.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/mme.conf OUTPUT \"CONSOLE\" + ETC/mme.conf HSS_HOSTNAME \"nano\" + ETC/mme_fd.conf Identity \"nano.openair4G.eur\" + ETC/mme_fd.conf ConnectPeer nano.openair4G.eur + ETC/hss_fd.conf Identity \"nano.openair4G.eur\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11 \"lo\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth1\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\" + ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP 2152 + ETC/spgw.conf PGW_INTERFACE_NAME_FOR_SGI \"eth1\" + ETC/spgw.conf PGW_MASQUERADE_SGI \"yes\" + ETC/spgw.conf DEFAULT_DNS_IPV4_ADDRESS \"192.168.12.100\" + ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\" </EPC_config_file> + <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/acl.conf /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai ; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> +c + <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>sleep 10;$OPENAIRCN_DIR/TEST/autotests/tools/run_epc </EPC_main_exec> + <EPC_main_exec_args> </EPC_main_exec_args> + <HSS_main_exec>cp -vf $OPENAIRCN_DIR/ETC/*.conf $OPENAIRCN_TESTDIR/; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -b 16M -i 1 -f m -u</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true></EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>USRPb210.OAI_EPC_remote.OAI_UE.5MHz.FDD.Band_7.DL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="025704" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>hutch</eNB> + <UE>starsky</UE> + <EPC>nano</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"93\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai --eNB --UE -w USRP -c -x </UE_compile_prog> + <UE_branch>develop1B</UE_branch> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo rmmod nasmesh ; sudo rmmod ue_ip; sudo rmmod oai_nw_drv</UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>sleep 50; cd $OPENAIR_DIR/cmake_targets/lte_build_oai/build ; sudo -E $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -U -C2660000000 -r50 --ue-scan-carrier --ue-txgain 90 --ue-rxgain 125 </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 lo -s -i 1 -f m -u </UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=1Mbits/sec average=1Mbits/sec</UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script> </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + + <EPC_config_file>ETC/hss.conf MYSQL_user \"root\" + ETC/hss.conf MYSQL_pass \"linux\" + ETC/hss.conf OPERATOR_key \"1006020f0a478bf6b699f15c062e42b3\" + ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"93\";MME_GID=\"4\";MME_CODE=\"1\";}" + ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"93\";TAC=\"1\";}" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth1\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S11_MME \"lo\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME \"127.0.11.1/8\" + ETC/mme.conf MME_PORT_FOR_S11_MME 2123 + ETC/mme.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/mme.conf OUTPUT \"CONSOLE\" + ETC/mme.conf HSS_HOSTNAME \"nano\" + ETC/mme_fd.conf Identity \"nano.openair4G.eur\" + ETC/mme_fd.conf ConnectPeer nano.openair4G.eur + ETC/hss_fd.conf Identity \"nano.openair4G.eur\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11 \"lo\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth1\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\" + ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP 2152 + ETC/spgw.conf PGW_INTERFACE_NAME_FOR_SGI \"eth1\" + ETC/spgw.conf PGW_MASQUERADE_SGI \"yes\" + ETC/spgw.conf DEFAULT_DNS_IPV4_ADDRESS \"192.168.12.100\" + ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\" </EPC_config_file> + <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/acl.conf /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai ; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> +c + <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec> + + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>sleep 10;$OPENAIRCN_DIR/TEST/autotests/tools/run_epc </EPC_main_exec> + <EPC_main_exec_args> </EPC_main_exec_args> + <HSS_main_exec>cp -vf $OPENAIRCN_DIR/ETC/*.conf $OPENAIRCN_TESTDIR/; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -b33M -i 1 -f m -u </EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true></EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>USRPb210.OAI_EPC_remote.OAI_UE.10MHz.FDD.Band_7.DL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="025705" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>hutch</eNB> + <UE>starsky</UE> + <EPC>nano</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"93\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -32 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai --eNB --UE -w USRP -c -x </UE_compile_prog> + <UE_branch>develop1B</UE_branch> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo rmmod nasmesh ; sudo rmmod ue_ip; sudo rmmod oai_nw_drv</UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>sleep 50; cd $OPENAIR_DIR/cmake_targets/lte_build_oai/build ; sudo -E $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem -U -C2660000000 -r100 --ue-scan-carrier --ue-txgain 90 --ue-rxgain 125 </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 lo -s -i 1 -f m -u </UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=1Mbits/sec average=1Mbits/sec</UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script> </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file>ETC/hss.conf MYSQL_user \"root\" + ETC/hss.conf MYSQL_pass \"linux\" + ETC/hss.conf OPERATOR_key \"1006020f0a478bf6b699f15c062e42b3\" + ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"93\";MME_GID=\"4\";MME_CODE=\"1\";}" + ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"93\";TAC=\"1\";}" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth1\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S11_MME \"lo\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME \"127.0.11.1/8\" + ETC/mme.conf MME_PORT_FOR_S11_MME 2123 + ETC/mme.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/mme.conf OUTPUT \"CONSOLE\" + ETC/mme.conf HSS_HOSTNAME \"nano\" + ETC/mme_fd.conf Identity \"nano.openair4G.eur\" + ETC/mme_fd.conf ConnectPeer nano.openair4G.eur + ETC/hss_fd.conf Identity \"nano.openair4G.eur\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11 \"lo\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth1\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\" + ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP 2152 + ETC/spgw.conf PGW_INTERFACE_NAME_FOR_SGI \"eth1\" + ETC/spgw.conf PGW_MASQUERADE_SGI \"yes\" + ETC/spgw.conf DEFAULT_DNS_IPV4_ADDRESS \"192.168.12.100\" + ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\" </EPC_config_file> + <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/acl.conf /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai ; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> +c + <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec> + + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>sleep 10;$OPENAIRCN_DIR/TEST/autotests/tools/run_epc </EPC_main_exec> + <EPC_main_exec_args> </EPC_main_exec_args> + <HSS_main_exec>cp -vf $OPENAIRCN_DIR/ETC/*.conf $OPENAIRCN_TESTDIR/; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -b55M -i 1 -f m -u</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true></EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>USRPb210.OAI_EPC_remote.OAI_UE.20MHz.FDD.Band_7.DL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + </testCaseList> diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index b77a9baa566252bef3498d6ebc79a4918b704bbc..25e9a1ccc8537f04b6bc46924301dbc591c30656 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -35,6 +35,7 @@ source $THIS_SCRIPT_PATH/tools/build_helper MSC_GEN="False" XFORMS="True" +FLEXRAN_AGENT_SB_IF="True" PRINT_STATS="False" VCD_TIMING="False" DEADLINE_SCHEDULER_FLAG_USER="False" @@ -83,6 +84,8 @@ Options Makes the UE specific parts (ue_ip, usim, nvram) --RRH Makes the RRH +-a | --agent + Enables agent for software-defined control of the eNB -r | --3gpp-release default is Rel10, Rel8 limits the implementation to 3GPP Release 8 version @@ -169,6 +172,10 @@ function main() { eNB=1 echo_info "Will compile eNB" shift;; + -a | --agent) + FLEXRAN_AGENT=1 + echo_info "Will compile eNB with agent support" + shift;; --UE) UE=1 echo_info "Will compile UE" @@ -439,6 +446,9 @@ function main() { echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file echo "set ( XFORMS $XFORMS )" >> $cmake_file + if [ "$FLEXRAN_AGENT" = "1" ] ; then + echo "set ( FLEXRAN_AGENT_SB_IF $FLEXRAN_AGENT_SB_IF )" >> $cmake_file + fi echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file echo "set ( RF_BOARD \"${HW}\")" >> $cmake_file @@ -581,6 +591,9 @@ function main() { echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file echo "set ( XFORMS $XFORMS )" >> $cmake_file + if [ "$FLEXRAN_AGENT" = "1" ] ; then + echo "set ( FLEXRAN_AGENT_SB_IF $FLEXRAN_AGENT_SB_IF )" >> $cmake_file + fi echo "set ( PRINT_STATS $PRINT_STATS )" >> $cmake_file echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file @@ -649,6 +662,9 @@ function main() { cp $DIR/oaisim_mme_build_oai/CMakeLists.template $cmake_file echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file echo "set ( XFORMS $XFORMS )" >> $cmake_file + if [ "$FLEXRAN_AGENT" = "1" ] ; then + echo "set ( FLEXRAN_AGENT_SB_IF $FLEXRAN_AGENT_SB_IF )" >> $cmake_file + fi echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file echo "set ( T_TRACER $T_TRACER )" >> $cmake_file diff --git a/cmake_targets/oaisim_noS1_build_oai/CMakeLists.template b/cmake_targets/oaisim_noS1_build_oai/CMakeLists.template index 6d8fc6d26a77c3420673b341b2ebcfec22a7fe73..ebb4b32f49f736f6d57c61f02b696f4ffd9504ec 100644 --- a/cmake_targets/oaisim_noS1_build_oai/CMakeLists.template +++ b/cmake_targets/oaisim_noS1_build_oai/CMakeLists.template @@ -48,7 +48,7 @@ set ( NEW_FFT True ) set ( NO_RRM True ) set ( OAI_EMU True ) set ( OAISIM True ) -set ( OAI_NW_DRIVER_TYPE_ETHERNET True ) +set ( OAI_NW_DRIVER_TYPE_ETHERNET False ) set ( OAI_NW_DRIVER_USE_NETLINK True ) set ( OPENAIR1 True ) set ( OPENAIR2 True ) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index c5f2b877048c10b4a0e19cb238a99a6ac5c603dc..448d54f334db51dd3ce702312e94e90ca66f201e 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -163,6 +163,42 @@ compilations() { # External packages installers ############################################ +install_protobuf_from_source(){ + protobuf_install_log=$OPENAIR_DIR/cmake_targets/log/protobuf_install_log.txt + echo_info "\nInstalling Google Protobuf from sources. The log file for Protobuf installation is here: $protobuf_install_log " + ( + cd /tmp + echo "Downloading protobuf" + rm -rf /tmp/protobuf-2.6.1.tar.gz* /tmp/protobuf-2.6.1 + wget https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz + tar -xzvf protobuf-2.6.1.tar.gz + cd protobuf-2.6.1/ + ./configure + echo "Compiling protobuf" + make -j`nproc` + $SUDO make install + $SUDO ldconfig + ) >& $protobuf_install_log +} + +install_protobuf_c_from_source(){ + protobuf_c_install_log=$OPENAIR_DIR/cmake_targets/log/protobuf_c_install_log.txt + echo_info "\nInstalling Google Protobuf_C from sources. The log file for Protobuf_C installation is here: $protobuf_c_install_log " + ( + cd /tmp + echo "Downloading protobuf-c" + rm -rf /tmp/protobuf-c + git clone https://github.com/protobuf-c/protobuf-c.git + cd protobuf-c + ./autogen.sh + ./configure + echo "Compiling protobuf-c" + make -j`nproc` + $SUDO make install + $SUDO ldconfig + ) >& $protobuf_c_install_log +} + check_install_usrp_uhd_driver(){ #first we remove old installation $SUDO apt-get remove -y uhd || true @@ -324,6 +360,7 @@ check_install_oai_software() { xmlstarlet \ python-pip \ pydb \ + libyaml-dev \ wget $SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so @@ -337,6 +374,10 @@ check_install_oai_software() { $SUDO apt-get install -y libgnutls-dev install_asn1c_from_source + $SUDO rm -fr /opt/ssh + $SUDO git clone https://gist.github.com/2190472.git /opt/ssh + install_protobuf_from_source + install_protobuf_c_from_source } ### Remove Nettle installation which was done from sources @@ -361,6 +402,7 @@ remove_nettle_from_source() { cd nettle-2.5/ ./configure --disable-openssl --enable-shared --prefix=/usr $SUDO make uninstall || true + $SUDO ldconfig ) >& $nettle_uninstall_log } @@ -384,6 +426,7 @@ remove_gnutls_from_source(){ cd gnutls-3.1.23/ ./configure --prefix=/usr $SUDO make uninstall || true + $SUDO ldconfig )>& $gnutls_uninstall_log } @@ -398,6 +441,7 @@ install_asn1c_from_source(){ make -j`nproc` $SUDO make install cd - + $SUDO ldconfig ) > $asn1_install_log 2>&1 } diff --git a/cmake_targets/tools/generate_protobuf b/cmake_targets/tools/generate_protobuf new file mode 100755 index 0000000000000000000000000000000000000000..5c1b523f8cf338d8e29f18b25e6ceaf12d74ceac --- /dev/null +++ b/cmake_targets/tools/generate_protobuf @@ -0,0 +1,19 @@ +#!/bin/bash + +function main() +{ +mkdir -p $1 + +#echo generate protobuf messages inside $1 $2 + +c_out=$1 +shift +proto_path=$1 +shift + +protoc-c --c_out=$c_out --proto_path=$proto_path $* +#protoc --cpp_out=$c_out --proto_path=$proto_path $* + +} + +main "$@" diff --git a/cmake_targets/tools/make_agent_cache b/cmake_targets/tools/make_agent_cache new file mode 100755 index 0000000000000000000000000000000000000000..d2eab20fc0ba0e74792582df44f9dd69d5407e4a --- /dev/null +++ b/cmake_targets/tools/make_agent_cache @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +CACHE_DIR=/mnt/oai_agent_cache + +if [ ! -d $CACHE_DIR ]; then + echo "Creating cache dir in $CACHE_DIR" + sudo mkdir $CACHE_DIR +fi + +if grep -qs "$CACHE_DIR" /proc/mounts; then + echo "Agent cache is already mounted" +else + echo "Agent cache was not mounted" + echo "Mounting..." + sudo mount -o size=100m -t tmpfs none "$CACHE_DIR" + if [ $? -eq 0 ]; then + echo "Mount success" + else + echo "Something went wrong with the mount" + fi +fi diff --git a/common/utils/T/T_messages.txt b/common/utils/T/T_messages.txt index 6e5e0ad7aa26f86d760c6df773782f076cbe23c5..2d2ee3c48908994512ca1049064013ab741c9db4 100644 --- a/common/utils/T/T_messages.txt +++ b/common/utils/T/T_messages.txt @@ -16,7 +16,7 @@ ID = ENB_PHY_DL_TICK ID = ENB_PHY_DLSCH_UE_DCI DESC = eNodeB downlink UE specific DCI as sent by the PHY layer GROUP = ALL:PHY:GRAPHIC:ENB - FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,dci_format : int,harq_pid + FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,dci_format : int,harq_pid : int,mcs : int,TBS ID = ENB_PHY_DLSCH_UE_ACK DESC = eNodeB downlink UE ACK as seen by the PHY layer in process_HARQ_feedback GROUP = ALL:PHY:GRAPHIC:ENB @@ -28,7 +28,7 @@ ID = ENB_PHY_DLSCH_UE_NACK ID = ENB_PHY_ULSCH_UE_DCI DESC = eNodeB uplink UE specific DCI as sent by the PHY layer GROUP = ALL:PHY:GRAPHIC:ENB - FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid + FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid : int,mcs : int,round : int,first_rb : int,nb_rb : int,TBS ID = ENB_PHY_ULSCH_UE_NO_DCI_RETRANSMISSION DESC = eNodeB uplink UE retransmission due to PHICH NACK (see generate_phich_top) GROUP = ALL:PHY:GRAPHIC:ENB @@ -65,6 +65,14 @@ ID = ENB_PHY_PHICH DESC = eNodeB PHICH GROUP = ALL:PHY:ENB FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid : int,NGROUP : int,NSF : int,ngroup : int,nseq : int,ACK : int,first_rb : int,n_DMRS +ID = ENB_PHY_MSG3_ALLOCATION + DESC = eNodeB Msg3 allocation/reallocation + GROUP = ALL:PHY:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,first_transmission : int,Msg3_frame : int,Msg3_subframe +ID = ENB_PHY_INITIATE_RA_PROCEDURE + DESC = eNodeB initiates a random access procedure after detecting enough energy for one of the preambles + GROUP = ALL:PHY:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,preamble : int,energy : int,delay #MAC logs ID = ENB_MAC_UE_DL_SDU @@ -74,7 +82,7 @@ ID = ENB_MAC_UE_DL_SDU ID = ENB_MAC_UE_UL_SCHEDULE DESC = MAC uplink UE scheduling decision GROUP = ALL:MAC:ENB - FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,harq_pid : int,mcs : int,first_rb : int,nb_rb : int,TBS + FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,harq_pid : int,mcs : int,first_rb : int,nb_rb : int,TBS : int,ndi ID = ENB_MAC_UE_UL_SCHEDULE_RETRANSMISSION DESC = MAC uplink UE scheduling retransmission decision GROUP = ALL:MAC:ENB diff --git a/common/utils/T/tracer/enb.c b/common/utils/T/tracer/enb.c index 3b8e2bf14e3c0eb147dc4b87381ab1826a9df10f..14e1da35c01138067e8ddf0926e645e555922afb 100644 --- a/common/utils/T/tracer/enb.c +++ b/common/utils/T/tracer/enb.c @@ -24,6 +24,30 @@ typedef struct { view *pdcpview; view *rrcview; view *legacy; + widget *current_ue_label; + widget *prev_ue_button; + widget *next_ue_button; + widget *pusch_iq_ue_xy_plot; + widget *ul_estimate_ue_xy_plot; + widget *pucch1_energy_ue_xy_plot; + widget *pucch_iq_ue_xy_plot; + widget *dl_ul_harq_ue_label; + widget *dl_mcs_xy_plot; + widget *ul_mcs_xy_plot; + logger *pusch_iq_ue_logger; + logger *ul_estimate_ue_logger; + logger *pucch1_energy_ue_threshold_logger; + logger *pucch1_energy_ue_energy_logger; + logger *pucch_iq_ue_logger; + logger *dl_dci_logger[8]; + logger *dl_ack_logger[8]; + logger *dl_nack_logger[8]; + logger *ul_dci_logger[8]; + logger *ul_dci_retransmission_logger[8]; + logger *ul_ack_logger[8]; + logger *ul_nack_logger[8]; + logger *dl_mcs_logger; + logger *ul_mcs_logger; } enb_gui; typedef struct { @@ -31,6 +55,9 @@ typedef struct { int *is_on; int nevents; pthread_mutex_t lock; + enb_gui *e; + int ue; /* what UE is displayed in the UE specific views */ + void *database; } enb_data; void is_on_changed(void *_d) @@ -86,18 +113,109 @@ static void *gui_thread(void *_g) return NULL; } -static filter *ticktime_filter(void *database, char *event, int i) +static filter *ticktime_filter(void *database, char *event, int i, int ue) { /* filter is "harq_pid == i && UE_id == 0 && eNB_id == 0" */ return filter_and( filter_eq(filter_evarg(database, event, "harq_pid"), filter_int(i)), filter_and( - filter_eq(filter_evarg(database, event, "UE_id"), filter_int(0)), + filter_eq(filter_evarg(database, event, "UE_id"), filter_int(ue)), filter_eq(filter_evarg(database, event, "eNB_ID"), filter_int(0)))); } -static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database) +static void set_current_ue(gui *g, enb_data *e, int ue) +{ + int i; + char s[256]; + + sprintf(s, "[UE %d] ", ue); + label_set_text(g, e->e->current_ue_label, s); + sprintf(s, "PUSCH IQ [UE %d]", ue); + xy_plot_set_title(g, e->e->pusch_iq_ue_xy_plot, s); + sprintf(s, "UL estimated channel [UE %d]", ue); + xy_plot_set_title(g, e->e->ul_estimate_ue_xy_plot, s); + sprintf(s, "PUCCH1 energy (SR) [UE %d]", ue); + xy_plot_set_title(g, e->e->pucch1_energy_ue_xy_plot, s); + sprintf(s, "PUCCH IQ [UE %d]", ue); + xy_plot_set_title(g, e->e->pucch_iq_ue_xy_plot, s); + sprintf(s, "DL/UL HARQ (x8) [UE %d]", ue); + label_set_text(g, e->e->dl_ul_harq_ue_label, s); + sprintf(s, "DL MCS [UE %d]", ue); + xy_plot_set_title(g, e->e->dl_mcs_xy_plot, s); + sprintf(s, "UL MCS [UE %d]", ue); + xy_plot_set_title(g, e->e->ul_mcs_xy_plot, s); + + logger_set_filter(e->e->pusch_iq_ue_logger, + filter_eq( + filter_evarg(e->database, "ENB_PHY_PUSCH_IQ", "UE_ID"), + filter_int(ue))); + logger_set_filter(e->e->ul_estimate_ue_logger, + filter_eq( + filter_evarg(e->database, "ENB_PHY_UL_CHANNEL_ESTIMATE", "UE_ID"), + filter_int(ue))); + logger_set_filter(e->e->pucch1_energy_ue_threshold_logger, + filter_eq( + filter_evarg(e->database, "ENB_PHY_PUCCH_1_ENERGY", "UE_ID"), + filter_int(ue))); + logger_set_filter(e->e->pucch1_energy_ue_energy_logger, + filter_eq( + filter_evarg(e->database, "ENB_PHY_PUCCH_1_ENERGY", "UE_ID"), + filter_int(ue))); + logger_set_filter(e->e->pucch_iq_ue_logger, + filter_eq( + filter_evarg(e->database, "ENB_PHY_PUCCH_1AB_IQ", "UE_ID"), + filter_int(ue))); + for (i = 0; i < 8; i++) { + logger_set_filter(e->e->dl_dci_logger[i], + ticktime_filter(e->database, "ENB_PHY_DLSCH_UE_DCI", i, ue)); + logger_set_filter(e->e->dl_ack_logger[i], + ticktime_filter(e->database, "ENB_PHY_DLSCH_UE_ACK", i, ue)); + logger_set_filter(e->e->dl_nack_logger[i], + ticktime_filter(e->database, "ENB_PHY_DLSCH_UE_NACK", i, ue)); + logger_set_filter(e->e->ul_dci_logger[i], + ticktime_filter(e->database, "ENB_PHY_ULSCH_UE_DCI", i, ue)); + logger_set_filter(e->e->ul_dci_retransmission_logger[i], + ticktime_filter(e->database, + "ENB_PHY_ULSCH_UE_NO_DCI_RETRANSMISSION", i, ue)); + logger_set_filter(e->e->ul_ack_logger[i], + ticktime_filter(e->database, "ENB_PHY_ULSCH_UE_ACK", i, ue)); + logger_set_filter(e->e->ul_nack_logger[i], + ticktime_filter(e->database, "ENB_PHY_ULSCH_UE_NACK", i, ue)); + } + logger_set_filter(e->e->dl_mcs_logger, + filter_eq( + filter_evarg(e->database, "ENB_PHY_DLSCH_UE_DCI", "UE_id"), + filter_int(ue))); + logger_set_filter(e->e->ul_mcs_logger, + filter_eq( + filter_evarg(e->database, "ENB_PHY_ULSCH_UE_DCI", "UE_id"), + filter_int(ue))); +} + +static void click(void *private, gui *g, + char *notification, widget *w, void *notification_data) +{ + int *d = notification_data; + int button = d[0]; + enb_data *ed = private; + enb_gui *e = ed->e; + int ue = ed->ue; + + if (button != 1) return; + if (w == e->prev_ue_button) { ue--; if (ue < 0) ue = 0; } + if (w == e->next_ue_button) ue++; + + if (pthread_mutex_lock(&ed->lock)) abort(); + if (ue != ed->ue) { + set_current_ue(g, ed, ue); + ed->ue = ue; + } + if (pthread_mutex_unlock(&ed->lock)) abort(); +} + +static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database, + enb_data *ed) { widget *main_window; widget *top_container; @@ -113,7 +231,7 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database) widget *text; view *textview; int i; - widget *w; + widget *w, *w2; view *v; logger *l; @@ -124,7 +242,26 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database) line = new_container(g, HORIZONTAL); widget_add_child(g, top_container, line, -1); logo = new_image(g, openair_logo_png, openair_logo_png_len); - widget_add_child(g, line, logo, -1); + + /* logo + prev/next UE buttons */ + col = new_container(g, VERTICAL); + widget_add_child(g, col, logo, -1); + w = new_container(g, HORIZONTAL); + widget_add_child(g, col, w, -1); + w2 = new_label(g, ""); + widget_add_child(g, w, w2, -1); + e->current_ue_label = w2; + /* TODO: use button widget, not label widget */ + w2 = new_label(g, " [prev UE] "); + widget_add_child(g, w, w2, -1); + label_set_clickable(g, w2, 1); + e->prev_ue_button = w2; + w2 = new_label(g, " [next UE] "); + widget_add_child(g, w, w2, -1); + label_set_clickable(g, w2, 1); + e->next_ue_button = w2; + widget_add_child(g, line, col, -1); + input_signal_plot = new_xy_plot(g, 256, 55, "input signal", 20); widget_add_child(g, line, input_signal_plot, -1); xy_plot_set_range(g, input_signal_plot, 0, 7680*10, 20, 70); @@ -138,21 +275,20 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database) g, input_signal_plot, new_color(g, "#0c0c72"), XY_LOOP_MODE); logger_add_view(input_signal_log, input_signal_view); - /* UE 0 PUSCH IQ data */ - w = new_xy_plot(g, 55, 55, "PUSCH IQ [UE 0]", 50); + /* UE x PUSCH IQ data */ + w = new_xy_plot(g, 55, 55, "", 50); + e->pusch_iq_ue_xy_plot = w; widget_add_child(g, line, w, -1); xy_plot_set_range(g, w, -1000, 1000, -1000, 1000); l = new_iqlog(h, database, "ENB_PHY_PUSCH_IQ", "nb_rb", "N_RB_UL", "symbols_per_tti", "pusch_comp"); v = new_view_xy(100*12*14,10,g,w,new_color(g,"#000"),XY_FORCED_MODE); logger_add_view(l, v); - logger_set_filter(l, - filter_eq( - filter_evarg(database, "ENB_PHY_PUSCH_IQ", "UE_ID"), - filter_int(0))); + e->pusch_iq_ue_logger = l; - /* UE 0 estimated UL channel */ - w = new_xy_plot(g, 280, 55, "UL estimated channel [UE 0]", 50); + /* UE x estimated UL channel */ + w = new_xy_plot(g, 280, 55, "", 50); + e->ul_estimate_ue_xy_plot = w; widget_add_child(g, line, w, -1); xy_plot_set_range(g, w, 0, 512*10, -10, 80); l = new_framelog(h, database, @@ -161,43 +297,57 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database) framelog_set_update_only_at_sf9(l, 0); v = new_view_xy(512*10, 10, g, w, new_color(g, "#0c0c72"), XY_LOOP_MODE); logger_add_view(l, v); - logger_set_filter(l, - filter_eq( - filter_evarg(database, "ENB_PHY_UL_CHANNEL_ESTIMATE", "UE_ID"), - filter_int(0))); + e->ul_estimate_ue_logger = l; - /* UE 0 PUCCH energy */ - w = new_xy_plot(g, 128, 55, "PUCCH1 energy (SR) [UE 0]", 50); + /* UE x PUCCH energy */ + w = new_xy_plot(g, 128, 55, "", 50); + e->pucch1_energy_ue_xy_plot = w; widget_add_child(g, line, w, -1); xy_plot_set_range(g, w, 0, 1024*10, -10, 80); l = new_ttilog(h, database, "ENB_PHY_PUCCH_1_ENERGY", "frame", "subframe", "threshold", 0); v = new_view_tti(10, g, w, new_color(g, "#ff0000")); logger_add_view(l, v); - logger_set_filter(l, - filter_eq( - filter_evarg(database, "ENB_PHY_PUCCH_1_ENERGY", "UE_ID"), - filter_int(0))); + e->pucch1_energy_ue_threshold_logger = l; l = new_ttilog(h, database, "ENB_PHY_PUCCH_1_ENERGY", "frame", "subframe", "energy", 1); v = new_view_tti(10, g, w, new_color(g, "#0c0c72")); logger_add_view(l, v); - logger_set_filter(l, - filter_eq( - filter_evarg(database, "ENB_PHY_PUCCH_1_ENERGY", "UE_ID"), - filter_int(0))); + e->pucch1_energy_ue_energy_logger = l; - /* UE 0 PUCCH IQ data */ - w = new_xy_plot(g, 55, 55, "PUCCH IQ [UE 0]", 50); + /* UE x PUCCH IQ data */ + w = new_xy_plot(g, 55, 55, "", 50); + e->pucch_iq_ue_xy_plot = w; widget_add_child(g, line, w, -1); - xy_plot_set_range(g, w, -100, 100, -100, 100); + xy_plot_set_range(g, w, -2000, 2000, -2000, 2000); l = new_iqdotlog(h, database, "ENB_PHY_PUCCH_1AB_IQ", "I", "Q"); v = new_view_xy(500, 10, g, w, new_color(g,"#000"), XY_LOOP_MODE); logger_add_view(l, v); - logger_set_filter(l, - filter_eq( - filter_evarg(database, "ENB_PHY_PUCCH_1AB_IQ", "UE_ID"), - filter_int(0))); + e->pucch_iq_ue_logger = l; + + /* UE x DL mcs */ + line = new_container(g, HORIZONTAL); + widget_add_child(g, top_container, line, -1); + w = new_xy_plot(g, 128, 55, "", 20); + xy_plot_set_range(g, w, 0, 1024*10, -2, 30); + e->dl_mcs_xy_plot = w; + widget_add_child(g, line, w, -1); + l = new_ticked_ttilog(h, database, "ENB_PHY_DL_TICK", "frame", "subframe", + "ENB_PHY_DLSCH_UE_DCI", "mcs", 0, -1); + v = new_view_tti(10, g, w, new_color(g, "#0c0c72")); + logger_add_view(l, v); + e->dl_mcs_logger = l; + + /* UE x UL mcs */ + w = new_xy_plot(g, 128, 55, "", 20); + xy_plot_set_range(g, w, 0, 1024*10, -2, 30); + e->ul_mcs_xy_plot = w; + widget_add_child(g, line, w, -1); + l = new_ticked_ttilog(h, database, "ENB_PHY_DL_TICK", "frame", "subframe", + "ENB_PHY_ULSCH_UE_DCI", "mcs", 0, -1); + v = new_view_tti(10, g, w, new_color(g, "#0c0c72")); + logger_add_view(l, v); + e->ul_mcs_logger = l; /* downlink/uplink UE DCIs */ widget_add_child(g, top_container, @@ -250,8 +400,8 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database) logger_add_view(timelog, subview); /* harq processes' ticktime view */ - widget_add_child(g, top_container, - new_label(g,"DL/UL HARQ (x8) [UE 0]"), -1); + e->dl_ul_harq_ue_label = new_label(g, ""); + widget_add_child(g, top_container, e->dl_ul_harq_ue_label, -1); line = new_container(g, HORIZONTAL); widget_add_child(g, top_container, line, -1); timeline_plot = new_timeline(g, 512, 2*8+2, 3); @@ -271,15 +421,14 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database) /* tick on UL view */ subview = new_subview_ticktime(timeview, 9, new_color(g,"#bbb"), 3600*1000); logger_add_view(timelog, subview); - /* DL harq pids */ + /* DL DCI */ for (i = 0; i < 8; i++) { timelog = new_ticklog(h, database, "ENB_PHY_DLSCH_UE_DCI", "frame", "subframe"); subview = new_subview_ticktime(timeview, i+1, new_color(g,"#55f"), 3600*1000); logger_add_view(timelog, subview); - logger_set_filter(timelog, - ticktime_filter(database, "ENB_PHY_DLSCH_UE_DCI", i)); + e->dl_dci_logger[i] = timelog; } /* DL ACK */ for (i = 0; i < 8; i++) { @@ -288,8 +437,7 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database) subview = new_subview_ticktime(timeview, i+1, new_color(g,"#282"), 3600*1000); logger_add_view(timelog, subview); - logger_set_filter(timelog, - ticktime_filter(database, "ENB_PHY_DLSCH_UE_ACK", i)); + e->dl_ack_logger[i] = timelog; } /* DL NACK */ for (i = 0; i < 8; i++) { @@ -298,10 +446,9 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database) subview = new_subview_ticktime(timeview, i+1, new_color(g,"#f22"), 3600*1000); logger_add_view(timelog, subview); - logger_set_filter(timelog, - ticktime_filter(database, "ENB_PHY_DLSCH_UE_NACK", i)); + e->dl_nack_logger[i] = timelog; } - /* UL harq pids */ + /* UL DCI/retransmission without DCI */ for (i = 0; i < 8; i++) { /* first transmission */ timelog = new_ticklog(h, database, "ENB_PHY_ULSCH_UE_DCI", @@ -309,17 +456,14 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database) subview = new_subview_ticktime(timeview, i+9+1, new_color(g,"#55f"), 3600*1000); logger_add_view(timelog, subview); - logger_set_filter(timelog, - ticktime_filter(database, "ENB_PHY_ULSCH_UE_DCI", i)); + e->ul_dci_logger[i] = timelog; /* retransmission */ timelog = new_ticklog(h, database, "ENB_PHY_ULSCH_UE_NO_DCI_RETRANSMISSION", "frame", "subframe"); subview = new_subview_ticktime(timeview, i+9+1, new_color(g,"#99f"), 3600*1000); logger_add_view(timelog, subview); - logger_set_filter(timelog, - ticktime_filter(database, - "ENB_PHY_ULSCH_UE_NO_DCI_RETRANSMISSION", i)); + e->ul_dci_retransmission_logger[i] = timelog; } /* UL ACK */ for (i = 0; i < 8; i++) { @@ -328,8 +472,7 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database) subview = new_subview_ticktime(timeview, i+9+1, new_color(g,"#282"), 3600*1000); logger_add_view(timelog, subview); - logger_set_filter(timelog, - ticktime_filter(database, "ENB_PHY_ULSCH_UE_ACK", i)); + e->ul_ack_logger[i] = timelog; } /* UL NACK */ for (i = 0; i < 8; i++) { @@ -338,8 +481,7 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database) subview = new_subview_ticktime(timeview, i+9+1, new_color(g,"#f22"), 3600*1000); logger_add_view(timelog, subview); - logger_set_filter(timelog, - ticktime_filter(database, "ENB_PHY_ULSCH_UE_NACK", i)); + e->ul_nack_logger[i] = timelog; } /* phy/mac/rlc/pdcp/rrc textlog */ @@ -416,6 +558,10 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database) widget_add_child(g, top_container, text, -1); container_set_child_growable(g, top_container, text, 1); e->legacy = new_view_textlist(10000, 10, g, text); + + set_current_ue(g, ed, 0); + register_notifier(g, "click", e->prev_ue_button, click, ed); + register_notifier(g, "click", e->next_ue_button, click, ed); } void view_add_log(view *v, char *log, event_handler *h, void *database, @@ -495,7 +641,11 @@ int main(int n, char **v) g = gui_init(); new_thread(gui_thread, g); - enb_main_gui(&eg, g, h, database); + enb_data.ue = 0; + enb_data.e = ⪚ + enb_data.database = database; + + enb_main_gui(&eg, g, h, database, &enb_data); for (i = 0; i < number_of_events; i++) { logger *textlog; @@ -525,9 +675,9 @@ int main(int n, char **v) on_off(database, "ENB_PHY_PUCCH_1_ENERGY", is_on, 1); on_off(database, "ENB_PHY_PUCCH_1AB_IQ", is_on, 1); - on_off(database, "LEGACY_RRC_INFO", is_on, 1); - on_off(database, "LEGACY_RRC_ERROR", is_on, 1); - on_off(database, "LEGACY_RRC_WARNING", is_on, 1); + on_off(database, "LEGACY_GROUP_INFO", is_on, 1); + on_off(database, "LEGACY_GROUP_ERROR", is_on, 1); + on_off(database, "LEGACY_GROUP_WARNING", is_on, 1); view_add_log(eg.phyview, "ENB_PHY_DLSCH_UE_DCI", h, database, is_on); view_add_log(eg.phyview, "ENB_PHY_DLSCH_UE_ACK", h, database, is_on); @@ -639,7 +789,9 @@ restart: event e; e = get_event(enb_data.socket, v, database); if (e.type == -1) goto restart; + if (pthread_mutex_lock(&enb_data.lock)) abort(); handle_event(h, e); + if (pthread_mutex_unlock(&enb_data.lock)) abort(); } return 0; diff --git a/common/utils/T/tracer/filter/filter.c b/common/utils/T/tracer/filter/filter.c index b09b01259d91bf96dd8d886aee433000897d909c..d26dc2500058a091e9ce1ba49a0739f437db5b86 100644 --- a/common/utils/T/tracer/filter/filter.c +++ b/common/utils/T/tracer/filter/filter.c @@ -13,6 +13,7 @@ struct filter { } v; int (*eval)(struct filter *this, event e); + void (*free)(struct filter *this); }; /****************************************************************************/ @@ -52,7 +53,23 @@ int eval_evarg(struct filter *f, event e) } /****************************************************************************/ -/* filter construction functions */ +/* free memory functions */ +/****************************************************************************/ + +void free_op2(struct filter *f) +{ + free_filter(f->v.op2.a); + free_filter(f->v.op2.b); + free(f); +} + +void free_noop(struct filter *f) +{ + free(f); +} + +/****************************************************************************/ +/* filter construction/destruction functions */ /****************************************************************************/ filter *filter_and(filter *a, filter *b) @@ -60,6 +77,7 @@ filter *filter_and(filter *a, filter *b) struct filter *ret = calloc(1, sizeof(struct filter)); if (ret == NULL) abort(); ret->eval = eval_and; + ret->free = free_op2; ret->v.op2.a = a; ret->v.op2.b = b; return ret; @@ -70,6 +88,7 @@ filter *filter_eq(filter *a, filter *b) struct filter *ret = calloc(1, sizeof(struct filter)); if (ret == NULL) abort(); ret->eval = eval_eq; + ret->free = free_op2; ret->v.op2.a = a; ret->v.op2.b = b; return ret; @@ -80,6 +99,7 @@ filter *filter_int(int v) struct filter *ret = calloc(1, sizeof(struct filter)); if (ret == NULL) abort(); ret->eval = eval_int; + ret->free = free_noop; ret->v.v = v; return ret; } @@ -97,6 +117,7 @@ filter *filter_evarg(void *database, char *event_name, char *varname) f = get_format(database, event_id); ret->eval = eval_evarg; + ret->free = free_noop; ret->v.evarg.event_type = event_id; ret->v.evarg.arg_index = -1; @@ -114,6 +135,14 @@ filter *filter_evarg(void *database, char *event_name, char *varname) return ret; } +void free_filter(filter *_f) +{ + struct filter *f; + if (_f == NULL) return; + f = _f; + f->free(f); +} + /****************************************************************************/ /* eval function */ /****************************************************************************/ diff --git a/common/utils/T/tracer/filter/filter.h b/common/utils/T/tracer/filter/filter.h index eba02d7fb7f9975709c60f167c267c1c3ce43c6b..d45e0bdd86e8537a23dead4960c54c12e0d0b543 100644 --- a/common/utils/T/tracer/filter/filter.h +++ b/common/utils/T/tracer/filter/filter.h @@ -12,4 +12,6 @@ filter *filter_evarg(void *database, char *event_name, char *varname); int filter_eval(filter *f, event e); +void free_filter(filter *f); + #endif /* _FILTER_H_ */ diff --git a/common/utils/T/tracer/gui/Makefile b/common/utils/T/tracer/gui/Makefile index 53f2077eaccb2ae7aab01ee1ff5c5635cd207395..2edec111d74760a06acc440a97a19d31fb44e538 100644 --- a/common/utils/T/tracer/gui/Makefile +++ b/common/utils/T/tracer/gui/Makefile @@ -2,8 +2,8 @@ CC=gcc CFLAGS=-Wall -g -pthread -I/usr/include/X11/Xft -I/usr/include/freetype2 OBJS=init.o loop.o toplevel_window.o x.o container.o widget.o \ - gui.o label.o event.o xy_plot.o textlist.o notify.o positioner.o \ - timeline.o space.o image.o + gui.o label.o textarea.o event.o xy_plot.o textlist.o notify.o \ + positioner.o timeline.o space.o image.o gui.a: $(OBJS) ar cr gui.a $(OBJS) diff --git a/common/utils/T/tracer/gui/gui.h b/common/utils/T/tracer/gui/gui.h index 27e6603042fa24d928933031d822609b5115f084..0fb96db325798e77de38bee3af2fa9b1e62f9e7d 100644 --- a/common/utils/T/tracer/gui/gui.h +++ b/common/utils/T/tracer/gui/gui.h @@ -14,6 +14,10 @@ typedef void widget; #define DEFAULT_FONT 0 +/* tic type for XY plot */ +#define XY_PLOT_DEFAULT_TICK 0 +#define XY_PLOT_SCROLL_TICK 1 + /* key modifiers */ #define KEY_SHIFT (1<<0) #define KEY_CONTROL (1<<1) @@ -30,6 +34,7 @@ widget *new_toplevel_window(gui *gui, int width, int height, char *title); widget *new_container(gui *gui, int vertical); widget *new_positioner(gui *gui); widget *new_label(gui *gui, const char *text); +widget *new_textarea(gui *gui, int width, int height, int maxsize); widget *new_xy_plot(gui *gui, int width, int height, char *label, int vruler_width); widget *new_textlist(gui *gui, int width, int nlines, int background_color); @@ -39,6 +44,9 @@ widget *new_space(gui *gui, int width, int height); widget *new_image(gui *gui, unsigned char *data, int length); void label_set_clickable(gui *gui, widget *label, int clickable); +void label_set_text(gui *gui, widget *label, char *text); + +void textarea_set_text(gui *gui, widget *textarea, char *text); void container_set_child_growable(gui *_gui, widget *_this, widget *child, int growable); @@ -49,6 +57,8 @@ void xy_plot_set_range(gui *gui, widget *this, void xy_plot_set_points(gui *gui, widget *this, int plot, int npoints, float *x, float *y); void xy_plot_get_dimensions(gui *gui, widget *this, int *width, int *height); +void xy_plot_set_title(gui *gui, widget *this, char *label); +void xy_plot_set_tick_type(gui *gui, widget *this, int type); void textlist_add(gui *gui, widget *this, const char *text, int position, int color); diff --git a/common/utils/T/tracer/gui/gui_defs.h b/common/utils/T/tracer/gui/gui_defs.h index ec72bb0e2bb14e8951f8bf7e5d3acda960109de8..88b8121ec9591b461d59ba1ae7c87f9deaa79d39 100644 --- a/common/utils/T/tracer/gui/gui_defs.h +++ b/common/utils/T/tracer/gui/gui_defs.h @@ -31,7 +31,7 @@ extern int volatile gui_logd; enum widget_type { TOPLEVEL_WINDOW, CONTAINER, POSITIONER, TEXT_LIST, XY_PLOT, BUTTON, LABEL, - TIMELINE, SPACE, IMAGE + TEXTAREA, TIMELINE, SPACE, IMAGE }; struct widget_list; @@ -117,6 +117,7 @@ struct xy_plot_widget { int wanted_height; struct xy_plot_plot *plots; int nplots; + int tick_type; }; struct timeline_subline { @@ -141,13 +142,24 @@ struct button_widget { struct label_widget { struct widget common; - const char *t; + char *t; int color; int width; /* as given by the graphic's backend */ int height; /* as given by the graphic's backend */ int baseline; /* as given by the graphic's backend */ }; +struct textarea_widget { + struct widget common; + char *t; + int tmaxsize; + int color; + int wanted_width; + int wanted_height; + int baseline; /* as given by the graphic's backend */ + int text_width; /* as given by the graphic's backend */ +}; + struct space_widget { struct widget common; int wanted_width; diff --git a/common/utils/T/tracer/gui/label.c b/common/utils/T/tracer/gui/label.c index f649fa520147cb1bde0099bd9bab2f1330813423..02efabfaf30d8ce58d62c02d9b7b88063bc836ce 100644 --- a/common/utils/T/tracer/gui/label.c +++ b/common/utils/T/tracer/gui/label.c @@ -81,3 +81,21 @@ void label_set_clickable(gui *_g, widget *_this, int clickable) gunlock(g); } + +void label_set_text(gui *_g, widget *_this, char *text) +{ + struct gui *g = _g; + struct label_widget *this = _this; + + glock(g); + + free(this->t); + this->t = strdup(text); if (this->t == NULL) OOM; + + x_text_get_dimensions(g->x, DEFAULT_FONT, text, + &this->width, &this->height, &this->baseline); + + send_event(g, REPACK, this->common.id); + + gunlock(g); +} diff --git a/common/utils/T/tracer/gui/textarea.c b/common/utils/T/tracer/gui/textarea.c new file mode 100644 index 0000000000000000000000000000000000000000..da84f850ca6a6d865761db27647658f0b469eacf --- /dev/null +++ b/common/utils/T/tracer/gui/textarea.c @@ -0,0 +1,83 @@ +#include "gui.h" +#include "gui_defs.h" +#include "x.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +static void paint(gui *_gui, widget *_w) +{ + struct gui *g = _gui; + struct textarea_widget *t = _w; + LOGD("PAINT textarea '%s'\n", t->t); + x_fill_rectangle(g->x, g->xwin, BACKGROUND_COLOR, + t->common.x, t->common.y, + t->common.width, t->common.height); + x_draw_clipped_string(g->x, g->xwin, DEFAULT_FONT, t->color, + t->common.x + t->common.width - t->text_width, + t->common.y + t->baseline, t->t, + t->common.x, t->common.y, + t->common.width, t->common.height); +} + +static void hints(gui *_gui, widget *_w, int *width, int *height) +{ + struct textarea_widget *t = _w; + LOGD("HINTS textarea '%s'\n", t->t); + *width = t->wanted_width; + *height = t->wanted_height; +} + +widget *new_textarea(gui *_gui, int width, int height, int maxsize) +{ + struct gui *g = _gui; + struct textarea_widget *w; + int _; + + glock(g); + + w = new_widget(g, TEXTAREA, sizeof(struct textarea_widget)); + + w->t = calloc(maxsize, 1); + if (w->t == NULL) OOM; + w->tmaxsize = maxsize; + w->wanted_width = width; + w->wanted_height = height; + w->color = FOREGROUND_COLOR; + w->text_width = 0; + + x_text_get_dimensions(g->x, DEFAULT_FONT, "jlM", + &_, &_, &w->baseline); + + w->common.paint = paint; + w->common.hints = hints; + + gunlock(g); + + return w; +} + +/*************************************************************************/ +/* public functions */ +/*************************************************************************/ + +void textarea_set_text(gui *_g, widget *_this, char *text) +{ + struct gui *g = _g; + struct textarea_widget *this = _this; + int _; + int len = strlen(text); + if (len >= this->tmaxsize) { + fprintf(stderr, "ERROR: string '%s' too big for textarea\n", text); + return; + } + + glock(g); + + strcpy(this->t, text); + x_text_get_dimensions(g->x, DEFAULT_FONT, text, + &this->text_width, &_, &this->baseline); + send_event(g, DIRTY, this->common.id); + + gunlock(g); +} diff --git a/common/utils/T/tracer/gui/widget.c b/common/utils/T/tracer/gui/widget.c index 362d2e1e4898c39960033fe206518d902a3ba897..b8ccba6d54ff40afd04ddf6c5f86a02a197f9d47 100644 --- a/common/utils/T/tracer/gui/widget.c +++ b/common/utils/T/tracer/gui/widget.c @@ -265,7 +265,7 @@ void widget_dirty(gui *_gui, widget *_this) static const char *names[] = { "TOPLEVEL_WINDOW", "CONTAINER", "POSITIONER", "TEXT_LIST", - "XY_PLOT", "BUTTON", "LABEL", "TIMELINE", "SPACE", "IMAGE" + "XY_PLOT", "BUTTON", "LABEL", "TEXTAREA", "TIMELINE", "SPACE", "IMAGE" }; const char *widget_name(enum widget_type type) { @@ -277,6 +277,7 @@ const char *widget_name(enum widget_type type) case XY_PLOT: case BUTTON: case LABEL: + case TEXTAREA: case TIMELINE: case SPACE: case IMAGE: diff --git a/common/utils/T/tracer/gui/xy_plot.c b/common/utils/T/tracer/gui/xy_plot.c index 7d20a027a155524481d6aab45c2ada8361b83180..4115f92103adca50bad18cd022dce6cbbc6b2680 100644 --- a/common/utils/T/tracer/gui/xy_plot.c +++ b/common/utils/T/tracer/gui/xy_plot.c @@ -1,11 +1,20 @@ #include "gui.h" #include "gui_defs.h" #include "x.h" +#include "../utils.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> +#if 0 +/* this version behaves differently when you resize the XY plot. Say + * you increase the size. The old (smaller) view is put at the center + * of the new view. Everything inside keeps the same size/aspect ratio. + * The other version below resizes the old view so that it fully occupies + * the new view. It may introduce aspect ratio changes, but usage seems + * to suggest it's a better behaviour. + */ static void paint(gui *_gui, widget *_this) { struct gui *g = _gui; @@ -70,9 +79,9 @@ static void paint(gui *_gui, widget *_this) */ char v[64]; int vwidth, dummy; - float x = (k * ticstep - allocated_xmin) / - (allocated_xmax - allocated_xmin) * - (allocated_plot_width - 1); + int x = (k * ticstep - allocated_xmin) / + (allocated_xmax - allocated_xmin) * + (allocated_plot_width - 1); x_draw_line(g->x, g->xwin, FOREGROUND_COLOR, this->common.x + this->vrule_width + x, this->common.y + this->common.height - this->label_height * 2, @@ -85,7 +94,7 @@ static void paint(gui *_gui, widget *_this) this->common.y + this->common.height - this->label_height * 2 + this->label_baseline, v); - LOGD("tic k %d val %g x %g\n", k, k * ticstep, x); + LOGD("tic k %d val %g x %d\n", k, k * ticstep, x); } /* vertical tics */ @@ -112,9 +121,9 @@ static void paint(gui *_gui, widget *_this) for (k = kmin; k <= kmax; k++) { char v[64]; int vwidth, dummy; - float y = (k * ticstep - allocated_ymin) / - (allocated_ymax - allocated_ymin) * - (allocated_plot_height - 1); + int y = (k * ticstep - allocated_ymin) / + (allocated_ymax - allocated_ymin) * + (allocated_plot_height - 1); sprintf(v, "%g", k * ticstep); x_text_get_dimensions(g->x, DEFAULT_FONT, v, &vwidth, &dummy, &dummy); x_draw_line(g->x, g->xwin, FOREGROUND_COLOR, @@ -155,6 +164,184 @@ static void paint(gui *_gui, widget *_this) x_plot_points(g->x, g->xwin, this->plots[n].color); } } +#endif + +static void paint(gui *_gui, widget *_this) +{ + struct gui *g = _gui; + struct xy_plot_widget *this = _this; + int allocated_plot_width; + int allocated_plot_height; + float pxsize; + float ticdist; + float tic; + float ticstep; + int k, kmin, kmax; + float allocated_xmin, allocated_xmax; + float allocated_ymin, allocated_ymax; + int i; + int n; + char v[64]; + int vwidth, dummy; + +# define FLIP(v) (-(v) + allocated_plot_height-1) + + LOGD("PAINT xy plot xywh %d %d %d %d\n", this->common.x, this->common.y, this->common.width, this->common.height); + +//x_draw_rectangle(g->x, g->xwin, 1, this->common.x, this->common.y, this->common.width, this->common.height); + + allocated_plot_width = this->common.width - this->vrule_width; + allocated_plot_height = this->common.height - this->label_height * 2; + + if (allocated_plot_width <= 1 || allocated_plot_height <= 1) { + WARN("PAINT xy plot: width (%d) or height (%d) is wrong, not painting\n", + this->common.width, this->common.height); + return; + } + + /* plot zone */ + /* TODO: refine height - height of hrule text may be != from label */ + x_draw_rectangle(g->x, g->xwin, 1, + this->common.x + this->vrule_width, + this->common.y, + this->common.width - this->vrule_width -1, /* -1 to see right border */ + this->common.height - this->label_height * 2); + + /* horizontal tics */ + pxsize = (this->xmax - this->xmin) / allocated_plot_width; + ticdist = 100; + tic = floor(log10(ticdist * pxsize)); + ticstep = powf(10, tic); + allocated_xmin = this->xmin; + allocated_xmax = this->xmax; + /* adjust tic if too tight */ + LOGD("pre x ticstep %g\n", ticstep); + while (1) { + if (ticstep / (allocated_xmax - allocated_xmin) + * (allocated_plot_width - 1) > 40) break; + ticstep *= 2; + } + LOGD("post x ticstep %g\n", ticstep); + LOGD("xmin/max %g %g width allocated %d alloc xmin/max %g %g ticstep %g\n", this->xmin, this->xmax, allocated_plot_width, allocated_xmin, allocated_xmax, ticstep); + kmin = ceil(allocated_xmin / ticstep); + kmax = floor(allocated_xmax / ticstep); + for (k = kmin; k <= kmax; k++) { +/* + (k * ticstep - allocated_xmin) / (allocated_max - allocated_xmin) = + (x - 0) / (allocated_plot_width-1 - 0) + */ + int x = (k * ticstep - allocated_xmin) / + (allocated_xmax - allocated_xmin) * + (allocated_plot_width - 1); + int px; + x_draw_line(g->x, g->xwin, FOREGROUND_COLOR, + this->common.x + this->vrule_width + x, + this->common.y + this->common.height - this->label_height * 2, + this->common.x + this->vrule_width + x, + this->common.y + this->common.height - this->label_height * 2 - 5); + sprintf(v, "%g", k * ticstep); + x_text_get_dimensions(g->x, DEFAULT_FONT, v, &vwidth, &dummy, &dummy); + + /* do not draw after the widget ('width-1' for if we use 'width' + * it is still off by 1 pixel for whatever reason) */ + px = this->vrule_width + x - vwidth/2; + if (px + vwidth > this->common.width-1) + px = this->common.width-1 - vwidth; + + x_draw_string(g->x, g->xwin, DEFAULT_FONT, FOREGROUND_COLOR, + this->common.x + px, + this->common.y + this->common.height - this->label_height * 2 + + this->label_baseline, + v); + LOGD("tic k %d val %g x %d\n", k, k * ticstep, x); + } + + /* vertical tics */ + allocated_ymin = this->ymin; + allocated_ymax = this->ymax; + switch (this->tick_type) { + case XY_PLOT_DEFAULT_TICK: + pxsize = (this->ymax - this->ymin) / allocated_plot_height; + ticdist = 30; + tic = floor(log10(ticdist * pxsize)); + ticstep = powf(10, tic); + /* adjust tic if too tight */ + LOGD("pre y ticstep %g\n", ticstep); + while (1) { + if (ticstep / (allocated_ymax - allocated_ymin) + * (allocated_plot_height - 1) > 20) break; + ticstep *= 2; + } + LOGD("post y ticstep %g\n", ticstep); + LOGD("ymin/max %g %g height allocated %d alloc " + "ymin/max %g %g ticstep %g\n", this->ymin, this->ymax, + allocated_plot_height, allocated_ymin, allocated_ymax, ticstep); + kmin = ceil(allocated_ymin / ticstep); + kmax = floor(allocated_ymax / ticstep); + for (k = kmin; k <= kmax; k++) { + int y = (k * ticstep - allocated_ymin) / + (allocated_ymax - allocated_ymin) * + (allocated_plot_height - 1); + sprintf(v, "%g", k * ticstep); + x_text_get_dimensions(g->x, DEFAULT_FONT, v, &vwidth, &dummy, &dummy); + x_draw_line(g->x, g->xwin, FOREGROUND_COLOR, + this->common.x + this->vrule_width, + this->common.y + FLIP(y), + this->common.x + this->vrule_width + 5, + this->common.y + FLIP(y)); + x_draw_string(g->x, g->xwin, DEFAULT_FONT, FOREGROUND_COLOR, + this->common.x + this->vrule_width - vwidth - 2, + this->common.y + FLIP(y)-this->label_height/2+this->label_baseline, + v); + } + break; + case XY_PLOT_SCROLL_TICK: + /* print only max value, formatted using 'bps' for readability */ + bps(v, this->ymax, ""); + x_text_get_dimensions(g->x, DEFAULT_FONT, v, &vwidth, &dummy, &dummy); + x_draw_string(g->x, g->xwin, DEFAULT_FONT, FOREGROUND_COLOR, + this->common.x + this->vrule_width - vwidth - 2, + this->common.y + +this->label_baseline, + v); + /* vertically divide into 5 */ + for (k = 1; k < 5; k++) { + int y = round((k * (allocated_plot_height - 1)) / 5.); + x_draw_line(g->x, g->xwin, FOREGROUND_COLOR, + this->common.x + this->vrule_width, + this->common.y + y, + this->common.x + this->vrule_width + 5, + this->common.y + y); + } + break; + } /* swich (this->tick_type) */ + + /* label at bottom, in the middle */ + x_draw_string(g->x, g->xwin, DEFAULT_FONT, FOREGROUND_COLOR, + this->common.x + (this->common.width - this->label_width) / 2, + this->common.y + this->common.height - this->label_height + + this->label_baseline, + this->label); + + for (n = 0; n < this->nplots; n++) { + /* points */ + float ax, bx, ay, by; + ax = (allocated_plot_width-1) / (allocated_xmax - allocated_xmin); + bx = -ax * allocated_xmin; + ay = (allocated_plot_height-1) / (allocated_ymax - allocated_ymin); + by = -ay * allocated_ymin; + for (i = 0; i < this->plots[n].npoints; i++) { + int x, y; + x = ax * this->plots[n].x[i] + bx; + y = ay * this->plots[n].y[i] + by; + if (x >= 0 && x < allocated_plot_width && + y >= 0 && y < allocated_plot_height) + x_add_point(g->x, + this->common.x + this->vrule_width + x, + this->common.y + FLIP(y)); + } + x_plot_points(g->x, g->xwin, this->plots[n].color); + } +} static void hints(gui *_gui, widget *_w, int *width, int *height) { @@ -191,6 +378,7 @@ widget *new_xy_plot(gui *_gui, int width, int height, char *label, w->ymax = 1; w->plots = NULL; w->nplots = 0; + w->tick_type = XY_PLOT_DEFAULT_TICK; w->common.paint = paint; w->common.hints = hints; @@ -290,3 +478,36 @@ void xy_plot_get_dimensions(gui *_gui, widget *_this, int *width, int *height) gunlock(g); } + +void xy_plot_set_title(gui *_gui, widget *_this, char *label) +{ + struct gui *g = _gui; + struct xy_plot_widget *this = _this; + + glock(g); + + free(this->label); + this->label = strdup(label); if (this->label == NULL) OOM; + /* TODO: be sure calling X there is valid wrt "global model" (we are + * not in the "gui thread") */ + x_text_get_dimensions(g->x, DEFAULT_FONT, label, + &this->label_width, &this->label_height, &this->label_baseline); + + send_event(g, REPACK, this->common.id); + + gunlock(g); +} + +void xy_plot_set_tick_type(gui *_gui, widget *_this, int type) +{ + struct gui *g = _gui; + struct xy_plot_widget *this = _this; + + glock(g); + + this->tick_type = type; + + send_event(g, DIRTY, this->common.id); + + gunlock(g); +} diff --git a/common/utils/T/tracer/logger/Makefile b/common/utils/T/tracer/logger/Makefile index 92431739dba89d44104bc8c509daec7ea479af2b..28f0e0b81392158e45ed5a8e472369f6a099e1ed 100644 --- a/common/utils/T/tracer/logger/Makefile +++ b/common/utils/T/tracer/logger/Makefile @@ -2,7 +2,7 @@ CC=gcc CFLAGS=-Wall -g -pthread -I.. OBJS=logger.o textlog.o framelog.o ttilog.o timelog.o ticklog.o iqlog.o \ - iqdotlog.o + iqdotlog.o ticked_ttilog.o throughputlog.o logger.a: $(OBJS) ar cr logger.a $(OBJS) diff --git a/common/utils/T/tracer/logger/logger.c b/common/utils/T/tracer/logger/logger.c index ab6fb8bc625e97bc0f5b7ea848a8c25c422b463e..ffba2d25c02a3777f1868fa919b81605021577fa 100644 --- a/common/utils/T/tracer/logger/logger.c +++ b/common/utils/T/tracer/logger/logger.c @@ -1,5 +1,6 @@ #include "logger.h" #include "logger_defs.h" +#include "filter/filter.h" #include <stdlib.h> void logger_add_view(logger *_l, view *v) @@ -13,5 +14,6 @@ void logger_add_view(logger *_l, view *v) void logger_set_filter(logger *_l, void *filter) { struct logger *l = _l; + free_filter(l->filter); l->filter = filter; } diff --git a/common/utils/T/tracer/logger/logger.h b/common/utils/T/tracer/logger/logger.h index b2ab4f8cbcd09367d30ffa74a0d16891f83b4264..434cf5a90fee02a4c97d33ddcab26e5f484b193c 100644 --- a/common/utils/T/tracer/logger/logger.h +++ b/common/utils/T/tracer/logger/logger.h @@ -10,6 +10,13 @@ logger *new_textlog(void *event_handler, void *database, logger *new_ttilog(void *event_handler, void *database, char *event_name, char *frame_varname, char *subframe_varname, char *data_varname, int convert_to_dB); +logger *new_ticked_ttilog(void *event_handler, void *database, + char *tick_event_name, char *frame_varname, char *subframe_varname, + char *event_name, char *data_varname, + int convert_to_dB, float empty_value); +logger *new_throughputlog(void *event_handler, void *database, + char *tick_event_name, char *frame_varname, char *subframe_varname, + char *event_name, char *data_varname); logger *new_timelog(void *event_handler, void *database, char *event_name); logger *new_ticklog(void *event_handler, void *database, char *event_name, char *frame_name, char *subframe_name); @@ -28,5 +35,6 @@ void textlog_dump_buffer(logger *_this, int dump_buffer); void logger_add_view(logger *l, view *v); void logger_set_filter(logger *l, void *filter); +void ticked_ttilog_set_tick_filter(logger *l, void *filter); #endif /* _LOGGER_H_ */ diff --git a/common/utils/T/tracer/logger/throughputlog.c b/common/utils/T/tracer/logger/throughputlog.c new file mode 100644 index 0000000000000000000000000000000000000000..8a2d46da916cac4a2dbaa1928a9fbaf3e458a7a3 --- /dev/null +++ b/common/utils/T/tracer/logger/throughputlog.c @@ -0,0 +1,194 @@ +#include "logger.h" +#include "logger_defs.h" +#include "event.h" +#include "database.h" +#include "handler.h" +#include "filter/filter.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <math.h> + +struct throughputlog { + struct logger common; + void *database; + int tick_frame_arg; + int tick_subframe_arg; + int data_frame_arg; + int data_subframe_arg; + int data_arg; + int last_tick_frame; + int last_tick_subframe; + unsigned long bits[1000]; + unsigned long total; + int insert_point; + char *tick_event_name; + unsigned long tick_handler_id; + /* tick filter - NULL is no filter set */ + void *tick_filter; +}; + +static void _event(void *p, event e) +{ + struct throughputlog *l = p; + int frame; + int subframe; + unsigned long value; + + if (l->common.filter != NULL && filter_eval(l->common.filter, e) == 0) + return; + + frame = e.e[l->data_frame_arg].i; + subframe = e.e[l->data_subframe_arg].i; + + if (frame != l->last_tick_frame || subframe != l->last_tick_subframe) { + printf("WARNING: %s:%d: data comes without previous tick!\n", + __FILE__, __LINE__); + return; + } + + switch (e.e[l->data_arg].type) { + case EVENT_INT: value = e.e[l->data_arg].i; break; + case EVENT_ULONG: value = e.e[l->data_arg].ul; break; + default: printf("%s:%d: unsupported type\n", __FILE__, __LINE__); abort(); + } + + l->total += value; + l->bits[l->insert_point] += value; +} + +static void _tick_event(void *p, event e) +{ + struct throughputlog *l = p; + int i; + int frame; + int subframe; + + if (l->tick_filter != NULL && filter_eval(l->tick_filter, e) == 0) + return; + + frame = e.e[l->tick_frame_arg].i; + subframe = e.e[l->tick_subframe_arg].i; + + for (i = 0; i < l->common.vsize; i++) + l->common.v[i]->append(l->common.v[i], frame, subframe, (double)l->total); + + l->insert_point = (l->insert_point + 1) % 1000; + l->total -= l->bits[l->insert_point]; + l->bits[l->insert_point] = 0; + + l->last_tick_frame = frame; + l->last_tick_subframe = subframe; +} + +logger *new_throughputlog(event_handler *h, void *database, + char *tick_event_name, char *frame_varname, char *subframe_varname, + char *event_name, char *data_varname) +{ + struct throughputlog *ret; + int event_id; + database_event_format f; + int i; + + ret = calloc(1, sizeof(struct throughputlog)); if (ret == NULL) abort(); + + ret->common.event_name = strdup(event_name); + if (ret->common.event_name == NULL) abort(); + ret->database = database; + + ret->tick_event_name = strdup(tick_event_name); + if (ret->tick_event_name == NULL) abort(); + + /* tick event */ + event_id = event_id_from_name(database, tick_event_name); + + ret->tick_handler_id=register_handler_function(h,event_id,_tick_event,ret); + + f = get_format(database, event_id); + + /* look for frame and subframe */ + ret->tick_frame_arg = -1; + ret->tick_subframe_arg = -1; + for (i = 0; i < f.count; i++) { + if (!strcmp(f.name[i], frame_varname)) ret->tick_frame_arg = i; + if (!strcmp(f.name[i], subframe_varname)) ret->tick_subframe_arg = i; + } + if (ret->tick_frame_arg == -1) { + printf("%s:%d: frame argument '%s' not found in event '%s'\n", + __FILE__, __LINE__, frame_varname, event_name); + abort(); + } + if (ret->tick_subframe_arg == -1) { + printf("%s:%d: subframe argument '%s' not found in event '%s'\n", + __FILE__, __LINE__, subframe_varname, event_name); + abort(); + } + if (strcmp(f.type[ret->tick_frame_arg], "int") != 0) { + printf("%s:%d: argument '%s' has wrong type (should be 'int')\n", + __FILE__, __LINE__, frame_varname); + abort(); + } + if (strcmp(f.type[ret->tick_subframe_arg], "int") != 0) { + printf("%s:%d: argument '%s' has wrong type (should be 'int')\n", + __FILE__, __LINE__, subframe_varname); + abort(); + } + + /* data event */ + event_id = event_id_from_name(database, event_name); + + ret->common.handler_id = register_handler_function(h,event_id,_event,ret); + + f = get_format(database, event_id); + + /* look for frame, subframe and data args */ + ret->data_frame_arg = -1; + ret->data_subframe_arg = -1; + ret->data_arg = -1; + for (i = 0; i < f.count; i++) { + if (!strcmp(f.name[i], frame_varname)) ret->data_frame_arg = i; + if (!strcmp(f.name[i], subframe_varname)) ret->data_subframe_arg = i; + if (!strcmp(f.name[i], data_varname)) ret->data_arg = i; + } + if (ret->data_frame_arg == -1) { + printf("%s:%d: frame argument '%s' not found in event '%s'\n", + __FILE__, __LINE__, frame_varname, event_name); + abort(); + } + if (ret->data_subframe_arg == -1) { + printf("%s:%d: subframe argument '%s' not found in event '%s'\n", + __FILE__, __LINE__, subframe_varname, event_name); + abort(); + } + if (ret->data_arg == -1) { + printf("%s:%d: data argument '%s' not found in event '%s'\n", + __FILE__, __LINE__, data_varname, event_name); + abort(); + } + if (strcmp(f.type[ret->data_frame_arg], "int") != 0) { + printf("%s:%d: argument '%s' has wrong type (should be 'int')\n", + __FILE__, __LINE__, frame_varname); + abort(); + } + if (strcmp(f.type[ret->data_subframe_arg], "int") != 0) { + printf("%s:%d: argument '%s' has wrong type (should be 'int')\n", + __FILE__, __LINE__, subframe_varname); + abort(); + } + if (strcmp(f.type[ret->data_arg], "int") != 0 && + strcmp(f.type[ret->data_arg], "float") != 0) { + printf("%s:%d: argument '%s' has wrong type" + " (should be 'int' or 'float')\n", + __FILE__, __LINE__, data_varname); + abort(); + } + + return ret; +} + +void throughputlog_set_tick_filter(logger *_l, void *filter) +{ + struct throughputlog *l = (struct throughputlog *)_l; + free(l->tick_filter); + l->tick_filter = filter; +} diff --git a/common/utils/T/tracer/logger/ticked_ttilog.c b/common/utils/T/tracer/logger/ticked_ttilog.c new file mode 100644 index 0000000000000000000000000000000000000000..53bbad768166a623b31108085f1655595b580682 --- /dev/null +++ b/common/utils/T/tracer/logger/ticked_ttilog.c @@ -0,0 +1,196 @@ +#include "logger.h" +#include "logger_defs.h" +#include "event.h" +#include "database.h" +#include "handler.h" +#include "filter/filter.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <math.h> + +struct ticked_ttilog { + struct logger common; + void *database; + int tick_frame_arg; + int tick_subframe_arg; + int data_frame_arg; + int data_subframe_arg; + int data_arg; + int convert_to_dB; + int last_tick_frame; + int last_tick_subframe; + float last_value; + float empty_value; + char *tick_event_name; + unsigned long tick_handler_id; + /* tick filter - NULL is no filter set */ + void *tick_filter; +}; + +static void _event(void *p, event e) +{ + struct ticked_ttilog *l = p; + int frame; + int subframe; + float value; + + if (l->common.filter != NULL && filter_eval(l->common.filter, e) == 0) + return; + + frame = e.e[l->data_frame_arg].i; + subframe = e.e[l->data_subframe_arg].i; + + if (frame != l->last_tick_frame || subframe != l->last_tick_subframe) { + printf("WARNING: %s:%d: data comes without previous tick!\n", + __FILE__, __LINE__); + return; + } + + switch (e.e[l->data_arg].type) { + case EVENT_INT: value = e.e[l->data_arg].i; break; + case EVENT_ULONG: value = e.e[l->data_arg].ul; break; + default: printf("%s:%d: unsupported type\n", __FILE__, __LINE__); abort(); + } + + if (l->convert_to_dB) value = 10 * log10(value); + + l->last_value = value; +} + +static void _tick_event(void *p, event e) +{ + struct ticked_ttilog *l = p; + int i; + int frame; + int subframe; + + if (l->tick_filter != NULL && filter_eval(l->tick_filter, e) == 0) + return; + + frame = e.e[l->tick_frame_arg].i; + subframe = e.e[l->tick_subframe_arg].i; + + for (i = 0; i < l->common.vsize; i++) + l->common.v[i]->append(l->common.v[i], frame, subframe, l->last_value); + + l->last_value = l->empty_value; + l->last_tick_frame = frame; + l->last_tick_subframe = subframe; +} + +logger *new_ticked_ttilog(event_handler *h, void *database, + char *tick_event_name, char *frame_varname, char *subframe_varname, + char *event_name, char *data_varname, + int convert_to_dB, float empty_value) +{ + struct ticked_ttilog *ret; + int event_id; + database_event_format f; + int i; + + ret = calloc(1, sizeof(struct ticked_ttilog)); if (ret == NULL) abort(); + + ret->common.event_name = strdup(event_name); + if (ret->common.event_name == NULL) abort(); + ret->database = database; + ret->convert_to_dB = convert_to_dB; + + ret->tick_event_name = strdup(tick_event_name); + if (ret->tick_event_name == NULL) abort(); + ret->empty_value = empty_value; + ret->last_value = empty_value; + + /* tick event */ + event_id = event_id_from_name(database, tick_event_name); + + ret->tick_handler_id=register_handler_function(h,event_id,_tick_event,ret); + + f = get_format(database, event_id); + + /* look for frame and subframe */ + ret->tick_frame_arg = -1; + ret->tick_subframe_arg = -1; + for (i = 0; i < f.count; i++) { + if (!strcmp(f.name[i], frame_varname)) ret->tick_frame_arg = i; + if (!strcmp(f.name[i], subframe_varname)) ret->tick_subframe_arg = i; + } + if (ret->tick_frame_arg == -1) { + printf("%s:%d: frame argument '%s' not found in event '%s'\n", + __FILE__, __LINE__, frame_varname, event_name); + abort(); + } + if (ret->tick_subframe_arg == -1) { + printf("%s:%d: subframe argument '%s' not found in event '%s'\n", + __FILE__, __LINE__, subframe_varname, event_name); + abort(); + } + if (strcmp(f.type[ret->tick_frame_arg], "int") != 0) { + printf("%s:%d: argument '%s' has wrong type (should be 'int')\n", + __FILE__, __LINE__, frame_varname); + abort(); + } + if (strcmp(f.type[ret->tick_subframe_arg], "int") != 0) { + printf("%s:%d: argument '%s' has wrong type (should be 'int')\n", + __FILE__, __LINE__, subframe_varname); + abort(); + } + + /* data event */ + event_id = event_id_from_name(database, event_name); + + ret->common.handler_id = register_handler_function(h,event_id,_event,ret); + + f = get_format(database, event_id); + + /* look for frame, subframe and data args */ + ret->data_frame_arg = -1; + ret->data_subframe_arg = -1; + ret->data_arg = -1; + for (i = 0; i < f.count; i++) { + if (!strcmp(f.name[i], frame_varname)) ret->data_frame_arg = i; + if (!strcmp(f.name[i], subframe_varname)) ret->data_subframe_arg = i; + if (!strcmp(f.name[i], data_varname)) ret->data_arg = i; + } + if (ret->data_frame_arg == -1) { + printf("%s:%d: frame argument '%s' not found in event '%s'\n", + __FILE__, __LINE__, frame_varname, event_name); + abort(); + } + if (ret->data_subframe_arg == -1) { + printf("%s:%d: subframe argument '%s' not found in event '%s'\n", + __FILE__, __LINE__, subframe_varname, event_name); + abort(); + } + if (ret->data_arg == -1) { + printf("%s:%d: data argument '%s' not found in event '%s'\n", + __FILE__, __LINE__, data_varname, event_name); + abort(); + } + if (strcmp(f.type[ret->data_frame_arg], "int") != 0) { + printf("%s:%d: argument '%s' has wrong type (should be 'int')\n", + __FILE__, __LINE__, frame_varname); + abort(); + } + if (strcmp(f.type[ret->data_subframe_arg], "int") != 0) { + printf("%s:%d: argument '%s' has wrong type (should be 'int')\n", + __FILE__, __LINE__, subframe_varname); + abort(); + } + if (strcmp(f.type[ret->data_arg], "int") != 0 && + strcmp(f.type[ret->data_arg], "float") != 0) { + printf("%s:%d: argument '%s' has wrong type" + " (should be 'int' or 'float')\n", + __FILE__, __LINE__, data_varname); + abort(); + } + + return ret; +} + +void ticked_ttilog_set_tick_filter(logger *_l, void *filter) +{ + struct ticked_ttilog *l = (struct ticked_ttilog *)_l; + free(l->tick_filter); + l->tick_filter = filter; +} diff --git a/common/utils/T/tracer/macpdu2wireshark.c b/common/utils/T/tracer/macpdu2wireshark.c index 886638f5ef2c6774045395cc593e20cbd12a50a9..be0bbd382142bf82f171401bac34f91a7e4d4f67 100644 --- a/common/utils/T/tracer/macpdu2wireshark.c +++ b/common/utils/T/tracer/macpdu2wireshark.c @@ -177,7 +177,7 @@ void usage(void) printf( "options:\n" " -d <database file> this option is mandatory\n" -" -in <dump file> read events from this dump file\n" +" -i <dump file> read events from this dump file\n" " -ip <IP address> send packets to this IP address (default %s)\n" " -p <port> send packets to this port (default %d)\n", DEFAULT_IP, @@ -205,7 +205,7 @@ int main(int n, char **v) if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage(); if (!strcmp(v[i], "-d")) { if (i > n-2) usage(); database_filename = v[++i]; continue; } - if (!strcmp(v[i], "-in")) + if (!strcmp(v[i], "-i")) { if (i > n-2) usage(); input_filename = v[++i]; continue; } if (!strcmp(v[i], "-ip")) { if (i > n-2) usage(); ip = v[++i]; continue; } if (!strcmp(v[i], "-p")) {if(i>n-2)usage(); port=atoi(v[++i]); continue; } diff --git a/common/utils/T/tracer/utils.c b/common/utils/T/tracer/utils.c index a22e0a0565dabecfa928d2bd6d4c7c5df6c72553..507154673538a4570c058f1af5ecf4db8771871d 100644 --- a/common/utils/T/tracer/utils.c +++ b/common/utils/T/tracer/utils.c @@ -7,6 +7,7 @@ #include <ctype.h> #include <netinet/in.h> #include <arpa/inet.h> +#include <math.h> void new_thread(void *(*f)(void *), void *data) { @@ -36,6 +37,16 @@ void sleepms(int ms) if (nanosleep(&t, NULL)) abort(); } +void bps(char *out, float v, char *suffix) +{ + static char *bps_unit[4] = { "", "k", "M", "G" }; + int flog; + if (v < 1000) flog = 0; else flog = floor(floor(log10(v)) / 3); + if (flog > 3) flog = 3; + v /= pow(10, flog*3); + sprintf(out, "%g%s%s", round(v*100)/100, bps_unit[flog], suffix); +} + /****************************************************************************/ /* list */ /****************************************************************************/ diff --git a/common/utils/T/tracer/utils.h b/common/utils/T/tracer/utils.h index 086e92b5dcb4cb0e2fd6476132a815b3b018ba6a..3be6cfe1a7f67af65282d7494c7d1a172fc163d7 100644 --- a/common/utils/T/tracer/utils.h +++ b/common/utils/T/tracer/utils.h @@ -3,6 +3,7 @@ void new_thread(void *(*f)(void *), void *data); void sleepms(int ms); +void bps(char *out, float v, char *suffix); /****************************************************************************/ /* list */ diff --git a/common/utils/T/tracer/view/Makefile b/common/utils/T/tracer/view/Makefile index 32b267ec24d60c25bf1650e5b60250579c6be871..370c317e66244490aaef303eeeccefe827d6c0d7 100644 --- a/common/utils/T/tracer/view/Makefile +++ b/common/utils/T/tracer/view/Makefile @@ -1,7 +1,7 @@ CC=gcc CFLAGS=-Wall -g -pthread -I.. -I../logger -OBJS=stdout.o textlist.o xy.o tti.o time.o ticktime.o +OBJS=stdout.o textlist.o xy.o tti.o time.o ticktime.o scrolltti.o view.a: $(OBJS) ar cr view.a $(OBJS) diff --git a/common/utils/T/tracer/view/scrolltti.c b/common/utils/T/tracer/view/scrolltti.c new file mode 100644 index 0000000000000000000000000000000000000000..ad83cbc7569b3dc2e80db092483297284bb1aad5 --- /dev/null +++ b/common/utils/T/tracer/view/scrolltti.c @@ -0,0 +1,100 @@ +#include "view.h" +#include "../utils.h" +#include <stdio.h> +#include <stdlib.h> +#include <pthread.h> +#include <stdarg.h> +#include <string.h> +#include <math.h> + +struct scrolltti { + view common; + gui *g; + widget *w; + widget *throughput_textarea; + int plot; + float refresh_rate; + pthread_mutex_t lock; + unsigned long data[1000]; + unsigned long total; /* sum data[0..999] to have smoother value printed */ + float xout[1000]; + float yout[1000]; + int insert_point; +}; + +/* this array is used to get Y range 1000, 2000, 5000, 10000, ... */ +static int tolog[11] = { -1, 1, 2, 5, 5, 5, 10, 10, 10, 10, 10 }; + +static void *scrolltti_thread(void *_this) +{ + struct scrolltti *this = _this; + int i; + int p; + float max, mlog; + char o[64]; + + while (1) { + if (pthread_mutex_lock(&this->lock)) abort(); + /* TODO: optimize */ + p = this->insert_point; + max = 0; + for (i = 0; i < 1000; i++) { + this->xout[i] = i; + this->yout[i] = this->data[p]; + if (this->data[p] > max) max = this->data[p]; + p = (p + 1) % 1000; + } + bps(o, this->total/1000., "b/s"); + textarea_set_text(this->g, this->throughput_textarea, o); + /* for Y range we want 1000, 2000, 5000, 10000, 20000, 50000, etc. */ + if (max < 1000) max = 1000; + mlog = pow(10, floor(log10(max))); + max = tolog[(int)ceil(max/mlog)] * mlog; + xy_plot_set_range(this->g, this->w, 0, 1000, 0, max); + xy_plot_set_points(this->g, this->w, this->plot, + 1000, this->xout, this->yout); + if (pthread_mutex_unlock(&this->lock)) abort(); + sleepms(1000/this->refresh_rate); + } + + return 0; +} + +static void clear(view *this) +{ + /* TODO */ +} + +static void append(view *_this, int frame, int subframe, double value) +{ + struct scrolltti *this = (struct scrolltti *)_this; + + if (pthread_mutex_lock(&this->lock)) abort(); + this->total -= this->data[this->insert_point]; + this->data[this->insert_point] = value; + this->total += this->data[this->insert_point]; + this->insert_point = (this->insert_point + 1) % 1000; + if (pthread_mutex_unlock(&this->lock)) abort(); +} + +view *new_view_scrolltti(float refresh_rate, gui *g, widget *w, int color, + widget *throughput_textarea) +{ + struct scrolltti *ret = calloc(1, sizeof(struct scrolltti)); + if (ret == NULL) abort(); + + ret->common.clear = clear; + ret->common.append = (void (*)(view *, ...))append; + + ret->refresh_rate = refresh_rate; + ret->g = g; + ret->w = w; + ret->throughput_textarea = throughput_textarea; + ret->plot = xy_plot_new_plot(g, w, color); + + if (pthread_mutex_init(&ret->lock, NULL)) abort(); + + new_thread(scrolltti_thread, ret); + + return (view *)ret; +} diff --git a/common/utils/T/tracer/view/view.h b/common/utils/T/tracer/view/view.h index 2173c842ce956929945ef1e38662f64e90e0dcc2..8167a00ccdb0d7e5ac1a9157ed04f66885034129 100644 --- a/common/utils/T/tracer/view/view.h +++ b/common/utils/T/tracer/view/view.h @@ -19,6 +19,8 @@ view *new_view_xy(int length, float refresh_rate, gui *g, widget *w, int color, enum xy_mode mode); view *new_view_tti(float refresh_rate, gui *g, widget *w, int color); +view *new_view_scrolltti(float refresh_rate, gui *g, widget *w, + int color, widget *throughput_label); view *new_view_time(int number_of_seconds, float refresh_rate, gui *g, widget *w); view *new_subview_time(view *time, int line, int color, int size); diff --git a/common/utils/collection/tree.h b/common/utils/collection/tree.h index 8e4e35c408c5a3945447caae1beabea6f34ad2b9..c9df686fbb135d17c24a8e2ad72ebd75e9ada647 100755 --- a/common/utils/collection/tree.h +++ b/common/utils/collection/tree.h @@ -1,4 +1,8 @@ -/* +/* $NetBSD: tree.h,v 1.8 2004/03/28 19:38:30 provos Exp $ */ +/* $OpenBSD: tree.h,v 1.7 2002/10/17 21:51:54 art Exp $ */ +/* $FreeBSD$ */ + +/*- * Copyright 2002 Niels Provos <provos@citi.umich.edu> * All rights reserved. * @@ -26,6 +30,8 @@ #ifndef _SYS_TREE_H_ #define _SYS_TREE_H_ +#include <sys/cdefs.h> + /* * This file defines data structures for different types of trees: * splay trees and red-black trees. @@ -63,7 +69,7 @@ struct name { \ #define SPLAY_INIT(root) do { \ (root)->sph_root = NULL; \ -} while (0) +} while (/*CONSTCOND*/ 0) #define SPLAY_ENTRY(type) \ struct { \ @@ -81,32 +87,32 @@ struct { \ SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(tmp, field); \ SPLAY_RIGHT(tmp, field) = (head)->sph_root; \ (head)->sph_root = tmp; \ -} while (0) +} while (/*CONSTCOND*/ 0) #define SPLAY_ROTATE_LEFT(head, tmp, field) do { \ SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(tmp, field); \ SPLAY_LEFT(tmp, field) = (head)->sph_root; \ (head)->sph_root = tmp; \ -} while (0) +} while (/*CONSTCOND*/ 0) #define SPLAY_LINKLEFT(head, tmp, field) do { \ SPLAY_LEFT(tmp, field) = (head)->sph_root; \ tmp = (head)->sph_root; \ (head)->sph_root = SPLAY_LEFT((head)->sph_root, field); \ -} while (0) +} while (/*CONSTCOND*/ 0) #define SPLAY_LINKRIGHT(head, tmp, field) do { \ SPLAY_RIGHT(tmp, field) = (head)->sph_root; \ tmp = (head)->sph_root; \ (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field); \ -} while (0) +} while (/*CONSTCOND*/ 0) #define SPLAY_ASSEMBLE(head, node, left, right, field) do { \ SPLAY_RIGHT(left, field) = SPLAY_LEFT((head)->sph_root, field); \ SPLAY_LEFT(right, field) = SPLAY_RIGHT((head)->sph_root, field);\ SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(node, field); \ SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(node, field); \ -} while (0) +} while (/*CONSTCOND*/ 0) /* Generates prototypes and inline functions */ @@ -207,7 +213,7 @@ name##_SPLAY(struct name *head, struct type *elm) \ SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;\ __left = __right = &__node; \ \ - while ((__comp = (cmp)(elm, (head)->sph_root))) { \ + while ((__comp = (cmp)(elm, (head)->sph_root)) != 0) { \ if (__comp < 0) { \ __tmp = SPLAY_LEFT((head)->sph_root, field); \ if (__tmp == NULL) \ @@ -286,7 +292,7 @@ void name##_SPLAY_MINMAX(struct name *head, int __comp) \ (x) != NULL; \ (x) = SPLAY_NEXT(name, head, x)) -/* Macros that define a red-back tree */ +/* Macros that define a red-black tree */ #define RB_HEAD(name, type) \ struct name { \ struct type *rbh_root; /* root of the tree */ \ @@ -297,7 +303,7 @@ struct name { \ #define RB_INIT(root) do { \ (root)->rbh_root = NULL; \ -} while (0) +} while (/*CONSTCOND*/ 0) #define RB_BLACK 0 #define RB_RED 1 @@ -320,24 +326,24 @@ struct { \ RB_PARENT(elm, field) = parent; \ RB_LEFT(elm, field) = RB_RIGHT(elm, field) = NULL; \ RB_COLOR(elm, field) = RB_RED; \ -} while (0) +} while (/*CONSTCOND*/ 0) #define RB_SET_BLACKRED(black, red, field) do { \ RB_COLOR(black, field) = RB_BLACK; \ RB_COLOR(red, field) = RB_RED; \ -} while (0) +} while (/*CONSTCOND*/ 0) #ifndef RB_AUGMENT -#define RB_AUGMENT(x) +#define RB_AUGMENT(x) do {} while (0) #endif #define RB_ROTATE_LEFT(head, elm, tmp, field) do { \ (tmp) = RB_RIGHT(elm, field); \ - if ((RB_RIGHT(elm, field) = RB_LEFT(tmp, field))) { \ + if ((RB_RIGHT(elm, field) = RB_LEFT(tmp, field)) != NULL) { \ RB_PARENT(RB_LEFT(tmp, field), field) = (elm); \ } \ RB_AUGMENT(elm); \ - if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field))) { \ + if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) { \ if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \ RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \ else \ @@ -349,15 +355,15 @@ struct { \ RB_AUGMENT(tmp); \ if ((RB_PARENT(tmp, field))) \ RB_AUGMENT(RB_PARENT(tmp, field)); \ -} while (0) +} while (/*CONSTCOND*/ 0) #define RB_ROTATE_RIGHT(head, elm, tmp, field) do { \ (tmp) = RB_LEFT(elm, field); \ - if ((RB_LEFT(elm, field) = RB_RIGHT(tmp, field))) { \ + if ((RB_LEFT(elm, field) = RB_RIGHT(tmp, field)) != NULL) { \ RB_PARENT(RB_RIGHT(tmp, field), field) = (elm); \ } \ RB_AUGMENT(elm); \ - if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field))) { \ + if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) { \ if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \ RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \ else \ @@ -369,28 +375,66 @@ struct { \ RB_AUGMENT(tmp); \ if ((RB_PARENT(tmp, field))) \ RB_AUGMENT(RB_PARENT(tmp, field)); \ -} while (0) +} while (/*CONSTCOND*/ 0) /* Generates prototypes and inline functions */ -#define RB_PROTOTYPE(name, type, field, cmp) \ -void name##_RB_INSERT_COLOR(struct name *, struct type *); \ -void name##_RB_REMOVE_COLOR(struct name *, struct type *, struct type *);\ -struct type *name##_RB_REMOVE(struct name *, struct type *); \ -struct type *name##_RB_INSERT(struct name *, struct type *); \ -struct type *name##_RB_FIND(struct name *, struct type *); \ -struct type *name##_RB_NEXT(struct type *); \ -struct type *name##_RB_MINMAX(struct name *, int); \ - \ +#define RB_PROTOTYPE(name, type, field, cmp) \ + RB_PROTOTYPE_INTERNAL(name, type, field, cmp,) +#define RB_PROTOTYPE_STATIC(name, type, field, cmp) \ + RB_PROTOTYPE_INTERNAL(name, type, field, cmp, __unused static) +#define RB_PROTOTYPE_INTERNAL(name, type, field, cmp, attr) \ + RB_PROTOTYPE_INSERT_COLOR(name, type, attr); \ + RB_PROTOTYPE_REMOVE_COLOR(name, type, attr); \ + RB_PROTOTYPE_INSERT(name, type, attr); \ + RB_PROTOTYPE_REMOVE(name, type, attr); \ + RB_PROTOTYPE_FIND(name, type, attr); \ + RB_PROTOTYPE_NFIND(name, type, attr); \ + RB_PROTOTYPE_NEXT(name, type, attr); \ + RB_PROTOTYPE_PREV(name, type, attr); \ + RB_PROTOTYPE_MINMAX(name, type, attr); +#define RB_PROTOTYPE_INSERT_COLOR(name, type, attr) \ + attr void name##_RB_INSERT_COLOR(struct name *, struct type *) +#define RB_PROTOTYPE_REMOVE_COLOR(name, type, attr) \ + attr void name##_RB_REMOVE_COLOR(struct name *, struct type *, struct type *) +#define RB_PROTOTYPE_REMOVE(name, type, attr) \ + attr struct type *name##_RB_REMOVE(struct name *, struct type *) +#define RB_PROTOTYPE_INSERT(name, type, attr) \ + attr struct type *name##_RB_INSERT(struct name *, struct type *) +#define RB_PROTOTYPE_FIND(name, type, attr) \ + attr struct type *name##_RB_FIND(struct name *, struct type *) +#define RB_PROTOTYPE_NFIND(name, type, attr) \ + attr struct type *name##_RB_NFIND(struct name *, struct type *) +#define RB_PROTOTYPE_NEXT(name, type, attr) \ + attr struct type *name##_RB_NEXT(struct type *) +#define RB_PROTOTYPE_PREV(name, type, attr) \ + attr struct type *name##_RB_PREV(struct type *) +#define RB_PROTOTYPE_MINMAX(name, type, attr) \ + attr struct type *name##_RB_MINMAX(struct name *, int) /* Main rb operation. * Moves node close to the key of elm to top */ -#define RB_GENERATE(name, type, field, cmp) \ -void \ +#define RB_GENERATE(name, type, field, cmp) \ + RB_GENERATE_INTERNAL(name, type, field, cmp,) +#define RB_GENERATE_STATIC(name, type, field, cmp) \ + RB_GENERATE_INTERNAL(name, type, field, cmp, __unused static) +#define RB_GENERATE_INTERNAL(name, type, field, cmp, attr) \ + RB_GENERATE_INSERT_COLOR(name, type, field, attr) \ + RB_GENERATE_REMOVE_COLOR(name, type, field, attr) \ + RB_GENERATE_INSERT(name, type, field, cmp, attr) \ + RB_GENERATE_REMOVE(name, type, field, attr) \ + RB_GENERATE_FIND(name, type, field, cmp, attr) \ + RB_GENERATE_NFIND(name, type, field, cmp, attr) \ + RB_GENERATE_NEXT(name, type, field, attr) \ + RB_GENERATE_PREV(name, type, field, attr) \ + RB_GENERATE_MINMAX(name, type, field, attr) + +#define RB_GENERATE_INSERT_COLOR(name, type, field, attr) \ +attr void \ name##_RB_INSERT_COLOR(struct name *head, struct type *elm) \ { \ struct type *parent, *gparent, *tmp; \ - while ((parent = RB_PARENT(elm, field)) && \ + while ((parent = RB_PARENT(elm, field)) != NULL && \ RB_COLOR(parent, field) == RB_RED) { \ gparent = RB_PARENT(parent, field); \ if (parent == RB_LEFT(gparent, field)) { \ @@ -428,9 +472,10 @@ name##_RB_INSERT_COLOR(struct name *head, struct type *elm) \ } \ } \ RB_COLOR(head->rbh_root, field) = RB_BLACK; \ -} \ - \ -void \ +} + +#define RB_GENERATE_REMOVE_COLOR(name, type, field, attr) \ +attr void \ name##_RB_REMOVE_COLOR(struct name *head, struct type *parent, struct type *elm) \ { \ struct type *tmp; \ @@ -454,7 +499,8 @@ name##_RB_REMOVE_COLOR(struct name *head, struct type *parent, struct type *elm) if (RB_RIGHT(tmp, field) == NULL || \ RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK) {\ struct type *oleft; \ - if ((oleft = RB_LEFT(tmp, field)))\ + if ((oleft = RB_LEFT(tmp, field)) \ + != NULL) \ RB_COLOR(oleft, field) = RB_BLACK;\ RB_COLOR(tmp, field) = RB_RED; \ RB_ROTATE_RIGHT(head, tmp, oleft, field);\ @@ -486,7 +532,8 @@ name##_RB_REMOVE_COLOR(struct name *head, struct type *parent, struct type *elm) if (RB_LEFT(tmp, field) == NULL || \ RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) {\ struct type *oright; \ - if ((oright = RB_RIGHT(tmp, field)))\ + if ((oright = RB_RIGHT(tmp, field)) \ + != NULL) \ RB_COLOR(oright, field) = RB_BLACK;\ RB_COLOR(tmp, field) = RB_RED; \ RB_ROTATE_LEFT(head, tmp, oright, field);\ @@ -504,9 +551,10 @@ name##_RB_REMOVE_COLOR(struct name *head, struct type *parent, struct type *elm) } \ if (elm) \ RB_COLOR(elm, field) = RB_BLACK; \ -} \ - \ -struct type * \ +} + +#define RB_GENERATE_REMOVE(name, type, field, attr) \ +attr struct type * \ name##_RB_REMOVE(struct name *head, struct type *elm) \ { \ struct type *child, *parent, *old = elm; \ @@ -518,7 +566,7 @@ name##_RB_REMOVE(struct name *head, struct type *elm) \ else { \ struct type *left; \ elm = RB_RIGHT(elm, field); \ - while ((left = RB_LEFT(elm, field))) \ + while ((left = RB_LEFT(elm, field)) != NULL) \ elm = left; \ child = RB_RIGHT(elm, field); \ parent = RB_PARENT(elm, field); \ @@ -551,7 +599,7 @@ name##_RB_REMOVE(struct name *head, struct type *elm) \ left = parent; \ do { \ RB_AUGMENT(left); \ - } while ((left = RB_PARENT(left, field))); \ + } while ((left = RB_PARENT(left, field)) != NULL); \ } \ goto color; \ } \ @@ -572,9 +620,10 @@ color: \ name##_RB_REMOVE_COLOR(head, parent, child); \ return (old); \ } \ - \ + +#define RB_GENERATE_INSERT(name, type, field, cmp, attr) \ /* Inserts a node into the RB tree */ \ -struct type * \ +attr struct type * \ name##_RB_INSERT(struct name *head, struct type *elm) \ { \ struct type *tmp; \ @@ -599,15 +648,14 @@ name##_RB_INSERT(struct name *head, struct type *elm) \ RB_RIGHT(parent, field) = elm; \ RB_AUGMENT(parent); \ } else \ - { \ RB_ROOT(head) = elm; \ - } \ name##_RB_INSERT_COLOR(head, elm); \ return (NULL); \ -} \ - \ +} + +#define RB_GENERATE_FIND(name, type, field, cmp, attr) \ /* Finds the node with the same key as elm */ \ -struct type * \ +attr struct type * \ name##_RB_FIND(struct name *head, struct type *elm) \ { \ struct type *tmp = RB_ROOT(head); \ @@ -622,9 +670,33 @@ name##_RB_FIND(struct name *head, struct type *elm) \ return (tmp); \ } \ return (NULL); \ -} \ - \ -struct type * \ +} + +#define RB_GENERATE_NFIND(name, type, field, cmp, attr) \ +/* Finds the first node greater than or equal to the search key */ \ +attr struct type * \ +name##_RB_NFIND(struct name *head, struct type *elm) \ +{ \ + struct type *tmp = RB_ROOT(head); \ + struct type *res = NULL; \ + int comp; \ + while (tmp) { \ + comp = cmp(elm, tmp); \ + if (comp < 0) { \ + res = tmp; \ + tmp = RB_LEFT(tmp, field); \ + } \ + else if (comp > 0) \ + tmp = RB_RIGHT(tmp, field); \ + else \ + return (tmp); \ + } \ + return (res); \ +} + +#define RB_GENERATE_NEXT(name, type, field, attr) \ +/* ARGSUSED */ \ +attr struct type * \ name##_RB_NEXT(struct type *elm) \ { \ if (RB_RIGHT(elm, field)) { \ @@ -643,9 +715,33 @@ name##_RB_NEXT(struct type *elm) \ } \ } \ return (elm); \ -} \ - \ -struct type * \ +} + +#define RB_GENERATE_PREV(name, type, field, attr) \ +/* ARGSUSED */ \ +attr struct type * \ +name##_RB_PREV(struct type *elm) \ +{ \ + if (RB_LEFT(elm, field)) { \ + elm = RB_LEFT(elm, field); \ + while (RB_RIGHT(elm, field)) \ + elm = RB_RIGHT(elm, field); \ + } else { \ + if (RB_PARENT(elm, field) && \ + (elm == RB_RIGHT(RB_PARENT(elm, field), field))) \ + elm = RB_PARENT(elm, field); \ + else { \ + while (RB_PARENT(elm, field) && \ + (elm == RB_LEFT(RB_PARENT(elm, field), field)))\ + elm = RB_PARENT(elm, field); \ + elm = RB_PARENT(elm, field); \ + } \ + } \ + return (elm); \ +} + +#define RB_GENERATE_MINMAX(name, type, field, attr) \ +attr struct type * \ name##_RB_MINMAX(struct name *head, int val) \ { \ struct type *tmp = RB_ROOT(head); \ @@ -666,7 +762,9 @@ name##_RB_MINMAX(struct name *head, int val) \ #define RB_INSERT(name, x, y) name##_RB_INSERT(x, y) #define RB_REMOVE(name, x, y) name##_RB_REMOVE(x, y) #define RB_FIND(name, x, y) name##_RB_FIND(x, y) +#define RB_NFIND(name, x, y) name##_RB_NFIND(x, y) #define RB_NEXT(name, x, y) name##_RB_NEXT(y) +#define RB_PREV(name, x, y) name##_RB_PREV(y) #define RB_MIN(name, x) name##_RB_MINMAX(x, RB_NEGINF) #define RB_MAX(name, x) name##_RB_MINMAX(x, RB_INF) @@ -675,4 +773,29 @@ name##_RB_MINMAX(struct name *head, int val) \ (x) != NULL; \ (x) = name##_RB_NEXT(x)) +#define RB_FOREACH_FROM(x, name, y) \ + for ((x) = (y); \ + ((x) != NULL) && ((y) = name##_RB_NEXT(x), (x) != NULL); \ + (x) = (y)) + +#define RB_FOREACH_SAFE(x, name, head, y) \ + for ((x) = RB_MIN(name, head); \ + ((x) != NULL) && ((y) = name##_RB_NEXT(x), (x) != NULL); \ + (x) = (y)) + +#define RB_FOREACH_REVERSE(x, name, head) \ + for ((x) = RB_MAX(name, head); \ + (x) != NULL; \ + (x) = name##_RB_PREV(x)) + +#define RB_FOREACH_REVERSE_FROM(x, name, y) \ + for ((x) = (y); \ + ((x) != NULL) && ((y) = name##_RB_PREV(x), (x) != NULL); \ + (x) = (y)) + +#define RB_FOREACH_REVERSE_SAFE(x, name, head, y) \ + for ((x) = RB_MAX(name, head); \ + ((x) != NULL) && ((y) = name##_RB_PREV(x), (x) != NULL); \ + (x) = (y)) + #endif /* _SYS_TREE_H_ */ diff --git a/common/utils/itti/timer.c b/common/utils/itti/timer.c index 5486c76d83e14c444309274aebc3187fcd55667a..c180cfcda40d8fea03c785061530ab0d7eabc983 100644 --- a/common/utils/itti/timer.c +++ b/common/utils/itti/timer.c @@ -86,8 +86,8 @@ int timer_handle_signal(siginfo_t *info) timer_p = (struct timer_elm_s *)info->si_ptr; // LG: To many traces for msc timer: - // TMR_DEBUG("Timer with id 0x%lx has expired\n", (long)timer_p->timer); - + TMR_DEBUG("Timer with id 0x%lx has expired\n", (long)timer_p->timer); + task_id = timer_p->task_id; instance = timer_p->instance; message_p = itti_alloc_new_message(TASK_TIMER, TIMER_HAS_EXPIRED); @@ -120,6 +120,10 @@ int timer_handle_signal(siginfo_t *info) return -1; } +#if defined(ENB_AGENT_SB_IF) + +#endif + return 0; } diff --git a/maketags b/maketags index 4dff87bf765f082cd58fafc5b4252367ee34fd45..361adc5d67eed32c67bc41ab1d59eb946aded209 100755 --- a/maketags +++ b/maketags @@ -1,3 +1,4 @@ #!/bin/sh echo "building ctags for openair1 and openair2 ..." ctags -e -R --exclude=openair1/DOCS/ --exclude=openair2/DOCS/ --exclude=openair2/RRC/CELLULAR/ --exclude=openair2/NAS/DRIVER/CELLULAR/ --exclude=openair2/SIMULATION/ --exclude=targets/DOCS/ --exclude=targets/PROJECTS/ openair1 openair2 openair3 targets cmake_targets common + diff --git a/openair1/PHY/INIT/defs.h b/openair1/PHY/INIT/defs.h index 1874c4e8c7d85d9417381869cd998e0674cc2e26..2b65bebc8d41d2954bcc8815849d53aeb07b3c9f 100644 --- a/openair1/PHY/INIT/defs.h +++ b/openair1/PHY/INIT/defs.h @@ -206,7 +206,19 @@ void phy_config_dedicated_ue(module_id_t Mod_id, uint8_t CH_index, struct PhysicalConfigDedicated *physicalConfigDedicated); +/*! +\fn void phy_config_harq_ue(module_id_t Mod_id,uint8_t CC_id,uint8_t CH_index, + uint16_t max_harq_tx) +\brief Configure UE UL max harq Tx. +\details Invoked upon reception of RRCConnectionSetup or RRCConnectionReconfiguration from eNB. +@param Mod_id Instance ID for eNB +@param CC_id Component Carrier index +@param CH_index Index of eNB for this configuration +@param max_harq_tx max harq tx information + */ +void phy_config_harq_ue(module_id_t Mod_id,int CC_id,uint8_t CH_index, + uint16_t max_harq_tx); /** \brief Configure UE MBSFN common parameters. \details Invoked upon reception of SIB13 from eNB. diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index 3fcc37f6bd145fa017184a13c48c304023cd08aa..c10e4dd3c14d082cc92d54271bc2998d3cb492a4 100644 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -483,7 +483,7 @@ void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *eNB) } if (physicalConfigDedicated->soundingRS_UL_ConfigDedicated) { - if (physicalConfigDedicated->soundingRS_UL_ConfigDedicated->present == SchedulingRequestConfig_PR_setup) { + if (physicalConfigDedicated->soundingRS_UL_ConfigDedicated->present == SoundingRS_UL_ConfigDedicated_PR_setup) { eNB->soundingrs_ul_config_dedicated[UE_id].duration = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.duration; eNB->soundingrs_ul_config_dedicated[UE_id].cyclicShift = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.cyclicShift; @@ -746,6 +746,14 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id, } #endif +void phy_config_harq_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id, + uint16_t max_harq_tx ) +{ + + PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id][CC_id]; + phy_vars_ue->ulsch[eNB_id]->Mlimit = max_harq_tx; +} + void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id, struct PhysicalConfigDedicated *physicalConfigDedicated ) { @@ -876,7 +884,7 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id, if (physicalConfigDedicated->soundingRS_UL_ConfigDedicated) { phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id].srsConfigDedicatedSetup = 0; - if (physicalConfigDedicated->soundingRS_UL_ConfigDedicated->present == SchedulingRequestConfig_PR_setup) { + if (physicalConfigDedicated->soundingRS_UL_ConfigDedicated->present == SoundingRS_UL_ConfigDedicated_PR_setup) { phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id].srsConfigDedicatedSetup = 1; phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id].duration = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.duration; phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id].cyclicShift = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.cyclicShift; diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 92836ebcf951e134f6998b86e2768c26dc535282..a1c118529adc99bc43b582a4b4ab6e529bc1779e 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -6451,16 +6451,16 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, // ue->Mod_id,harq_pid, // proc->frame_rx, // subframe, - // UE_mac_inst[eNB_id].scheduling_info.maxHARQ_Tx); + // ulsch->Mlimit); //#endif - +/* if (ulsch->harq_processes[harq_pid]->round > 0) // NACK detected on phich { // ulsch->harq_processes[harq_pid]->round++; already done on phich_rx - ulsch->harq_processes[harq_pid] = ulsch->harq_processes[8]; + // ulsch->harq_processes[harq_pid] = ulsch->harq_processes[8]; // LOG_I(PHY," Adaptative retransmission - copy temporary harq Process to current harq process. [harqId %d round %d] \n",harq_pid, ulsch->harq_processes[8]->round); - if (ulsch->harq_processes[harq_pid]->round >= UE_mac_inst[eNB_id].scheduling_info.maxHARQ_Tx) + if (ulsch->harq_processes[harq_pid]->round >= ulsch->Mlimit) //UE_mac_inst[eNB_id].scheduling_info.maxHARQ_Tx) { ulsch->harq_processes[harq_pid]->subframe_scheduling_flag = 0; ulsch->harq_processes[harq_pid]->round = 0; @@ -6479,7 +6479,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, //LOG_I(PHY," [HARQ-UL harqId: %d] Adaptative retransmission NACK ==> subframe_scheduling_flag = %d round: %d\n", harq_pid, ulsch->harq_processes[harq_pid]->subframe_scheduling_flag,ulsch->harq_processes[harq_pid]->round); } } - +*/ } } diff --git a/openair1/PHY/LTE_TRANSPORT/defs.h b/openair1/PHY/LTE_TRANSPORT/defs.h index f8d36d3bd4e08cf6b6d8ac7a93b8ab7e06e903d0..442fd8216704a4f232396495d95ba1b77be93d8b 100644 --- a/openair1/PHY/LTE_TRANSPORT/defs.h +++ b/openair1/PHY/LTE_TRANSPORT/defs.h @@ -283,7 +283,7 @@ typedef struct { /// SRS active flag uint8_t srs_active; /// Pointers to 8 HARQ processes for the ULSCH - LTE_UL_UE_HARQ_t *harq_processes[9]; + LTE_UL_UE_HARQ_t *harq_processes[8]; /// Pointer to CQI data uint8_t o[MAX_CQI_BYTES]; /// Length of CQI data (bits) @@ -346,6 +346,8 @@ typedef struct { uint8_t num_cba_dci[10]; /// allocated CBA RNTI uint16_t cba_rnti[4];//NUM_MAX_CBA_GROUP]; + /// UL max-harq-retransmission + uint8_t Mlimit; } LTE_UE_ULSCH_t; typedef struct { diff --git a/openair1/PHY/LTE_TRANSPORT/phich.c b/openair1/PHY/LTE_TRANSPORT/phich.c index 9a3287660264316dbaa334534beb88a648ff64c3..989567ca3498d075237a8b50982460748ab7cf69 100644 --- a/openair1/PHY/LTE_TRANSPORT/phich.c +++ b/openair1/PHY/LTE_TRANSPORT/phich.c @@ -1381,13 +1381,13 @@ void rx_phich(PHY_VARS_UE *ue, HI16, nseq_PHICH, ngroup_PHICH, - UE_mac_inst[eNB_id].scheduling_info.maxHARQ_Tx); + ulsch->Mlimit); //#endif // ulsch->harq_processes[harq_pid]->Ndi = 0; ulsch->harq_processes[harq_pid]->round++; - if ( ulsch->harq_processes[harq_pid]->round >= (UE_mac_inst[eNB_id].scheduling_info.maxHARQ_Tx - 1) ) + if ( ulsch->harq_processes[harq_pid]->round >= (ulsch->Mlimit - 1) ) { // this is last push re transmission ulsch->harq_processes[harq_pid]->rvidx = rv_table[ulsch->harq_processes[harq_pid]->round&3]; @@ -1402,7 +1402,7 @@ void rx_phich(PHY_VARS_UE *ue, //ulsch->harq_processes[harq_pid]->round = 0; //LOG_I(PHY,"PUSCH MAX Retransmission acheived ==> flush harq buff (%d) \n",harq_pid); - //LOG_I(PHY,"[HARQ-UL harqId: %d] PHICH NACK MAX RETRANS(%d) ==> subframe_scheduling_flag = %d round: %d\n", harq_pid, UE_mac_inst[eNB_id].scheduling_info.maxHARQ_Tx, ulsch->harq_processes[harq_pid]->subframe_scheduling_flag, ulsch->harq_processes[harq_pid]->round); + //LOG_I(PHY,"[HARQ-UL harqId: %d] PHICH NACK MAX RETRANS(%d) ==> subframe_scheduling_flag = %d round: %d\n", harq_pid, ulsch->Mlimit, ulsch->harq_processes[harq_pid]->subframe_scheduling_flag, ulsch->harq_processes[harq_pid]->round); } else { @@ -1441,7 +1441,7 @@ void rx_phich(PHY_VARS_UE *ue, // rely only on DCI0 decoding and check if NDI has toggled // save current harq_processes content in temporary struct // harqId-8 corresponds to the temporary struct. In total we have 8 harq process(0 ..7) + 1 temporary harq process() - ulsch->harq_processes[8] = ulsch->harq_processes[harq_pid]; + //ulsch->harq_processes[8] = ulsch->harq_processes[harq_pid]; ulsch->harq_processes[harq_pid]->subframe_scheduling_flag =0; ulsch->harq_processes[harq_pid]->status = IDLE; diff --git a/openair1/PHY/LTE_TRANSPORT/srs_modulation.c b/openair1/PHY/LTE_TRANSPORT/srs_modulation.c index 15561e6b282c991fbceb6363739cd59c92a66cbc..7e29d998a10e30c49d96ba934d2822d86127fe75 100644 --- a/openair1/PHY/LTE_TRANSPORT/srs_modulation.c +++ b/openair1/PHY/LTE_TRANSPORT/srs_modulation.c @@ -133,7 +133,7 @@ int32_t generate_srs_tx(PHY_VARS_UE *ue, uint16_t msrsb=0,Nb=0,nb,b,msrs0=0,k,Msc_RS,Msc_RS_idx,carrier_pos,symbol_offset; uint16_t *Msc_idx_ptr; int32_t k0; - uint32_t subframe_offset; + //uint32_t subframe_offset; uint8_t Bsrs = soundingrs_ul_config_dedicated->srs_Bandwidth; uint8_t Csrs = frame_parms->soundingrs_ul_config_common.srs_BandwidthConfig; uint8_t Ssrs = frame_parms->soundingrs_ul_config_common.srs_SubframeConfig; diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c index fe4e05747a0b738b223e8ab0fa02bf4971d5541f..4559aaa326bd620137d0e6184db2b0cd222c6757 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c @@ -140,6 +140,8 @@ LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag) if (ulsch) { memset(ulsch,0,sizeof(LTE_UE_ULSCH_t)); + ulsch->Mlimit = 4; + for (i=0; i<8; i++) { ulsch->harq_processes[i] = (LTE_UL_UE_HARQ_t *)malloc16(sizeof(LTE_UL_UE_HARQ_t)); diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index 80dfb69877a157e1f1c56b8b5f816c36752faf00..0ce810a52cfabd7d856bcee07d0f7cfe095abef8 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -449,7 +449,7 @@ int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr int16_t dummy_w[MAX_NUM_ULSCH_SEGMENTS][3*(6144+64)]; LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[UE_id]; LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid]; - int Q_m = get_Qm_ul(ulsch_harq->mcs); + //int Q_m = get_Qm_ul(ulsch_harq->mcs); int G = ulsch_harq->G; unsigned int E; int Cby2; @@ -657,7 +657,7 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag) int16_t dummy_w[MAX_NUM_ULSCH_SEGMENTS][3*(6144+64)]; LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[UE_id]; LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid]; - int Q_m = get_Qm_ul(ulsch_harq->mcs); + //int Q_m = get_Qm_ul(ulsch_harq->mcs); int G = ulsch_harq->G; unsigned int E; @@ -1533,6 +1533,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, // CQI // printf("before cqi c[%d] = %p\n",0,ulsch_harq->c[0]); + ulsch_harq->cqi_crc_status = 0; if (Q_CQI>0) { memset((void *)&dummy_w_cc[0],0,3*(ulsch_harq->Or1+8+32)); @@ -1555,9 +1556,6 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, if (extract_cqi_crc(o_flip,ulsch_harq->Or1) == (crc8(o_flip,ulsch_harq->Or1)>>24)) ulsch_harq->cqi_crc_status = 1; - else - ulsch_harq->cqi_crc_status = 0; - if (ulsch->harq_processes[harq_pid]->Or1<=32) { ulsch_harq->o[3] = o_flip[0] ; diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h index 375efa5feadb524e2f6ac92ec491c931f43f0e8c..0e69265d20ce2fe81b22c98edbcc19bddbe9e0bd 100644 --- a/openair1/PHY/defs.h +++ b/openair1/PHY/defs.h @@ -656,7 +656,7 @@ typedef struct { /// \brief Total gains with bypassed RF gain stage (ExpressMIMO2/Lime) uint32_t rx_gain_byp[4]; /// \brief Current transmit power - int8_t tx_power_dBm[10]; + int16_t tx_power_dBm[10]; /// \brief Total number of REs in current transmission int tx_total_RE[10]; /// \brief Maximum transmit power diff --git a/openair1/SCHED/defs.h b/openair1/SCHED/defs.h index a9031ac4435df4417841465ccb07ccf3738266ca..2490a4035c14cafd2c7c708f24a9e47073a5e569 100644 --- a/openair1/SCHED/defs.h +++ b/openair1/SCHED/defs.h @@ -69,6 +69,11 @@ enum openair_SYNCH_STATUS { openair_SCHED_EXIT }; +enum openair_HARQ_TYPE { + openair_harq_DL = 0, + openair_harq_UL, + openair_harq_RA +}; #define DAQ_AGC_ON 1 #define DAQ_AGC_OFF 0 diff --git a/openair1/SCHED/phy_mac_stub.c b/openair1/SCHED/phy_mac_stub.c index 939023b2c84ea1cdbf87fab0a92b3902ff3968ed..0ac194d051ec596bfec9dd747aa26d6bf6b3a842 100644 --- a/openair1/SCHED/phy_mac_stub.c +++ b/openair1/SCHED/phy_mac_stub.c @@ -70,6 +70,7 @@ void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) case 5: DCI_pdu->Num_common_dci = 1; DCI_pdu->dci_alloc[0].L = 2; + DCI_pdu->dci_alloc[0].firstCCE = 0; DCI_pdu->dci_alloc[0].rnti = SI_RNTI; DCI_pdu->dci_alloc[0].format = format1A; DCI_pdu->dci_alloc[0].ra_flag = 0; @@ -212,6 +213,7 @@ void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) case 7: DCI_pdu->Num_ue_spec_dci = 1; DCI_pdu->dci_alloc[0].L = 2; + DCI_pdu->dci_alloc[0].firstCCE = 0; DCI_pdu->dci_alloc[0].rnti = 0x1235; DCI_pdu->dci_alloc[0].format = format1; DCI_pdu->dci_alloc[0].ra_flag = 0; diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 7ac6e2bf1fe6e7a148df8a1434d633a53807b093..a7d9e73e2f8825ae2be4d93e10ae1974fa31c385 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -21,11 +21,11 @@ /*! \file phy_procedures_lte_eNB.c * \brief Implementation of eNB procedures from 36.213 LTE specifications - * \author R. Knopp, F. Kaltenberger, N. Nikaein + * \author R. Knopp, F. Kaltenberger, N. Nikaein, X. Foukas * \date 2011 * \version 0.1 * \company Eurecom - * \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr,navid.nikaein@eurecom.fr + * \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr,navid.nikaein@eurecom.fr, x.foukas@sms.ed.ac.uk * \note * \warning */ @@ -61,6 +61,14 @@ # include "intertask_interface.h" #endif + +#if defined(FLEXRAN_AGENT_SB_IF) +//Agent-related headers +#include "ENB_APP/flexran_agent_extern.h" +#include "ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.h" +#include "LAYER2/MAC/flexran_agent_mac_proto.h" +#endif + //#define DIAG_PHY #define NS_PER_SLOT 500000 @@ -221,7 +229,7 @@ int8_t find_next_ue_index(PHY_VARS_eNB *eNB) return(-1); } -int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16_t rnti, const int frame, const uint8_t subframe,uint8_t *harq_pid,uint8_t *round,const uint8_t ul_flag) +int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16_t rnti, const int frame, const uint8_t subframe,uint8_t *harq_pid,uint8_t *round,const uint8_t harq_flag) { LTE_eNB_DLSCH_t *DLSCH_ptr; LTE_eNB_ULSCH_t *ULSCH_ptr; @@ -235,9 +243,20 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16 return(-1); } - if (ul_flag == 0) {// this is a DL request + if ((harq_flag == openair_harq_DL) || (harq_flag == openair_harq_RA)) {// this is a DL request + DLSCH_ptr = PHY_vars_eNB_g[Mod_id][CC_id]->dlsch[(uint32_t)UE_id][0]; + if (harq_flag == openair_harq_RA) { + if (DLSCH_ptr->harq_processes[0] != NULL) { + *harq_pid = 0; + *round = DLSCH_ptr->harq_processes[0]->round; + return 0; + } else { + return -1; + } + } + /* let's go synchronous for the moment - maybe we can change at some point */ i = (frame * 10 + subframe) % 8; @@ -760,7 +779,9 @@ void generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC T(T_ENB_PHY_DLSCH_UE_DCI, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(UE_id), T_INT(dci_alloc->rnti), T_INT(dci_alloc->format), - T_INT(eNB->dlsch[(int)UE_id][0]->current_harq_pid)); + T_INT(eNB->dlsch[(int)UE_id][0]->current_harq_pid), + T_INT(eNB->dlsch[(int)UE_id][0]->harq_processes[eNB->dlsch[(int)UE_id][0]->current_harq_pid]->mcs), + T_INT(eNB->dlsch[(int)UE_id][0]->harq_processes[eNB->dlsch[(int)UE_id][0]->current_harq_pid]->TBS)); eNB->dlsch[(uint8_t)UE_id][0]->nCCE[subframe] = dci_alloc->firstCCE; @@ -854,8 +875,12 @@ void generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 1; T(T_ENB_PHY_ULSCH_UE_DCI, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(UE_id), - T_INT(dci_alloc->rnti), T_INT(harq_pid)); - + T_INT(dci_alloc->rnti), T_INT(harq_pid), + T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->mcs), + T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->round), + T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->first_rb), + T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->nb_rb), + T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->TBS)); } void pdsch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t *dlsch1,LTE_eNB_UE_stats *ue_stats,int ra_flag,int num_pdcch_symbols) { @@ -968,6 +993,22 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,LTE_eNB_DLSCH_t *d UE_id, eNB->ulsch[(uint32_t)UE_id]->Msg3_frame, eNB->ulsch[(uint32_t)UE_id]->Msg3_subframe); + + /* TODO: get rid of this hack. The problem is that the eNodeB may + * sometimes wrongly generate PHICH because somewhere 'phich_active' was + * not reset to 0, due to an unidentified reason. When adding this + * resetting here the problem seems to disappear completely. + */ + LOG_D(PHY, "hack: set phich_active to 0 for UE %d fsf %d %d all HARQs\n", UE_id, frame, subframe); + for (i = 0; i < 8; i++) + eNB->ulsch[(uint32_t)UE_id]->harq_processes[i]->phich_active = 0; + + mac_xface->set_msg3_subframe(eNB->Mod_id, eNB->CC_id, frame, subframe, (uint16_t)crnti, + eNB->ulsch[UE_id]->Msg3_frame, eNB->ulsch[UE_id]->Msg3_subframe); + + T(T_ENB_PHY_MSG3_ALLOCATION, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), + T_INT(UE_id), T_INT((uint16_t)crnti), T_INT(1 /* 1 is for initial transmission*/), + T_INT(eNB->ulsch[UE_id]->Msg3_frame), T_INT(eNB->ulsch[UE_id]->Msg3_subframe)); } if (ue_stats) ue_stats->total_TBS_MAC += dlsch_harq->TBS; } @@ -1103,7 +1144,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, #endif - if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)!=SF_DL)) return; + if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)==SF_UL)) return; VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX+offset,1); if (do_meas==1) start_meas(&eNB->phy_proc_tx); @@ -1383,7 +1424,16 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, eNB->dlsch_ra->active = 0; } - + +#if defined(FLEXRAN_AGENT_SB_IF) +#ifndef DISABLE_SF_TRIGGER + //Send subframe trigger to the controller + if (mac_agent_registered[eNB->Mod_id]) { + agent_mac_xface[eNB->Mod_id]->flexran_agent_send_sf_trigger(eNB->Mod_id); + } +#endif +#endif + // Now scan UE specific DLSCH for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) { @@ -1959,6 +2009,9 @@ void prach_procedures(PHY_VARS_eNB *eNB) { preamble_energy_max%10, preamble_delay_list[preamble_max]); + T(T_ENB_PHY_INITIATE_RA_PROCEDURE, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(UE_id), + T_INT(preamble_max), T_INT(preamble_energy_max), T_INT(preamble_delay_list[preamble_max])); + if (eNB->mac_enabled==1) { uint8_t update_TA=4; @@ -1997,11 +2050,11 @@ void prach_procedures(PHY_VARS_eNB *eNB) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,0); } -void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq_pid) { - +void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq_pid) +{ LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; uint8_t SR_payload = 0,*pucch_payload=NULL,pucch_payload0[2]= {0,0},pucch_payload1[2]= {0,0}; - int16_t n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3; + int16_t n1_pucch0 = -1, n1_pucch1 = -1, n1_pucch2 = -1, n1_pucch3 = -1; uint8_t do_SR = 0; uint8_t pucch_sel = 0; int32_t metric0=0,metric1=0,metric0_SR=0; @@ -2012,352 +2065,329 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq if ((eNB->dlsch[UE_id][0]) && (eNB->dlsch[UE_id][0]->rnti>0) && - (eNB->ulsch[UE_id]->harq_processes[harq_pid]->subframe_scheduling_flag==0)) { + (eNB->ulsch[UE_id]->harq_processes[harq_pid]->subframe_scheduling_flag==0)) { // check SR availability do_SR = is_SR_subframe(eNB,proc,UE_id); // do_SR = 0; - + // Now ACK/NAK // First check subframe_tx flag for earlier subframes get_n1_pucch_eNB(eNB, - proc, - UE_id, - &n1_pucch0, - &n1_pucch1, - &n1_pucch2, - &n1_pucch3); - + proc, + UE_id, + &n1_pucch0, + &n1_pucch1, + &n1_pucch2, + &n1_pucch3); + LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d, subframe %d Checking for PUCCH (%d,%d,%d,%d) SR %d\n", - eNB->Mod_id,eNB->dlsch[UE_id][0]->rnti, - frame,subframe, - n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3,do_SR); - + eNB->Mod_id,eNB->dlsch[UE_id][0]->rnti, + frame,subframe, + n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3,do_SR); + if ((n1_pucch0==-1) && (n1_pucch1==-1) && (do_SR==0)) { // no TX PDSCH that have to be checked and no SR for this UE_id } else { // otherwise we have some PUCCH detection to do - + // Null out PUCCH PRBs for noise measurement switch(fp->N_RB_UL) { case 6: - eNB->rb_mask_ul[0] |= (0x1 | (1<<5)); //position 5 - break; + eNB->rb_mask_ul[0] |= (0x1 | (1<<5)); //position 5 + break; case 15: - eNB->rb_mask_ul[0] |= (0x1 | (1<<14)); // position 14 - break; + eNB->rb_mask_ul[0] |= (0x1 | (1<<14)); // position 14 + break; case 25: - eNB->rb_mask_ul[0] |= (0x1 | (1<<24)); // position 24 - break; + eNB->rb_mask_ul[0] |= (0x1 | (1<<24)); // position 24 + break; case 50: - eNB->rb_mask_ul[0] |= 0x1; - eNB->rb_mask_ul[1] |= (1<<17); // position 49 (49-32) - break; + eNB->rb_mask_ul[0] |= 0x1; + eNB->rb_mask_ul[1] |= (1<<17); // position 49 (49-32) + break; case 75: - eNB->rb_mask_ul[0] |= 0x1; - eNB->rb_mask_ul[2] |= (1<<10); // position 74 (74-64) - break; + eNB->rb_mask_ul[0] |= 0x1; + eNB->rb_mask_ul[2] |= (1<<10); // position 74 (74-64) + break; case 100: - eNB->rb_mask_ul[0] |= 0x1; - eNB->rb_mask_ul[3] |= (1<<3); // position 99 (99-96) - break; + eNB->rb_mask_ul[0] |= 0x1; + eNB->rb_mask_ul[3] |= (1<<3); // position 99 (99-96) + break; default: - LOG_E(PHY,"Unknown number for N_RB_UL %d\n",fp->N_RB_UL); - break; + LOG_E(PHY,"Unknown number for N_RB_UL %d\n",fp->N_RB_UL); + break; } - + if (do_SR == 1) { - eNB->UE_stats[UE_id].sr_total++; + eNB->UE_stats[UE_id].sr_total++; - if (eNB->abstraction_flag == 0) - metric0_SR = rx_pucch(eNB, - pucch_format1, - UE_id, - eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex, - 0, // n2_pucch - 0, // shortened format, should be use_srs flag, later - &SR_payload, - frame, - subframe, - PUCCH1_THRES); - + if (eNB->abstraction_flag == 0) { + metric0_SR = rx_pucch(eNB, + pucch_format1, + UE_id, + eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex, + 0, // n2_pucch + 0, // shortened format, should be use_srs flag, later + &SR_payload, + frame, + subframe, + PUCCH1_THRES); + LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking SR is %d (SR n1pucch is %d)\n", + eNB->Mod_id, + eNB->ulsch[UE_id]->rnti, + frame, + subframe, + SR_payload, + eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex); + } #ifdef PHY_ABSTRACTION - else { - metric0_SR = rx_pucch_emul(eNB, - proc, - UE_id, - pucch_format1, - 0, - &SR_payload); - LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking SR (UE SR %d/%d)\n",eNB->Mod_id, - eNB->ulsch[UE_id]->rnti,frame,subframe,SR_payload,eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex); - } - + else { + metric0_SR = rx_pucch_emul(eNB, + proc, + UE_id, + pucch_format1, + 0, + &SR_payload); + LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking SR (UE SR %d/%d)\n",eNB->Mod_id, + eNB->ulsch[UE_id]->rnti,frame,subframe,SR_payload,eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex); + } #endif - - if (SR_payload == 1) { - LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Got SR for PUSCH, transmitting to MAC\n",eNB->Mod_id, - eNB->ulsch[UE_id]->rnti,frame,subframe); - eNB->UE_stats[UE_id].sr_received++; - - if (eNB->first_sr[UE_id] == 1) { // this is the first request for uplink after Connection Setup, so clear HARQ process 0 use for Msg4 - eNB->first_sr[UE_id] = 0; - eNB->dlsch[UE_id][0]->harq_processes[0]->round=0; - eNB->dlsch[UE_id][0]->harq_processes[0]->status=SCH_IDLE; - LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d First SR\n", - eNB->Mod_id, - eNB->ulsch[UE_id]->rnti,frame,subframe); - } - - if (eNB->mac_enabled==1) { - mac_xface->SR_indication(eNB->Mod_id, - eNB->CC_id, - frame, - eNB->dlsch[UE_id][0]->rnti,subframe); - } - } }// do_SR==1 - + if ((n1_pucch0==-1) && (n1_pucch1==-1)) { // just check for SR - } else if (eNB->frame_parms.frame_type==FDD) { // FDD - // if SR was detected, use the n1_pucch from SR, else use n1_pucch0 - // n1_pucch0 = (SR_payload==1) ? eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex:n1_pucch0; - - LOG_D(PHY,"Demodulating PUCCH for ACK/NAK: n1_pucch0 %d (%d), SR_payload %d\n",n1_pucch0,eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex,SR_payload); - - if (eNB->abstraction_flag == 0) { - - - - metric0 = rx_pucch(eNB, - pucch_format1a, - UE_id, - (uint16_t)n1_pucch0, - 0, //n2_pucch - 0, // shortened format - pucch_payload0, - frame, - subframe, - PUCCH1a_THRES); - - if (metric0 < metric0_SR) - metric0=rx_pucch(eNB, - pucch_format1a, - UE_id, - eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex, - 0, //n2_pucch - 0, // shortened format - pucch_payload0, - frame, - subframe, - PUCCH1a_THRES); - - } - - if (eNB->mac_enabled==1) { - mac_xface->SR_indication(eNB->Mod_id, - eNB->CC_id, - frame, - eNB->dlsch[UE_id][0]->rnti,subframe); - } - } - }// do_SR==1 - - if ((n1_pucch0==-1) && (n1_pucch1==-1)) { // just check for SR - } else if (fp->frame_type==FDD) { // FDD - // if SR was detected, use the n1_pucch from SR, else use n1_pucch0 - // n1_pucch0 = (SR_payload==1) ? eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex:n1_pucch0; - - LOG_D(PHY,"Demodulating PUCCH for ACK/NAK: n1_pucch0 %d (%d), SR_payload %d\n",n1_pucch0,eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex,SR_payload); - - if (eNB->abstraction_flag == 0) { - - - - metric0 = rx_pucch(eNB, - pucch_format1a, - UE_id, - (uint16_t)n1_pucch0, - 0, //n2_pucch - 0, // shortened format - pucch_payload0, - frame, - subframe, - PUCCH1a_THRES); - - if (metric0 < metric0_SR) - metric0=rx_pucch(eNB, - pucch_format1a, - UE_id, - eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex, - 0, //n2_pucch - 0, // shortened format - pucch_payload0, - frame, - subframe, - PUCCH1a_THRES); - } - else { + } else if (fp->frame_type==FDD) { // FDD + // if SR was detected, use the n1_pucch from SR, else use n1_pucch0 + // n1_pucch0 = (SR_payload==1) ? eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex:n1_pucch0; + + LOG_D(PHY,"Demodulating PUCCH for ACK/NAK: n1_pucch0 %d (%d), SR_payload %d\n",n1_pucch0,eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex,SR_payload); + + if (eNB->abstraction_flag == 0) { + metric0 = rx_pucch(eNB, + pucch_format1a, + UE_id, + (uint16_t)n1_pucch0, + 0, //n2_pucch + 0, // shortened format + pucch_payload0, + frame, + subframe, + PUCCH1a_THRES); + } #ifdef PHY_ABSTRACTION - metric0 = rx_pucch_emul(eNB, - proc, - UE_id, - pucch_format1a, - 0, - pucch_payload0); + else { + metric0 = rx_pucch_emul(eNB, + proc, + UE_id, + pucch_format1a, + 0, + pucch_payload0); + } #endif - } - + + /* cancel SR detection if reception on n1_pucch0 is better than on SR PUCCH resource index */ + if (do_SR && metric0 > metric0_SR) SR_payload = 0; + + if (do_SR && metric0 <= metric0_SR) { + /* when transmitting ACK/NACK on SR PUCCH resource index, SR payload is always 1 */ + SR_payload = 1; + + if (eNB->abstraction_flag == 0) { + metric0=rx_pucch(eNB, + pucch_format1a, + UE_id, + eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex, + 0, //n2_pucch + 0, // shortened format + pucch_payload0, + frame, + subframe, + PUCCH1a_THRES); + } +#ifdef PHY_ABSTRACTION + else { + metric0 = rx_pucch_emul(eNB, + proc, + UE_id, + pucch_format1a, + 0, + pucch_payload0); + } +#endif + } + #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d pucch1a (FDD) payload %d (metric %d)\n", - eNB->Mod_id, - eNB->dlsch[UE_id][0]->rnti, - frame,subframe, - pucch_payload0[0],metric0); + LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d pucch1a (FDD) payload %d (metric %d)\n", + eNB->Mod_id, + eNB->dlsch[UE_id][0]->rnti, + frame,subframe, + pucch_payload0[0],metric0); #endif - - process_HARQ_feedback(UE_id,eNB,proc, - 0,// pusch_flag - pucch_payload0, - 2, - SR_payload); - } // FDD - else { //TDD + process_HARQ_feedback(UE_id,eNB,proc, + 0,// pusch_flag + pucch_payload0, + 2, + SR_payload); + } // FDD + else { //TDD - bundling_flag = eNB->pucch_config_dedicated[UE_id].tdd_AckNackFeedbackMode; + bundling_flag = eNB->pucch_config_dedicated[UE_id].tdd_AckNackFeedbackMode; - // fix later for 2 TB case and format1b + // fix later for 2 TB case and format1b - if ((fp->frame_type==FDD) || - (bundling_flag==bundling) || - ((fp->frame_type==TDD)&&(fp->tdd_config==1)&&((subframe!=2)||(subframe!=7)))) { - format = pucch_format1a; - } else { - format = pucch_format1b; - } + if ((fp->frame_type==FDD) || + (bundling_flag==bundling) || + ((fp->frame_type==TDD)&&(fp->tdd_config==1)&&((subframe!=2)||(subframe!=7)))) { + format = pucch_format1a; + } else { + format = pucch_format1b; + } - // if SR was detected, use the n1_pucch from SR - if (SR_payload==1) { + // if SR was detected, use the n1_pucch from SR + if (SR_payload==1) { #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d Checking ACK/NAK (%d,%d,%d,%d) format %d with SR\n",eNB->Mod_id, - eNB->dlsch[UE_id][0]->rnti, - frame,subframe, - n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3,format); -#endif - - if (eNB->abstraction_flag == 0) - metric0_SR = rx_pucch(eNB, - format, - UE_id, - eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex, - 0, //n2_pucch - 0, // shortened format - pucch_payload0, - frame, - subframe, - PUCCH1a_THRES); - else { + LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d Checking ACK/NAK (%d,%d,%d,%d) format %d with SR\n",eNB->Mod_id, + eNB->dlsch[UE_id][0]->rnti, + frame,subframe, + n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3,format); +#endif + + if (eNB->abstraction_flag == 0) + metric0 = rx_pucch(eNB, + format, + UE_id, + eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex, + 0, //n2_pucch + 0, // shortened format + pucch_payload0, + frame, + subframe, + PUCCH1a_THRES); + else { #ifdef PHY_ABSTRACTION - metric0 = rx_pucch_emul(eNB,proc, - UE_id, - format, - 0, - pucch_payload0); + metric0 = rx_pucch_emul(eNB,proc, + UE_id, + format, + 0, + pucch_payload0); #endif - } - } else { //using n1_pucch0/n1_pucch1 resources + } + } else { //using n1_pucch0/n1_pucch1 resources #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d Checking ACK/NAK (%d,%d,%d,%d) format %d\n",eNB->Mod_id, - eNB->dlsch[UE_id][0]->rnti, - frame,subframe, - n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3,format); -#endif - metric0=0; - metric1=0; - - // Check n1_pucch0 metric - if (n1_pucch0 != -1) { - if (eNB->abstraction_flag == 0) - metric0 = rx_pucch(eNB, - format, - UE_id, - (uint16_t)n1_pucch0, - 0, // n2_pucch - 0, // shortened format - pucch_payload0, - frame, - subframe, - PUCCH1a_THRES); - else { + LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d Checking ACK/NAK (%d,%d,%d,%d) format %d\n",eNB->Mod_id, + eNB->dlsch[UE_id][0]->rnti, + frame,subframe, + n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3,format); +#endif + metric0=0; + metric1=0; + + // Check n1_pucch0 metric + if (n1_pucch0 != -1) { + if (eNB->abstraction_flag == 0) + metric0 = rx_pucch(eNB, + format, + UE_id, + (uint16_t)n1_pucch0, + 0, // n2_pucch + 0, // shortened format + pucch_payload0, + frame, + subframe, + PUCCH1a_THRES); + else { #ifdef PHY_ABSTRACTION - metric0 = rx_pucch_emul(eNB, - proc, - UE_id, - format, - 0, - pucch_payload0); -#endif - } - } + metric0 = rx_pucch_emul(eNB, + proc, + UE_id, + format, + 0, + pucch_payload0); +#endif + } + } - // Check n1_pucch1 metric - if (n1_pucch1 != -1) { - if (eNB->abstraction_flag == 0) - metric1 = rx_pucch(eNB, - format, - UE_id, - (uint16_t)n1_pucch1, - 0, //n2_pucch - 0, // shortened format - pucch_payload1, - frame, - subframe, - PUCCH1a_THRES); - else { + // Check n1_pucch1 metric + if (n1_pucch1 != -1) { + if (eNB->abstraction_flag == 0) + metric1 = rx_pucch(eNB, + format, + UE_id, + (uint16_t)n1_pucch1, + 0, //n2_pucch + 0, // shortened format + pucch_payload1, + frame, + subframe, + PUCCH1a_THRES); + else { #ifdef PHY_ABSTRACTION - metric1 = rx_pucch_emul(eNB, - proc, - UE_id, - format, - 1, - pucch_payload1); -#endif - } - } - } + metric1 = rx_pucch_emul(eNB, + proc, + UE_id, + format, + 1, + pucch_payload1); +#endif + } + } + } - if (SR_payload == 1) { - pucch_payload = pucch_payload0; - - if (bundling_flag == bundling) - pucch_sel = 2; - } else if (bundling_flag == multiplexing) { // multiplexing + no SR - pucch_payload = (metric1>metric0) ? pucch_payload1 : pucch_payload0; - pucch_sel = (metric1>metric0) ? 1 : 0; - } else { // bundling + no SR - if (n1_pucch1 != -1) - pucch_payload = pucch_payload1; - else if (n1_pucch0 != -1) - pucch_payload = pucch_payload0; - - pucch_sel = 2; // indicate that this is a bundled ACK/NAK - } + if (SR_payload == 1) { + pucch_payload = pucch_payload0; + + if (bundling_flag == bundling) + pucch_sel = 2; + } else if (bundling_flag == multiplexing) { // multiplexing + no SR + pucch_payload = (metric1>metric0) ? pucch_payload1 : pucch_payload0; + pucch_sel = (metric1>metric0) ? 1 : 0; + } else { // bundling + no SR + if (n1_pucch1 != -1) + pucch_payload = pucch_payload1; + else if (n1_pucch0 != -1) + pucch_payload = pucch_payload0; + + pucch_sel = 2; // indicate that this is a bundled ACK/NAK + } #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d ACK/NAK metric 0 %d, metric 1 %d, sel %d, (%d,%d)\n",eNB->Mod_id, - eNB->dlsch[UE_id][0]->rnti, - frame,subframe, - metric0,metric1,pucch_sel,pucch_payload[0],pucch_payload[1]); -#endif - process_HARQ_feedback(UE_id,eNB,proc, - 0,// pusch_flag - pucch_payload, - pucch_sel, - SR_payload); + LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d ACK/NAK metric 0 %d, metric 1 %d, sel %d, (%d,%d)\n",eNB->Mod_id, + eNB->dlsch[UE_id][0]->rnti, + frame,subframe, + metric0,metric1,pucch_sel,pucch_payload[0],pucch_payload[1]); +#endif + process_HARQ_feedback(UE_id,eNB,proc, + 0,// pusch_flag + pucch_payload, + pucch_sel, + SR_payload); + } // TDD } - } + + if (SR_payload == 1) { + LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Got SR for PUSCH, transmitting to MAC\n",eNB->Mod_id, + eNB->ulsch[UE_id]->rnti,frame,subframe); + eNB->UE_stats[UE_id].sr_received++; + + if (eNB->first_sr[UE_id] == 1) { // this is the first request for uplink after Connection Setup, so clear HARQ process 0 use for Msg4 + eNB->first_sr[UE_id] = 0; + eNB->dlsch[UE_id][0]->harq_processes[0]->round=0; + eNB->dlsch[UE_id][0]->harq_processes[0]->status=SCH_IDLE; + LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d First SR\n", + eNB->Mod_id, + eNB->ulsch[UE_id]->rnti,frame,subframe); + } + + if (eNB->mac_enabled==1) { + mac_xface->SR_indication(eNB->Mod_id, + eNB->CC_id, + frame, + eNB->dlsch[UE_id][0]->rnti,subframe); + } + } + } } @@ -3059,6 +3089,13 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const frame, &eNB->ulsch[i]->Msg3_frame, &eNB->ulsch[i]->Msg3_subframe); + + mac_xface->set_msg3_subframe(eNB->Mod_id, eNB->CC_id, frame, subframe, eNB->ulsch[i]->rnti, + eNB->ulsch[i]->Msg3_frame, eNB->ulsch[i]->Msg3_subframe); + + T(T_ENB_PHY_MSG3_ALLOCATION, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), + T_INT(i), T_INT(eNB->ulsch[i]->rnti), T_INT(0 /* 0 is for retransmission*/), + T_INT(eNB->ulsch[i]->Msg3_frame), T_INT(eNB->ulsch[i]->Msg3_subframe)); } LOG_D(PHY,"[eNB] Frame %d, Subframe %d: Msg3 in error, i = %d \n", frame,subframe,i); } // This is Msg3 error diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index f0811476eb4254daa1b20b1dcb32ffb8f78010cb..872eab83be8f8f534cf2b7265d59a5fb01538a58 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -1236,8 +1236,8 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB // deactivate service request // ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 0; - LOG_D(PHY,"Generating PUSCH (Abssubframe: %d.%d): harq-Id: %d, round: %d, MaxReTrans: %d \n",frame_tx,subframe_tx,harq_pid,ue->ulsch[eNB_id]->harq_processes[harq_pid]->round,UE_mac_inst[eNB_id].scheduling_info.maxHARQ_Tx); - if (ue->ulsch[eNB_id]->harq_processes[harq_pid]->round >= (UE_mac_inst[eNB_id].scheduling_info.maxHARQ_Tx - 1)) + LOG_D(PHY,"Generating PUSCH (Abssubframe: %d.%d): harq-Id: %d, round: %d, MaxReTrans: %d \n",frame_tx,subframe_tx,harq_pid,ue->ulsch[eNB_id]->harq_processes[harq_pid]->round,ue->ulsch[eNB_id]->Mlimit); + if (ue->ulsch[eNB_id]->harq_processes[harq_pid]->round >= (ue->ulsch[eNB_id]->Mlimit - 1)) { LOG_D(PHY,"PUSCH MAX Retransmission acheived ==> send last pusch (%d) \n"); ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 0; diff --git a/openair1/SCHED/srs_pc.c b/openair1/SCHED/srs_pc.c index 461d23097561490f4884eff5b5bf97f559d8cd04..98049b2ed0cd09a9e1c32da5e8dfad4254970242 100644 --- a/openair1/SCHED/srs_pc.c +++ b/openair1/SCHED/srs_pc.c @@ -1,31 +1,23 @@ -/******************************************************************************* - OpenAirInterface - Copyright(c) 1999 - 2014 Eurecom - - OpenAirInterface is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - - OpenAirInterface is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with OpenAirInterface.The full GNU General Public License is - included in this distribution in the file called "COPYING". If not, - see <http://www.gnu.org/licenses/>. - - Contact Information - OpenAirInterface Admin: openair_admin@eurecom.fr - OpenAirInterface Tech : openair_tech@eurecom.fr - OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr - - Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE - - *******************************************************************************/ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ /*! \file srs_pc.c * \brief Implementation of UE SRS Power Control procedures from 36.213 LTE specifications (Section diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index 40faf1049f6f95de5ed3b883c04e7c67c4f87817..96c533bde50dddba3876991f1c687153037cd3a3 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -2420,7 +2420,7 @@ int main(int argc, char **argv) phy_procedures_UE_RX(UE,proc,0,0,normal_txrx,no_relay,NULL); if (UE->dlsch[0][0]->active == 0) { - printf("DCI not received\n"); + //printf("DCI not received\n"); /* write_output("pdcchF0_ext.m","pdcchF_ext", UE->pdcch_vars[eNB_id]->rxdataF_ext[0],2*3*UE->frame_parms.ofdm_symbol_size,1,1); write_output("pdcch00_ch0_ext.m","pdcch00_ch0_ext",UE->pdcch_vars[eNB_id]->dl_ch_estimates_ext[0],12*UE->frame_parms.N_RB_DL*3,1,1); diff --git a/openair2/COMMON/tasks_def.h b/openair2/COMMON/tasks_def.h index 5fe555e1176c7aaaa216b7ce204b2131ac91ae5f..c9e210fd1f4bc27a1a0e55d85a27088d4a697750 100644 --- a/openair2/COMMON/tasks_def.h +++ b/openair2/COMMON/tasks_def.h @@ -55,6 +55,8 @@ TASK_DEF(TASK_X2AP, TASK_PRIORITY_MED, 200) TASK_DEF(TASK_SCTP, TASK_PRIORITY_MED, 200) /// eNB APP task TASK_DEF(TASK_ENB_APP, TASK_PRIORITY_MED, 200) +/// eNB Agent task +TASK_DEF(TASK_FLEXRAN_AGENT, TASK_PRIORITY_MED, 200) // UE tasks and sub-tasks: //// Layer 2 and Layer 1 sub-tasks diff --git a/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c new file mode 100644 index 0000000000000000000000000000000000000000..b9cad28278ba60fab4a54d0ce5535d6f5ea5c6d1 --- /dev/null +++ b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c @@ -0,0 +1,1493 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file flexran_agent_mac.c + * \brief FlexRAN agent message handler for MAC layer + * \author Xenofon Foukas, Mohamed Kassem and Navid Nikaein + * \date 2016 + * \version 0.1 + */ + +#include "flexran_agent_mac.h" +#include "flexran_agent_extern.h" +#include "flexran_agent_common.h" +#include "flexran_agent_mac_internal.h" + +#include "LAYER2/MAC/proto.h" +#include "LAYER2/MAC/flexran_agent_mac_proto.h" +#include "LAYER2/MAC/flexran_agent_scheduler_dlsch_ue_remote.h" + +#include "liblfds700.h" + +#include "log.h" + + +/*Flags showing if a mac agent has already been registered*/ +unsigned int mac_agent_registered[NUM_MAX_ENB]; + +/*Array containing the Agent-MAC interfaces*/ +AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB]; + +/* Ringbuffer related structs used for maintaining the dl mac config messages */ +//message_queue_t *dl_mac_config_queue; +struct lfds700_misc_prng_state ps[NUM_MAX_ENB]; +struct lfds700_ringbuffer_element *dl_mac_config_array[NUM_MAX_ENB]; +struct lfds700_ringbuffer_state ringbuffer_state[NUM_MAX_ENB]; + + +int flexran_agent_mac_handle_stats(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg){ + + // TODO: Must deal with sanitization of input + // TODO: Must check if RNTIs and cell ids of the request actually exist + // TODO: Must resolve conflicts among stats requests + + int i; + void *buffer; + int size; + err_code_t err_code; + xid_t xid; + uint32_t usec_interval, sec_interval; + + //TODO: We do not deal with multiple CCs at the moment and eNB id is 0 + int cc_id = 0; + int enb_id = mod_id; + + //eNB_MAC_INST *eNB = &eNB_mac_inst[enb_id]; + //UE_list_t *eNB_UE_list= &eNB->UE_list; + + report_config_t report_config; + + uint32_t ue_flags = 0; + uint32_t c_flags = 0; + + Protocol__FlexranMessage *input = (Protocol__FlexranMessage *)params; + + Protocol__FlexStatsRequest *stats_req = input->stats_request_msg; + xid = (stats_req->header)->xid; + + // Check the type of request that is made + switch(stats_req->body_case) { + case PROTOCOL__FLEX_STATS_REQUEST__BODY_COMPLETE_STATS_REQUEST: ; + Protocol__FlexCompleteStatsRequest *comp_req = stats_req->complete_stats_request; + if (comp_req->report_frequency == PROTOCOL__FLEX_STATS_REPORT_FREQ__FLSRF_OFF) { + /*Disable both periodic and continuous updates*/ + flexran_agent_disable_cont_mac_stats_update(mod_id); + flexran_agent_destroy_timer_by_task_id(xid); + *msg = NULL; + return 0; + } else { //One-off, periodical or continuous reporting + //Set the proper flags + ue_flags = comp_req->ue_report_flags; + c_flags = comp_req->cell_report_flags; + //Create a list of all eNB RNTIs and cells + + //Set the number of UEs and create list with their RNTIs stats configs + report_config.nr_ue = flexran_get_num_ues(mod_id); //eNB_UE_list->num_UEs + report_config.ue_report_type = (ue_report_type_t *) malloc(sizeof(ue_report_type_t) * report_config.nr_ue); + if (report_config.ue_report_type == NULL) { + // TODO: Add appropriate error code + err_code = -100; + goto error; + } + for (i = 0; i < report_config.nr_ue; i++) { + report_config.ue_report_type[i].ue_rnti = flexran_get_ue_crnti(enb_id, i); //eNB_UE_list->eNB_UE_stats[UE_PCCID(enb_id,i)][i].crnti; + report_config.ue_report_type[i].ue_report_flags = ue_flags; + } + //Set the number of CCs and create a list with the cell stats configs + report_config.nr_cc = MAX_NUM_CCs; + report_config.cc_report_type = (cc_report_type_t *) malloc(sizeof(cc_report_type_t) * report_config.nr_cc); + if (report_config.cc_report_type == NULL) { + // TODO: Add appropriate error code + err_code = -100; + goto error; + } + for (i = 0; i < report_config.nr_cc; i++) { + //TODO: Must fill in the proper cell ids + report_config.cc_report_type[i].cc_id = i; + report_config.cc_report_type[i].cc_report_flags = c_flags; + } + /* Check if request was periodical */ + if (comp_req->report_frequency == PROTOCOL__FLEX_STATS_REPORT_FREQ__FLSRF_PERIODICAL) { + /* Create a one off flexran message as an argument for the periodical task */ + Protocol__FlexranMessage *timer_msg; + stats_request_config_t request_config; + request_config.report_type = PROTOCOL__FLEX_STATS_TYPE__FLST_COMPLETE_STATS; + request_config.report_frequency = PROTOCOL__FLEX_STATS_REPORT_FREQ__FLSRF_ONCE; + request_config.period = 0; + /* Need to make sure that the ue flags are saved (Bug) */ + if (report_config.nr_ue == 0) { + report_config.nr_ue = 1; + report_config.ue_report_type = (ue_report_type_t *) malloc(sizeof(ue_report_type_t)); + if (report_config.ue_report_type == NULL) { + // TODO: Add appropriate error code + err_code = -100; + goto error; + } + report_config.ue_report_type[0].ue_rnti = 0; // Dummy value + report_config.ue_report_type[0].ue_report_flags = ue_flags; + } + request_config.config = &report_config; + flexran_agent_mac_stats_request(enb_id, xid, &request_config, &timer_msg); + /* Create a timer */ + long timer_id = 0; + flexran_agent_timer_args_t *timer_args; + timer_args = malloc(sizeof(flexran_agent_timer_args_t)); + memset (timer_args, 0, sizeof(flexran_agent_timer_args_t)); + timer_args->mod_id = enb_id; + timer_args->msg = timer_msg; + /*Convert subframes to usec time*/ + usec_interval = 1000*comp_req->sf; + sec_interval = 0; + /*add seconds if required*/ + if (usec_interval >= 1000*1000) { + sec_interval = usec_interval/(1000*1000); + usec_interval = usec_interval%(1000*1000); + } + flexran_agent_create_timer(sec_interval, usec_interval, FLEXRAN_AGENT_DEFAULT, enb_id, FLEXRAN_AGENT_TIMER_TYPE_PERIODIC, xid, flexran_agent_handle_timed_task,(void*) timer_args, &timer_id); + } else if (comp_req->report_frequency == PROTOCOL__FLEX_STATS_REPORT_FREQ__FLSRF_CONTINUOUS) { + /*If request was for continuous updates, disable the previous configuration and + set up a new one*/ + flexran_agent_disable_cont_mac_stats_update(mod_id); + stats_request_config_t request_config; + request_config.report_type = PROTOCOL__FLEX_STATS_TYPE__FLST_COMPLETE_STATS; + request_config.report_frequency = PROTOCOL__FLEX_STATS_REPORT_FREQ__FLSRF_ONCE; + request_config.period = 0; + /* Need to make sure that the ue flags are saved (Bug) */ + if (report_config.nr_ue == 0) { + report_config.nr_ue = 1; + report_config.ue_report_type = (ue_report_type_t *) malloc(sizeof(ue_report_type_t)); + if (report_config.ue_report_type == NULL) { + // TODO: Add appropriate error code + err_code = -100; + goto error; + } + report_config.ue_report_type[0].ue_rnti = 0; // Dummy value + report_config.ue_report_type[0].ue_report_flags = ue_flags; + } + request_config.config = &report_config; + flexran_agent_enable_cont_mac_stats_update(enb_id, xid, &request_config); + } + } + break; + case PROTOCOL__FLEX_STATS_REQUEST__BODY_CELL_STATS_REQUEST:; + Protocol__FlexCellStatsRequest *cell_req = stats_req->cell_stats_request; + // UE report config will be blank + report_config.nr_ue = 0; + report_config.ue_report_type = NULL; + report_config.nr_cc = cell_req->n_cell; + report_config.cc_report_type = (cc_report_type_t *) malloc(sizeof(cc_report_type_t) * report_config.nr_cc); + if (report_config.cc_report_type == NULL) { + // TODO: Add appropriate error code + err_code = -100; + goto error; + } + for (i = 0; i < report_config.nr_cc; i++) { + //TODO: Must fill in the proper cell ids + report_config.cc_report_type[i].cc_id = cell_req->cell[i]; + report_config.cc_report_type[i].cc_report_flags = cell_req->flags; + } + break; + case PROTOCOL__FLEX_STATS_REQUEST__BODY_UE_STATS_REQUEST:; + Protocol__FlexUeStatsRequest *ue_req = stats_req->ue_stats_request; + // Cell report config will be blank + report_config.nr_cc = 0; + report_config.cc_report_type = NULL; + report_config.nr_ue = ue_req->n_rnti; + report_config.ue_report_type = (ue_report_type_t *) malloc(sizeof(ue_report_type_t) * report_config.nr_ue); + if (report_config.ue_report_type == NULL) { + // TODO: Add appropriate error code + err_code = -100; + goto error; + } + for (i = 0; i < report_config.nr_ue; i++) { + report_config.ue_report_type[i].ue_rnti = ue_req->rnti[i]; + report_config.ue_report_type[i].ue_report_flags = ue_req->flags; + } + break; + default: + //TODO: Add appropriate error code + err_code = -100; + goto error; + } + + if (flexran_agent_mac_stats_reply(enb_id, xid, &report_config, msg) < 0 ){ + err_code = PROTOCOL__FLEXRAN_ERR__MSG_BUILD; + goto error; + } + + free(report_config.ue_report_type); + free(report_config.cc_report_type); + + return 0; + + error : + LOG_E(FLEXRAN_AGENT, "errno %d occured\n", err_code); + return err_code; +} + +int flexran_agent_mac_stats_request(mid_t mod_id, + xid_t xid, + const stats_request_config_t *report_config, + Protocol__FlexranMessage **msg) { + Protocol__FlexHeader *header; + int i; + + if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_STATS_REQUEST, &header) != 0) + goto error; + + Protocol__FlexStatsRequest *stats_request_msg; + stats_request_msg = malloc(sizeof(Protocol__FlexStatsRequest)); + if(stats_request_msg == NULL) + goto error; + + protocol__flex_stats_request__init(stats_request_msg); + stats_request_msg->header = header; + + stats_request_msg->type = report_config->report_type; + stats_request_msg->has_type = 1; + + switch (report_config->report_type) { + case PROTOCOL__FLEX_STATS_TYPE__FLST_COMPLETE_STATS: + stats_request_msg->body_case = PROTOCOL__FLEX_STATS_REQUEST__BODY_COMPLETE_STATS_REQUEST; + Protocol__FlexCompleteStatsRequest *complete_stats; + complete_stats = malloc(sizeof(Protocol__FlexCompleteStatsRequest)); + if(complete_stats == NULL) + goto error; + protocol__flex_complete_stats_request__init(complete_stats); + complete_stats->report_frequency = report_config->report_frequency; + complete_stats->has_report_frequency = 1; + complete_stats->sf = report_config->period; + complete_stats->has_sf = 1; + complete_stats->has_cell_report_flags = 1; + complete_stats->has_ue_report_flags = 1; + if (report_config->config->nr_cc > 0) { + complete_stats->cell_report_flags = report_config->config->cc_report_type[0].cc_report_flags; + } + if (report_config->config->nr_ue > 0) { + complete_stats->ue_report_flags = report_config->config->ue_report_type[0].ue_report_flags; + } + stats_request_msg->complete_stats_request = complete_stats; + break; + case PROTOCOL__FLEX_STATS_TYPE__FLST_CELL_STATS: + stats_request_msg->body_case = PROTOCOL__FLEX_STATS_REQUEST__BODY_CELL_STATS_REQUEST; + Protocol__FlexCellStatsRequest *cell_stats; + cell_stats = malloc(sizeof(Protocol__FlexCellStatsRequest)); + if(cell_stats == NULL) + goto error; + protocol__flex_cell_stats_request__init(cell_stats); + cell_stats->n_cell = report_config->config->nr_cc; + cell_stats->has_flags = 1; + if (cell_stats->n_cell > 0) { + uint32_t *cells; + cells = (uint32_t *) malloc(sizeof(uint32_t)*cell_stats->n_cell); + for (i = 0; i < cell_stats->n_cell; i++) { + cells[i] = report_config->config->cc_report_type[i].cc_id; + } + cell_stats->cell = cells; + cell_stats->flags = report_config->config->cc_report_type[i].cc_report_flags; + } + stats_request_msg->cell_stats_request = cell_stats; + break; + case PROTOCOL__FLEX_STATS_TYPE__FLST_UE_STATS: + stats_request_msg->body_case = PROTOCOL__FLEX_STATS_REQUEST__BODY_UE_STATS_REQUEST; + Protocol__FlexUeStatsRequest *ue_stats; + ue_stats = malloc(sizeof(Protocol__FlexUeStatsRequest)); + if(ue_stats == NULL) + goto error; + protocol__flex_ue_stats_request__init(ue_stats); + ue_stats->n_rnti = report_config->config->nr_ue; + ue_stats->has_flags = 1; + if (ue_stats->n_rnti > 0) { + uint32_t *ues; + ues = (uint32_t *) malloc(sizeof(uint32_t)*ue_stats->n_rnti); + for (i = 0; i < ue_stats->n_rnti; i++) { + ues[i] = report_config->config->ue_report_type[i].ue_rnti; + } + ue_stats->rnti = ues; + ue_stats->flags = report_config->config->ue_report_type[i].ue_report_flags; + } + stats_request_msg->ue_stats_request = ue_stats; + break; + default: + goto error; + } + *msg = malloc(sizeof(Protocol__FlexranMessage)); + if(*msg == NULL) + goto error; + protocol__flexran_message__init(*msg); + (*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_STATS_REQUEST_MSG; + (*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__INITIATING_MESSAGE; + (*msg)->stats_request_msg = stats_request_msg; + return 0; + + error: + // TODO: Need to make proper error handling + if (header != NULL) + free(header); + if (stats_request_msg != NULL) + free(stats_request_msg); + if(*msg != NULL) + free(*msg); + //LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); + return -1; +} + +int flexran_agent_mac_destroy_stats_request(Protocol__FlexranMessage *msg) { + if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_STATS_REQUEST_MSG) + goto error; + free(msg->stats_request_msg->header); + if (msg->stats_request_msg->body_case == PROTOCOL__FLEX_STATS_REQUEST__BODY_CELL_STATS_REQUEST) { + free(msg->stats_request_msg->cell_stats_request->cell); + } + if (msg->stats_request_msg->body_case == PROTOCOL__FLEX_STATS_REQUEST__BODY_UE_STATS_REQUEST) { + free(msg->stats_request_msg->ue_stats_request->rnti); + } + free(msg->stats_request_msg); + free(msg); + return 0; + + error: + //LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); + return -1; +} + +int flexran_agent_mac_stats_reply(mid_t mod_id, + xid_t xid, + const report_config_t *report_config, + Protocol__FlexranMessage **msg) { + Protocol__FlexHeader *header; + int i, j, k; + int cc_id = 0; + int enb_id = mod_id; + //eNB_MAC_INST *eNB = &eNB_mac_inst[enb_id]; + //UE_list_t *eNB_UE_list= &eNB->UE_list; + + + if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_STATS_REPLY, &header) != 0) + goto error; + + Protocol__FlexStatsReply *stats_reply_msg; + stats_reply_msg = malloc(sizeof(Protocol__FlexStatsReply)); + if (stats_reply_msg == NULL) + goto error; + protocol__flex_stats_reply__init(stats_reply_msg); + stats_reply_msg->header = header; + + stats_reply_msg->n_ue_report = report_config->nr_ue; + stats_reply_msg->n_cell_report = report_config->nr_cc; + + Protocol__FlexUeStatsReport **ue_report; + Protocol__FlexCellStatsReport **cell_report; + + + /* Allocate memory for list of UE reports */ + if (report_config->nr_ue > 0) { + ue_report = malloc(sizeof(Protocol__FlexUeStatsReport *) * report_config->nr_ue); + if (ue_report == NULL) + goto error; + for (i = 0; i < report_config->nr_ue; i++) { + ue_report[i] = malloc(sizeof(Protocol__FlexUeStatsReport)); + protocol__flex_ue_stats_report__init(ue_report[i]); + ue_report[i]->rnti = report_config->ue_report_type[i].ue_rnti; + ue_report[i]->has_rnti = 1; + ue_report[i]->flags = report_config->ue_report_type[i].ue_report_flags; + ue_report[i]->has_flags = 1; + /* Check the types of reports that need to be constructed based on flag values */ + + /* Check flag for creation of buffer status report */ + if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_BSR) { + ue_report[i]->n_bsr = 4; + uint32_t *elem; + elem = (uint32_t *) malloc(sizeof(uint32_t)*ue_report[i]->n_bsr); + if (elem == NULL) + goto error; + for (j = 0; j++; j < ue_report[i]->n_bsr) { + // NN: we need to know the cc_id here, consider the first one + elem[j] = flexran_get_ue_bsr (enb_id, i, j); + } + ue_report[i]->bsr = elem; + } + + /* Check flag for creation of PRH report */ + if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_PRH) { + ue_report[i]->phr = flexran_get_ue_phr (enb_id, i); // eNB_UE_list->UE_template[UE_PCCID(enb_id,i)][i].phr_info; + ue_report[i]->has_phr = 1; + } + + /* Check flag for creation of RLC buffer status report */ + if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_RLC_BS) { + ue_report[i]->n_rlc_report = 3; // Set this to the number of LCs for this UE. This needs to be generalized for for LCs + Protocol__FlexRlcBsr ** rlc_reports; + rlc_reports = malloc(sizeof(Protocol__FlexRlcBsr *) * ue_report[i]->n_rlc_report); + if (rlc_reports == NULL) + goto error; + + // NN: see LAYER2/openair2_proc.c for rlc status + for (j = 0; j < ue_report[i]->n_rlc_report; j++) { + rlc_reports[j] = malloc(sizeof(Protocol__FlexRlcBsr)); + if (rlc_reports[j] == NULL) + goto error; + protocol__flex_rlc_bsr__init(rlc_reports[j]); + rlc_reports[j]->lc_id = j+1; + rlc_reports[j]->has_lc_id = 1; + rlc_reports[j]->tx_queue_size = flexran_get_tx_queue_size(enb_id,i,j+1); + rlc_reports[j]->has_tx_queue_size = 1; + + //TODO:Set tx queue head of line delay in ms + rlc_reports[j]->tx_queue_hol_delay = 100; + rlc_reports[j]->has_tx_queue_hol_delay = 0; + //TODO:Set retransmission queue size in bytes + rlc_reports[j]->retransmission_queue_size = 10; + rlc_reports[j]->has_retransmission_queue_size = 0; + //TODO:Set retransmission queue head of line delay in ms + rlc_reports[j]->retransmission_queue_hol_delay = 100; + rlc_reports[j]->has_retransmission_queue_hol_delay = 0; + //TODO:Set current size of the pending message in bytes + rlc_reports[j]->status_pdu_size = 100; + rlc_reports[j]->has_status_pdu_size = 0; + } + // Add RLC buffer status reports to the full report + if (ue_report[i]->n_rlc_report > 0) + ue_report[i]->rlc_report = rlc_reports; + } + + /* Check flag for creation of MAC CE buffer status report */ + if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_MAC_CE_BS) { + // TODO: Fill in the actual MAC CE buffer status report + ue_report[i]->pending_mac_ces = (flexran_get_MAC_CE_bitmap_TA(enb_id,i,0) | (0 << 1) | (0 << 2) | (0 << 3)) & 15; /* Use as bitmap. Set one or more of the; /* Use as bitmap. Set one or more of the + PROTOCOL__FLEX_CE_TYPE__FLPCET_ values + found in stats_common.pb-c.h. See + flex_ce_type in FlexRAN specification */ + ue_report[i]->has_pending_mac_ces = 1; + } + + /* Check flag for creation of DL CQI report */ + if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_DL_CQI) { + // TODO: Fill in the actual DL CQI report for the UE based on its configuration + Protocol__FlexDlCqiReport * dl_report; + dl_report = malloc(sizeof(Protocol__FlexDlCqiReport)); + if (dl_report == NULL) + goto error; + protocol__flex_dl_cqi_report__init(dl_report); + + dl_report->sfn_sn = flexran_get_sfn_sf(enb_id); + dl_report->has_sfn_sn = 1; + //Set the number of DL CQI reports for this UE. One for each CC + dl_report->n_csi_report = flexran_get_active_CC(enb_id,i); + + //Create the actual CSI reports. + Protocol__FlexDlCsi **csi_reports; + csi_reports = malloc(sizeof(Protocol__FlexDlCsi *)*dl_report->n_csi_report); + if (csi_reports == NULL) + goto error; + for (j = 0; j < dl_report->n_csi_report; j++) { + csi_reports[j] = malloc(sizeof(Protocol__FlexDlCsi)); + if (csi_reports[j] == NULL) + goto error; + protocol__flex_dl_csi__init(csi_reports[j]); + //The servCellIndex for this report + csi_reports[j]->serv_cell_index = j; + csi_reports[j]->has_serv_cell_index = 1; + //The rank indicator value for this cc + csi_reports[j]->ri = flexran_get_current_RI(enb_id,i,j); + csi_reports[j]->has_ri = 1; + //TODO: the type of CSI report based on the configuration of the UE + //For now we only support type P10, which only needs a wideband value + //The full set of types can be found in stats_common.pb-c.h and + //in the FlexRAN specifications + csi_reports[j]->type = PROTOCOL__FLEX_CSI_TYPE__FLCSIT_P10; + csi_reports[j]->has_type = 1; + csi_reports[j]->report_case = PROTOCOL__FLEX_DL_CSI__REPORT_P10CSI; + if(csi_reports[j]->report_case == PROTOCOL__FLEX_DL_CSI__REPORT_P10CSI){ + Protocol__FlexCsiP10 *csi10; + csi10 = malloc(sizeof(Protocol__FlexCsiP10)); + if (csi10 == NULL) + goto error; + protocol__flex_csi_p10__init(csi10); + //TODO: set the wideband value + // NN: this is also depends on cc_id + csi10->wb_cqi = flexran_get_ue_wcqi (enb_id, i); //eNB_UE_list->eNB_UE_stats[UE_PCCID(enb_id,i)][i].dl_cqi; + csi10->has_wb_cqi = 1; + //Add the type of measurements to the csi report in the proper union type + csi_reports[j]->p10csi = csi10; + } + else if(csi_reports[j]->report_case == PROTOCOL__FLEX_DL_CSI__REPORT_P11CSI){ + + } + else if(csi_reports[j]->report_case == PROTOCOL__FLEX_DL_CSI__REPORT_P20CSI){ + + } + else if(csi_reports[j]->report_case == PROTOCOL__FLEX_DL_CSI__REPORT_P21CSI){ + + } + else if(csi_reports[j]->report_case == PROTOCOL__FLEX_DL_CSI__REPORT_A12CSI){ + + } + else if(csi_reports[j]->report_case == PROTOCOL__FLEX_DL_CSI__REPORT_A22CSI){ + + } + else if(csi_reports[j]->report_case == PROTOCOL__FLEX_DL_CSI__REPORT_A20CSI){ + + } + else if(csi_reports[j]->report_case == PROTOCOL__FLEX_DL_CSI__REPORT_A30CSI){ + + } + else if(csi_reports[j]->report_case == PROTOCOL__FLEX_DL_CSI__REPORT_A31CSI){ + + } + } + //Add the csi reports to the full DL CQI report + dl_report->csi_report = csi_reports; + //Add the DL CQI report to the stats report + ue_report[i]->dl_cqi_report = dl_report; + } + + /* Check flag for creation of paging buffer status report */ + if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_PBS) { + //TODO: Fill in the actual paging buffer status report. For this field to be valid, the RNTI + //set in the report must be a P-RNTI + Protocol__FlexPagingBufferReport *paging_report; + paging_report = malloc(sizeof(Protocol__FlexPagingBufferReport)); + if (paging_report == NULL) + goto error; + protocol__flex_paging_buffer_report__init(paging_report); + //Set the number of pending paging messages + paging_report->n_paging_info = 1; + //Provide a report for each pending paging message + Protocol__FlexPagingInfo **p_info; + p_info = malloc(sizeof(Protocol__FlexPagingInfo *) * paging_report->n_paging_info); + if (p_info == NULL) + goto error; + for (j = 0; j < paging_report->n_paging_info; j++) { + p_info[j] = malloc(sizeof(Protocol__FlexPagingInfo)); + if(p_info[j] == NULL) + goto error; + protocol__flex_paging_info__init(p_info[j]); + //TODO: Set paging index. This index is the same that will be used for the scheduling of the + //paging message by the controller + p_info[j]->paging_index = 10; + p_info[j]->has_paging_index = 0; + //TODO:Set the paging message size + p_info[j]->paging_message_size = 100; + p_info[j]->has_paging_message_size = 0; + //TODO: Set the paging subframe + p_info[j]->paging_subframe = 10; + p_info[j]->has_paging_subframe = 0; + //TODO: Set the carrier index for the pending paging message + p_info[j]->carrier_index = 0; + p_info[j]->has_carrier_index = 0; + } + //Add all paging info to the paging buffer rerport + paging_report->paging_info = p_info; + //Add the paging report to the UE report + ue_report[i]->pbr = paging_report; + } + + /* Check flag for creation of UL CQI report */ + if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_UL_CQI) { + //Fill in the full UL CQI report of the UE + Protocol__FlexUlCqiReport *full_ul_report; + full_ul_report = malloc(sizeof(Protocol__FlexUlCqiReport)); + if(full_ul_report == NULL) + goto error; + protocol__flex_ul_cqi_report__init(full_ul_report); + //TODO:Set the SFN and SF of the generated report + full_ul_report->sfn_sn = flexran_get_sfn_sf(enb_id); + full_ul_report->has_sfn_sn = 1; + //TODO:Set the number of UL measurement reports based on the types of measurements + //configured for this UE and on the servCellIndex + full_ul_report->n_cqi_meas = 1; + Protocol__FlexUlCqi **ul_report; + ul_report = malloc(sizeof(Protocol__FlexUlCqi *) * full_ul_report->n_cqi_meas); + if(ul_report == NULL) + goto error; + //Fill each UL report of the UE for each of the configured report types + for(j = 0; j < full_ul_report->n_cqi_meas; j++) { + ul_report[j] = malloc(sizeof(Protocol__FlexUlCqi)); + if(ul_report[j] == NULL) + goto error; + protocol__flex_ul_cqi__init(ul_report[j]); + //TODO: Set the type of the UL report. As an example set it to SRS UL report + // See enum flex_ul_cqi_type in FlexRAN specification for more details + ul_report[j]->type = PROTOCOL__FLEX_UL_CQI_TYPE__FLUCT_SRS; + ul_report[j]->has_type = 1; + //TODO:Set the number of SINR measurements based on the report type + //See struct flex_ul_cqi in FlexRAN specification for more details + ul_report[j]->n_sinr = 0; + uint32_t *sinr_meas; + sinr_meas = (uint32_t *) malloc(sizeof(uint32_t) * ul_report[j]->n_sinr); + if (sinr_meas == NULL) + goto error; + //TODO:Set the SINR measurements for the specified type + for (k = 0; k < ul_report[j]->n_sinr; k++) { + sinr_meas[k] = 10; + } + ul_report[j]->sinr = sinr_meas; + //TODO: Set the servCellIndex for this report + ul_report[j]->serv_cell_index = 0; + ul_report[j]->has_serv_cell_index = 1; + + //Set the list of UL reports of this UE to the full UL report + full_ul_report->cqi_meas = ul_report; + + full_ul_report->n_pucch_dbm = MAX_NUM_CCs; + full_ul_report->pucch_dbm = malloc(sizeof(Protocol__FlexPucchDbm *) * full_ul_report->n_pucch_dbm); + + for (j = 0; j < MAX_NUM_CCs; j++) { + full_ul_report->pucch_dbm[j] = malloc(sizeof(Protocol__FlexPucchDbm)); + protocol__flex_pucch_dbm__init(full_ul_report->pucch_dbm[j]); + full_ul_report->pucch_dbm[j]->has_serv_cell_index = 1; + full_ul_report->pucch_dbm[j]->serv_cell_index = j; + if(flexran_get_p0_pucch_dbm(enb_id,i, j) != -1){ + full_ul_report->pucch_dbm[j]->p0_pucch_dbm = flexran_get_p0_pucch_dbm(enb_id,i,j); + full_ul_report->pucch_dbm[j]->has_p0_pucch_dbm = 1; + } + } + + //Add full UL CQI report to the UE report + ue_report[i]->ul_cqi_report = full_ul_report; + } + } + } + /* Add list of all UE reports to the message */ + stats_reply_msg->ue_report = ue_report; + } + + /* Allocate memory for list of cell reports */ + if (report_config->nr_cc > 0) { + cell_report = malloc(sizeof(Protocol__FlexCellStatsReport *) * report_config->nr_cc); + if (cell_report == NULL) + goto error; + // Fill in the Cell reports + for (i = 0; i < report_config->nr_cc; i++) { + cell_report[i] = malloc(sizeof(Protocol__FlexCellStatsReport)); + if(cell_report[i] == NULL) + goto error; + protocol__flex_cell_stats_report__init(cell_report[i]); + cell_report[i]->carrier_index = report_config->cc_report_type[i].cc_id; + cell_report[i]->has_carrier_index = 1; + cell_report[i]->flags = report_config->cc_report_type[i].cc_report_flags; + cell_report[i]->has_flags = 1; + + /* Check flag for creation of noise and interference report */ + if(report_config->cc_report_type[i].cc_report_flags & PROTOCOL__FLEX_CELL_STATS_TYPE__FLCST_NOISE_INTERFERENCE) { + // TODO: Fill in the actual noise and interference report for this cell + Protocol__FlexNoiseInterferenceReport *ni_report; + ni_report = malloc(sizeof(Protocol__FlexNoiseInterferenceReport)); + if(ni_report == NULL) + goto error; + protocol__flex_noise_interference_report__init(ni_report); + // Current frame and subframe number + ni_report->sfn_sf = flexran_get_sfn_sf(enb_id); + ni_report->has_sfn_sf = 1; + //TODO:Received interference power in dbm + ni_report->rip = 0; + ni_report->has_rip = 0; + //TODO:Thermal noise power in dbm + ni_report->tnp = 0; + ni_report->has_tnp = 0; + + ni_report->p0_nominal_pucch = flexran_get_p0_nominal_pucch(enb_id, 0); + ni_report->has_p0_nominal_pucch = 1; + cell_report[i]->noise_inter_report = ni_report; + } + } + /* Add list of all cell reports to the message */ + stats_reply_msg->cell_report = cell_report; + } + + *msg = malloc(sizeof(Protocol__FlexranMessage)); + if(*msg == NULL) + goto error; + protocol__flexran_message__init(*msg); + (*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_STATS_REPLY_MSG; + (*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__SUCCESSFUL_OUTCOME; + (*msg)->stats_reply_msg = stats_reply_msg; + return 0; + + error: + // TODO: Need to make proper error handling + if (header != NULL) + free(header); + if (stats_reply_msg != NULL) + free(stats_reply_msg); + if(*msg != NULL) + free(*msg); + //LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); + return -1; +} + +int flexran_agent_mac_destroy_stats_reply(Protocol__FlexranMessage *msg) { + //TODO: Need to deallocate memory for the stats reply message + if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_STATS_REPLY_MSG) + goto error; + free(msg->stats_reply_msg->header); + int i, j, k; + + Protocol__FlexStatsReply *reply = msg->stats_reply_msg; + Protocol__FlexDlCqiReport *dl_report; + Protocol__FlexUlCqiReport *ul_report; + Protocol__FlexPagingBufferReport *paging_report; + + // Free the memory for the UE reports + for (i = 0; i < reply->n_ue_report; i++) { + free(reply->ue_report[i]->bsr); + for (j = 0; j < reply->ue_report[i]->n_rlc_report; j++) { + free(reply->ue_report[i]->rlc_report[j]); + } + free(reply->ue_report[i]->rlc_report); + // If DL CQI report flag was set + if (reply->ue_report[i]->flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_DL_CQI) { + dl_report = reply->ue_report[i]->dl_cqi_report; + // Delete all CSI reports + for (j = 0; j < dl_report->n_csi_report; j++) { + //Must free memory based on the type of report + switch(dl_report->csi_report[j]->report_case) { + case PROTOCOL__FLEX_DL_CSI__REPORT_P10CSI: + free(dl_report->csi_report[j]->p10csi); + break; + case PROTOCOL__FLEX_DL_CSI__REPORT_P11CSI: + free(dl_report->csi_report[j]->p11csi->wb_cqi); + free(dl_report->csi_report[j]->p11csi); + break; + case PROTOCOL__FLEX_DL_CSI__REPORT_P20CSI: + free(dl_report->csi_report[j]->p20csi); + break; + case PROTOCOL__FLEX_DL_CSI__REPORT_P21CSI: + free(dl_report->csi_report[j]->p21csi->wb_cqi); + free(dl_report->csi_report[j]->p21csi->sb_cqi); + free(dl_report->csi_report[j]->p21csi); + break; + case PROTOCOL__FLEX_DL_CSI__REPORT_A12CSI: + free(dl_report->csi_report[j]->a12csi->wb_cqi); + free(dl_report->csi_report[j]->a12csi->sb_pmi); + free(dl_report->csi_report[j]->a12csi); + break; + case PROTOCOL__FLEX_DL_CSI__REPORT_A22CSI: + free(dl_report->csi_report[j]->a22csi->wb_cqi); + free(dl_report->csi_report[j]->a22csi->sb_cqi); + free(dl_report->csi_report[j]->a22csi->sb_list); + free(dl_report->csi_report[j]->a22csi); + break; + case PROTOCOL__FLEX_DL_CSI__REPORT_A20CSI: + free(dl_report->csi_report[j]->a20csi->sb_list); + free(dl_report->csi_report[j]->a20csi); + break; + case PROTOCOL__FLEX_DL_CSI__REPORT_A30CSI: + free(dl_report->csi_report[j]->a30csi->sb_cqi); + free(dl_report->csi_report[j]->a30csi); + break; + case PROTOCOL__FLEX_DL_CSI__REPORT_A31CSI: + free(dl_report->csi_report[j]->a31csi->wb_cqi); + for (k = 0; k < dl_report->csi_report[j]->a31csi->n_sb_cqi; k++) { + free(dl_report->csi_report[j]->a31csi->sb_cqi[k]); + } + free(dl_report->csi_report[j]->a31csi->sb_cqi); + break; + } + + free(dl_report->csi_report[j]); + } + free(dl_report->csi_report); + free(dl_report); + } + // If Paging buffer report flag was set + if (reply->ue_report[i]->flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_PBS) { + paging_report = reply->ue_report[i]->pbr; + // Delete all paging buffer reports + for (j = 0; j < paging_report->n_paging_info; j++) { + free(paging_report->paging_info[j]); + } + free(paging_report->paging_info); + free(paging_report); + } + // If UL CQI report flag was set + if (reply->ue_report[i]->flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_UL_CQI) { + ul_report = reply->ue_report[i]->ul_cqi_report; + for (j = 0; j < ul_report->n_cqi_meas; j++) { + free(ul_report->cqi_meas[j]->sinr); + free(ul_report->cqi_meas[j]); + } + free(ul_report->cqi_meas); + for (j = 0; j < ul_report->n_pucch_dbm; j++) { + free(ul_report->pucch_dbm[j]); + } + free(ul_report->pucch_dbm); + } + free(reply->ue_report[i]); + } + free(reply->ue_report); + + // Free memory for all Cell reports + for (i = 0; i < reply->n_cell_report; i++) { + free(reply->cell_report[i]->noise_inter_report); + free(reply->cell_report[i]); + } + free(reply->cell_report); + + free(reply); + free(msg); + return 0; + + error: + //LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); + return -1; +} + +int flexran_agent_mac_sr_info(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) { + Protocol__FlexHeader *header; + int i; + const int xid = *((int *)params); + if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_UL_SR_INFO, &header) != 0) + goto error; + + Protocol__FlexUlSrInfo *ul_sr_info_msg; + ul_sr_info_msg = malloc(sizeof(Protocol__FlexUlSrInfo)); + if (ul_sr_info_msg == NULL) { + goto error; + } + protocol__flex_ul_sr_info__init(ul_sr_info_msg); + + ul_sr_info_msg->header = header; + ul_sr_info_msg->has_sfn_sf = 1; + ul_sr_info_msg->sfn_sf = flexran_get_sfn_sf(mod_id); + /*TODO: Set the number of UEs that sent an SR */ + ul_sr_info_msg->n_rnti = 1; + ul_sr_info_msg->rnti = (uint32_t *) malloc(ul_sr_info_msg->n_rnti * sizeof(uint32_t)); + + if(ul_sr_info_msg->rnti == NULL) { + goto error; + } + /*TODO:Set the rnti of the UEs that sent an SR */ + for (i = 0; i < ul_sr_info_msg->n_rnti; i++) { + ul_sr_info_msg->rnti[i] = 1; + } + + *msg = malloc(sizeof(Protocol__FlexranMessage)); + if(*msg == NULL) + goto error; + protocol__flexran_message__init(*msg); + (*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_UL_SR_INFO_MSG; + (*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__INITIATING_MESSAGE; + (*msg)->ul_sr_info_msg = ul_sr_info_msg; + return 0; + + error: + // TODO: Need to make proper error handling + if (header != NULL) + free(header); + if (ul_sr_info_msg != NULL) { + free(ul_sr_info_msg->rnti); + free(ul_sr_info_msg); + } + if(*msg != NULL) + free(*msg); + //LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); + return -1; +} + +int flexran_agent_mac_destroy_sr_info(Protocol__FlexranMessage *msg) { + if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_UL_SR_INFO_MSG) + goto error; + + free(msg->ul_sr_info_msg->header); + free(msg->ul_sr_info_msg->rnti); + free(msg->ul_sr_info_msg); + free(msg); + return 0; + + error: + //LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); + return -1; +} + +int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) { + Protocol__FlexHeader *header; + int i,j; + const int xid = *((int *)params); + if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_SF_TRIGGER, &header) != 0) + goto error; + + Protocol__FlexSfTrigger *sf_trigger_msg; + sf_trigger_msg = malloc(sizeof(Protocol__FlexSfTrigger)); + if (sf_trigger_msg == NULL) { + goto error; + } + protocol__flex_sf_trigger__init(sf_trigger_msg); + + frame_t frame; + sub_frame_t subframe; + + int ahead_of_time = 1; + + frame = (frame_t) flexran_get_current_system_frame_num(mod_id); + subframe = (sub_frame_t) flexran_get_current_subframe(mod_id); + + subframe = ((subframe + ahead_of_time) % 10); + + int full_frames_ahead = ((ahead_of_time / 10) % 10); + + frame = frame + full_frames_ahead; + + if (subframe < flexran_get_current_subframe(mod_id)) { + frame++; + } + + sf_trigger_msg->header = header; + sf_trigger_msg->has_sfn_sf = 1; + sf_trigger_msg->sfn_sf = flexran_get_future_sfn_sf(mod_id, 1); + + /*TODO: Fill in the number of dl HARQ related info, based on the number of currently + *transmitting UEs + */ + sf_trigger_msg->n_dl_info = flexran_get_num_ues(mod_id); + + Protocol__FlexDlInfo **dl_info = NULL; + + if (sf_trigger_msg->n_dl_info > 0) { + dl_info = malloc(sizeof(Protocol__FlexDlInfo *) * sf_trigger_msg->n_dl_info); + if(dl_info == NULL) + goto error; + //Fill the status of the current HARQ process for each UE + for(i = 0; i < sf_trigger_msg->n_dl_info; i++) { + dl_info[i] = malloc(sizeof(Protocol__FlexDlInfo)); + if(dl_info[i] == NULL) + goto error; + protocol__flex_dl_info__init(dl_info[i]); + dl_info[i]->rnti = flexran_get_ue_crnti(mod_id, i); + dl_info[i]->has_rnti = 1; + /*Fill in the right id of this round's HARQ process for this UE*/ + int harq_id; + int harq_status; + flexran_get_harq(mod_id, UE_PCCID(mod_id,i), i, frame, subframe, &harq_id, &harq_status); + dl_info[i]->harq_process_id = harq_id; + dl_info[i]->has_harq_process_id = 1; + /* Fill in the status of the HARQ process (2 TBs)*/ + dl_info[i]->n_harq_status = 2; + dl_info[i]->harq_status = malloc(sizeof(uint32_t) * dl_info[i]->n_harq_status); + for (j = 0; j < dl_info[i]->n_harq_status; j++) { + // TODO: This should be different per TB + if(harq_status == 0) + dl_info[i]->harq_status[j] = PROTOCOL__FLEX_HARQ_STATUS__FLHS_ACK; + else if (harq_status > 0) + dl_info[i]->harq_status[j] = PROTOCOL__FLEX_HARQ_STATUS__FLHS_NACK; + } + /*Fill in the serving cell index for this UE */ + dl_info[i]->serv_cell_index = UE_PCCID(mod_id,i); + dl_info[i]->has_serv_cell_index = 1; + } + } + + sf_trigger_msg->dl_info = dl_info; + + /* Fill in the number of UL reception status related info, based on the number of currently + * transmitting UEs + */ + sf_trigger_msg->n_ul_info = flexran_get_num_ues(mod_id); + + Protocol__FlexUlInfo **ul_info = NULL; + + if (sf_trigger_msg->n_ul_info > 0) { + ul_info = malloc(sizeof(Protocol__FlexUlInfo *) * sf_trigger_msg->n_ul_info); + if(ul_info == NULL) + goto error; + //Fill the reception info for each transmitting UE + for(i = 0; i < sf_trigger_msg->n_ul_info; i++) { + ul_info[i] = malloc(sizeof(Protocol__FlexUlInfo)); + if(ul_info[i] == NULL) + goto error; + protocol__flex_ul_info__init(ul_info[i]); + ul_info[i]->rnti = flexran_get_ue_crnti(mod_id, i); + ul_info[i]->has_rnti = 1; + /*Fill in the Tx power control command for this UE (if available)*/ + if(flexran_get_tpc(mod_id,i) != 1){ + ul_info[i]->tpc = flexran_get_tpc(mod_id,i); + ul_info[i]->has_tpc = 1; + } + else{ + ul_info[i]->tpc = flexran_get_tpc(mod_id,i); + ul_info[i]->has_tpc = 0; + } + /*TODO: fill in the amount of data in bytes in the MAC SDU received in this subframe for the + given logical channel*/ + ul_info[i]->n_ul_reception = 0; + ul_info[i]->ul_reception = malloc(sizeof(uint32_t) * ul_info[i]->n_ul_reception); + for (j = 0; j < ul_info[i]->n_ul_reception; j++) { + ul_info[i]->ul_reception[j] = 100; + } + /*TODO: Fill in the reception status for each UEs data*/ + ul_info[i]->reception_status = PROTOCOL__FLEX_RECEPTION_STATUS__FLRS_OK; + ul_info[i]->has_reception_status = 1; + /*Fill in the serving cell index for this UE */ + ul_info[i]->serv_cell_index = UE_PCCID(mod_id,i); + ul_info[i]->has_serv_cell_index = 1; + } + } + + sf_trigger_msg->ul_info = ul_info; + + *msg = malloc(sizeof(Protocol__FlexranMessage)); + if(*msg == NULL) + goto error; + protocol__flexran_message__init(*msg); + (*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_SF_TRIGGER_MSG; + (*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__INITIATING_MESSAGE; + (*msg)->sf_trigger_msg = sf_trigger_msg; + return 0; + + error: + if (header != NULL) + free(header); + if (sf_trigger_msg != NULL) { + for (i = 0; i < sf_trigger_msg->n_dl_info; i++) { + free(sf_trigger_msg->dl_info[i]->harq_status); + } + free(sf_trigger_msg->dl_info); + for (i = 0; i < sf_trigger_msg->n_ul_info; i++) { + free(sf_trigger_msg->ul_info[i]->reception_status); + } + free(sf_trigger_msg->ul_info); + free(sf_trigger_msg); + } + if(*msg != NULL) + free(*msg); + //LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); + return -1; +} + +int flexran_agent_mac_destroy_sf_trigger(Protocol__FlexranMessage *msg) { + int i; + if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_SF_TRIGGER_MSG) + goto error; + + free(msg->sf_trigger_msg->header); + for (i = 0; i < msg->sf_trigger_msg->n_dl_info; i++) { + free(msg->sf_trigger_msg->dl_info[i]->harq_status); + free(msg->sf_trigger_msg->dl_info[i]); + } + free(msg->sf_trigger_msg->dl_info); + for (i = 0; i < msg->sf_trigger_msg->n_ul_info; i++) { + free(msg->sf_trigger_msg->ul_info[i]->ul_reception); + free(msg->sf_trigger_msg->ul_info[i]); + } + free(msg->sf_trigger_msg->ul_info); + free(msg->sf_trigger_msg); + free(msg); + + return 0; + + error: + //LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); + return -1; +} + +int flexran_agent_mac_create_empty_dl_config(mid_t mod_id, Protocol__FlexranMessage **msg) { + + int xid = 0; + Protocol__FlexHeader *header; + if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_DL_MAC_CONFIG, &header) != 0) + goto error; + + Protocol__FlexDlMacConfig *dl_mac_config_msg; + dl_mac_config_msg = malloc(sizeof(Protocol__FlexDlMacConfig)); + if (dl_mac_config_msg == NULL) { + goto error; + } + protocol__flex_dl_mac_config__init(dl_mac_config_msg); + + dl_mac_config_msg->header = header; + dl_mac_config_msg->has_sfn_sf = 1; + dl_mac_config_msg->sfn_sf = flexran_get_sfn_sf(mod_id); + + *msg = malloc(sizeof(Protocol__FlexranMessage)); + if(*msg == NULL) + goto error; + protocol__flexran_message__init(*msg); + (*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_DL_MAC_CONFIG_MSG; + (*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__INITIATING_MESSAGE; + (*msg)->dl_mac_config_msg = dl_mac_config_msg; + + return 0; + + error: + return -1; +} + +int flexran_agent_mac_destroy_dl_config(Protocol__FlexranMessage *msg) { + int i,j, k; + if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_DL_MAC_CONFIG_MSG) + goto error; + + Protocol__FlexDlDci *dl_dci; + + free(msg->dl_mac_config_msg->header); + for (i = 0; i < msg->dl_mac_config_msg->n_dl_ue_data; i++) { + free(msg->dl_mac_config_msg->dl_ue_data[i]->ce_bitmap); + for (j = 0; j < msg->dl_mac_config_msg->dl_ue_data[i]->n_rlc_pdu; j++) { + for (k = 0; k < msg->dl_mac_config_msg->dl_ue_data[i]->rlc_pdu[j]->n_rlc_pdu_tb; k++) { + free(msg->dl_mac_config_msg->dl_ue_data[i]->rlc_pdu[j]->rlc_pdu_tb[k]); + } + free(msg->dl_mac_config_msg->dl_ue_data[i]->rlc_pdu[j]->rlc_pdu_tb); + free(msg->dl_mac_config_msg->dl_ue_data[i]->rlc_pdu[j]); + } + free(msg->dl_mac_config_msg->dl_ue_data[i]->rlc_pdu); + dl_dci = msg->dl_mac_config_msg->dl_ue_data[i]->dl_dci; + free(dl_dci->tbs_size); + free(dl_dci->mcs); + free(dl_dci->ndi); + free(dl_dci->rv); + free(dl_dci); + free(msg->dl_mac_config_msg->dl_ue_data[i]); + } + free(msg->dl_mac_config_msg->dl_ue_data); + + for (i = 0; i < msg->dl_mac_config_msg->n_dl_rar; i++) { + dl_dci = msg->dl_mac_config_msg->dl_rar[i]->rar_dci; + free(dl_dci->tbs_size); + free(dl_dci->mcs); + free(dl_dci->ndi); + free(dl_dci->rv); + free(dl_dci); + free(msg->dl_mac_config_msg->dl_rar[i]); + } + free(msg->dl_mac_config_msg->dl_rar); + + for (i = 0; i < msg->dl_mac_config_msg->n_dl_broadcast; i++) { + dl_dci = msg->dl_mac_config_msg->dl_broadcast[i]->broad_dci; + free(dl_dci->tbs_size); + free(dl_dci->mcs); + free(dl_dci->ndi); + free(dl_dci->rv); + free(dl_dci); + free(msg->dl_mac_config_msg->dl_broadcast[i]); + } + free(msg->dl_mac_config_msg->dl_broadcast); + + for ( i = 0; i < msg->dl_mac_config_msg->n_ofdm_sym; i++) { + free(msg->dl_mac_config_msg->ofdm_sym[i]); + } + free(msg->dl_mac_config_msg->ofdm_sym); + free(msg->dl_mac_config_msg); + free(msg); + + return 0; + + error: + return -1; +} + +void flexran_agent_get_pending_dl_mac_config(mid_t mod_id, Protocol__FlexranMessage **msg) { + + struct lfds700_misc_prng_state ls; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + lfds700_misc_prng_init(&ls); + + if (lfds700_ringbuffer_read(&ringbuffer_state[mod_id], NULL, (void **) msg, &ls) == 0) { + *msg = NULL; + } +} + +int flexran_agent_mac_handle_dl_mac_config(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) { + + struct lfds700_misc_prng_state ls; + enum lfds700_misc_flag overwrite_occurred_flag; + Protocol__FlexranMessage *overwritten_dl_config; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + lfds700_misc_prng_init(&ls); + + lfds700_ringbuffer_write( &ringbuffer_state[mod_id], + NULL, + (void *) params, + &overwrite_occurred_flag, + NULL, + (void **)&overwritten_dl_config, + &ls); + + if (overwrite_occurred_flag == LFDS700_MISC_FLAG_RAISED) { + // Delete unmanaged dl_config + flexran_agent_mac_destroy_dl_config(overwritten_dl_config); + } + *msg = NULL; + return 2; + + error: + *msg = NULL; + return -1; +} + +void flexran_agent_init_mac_agent(mid_t mod_id) { + lfds700_misc_library_init_valid_on_current_logical_core(); + lfds700_misc_prng_init(&ps[mod_id]); + int num_elements = RINGBUFFER_SIZE + 1; + //Allow RINGBUFFER_SIZE messages to be stored in the ringbuffer at any time + dl_mac_config_array[mod_id] = malloc( sizeof(struct lfds700_ringbuffer_element) * num_elements); + lfds700_ringbuffer_init_valid_on_current_logical_core( &ringbuffer_state[mod_id], dl_mac_config_array[mod_id], num_elements, &ps[mod_id], NULL ); +} + +/*********************************************** + * FlexRAN agent - technology mac API implementation + ***********************************************/ + +void flexran_agent_send_sr_info(mid_t mod_id) { + int size; + Protocol__FlexranMessage *msg; + void *data; + int priority; + err_code_t err_code; + + int xid = 0; + + /*TODO: Must use a proper xid*/ + err_code = flexran_agent_mac_sr_info(mod_id, (void *) &xid, &msg); + if (err_code < 0) { + goto error; + } + + if (msg != NULL){ + data=flexran_agent_pack_message(msg, &size); + /*Send sr info using the MAC channel of the eNB*/ + if (flexran_agent_msg_send(mod_id, FLEXRAN_AGENT_MAC, data, size, priority)) { + err_code = PROTOCOL__FLEXRAN_ERR__MSG_ENQUEUING; + goto error; + } + + LOG_D(FLEXRAN_AGENT,"sent message with size %d\n", size); + return; + } + error: + LOG_D(FLEXRAN_AGENT, "Could not send sr message\n"); +} + +void flexran_agent_send_sf_trigger(mid_t mod_id) { + int size; + Protocol__FlexranMessage *msg; + void *data; + int priority; + err_code_t err_code; + + int xid = 0; + + /*TODO: Must use a proper xid*/ + err_code = flexran_agent_mac_sf_trigger(mod_id, (void *) &xid, &msg); + if (err_code < 0) { + goto error; + } + + if (msg != NULL){ + data=flexran_agent_pack_message(msg, &size); + /*Send sr info using the MAC channel of the eNB*/ + if (flexran_agent_msg_send(mod_id, FLEXRAN_AGENT_MAC, data, size, priority)) { + err_code = PROTOCOL__FLEXRAN_ERR__MSG_ENQUEUING; + goto error; + } + + LOG_D(FLEXRAN_AGENT,"sent message with size %d\n", size); + return; + } + error: + LOG_D(FLEXRAN_AGENT, "Could not send sf trigger message\n"); +} + +void flexran_agent_send_update_mac_stats(mid_t mod_id) { + + Protocol__FlexranMessage *current_report = NULL, *msg; + void *data; + int size; + err_code_t err_code; + int priority; + + mac_stats_updates_context_t stats_context = mac_stats_context[mod_id]; + + if (pthread_mutex_lock(mac_stats_context[mod_id].mutex)) { + goto error; + } + + if (mac_stats_context[mod_id].cont_update == 1) { + + /*Create a fresh report with the required flags*/ + err_code = flexran_agent_mac_handle_stats(mod_id, (void *) mac_stats_context[mod_id].stats_req, ¤t_report); + if (err_code < 0) { + goto error; + } + } + /* /\*TODO:Check if a previous reports exists and if yes, generate a report */ + /* *that is the diff between the old and the new report, */ + /* *respecting the thresholds. Otherwise send the new report*\/ */ + /* if (mac_stats_context[mod_id].prev_stats_reply != NULL) { */ + + /* msg = flexran_agent_generate_diff_mac_stats_report(current_report, mac_stats_context[mod_id].prev_stats_reply); */ + + /* /\*Destroy the old stats*\/ */ + /* flexran_agent_destroy_flexran_message(mac_stats_context[mod_id].prev_stats_reply); */ + /* } */ + /* /\*Use the current report for future comparissons*\/ */ + /* mac_stats_context[mod_id].prev_stats_reply = current_report; */ + + + if (pthread_mutex_unlock(mac_stats_context[mod_id].mutex)) { + goto error; + } + + if (current_report != NULL){ + data=flexran_agent_pack_message(current_report, &size); + /*Send any stats updates using the MAC channel of the eNB*/ + if (flexran_agent_msg_send(mod_id, FLEXRAN_AGENT_MAC, data, size, priority)) { + err_code = PROTOCOL__FLEXRAN_ERR__MSG_ENQUEUING; + goto error; + } + + LOG_D(FLEXRAN_AGENT,"sent message with size %d\n", size); + return; + } + error: + LOG_D(FLEXRAN_AGENT, "Could not send sf trigger message\n"); +} + +int flexran_agent_register_mac_xface(mid_t mod_id, AGENT_MAC_xface *xface) { + if (mac_agent_registered[mod_id]) { + LOG_E(MAC, "MAC agent for eNB %d is already registered\n", mod_id); + return -1; + } + + //xface->agent_ctxt = &shared_ctxt[mod_id]; + xface->flexran_agent_send_sr_info = flexran_agent_send_sr_info; + xface->flexran_agent_send_sf_trigger = flexran_agent_send_sf_trigger; + xface->flexran_agent_send_update_mac_stats = flexran_agent_send_update_mac_stats; + xface->flexran_agent_schedule_ue_spec = flexran_schedule_ue_spec_default; + //xface->flexran_agent_schedule_ue_spec = flexran_schedule_ue_spec_remote; + xface->flexran_agent_get_pending_dl_mac_config = flexran_agent_get_pending_dl_mac_config; + xface->flexran_agent_notify_ue_state_change = flexran_agent_ue_state_change; + + xface->dl_scheduler_loaded_lib = NULL; + + mac_agent_registered[mod_id] = 1; + agent_mac_xface[mod_id] = xface; + + return 0; +} + +int flexran_agent_unregister_mac_xface(mid_t mod_id, AGENT_MAC_xface *xface) { + + //xface->agent_ctxt = NULL; + xface->flexran_agent_send_sr_info = NULL; + xface->flexran_agent_send_sf_trigger = NULL; + xface->flexran_agent_send_update_mac_stats = NULL; + xface->flexran_agent_schedule_ue_spec = NULL; + xface->flexran_agent_get_pending_dl_mac_config = NULL; + xface->flexran_agent_notify_ue_state_change = NULL; + + xface->dl_scheduler_loaded_lib = NULL; + + mac_agent_registered[mod_id] = 0; + agent_mac_xface[mod_id] = NULL; + + return 0; +} + + +/****************************************************** + *Implementations of flexran_agent_mac_internal.h functions + ******************************************************/ + +err_code_t flexran_agent_init_cont_mac_stats_update(mid_t mod_id) { + + /*Initialize the Mac stats update structure*/ + /*Initially the continuous update is set to false*/ + mac_stats_context[mod_id].cont_update = 0; + mac_stats_context[mod_id].is_initialized = 1; + mac_stats_context[mod_id].stats_req = NULL; + mac_stats_context[mod_id].prev_stats_reply = NULL; + mac_stats_context[mod_id].mutex = calloc(1, sizeof(pthread_mutex_t)); + if (mac_stats_context[mod_id].mutex == NULL) + goto error; + if (pthread_mutex_init(mac_stats_context[mod_id].mutex, NULL)) + goto error;; + + return 0; + + error: + return -1; +} + +err_code_t flexran_agent_destroy_cont_mac_stats_update(mid_t mod_id) { + /*Disable the continuous updates for the MAC*/ + mac_stats_context[mod_id].cont_update = 0; + mac_stats_context[mod_id].is_initialized = 0; + flexran_agent_destroy_flexran_message(mac_stats_context[mod_id].stats_req); + flexran_agent_destroy_flexran_message(mac_stats_context[mod_id].prev_stats_reply); + free(mac_stats_context[mod_id].mutex); + + mac_agent_registered[mod_id] = NULL; + return 1; +} + + +err_code_t flexran_agent_enable_cont_mac_stats_update(mid_t mod_id, + xid_t xid, stats_request_config_t *stats_req) { + /*Enable the continuous updates for the MAC*/ + if (pthread_mutex_lock(mac_stats_context[mod_id].mutex)) { + goto error; + } + + Protocol__FlexranMessage *req_msg; + + flexran_agent_mac_stats_request(mod_id, xid, stats_req, &req_msg); + mac_stats_context[mod_id].stats_req = req_msg; + mac_stats_context[mod_id].prev_stats_reply = NULL; + + mac_stats_context[mod_id].cont_update = 1; + mac_stats_context[mod_id].xid = xid; + + if (pthread_mutex_unlock(mac_stats_context[mod_id].mutex)) { + goto error; + } + return 0; + + error: + LOG_E(FLEXRAN_AGENT, "mac_stats_context for eNB %d is not initialized\n", mod_id); + return -1; +} + +err_code_t flexran_agent_disable_cont_mac_stats_update(mid_t mod_id) { + /*Disable the continuous updates for the MAC*/ + if (pthread_mutex_lock(mac_stats_context[mod_id].mutex)) { + goto error; + } + mac_stats_context[mod_id].cont_update = 0; + mac_stats_context[mod_id].xid = 0; + if (mac_stats_context[mod_id].stats_req != NULL) { + flexran_agent_destroy_flexran_message(mac_stats_context[mod_id].stats_req); + } + if (mac_stats_context[mod_id].prev_stats_reply != NULL) { + flexran_agent_destroy_flexran_message(mac_stats_context[mod_id].prev_stats_reply); + } + if (pthread_mutex_unlock(mac_stats_context[mod_id].mutex)) { + goto error; + } + return 0; + + error: + LOG_E(FLEXRAN_AGENT, "mac_stats_context for eNB %d is not initialized\n", mod_id); + return -1; + +} diff --git a/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.h b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.h new file mode 100644 index 0000000000000000000000000000000000000000..e2378e93119264517ab2a1c2815e3eddb242d918 --- /dev/null +++ b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.h @@ -0,0 +1,122 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file flexran_agent_mac.h + * \brief FlexRAN agent message handler APIs for MAC layer + * \author Xenofon Foukas, Mohamed Kassem and Navid Nikaein + * \date 2016 + * \version 0.1 + */ + +#ifndef FLEXRAN_AGENT_MAC_H_ +#define FLEXRAN_AGENT_MAC_H_ + +#include "header.pb-c.h" +#include "flexran.pb-c.h" +#include "stats_messages.pb-c.h" +#include "stats_common.pb-c.h" + +#include "flexran_agent_common.h" +#include "flexran_agent_extern.h" + +/* These types will be used to give + instructions for the type of stats reports + we need to create */ +typedef struct { + uint16_t ue_rnti; + uint32_t ue_report_flags; /* Indicates the report elements + required for this UE id. See + FlexRAN specification 1.2.4.2 */ +} ue_report_type_t; + +typedef struct { + uint16_t cc_id; + uint32_t cc_report_flags; /* Indicates the report elements + required for this CC index. See + FlexRAN specification 1.2.4.3 */ +} cc_report_type_t; + +typedef struct { + int nr_ue; + ue_report_type_t *ue_report_type; + int nr_cc; + cc_report_type_t *cc_report_type; +} report_config_t; + +typedef struct stats_request_config_s{ + uint8_t report_type; + uint8_t report_frequency; + uint16_t period; /*In number of subframes*/ + report_config_t *config; +} stats_request_config_t; + +/* Initialization function for the agent structures etc */ +void flexran_agent_init_mac_agent(mid_t mod_id); + +int flexran_agent_mac_handle_stats(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg); + +/* Statistics request protocol message constructor and destructor */ +int flexran_agent_mac_stats_request(mid_t mod_id, xid_t xid, const stats_request_config_t *report_config, Protocol__FlexranMessage **msg); +int flexran_agent_mac_destroy_stats_request(Protocol__FlexranMessage *msg); + +/* Statistics reply protocol message constructor and destructor */ +int flexran_agent_mac_stats_reply(mid_t mod_id, xid_t xid, const report_config_t *report_config, Protocol__FlexranMessage **msg); +int flexran_agent_mac_destroy_stats_reply(Protocol__FlexranMessage *msg); + +/* Scheduling request information protocol message constructor and estructor */ +int flexran_agent_mac_sr_info(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg); +int flexran_agent_mac_destroy_sr_info(Protocol__FlexranMessage *msg); + +/* Subframe trigger protocol msssage constructor and destructor */ +int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg); +int flexran_agent_mac_destroy_sf_trigger(Protocol__FlexranMessage *msg); + +/* DL MAC scheduling decision protocol message constructor (empty command) and destructor */ +int flexran_agent_mac_create_empty_dl_config(mid_t mod_id, Protocol__FlexranMessage **msg); +int flexran_agent_mac_destroy_dl_config(Protocol__FlexranMessage *msg); + +int flexran_agent_mac_handle_dl_mac_config(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg); + + +/********************************** + * FlexRAN agent - technology mac API + **********************************/ + +/*Inform controller about received scheduling requests during a subframe*/ +void flexran_agent_send_sr_info(mid_t mod_id); + +/*Inform the controller about the current UL/DL subframe*/ +void flexran_agent_send_sf_trigger(mid_t mod_id); + +/// Send to the controller all the mac stat updates that occured during this subframe +/// based on the stats request configuration +void flexran_agent_send_update_mac_stats(mid_t mod_id); + +/// Provide to the scheduler a pending dl_mac_config message +void flexran_agent_get_pending_dl_mac_config(mid_t mod_id, Protocol__FlexranMessage **msg); + +/*Register technology specific interface callbacks*/ +int flexran_agent_register_mac_xface(mid_t mod_id, AGENT_MAC_xface *xface); + +/*Unregister technology specific callbacks*/ +int flexran_agent_unregister_mac_xface(mid_t mod_id, AGENT_MAC_xface*xface); + +#endif diff --git a/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_defs.h b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_defs.h new file mode 100644 index 0000000000000000000000000000000000000000..bb6aed1d8e9fadda1a37339fa993635b39de7956 --- /dev/null +++ b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_defs.h @@ -0,0 +1,75 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file flexran_agent_mac_defs.h + * \brief FlexRAN agent - mac interface primitives + * \author Xenofon Foukas + * \date 2016 + * \version 0.1 + * \mail x.foukas@sms.ed.ac.uk + */ + +#ifndef __FLEXRAN_AGENT_MAC_PRIMITIVES_H__ +#define __FLEXRAN_AGENT_MAC_PRIMITIVES_H__ + +#include "flexran_agent_defs.h" +#include "flexran.pb-c.h" +#include "header.pb-c.h" + +#define RINGBUFFER_SIZE 100 + +/* FLEXRAN AGENT-MAC Interface */ +typedef struct { + //msg_context_t *agent_ctxt; + + /// Inform the controller about the scheduling requests received during the subframe + void (*flexran_agent_send_sr_info)(mid_t mod_id); + + /// Inform the controller about the current UL/DL subframe + void (*flexran_agent_send_sf_trigger)(mid_t mod_id); + + /// Send to the controller all the mac stat updates that occured during this subframe + /// based on the stats request configuration + void (*flexran_agent_send_update_mac_stats)(mid_t mod_id); + + /// Provide to the scheduler a pending dl_mac_config message + void (*flexran_agent_get_pending_dl_mac_config)(mid_t mod_id, + Protocol__FlexranMessage **msg); + + /// Run the UE DL scheduler and fill the Protocol__FlexranMessage. Assumes that + /// dl_info is already initialized as flex_dl_mac_config and fills the + /// flex_dl_data part of it + void (*flexran_agent_schedule_ue_spec)(mid_t mod_id, uint32_t frame, uint32_t subframe, + int *mbsfn_flag, Protocol__FlexranMessage **dl_info); + + + /// Notify the controller for a state change of a particular UE, by sending the proper + /// UE state change message (ACTIVATION, DEACTIVATION, HANDOVER) + void (*flexran_agent_notify_ue_state_change)(mid_t mod_id, uint32_t rnti, + uint32_t state_change); + + + void *dl_scheduler_loaded_lib; + /*TODO: Fill in with the rest of the MAC layer technology specific callbacks (UL/DL scheduling, RACH info etc)*/ + +} AGENT_MAC_xface; + +#endif diff --git a/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_internal.c b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_internal.c new file mode 100644 index 0000000000000000000000000000000000000000..a63225e657cc725f42124ccf60fcfafb228c7f45 --- /dev/null +++ b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_internal.c @@ -0,0 +1,794 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file flexran_agent_mac_internal.c + * \brief Helper functions for the MAC agent + * \author Xenofon Foukas + * \date 2016 + * \version 0.1 + */ + +#include <string.h> +#include <dlfcn.h> + +#include "flexran_agent_mac_internal.h" + +Protocol__FlexranMessage * flexran_agent_generate_diff_mac_stats_report(Protocol__FlexranMessage *new_message, + Protocol__FlexranMessage *old_message) { + + int i, j; + + Protocol__FlexStatsReply *old_report, *new_report; + + Protocol__FlexStatsReply *stats_reply_msg = NULL; + Protocol__FlexranMessage *msg = NULL; + + Protocol__FlexUeStatsReport **ue_report; + Protocol__FlexUeStatsReport *tmp_ue_report[NUM_MAX_UE]; + Protocol__FlexCellStatsReport **cell_report; + Protocol__FlexCellStatsReport *tmp_cell_report[NUM_MAX_UE]; + + old_report = old_message->stats_reply_msg; + new_report = new_message->stats_reply_msg; + + /*Flags to designate changes in various levels of the message*/ + int stats_had_changes = 0; + int ue_had_change = 0; + int cell_had_change = 0; + + /*See how many and which UE reports should be included in the final stats message*/ + int n_ue_report = 0; + int ue_found = 0; + + /*Go through each RNTI of the new report and see if it exists in the old one*/ + for (i = 0; i < new_report->n_ue_report; i++) { + for (j = 0; j < old_report->n_ue_report; i++) { + if (new_report->ue_report[i]->rnti == old_report->ue_report[j]->rnti) { + ue_found = 1; + /*Need to check if something changed*/ + if (compare_ue_stats_reports(new_report->ue_report[i], old_report->ue_report[j]) != 0) { + tmp_ue_report[n_ue_report] = copy_ue_stats_report(new_report->ue_report[i]); + n_ue_report++; + } + break; + } + } + if (!ue_found) { + tmp_ue_report[n_ue_report] = copy_ue_stats_report(new_report->ue_report[i]); + n_ue_report++; + } + ue_found = 0; + } + + /*See how many and which cell reports should be included in the final stats message*/ + int n_cell_report = 0; + int cell_found = 0; + + /*Go through each cell of the new report and see if it exists in the old one*/ + for (i = 0; i < new_report->n_cell_report; i++) { + for (j = 0; j < old_report->n_cell_report; i++) { + if (new_report->cell_report[i]->carrier_index == old_report->cell_report[j]->carrier_index) { + cell_found = 1; + /*Need to check if something changed*/ + if (compare_cell_stats_reports(new_report->cell_report[i], old_report->cell_report[j]) != 0) { + tmp_cell_report[n_cell_report] = copy_cell_stats_report(new_report->cell_report[i]); + n_cell_report++; + } + break; + } + } + if (!cell_found) { + tmp_cell_report[n_cell_report] = copy_cell_stats_report(new_report->cell_report[i]); + n_cell_report++; + } + cell_found = 0; + } + + /*TODO: create the reply message based on the findings*/ + /*Create ue report list*/ + if (n_ue_report > 0) { + ue_report = malloc(sizeof(Protocol__FlexUeStatsReport *)); + for (i = 0; i<n_ue_report; i++) { + ue_report[i] = tmp_ue_report[i]; + } + } + + /*Create cell report list*/ + if (n_cell_report > 0) { + cell_report = malloc(sizeof(Protocol__FlexCellStatsReport *)); + for (i = 0; i<n_cell_report; i++) { + cell_report[i] = tmp_cell_report[i]; + } + } + + if (n_cell_report > 0 || n_ue_report > 0) { + /*Create header*/ + int xid = old_report->header->xid; + Protocol__FlexHeader *header; + if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_STATS_REPLY, &header) != 0) { + goto error; + } + stats_reply_msg = malloc(sizeof(Protocol__FlexStatsReply)); + protocol__flex_stats_reply__init(stats_reply_msg); + stats_reply_msg->header = header; + stats_reply_msg->n_ue_report = n_ue_report; + stats_reply_msg->ue_report = ue_report; + stats_reply_msg->n_cell_report = n_cell_report; + stats_reply_msg->cell_report = cell_report; + msg = malloc(sizeof(Protocol__FlexranMessage)); + if(msg == NULL) + goto error; + protocol__flexran_message__init(msg); + msg->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_STATS_REPLY_MSG; + msg->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__SUCCESSFUL_OUTCOME; + msg->stats_reply_msg = stats_reply_msg; + } + return msg; + + error: + return NULL; +} + +int compare_ue_stats_reports(Protocol__FlexUeStatsReport *rep1, + Protocol__FlexUeStatsReport *rep2) { + return 1; +} + +int compare_cell_stats_reports(Protocol__FlexCellStatsReport *rep1, + Protocol__FlexCellStatsReport *rep2) { + return 1; +} + +Protocol__FlexUeStatsReport * copy_ue_stats_report(Protocol__FlexUeStatsReport * original) { + int i; + Protocol__FlexUeStatsReport *copy = malloc(sizeof(Protocol__FlexUeStatsReport)); + if (copy == NULL) + goto error; + protocol__flex_ue_stats_report__init(copy); + copy->rnti = original->rnti; + copy->has_rnti = original->has_rnti; + copy->flags = original->flags; + copy->has_flags = original->has_flags; + + if (copy->flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_BSR) { + copy->n_bsr = original->n_bsr; + if (copy->n_bsr > 0) { + uint32_t *elem; + elem = (uint32_t *) malloc(sizeof(uint32_t)*copy->n_bsr); + if (elem == NULL) + goto error; + for (i = 0; i < original->n_bsr; i++) { + elem[i] = original->bsr[i]; + } + copy->bsr = elem; + } + } + + if (copy->flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_PRH) { + copy->has_phr = original->has_phr; + copy->phr = original->phr; + } + + if (copy->flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_RLC_BS) { + copy->n_rlc_report = original->n_rlc_report; + if (copy->n_rlc_report > 0) { + Protocol__FlexRlcBsr ** rlc_reports; + rlc_reports = malloc(sizeof(Protocol__FlexRlcBsr) * copy->n_rlc_report); + if (rlc_reports == NULL) + goto error; + for (i = 0; i < copy->n_rlc_report; i++) { + rlc_reports[i] = copy_rlc_report(original->rlc_report[i]); + } + copy->rlc_report = rlc_reports; + } + } + + if (copy->flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_MAC_CE_BS) { + copy->has_pending_mac_ces = original->has_pending_mac_ces; + copy->pending_mac_ces = original->pending_mac_ces; + + } + + if (copy->flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_DL_CQI) { + copy->dl_cqi_report = copy_dl_cqi_report(original->dl_cqi_report); + } + + if (copy->flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_PBS) { + /*Copy the Paging Buffer report*/ + copy->pbr = copy_paging_buffer_report(original->pbr); + } + + if (copy->flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_UL_CQI) { + /*TODO: Copy the UL report*/ + copy->ul_cqi_report = copy_ul_cqi_report(original->ul_cqi_report); + } + + return copy; + + error: + return NULL; +} + +Protocol__FlexRlcBsr * copy_rlc_report(Protocol__FlexRlcBsr * original) { + Protocol__FlexRlcBsr * copy = malloc(sizeof(Protocol__FlexRlcBsr)); + if (copy == NULL) + goto error; + protocol__flex_rlc_bsr__init(copy); + copy->lc_id = original->lc_id; + copy->has_lc_id = original->has_lc_id; + copy->tx_queue_size = original->tx_queue_size; + copy->has_tx_queue_size = original->has_tx_queue_size; + copy->tx_queue_hol_delay = original->tx_queue_hol_delay; + copy->has_tx_queue_hol_delay = original->has_tx_queue_hol_delay; + copy->retransmission_queue_size = original->retransmission_queue_size; + copy->has_retransmission_queue_size = original->has_retransmission_queue_size; + copy->retransmission_queue_hol_delay = original->retransmission_queue_hol_delay; + copy->has_retransmission_queue_hol_delay = original->has_retransmission_queue_hol_delay; + copy->status_pdu_size = original->status_pdu_size; + copy->has_status_pdu_size = original->has_status_pdu_size; + + return copy; + + error: + return NULL; +} + +Protocol__FlexUlCqiReport * copy_ul_cqi_report(Protocol__FlexUlCqiReport * original) { + int i, j; + + //Fill in the full UL CQI report of the UE + Protocol__FlexUlCqiReport *full_ul_report; + full_ul_report = malloc(sizeof(Protocol__FlexUlCqiReport)); + if(full_ul_report == NULL) { + goto error; + } + protocol__flex_ul_cqi_report__init(full_ul_report); + //TODO:Set the SFN and SF of the generated report + full_ul_report->sfn_sn = original->sfn_sn; + full_ul_report->has_sfn_sn = original->has_sfn_sn; + full_ul_report->n_cqi_meas = original->n_cqi_meas; + + Protocol__FlexUlCqi **ul_report; + ul_report = malloc(sizeof(Protocol__FlexUlCqi *) * full_ul_report->n_cqi_meas); + if(ul_report == NULL) + goto error; + for(i = 0; i++; i < full_ul_report->n_cqi_meas) { + ul_report[i] = malloc(sizeof(Protocol__FlexUlCqi)); + if(ul_report[i] == NULL) + goto error; + protocol__flex_ul_cqi__init(ul_report[i]); + ul_report[i]->type = original->cqi_meas[i]->type; + ul_report[i]->has_type = original->cqi_meas[i]->has_type; + ul_report[i]->n_sinr = original->cqi_meas[i]->n_sinr; + uint32_t *sinr_meas; + sinr_meas = (uint32_t *) malloc(sizeof(uint32_t) * ul_report[i]->n_sinr); + if (sinr_meas == NULL) + goto error; + for (j = 0; j < ul_report[i]->n_sinr; j++) { + sinr_meas[j] = original->cqi_meas[i]->sinr[j]; + } + ul_report[i]->sinr = sinr_meas; + ul_report[i]->serv_cell_index = original->cqi_meas[i]->serv_cell_index; + ul_report[i]->has_serv_cell_index = original->cqi_meas[i]->has_serv_cell_index; + } + full_ul_report->cqi_meas = ul_report; + + return full_ul_report; + + error: + return NULL; +} + +Protocol__FlexDlCqiReport * copy_dl_cqi_report(Protocol__FlexDlCqiReport * original) { + int i; + /*Copy the DL report*/ + Protocol__FlexDlCqiReport * dl_report; + dl_report = malloc(sizeof(Protocol__FlexDlCqiReport)); + if (dl_report == NULL) + goto error; + protocol__flex_dl_cqi_report__init(dl_report); + + dl_report->sfn_sn = original->sfn_sn; + dl_report->has_sfn_sn = original->has_sfn_sn; + dl_report->n_csi_report = original->n_csi_report; + + Protocol__FlexDlCsi **csi_reports; + csi_reports = malloc(sizeof(Protocol__FlexDlCsi *) * dl_report->n_csi_report); + if (csi_reports == NULL) + goto error; + + for (i = 0; i < dl_report->n_csi_report; i++) { + csi_reports[i] = copy_csi_report(original->csi_report[i]); + } + dl_report->csi_report = csi_reports; + return dl_report; + + error: + /*TODO: Must free memory properly*/ + return NULL; +} + +Protocol__FlexPagingBufferReport * copy_paging_buffer_report(Protocol__FlexPagingBufferReport *original) { + + int i; + Protocol__FlexPagingBufferReport *copy; + copy = malloc(sizeof(Protocol__FlexPagingBufferReport)); + if (copy == NULL) + goto error; + + protocol__flex_paging_buffer_report__init(copy); + copy->n_paging_info = original->n_paging_info; + + Protocol__FlexPagingInfo **p_info; + p_info = malloc(sizeof(Protocol__FlexPagingInfo *) * copy->n_paging_info); + if (p_info == NULL) + goto error; + for (i = 0; i < copy->n_paging_info; i++) { + p_info[i] = malloc(sizeof(Protocol__FlexPagingInfo)); + if(p_info[i] == NULL) + goto error; + protocol__flex_paging_info__init(p_info[i]); + p_info[i]->paging_index = original->paging_info[i]->paging_index; + p_info[i]->has_paging_index = original->paging_info[i]->has_paging_index;; + p_info[i]->paging_message_size = original->paging_info[i]->paging_message_size; + p_info[i]->has_paging_message_size = original->paging_info[i]->has_paging_message_size; + p_info[i]->paging_subframe = original->paging_info[i]->paging_subframe; + p_info[i]->has_paging_subframe = original->paging_info[i]->has_paging_subframe; + p_info[i]->carrier_index = original->paging_info[i]->carrier_index; + p_info[i]->has_carrier_index = original->paging_info[i]->has_carrier_index; + } + copy->paging_info = p_info; + return copy; + + error: + /*TODO: free memory properly*/ + return NULL; +} + +Protocol__FlexDlCsi * copy_csi_report(Protocol__FlexDlCsi * original) { + int i, j; + Protocol__FlexDlCsi *copy = malloc(sizeof(Protocol__FlexDlCsi)); + if (copy == NULL) + goto error; + protocol__flex_dl_csi__init(copy); + copy->serv_cell_index = original->serv_cell_index; + copy->has_serv_cell_index = original->has_serv_cell_index; + copy->ri = original->ri; + copy->has_ri = original->ri; + + copy->type = original->type; + copy->has_type = original->has_type; + copy->report_case = original->report_case; + + switch (copy->report_case) { + case PROTOCOL__FLEX_DL_CSI__REPORT_P10CSI: + copy->p10csi->wb_cqi = original->p10csi->wb_cqi; + copy->p10csi->has_wb_cqi = original->p10csi->has_wb_cqi; + break; + case PROTOCOL__FLEX_DL_CSI__REPORT_P11CSI: + copy->p11csi->n_wb_cqi = original->p11csi->n_wb_cqi; + copy->p11csi->wb_cqi = (uint32_t *) malloc(sizeof(uint32_t) * copy->p11csi->n_wb_cqi); + for (i = 0; i < copy->p11csi->n_wb_cqi; i++) { + copy->p11csi->wb_cqi[i] = original->p11csi->wb_cqi[i]; + } + copy->p11csi->has_wb_pmi = original->p11csi->has_wb_pmi; + copy->p11csi->wb_pmi = original->p11csi->wb_pmi; + break; + case PROTOCOL__FLEX_DL_CSI__REPORT_P20CSI: + copy->p20csi->has_wb_cqi = original->p20csi->has_wb_cqi; + copy->p20csi->wb_cqi = original->p20csi->wb_cqi; + copy->p20csi->has_sb_cqi = original->p20csi->has_sb_cqi; + copy->p20csi->sb_cqi = original->p20csi->sb_cqi; + copy->p20csi->has_bandwidth_part_index = original->p20csi->has_bandwidth_part_index; + copy->p20csi->bandwidth_part_index = original->p20csi->bandwidth_part_index; + copy->p20csi->has_sb_index = original->p20csi->has_sb_index; + copy->p20csi->sb_index = original->p20csi->sb_index; + break; + case PROTOCOL__FLEX_DL_CSI__REPORT_P21CSI: + copy->p21csi->n_wb_cqi = original->p21csi->n_wb_cqi; + copy->p21csi->wb_cqi = (uint32_t *) malloc(sizeof(uint32_t) * copy->p21csi->n_wb_cqi); + for (i = 0; i < copy->p21csi->n_wb_cqi; i++) { + copy->p21csi->wb_cqi[i] = original->p21csi->wb_cqi[i]; + } + copy->p21csi->has_wb_pmi = original->p21csi->has_wb_pmi; + copy->p21csi->wb_pmi = original->p21csi->wb_pmi; + copy->p21csi->n_sb_cqi = original->p21csi->n_sb_cqi; + copy->p21csi->sb_cqi = (uint32_t *) malloc(sizeof(uint32_t) * copy->p21csi->n_sb_cqi); + for (i = 0; i < copy->p21csi->n_sb_cqi; i++) { + copy->p21csi->sb_cqi[i] = original->p21csi->sb_cqi[i]; + } + copy->p21csi->has_badwidth_part_index = original->p21csi->has_badwidth_part_index; + copy->p21csi->badwidth_part_index = original->p21csi->badwidth_part_index; + copy->p21csi->has_sb_index = original->p21csi->has_sb_index; + copy->p21csi->sb_index = original->p21csi->sb_index; + break; + case PROTOCOL__FLEX_DL_CSI__REPORT_A12CSI: + copy->a12csi->n_wb_cqi = original->a12csi->n_wb_cqi; + copy->a12csi->wb_cqi = (uint32_t *) malloc(sizeof(uint32_t) * copy->a12csi->n_wb_cqi); + for (i = 0; i < copy->a12csi->n_wb_cqi; i++) { + copy->a12csi->wb_cqi[i] = original->a12csi->wb_cqi[i]; + } + copy->a12csi->n_sb_pmi = original->a12csi->n_sb_pmi; + copy->a12csi->sb_pmi = (uint32_t *) malloc(sizeof(uint32_t) * copy->a12csi->n_sb_pmi); + for (i = 0; i < copy->a12csi->n_sb_pmi; i++) { + copy->a12csi->sb_pmi[i] = original->a12csi->sb_pmi[i]; + } + break; + case PROTOCOL__FLEX_DL_CSI__REPORT_A22CSI: + copy->a22csi->n_wb_cqi = original->a22csi->n_wb_cqi; + copy->a22csi->wb_cqi = (uint32_t *) malloc(sizeof(uint32_t) * copy->a22csi->n_wb_cqi); + for (i = 0; i < copy->a22csi->n_wb_cqi; i++) { + copy->a22csi->wb_cqi[i] = original->a22csi->wb_cqi[i]; + } + copy->a22csi->n_sb_cqi = original->a22csi->n_sb_cqi; + copy->a22csi->sb_cqi = (uint32_t *) malloc(sizeof(uint32_t) * copy->a22csi->n_sb_cqi); + for (i = 0; i < copy->a22csi->n_sb_cqi; i++) { + copy->a22csi->sb_cqi[i] = original->a22csi->sb_cqi[i]; + } + copy->a22csi->has_wb_pmi = original->a22csi->has_wb_pmi; + copy->a22csi->wb_pmi = original->a22csi->wb_pmi; + copy->a22csi->has_sb_pmi = original->a22csi->has_sb_pmi; + copy->a22csi->sb_pmi = original->a22csi->sb_pmi; + copy->a22csi->n_sb_list = original->a22csi->n_sb_list; + copy->a22csi->sb_list = (uint32_t *) malloc(sizeof(uint32_t) * copy->a22csi->n_sb_list); + for (i = 0; i < copy->a22csi->n_sb_list; i++) { + copy->a22csi->sb_list[i] = original->a22csi->sb_list[i]; + } + break; + case PROTOCOL__FLEX_DL_CSI__REPORT_A20CSI: + copy->a20csi->has_wb_cqi = original->a20csi->has_wb_cqi; + copy->a20csi->wb_cqi = original->a20csi->wb_cqi; + copy->a20csi->has_sb_cqi = original->a20csi->has_sb_cqi; + copy->a20csi->sb_cqi = original->a20csi->sb_cqi; + copy->a20csi->n_sb_list = original->a20csi->n_sb_list; + copy->a20csi->sb_list = (uint32_t *) malloc(sizeof(uint32_t) * copy->a20csi->n_sb_list); + for (i = 0; i < copy->a20csi->n_sb_list; i++) { + copy->a20csi->sb_list[i] = original->a20csi->sb_list[i]; + } + break; + case PROTOCOL__FLEX_DL_CSI__REPORT_A30CSI: + copy->a30csi->has_wb_cqi = original->a30csi->has_wb_cqi; + copy->a30csi->wb_cqi = original->a30csi->wb_cqi; + copy->a30csi->n_sb_cqi = original->a30csi->n_sb_cqi; + copy->a30csi->sb_cqi = (uint32_t *) malloc(sizeof(uint32_t) * copy->a30csi->n_sb_cqi); + for (i = 0; i < copy->a30csi->n_sb_cqi; i++) { + copy->a30csi->sb_cqi[i] = original->a30csi->sb_cqi[i]; + } + break; + case PROTOCOL__FLEX_DL_CSI__REPORT_A31CSI: + copy->a31csi->n_wb_cqi = original->a31csi->n_wb_cqi; + copy->a31csi->wb_cqi = (uint32_t *) malloc(sizeof(uint32_t) * copy->a31csi->n_wb_cqi); + for (i = 0; i < copy->a31csi->n_wb_cqi; i++) { + copy->a31csi->wb_cqi[i] = original->a31csi->wb_cqi[i]; + } + copy->a31csi->has_wb_pmi = original->a31csi->has_wb_pmi; + copy->a31csi->wb_pmi = original->a31csi->wb_pmi; + copy->a31csi->n_sb_cqi = original->a31csi->n_sb_cqi; + copy->a31csi->sb_cqi = malloc(sizeof(Protocol__FlexMsbCqi *) * copy->a31csi->n_sb_cqi); + if (copy->a31csi == NULL) { + goto error; + } + for (i = 0; i < copy->a31csi->n_sb_cqi; i++) { + copy->a31csi->sb_cqi[i] = malloc(sizeof(Protocol__FlexMsbCqi)); + if (copy->a31csi->sb_cqi[i] == NULL) { + goto error; + } + protocol__flex_msb_cqi__init(copy->a31csi->sb_cqi[i]); + copy->a31csi->sb_cqi[i]->n_sb_cqi = original->a31csi->sb_cqi[i]->n_sb_cqi; + copy->a31csi->sb_cqi[i]->sb_cqi = (uint32_t *) malloc(sizeof(uint32_t) * copy->a31csi->sb_cqi[i]->n_sb_cqi); + for (j = 0; j < copy->a31csi->sb_cqi[i]->n_sb_cqi; j++) { + copy->a31csi->sb_cqi[i]->sb_cqi[j] = original->a31csi->sb_cqi[i]->sb_cqi[j]; + } + } + break; + default: + goto error; + } + return copy; + + error: + return NULL; +} + +Protocol__FlexCellStatsReport * copy_cell_stats_report(Protocol__FlexCellStatsReport *original) { + + Protocol__FlexCellStatsReport * copy = malloc(sizeof(Protocol__FlexCellStatsReport)); + + if(copy == NULL) { + goto error; + } + protocol__flex_cell_stats_report__init(copy); + copy->carrier_index = original->carrier_index; + copy->has_carrier_index = original->has_carrier_index; + copy->flags = original->flags; + copy->has_flags = original->has_flags; + + if(copy->flags & PROTOCOL__FLEX_CELL_STATS_TYPE__FLCST_NOISE_INTERFERENCE) { + copy->noise_inter_report = copy_noise_inter_report(original->noise_inter_report); + } + + return copy; + + error: + return NULL; +} + +Protocol__FlexNoiseInterferenceReport * copy_noise_inter_report(Protocol__FlexNoiseInterferenceReport *original) { + Protocol__FlexNoiseInterferenceReport *ni_report; + ni_report = malloc(sizeof(Protocol__FlexNoiseInterferenceReport)); + if(ni_report == NULL) { + goto error; + } + protocol__flex_noise_interference_report__init(ni_report); + // Current frame and subframe number + ni_report->sfn_sf = original->sfn_sf; + ni_report->has_sfn_sf = original->sfn_sf; + // Received interference power in dbm + ni_report->rip = original->rip; + ni_report->has_rip = original->has_rip; + // Thermal noise power in dbm + ni_report->tnp = original->tnp; + ni_report->has_tnp = original->has_tnp; + + return ni_report; + + error: + return NULL; +} + + +int parse_mac_config(mid_t mod_id, yaml_parser_t *parser) { + + yaml_event_t event; + + int done = 0; + + int sequence_started = 0; + int mapping_started = 0; + + while (!done) { + + if (!yaml_parser_parse(parser, &event)) + goto error; + + switch (event.type) { + case YAML_SEQUENCE_START_EVENT: + LOG_D(ENB_APP, "A sequence just started as expected\n"); + sequence_started = 1; + break; + case YAML_SEQUENCE_END_EVENT: + LOG_D(ENB_APP, "A sequence ended\n"); + sequence_started = 0; + break; + case YAML_MAPPING_START_EVENT: + if (!sequence_started) { + goto error; + } + LOG_D(ENB_APP, "A mapping started\n"); + mapping_started = 1; + break; + case YAML_MAPPING_END_EVENT: + if (!mapping_started) { + goto error; + } + LOG_D(ENB_APP, "A mapping ended\n"); + mapping_started = 0; + break; + case YAML_SCALAR_EVENT: + if (!mapping_started) { + goto error; + } + // Check the types of subsystems offered and handle their values accordingly + if (strcmp(event.data.scalar.value, "dl_scheduler") == 0) { + LOG_D(ENB_APP, "This is for the dl_scheduler subsystem\n"); + // Call the proper handler + if (parse_dl_scheduler_config(mod_id, parser) == -1) { + LOG_D(ENB_APP, "An error occured\n"); + goto error; + } + } else if (strcmp(event.data.scalar.value, "ul_scheduler") == 0) { + // Call the proper handler + LOG_D(ENB_APP, "This is for the ul_scheduler subsystem\n"); + goto error; + // TODO + } else if (strcmp(event.data.scalar.value, "ra_scheduler") == 0) { + // Call the proper handler + // TODO + } else if (strcmp(event.data.scalar.value, "page_scheduler") == 0) { + // Call the proper handler + // TODO + } else { + // Unknown subsystem + goto error; + } + break; + default: // We expect nothing else at this level of the hierarchy + goto error; + } + + done = (event.type == YAML_SEQUENCE_END_EVENT); + + yaml_event_delete(&event); + + } + + return 0; + + error: + yaml_event_delete(&event); + return -1; + +} + +int parse_dl_scheduler_config(mid_t mod_id, yaml_parser_t *parser) { + + yaml_event_t event; + + int done = 0; + int mapping_started = 0; + + while (!done) { + + if (!yaml_parser_parse(parser, &event)) + goto error; + + switch (event.type) { + // We are expecting a mapping (behavior and parameters) + case YAML_MAPPING_START_EVENT: + LOG_D(ENB_APP, "The mapping of the subsystem started\n"); + mapping_started = 1; + break; + case YAML_MAPPING_END_EVENT: + LOG_D(ENB_APP, "The mapping of the subsystem ended\n"); + mapping_started = 0; + break; + case YAML_SCALAR_EVENT: + if (!mapping_started) { + goto error; + } + // Check what key needs to be set + if (strcmp(event.data.scalar.value, "behavior") == 0) { + LOG_I(ENB_APP, "Time to set the behavior attribute\n"); + yaml_event_delete(&event); + if (!yaml_parser_parse(parser, &event)) { + goto error; + } + if (event.type == YAML_SCALAR_EVENT) { + if (load_dl_scheduler_function(mod_id, event.data.scalar.value) == -1) { + goto error; + } + } else { + goto error; + } + } else if (strcmp(event.data.scalar.value, "parameters") == 0) { + LOG_D(ENB_APP, "Now it is time to set the parameters for this subsystem\n"); + if (parse_dl_scheduler_parameters(mod_id, parser) == -1) { + goto error; + } + } + break; + default: + goto error; + } + + done = (event.type == YAML_MAPPING_END_EVENT); + yaml_event_delete(&event); + } + + return 0; + + error: + yaml_event_delete(&event); + return -1; +} + +int parse_dl_scheduler_parameters(mid_t mod_id, yaml_parser_t *parser) { + yaml_event_t event; + + void *param; + + int done = 0; + int mapping_started = 0; + + while (!done) { + + if (!yaml_parser_parse(parser, &event)) + goto error; + + switch (event.type) { + // We are expecting a mapping of parameters + case YAML_MAPPING_START_EVENT: + LOG_D(ENB_APP, "The mapping of the parameters started\n"); + mapping_started = 1; + break; + case YAML_MAPPING_END_EVENT: + LOG_D(ENB_APP, "The mapping of the parameters ended\n"); + mapping_started = 0; + break; + case YAML_SCALAR_EVENT: + if (!mapping_started) { + goto error; + } + // Check what key needs to be set + if (mac_agent_registered[mod_id]) { + LOG_D(ENB_APP, "Setting parameter %s\n", event.data.scalar.value); + param = dlsym(agent_mac_xface[mod_id]->dl_scheduler_loaded_lib, + event.data.scalar.value); + if (param == NULL) { + goto error; + } + apply_parameter_modification(param, parser); + } else { + goto error; + } + break; + default: + goto error; + } + + done = (event.type == YAML_MAPPING_END_EVENT); + yaml_event_delete(&event); + } + + return 0; + + error: + yaml_event_delete(&event); + return -1; +} + +int load_dl_scheduler_function(mid_t mod_id, const char *function_name) { + void *lib; + + char lib_name[120]; + char target[512]; + snprintf(lib_name, sizeof(lib_name), "/%s.so", function_name); + strcpy(target, local_cache); + strcat(target, lib_name); + + LOG_I(FLEXRAN_AGENT, "Opening pushed code: %s\n", target); + lib = dlopen(target, RTLD_NOW); + if (lib == NULL) { + LOG_I(FLEXRAN_AGENT, "Could not load library\n"); + goto error; + } + + LOG_I(FLEXRAN_AGENT, "Loading function: %s\n", function_name); + void *loaded_scheduler = dlsym(lib, function_name); + if (loaded_scheduler) { + if (mac_agent_registered[mod_id]) { + agent_mac_xface[mod_id]->flexran_agent_schedule_ue_spec = loaded_scheduler; + if (agent_mac_xface[mod_id]->dl_scheduler_loaded_lib != NULL) { + dlclose(agent_mac_xface[mod_id]->dl_scheduler_loaded_lib); + } + agent_mac_xface[mod_id]->dl_scheduler_loaded_lib = lib; + LOG_I(FLEXRAN_AGENT, "New DL UE scheduler: %s\n", function_name); + } + } else { + LOG_I(FLEXRAN_AGENT, "Scheduler could not be loaded\n"); + } + + return 0; + + error: + return -1; + +} diff --git a/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_internal.h b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_internal.h new file mode 100644 index 0000000000000000000000000000000000000000..9a7d4a8555b070fde7f389e30b46d256f84bc278 --- /dev/null +++ b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_internal.h @@ -0,0 +1,106 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file flexran_agent_mac_internal.h + * \brief Implementation specific definitions for the FlexRAN MAC agent + * \author Xenofon Foukas + * \date 2016 + * \version 0.1 + */ + +#ifndef FLEXRAN_AGENT_MAC_INTERNAL_H_ +#define FLEXRAN_AGENT_MAC_INTERNAL_H_ + +#include <pthread.h> + +#include <yaml.h> + +#include "flexran_agent_mac.h" +#include "flexran_agent_common.h" +#include "flexran_agent_defs.h" + +/*This will be used for producing continuous status updates for the MAC + *Needs to be thread-safe + */ +typedef struct { + /*Flag showing if continuous mac stats update is enabled*/ + uint8_t is_initialized; + volatile uint8_t cont_update; + xid_t xid; + Protocol__FlexranMessage *stats_req; + Protocol__FlexranMessage *prev_stats_reply; + + pthread_mutex_t *mutex; +} mac_stats_updates_context_t; + +/*Array holding the last stats reports for each eNB. Used for continuous reporting*/ +mac_stats_updates_context_t mac_stats_context[NUM_MAX_ENB]; + +/*Functions to initialize and destroy the struct required for the + *continuous stats update report*/ +err_code_t flexran_agent_init_cont_mac_stats_update(mid_t mod_id); + +err_code_t flexran_agent_destroy_cont_mac_stats_update(mid_t mod_id); + + +/*Enable/Disable the continuous stats update service for the MAC*/ +err_code_t flexran_agent_enable_cont_mac_stats_update(mid_t mod_id, xid_t xid, + stats_request_config_t *stats_req); + +err_code_t flexran_agent_disable_cont_mac_stats_update(mid_t mod_id); + +Protocol__FlexranMessage * flexran_agent_generate_diff_mac_stats_report(Protocol__FlexranMessage *new_report, + Protocol__FlexranMessage *old_report); + +Protocol__FlexUeStatsReport * copy_ue_stats_report(Protocol__FlexUeStatsReport * original); + +Protocol__FlexCellStatsReport * copy_cell_stats_report(Protocol__FlexCellStatsReport *original); + +Protocol__FlexRlcBsr * copy_rlc_report(Protocol__FlexRlcBsr * original); + +Protocol__FlexUlCqiReport * copy_ul_cqi_report(Protocol__FlexUlCqiReport * original); + +Protocol__FlexDlCqiReport * copy_dl_cqi_report(Protocol__FlexDlCqiReport * original); + +Protocol__FlexPagingBufferReport * copy_paging_buffer_report(Protocol__FlexPagingBufferReport *original); + +Protocol__FlexDlCsi * copy_csi_report(Protocol__FlexDlCsi * original); + +Protocol__FlexNoiseInterferenceReport * copy_noise_inter_report(Protocol__FlexNoiseInterferenceReport *original); + +int compare_ue_stats_reports(Protocol__FlexUeStatsReport *rep1, + Protocol__FlexUeStatsReport *rep2); + +int compare_cell_stats_reports(Protocol__FlexCellStatsReport *rep1, + Protocol__FlexCellStatsReport *rep2); + + +/* Functions for parsing the MAC agent policy reconfiguration command */ + +int parse_mac_config(mid_t mod_id, yaml_parser_t *parser); + +int parse_dl_scheduler_config(mid_t mod_id, yaml_parser_t *parser); + +int parse_dl_scheduler_parameters(mid_t mod_id, yaml_parser_t *parser); + +int load_dl_scheduler_function(mid_t mod_id, const char *function_name); + +#endif /*FLEXRAN_AGENT_MAC_INTERNAL_H_*/ diff --git a/openair2/ENB_APP/MESSAGES/V2/config_common.proto b/openair2/ENB_APP/MESSAGES/V2/config_common.proto new file mode 100644 index 0000000000000000000000000000000000000000..51ae7112770a701d9212ebc2801e3fb6f8753322 --- /dev/null +++ b/openair2/ENB_APP/MESSAGES/V2/config_common.proto @@ -0,0 +1,180 @@ +//'syntax = "proto2";' +package protocol; + +// +// Cell config related structures and enums +// + +message flex_si_config { + optional uint32 sfn = 1; + optional uint32 sib1_length = 2; // The length of SIB1 in bytes + optional uint32 si_window_length = 3; // The scheduling window for all SIs in SF + repeated flex_si_message si_message = 4; // List of SI messages to be sent. + // The index identifies the type of an SI message + // 0 - SIB1 + // 1..31 - SIx + // 32..63 - PCCH +} + +message flex_si_message { + optional uint32 periodicity = 1; // Periodicity of SI msg in radio frames + optional uint32 length = 2; // The length of the SI message in bytes +} + +enum flex_hopping_mode { + FLHM_INTER = 0; + FLHM_INTERINTRA = 1; +} + +enum flex_phich_resource { + FLPR_ONE_SIXTH = 0; + FLPR_HALF = 1; + FLPR_ONE = 2; + FLPR_TWO = 3; +} + +enum flex_phich_duration { + FLPD_NORMAL = 0; + FLPD_EXTENDED = 1; +} + +enum flex_ul_cyclic_prefix_length { + FLUCPL_NORMAL = 0; + FLUCPL_EXTENDED = 1; +} + +enum flex_dl_cyclic_prefix_length { + FLDCPL_NORMAL = 0; + FLDCPL_EXTENDED = 1; +} + +enum flex_duplex_mode { + FLDM_TDD = 0; + FLDM_FDD = 1; +} + +enum flex_qam { + FLEQ_MOD_16QAM = 0; + FLEQ_MOD_64QAM = 1; +} + +// +// UE config related structures and enums +// + +message flex_drx_config { + optional uint32 on_duration_timer = 1; // Timer in SF. See TS 36.321 + optional uint32 drx_inactivity_timer = 2; // Timer in SF. See TS 36.321 + optional uint32 drx_retransmission_timer = 3; // Timer in SF. See TS 36.321 + optional uint32 long_drx_cycle = 4; // In SF. See TS 36.321 + optional uint32 long_drx_cycle_start_offset = 5;// See TS 36.321 + optional uint32 short_drx_cycle = 6; // In SF + optional uint32 drx_short_cycle_timer = 7; // Timer in subframes. See TS 36.321 +} + +message flex_sps_config { + optional uint32 semi_persistent_sched_interval_UL = 1; // SPS UL scheduling interval in SF + optional uint32 semi_persistent_sched_interval_DL = 2; // SPS DL scheduling interval in SF + optional uint32 num_of_conf_sps_proc = 3; // Number of SPS HARQ processes. See TS 36.321 + repeated uint32 n1_PUCCH_AN_persistent_element = 4;// See TS36.213. Ignored when config is used + // as part of FLPT_SET_UE_CONFIG + optional uint32 implicit_release_after = 5; // number of empty transmissions before release of SPS +} + +message flex_sr_config { + optional uint32 sr_action = 1; // Indicates if SR config should be changed or released + // One of the FLSRA_* enum values + optional uint32 sched_interval = 2; // SR scheduling interval in SF + optional uint32 dsr_trans_max = 3; // See TS 36.213 +} + +message flex_cqi_config { + optional uint32 cqi_action = 1; // Indicats if CQI changed or released. + // One of the FLSRA_* enum values + optional uint32 cqi_sched_interval = 2; // CQI scheduling interval in SF + optional uint32 ri_sched_interval = 3; // RI scheduling interval in SF +} + +message flex_ue_capabilities { + optional uint32 half_duplex = 1; // Boolean value. Only half duplex support. FDD operation + optional uint32 intra_SF_hopping = 2; // Support for intra-subframe hopping. Boolean value + optional uint32 type2_sb_1 = 3; // Support for type 2 hopping with n_sb > 1 + optional uint32 ue_category = 4; + optional uint32 res_alloc_type1 = 5; // Boolean value. UE support for resource allocation type 1 +} + +message flex_scell_config { + optional uint32 carrier_index = 1; // Id of the carrier component + optional uint32 scell_index = 2; // Index of this Scell (RRC SCellIndex) + optional uint32 use_ccs = 3; // Boolean value. Indicates if cross-carrier scheduling + // is used by this SCell + optional uint32 sched_cell_index = 4; // Index of the cell responsible for scheduling + // this SCell if cross-carrier scheduling is enabled + optional uint32 pdsch_start = 5; // Starting OFDM symbol of PDSCH data region for this SCell +} + +enum flex_meas_gap_config_pattern { + FLMGCP_GP1 = 0; + FLMGCP_GP2 = 1; + FLMGCP_OFF = 2; +} + +enum flex_setup_release_action { + FLSRA_SETUP = 0; + FLSRA_RELEASE = 1; +} + +enum flex_ue_transmission_antenna { + FLUTA_NONE = 0; + FLUTA_OPEN_LOOP = 1; + FLUTA_CLOSED_LOOP = 2; +} + +enum flex_aperiodic_cqi_report_mode { + FLACRM_RM12 = 0; + FLACRM_RM20 = 1; + FLACRM_RM22 = 2; + FLACRM_RM30 = 3; + FLACRM_RM31 = 4; + FLACRM_NONE = 5; +} + +enum flex_tdd_ack_nack_feedback_mode { + FLTANFM_BUNDLING = 0; + FLTANFM_MULTIPLEXING = 1; +} + +// +// Logical channel config related structures and enums +// + +message flex_lc_config { + optional uint32 lcid = 1; // The logical channel id + optional uint32 lcg = 2; // The logical channel group (0..3) the LC is mapped to + optional uint32 direction = 3; // The LC direction. One of the FLLCD_* enum values + optional uint32 qos_bearer_type = 4;// GBR or NGBR bearer. One of the FLQBT_* enum values + optional uint32 qci = 5; // The QCI defined in TS 23.203, coded as defined in TS 36.413 + // One less than the actual QCI value + optional uint64 e_RAB_max_bitrate_UL = 6; // In bps (GBR only) + optional uint64 e_RAB_max_bitrate_DL = 7; // In bps (GBR only) + optional uint64 e_RAB_guaranteed_bitrate_UL = 8; // In bps (GBR only) + optional uint64 e_RAB_guaranteed_bitrate_DL = 9; // In bps (GBR only) +} + +enum flex_lc_direction { + FLLCD_UL = 0; + FLLCD_DL = 1; + FLLCD_BOTH = 2; +} + +enum flex_qos_bearer_type { + FLQBT_NON_GBR = 0; + FLQBT_GBR = 1; +} + +enum flex_ue_state_change_type { + FLUESC_UPDATED = 0; + FLUESC_ACTIVATED = 1; + FLUESC_DEACTIVATED = 2; + FLUESC_MOVED = 3; +} \ No newline at end of file diff --git a/openair2/ENB_APP/MESSAGES/V2/config_messages.proto b/openair2/ENB_APP/MESSAGES/V2/config_messages.proto new file mode 100644 index 0000000000000000000000000000000000000000..441e193569343b1b3a619ce3e97da437d55bc9d1 --- /dev/null +++ b/openair2/ENB_APP/MESSAGES/V2/config_messages.proto @@ -0,0 +1,88 @@ +//'syntax = "proto2";' +package protocol; + +import "config_common.proto"; + +message flex_cell_config { + optional uint32 phy_cell_id = 1; // The PCI of this cell + optional uint32 cell_id = 2; // The PLMN cell id of this cell + optional uint32 pusch_hopping_offset = 3; // PUSCH resources in RBs for hopping + optional uint32 hopping_mode = 4; // One of the FLHM_* enum values + optional uint32 n_sb = 5; // The number of subbands + optional uint32 phich_resource = 6; // The number of REGs used for PHICH + // One of the FLPR_* enum values + optional uint32 phich_duration = 7; // One of the FLPD_* enum values + optional uint32 init_nr_PDCCH_OFDM_sym = 8; // See TS 36.211, section 6.9 + optional flex_si_config si_config = 9; // The SI configuration + optional uint32 dl_bandwidth = 10; // The DL transmission bandwidth in RBs + optional uint32 ul_bandwidth = 11; // The UL transmission bandwidth in RBs + optional uint32 ul_cyclic_prefix_length = 13; // One of the FLUCPL_* enum values + optional uint32 dl_cyclic_prefix_length = 14; // One of the FLDCPL_* enum values + optional uint32 antenna_ports_count = 15; // Number of cell specific antenna ports + optional uint32 duplex_mode = 16; // One of the FLDM_* enum values + optional uint32 subframe_assignment = 17; // DL/UL subframe assignment. TDD only + optional uint32 special_subframe_patterns = 18; // TDD only. See TS 36.211, table 4.2.1 + repeated uint32 mbsfn_subframe_config_rfperiod = 19; // The MBSFN radio frame period (Optional) + repeated uint32 mbsfn_subframe_config_rfoffset = 20; // The radio frame offset (Optional) + repeated uint32 mbsfn_subframe_config_sfalloc = 21; // Bitmap indicating the MBSFN subframes (Optional) + optional uint32 prach_config_index = 22; // See TS 36.211, section 5.7.1 + optional uint32 prach_freq_offset = 23; // See TS 36.211, section 5.7.1 + optional uint32 ra_response_window_size = 24; // The duration of the RA response window in SF + optional uint32 mac_contention_resolution_timer = 25; // Timer for RA + optional uint32 max_HARQ_Msg3Tx = 26; // See TS 36.321 + optional uint32 n1PUCCH_AN = 27; // See TS 36.213, section 10.1 + optional uint32 deltaPUCCH_shift = 28; // See TS 36.211, section 5.4 + optional uint32 nRB_cqi = 29; // See TS 36.211, section 5.4 + optional uint32 srs_subframe_config = 30; // See TS 36.211, table 5.5.3.3-1 and 2 + optional uint32 srs_bw_config = 31; // See TS 36.211, section 5.5.3.2 + optional uint32 srs_mac_up_pts = 32; // Boolean value. See TS 36.211, section 5.5.3.2. TDD only + optional uint32 enable_64QAM = 33; // One of the FLEQ_* enum values + optional uint32 carrier_index = 34; // Carrier component index +} + +message flex_ue_config { + optional uint32 rnti = 1; + optional flex_drx_config drx_config = 2; // The DRX configuration (Optional) + optional uint32 time_alignment_timer = 3; // Timer in SF. Control the synchronization + // status of the UE, not the actual advance procedure + // See TS 36.321 + optional uint32 meas_gap_config_pattern = 4; // Measurement gap configuration. + // One of the FLMGCP_* enum values + // See TS 36.133 + optional uint32 meas_gap_config_sf_offset = 5; // Measurement gap offset if applicable + optional flex_sps_config sps_config = 6; // The SPS configuration (Optional) + optional flex_sr_config sr_config = 7; // The SR configuration (Optional) + optional flex_cqi_config cqi_config = 8; // The CQI configuration (Optional) + optional uint32 transmission_mode = 9; // The UE transmission mode + optional uint64 ue_aggregated_max_bitrate_UL = 10; // Aggregated bit-rate of non-gbr bearer + // per UE. See TS 36.413 + optional uint64 ue_aggregated_max_bitrate_DL = 11; // Aggregated bit-rate of non-gbr bearer + // per UE. See TS 36.413 + optional flex_ue_capabilities capabilities = 12; + optional uint32 ue_transmission_antenna = 13; // One of the FLUTA_* enum values + optional uint32 tti_bundling = 14; // Boolean value. See TS 36.321 + optional uint32 max_HARQ_tx = 15; // The max HARQ retransmission for UL + optional uint32 beta_offset_ACK_index = 16; // See TS 36.213 + optional uint32 beta_offset_RI_index = 17; // See TS 36.213 + optional uint32 beta_offset_CQI_index = 18; // See TS 36.213 + optional uint32 ack_nack_simultaneous_trans = 19;// Boolean. See TS 36.213 + optional uint32 simultaneous_ack_nack_cqi = 20; // Boolean. See TS 36.213 + optional uint32 aperiodic_cqi_rep_mode = 21; // One of the FLACRM_* enum values + optional uint32 tdd_ack_nack_feedback = 22; // One of the FLTANFM_* enum values + optional uint32 ack_nack_repetition_factor = 23;// See TS 36.213, section 10.1 + optional uint32 extended_bsr_size = 24; // Boolean for extended BSR size + optional uint32 ca_support = 25; // Boolean. Support for carrier aggregation + optional uint32 cross_carrier_sched_support = 26; // Boolean value + optional uint32 pcell_carrier_index = 27; // Index of primary cell + repeated flex_scell_config scell_config = 28; // Secondary cells configuration + optional uint32 scell_deactivation_timer = 29;// Deactivation timer for secondary cell +} + +message flex_lc_ue_config { + optional uint32 rnti = 1; + repeated flex_lc_config lc_config = 2; // A list of LC configurations for the given UE +} + + + + diff --git a/openair2/ENB_APP/MESSAGES/V2/control_delegation.proto b/openair2/ENB_APP/MESSAGES/V2/control_delegation.proto new file mode 100644 index 0000000000000000000000000000000000000000..3a5efaf7d40d427d6b1fa3185eba77f36d460ff2 --- /dev/null +++ b/openair2/ENB_APP/MESSAGES/V2/control_delegation.proto @@ -0,0 +1,6 @@ +//'syntax = "proto2";' +package protocol; + +enum flex_control_delegation_type { + FLCDT_MAC_DL_UE_SCHEDULER = 1; // DL UE scheduler delegation +} \ No newline at end of file diff --git a/openair2/ENB_APP/MESSAGES/V2/controller_commands.proto b/openair2/ENB_APP/MESSAGES/V2/controller_commands.proto new file mode 100644 index 0000000000000000000000000000000000000000..cbec332b304085d4389d7b3498556fc29a9803dd --- /dev/null +++ b/openair2/ENB_APP/MESSAGES/V2/controller_commands.proto @@ -0,0 +1,58 @@ +package protocol; + +import "mac_primitives.proto"; + +// +// Body of UE DL MAC scheduling configuration info +// + +message flex_dl_data { + optional uint32 rnti = 1; + optional flex_dl_dci dl_dci = 2; + repeated uint32 ce_bitmap = 3; // list of 2 MAC CEs, one for each TB + repeated flex_rlc_pdu rlc_pdu = 4; // list of parameters for the creation of RLC PDUs. One for each lcid + optional uint32 serv_cell_index = 5; + optional uint32 act_deact_ce = 6; //Hex content of MAC CE for Activation/Deactivation in CA +} + +// +// Body of the RAR scheduler configuration +// +message flex_dl_rar { + optional uint32 rnti = 1; + optional uint32 grant = 2; // The 20-bit UL grant. TS 36.213, sec 6.2 + optional flex_dl_dci rar_dci = 3; + optional uint32 carrier_index = 4; // The carrier index for the RAR +} + +// +// Body of the paging/broadcast configuration message +// + +message flex_dl_broadcast { + optional uint32 type = 1; // The FLBT_* values + optional uint32 index = 2; // Index of the broadcast message: + // 0 - SIB1, + // 1..31 - Six, + // 32..63 - PCCH (PCCH index obtained from flex_paging_info) + optional flex_dl_dci broad_dci = 3; + optional uint32 carrier_index = 4; // Index of the carrier for broadcast +} + +// +// Body of the OFDM symbol count message +// + +message flex_pdcch_ofdm_sym_count { + optional uint32 carrier_index = 1; + optional uint32 num_pdcch_ofdm_symbols = 2; +} + +// +// Types of commands related enums +// + +enum flex_broadcast_type { + FLBT_BCCH = 0; + FLBT_PCCH = 1; +} \ No newline at end of file diff --git a/openair2/ENB_APP/MESSAGES/V2/flexran.proto b/openair2/ENB_APP/MESSAGES/V2/flexran.proto new file mode 100644 index 0000000000000000000000000000000000000000..3a1d40bca69479daaafa42f055e690add87426ef --- /dev/null +++ b/openair2/ENB_APP/MESSAGES/V2/flexran.proto @@ -0,0 +1,210 @@ +//'syntax = "proto2";' +package protocol; + +import "stats_messages.proto"; +import "header.proto"; +import "time_common.proto"; +import "config_messages.proto"; +import "controller_commands.proto"; +import "control_delegation.proto"; + +message flexran_message { + optional flexran_direction msg_dir = 100; + oneof msg { + flex_hello hello_msg = 1; + flex_echo_request echo_request_msg = 2; + flex_echo_reply echo_reply_msg = 3; + flex_stats_request stats_request_msg = 4; + flex_stats_reply stats_reply_msg = 5; + flex_sf_trigger sf_trigger_msg = 6; + flex_ul_sr_info ul_sr_info_msg = 7; + flex_enb_config_request enb_config_request_msg = 8; + flex_enb_config_reply enb_config_reply_msg = 9; + flex_ue_config_request ue_config_request_msg = 10; + flex_ue_config_reply ue_config_reply_msg = 11; + flex_lc_config_request lc_config_request_msg = 12; + flex_lc_config_reply lc_config_reply_msg = 13; + flex_dl_mac_config dl_mac_config_msg = 14; + flex_ue_state_change ue_state_change_msg = 15; + flex_control_delegation control_delegation_msg = 16; + flex_agent_reconfiguration agent_reconfiguration_msg = 17; + } +} + +enum flexran_direction { + //option allow_alias = true; + NOT_SET = 0; + INITIATING_MESSAGE = 1; + SUCCESSFUL_OUTCOME=2; + UNSUCCESSFUL_OUTCOME=3; +} + +enum flexran_err { + option allow_alias = true; + // message errors + NO_ERR = 0; + MSG_DEQUEUING = -1; + MSG_ENQUEUING = -2; + MSG_DECODING = -3; + MSG_ENCODING = -4; + MSG_BUILD = -5; + MSG_NOT_SUPPORTED = -6; + MSG_NOT_HANDLED = -7; + MSG_NOT_VALIDATED = -8; + MSG_OUT_DATED = -9; + + + // other erros + UNEXPECTED = -100; +} + +// +// Maintenance and discovery messages +// + +message flex_hello { + optional flex_header header = 1; +} + +message flex_echo_request { + optional flex_header header = 1; + extensions 100 to 199; +} + + +message flex_echo_reply { + optional flex_header header = 1; + extensions 100 to 199; +} + + +// +// Statistics request and reply message +// + +message flex_stats_request { + optional flex_header header = 1; + optional flex_stats_type type = 2; + oneof body { + flex_complete_stats_request complete_stats_request = 3; + flex_cell_stats_request cell_stats_request = 4; + flex_ue_stats_request ue_stats_request = 5; + } +} + +message flex_stats_reply { + optional flex_header header = 1; + repeated flex_ue_stats_report ue_report = 2; + repeated flex_cell_stats_report cell_report = 3; +} + +// +// Time indication messages +// + +message flex_sf_trigger { + optional flex_header header = 1; + optional uint32 sfn_sf = 2; + repeated flex_dl_info dl_info = 3; + repeated flex_ul_info ul_info = 4; +} + +// +// Asynchronous messages +// + +message flex_ul_sr_info { + optional flex_header header = 1; + optional uint32 sfn_sf = 2; + repeated uint32 rnti = 3; +} + +// +// eNB configuration messages +// +message flex_enb_config_request { + optional flex_header header = 1; +} + +message flex_enb_config_reply { + optional flex_header header = 1; + optional uint32 eNB_id = 2; // Unique id to distinguish the eNB + repeated flex_cell_config cell_config = 3; +} + +message flex_ue_config_request { + optional flex_header header = 1; +} + +message flex_ue_config_reply { + optional flex_header header = 1; + repeated flex_ue_config ue_config = 2; +} + +message flex_lc_config_request { + optional flex_header header = 1; +} + +message flex_lc_config_reply { + optional flex_header header = 1; + repeated flex_lc_ue_config lc_ue_config = 2; +} + +// +// Controller command messages +// + +message flex_dl_mac_config { + optional flex_header header = 1; + optional uint32 sfn_sf = 2; + repeated flex_dl_data dl_ue_data = 3; + repeated flex_dl_rar dl_rar = 4; + repeated flex_dl_broadcast dl_broadcast = 5; + repeated flex_pdcch_ofdm_sym_count ofdm_sym = 6; // OFDM symbol count for each CC +} + +// +// UE state change message +// + +message flex_ue_state_change { + optional flex_header header = 1; + optional uint32 type = 2; // One of the FLUESC_* values + optional flex_ue_config config = 3; // Body of the message (based on type) +} + +// +// Control delegation message +// + +message flex_control_delegation { + optional flex_header header = 1; + optional uint32 delegation_type = 2; // Bitmap of FLCDT_* flags + optional bytes payload = 3; // Byte array of shared lib containing the delegated functions + optional string name = 4; // The delegated functions names ordered based on bitmap flags +} + +// +// Agent reconfiguration message +// + +message flex_agent_reconfiguration { + optional flex_header header = 1; + optional string policy = 2; // The policy changes using YAML syntax in string format +} + +// Extensions of the echo request and reply +// messages for carrying a latency value in ms +message flex_echo_request_latency { + extend flex_echo_request { + optional uint32 latency = 100; + } +} + +message flex_echo_reply_latency { + extend flex_echo_reply { + optional uint32 latency = 100; + } +} + + diff --git a/openair2/ENB_APP/MESSAGES/V2/header.proto b/openair2/ENB_APP/MESSAGES/V2/header.proto new file mode 100644 index 0000000000000000000000000000000000000000..dfd5ea6c9951ef2b266677413a4aec128c839b24 --- /dev/null +++ b/openair2/ENB_APP/MESSAGES/V2/header.proto @@ -0,0 +1,43 @@ +package protocol; + +message flex_header { + optional uint32 version = 1; + optional uint32 type = 2; + optional uint32 xid = 4; +} + +enum flex_type { + // Discovery and maintenance messages + FLPT_HELLO = 0; + FLPT_ECHO_REQUEST = 1; + FLPT_ECHO_REPLY = 2; + + // Statistics and measurement messages + FLPT_STATS_REQUEST = 3; + FLPT_STATS_REPLY = 4; + + // Time indication messages + FLPT_SF_TRIGGER = 5; + + // Asynchronous messages + FLPT_UL_SR_INFO = 6; + + // eNB configuration messages + FLPT_GET_ENB_CONFIG_REQUEST = 7; + FLPT_GET_ENB_CONFIG_REPLY = 8; + FLPT_GET_UE_CONFIG_REQUEST = 9; + FLPT_GET_UE_CONFIG_REPLY = 10; + FLPT_GET_LC_CONFIG_REQUEST = 11; + FLPT_GET_LC_CONFIG_REPLY = 12; + + //Controller command messages + FLPT_DL_MAC_CONFIG = 13; + + // UE state change messages + FLPT_UE_STATE_CHANGE = 14; + + // Control delegation messages + FLPT_DELEGATE_CONTROL = 15; + FLPT_RECONFIGURE_AGENT = 16; +} + diff --git a/openair2/ENB_APP/MESSAGES/V2/mac_primitives.proto b/openair2/ENB_APP/MESSAGES/V2/mac_primitives.proto new file mode 100644 index 0000000000000000000000000000000000000000..be7c72ab7b07a4dd69bc99d5f7c4b9765d79c1c9 --- /dev/null +++ b/openair2/ENB_APP/MESSAGES/V2/mac_primitives.proto @@ -0,0 +1,76 @@ +package protocol; + +// +// Message containing the DL DCI info +// + +message flex_dl_dci { + optional uint32 rnti = 1; + optional uint32 res_alloc = 2; // Type of resource allocation + optional uint32 rb_bitmap = 3; // Bitmap for RB allocation + optional uint32 rb_shift = 4; // See TS 36.214, section 7.1.6.2 + repeated uint32 tbs_size = 5; // The size of each TBS + repeated uint32 mcs = 6; // The MCS of each TB + repeated uint32 ndi = 7; // New data indicator of each TB + repeated uint32 rv = 8; // Redundancy version of each TB + optional uint32 cce_index = 9; // CCE index used to send the DCI + optional uint32 aggr_level = 10; + optional uint32 precoding_info = 11; // 2 antenna ports:0..6, + // 4 antenna ports:0..50 + optional uint32 format = 12; // DCI format. A FLDCIF_* value + optional uint32 tpc = 13; // TS 36.213, sec 5.1.1.1 + optional uint32 harq_process = 14; // HARQ process ID + optional uint32 dai = 15; // TDD only + optional uint32 vrb_format = 16; // One of the FLVRBF_* values + optional uint32 tb_swap = 17; // Boolean. TB to codeword swap flag + optional uint32 sps_release = 18; // Flag value + optional uint32 pdcch_order = 19; + optional uint32 preamble_index = 20; // Only valid if pdcch_order = 1 + optional uint32 prach_mask_index = 21; // Only valid if pdcch_order = 1 + optional uint32 n_gap = 22; // One of the FLNGV_* values + optional uint32 tbs_idx = 23; // The TBS index for Format 1A + optional uint32 dl_power_offset = 24; // For format 1D + optional uint32 pdcch_power_offset = 25; // DL PDCCH power boosting in dB + optional uint32 cif_present = 26; // Boolean. Indication of CIF field + optional uint32 cif = 27; // CIF for cross-carrier scheduling +} + +// +// Messages related to the creation of RLC PDUs +// + +message flex_rlc_pdu { + repeated flex_rlc_pdu_tb rlc_pdu_tb = 1; // list of parameters for the creation of RLC PDUs. One for each TB +} + +message flex_rlc_pdu_tb { + optional uint32 logical_channel_id = 1; + optional uint32 size = 2; // Maximum RLC PDU to be created in bytes +} + +// +// MAC content types related enums +// + +enum flex_dci_format { + FLDCIF_1 = 0; + FLDCIF_1A = 1; + FLDCIF_1B = 2; + FLDCIF_1C = 3; + FLDCIF_1D = 4; + FLDCIF_2 = 5; + FLDCIF_2A = 6; + FLDCIF_2B = 7; + FLDCIF_3 = 8; + FLDCIF_3A = 9; +} + +enum flex_vrb_format { + FLVRBF_LOCALIZED = 0; + FLVRBF_DISTRIBUTED = 1; +} + +enum flex_ngap_val { + FLNGV_1 = 0; + FLNGV_2 = 1; +} \ No newline at end of file diff --git a/openair2/ENB_APP/MESSAGES/V2/stats_common.proto b/openair2/ENB_APP/MESSAGES/V2/stats_common.proto new file mode 100644 index 0000000000000000000000000000000000000000..70f99618ac3f4d959fe698c2644da9aecb17ddae --- /dev/null +++ b/openair2/ENB_APP/MESSAGES/V2/stats_common.proto @@ -0,0 +1,182 @@ +package protocol; + +// +// UE related statistics +// + +// RLC buffer status for a specific logical channel of a UE +message flex_rlc_bsr { + optional uint32 lc_id = 1; + optional uint32 tx_queue_size = 2; + optional uint32 tx_queue_hol_delay = 3; + optional uint32 retransmission_queue_size = 4; + optional uint32 retransmission_queue_hol_delay = 5; + optional uint32 status_pdu_size = 6; +} + +// Flags for MAC Control Elements +enum flex_ce_type { + FLPCET_TA = 1; + FLPCET_DRX = 2; + FLPCET_CR = 4; + FLPCET_CA = 8; +} + +// Types of DL CSI reports +enum flex_csi_type { + FLCSIT_P10 = 0; + FLCSIT_P11 = 1; + FLCSIT_P20 = 2; + FLCSIT_P21 = 3; + FLCSIT_A12 = 4; + FLCSIT_A22 = 5; + FLCSIT_A20 = 6; + FLCSIT_A30 = 7; + FLCSIT_A31 = 8; +} + +// CSI type P10 +message flex_csi_p10 { + optional uint32 wb_cqi = 1; +} + +// CSI type P11 +message flex_csi_p11 { + repeated uint32 wb_cqi = 1; + optional uint32 wb_pmi = 2; +} + +// CSI type P20 +message flex_csi_p20 { + optional uint32 wb_cqi = 1; + optional uint32 sb_cqi = 2; + optional uint32 bandwidth_part_index = 3; + optional uint32 sb_index = 4; +} + +// CSI type P21 +message flex_csi_p21 { + repeated uint32 wb_cqi = 1; + optional uint32 wb_pmi = 2; + repeated uint32 sb_cqi = 3; + optional uint32 badwidth_part_index = 4; + optional uint32 sb_index = 5; +} + +// CSI type A12 +message flex_csi_a12 { + repeated uint32 wb_cqi = 1; + repeated uint32 sb_pmi = 2; +} + +// CSI type A22 +message flex_csi_a22 { + repeated uint32 wb_cqi = 1; + repeated uint32 sb_cqi = 2; + optional uint32 wb_pmi = 3; + optional uint32 sb_pmi = 4; + repeated uint32 sb_list = 5; +} + +// CSI type A20 +message flex_csi_a20 { + optional uint32 wb_cqi = 1; + optional uint32 sb_cqi = 2; + repeated uint32 sb_list = 3; +} + +// CSI type A30 +message flex_csi_a30 { + optional uint32 wb_cqi = 1; + repeated uint32 sb_cqi = 2; +} + +// CSI type A31 +message flex_csi_a31 { + repeated uint32 wb_cqi = 1; + repeated flex_msb_cqi sb_cqi = 2; + optional uint32 wb_pmi = 3; +} + +// The CQI for the M-preffered subband +message flex_msb_cqi { + repeated uint32 sb_cqi = 1; +} + +// The CSI report of the UE for a specific servCellIndex +message flex_dl_csi { + optional uint32 serv_cell_index = 1; + optional uint32 ri = 2; + optional flex_csi_type type = 3; + oneof report { + flex_csi_p10 p10csi = 4; + flex_csi_p11 p11csi = 5; + flex_csi_p20 p20csi = 6; + flex_csi_p21 p21csi = 7; + flex_csi_a12 a12csi = 8; + flex_csi_a22 a22csi = 9; + flex_csi_a20 a20csi = 10; + flex_csi_a30 a30csi = 11; + flex_csi_a31 a31csi = 12; + } +} + +// The full DL CQI report for all CC of a UE +message flex_dl_cqi_report { + optional uint32 sfn_sn = 1; + repeated flex_dl_csi csi_report = 2; +} + +// Paging message info +message flex_paging_info { + optional uint32 paging_index = 1; + optional uint32 paging_message_size = 2; + optional uint32 paging_subframe = 3; + optional uint32 carrier_index = 4; +} + +// Report for the paging buffer status +message flex_paging_buffer_report { + repeated flex_paging_info paging_info = 1; +} + +// The type of UL CQI +enum flex_ul_cqi_type { + FLUCT_SRS = 0; + FLUCT_PUSCH = 1; + FLUCT_PUCCH_1 = 2; + FLUCT_PUCCH_2 = 3; + FLUCT_PRACH = 4; +} + +// UL CQI report for a specific UE for a given report type +message flex_ul_cqi { + optional flex_ul_cqi_type type = 1; + repeated uint32 sinr = 2; + optional uint32 serv_cell_index = 3; +} + +// Full UL CQI report for a specific UE +message flex_ul_cqi_report { + optional uint32 sfn_sn = 1; + repeated flex_ul_cqi cqi_meas = 2; + repeated flex_pucch_dbm pucch_dbm = 3; +} + +message flex_pucch_dbm { + optional int32 p0_pucch_dbm = 1; + optional uint32 serv_cell_index = 2; +} + +// +// Cell related statistics +// + +// The UL noise and interference report for a UE +message flex_noise_interference_report { + optional uint32 sfn_sf = 1; + optional uint32 rip = 2; + optional uint32 tnp = 3; + optional int32 p0_nominal_pucch = 4; +} + diff --git a/openair2/ENB_APP/MESSAGES/V2/stats_messages.proto b/openair2/ENB_APP/MESSAGES/V2/stats_messages.proto new file mode 100644 index 0000000000000000000000000000000000000000..1b1567dda1e4b87b9f5b41bcdd05d0d2badf8af7 --- /dev/null +++ b/openair2/ENB_APP/MESSAGES/V2/stats_messages.proto @@ -0,0 +1,86 @@ +package protocol; + +//import "header.proto"; +import "stats_common.proto"; + +// +// Bodies of statistics report requests +// + +message flex_complete_stats_request { + optional flex_stats_report_freq report_frequency = 1; + optional uint32 sf = 2; + optional uint32 cell_report_flags = 3; + optional uint32 ue_report_flags = 4; +} + +message flex_cell_stats_request { + repeated uint32 cell = 1; + optional uint32 flags = 2; +} + +message flex_ue_stats_request { + repeated uint32 rnti = 1; + optional uint32 flags = 2; +} + +// +// Bodies of statistics reports +// + +// The full statistics report for a specific cell +message flex_cell_stats_report { + optional uint32 carrier_index = 1; + optional uint32 flags = 2; + optional flex_noise_interference_report noise_inter_report = 3; +} + +// Statistics report for a specific UE +message flex_ue_stats_report { + optional uint32 rnti = 1; + optional uint32 flags = 2; + repeated uint32 bsr = 3; + optional uint32 phr = 4; + repeated flex_rlc_bsr rlc_report = 5; + optional uint32 pending_mac_ces = 6; + optional flex_dl_cqi_report dl_cqi_report = 7; + optional flex_paging_buffer_report pbr = 8; + optional flex_ul_cqi_report ul_cqi_report = 9; +} + +// +// Types of statistics related enums +// + + +//Types of statistics requested by the controller +enum flex_stats_type { + FLST_COMPLETE_STATS = 0; + FLST_CELL_STATS = 1; + FLST_UE_STATS = 2; +} + +// Report frequency for the requested statistics +enum flex_stats_report_freq { + FLSRF_ONCE = 0; + FLSRF_PERIODICAL = 1; + FLSRF_CONTINUOUS = 2; + FLSRF_OFF = 3; +} + +// Flags for cell statistics +enum flex_cell_stats_type { + FLCST_NOISE_INTERFERENCE = 1; +} + +// Flags for UE-related statistics +enum flex_ue_stats_type { + FLUST_BSR = 1; + FLUST_PRH = 2; + FLUST_RLC_BS = 4; + FLUST_MAC_CE_BS = 8; + FLUST_DL_CQI = 16; + FLUST_PBS = 32; + FLUST_UL_CQI = 64; + // To be extended with more types of stats +} \ No newline at end of file diff --git a/openair2/ENB_APP/MESSAGES/V2/time_common.proto b/openair2/ENB_APP/MESSAGES/V2/time_common.proto new file mode 100644 index 0000000000000000000000000000000000000000..30a56bb776957d245e673ac44e8e2ca255408c71 --- /dev/null +++ b/openair2/ENB_APP/MESSAGES/V2/time_common.proto @@ -0,0 +1,29 @@ +package protocol; + +enum flex_harq_status { + FLHS_ACK = 0; + FLHS_NACK = 1; + FLHS_DTX = 2; +} + +enum flex_reception_status { + FLRS_OK = 0; + FLRS_NOT_OK = 1; + FLRS_NOT_VALID = 2; +} + +message flex_dl_info { + optional uint32 rnti = 1; + optional uint32 harq_process_id = 2; + repeated uint32 harq_status = 3; + optional uint32 serv_cell_index = 4; +} + +message flex_ul_info { + optional uint32 rnti = 1; + repeated uint32 ul_reception = 2; + optional uint32 reception_status = 3; + optional uint32 tpc = 4; + optional uint32 serv_cell_index = 5; +} + diff --git a/openair2/ENB_APP/enb_app.c b/openair2/ENB_APP/enb_app.c index 217f44fcf5a6e0fbac06a8506e2ba38ccbcc10e6..3734bc4a2b11d9c66ab09b074dbffa78216f591b 100644 --- a/openair2/ENB_APP/enb_app.c +++ b/openair2/ENB_APP/enb_app.c @@ -49,6 +49,10 @@ # include "gtpv1u_eNB_task.h" # endif +#if defined(FLEXRAN_AGENT_SB_IF) +# include "flexran_agent.h" +#endif + extern unsigned char NB_eNB_INST; #endif @@ -287,7 +291,7 @@ void *eNB_app_task(void *args_p) itti_mark_task_ready (TASK_ENB_APP); -# if defined(ENABLE_USE_MME) + # if defined(ENABLE_ITTI) # if defined(OAI_EMU) enb_nb = oai_emulation.info.nb_enb_local; enb_id_start = oai_emulation.info.first_enb_local; @@ -297,7 +301,7 @@ void *eNB_app_task(void *args_p) "Last eNB index is greater or equal to maximum eNB index (%d/%d)!", enb_id_end, NUMBER_OF_eNB_MAX); # endif -# endif + # endif enb_properties_p = enb_config_get(); @@ -310,6 +314,14 @@ void *eNB_app_task(void *args_p) configure_rrc(enb_id, enb_properties_p); } +#if defined (FLEXRAN_AGENT_SB_IF) + + for (enb_id = enb_id_start; (enb_id < enb_id_end) ; enb_id++) { + printf("\n start enb agent %d\n", enb_id); + flexran_agent_start(enb_id, enb_properties_p); + } +#endif + # if defined(ENABLE_USE_MME) /* Try to register each eNB */ registered_enb = 0; diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index bdb5df01b85caf0fddc48fa83838aa10fe545765..fdf953597e79ce2e9b67c9184d9ab1892451416b 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -190,6 +190,12 @@ #define ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U "ENB_IPV4_ADDRESS_FOR_S1U" #define ENB_CONFIG_STRING_ENB_PORT_FOR_S1U "ENB_PORT_FOR_S1U" +#define ENB_CONFIG_STRING_NETWORK_CONTROLLER_CONFIG "NETWORK_CONTROLLER" +#define ENB_CONFIG_STRING_FLEXRAN_AGENT_INTERFACE_NAME "FLEXRAN_AGENT_INTERFACE_NAME" +#define ENB_CONFIG_STRING_FLEXRAN_AGENT_IPV4_ADDRESS "FLEXRAN_AGENT_IPV4_ADDRESS" +#define ENB_CONFIG_STRING_FLEXRAN_AGENT_PORT "FLEXRAN_AGENT_PORT" +#define ENB_CONFIG_STRING_FLEXRAN_AGENT_CACHE "FLEXRAN_AGENT_CACHE" + #define ENB_CONFIG_STRING_RRH_GW_CONFIG "rrh_gw_config" #define ENB_CONFIG_STRING_RRH_GW_LOCAL_IF_NAME "local_if_name" #define ENB_CONFIG_STRING_RRH_GW_LOCAL_ADDRESS "local_address" @@ -335,6 +341,15 @@ void enb_config_display(void) } } +#if defined(FLEXRAN_AGENT_SB_IF) + printf( "\nFLEXRAN AGENT CONFIG : \n\n"); + printf( "\tInterface name: \t%s:\n",enb_properties.properties[i]->flexran_agent_interface_name); + printf( "\tInterface IP Address: \t%s:\n",enb_properties.properties[i]->flexran_agent_ipv4_address); + printf( "\tInterface PORT: \t%d:\n\n",enb_properties.properties[i]->flexran_agent_port); + printf( "\tCache directory: \t%s:\n",enb_properties.properties[i]->flexran_agent_cache); + +#endif + for (j=0; j< enb_properties.properties[i]->nb_cc; j++) { // CC_ID node function/timing printf( "\n\tnode_function for CC %d: \t%s:\n",j,eNB_functions[enb_properties.properties[i]->cc_node_function[j]]); @@ -659,6 +674,10 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) char *address = NULL; char *cidr = NULL; char *astring = NULL; + char* flexran_agent_interface_name = NULL; + char* flexran_agent_ipv4_address = NULL; + libconfig_int flexran_agent_port = 0; + char* flexran_agent_cache = NULL; libconfig_int otg_ue_id = 0; char* otg_app_type = NULL; char* otg_bg_traffic = NULL; @@ -2456,6 +2475,35 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) } } } + + // Network Controller + subsetting = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_NETWORK_CONTROLLER_CONFIG); + + if (subsetting != NULL) { + if ( ( + config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_FLEXRAN_AGENT_INTERFACE_NAME, + (const char **)&flexran_agent_interface_name) + && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_FLEXRAN_AGENT_IPV4_ADDRESS, + (const char **)&flexran_agent_ipv4_address) + && config_setting_lookup_int(subsetting, ENB_CONFIG_STRING_FLEXRAN_AGENT_PORT, + &flexran_agent_port) + && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_FLEXRAN_AGENT_CACHE, + (const char **)&flexran_agent_cache) + ) + ) { + enb_properties.properties[enb_properties_index]->flexran_agent_interface_name = strdup(flexran_agent_interface_name); + cidr = flexran_agent_ipv4_address; + address = strtok(cidr, "/"); + enb_properties.properties[enb_properties_index]->flexran_agent_ipv4_address = strdup(address); + /* if (address) { + IPV4_STR_ADDR_TO_INT_NWBO (address, enb_properties.properties[enb_properties_index]->flexran_agent_ipv4_address, "BAD IP ADDRESS FORMAT FOR eNB Agent !\n" ); + }*/ + + enb_properties.properties[enb_properties_index]->flexran_agent_port = flexran_agent_port; + enb_properties.properties[enb_properties_index]->flexran_agent_cache = strdup(flexran_agent_cache); + } + } + // OTG _CONFIG setting_otg = config_setting_get_member (setting_enb, ENB_CONF_STRING_OTG_CONFIG); diff --git a/openair2/ENB_APP/enb_config.h b/openair2/ENB_APP/enb_config.h index 9e53af172d64e6347ac073a1f04ca0ba6545808f..fd53395311c4e3eeef5fda3bb42062c60687b7e8 100644 --- a/openair2/ENB_APP/enb_config.h +++ b/openair2/ENB_APP/enb_config.h @@ -228,6 +228,10 @@ typedef struct Enb_properties_s { char *enb_interface_name_for_S1_MME; in_addr_t enb_ipv4_address_for_S1_MME; + char *flexran_agent_interface_name; + in_addr_t flexran_agent_ipv4_address; + tcp_udp_port_t flexran_agent_port; + char *flexran_agent_cache; /* Nb of RRH to connect to */ uint8_t nb_rrh_gw; diff --git a/openair2/ENB_APP/flexran_agent.c b/openair2/ENB_APP/flexran_agent.c new file mode 100644 index 0000000000000000000000000000000000000000..beca1062bd6aa0fbd82a20ad5a0c39c0d0dfa899 --- /dev/null +++ b/openair2/ENB_APP/flexran_agent.c @@ -0,0 +1,319 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file flexran_agent.h + * \brief top level flexran agent receive thread and itti task + * \author Xenofon Foukas and Navid Nikaein + * \date 2016 + * \version 0.1 + */ + +#include "flexran_agent_common.h" +#include "log.h" +#include "flexran_agent.h" +#include "flexran_agent_mac_defs.h" + +#include "flexran_agent_extern.h" + +#include "assertions.h" + +#include "flexran_agent_net_comm.h" +#include "flexran_agent_async.h" + +//#define TEST_TIMER + +flexran_agent_instance_t flexran_agent[NUM_MAX_ENB]; + +char in_ip[40]; +static uint16_t in_port; +char local_cache[40]; + +void *send_thread(void *args); +void *receive_thread(void *args); +pthread_t new_thread(void *(*f)(void *), void *b); +Protocol__FlexranMessage *flexran_agent_timeout(void* args); + + +int agent_task_created = 0; +/* + * enb agent task mainly wakes up the tx thread for periodic and oneshot messages to the controller + * and can interact with other itti tasks +*/ +void *flexran_agent_task(void *args){ + + //flexran_agent_instance_t *d = (flexran_agent_instance_t *) args; + Protocol__FlexranMessage *msg; + void *data; + int size; + err_code_t err_code; + int priority; + + MessageDef *msg_p = NULL; + const char *msg_name = NULL; + instance_t instance; + int result; + struct flexran_agent_timer_element_s * elem = NULL; + + itti_mark_task_ready(TASK_FLEXRAN_AGENT); + + do { + // Wait for a message + itti_receive_msg (TASK_FLEXRAN_AGENT, &msg_p); + DevAssert(msg_p != NULL); + msg_name = ITTI_MSG_NAME (msg_p); + instance = ITTI_MSG_INSTANCE (msg_p); + + switch (ITTI_MSG_ID(msg_p)) { + case TERMINATE_MESSAGE: + itti_exit_task (); + break; + + case MESSAGE_TEST: + LOG_I(FLEXRAN_AGENT, "Received %s\n", ITTI_MSG_NAME(msg_p)); + break; + + case TIMER_HAS_EXPIRED: + msg = flexran_agent_process_timeout(msg_p->ittiMsg.timer_has_expired.timer_id, msg_p->ittiMsg.timer_has_expired.arg); + if (msg != NULL){ + data=flexran_agent_pack_message(msg,&size); + elem = get_timer_entry(msg_p->ittiMsg.timer_has_expired.timer_id); + if (flexran_agent_msg_send(elem->agent_id, FLEXRAN_AGENT_DEFAULT, data, size, priority)) { + err_code = PROTOCOL__FLEXRAN_ERR__MSG_ENQUEUING; + goto error; + } + + LOG_D(FLEXRAN_AGENT,"sent message with size %d\n", size); + } + break; + + default: + LOG_E(FLEXRAN_AGENT, "Received unexpected message %s\n", msg_name); + break; + } + + result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); + continue; + error: + LOG_E(FLEXRAN_AGENT,"flexran_agent_task: error %d occured\n",err_code); + } while (1); + + return NULL; +} + +void *receive_thread(void *args) { + + flexran_agent_instance_t *d = args; + void *data; + int size; + int priority; + err_code_t err_code; + + Protocol__FlexranMessage *msg; + + while (1) { + + while (flexran_agent_msg_recv(d->enb_id, FLEXRAN_AGENT_DEFAULT, &data, &size, &priority) == 0) { + + LOG_D(FLEXRAN_AGENT,"received message with size %d\n", size); + + // Invoke the message handler + msg=flexran_agent_handle_message(d->enb_id, data, size); + + free(data); + + // check if there is something to send back to the controller + if (msg != NULL){ + data=flexran_agent_pack_message(msg,&size); + + if (flexran_agent_msg_send(d->enb_id, FLEXRAN_AGENT_DEFAULT, data, size, priority)) { + err_code = PROTOCOL__FLEXRAN_ERR__MSG_ENQUEUING; + goto error; + } + + LOG_D(FLEXRAN_AGENT,"sent message with size %d\n", size); + } + } + } + + return NULL; + +error: + LOG_E(FLEXRAN_AGENT,"receive_thread: error %d occured\n",err_code); + return NULL; +} + + +/* utility function to create a thread */ +pthread_t new_thread(void *(*f)(void *), void *b) { + pthread_t t; + pthread_attr_t att; + + if (pthread_attr_init(&att)){ + fprintf(stderr, "pthread_attr_init err\n"); + exit(1); + } + + struct sched_param sched_param_recv_thread; + + sched_param_recv_thread.sched_priority = sched_get_priority_max(SCHED_FIFO) - 1; + pthread_attr_setschedparam(&att, &sched_param_recv_thread); + pthread_attr_setschedpolicy(&att, SCHED_FIFO); + + if (pthread_attr_setdetachstate(&att, PTHREAD_CREATE_DETACHED)) { + fprintf(stderr, "pthread_attr_setdetachstate err\n"); + exit(1); + } + if (pthread_create(&t, &att, f, b)) { + fprintf(stderr, "pthread_create err\n"); + exit(1); + } + if (pthread_attr_destroy(&att)) { + fprintf(stderr, "pthread_attr_destroy err\n"); + exit(1); + } + + return t; +} + +int channel_container_init = 0; +int flexran_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properties){ + + int channel_id; + + flexran_set_enb_vars(mod_id, RAN_LTE_OAI); + flexran_agent[mod_id].enb_id = mod_id; + + /* + * check the configuration + */ + if (enb_properties->properties[mod_id]->flexran_agent_cache != NULL) { + strncpy(local_cache, enb_properties->properties[mod_id]->flexran_agent_cache, sizeof(local_cache)); + local_cache[sizeof(local_cache) - 1] = 0; + } else { + strcpy(local_cache, DEFAULT_FLEXRAN_AGENT_CACHE); + } + + if (enb_properties->properties[mod_id]->flexran_agent_ipv4_address != NULL) { + strncpy(in_ip, enb_properties->properties[mod_id]->flexran_agent_ipv4_address, sizeof(in_ip) ); + in_ip[sizeof(in_ip) - 1] = 0; // terminate string + } else { + strcpy(in_ip, DEFAULT_FLEXRAN_AGENT_IPv4_ADDRESS ); + } + + if (enb_properties->properties[mod_id]->flexran_agent_port != 0 ) { + in_port = enb_properties->properties[mod_id]->flexran_agent_port; + } else { + in_port = DEFAULT_FLEXRAN_AGENT_PORT ; + } + LOG_I(FLEXRAN_AGENT,"starting enb agent client for module id %d on ipv4 %s, port %d\n", + flexran_agent[mod_id].enb_id, + in_ip, + in_port); + + /* + * Initialize the channel container + */ + if (!channel_container_init) { + flexran_agent_init_channel_container(); + channel_container_init = 1; + } + /*Create the async channel info*/ + flexran_agent_instance_t *channel_info = flexran_agent_async_channel_info(mod_id, in_ip, in_port); + + /*Create a channel using the async channel info*/ + channel_id = flexran_agent_create_channel((void *) channel_info, + flexran_agent_async_msg_send, + flexran_agent_async_msg_recv, + flexran_agent_async_release); + + + if (channel_id <= 0) { + goto error; + } + + flexran_agent_channel_t *channel = get_channel(channel_id); + + if (channel == NULL) { + goto error; + } + + /*Register the channel for all underlying agents (use FLEXRAN_AGENT_MAX)*/ + flexran_agent_register_channel(mod_id, channel, FLEXRAN_AGENT_MAX); + + /*Example of registration for a specific agent(MAC): + *flexran_agent_register_channel(mod_id, channel, FLEXRAN_AGENT_MAC); + */ + + /*Initialize the continuous MAC stats update mechanism*/ + flexran_agent_init_cont_mac_stats_update(mod_id); + + new_thread(receive_thread, &flexran_agent[mod_id]); + + /*Initialize and register the mac xface. Must be modified later + *for more flexibility in agent management */ + + AGENT_MAC_xface *mac_agent_xface = (AGENT_MAC_xface *) malloc(sizeof(AGENT_MAC_xface)); + flexran_agent_register_mac_xface(mod_id, mac_agent_xface); + + /* + * initilize a timer + */ + + flexran_agent_init_timer(); + + /* + * Initialize the mac agent + */ + flexran_agent_init_mac_agent(mod_id); + + /* + * start the enb agent task for tx and interaction with the underlying network function + */ + if (!agent_task_created) { + if (itti_create_task (TASK_FLEXRAN_AGENT, flexran_agent_task, (void *) &flexran_agent[mod_id]) < 0) { + LOG_E(FLEXRAN_AGENT, "Create task for FlexRAN Agent failed\n"); + return -1; + } + agent_task_created = 1; + } + + LOG_I(FLEXRAN_AGENT,"client ends\n"); + return 0; + +error: + LOG_I(FLEXRAN_AGENT,"there was an error\n"); + return 1; + +} + +Protocol__FlexranMessage *flexran_agent_timeout(void* args){ + + // flexran_agent_timer_args_t *timer_args = calloc(1, sizeof(*timer_args)); + //memcpy (timer_args, args, sizeof(*timer_args)); + flexran_agent_timer_args_t *timer_args = (flexran_agent_timer_args_t *) args; + + LOG_I(FLEXRAN_AGENT, "flexran_agent %d timeout\n", timer_args->mod_id); + //LOG_I(FLEXRAN_AGENT, "eNB action %d ENB flags %d \n", timer_args->cc_actions,timer_args->cc_report_flags); + //LOG_I(FLEXRAN_AGENT, "UE action %d UE flags %d \n", timer_args->ue_actions,timer_args->ue_report_flags); + + return NULL; +} diff --git a/openair2/ENB_APP/flexran_agent.h b/openair2/ENB_APP/flexran_agent.h new file mode 100644 index 0000000000000000000000000000000000000000..21ea21aafcf336551b9c276ef51d0e9976a34b8e --- /dev/null +++ b/openair2/ENB_APP/flexran_agent.h @@ -0,0 +1,46 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file flexran_agent.h + * \brief top level flexran agent + * \author Navid Nikaein and Xenofon Foukas + * \date 2016 + * \version 0.1 + */ + +#ifndef FLEXRAN_AGENT_H_ +#define FLEXRAN_AGENT_H_ + +#include "enb_config.h" // for enb properties +#include "flexran_agent_common.h" + + +/* Initiation and termination of the eNodeB agent */ +int flexran_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properties); +int flexran_agent_stop(mid_t mod_id); + +/* + * enb agent task mainly wakes up the tx thread for periodic and oneshot messages to the controller + * and can interact with other itti tasks +*/ +void *flexran_agent_task(void *args); + +#endif diff --git a/openair2/ENB_APP/flexran_agent_async.c b/openair2/ENB_APP/flexran_agent_async.c new file mode 100644 index 0000000000000000000000000000000000000000..978b44929d7607b0b1a384447255d506e6de10c1 --- /dev/null +++ b/openair2/ENB_APP/flexran_agent_async.c @@ -0,0 +1,99 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file flexran_agent_async.c + * \brief channel implementation for async interface + * \author Xenofon Foukas + * \date 2016 + * \version 0.1 + */ + +#include "flexran_agent_async.h" +#include "flexran_agent_defs.h" + +#include "log.h" + +flexran_agent_async_channel_t * flexran_agent_async_channel_info(mid_t mod_id, char *dst_ip, uint16_t dst_port) { + + flexran_agent_async_channel_t *channel; + channel = (flexran_agent_async_channel_t *) malloc(sizeof(flexran_agent_channel_t)); + + if (channel == NULL) + goto error; + + channel->enb_id = mod_id; + /*Create a socket*/ + channel->link = new_link_client(dst_ip, dst_port); + if (channel->link == NULL) goto error; + + LOG_I(FLEXRAN_AGENT,"starting enb agent client for module id %d on ipv4 %s, port %d\n", + channel->enb_id, + dst_ip, + dst_port); + + /* + * create a message queue + */ + // Set size of queues statically for now + channel->send_queue = new_message_queue(500); + if (channel->send_queue == NULL) goto error; + channel->receive_queue = new_message_queue(500); + if (channel->receive_queue == NULL) goto error; + + /* + * create a link manager + */ + channel->manager = create_link_manager(channel->send_queue, channel->receive_queue, channel->link); + if (channel->manager == NULL) goto error; + + return channel; + + error: + LOG_I(FLEXRAN_AGENT,"there was an error\n"); + return 1; +} + +int flexran_agent_async_msg_send(void *data, int size, int priority, void *channel_info) { + flexran_agent_async_channel_t *channel; + channel = (flexran_agent_channel_t *)channel_info; + + return message_put(channel->send_queue, data, size, priority); +} + +int flexran_agent_async_msg_recv(void **data, int *size, int *priority, void *channel_info) { + flexran_agent_async_channel_t *channel; + channel = (flexran_agent_async_channel_t *)channel_info; + + return message_get(channel->receive_queue, data, size, priority); +} + +void flexran_agent_async_release(flexran_agent_channel_t *channel) { + flexran_agent_async_channel_t *channel_info; + channel_info = (flexran_agent_async_channel_t *) channel->channel_info; + + destroy_link_manager(channel_info->manager); + + destroy_message_queue(channel_info->send_queue); + destroy_message_queue(channel_info->receive_queue); + + close_link(channel_info->link); + free(channel_info); +} diff --git a/openair2/ENB_APP/flexran_agent_async.h b/openair2/ENB_APP/flexran_agent_async.h new file mode 100644 index 0000000000000000000000000000000000000000..b097b15c2590885648a32d010e8287626022f562 --- /dev/null +++ b/openair2/ENB_APP/flexran_agent_async.h @@ -0,0 +1,55 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file flexran_agent_async.h + * \brief channel implementation for async interface + * \author Xenofon Foukas + * \date 2016 + * \version 0.1 + */ + +#ifndef FLEXRAN_AGENT_ASYNC_H_ +#define FLEXRAN_AGENT_ASYNC_H_ + +#include "flexran_agent_net_comm.h" + +typedef struct { + mid_t enb_id; + socket_link_t *link; + message_queue_t *send_queue; + message_queue_t *receive_queue; + link_manager_t *manager; +} flexran_agent_async_channel_t; + +/* Create a new channel for a given destination ip and destination port */ +flexran_agent_async_channel_t * flexran_agent_async_channel_info(mid_t mod_id, char *dst_ip, uint16_t dst_port); + +/* Send a message to the given channel */ +int flexran_agent_async_msg_send(void *data, int size, int priority, void *channel_info); + +/* Receive a message from a given channel */ +int flexran_agent_async_msg_recv(void **data, int *size, int *priority, void *channel_info); + +/* Release a channel */ +void flexran_agent_async_release(flexran_agent_channel_t *channel); + + +#endif /*FLEXRAN_AGENT_ASYNC_H_*/ diff --git a/openair2/ENB_APP/flexran_agent_common.c b/openair2/ENB_APP/flexran_agent_common.c new file mode 100644 index 0000000000000000000000000000000000000000..2ccca6602b5d8f2fd60a4f3f37b3f71dd01b6476 --- /dev/null +++ b/openair2/ENB_APP/flexran_agent_common.c @@ -0,0 +1,2279 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file flexran_agent_common.c + * \brief common primitives for all agents + * \author Xenofon Foukas, Mohamed Kassem and Navid Nikaein + * \date 2016 + * \version 0.1 + */ + +#include<stdio.h> +#include <time.h> + +#include "flexran_agent_common.h" +#include "flexran_agent_common_internal.h" +#include "flexran_agent_extern.h" +#include "PHY/extern.h" +#include "log.h" + +#include "SCHED/defs.h" +#include "RRC/LITE/extern.h" +#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" +#include "rrc_eNB_UE_context.h" + +void * enb[NUM_MAX_ENB]; +void * enb_ue[NUM_MAX_ENB]; +void * enb_rrc[NUM_MAX_ENB]; + +/* + * message primitives + */ + +int flexran_agent_serialize_message(Protocol__FlexranMessage *msg, void **buf, int *size) { + + *size = protocol__flexran_message__get_packed_size(msg); + + *buf = malloc(*size); + if (buf == NULL) + goto error; + + protocol__flexran_message__pack(msg, *buf); + + return 0; + + error: + LOG_E(FLEXRAN_AGENT, "an error occured\n"); // change the com + return -1; +} + + + +/* We assume that the buffer size is equal to the message size. + Should be chekced durint Tx/Rx */ +int flexran_agent_deserialize_message(void *data, int size, Protocol__FlexranMessage **msg) { + *msg = protocol__flexran_message__unpack(NULL, size, data); + if (*msg == NULL) + goto error; + + return 0; + + error: + //LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); + return -1; +} + + + +int flexran_create_header(xid_t xid, Protocol__FlexType type, Protocol__FlexHeader **header) { + + *header = malloc(sizeof(Protocol__FlexHeader)); + if(*header == NULL) + goto error; + + protocol__flex_header__init(*header); + (*header)->version = FLEXRAN_VERSION; + (*header)->has_version = 1; + // check if the type is set + (*header)->type = type; + (*header)->has_type = 1; + (*header)->xid = xid; + (*header)->has_xid = 1; + return 0; + + error: + LOG_E(FLEXRAN_AGENT, "%s: an error occured\n", __FUNCTION__); + return -1; +} + + +int flexran_agent_hello(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) { + + Protocol__FlexHeader *header; + /*TODO: Need to set random xid or xid from received hello message*/ + xid_t xid = 1; + if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_HELLO, &header) != 0) + goto error; + + Protocol__FlexHello *hello_msg; + hello_msg = malloc(sizeof(Protocol__FlexHello)); + if(hello_msg == NULL) + goto error; + protocol__flex_hello__init(hello_msg); + hello_msg->header = header; + + *msg = malloc(sizeof(Protocol__FlexranMessage)); + if(*msg == NULL) + goto error; + + protocol__flexran_message__init(*msg); + (*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_HELLO_MSG; + (*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__SUCCESSFUL_OUTCOME; + (*msg)->has_msg_dir = 1; + (*msg)->hello_msg = hello_msg; + return 0; + + error: + if(header != NULL) + free(header); + if(hello_msg != NULL) + free(hello_msg); + if(*msg != NULL) + free(*msg); + LOG_E(FLEXRAN_AGENT, "%s: an error occured\n", __FUNCTION__); + return -1; +} + + +int flexran_agent_destroy_hello(Protocol__FlexranMessage *msg) { + + if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_HELLO_MSG) + goto error; + + free(msg->hello_msg->header); + free(msg->hello_msg); + free(msg); + return 0; + + error: + LOG_E(FLEXRAN_AGENT, "%s: an error occured\n", __FUNCTION__); + return -1; +} + + +int flexran_agent_echo_request(mid_t mod_id, const void* params, Protocol__FlexranMessage **msg) { + Protocol__FlexHeader *header; + /*TODO: Need to set a random xid*/ + xid_t xid = 1; + if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_ECHO_REQUEST, &header) != 0) + goto error; + + Protocol__FlexEchoRequest *echo_request_msg; + echo_request_msg = malloc(sizeof(Protocol__FlexEchoRequest)); + if(echo_request_msg == NULL) + goto error; + protocol__flex_echo_request__init(echo_request_msg); + echo_request_msg->header = header; + + *msg = malloc(sizeof(Protocol__FlexranMessage)); + if(*msg == NULL) + goto error; + protocol__flexran_message__init(*msg); + (*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_ECHO_REQUEST_MSG; + (*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__INITIATING_MESSAGE; + (*msg)->echo_request_msg = echo_request_msg; + return 0; + + error: + if(header != NULL) + free(header); + if(echo_request_msg != NULL) + free(echo_request_msg); + if(*msg != NULL) + free(*msg); + //LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); + return -1; +} + + +int flexran_agent_destroy_echo_request(Protocol__FlexranMessage *msg) { + if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_ECHO_REQUEST_MSG) + goto error; + + free(msg->echo_request_msg->header); + free(msg->echo_request_msg); + free(msg); + return 0; + + error: + LOG_E(FLEXRAN_AGENT, "%s: an error occured\n", __FUNCTION__); + return -1; +} + + + +int flexran_agent_echo_reply(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) { + + xid_t xid; + Protocol__FlexranMessage *input = (Protocol__FlexranMessage *)params; + Protocol__FlexEchoRequest *echo_req = input->echo_request_msg; + xid = (echo_req->header)->xid; + + Protocol__FlexHeader *header; + if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_ECHO_REPLY, &header) != 0) + goto error; + + Protocol__FlexEchoReply *echo_reply_msg; + echo_reply_msg = malloc(sizeof(Protocol__FlexEchoReply)); + if(echo_reply_msg == NULL) + goto error; + protocol__flex_echo_reply__init(echo_reply_msg); + echo_reply_msg->header = header; + + *msg = malloc(sizeof(Protocol__FlexranMessage)); + if(*msg == NULL) + goto error; + protocol__flexran_message__init(*msg); + (*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_ECHO_REPLY_MSG; + (*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__SUCCESSFUL_OUTCOME; + (*msg)->has_msg_dir = 1; + (*msg)->echo_reply_msg = echo_reply_msg; + return 0; + + error: + if(header != NULL) + free(header); + if(echo_reply_msg != NULL) + free(echo_reply_msg); + if(*msg != NULL) + free(*msg); + LOG_E(FLEXRAN_AGENT, "%s: an error occured\n", __FUNCTION__); + return -1; +} + + +int flexran_agent_destroy_echo_reply(Protocol__FlexranMessage *msg) { + if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_ECHO_REPLY_MSG) + goto error; + + free(msg->echo_reply_msg->header); + free(msg->echo_reply_msg); + free(msg); + return 0; + + error: + LOG_E(FLEXRAN_AGENT, "%s: an error occured\n", __FUNCTION__); + return -1; +} + + +int flexran_agent_destroy_enb_config_reply(Protocol__FlexranMessage *msg) { + if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_ENB_CONFIG_REPLY_MSG) + goto error; + free(msg->enb_config_reply_msg->header); + int i, j; + Protocol__FlexEnbConfigReply *reply = msg->enb_config_reply_msg; + + for(i = 0; i < reply->n_cell_config;i++) { + free(reply->cell_config[i]->mbsfn_subframe_config_rfoffset); + free(reply->cell_config[i]->mbsfn_subframe_config_rfperiod); + free(reply->cell_config[i]->mbsfn_subframe_config_sfalloc); + if (reply->cell_config[i]->si_config != NULL) { + for(j = 0; j < reply->cell_config[i]->si_config->n_si_message;j++){ + free(reply->cell_config[i]->si_config->si_message[j]); + } + free(reply->cell_config[i]->si_config->si_message); + free(reply->cell_config[i]->si_config); + } + free(reply->cell_config[i]); + } + free(reply->cell_config); + free(reply); + free(msg); + + return 0; + error: + //LOG_E(FLEXRAN_AGENT, "%s: an error occured\n", __FUNCTION__); + return -1; +} + +int flexran_agent_destroy_ue_config_reply(Protocol__FlexranMessage *msg) { + if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_UE_CONFIG_REPLY_MSG) + goto error; + free(msg->ue_config_reply_msg->header); + int i, j; + Protocol__FlexUeConfigReply *reply = msg->ue_config_reply_msg; + + for(i = 0; i < reply->n_ue_config;i++){ + free(reply->ue_config[i]->capabilities); + free(reply->ue_config[i]); + } + free(reply->ue_config); + free(reply); + free(msg); + + return 0; + error: + //LOG_E(FLEXRAN_AGENT, "%s: an error occured\n", __FUNCTION__); + return -1; +} + +int flexran_agent_destroy_lc_config_reply(Protocol__FlexranMessage *msg) { + if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_LC_CONFIG_REPLY_MSG) + goto error; + + int i, j; + free(msg->lc_config_reply_msg->header); + for (i = 0; i < msg->lc_config_reply_msg->n_lc_ue_config; i++) { + for (j = 0; j < msg->lc_config_reply_msg->lc_ue_config[i]->n_lc_config; j++) { + free(msg->lc_config_reply_msg->lc_ue_config[i]->lc_config[j]); + } + free(msg->lc_config_reply_msg->lc_ue_config[i]->lc_config); + free(msg->lc_config_reply_msg->lc_ue_config[i]); + } + free(msg->lc_config_reply_msg->lc_ue_config); + free(msg->lc_config_reply_msg); + free(msg); + return 0; + error: + //LOG_E(FLEXRAN_AGENT, "%s: an error occured\n", __FUNCTION__); + return -1; +} + +int flexran_agent_destroy_ue_state_change(Protocol__FlexranMessage *msg) { + if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_UE_STATE_CHANGE_MSG) + goto error; + free(msg->ue_state_change_msg->header); + //TODO: Free the contents of the UE config structure + free(msg->ue_state_change_msg); + free(msg); + return 0; + + error: + //LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); + return -1; +} + +int flexran_agent_destroy_enb_config_request(Protocol__FlexranMessage *msg) { + if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_ENB_CONFIG_REQUEST_MSG) + goto error; + free(msg->enb_config_request_msg->header); + free(msg->enb_config_request_msg); + free(msg); + return 0; + + error: + //LOG_E(FLEXRAN_AGENT, "%s: an error occured\n", __FUNCTION__); + return -1; +} + +int flexran_agent_destroy_ue_config_request(Protocol__FlexranMessage *msg) { + /* TODO: Deallocate memory for a dynamically allocated UE config message */ + return 0; +} + +int flexran_agent_destroy_lc_config_request(Protocol__FlexranMessage *msg) { + /* TODO: Deallocate memory for a dynamically allocated LC config message */ + return 0; +} + +// call this function to start a nanosecond-resolution timer +struct timespec timer_start(){ + struct timespec start_time; + clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &start_time); + return start_time; +} + +// call this function to end a timer, returning nanoseconds elapsed as a long +long timer_end(struct timespec start_time){ + struct timespec end_time; + clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &end_time); + long diffInNanos = end_time.tv_nsec - start_time.tv_nsec; + return diffInNanos; +} + +int flexran_agent_control_delegation(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) { + + Protocol__FlexranMessage *input = (Protocol__FlexranMessage *)params; + Protocol__FlexControlDelegation *control_delegation_msg = input->control_delegation_msg; + + uint32_t delegation_type = control_delegation_msg->delegation_type; + + int i; + + struct timespec vartime = timer_start(); + + //Write the payload lib into a file in the cache and load the lib + char lib_name[120]; + char target[512]; + snprintf(lib_name, sizeof(lib_name), "/%s.so", control_delegation_msg->name); + strcpy(target, local_cache); + strcat(target, lib_name); + + FILE *f; + f = fopen(target, "wb"); + fwrite(control_delegation_msg->payload.data, control_delegation_msg->payload.len, 1, f); + fclose(f); + + long time_elapsed_nanos = timer_end(vartime); + *msg = NULL; + return 0; + + error: + return -1; +} + +int flexran_agent_destroy_control_delegation(Protocol__FlexranMessage *msg) { + /*TODO: Dealocate memory for a dynamically allocated control delegation message*/ +} + +int flexran_agent_reconfiguration(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) { + Protocol__FlexranMessage *input = (Protocol__FlexranMessage *)params; + Protocol__FlexAgentReconfiguration *agent_reconfiguration_msg = input->agent_reconfiguration_msg; + + apply_reconfiguration_policy(mod_id, agent_reconfiguration_msg->policy, strlen(agent_reconfiguration_msg->policy)); + + *msg = NULL; + return 0; +} + +int flexran_agent_destroy_agent_reconfiguration(Protocol__FlexranMessage *msg) { + /*TODO: Dealocate memory for a dynamically allocated agent reconfiguration message*/ +} + + +/* + * get generic info from RAN + */ + +void flexran_set_enb_vars(mid_t mod_id, ran_name_t ran){ + + switch (ran){ + case RAN_LTE_OAI : + enb[mod_id] = (void *)&eNB_mac_inst[mod_id]; + enb_ue[mod_id] = (void *)&eNB_mac_inst[mod_id].UE_list; + enb_rrc[mod_id] = (void *)&eNB_rrc_inst[mod_id]; + break; + default : + goto error; + } + + return; + + error: + LOG_E(FLEXRAN_AGENT, "unknown RAN name %d\n", ran); +} + +int flexran_get_current_time_ms (mid_t mod_id, int subframe_flag){ + + if (subframe_flag == 1){ + return ((eNB_MAC_INST *)enb[mod_id])->frame*10 + ((eNB_MAC_INST *)enb[mod_id])->subframe; + }else { + return ((eNB_MAC_INST *)enb[mod_id])->frame*10; + } + +} + +unsigned int flexran_get_current_frame (mid_t mod_id) { + + #warning "SFN will not be in [0-1023] when oaisim is used" + return ((eNB_MAC_INST *)enb[mod_id])->frame; + +} + +unsigned int flexran_get_current_system_frame_num(mid_t mod_id) { + return (flexran_get_current_frame(mod_id) %1024); +} + +unsigned int flexran_get_current_subframe (mid_t mod_id) { + + return ((eNB_MAC_INST *)enb[mod_id])->subframe; + +} + +uint16_t flexran_get_sfn_sf (mid_t mod_id) { + + frame_t frame; + sub_frame_t subframe; + uint16_t sfn_sf, frame_mask, sf_mask; + + frame = (frame_t) flexran_get_current_system_frame_num(mod_id); + subframe = (sub_frame_t) flexran_get_current_subframe(mod_id); + frame_mask = ((1<<12) - 1); + sf_mask = ((1<<4) - 1); + sfn_sf = (subframe & sf_mask) | ((frame & frame_mask) << 4); + + return sfn_sf; +} + +uint16_t flexran_get_future_sfn_sf (mid_t mod_id, int ahead_of_time) { + + frame_t frame; + sub_frame_t subframe; + uint16_t sfn_sf, frame_mask, sf_mask; + + frame = (frame_t) flexran_get_current_system_frame_num(mod_id); + subframe = (sub_frame_t) flexran_get_current_subframe(mod_id); + + subframe = ((subframe + ahead_of_time) % 10); + + int full_frames_ahead = ((ahead_of_time / 10) % 10); + + frame = frame + full_frames_ahead; + + if (subframe < flexran_get_current_subframe(mod_id)) { + frame++; + } + + frame_mask = ((1<<12) - 1); + sf_mask = ((1<<4) - 1); + sfn_sf = (subframe & sf_mask) | ((frame & frame_mask) << 4); + + return sfn_sf; +} + +int flexran_get_num_ues (mid_t mod_id){ + + return ((UE_list_t *)enb_ue[mod_id])->num_UEs; +} + +int flexran_get_ue_crnti (mid_t mod_id, mid_t ue_id) { + + return UE_RNTI(mod_id, ue_id); +} + +int flexran_get_ue_bsr (mid_t mod_id, mid_t ue_id, lcid_t lcid) { + + return ((UE_list_t *)enb_ue[mod_id])->UE_template[UE_PCCID(mod_id,ue_id)][ue_id].bsr_info[lcid]; +} + +int flexran_get_ue_phr (mid_t mod_id, mid_t ue_id) { + + return ((UE_list_t *)enb_ue[mod_id])->UE_template[UE_PCCID(mod_id,ue_id)][ue_id].phr_info; +} + +int flexran_get_ue_wcqi (mid_t mod_id, mid_t ue_id) { + return ((UE_list_t *)enb_ue[mod_id])->eNB_UE_stats[UE_PCCID(mod_id,ue_id)][ue_id].dl_cqi; +} + +int flexran_get_tx_queue_size(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id) { + rnti_t rnti = flexran_get_ue_crnti(mod_id,ue_id); + uint16_t frame = (uint16_t) flexran_get_current_frame(mod_id); + mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(mod_id,rnti, mod_id,frame,ENB_FLAG_YES,MBMS_FLAG_NO,channel_id,0); + return rlc_status.bytes_in_buffer; +} + +int flexran_update_TA(mid_t mod_id, mid_t ue_id, int CC_id) { + + UE_list_t *UE_list=&eNB_mac_inst[mod_id].UE_list; + UE_sched_ctrl *ue_sched_ctl = &UE_list->UE_sched_ctrl[ue_id]; + int rnti; + + rnti = flexran_get_ue_crnti(mod_id, ue_id); + if (ue_sched_ctl->ta_timer == 0) { + + // WE SHOULD PROTECT the eNB_UE_stats with a mutex here ... + LTE_eNB_UE_stats *eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id, CC_id, rnti); + ue_sched_ctl->ta_timer = 20; // wait 20 subframes before taking TA measurement from PHY + switch (PHY_vars_eNB_g[mod_id][CC_id]->frame_parms.N_RB_DL) { + case 6: + ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update; + break; + + case 15: + ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/2; + break; + + case 25: + ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/4; + break; + + case 50: + ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/8; + break; + + case 75: + ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/12; + break; + + case 100: + ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/16; + break; + } + // clear the update in case PHY does not have a new measurement after timer expiry + eNB_UE_stats->timing_advance_update = 0; + } + else { + ue_sched_ctl->ta_timer--; + ue_sched_ctl->ta_update = 0; // don't trigger a timing advance command + } + + return ue_sched_ctl->ta_update = 0; + +} + +int flexran_get_MAC_CE_bitmap_TA(mid_t mod_id, mid_t ue_id,int CC_id) { + + UE_list_t *UE_list = &eNB_mac_inst[mod_id].UE_list; + UE_sched_ctrl *ue_sched_ctl = &UE_list->UE_sched_ctrl[ue_id]; + + rnti_t rnti = flexran_get_ue_crnti(mod_id,ue_id); + LTE_eNB_UE_stats *eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id,CC_id,rnti); + + if (eNB_UE_stats == NULL) { + return 0; + } + + if (ue_sched_ctl->ta_update == 0) { + return 1; + } else { + return 0; + } + +} + +int flexran_get_active_CC(mid_t mod_id, mid_t ue_id) { + return ((UE_list_t *)enb_ue[mod_id])->numactiveCCs[ue_id]; +} + +int flexran_get_current_RI(mid_t mod_id, mid_t ue_id, int CC_id) { + LTE_eNB_UE_stats *eNB_UE_stats = NULL; + + int pCCid = UE_PCCID(mod_id,ue_id); + rnti_t rnti = flexran_get_ue_crnti(mod_id,ue_id); + + eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id,CC_id,rnti); + + if (eNB_UE_stats == NULL) { + return 0; + } + + return eNB_UE_stats[CC_id].rank; +} + +int flexran_get_tpc(mid_t mod_id, mid_t ue_id) { + LTE_eNB_UE_stats *eNB_UE_stats = NULL; + int32_t normalized_rx_power, target_rx_power; + int tpc = 1; + + int pCCid = UE_PCCID(mod_id,ue_id); + rnti_t rnti = flexran_get_ue_crnti(mod_id,ue_id); + + eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id, pCCid, rnti); + + target_rx_power = mac_xface->get_target_pusch_rx_power(mod_id,pCCid); + + if (eNB_UE_stats == NULL) { + normalized_rx_power = target_rx_power; + } else if (eNB_UE_stats->UL_rssi != NULL) { + normalized_rx_power = eNB_UE_stats->UL_rssi[0]; + } else { + normalized_rx_power = target_rx_power; + } + + if (normalized_rx_power>(target_rx_power+1)) { + tpc = 0; //-1 + } else if (normalized_rx_power<(target_rx_power-1)) { + tpc = 2; //+1 + } else { + tpc = 1; //0 + } + return tpc; +} + +int flexran_get_harq(const mid_t mod_id, const uint8_t CC_id, const mid_t ue_id, const int frame, const uint8_t subframe, int *id, int *round) { //flag_id_status = 0 then id, else status + /*TODO: Add int TB in function parameters to get the status of the second TB. This can be done to by editing in + * get_ue_active_harq_pid function in line 272 file: phy_procedures_lte_eNB.c to add + * DLSCH_ptr = PHY_vars_eNB_g[Mod_id][CC_id]->dlsch_eNB[(uint32_t)UE_id][1];*/ + + uint8_t harq_pid; + uint8_t harq_round; + + + uint16_t rnti = flexran_get_ue_crnti(mod_id,ue_id); + + mac_xface->get_ue_active_harq_pid(mod_id,CC_id,rnti,frame,subframe,&harq_pid,&harq_round,openair_harq_DL); + + *id = harq_pid; + *round = harq_round; + /* if (round > 0) { */ + /* *status = 1; */ + /* } else { */ + /* *status = 0; */ + /* } */ + + /* return 0; */ + return round; +} + +int flexran_get_p0_pucch_dbm(mid_t mod_id, mid_t ue_id, int CC_id) { + LTE_eNB_UE_stats *eNB_UE_stats = NULL; + uint32_t rnti = flexran_get_ue_crnti(mod_id,ue_id); + + eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id, CC_id, rnti); + + if (eNB_UE_stats == NULL) { + return -1; + } + + if(eNB_UE_stats->Po_PUCCH_update == 1) { + return eNB_UE_stats->Po_PUCCH_dBm; + } + else + return -1; +} + +int flexran_get_p0_nominal_pucch(mid_t mod_id, int CC_id) { + int32_t pucch_rx_received = mac_xface->get_target_pucch_rx_power(mod_id, CC_id); + return pucch_rx_received; +} + +int flexran_get_p0_pucch_status(mid_t mod_id, mid_t ue_id, int CC_id) { + LTE_eNB_UE_stats *eNB_UE_stats = NULL; + uint32_t rnti = flexran_get_ue_crnti(mod_id,ue_id); + + eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id, CC_id, rnti); + return eNB_UE_stats->Po_PUCCH_update; +} + +int flexran_update_p0_pucch(mid_t mod_id, mid_t ue_id, int CC_id) { + LTE_eNB_UE_stats *eNB_UE_stats = NULL; + uint32_t rnti = flexran_get_ue_crnti(mod_id,ue_id); + + eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id, CC_id, rnti); + eNB_UE_stats->Po_PUCCH_update = 0; + + return 0; +} + + +/* + * ************************************ + * Get Messages for eNB Configuration Reply + * ************************************ + */ + +int flexran_get_hopping_offset(mid_t mod_id, int CC_id) { + LTE_DL_FRAME_PARMS *frame_parms; + + frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id); + return frame_parms->pusch_config_common.pusch_HoppingOffset; +} + +int flexran_get_hopping_mode(mid_t mod_id, int CC_id) { + LTE_DL_FRAME_PARMS *frame_parms; + + frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id); + return frame_parms->pusch_config_common.hoppingMode; +} + +int flexran_get_n_SB(mid_t mod_id, int CC_id) { + LTE_DL_FRAME_PARMS *frame_parms; + + frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id); + return frame_parms->pusch_config_common.n_SB; +} + +int flexran_get_enable64QAM(mid_t mod_id, int CC_id) { + LTE_DL_FRAME_PARMS *frame_parms; + + frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id); + return frame_parms->pusch_config_common.enable64QAM; +} + +int flexran_get_phich_duration(mid_t mod_id, int CC_id) { + LTE_DL_FRAME_PARMS *frame_parms; + + frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id); + return frame_parms->phich_config_common.phich_duration; +} + +int flexran_get_phich_resource(mid_t mod_id, int CC_id) { + LTE_DL_FRAME_PARMS *frame_parms; + + frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id); + if(frame_parms->phich_config_common.phich_resource == oneSixth) + return 0; + else if(frame_parms->phich_config_common.phich_resource == half) + return 1; + else if(frame_parms->phich_config_common.phich_resource == one) + return 2; + else if(frame_parms->phich_config_common.phich_resource == two) + return 3; + + return -1; +} + +int flexran_get_n1pucch_an(mid_t mod_id, int CC_id) { + LTE_DL_FRAME_PARMS *frame_parms; + + frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id); + return frame_parms->pucch_config_common.n1PUCCH_AN; +} + +int flexran_get_nRB_CQI(mid_t mod_id, int CC_id) { + LTE_DL_FRAME_PARMS *frame_parms; + + frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id); + return frame_parms->pucch_config_common.nRB_CQI; +} + +int flexran_get_deltaPUCCH_Shift(mid_t mod_id, int CC_id) { + LTE_DL_FRAME_PARMS *frame_parms; + + frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id); + return frame_parms->pucch_config_common.deltaPUCCH_Shift; +} + +int flexran_get_prach_ConfigIndex(mid_t mod_id, int CC_id) { + LTE_DL_FRAME_PARMS *frame_parms; + + frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id); + return frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex; +} + +int flexran_get_prach_FreqOffset(mid_t mod_id, int CC_id) { + LTE_DL_FRAME_PARMS *frame_parms; + + frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id); + return frame_parms->prach_config_common.prach_ConfigInfo.prach_FreqOffset; +} + +int flexran_get_maxHARQ_Msg3Tx(mid_t mod_id, int CC_id) { + LTE_DL_FRAME_PARMS *frame_parms; + + frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id); + return frame_parms->maxHARQ_Msg3Tx; +} + +int flexran_get_ul_cyclic_prefix_length(mid_t mod_id, int CC_id) { + LTE_DL_FRAME_PARMS *frame_parms; + + frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id); + return frame_parms->Ncp_UL; +} + +int flexran_get_dl_cyclic_prefix_length(mid_t mod_id, int CC_id) { + LTE_DL_FRAME_PARMS *frame_parms; + + frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id); + return frame_parms->Ncp; +} + +int flexran_get_cell_id(mid_t mod_id, int CC_id) { + LTE_DL_FRAME_PARMS *frame_parms; + + frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id); + return frame_parms->Nid_cell; +} + +int flexran_get_srs_BandwidthConfig(mid_t mod_id, int CC_id) { + LTE_DL_FRAME_PARMS *frame_parms; + + frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id); + return frame_parms->soundingrs_ul_config_common.srs_BandwidthConfig; +} + +int flexran_get_srs_SubframeConfig(mid_t mod_id, int CC_id) { + LTE_DL_FRAME_PARMS *frame_parms; + + frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id); + return frame_parms->soundingrs_ul_config_common.srs_SubframeConfig; +} + +int flexran_get_srs_MaxUpPts(mid_t mod_id, int CC_id) { + LTE_DL_FRAME_PARMS *frame_parms; + + frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id); + return frame_parms->soundingrs_ul_config_common.srs_MaxUpPts; +} + +int flexran_get_N_RB_DL(mid_t mod_id, int CC_id) { + LTE_DL_FRAME_PARMS *frame_parms; + + frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id); + return frame_parms->N_RB_DL; +} + +int flexran_get_N_RB_UL(mid_t mod_id, int CC_id) { + LTE_DL_FRAME_PARMS *frame_parms; + + frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id); + return frame_parms->N_RB_UL; +} + +int flexran_get_N_RBG(mid_t mod_id, int CC_id) { + LTE_DL_FRAME_PARMS *frame_parms; + + frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id); + return frame_parms->N_RBG; +} + +int flexran_get_subframe_assignment(mid_t mod_id, int CC_id) { + LTE_DL_FRAME_PARMS *frame_parms; + + frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id); + return frame_parms->tdd_config; +} + +int flexran_get_special_subframe_assignment(mid_t mod_id, int CC_id) { + LTE_DL_FRAME_PARMS *frame_parms; + + frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id); + return frame_parms->tdd_config_S; +} + +int flexran_get_ra_ResponseWindowSize(mid_t mod_id, int CC_id) { + Enb_properties_array_t *enb_properties; + enb_properties = enb_config_get(); + return enb_properties->properties[mod_id]->rach_raResponseWindowSize[CC_id]; +} + +int flexran_get_mac_ContentionResolutionTimer(mid_t mod_id, int CC_id) { + Enb_properties_array_t *enb_properties; + enb_properties = enb_config_get(); + return enb_properties->properties[mod_id]->rach_macContentionResolutionTimer[CC_id]; +} + +int flexran_get_duplex_mode(mid_t mod_id, int CC_id) { + LTE_DL_FRAME_PARMS *frame_parms; + + frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id); + if(frame_parms->frame_type == TDD) + return PROTOCOL__FLEX_DUPLEX_MODE__FLDM_TDD; + else if (frame_parms->frame_type == FDD) + return PROTOCOL__FLEX_DUPLEX_MODE__FLDM_FDD; + + return -1; +} + +long flexran_get_si_window_length(mid_t mod_id, int CC_id) { + return ((eNB_RRC_INST *)enb_rrc[mod_id])->carrier[CC_id].sib1->si_WindowLength; +} + +int flexran_get_sib1_length(mid_t mod_id, int CC_id) { + return ((eNB_RRC_INST *)enb_rrc[mod_id])->carrier[CC_id].sizeof_SIB1; +} + +int flexran_get_num_pdcch_symb(mid_t mod_id, int CC_id) { + /* TODO: This should return the number of PDCCH symbols initially used by the cell CC_id */ + return 0; + //(PHY_vars_UE_g[mod_id][CC_id]->lte_ue_pdcch_vars[mod_id]->num_pdcch_symbols); +} + + + +/* + * ************************************ + * Get Messages for UE Configuration Reply + * ************************************ + */ + + +int flexran_get_time_alignment_timer(mid_t mod_id, mid_t ue_id) { + struct rrc_eNB_ue_context_s* ue_context_p = NULL; + uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id); + + ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP); + if(ue_context_p != NULL) { + if(ue_context_p->ue_context.mac_MainConfig != NULL) + return ue_context_p->ue_context.mac_MainConfig->timeAlignmentTimerDedicated; + } + else + return -1; +} + +int flexran_get_meas_gap_config(mid_t mod_id, mid_t ue_id) { + struct rrc_eNB_ue_context_s* ue_context_p = NULL; + uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id); + + ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP); + if(ue_context_p != NULL) { + if(ue_context_p->ue_context.measGapConfig != NULL) { + if(ue_context_p->ue_context.measGapConfig->present == MeasGapConfig_PR_setup) { + if (ue_context_p->ue_context.measGapConfig->choice.setup.gapOffset.present == MeasGapConfig__setup__gapOffset_PR_gp0) { + return PROTOCOL__FLEX_MEAS_GAP_CONFIG_PATTERN__FLMGCP_GP1; + } else if (ue_context_p->ue_context.measGapConfig->choice.setup.gapOffset.present == MeasGapConfig__setup__gapOffset_PR_gp1) { + return PROTOCOL__FLEX_MEAS_GAP_CONFIG_PATTERN__FLMGCP_GP2; + } else { + return PROTOCOL__FLEX_MEAS_GAP_CONFIG_PATTERN__FLMGCP_OFF; + } + } + } + } + return -1; +} + + +int flexran_get_meas_gap_config_offset(mid_t mod_id, mid_t ue_id) { + struct rrc_eNB_ue_context_s* ue_context_p = NULL; + uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id); + + ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP); + + if(ue_context_p != NULL) { + if(ue_context_p->ue_context.measGapConfig != NULL){ + if(ue_context_p->ue_context.measGapConfig->present == MeasGapConfig_PR_setup) { + if (ue_context_p->ue_context.measGapConfig->choice.setup.gapOffset.present == MeasGapConfig__setup__gapOffset_PR_gp0) { + return ue_context_p->ue_context.measGapConfig->choice.setup.gapOffset.choice.gp0; + } else if (ue_context_p->ue_context.measGapConfig->choice.setup.gapOffset.present == MeasGapConfig__setup__gapOffset_PR_gp1) { + return ue_context_p->ue_context.measGapConfig->choice.setup.gapOffset.choice.gp0; + } + } + } + } + return -1; +} + +int flexran_get_ue_aggregated_max_bitrate_dl (mid_t mod_id, mid_t ue_id) { + return ((UE_list_t *)enb_ue[mod_id])->UE_sched_ctrl[ue_id].ue_AggregatedMaximumBitrateDL; +} + +int flexran_get_ue_aggregated_max_bitrate_ul (mid_t mod_id, mid_t ue_id) { + return ((UE_list_t *)enb_ue[mod_id])->UE_sched_ctrl[ue_id].ue_AggregatedMaximumBitrateUL; +} + +int flexran_get_half_duplex(mid_t ue_id) { + // TODO + //int halfduplex = 0; + //int bands_to_scan = ((UE_RRC_INST *)enb_ue_rrc[ue_id])->UECap->UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list.count; + //for (int i =0; i < bands_to_scan; i++){ + //if(((UE_RRC_INST *)enb_ue_rrc[ue_id])->UECap->UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list.array[i]->halfDuplex > 0) + // halfduplex = 1; + //} + //return halfduplex; +} + +int flexran_get_intra_sf_hopping(mid_t ue_id) { + //TODO:Get proper value + //temp = (((UE_RRC_INST *)enb_ue_rrc[ue_id])->UECap->UE_EUTRA_Capability->featureGroupIndicators->buf); + //return (0 & ( 1 << (31))); +} + +int flexran_get_type2_sb_1(mid_t ue_id) { + //TODO:Get proper value + //uint8_t temp = 0; + //temp = (((UE_RRC_INST *)enb_ue_rrc[ue_id])->UECap->UE_EUTRA_Capability->featureGroupIndicators->buf); + //return (temp & ( 1 << (11))); +} + +int flexran_get_ue_category(mid_t ue_id) { + //TODO:Get proper value + //return (((UE_RRC_INST *)enb_ue_rrc[ue_id])->UECap->UE_EUTRA_Capability->ue_Category); +} + +int flexran_get_res_alloc_type1(mid_t ue_id) { + //TODO:Get proper value + //uint8_t temp = 0; + //temp = (((UE_RRC_INST *)enb_ue_rrc[ue_id])->UECap->UE_EUTRA_Capability->featureGroupIndicators->buf); + //return (temp & ( 1 << (30))); +} + +int flexran_get_ue_transmission_mode(mid_t mod_id, mid_t ue_id) { + struct rrc_eNB_ue_context_s* ue_context_p = NULL; + uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id); + + ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP); + + if(ue_context_p != NULL) { + if(ue_context_p->ue_context.physicalConfigDedicated != NULL){ + return ue_context_p->ue_context.physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode; + } + } + else + return -1; +} + +int flexran_get_tti_bundling(mid_t mod_id, mid_t ue_id) { + struct rrc_eNB_ue_context_s* ue_context_p = NULL; + uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id); + + ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP); + if(ue_context_p != NULL) { + if(ue_context_p->ue_context.mac_MainConfig != NULL){ + return ue_context_p->ue_context.mac_MainConfig->ul_SCH_Config->ttiBundling; + } + } + else + return -1; +} + +int flexran_get_maxHARQ_TX(mid_t mod_id, mid_t ue_id) { + struct rrc_eNB_ue_context_s* ue_context_p = NULL; + uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id); + + ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP); + if(ue_context_p != NULL) { + if(ue_context_p->ue_context.mac_MainConfig != NULL){ + return *ue_context_p->ue_context.mac_MainConfig->ul_SCH_Config->maxHARQ_Tx; + } + } + return -1; +} + +int flexran_get_beta_offset_ack_index(mid_t mod_id, mid_t ue_id) { + struct rrc_eNB_ue_context_s* ue_context_p = NULL; + uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id); + + ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP); + if(ue_context_p != NULL) { + if(ue_context_p->ue_context.physicalConfigDedicated != NULL){ + return ue_context_p->ue_context.physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_ACK_Index; + } + } + else + return -1; +} + +int flexran_get_beta_offset_ri_index(mid_t mod_id, mid_t ue_id) { + struct rrc_eNB_ue_context_s* ue_context_p = NULL; + uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id); + + ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP); + if(ue_context_p != NULL) { + if(ue_context_p->ue_context.physicalConfigDedicated != NULL){ + return ue_context_p->ue_context.physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_RI_Index; + } + } + else + return -1; +} + +int flexran_get_beta_offset_cqi_index(mid_t mod_id, mid_t ue_id) { + struct rrc_eNB_ue_context_s* ue_context_p = NULL; + uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id); + + ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP); + if(ue_context_p != NULL) { + if(ue_context_p->ue_context.physicalConfigDedicated != NULL){ + return ue_context_p->ue_context.physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_CQI_Index; + } + } + else + return -1; +} + +int flexran_get_simultaneous_ack_nack_cqi(mid_t mod_id, mid_t ue_id) { + struct rrc_eNB_ue_context_s* ue_context_p = NULL; + uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id); + + ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP); + if(ue_context_p != NULL) { + if(ue_context_p->ue_context.physicalConfigDedicated != NULL){ + if (ue_context_p->ue_context.physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic != NULL) { + return ue_context_p->ue_context.physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.simultaneousAckNackAndCQI; + } + } + } + return -1; +} + +int flexran_get_ack_nack_simultaneous_trans(mid_t mod_id,mid_t ue_id) { + return (&eNB_rrc_inst[mod_id])->carrier[0].sib2->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission; +} + +int flexran_get_aperiodic_cqi_rep_mode(mid_t mod_id,mid_t ue_id) { + struct rrc_eNB_ue_context_s* ue_context_p = NULL; + uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id); + + ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP); + + if(ue_context_p != NULL) { + if(ue_context_p->ue_context.physicalConfigDedicated != NULL){ + return *ue_context_p->ue_context.physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic; + } + } + return -1; +} + +int flexran_get_tdd_ack_nack_feedback(mid_t mod_id, mid_t ue_id) { + struct rrc_eNB_ue_context_s* ue_context_p = NULL; + uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id); + + ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP); + + if(ue_context_p != NULL) { + if(ue_context_p->ue_context.physicalConfigDedicated != NULL){ + return ue_context_p->ue_context.physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode; + } + } + else + return -1; +} + +int flexran_get_ack_nack_repetition_factor(mid_t mod_id, mid_t ue_id) { + struct rrc_eNB_ue_context_s* ue_context_p = NULL; + uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id); + + ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP); + if(ue_context_p != NULL) { + if(ue_context_p->ue_context.physicalConfigDedicated != NULL){ + return ue_context_p->ue_context.physicalConfigDedicated->pucch_ConfigDedicated->ackNackRepetition.choice.setup.repetitionFactor; + } + } + else + return -1; +} + +int flexran_get_extended_bsr_size(mid_t mod_id, mid_t ue_id) { + //TODO: need to double check + struct rrc_eNB_ue_context_s* ue_context_p = NULL; + uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id); + + ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP); + if(ue_context_p != NULL) { + if(ue_context_p->ue_context.mac_MainConfig != NULL){ + if(ue_context_p->ue_context.mac_MainConfig->ext2 != NULL){ + long val = (*(ue_context_p->ue_context.mac_MainConfig->ext2->mac_MainConfig_v1020->extendedBSR_Sizes_r10)); + if (val > 0) { + return 1; + } + } + } + } + return -1; +} + +int flexran_get_ue_transmission_antenna(mid_t mod_id, mid_t ue_id) { + struct rrc_eNB_ue_context_s* ue_context_p = NULL; + uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id); + + ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP); + + if(ue_context_p != NULL) { + if(ue_context_p->ue_context.physicalConfigDedicated != NULL){ + if(ue_context_p->ue_context.physicalConfigDedicated->antennaInfo->choice.explicitValue.ue_TransmitAntennaSelection.choice.setup == AntennaInfoDedicated__ue_TransmitAntennaSelection__setup_closedLoop) + return 2; + else if(ue_context_p->ue_context.physicalConfigDedicated->antennaInfo->choice.explicitValue.ue_TransmitAntennaSelection.choice.setup == AntennaInfoDedicated__ue_TransmitAntennaSelection__setup_openLoop) + return 1; + else + return 0; + } + } + else + return -1; +} + +int flexran_get_lcg(mid_t ue_id, mid_t lc_id) { + if (UE_mac_inst == NULL) { + return -1; + } + if(UE_mac_inst[ue_id].logicalChannelConfig[lc_id] != NULL) { + return *UE_mac_inst[ue_id].logicalChannelConfig[lc_id]->ul_SpecificParameters->logicalChannelGroup; + } else { + return -1; + } +} + +int flexran_get_direction(mid_t ue_id, mid_t lc_id) { + /*TODO: fill with the value for the rest of LCID*/ + if(lc_id == DCCH | lc_id == DCCH1) + return 2; + else if(lc_id == DTCH) + return 1; +} + +int flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_change) { + int size; + Protocol__FlexranMessage *msg; + Protocol__FlexHeader *header; + void *data; + int priority; + err_code_t err_code; + + int xid = 0; + + if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_UE_STATE_CHANGE, &header) != 0) + goto error; + + Protocol__FlexUeStateChange *ue_state_change_msg; + ue_state_change_msg = malloc(sizeof(Protocol__FlexUeStateChange)); + if(ue_state_change_msg == NULL) { + goto error; + } + protocol__flex_ue_state_change__init(ue_state_change_msg); + ue_state_change_msg->has_type = 1; + ue_state_change_msg->type = state_change; + + Protocol__FlexUeConfig *config; + config = malloc(sizeof(Protocol__FlexUeConfig)); + if (config == NULL) { + goto error; + } + protocol__flex_ue_config__init(config); + if (state_change == PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED) { + // Simply set the rnti of the UE + config->has_rnti = 1; + config->rnti = rnti; + } else if (state_change == PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_UPDATED + || state_change == PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_ACTIVATED) { + int i = find_UE_id(mod_id, rnti); + config->has_rnti = 1; + config->rnti = rnti; + if(flexran_get_time_alignment_timer(mod_id,i) != -1) { + config->time_alignment_timer = flexran_get_time_alignment_timer(mod_id,i); + config->has_time_alignment_timer = 1; + } + if(flexran_get_meas_gap_config(mod_id,i) != -1){ + config->meas_gap_config_pattern = flexran_get_meas_gap_config(mod_id,i); + config->has_meas_gap_config_pattern = 1; + } + if(config->has_meas_gap_config_pattern == 1 && + config->meas_gap_config_pattern != PROTOCOL__FLEX_MEAS_GAP_CONFIG_PATTERN__FLMGCP_OFF) { + config->meas_gap_config_sf_offset = flexran_get_meas_gap_config_offset(mod_id,i); + config->has_meas_gap_config_sf_offset = 1; + } + //TODO: Set the SPS configuration (Optional) + //Not supported for now, so we do not set it + + //TODO: Set the SR configuration (Optional) + //We do not set it for now + + //TODO: Set the CQI configuration (Optional) + //We do not set it for now + + if(flexran_get_ue_transmission_mode(mod_id,i) != -1) { + config->transmission_mode = flexran_get_ue_transmission_mode(mod_id,i); + config->has_transmission_mode = 1; + } + + config->ue_aggregated_max_bitrate_ul = flexran_get_ue_aggregated_max_bitrate_ul(mod_id,i); + config->has_ue_aggregated_max_bitrate_ul = 1; + + config->ue_aggregated_max_bitrate_dl = flexran_get_ue_aggregated_max_bitrate_dl(mod_id,i); + config->has_ue_aggregated_max_bitrate_dl = 1; + + //TODO: Set the UE capabilities + Protocol__FlexUeCapabilities *c_capabilities; + c_capabilities = malloc(sizeof(Protocol__FlexUeCapabilities)); + protocol__flex_ue_capabilities__init(c_capabilities); + //TODO: Set half duplex (FDD operation) + c_capabilities->has_half_duplex = 0; + c_capabilities->half_duplex = 1;//flexran_get_half_duplex(i); + //TODO: Set intra-frame hopping flag + c_capabilities->has_intra_sf_hopping = 0; + c_capabilities->intra_sf_hopping = 1;//flexran_get_intra_sf_hopping(i); + //TODO: Set support for type 2 hopping with n_sb > 1 + c_capabilities->has_type2_sb_1 = 0; + c_capabilities->type2_sb_1 = 1;//flexran_get_type2_sb_1(i); + //TODO: Set ue category + c_capabilities->has_ue_category = 0; + c_capabilities->ue_category = 1;//flexran_get_ue_category(i); + //TODO: Set UE support for resource allocation type 1 + c_capabilities->has_res_alloc_type1 = 0; + c_capabilities->res_alloc_type1 = 1;//flexran_get_res_alloc_type1(i); + //Set the capabilites to the message + config->capabilities = c_capabilities; + + if(flexran_get_ue_transmission_antenna(mod_id,i) != -1) { + config->has_ue_transmission_antenna = 1; + config->ue_transmission_antenna = flexran_get_ue_transmission_antenna(mod_id,i); + } + + if(flexran_get_tti_bundling(mod_id,i) != -1) { + config->has_tti_bundling = 1; + config->tti_bundling = flexran_get_tti_bundling(mod_id,i); + } + + if(flexran_get_maxHARQ_TX(mod_id,i) != -1){ + config->has_max_harq_tx = 1; + config->max_harq_tx = flexran_get_maxHARQ_TX(mod_id,i); + } + + if(flexran_get_beta_offset_ack_index(mod_id,i) != -1) { + config->has_beta_offset_ack_index = 1; + config->beta_offset_ack_index = flexran_get_beta_offset_ack_index(mod_id,i); + } + + if(flexran_get_beta_offset_ri_index(mod_id,i) != -1) { + config->has_beta_offset_ri_index = 1; + config->beta_offset_ri_index = flexran_get_beta_offset_ri_index(mod_id,i); + } + + if(flexran_get_beta_offset_cqi_index(mod_id,i) != -1) { + config->has_beta_offset_cqi_index = 1; + config->beta_offset_cqi_index = flexran_get_beta_offset_cqi_index(mod_id,i); + } + + if(flexran_get_ack_nack_simultaneous_trans(mod_id,i) != -1) { + config->has_ack_nack_simultaneous_trans = 1; + config->ack_nack_simultaneous_trans = flexran_get_ack_nack_simultaneous_trans(mod_id,i); + } + + if(flexran_get_simultaneous_ack_nack_cqi(mod_id,i) != -1) { + config->has_simultaneous_ack_nack_cqi = 1; + config->simultaneous_ack_nack_cqi = flexran_get_simultaneous_ack_nack_cqi(mod_id,i); + } + + if(flexran_get_aperiodic_cqi_rep_mode(mod_id,i) != -1) { + config->has_aperiodic_cqi_rep_mode = 1; + int mode = flexran_get_aperiodic_cqi_rep_mode(mod_id,i); + if (mode > 4) { + config->aperiodic_cqi_rep_mode = PROTOCOL__FLEX_APERIODIC_CQI_REPORT_MODE__FLACRM_NONE; + } else { + config->aperiodic_cqi_rep_mode = mode; + } + } + + if(flexran_get_tdd_ack_nack_feedback(mod_id, i) != -1) { + config->has_tdd_ack_nack_feedback = 1; + config->tdd_ack_nack_feedback = flexran_get_tdd_ack_nack_feedback(mod_id,i); + } + + if(flexran_get_ack_nack_repetition_factor(mod_id, i) != -1) { + config->has_ack_nack_repetition_factor = 1; + config->ack_nack_repetition_factor = flexran_get_ack_nack_repetition_factor(mod_id,i); + } + + if(flexran_get_extended_bsr_size(mod_id, i) != -1) { + config->has_extended_bsr_size = 1; + config->extended_bsr_size = flexran_get_extended_bsr_size(mod_id,i); + } + + config->has_pcell_carrier_index = 1; + config->pcell_carrier_index = UE_PCCID(mod_id, i); + //TODO: Set carrier aggregation support (boolean) + config->has_ca_support = 0; + config->ca_support = 0; + if(config->has_ca_support){ + //TODO: Set cross carrier scheduling support (boolean) + config->has_cross_carrier_sched_support = 1; + config->cross_carrier_sched_support = 0; + //TODO: Set secondary cells configuration + // We do not set it for now. No carrier aggregation support + + //TODO: Set deactivation timer for secondary cell + config->has_scell_deactivation_timer = 0; + config->scell_deactivation_timer = 0; + } + } else if (state_change == PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_MOVED) { + // TODO: Not supported for now. Leave blank + } + + ue_state_change_msg->config = config; + msg = malloc(sizeof(Protocol__FlexranMessage)); + if (msg == NULL) { + goto error; + } + protocol__flexran_message__init(msg); + msg->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_UE_STATE_CHANGE_MSG; + msg->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__INITIATING_MESSAGE; + msg->ue_state_change_msg = ue_state_change_msg; + + data = flexran_agent_pack_message(msg, &size); + /*Send sr info using the MAC channel of the eNB*/ + if (flexran_agent_msg_send(mod_id, FLEXRAN_AGENT_DEFAULT, data, size, priority)) { + err_code = PROTOCOL__FLEXRAN_ERR__MSG_ENQUEUING; + goto error; + } + + LOG_D(FLEXRAN_AGENT,"sent message with size %d\n", size); + return; + error: + LOG_D(FLEXRAN_AGENT, "Could not send UE state message\n"); +} + + + +int flexran_agent_lc_config_reply(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) { + + xid_t xid; + Protocol__FlexranMessage *input = (Protocol__FlexranMessage *)params; + Protocol__FlexLcConfigRequest *lc_config_request_msg = input->lc_config_request_msg; + xid = (lc_config_request_msg->header)->xid; + + int i, j; + Protocol__FlexHeader *header; + if(flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_GET_LC_CONFIG_REPLY, &header) != 0) + goto error; + + Protocol__FlexLcConfigReply *lc_config_reply_msg; + lc_config_reply_msg = malloc(sizeof(Protocol__FlexLcConfigReply)); + if(lc_config_reply_msg == NULL) + goto error; + protocol__flex_lc_config_reply__init(lc_config_reply_msg); + lc_config_reply_msg->header = header; + + lc_config_reply_msg->n_lc_ue_config = flexran_get_num_ues(mod_id); + + Protocol__FlexLcUeConfig **lc_ue_config; + if (lc_config_reply_msg->n_lc_ue_config > 0) { + lc_ue_config = malloc(sizeof(Protocol__FlexLcUeConfig *) * lc_config_reply_msg->n_lc_ue_config); + if (lc_ue_config == NULL) { + goto error; + } + // Fill the config for each UE + for (i = 0; i < lc_config_reply_msg->n_lc_ue_config; i++) { + lc_ue_config[i] = malloc(sizeof(Protocol__FlexLcUeConfig)); + protocol__flex_lc_ue_config__init(lc_ue_config[i]); + + lc_ue_config[i]->has_rnti = 1; + lc_ue_config[i]->rnti = flexran_get_ue_crnti(mod_id,i); + + //TODO: Set the number of LC configurations that will be reported for this UE + //Set this according to the current state of the UE. This is only a temporary fix + int status = 0; + status = mac_eNB_get_rrc_status(mod_id, flexran_get_ue_crnti(mod_id, i)); + if (status < RRC_CONNECTED) { + lc_ue_config[i]->n_lc_config = 0; + } else if (status == RRC_CONNECTED) { + lc_ue_config[i]->n_lc_config = 1; + } else { + lc_ue_config[i]->n_lc_config = 3; + } + + Protocol__FlexLcConfig **lc_config; + if (lc_ue_config[i]->n_lc_config > 0) { + lc_config = malloc(sizeof(Protocol__FlexLcConfig *) * lc_ue_config[i]->n_lc_config); + if (lc_config == NULL) { + goto error; + } + for (j = 0; j < lc_ue_config[i]->n_lc_config; j++) { + lc_config[j] = malloc(sizeof(Protocol__FlexLcConfig)); + protocol__flex_lc_config__init(lc_config[j]); + + lc_config[j]->has_lcid = 1; + lc_config[j]->lcid = j+1; + + int lcg = flexran_get_lcg(i, j+1); + if (lcg >= 0 && lcg <= 3) { + lc_config[j]->has_lcg = 1; + lc_config[j]->lcg = flexran_get_lcg(i,j+1); + } + + lc_config[j]->has_direction = 1; + lc_config[j]->direction = flexran_get_direction(i,j+1); + //TODO: Bearer type. One of FLQBT_* values. Currently only default bearer supported + lc_config[j]->has_qos_bearer_type = 1; + lc_config[j]->qos_bearer_type = PROTOCOL__FLEX_QOS_BEARER_TYPE__FLQBT_NON_GBR; + + //TODO: Set the QCI defined in TS 23.203, coded as defined in TS 36.413 + // One less than the actual QCI value. Needs to be generalized + lc_config[j]->has_qci = 1; + lc_config[j]->qci = 1; + if (lc_config[j]->direction == PROTOCOL__FLEX_QOS_BEARER_TYPE__FLQBT_GBR) { + //TODO: Set the max bitrate (UL) + lc_config[j]->has_e_rab_max_bitrate_ul = 0; + lc_config[j]->e_rab_max_bitrate_ul = 0; + //TODO: Set the max bitrate (DL) + lc_config[j]->has_e_rab_max_bitrate_dl = 0; + lc_config[j]->e_rab_max_bitrate_dl = 0; + //TODO: Set the guaranteed bitrate (UL) + lc_config[j]->has_e_rab_guaranteed_bitrate_ul = 0; + lc_config[j]->e_rab_guaranteed_bitrate_ul = 0; + //TODO: Set the guaranteed bitrate (DL) + lc_config[j]->has_e_rab_guaranteed_bitrate_dl = 0; + lc_config[j]->e_rab_guaranteed_bitrate_dl = 0; + } + } + lc_ue_config[i]->lc_config = lc_config; + } + } // end for UE + lc_config_reply_msg->lc_ue_config = lc_ue_config; + } // lc_config_reply_msg->n_lc_ue_config > 0 + *msg = malloc(sizeof(Protocol__FlexranMessage)); + if (*msg == NULL) + goto error; + protocol__flexran_message__init(*msg); + (*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_LC_CONFIG_REPLY_MSG; + (*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__SUCCESSFUL_OUTCOME; + (*msg)->lc_config_reply_msg = lc_config_reply_msg; + + return 0; + + error: + // TODO: Need to make proper error handling + if (header != NULL) + free(header); + if (lc_config_reply_msg != NULL) + free(lc_config_reply_msg); + if(*msg != NULL) + free(*msg); + //LOG_E(FLEXRAN_AGENT, "%s: an error occured\n", __FUNCTION__); + return -1; +} + +/* + * ************************************ + * UE Configuration Reply + * ************************************ + */ + +int flexran_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) { + + xid_t xid; + Protocol__FlexranMessage *input = (Protocol__FlexranMessage *)params; + Protocol__FlexUeConfigRequest *ue_config_request_msg = input->ue_config_request_msg; + xid = (ue_config_request_msg->header)->xid; + + int i; + + Protocol__FlexHeader *header; + if(flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_GET_UE_CONFIG_REPLY, &header) != 0) + goto error; + + Protocol__FlexUeConfigReply *ue_config_reply_msg; + ue_config_reply_msg = malloc(sizeof(Protocol__FlexUeConfigReply)); + if(ue_config_reply_msg == NULL) + goto error; + protocol__flex_ue_config_reply__init(ue_config_reply_msg); + ue_config_reply_msg->header = header; + + ue_config_reply_msg->n_ue_config = flexran_get_num_ues(mod_id); + + Protocol__FlexUeConfig **ue_config; + if (ue_config_reply_msg->n_ue_config > 0) { + ue_config = malloc(sizeof(Protocol__FlexUeConfig *) * ue_config_reply_msg->n_ue_config); + if (ue_config == NULL) { + goto error; + } + for (i = 0; i < ue_config_reply_msg->n_ue_config; i++) { + ue_config[i] = malloc(sizeof(Protocol__FlexUeConfig)); + protocol__flex_ue_config__init(ue_config[i]); + + ue_config[i]->rnti = flexran_get_ue_crnti(mod_id,i); + ue_config[i]->has_rnti = 1; + //TODO: Set the DRX configuration (optional) + //Not supported for now, so we do not set it + + if (flexran_get_time_alignment_timer(mod_id,i) != -1) { + ue_config[i]->time_alignment_timer = flexran_get_time_alignment_timer(mod_id,i); + ue_config[i]->has_time_alignment_timer = 1; + } + + if (flexran_get_meas_gap_config(mod_id,i) != -1) { + ue_config[i]->meas_gap_config_pattern = flexran_get_meas_gap_config(mod_id,i); + ue_config[i]->has_meas_gap_config_pattern = 1; + } + + if (ue_config[i]->has_meas_gap_config_pattern == 1 && + ue_config[i]->meas_gap_config_pattern != PROTOCOL__FLEX_MEAS_GAP_CONFIG_PATTERN__FLMGCP_OFF) { + ue_config[i]->meas_gap_config_sf_offset = flexran_get_meas_gap_config_offset(mod_id,i); + ue_config[i]->has_meas_gap_config_sf_offset = 1; + } + //TODO: Set the SPS configuration (Optional) + //Not supported for noe, so we do not set it + + //TODO: Set the SR configuration (Optional) + //We do not set it for now + + //TODO: Set the CQI configuration (Optional) + //We do not set it for now + + if (flexran_get_ue_transmission_mode(mod_id,i) != -1) { + ue_config[i]->transmission_mode = flexran_get_ue_transmission_mode(mod_id,i); + ue_config[i]->has_transmission_mode = 1; + } + + ue_config[i]->ue_aggregated_max_bitrate_ul = flexran_get_ue_aggregated_max_bitrate_ul(mod_id,i); + ue_config[i]->has_ue_aggregated_max_bitrate_ul = 1; + + ue_config[i]->ue_aggregated_max_bitrate_dl = flexran_get_ue_aggregated_max_bitrate_dl(mod_id,i); + ue_config[i]->has_ue_aggregated_max_bitrate_dl = 1; + + Protocol__FlexUeCapabilities *capabilities; + capabilities = malloc(sizeof(Protocol__FlexUeCapabilities)); + protocol__flex_ue_capabilities__init(capabilities); + //TODO: Set half duplex (FDD operation) + capabilities->has_half_duplex = 0; + capabilities->half_duplex = 0;//flexran_get_half_duplex(i); + //TODO: Set intra-frame hopping flag + capabilities->has_intra_sf_hopping = 0; + capabilities->intra_sf_hopping = 1;//flexran_get_intra_sf_hopping(i); + //TODO: Set support for type 2 hopping with n_sb > 1 + capabilities->has_type2_sb_1 = 0; + capabilities->type2_sb_1 = 1;//flexran_get_type2_sb_1(i); + //TODO: Set ue category + capabilities->has_ue_category = 0; + capabilities->ue_category = 1;//flexran_get_ue_category(i); + //TODO: Set UE support for resource allocation type 1 + capabilities->has_res_alloc_type1 = 0; + capabilities->res_alloc_type1 = 1;//flexran_get_res_alloc_type1(i); + //Set the capabilites to the message + ue_config[i]->capabilities = capabilities; + + if (flexran_get_ue_transmission_antenna(mod_id,i) != -1) { + ue_config[i]->has_ue_transmission_antenna = 1; + ue_config[i]->ue_transmission_antenna = flexran_get_ue_transmission_antenna(mod_id,i); + } + + if (flexran_get_tti_bundling(mod_id,i) != -1) { + ue_config[i]->has_tti_bundling = 1; + ue_config[i]->tti_bundling = flexran_get_tti_bundling(mod_id,i); + } + + if (flexran_get_maxHARQ_TX(mod_id,i) != -1) { + ue_config[i]->has_max_harq_tx = 1; + ue_config[i]->max_harq_tx = flexran_get_maxHARQ_TX(mod_id,i); + } + + if (flexran_get_beta_offset_ack_index(mod_id,i) != -1) { + ue_config[i]->has_beta_offset_ack_index = 1; + ue_config[i]->beta_offset_ack_index = flexran_get_beta_offset_ack_index(mod_id,i); + } + + if (flexran_get_beta_offset_ri_index(mod_id,i) != -1) { + ue_config[i]->has_beta_offset_ri_index = 1; + ue_config[i]->beta_offset_ri_index = flexran_get_beta_offset_ri_index(mod_id,i); + } + + if (flexran_get_beta_offset_cqi_index(mod_id,i) != -1) { + ue_config[i]->has_beta_offset_cqi_index = 1; + ue_config[i]->beta_offset_cqi_index = flexran_get_beta_offset_cqi_index(mod_id,i); + } + + if (flexran_get_ack_nack_simultaneous_trans(mod_id,i) != -1) { + ue_config[i]->has_ack_nack_simultaneous_trans = 1; + ue_config[i]->ack_nack_simultaneous_trans = flexran_get_ack_nack_simultaneous_trans(mod_id,i); + } + + if (flexran_get_simultaneous_ack_nack_cqi(mod_id,i) != -1) { + ue_config[i]->has_simultaneous_ack_nack_cqi = 1; + ue_config[i]->simultaneous_ack_nack_cqi = flexran_get_simultaneous_ack_nack_cqi(mod_id,i); + } + + if (flexran_get_aperiodic_cqi_rep_mode(mod_id,i) != -1) { + ue_config[i]->has_aperiodic_cqi_rep_mode = 1; + int mode = flexran_get_aperiodic_cqi_rep_mode(mod_id,i); + if (mode > 4) { + ue_config[i]->aperiodic_cqi_rep_mode = PROTOCOL__FLEX_APERIODIC_CQI_REPORT_MODE__FLACRM_NONE; + } else { + ue_config[i]->aperiodic_cqi_rep_mode = mode; + } + } + + if (flexran_get_tdd_ack_nack_feedback(mod_id, i) != -1) { + ue_config[i]->has_tdd_ack_nack_feedback = 1; + ue_config[i]->tdd_ack_nack_feedback = flexran_get_tdd_ack_nack_feedback(mod_id,i); + } + + if(flexran_get_ack_nack_repetition_factor(mod_id, i) != -1) { + ue_config[i]->has_ack_nack_repetition_factor = 1; + ue_config[i]->ack_nack_repetition_factor = flexran_get_ack_nack_repetition_factor(mod_id,i); + } + + if (flexran_get_extended_bsr_size(mod_id, i) != -1) { + ue_config[i]->has_extended_bsr_size = 1; + ue_config[i]->extended_bsr_size = flexran_get_extended_bsr_size(mod_id,i); + } + //TODO: Set carrier aggregation support (boolean) + ue_config[i]->has_ca_support = 0; + ue_config[i]->ca_support = 0; + + ue_config[i]->has_pcell_carrier_index = 1; + ue_config[i]->pcell_carrier_index = UE_PCCID(mod_id, i); + if(ue_config[i]->has_ca_support){ + //TODO: Set cross carrier scheduling support (boolean) + ue_config[i]->has_cross_carrier_sched_support = 0; + ue_config[i]->cross_carrier_sched_support = 0; + //TODO: Set secondary cells configuration + // We do not set it for now. No carrier aggregation support + //TODO: Set deactivation timer for secondary cell + ue_config[i]->has_scell_deactivation_timer = 0; + ue_config[i]->scell_deactivation_timer = 0; + } + } + ue_config_reply_msg->ue_config = ue_config; + } + *msg = malloc(sizeof(Protocol__FlexranMessage)); + if (*msg == NULL) + goto error; + protocol__flexran_message__init(*msg); + (*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_UE_CONFIG_REPLY_MSG; + (*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__SUCCESSFUL_OUTCOME; + (*msg)->ue_config_reply_msg = ue_config_reply_msg; + return 0; + + error: + // TODO: Need to make proper error handling + if (header != NULL) + free(header); + if (ue_config_reply_msg != NULL) + free(ue_config_reply_msg); + if(*msg != NULL) + free(*msg); + //LOG_E(FLEXRAN_AGENT, "%s: an error occured\n", __FUNCTION__); + return -1; +} + + +/* + * ************************************ + * eNB Configuration Request and Reply + * ************************************ + */ + +int flexran_agent_enb_config_request(mid_t mod_id, const void* params, Protocol__FlexranMessage **msg) { + + Protocol__FlexHeader *header; + xid_t xid = 1; + if(flexran_create_header(xid,PROTOCOL__FLEX_TYPE__FLPT_GET_ENB_CONFIG_REQUEST, &header) != 0) + goto error; + + Protocol__FlexEnbConfigRequest *enb_config_request_msg; + enb_config_request_msg = malloc(sizeof(Protocol__FlexEnbConfigRequest)); + + if(enb_config_request_msg == NULL) + goto error; + + protocol__flex_enb_config_request__init(enb_config_request_msg); + enb_config_request_msg->header = header; + + *msg = malloc(sizeof(Protocol__FlexranMessage)); + if(*msg == NULL) + goto error; + + protocol__flexran_message__init(*msg); + (*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_ENB_CONFIG_REQUEST_MSG; + (*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__INITIATING_MESSAGE; + (*msg)->enb_config_request_msg = enb_config_request_msg; + return 0; + + error: + // TODO: Need to make proper error handling + if (header != NULL) + free(header); + if (enb_config_request_msg != NULL) + free(enb_config_request_msg); + if(*msg != NULL) + free(*msg); + //LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); + return -1; +} + +int flexran_agent_enb_config_reply(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) { + + xid_t xid; + Protocol__FlexranMessage *input = (Protocol__FlexranMessage *)params; + Protocol__FlexEnbConfigRequest *enb_config_req_msg = input->enb_config_request_msg; + xid = (enb_config_req_msg->header)->xid; + + int i, j, k; + int cc_id = 0; + int enb_id = mod_id; + + Protocol__FlexHeader *header; + if(flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_GET_ENB_CONFIG_REPLY, &header) != 0) + goto error; + + Protocol__FlexEnbConfigReply *enb_config_reply_msg; + enb_config_reply_msg = malloc(sizeof(Protocol__FlexEnbConfigReply)); + if(enb_config_reply_msg == NULL) + goto error; + protocol__flex_enb_config_reply__init(enb_config_reply_msg); + enb_config_reply_msg->header = header; + + enb_config_reply_msg->enb_id = mod_id; + + + enb_config_reply_msg->n_cell_config = MAX_NUM_CCs; + + Protocol__FlexCellConfig **cell_conf; + if(enb_config_reply_msg->n_cell_config > 0){ + cell_conf = malloc(sizeof(Protocol__FlexCellConfig *) * enb_config_reply_msg->n_cell_config); + if(cell_conf == NULL) + goto error; + for(i = 0; i < enb_config_reply_msg->n_cell_config; i++){ + cell_conf[i] = malloc(sizeof(Protocol__FlexCellConfig)); + protocol__flex_cell_config__init(cell_conf[i]); + + cell_conf[i]->phy_cell_id = 1; + cell_conf[i]->has_phy_cell_id = flexran_get_cell_id(enb_id,i); + + cell_conf[i]->cell_id = i; + cell_conf[i]->has_cell_id = 1; + + cell_conf[i]->pusch_hopping_offset = flexran_get_hopping_offset(enb_id,i); + cell_conf[i]->has_pusch_hopping_offset = 1; + + if (flexran_get_hopping_mode(enb_id,i) == 0) { + cell_conf[i]->hopping_mode = PROTOCOL__FLEX_HOPPING_MODE__FLHM_INTER; + } else if(flexran_get_hopping_mode(enb_id,i) == 1) { + cell_conf[i]->hopping_mode = PROTOCOL__FLEX_HOPPING_MODE__FLHM_INTERINTRA; + } + cell_conf[i]->has_hopping_mode = 1; + + cell_conf[i]->n_sb = flexran_get_n_SB(enb_id,i); + cell_conf[i]->has_n_sb = 1; + + if (flexran_get_phich_resource(enb_id,i) == 0) { + cell_conf[i]->phich_resource = PROTOCOL__FLEX_PHICH_RESOURCE__FLPR_ONE_SIXTH; //0 + } else if (flexran_get_phich_resource(enb_id,i) == 1) { + cell_conf[i]->phich_resource = PROTOCOL__FLEX_PHICH_RESOURCE__FLPR_HALF; //1 + } else if (flexran_get_phich_resource(enb_id,i) == 2) { + cell_conf[i]->phich_resource = PROTOCOL__FLEX_PHICH_RESOURCE__FLPR_ONE; // 2 + } else if (flexran_get_phich_resource(enb_id,i) == 3) { + cell_conf[i]->phich_resource = PROTOCOL__FLEX_PHICH_RESOURCE__FLPR_TWO;//3 + } + cell_conf[i]->has_phich_resource = 1; + + if (flexran_get_phich_duration(enb_id,i) == 0) { + cell_conf[i]->phich_duration = PROTOCOL__FLEX_PHICH_DURATION__FLPD_NORMAL; + } else if(flexran_get_phich_duration(enb_id,i) == 1) { + cell_conf[i]->phich_duration = PROTOCOL__FLEX_PHICH_DURATION__FLPD_EXTENDED; + } + cell_conf[i]->has_phich_duration = 1; + //TODO: Fill in with actual value, See TS 36.211, section 6.9 + cell_conf[i]->init_nr_pdcch_ofdm_sym = flexran_get_num_pdcch_symb(enb_id,i); + cell_conf[i]->has_init_nr_pdcch_ofdm_sym = 0; + //TODO: Fill in with actual value + /* Protocol__FlexSiConfig *si_config; */ + /* si_config = malloc(sizeof(Protocol__FlexSiConfig)); */ + /* if(si_config == NULL) */ + /* goto error; */ + /* protocol__flex_si_config__init(si_config); */ + /* //TODO: Fill in with actual value, Frame number to apply the SI configuration */ + /* si_config->sfn = 1; */ + /* si_config->has_sfn = 1; */ + /* //TODO: Fill in with actual value, the length of SIB1 in bytes */ + /* si_config->sib1_length = get_sib1_length(enb_id,i); */ + /* si_config->has_sib1_length = 1; */ + /* //TODO: Fill in with actual value, Scheduling window for all SIs in SF */ + /* si_config->si_window_length = (uint32_t) get_si_window_length(enb_id,i); */ + /* si_config->has_si_window_length = 1; */ + /* //TODO: Fill in with actual value, the number of SI messages */ + /* si_config->n_si_message=1; */ + /* Protocol__FlexSiMessage **si_message; */ + /* si_message = malloc(sizeof(Protocol__FlexSiMessage *) * si_config->n_si_message); */ + /* if(si_message == NULL) */ + /* goto error; */ + /* for(j = 0; j < si_config->n_si_message; j++){ */ + /* si_message[j] = malloc(sizeof(Protocol__FlexSiMessage)); */ + /* if(si_message[j] == NULL) */ + /* goto error; */ + /* protocol__flex_si_message__init(si_message[j]); */ + /* //TODO: Fill in with actual value, Periodicity of SI msg in radio frames */ + /* si_message[j]->periodicity = 1; //SIPeriod */ + /* si_message[j]->has_periodicity = 1; */ + /* //TODO: Fill in with actual value, rhe length of the SI message in bytes */ + /* si_message[j]->length = 10; */ + /* si_message[j]->has_length = 1; */ + /* } */ + /* if(si_config->n_si_message > 0){ */ + /* si_config->si_message = si_message; */ + /* } */ + /* cell_conf[i]->si_config = si_config; */ + + cell_conf[i]->dl_bandwidth = flexran_get_N_RB_DL(enb_id,i); + cell_conf[i]->has_dl_bandwidth = 1; + + cell_conf[i]->ul_bandwidth = flexran_get_N_RB_UL(enb_id,i); + cell_conf[i]->has_ul_bandwidth = 1; + + if (flexran_get_ul_cyclic_prefix_length(enb_id, i) == 0) { + cell_conf[i]->ul_cyclic_prefix_length = PROTOCOL__FLEX_UL_CYCLIC_PREFIX_LENGTH__FLUCPL_NORMAL; + } else if(flexran_get_ul_cyclic_prefix_length(enb_id, i) == 1) { + cell_conf[i]->ul_cyclic_prefix_length = PROTOCOL__FLEX_UL_CYCLIC_PREFIX_LENGTH__FLUCPL_EXTENDED; + } + cell_conf[i]->has_ul_cyclic_prefix_length = 1; + + if (flexran_get_ul_cyclic_prefix_length(enb_id,i) == 0) { + cell_conf[i]->ul_cyclic_prefix_length = PROTOCOL__FLEX_DL_CYCLIC_PREFIX_LENGTH__FLDCPL_NORMAL; + } else if (flexran_get_ul_cyclic_prefix_length(enb_id,i) == 1) { + cell_conf[i]->ul_cyclic_prefix_length = PROTOCOL__FLEX_DL_CYCLIC_PREFIX_LENGTH__FLDCPL_EXTENDED; + } + + cell_conf[i]->has_dl_cyclic_prefix_length = 1; + //TODO: Fill in with actual value, number of cell specific antenna ports. Currently single port support + cell_conf[i]->antenna_ports_count = 1; + cell_conf[i]->has_antenna_ports_count = 1; + + if (flexran_get_duplex_mode(enb_id,i) == 1) { + cell_conf[i]->duplex_mode = PROTOCOL__FLEX_DUPLEX_MODE__FLDM_FDD; + } else if(flexran_get_duplex_mode(enb_id,i) == 0) { + cell_conf[i]->duplex_mode = PROTOCOL__FLEX_DUPLEX_MODE__FLDM_TDD; + } + cell_conf[i]->has_duplex_mode = 1; + //TODO: Fill in with actual value, DL/UL subframe assignment. TDD only + cell_conf[i]->subframe_assignment = flexran_get_subframe_assignment(enb_id, i); + cell_conf[i]->has_subframe_assignment = 0; + //TODO: Fill in with actual value, TDD only. See TS 36.211, table 4.2.1 + cell_conf[i]->special_subframe_patterns = flexran_get_special_subframe_assignment(enb_id,i); + cell_conf[i]->has_special_subframe_patterns = 0; + //TODO: Fill in with actual value, The MBSFN radio frame period + cell_conf[i]->n_mbsfn_subframe_config_rfperiod = 0; + uint32_t *elem_rfperiod; + elem_rfperiod = (uint32_t *) malloc(sizeof(uint32_t) *cell_conf[i]->n_mbsfn_subframe_config_rfperiod); + if(elem_rfperiod == NULL) + goto error; + for(j = 0; j < cell_conf[i]->n_mbsfn_subframe_config_rfperiod; j++){ + elem_rfperiod[j] = 1; + } + cell_conf[i]->mbsfn_subframe_config_rfperiod = elem_rfperiod; + + //TODO: Fill in with actual value, The MBSFN radio frame offset + cell_conf[i]->n_mbsfn_subframe_config_rfoffset = 0; + uint32_t *elem_rfoffset; + elem_rfoffset = (uint32_t *) malloc(sizeof(uint32_t) *cell_conf[i]->n_mbsfn_subframe_config_rfoffset); + if(elem_rfoffset == NULL) + goto error; + for(j = 0; j < cell_conf[i]->n_mbsfn_subframe_config_rfoffset; j++){ + elem_rfoffset[j] = 1; + } + cell_conf[i]->mbsfn_subframe_config_rfoffset = elem_rfoffset; + + //TODO: Fill in with actual value, Bitmap indicating the MBSFN subframes + cell_conf[i]->n_mbsfn_subframe_config_sfalloc = 0; + uint32_t *elem_sfalloc; + elem_sfalloc = (uint32_t *) malloc(sizeof(uint32_t) *cell_conf[i]->n_mbsfn_subframe_config_sfalloc); + if(elem_sfalloc == NULL) + goto error; + for(j = 0; j < cell_conf[i]->n_mbsfn_subframe_config_sfalloc; j++){ + elem_sfalloc[j] = 1; + } + cell_conf[i]->mbsfn_subframe_config_sfalloc = elem_sfalloc; + + cell_conf[i]->prach_config_index = flexran_get_prach_ConfigIndex(enb_id,i); + cell_conf[i]->has_prach_config_index = 1; + + cell_conf[i]->prach_freq_offset = flexran_get_prach_FreqOffset(enb_id,i); + cell_conf[i]->has_prach_freq_offset = 1; + + cell_conf[i]->ra_response_window_size = flexran_get_ra_ResponseWindowSize(enb_id,i); + cell_conf[i]->has_ra_response_window_size = 1; + + cell_conf[i]->mac_contention_resolution_timer = flexran_get_mac_ContentionResolutionTimer(enb_id,i); + cell_conf[i]->has_mac_contention_resolution_timer = 1; + + cell_conf[i]->max_harq_msg3tx = flexran_get_maxHARQ_Msg3Tx(enb_id,i); + cell_conf[i]->has_max_harq_msg3tx = 1; + + cell_conf[i]->n1pucch_an = flexran_get_n1pucch_an(enb_id,i); + cell_conf[i]->has_n1pucch_an = 1; + + cell_conf[i]->deltapucch_shift = flexran_get_deltaPUCCH_Shift(enb_id,i); + cell_conf[i]->has_deltapucch_shift = 1; + + cell_conf[i]->nrb_cqi = flexran_get_nRB_CQI(enb_id,i); + cell_conf[i]->has_nrb_cqi = 1; + + cell_conf[i]->srs_subframe_config = flexran_get_srs_SubframeConfig(enb_id,i); + cell_conf[i]->has_srs_subframe_config = 1; + + cell_conf[i]->srs_bw_config = flexran_get_srs_BandwidthConfig(enb_id,i); + cell_conf[i]->has_srs_bw_config = 1; + + cell_conf[i]->srs_mac_up_pts = flexran_get_srs_MaxUpPts(enb_id,i); + cell_conf[i]->has_srs_mac_up_pts = 1; + + if (flexran_get_enable64QAM(enb_id,i) == 0) { + cell_conf[i]->enable_64qam = PROTOCOL__FLEX_QAM__FLEQ_MOD_16QAM; + } else if(flexran_get_enable64QAM(enb_id,i) == 1) { + cell_conf[i]->enable_64qam = PROTOCOL__FLEX_QAM__FLEQ_MOD_64QAM; + } + cell_conf[i]->has_enable_64qam = 1; + + cell_conf[i]->carrier_index = i; + cell_conf[i]->has_carrier_index = 1; + } + enb_config_reply_msg->cell_config=cell_conf; + } + *msg = malloc(sizeof(Protocol__FlexranMessage)); + if(*msg == NULL) + goto error; + protocol__flexran_message__init(*msg); + (*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_ENB_CONFIG_REPLY_MSG; + (*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__SUCCESSFUL_OUTCOME; + (*msg)->enb_config_reply_msg = enb_config_reply_msg; + + return 0; + + error: + // TODO: Need to make proper error handling + if (header != NULL) + free(header); + if (enb_config_reply_msg != NULL) + free(enb_config_reply_msg); + if(*msg != NULL) + free(*msg); + //LOG_E(FLEXRAN_AGENT, "%s: an error occured\n", __FUNCTION__); + return -1; +} + + + +/* + * timer primitives + */ + +//struct flexran_agent_map agent_map; +flexran_agent_timer_instance_t timer_instance; +int agent_timer_init = 0; +err_code_t flexran_agent_init_timer(void){ + + LOG_I(FLEXRAN_AGENT, "init RB tree\n"); + if (!agent_timer_init) { + RB_INIT(&timer_instance.flexran_agent_head); + agent_timer_init = 1; + } + + return PROTOCOL__FLEXRAN_ERR__NO_ERR; +} + +RB_GENERATE(flexran_agent_map, flexran_agent_timer_element_s, entry, flexran_agent_compare_timer); + +/* The timer_id might not be the best choice for the comparison */ +int flexran_agent_compare_timer(struct flexran_agent_timer_element_s *a, struct flexran_agent_timer_element_s *b){ + + if (a->timer_id < b->timer_id) return -1; + if (a->timer_id > b->timer_id) return 1; + + // equal timers + return 0; +} + +err_code_t flexran_agent_create_timer(uint32_t interval_sec, + uint32_t interval_usec, + agent_id_t agent_id, + instance_t instance, + uint32_t timer_type, + xid_t xid, + flexran_agent_timer_callback_t cb, + void* timer_args, + long *timer_id){ + + struct flexran_agent_timer_element_s *e = calloc(1, sizeof(*e)); + DevAssert(e != NULL); + +//uint32_t timer_id; + int ret=-1; + + if ((interval_sec == 0) && (interval_usec == 0 )) + return TIMER_NULL; + + if (timer_type >= FLEXRAN_AGENT_TIMER_TYPE_MAX) + return TIMER_TYPE_INVALIDE; + + if (timer_type == FLEXRAN_AGENT_TIMER_TYPE_ONESHOT){ + ret = timer_setup(interval_sec, + interval_usec, + TASK_FLEXRAN_AGENT, + instance, + TIMER_ONE_SHOT, + timer_args, + timer_id); + + e->type = TIMER_ONE_SHOT; + } + else if (timer_type == FLEXRAN_AGENT_TIMER_TYPE_PERIODIC ){ + ret = timer_setup(interval_sec, + interval_usec, + TASK_FLEXRAN_AGENT, + instance, + TIMER_PERIODIC, + timer_args, + timer_id); + + e->type = TIMER_PERIODIC; + } + + if (ret < 0 ) { + return TIMER_SETUP_FAILED; + } + + e->agent_id = agent_id; + e->instance = instance; + e->state = FLEXRAN_AGENT_TIMER_STATE_ACTIVE; + e->timer_id = *timer_id; + e->xid = xid; + e->timer_args = timer_args; + e->cb = cb; + /*element should be a real pointer*/ + RB_INSERT(flexran_agent_map, &timer_instance.flexran_agent_head, e); + + LOG_I(FLEXRAN_AGENT,"Created a new timer with id 0x%lx for agent %d, instance %d \n", + e->timer_id, e->agent_id, e->instance); + + return 0; +} + +err_code_t flexran_agent_destroy_timer(long timer_id){ + + struct flexran_agent_timer_element_s *e = get_timer_entry(timer_id); + + if (e != NULL ) { + RB_REMOVE(flexran_agent_map, &timer_instance.flexran_agent_head, e); + flexran_agent_destroy_flexran_message(e->timer_args->msg); + free(e); + } + + if (timer_remove(timer_id) < 0 ) + goto error; + + return 0; + + error: + LOG_E(FLEXRAN_AGENT, "timer can't be removed\n"); + return TIMER_REMOVED_FAILED ; +} + +err_code_t flexran_agent_destroy_timer_by_task_id(xid_t xid) { + struct flexran_agent_timer_element_s *e = NULL; + long timer_id; + RB_FOREACH(e, flexran_agent_map, &timer_instance.flexran_agent_head) { + if (e->xid == xid) { + timer_id = e->timer_id; + RB_REMOVE(flexran_agent_map, &timer_instance.flexran_agent_head, e); + flexran_agent_destroy_flexran_message(e->timer_args->msg); + free(e); + if (timer_remove(timer_id) < 0 ) { + goto error; + } + } + } + return 0; + + error: + LOG_E(FLEXRAN_AGENT, "timer can't be removed\n"); + return TIMER_REMOVED_FAILED ; +} + +err_code_t flexran_agent_destroy_timers(void){ + + struct flexran_agent_timer_element_s *e = NULL; + + RB_FOREACH(e, flexran_agent_map, &timer_instance.flexran_agent_head) { + RB_REMOVE(flexran_agent_map, &timer_instance.flexran_agent_head, e); + timer_remove(e->timer_id); + flexran_agent_destroy_flexran_message(e->timer_args->msg); + free(e); + } + + return 0; + +} + +void flexran_agent_sleep_until(struct timespec *ts, int delay) { + ts->tv_nsec += delay; + if(ts->tv_nsec >= 1000*1000*1000){ + ts->tv_nsec -= 1000*1000*1000; + ts->tv_sec++; + } + clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, ts, NULL); +} + + +err_code_t flexran_agent_stop_timer(long timer_id){ + + struct flexran_agent_timer_element_s *e=NULL; + struct flexran_agent_timer_element_s search; + memset(&search, 0, sizeof(struct flexran_agent_timer_element_s)); + search.timer_id = timer_id; + + e = RB_FIND(flexran_agent_map, &timer_instance.flexran_agent_head, &search); + + if (e != NULL ) { + e->state = FLEXRAN_AGENT_TIMER_STATE_STOPPED; + } + + timer_remove(timer_id); + + return 0; +} + +struct flexran_agent_timer_element_s * get_timer_entry(long timer_id) { + + struct flexran_agent_timer_element_s search; + memset(&search, 0, sizeof(struct flexran_agent_timer_element_s)); + search.timer_id = timer_id; + + return RB_FIND(flexran_agent_map, &timer_instance.flexran_agent_head, &search); +} diff --git a/openair2/ENB_APP/flexran_agent_common.h b/openair2/ENB_APP/flexran_agent_common.h new file mode 100644 index 0000000000000000000000000000000000000000..56a52cd0b674480425fbace461cd23a838780615 --- /dev/null +++ b/openair2/ENB_APP/flexran_agent_common.h @@ -0,0 +1,496 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file flexran_agent_common.h + * \brief common message primitves and utilities + * \author Xenofon Foukas, Mohamed Kassem and Navid Nikaein + * \date 2016 + * \version 0.1 + */ + + + +#ifndef FLEXRAN_AGENT_COMMON_H_ +#define FLEXRAN_AGENT_COMMON_H_ + +#include <time.h> + +#include "header.pb-c.h" +#include "flexran.pb-c.h" +#include "stats_messages.pb-c.h" +#include "stats_common.pb-c.h" + +#include "flexran_agent_defs.h" +#include "enb_config.h" + +#include "LAYER2/MAC/extern.h" +#include "LAYER2/RLC/rlc.h" + +# include "tree.h" +# include "intertask_interface.h" +# include "timer.h" + +#define FLEXRAN_VERSION 0 + +typedef int (*flexran_agent_message_decoded_callback)( + mid_t mod_id, + const void *params, + Protocol__FlexranMessage **msg +); + +typedef int (*flexran_agent_message_destruction_callback)( + Protocol__FlexranMessage *msg +); + +/********************************** + * FlexRAN protocol messages helper + * functions and generic handlers + **********************************/ + +/* Helper functions for message (de)serialization */ +int flexran_agent_serialize_message(Protocol__FlexranMessage *msg, void **buf, int *size); +int flexran_agent_deserialize_message(void *data, int size, Protocol__FlexranMessage **msg); + +/* Serialize message and then destroy the input flexran msg. Should be called when protocol + message is created dynamically */ +void * flexran_agent_pack_message(Protocol__FlexranMessage *msg, + uint32_t * size); + +/* Calls destructor of the given message */ +err_code_t flexran_agent_destroy_flexran_message(Protocol__FlexranMessage *msg); + +/* Function to create the header for any FlexRAN protocol message */ +int flexran_create_header(xid_t xid, Protocol__FlexType type, Protocol__FlexHeader **header); + +/* Hello protocol message constructor and destructor */ +int flexran_agent_hello(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg); +int flexran_agent_destroy_hello(Protocol__FlexranMessage *msg); + +/* Echo request protocol message constructor and destructor */ +int flexran_agent_echo_request(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg); +int flexran_agent_destroy_echo_request(Protocol__FlexranMessage *msg); + +/* Echo reply protocol message constructor and destructor */ +int flexran_agent_echo_reply(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg); +int flexran_agent_destroy_echo_reply(Protocol__FlexranMessage *msg); + +/* eNodeB configuration reply message constructor and destructor */ +int flexran_agent_enb_config_reply(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg); +int flexran_agent_destroy_enb_config_reply(Protocol__FlexranMessage *msg); + +/* UE configuration reply message constructor and destructor */ +int flexran_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg); +int flexran_agent_destroy_ue_config_reply(Protocol__FlexranMessage *msg); + +/* Logical channel reply configuration message constructor and destructor */ +int flexran_agent_lc_config_reply(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg); +int flexran_agent_destroy_lc_config_reply(Protocol__FlexranMessage *msg); + +/* eNodeB configuration request message constructor and destructor */ +int flexran_agent_enb_config_request(mid_t mod_id, const void* params, Protocol__FlexranMessage **msg); +int flexran_agent_destroy_enb_config_request(Protocol__FlexranMessage *msg); + +/* UE configuration request message constructor */ +/* TODO: Need to define and implement destructor */ +int flexran_agent_destroy_ue_config_request(Protocol__FlexranMessage *msg); + +/* Logical channel configuration request message constructor */ +/* TODO: Need to define and implement destructor */ +int flexran_agent_destroy_lc_config_request(Protocol__FlexranMessage *msg); + +/* UE state change message constructor and destructor */ +int flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_change); +int flexran_agent_destroy_ue_state_change(Protocol__FlexranMessage *msg); + +/* Control delegation message constructor and destructor */ +int flexran_agent_control_delegation(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg); +int flexran_agent_destroy_control_delegation(Protocol__FlexranMessage *msg); + +/* Policy reconfiguration message constructor and destructor */ +int flexran_agent_reconfiguration(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg); +int flexran_agent_destroy_agent_reconfiguration(Protocol__FlexranMessage *msg); + +/* FlexRAN protocol message dispatcher function */ +Protocol__FlexranMessage* flexran_agent_handle_message (mid_t mod_id, + uint8_t *data, + uint32_t size); + +/* Function to be used to send a message to a dispatcher once the appropriate event is triggered. */ +Protocol__FlexranMessage *flexran_agent_handle_timed_task(void *args); + + + + +/**************************** + * get generic info from RAN + ****************************/ + +void flexran_set_enb_vars(mid_t mod_id, ran_name_t ran); + +int flexran_get_current_time_ms (mid_t mod_id, int subframe_flag); + +/*Return the current frame number + *Could be using implementation specific numbering of frames + */ +unsigned int flexran_get_current_frame(mid_t mod_id); + +/*Return the current SFN (0-1023)*/ +unsigned int flexran_get_current_system_frame_num(mid_t mod_id); + +unsigned int flexran_get_current_subframe(mid_t mod_id); + +/*Return the frame and subframe number in compact 16-bit format. + Bits 0-3 subframe, rest for frame. Required by FlexRAN protocol*/ +uint16_t flexran_get_sfn_sf (mid_t mod_id); + +/* Return a future frame and subframe number that is ahead_of_time + subframes later in compact 16-bit format. Bits 0-3 subframe, + rest for frame */ +uint16_t flexran_get_future_sfn_sf(mid_t mod_id, int ahead_of_time); + +/* Return the number of attached UEs */ +int flexran_get_num_ues(mid_t mod_id); + +/* Get the rnti of a UE with id ue_id */ +int flexran_get_ue_crnti (mid_t mod_id, mid_t ue_id); + +/* Get the RLC buffer status report of a ue for a designated + logical channel id */ +int flexran_get_ue_bsr (mid_t mod_id, mid_t ue_id, lcid_t lcid); + +/* Get power headroom of UE with id ue_id */ +int flexran_get_ue_phr (mid_t mod_id, mid_t ue_id); + +/* Get the UE wideband CQI */ +int flexran_get_ue_wcqi (mid_t mod_id, mid_t ue_id); + +/* Get the transmission queue size for a UE with a channel_id logical channel id */ +int flexran_get_tx_queue_size(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id); + +/* Update the timing advance status (find out whether a timing advance command is required) */ +int flexran_update_TA(mid_t mod_id, mid_t ue_id, int CC_id); + +/* Return timing advance MAC control element for a designated cell and UE */ +int flexran_get_MAC_CE_bitmap_TA(mid_t mod_id, mid_t ue_id, int CC_id); + +/* Get the number of active component carriers for a specific UE */ +int flexran_get_active_CC(mid_t mod_id, mid_t ue_id); + +/* Get the rank indicator for a designated cell and UE */ +int flexran_get_current_RI(mid_t mod_id, mid_t ue_id, int CC_id); + +/* See TS 36.213, section 10.1 */ +int flexran_get_n1pucch_an(mid_t mod_id, int CC_id); + +/* See TS 36.211, section 5.4 */ +int flexran_get_nRB_CQI(mid_t mod_id, int CC_id); + +/* See TS 36.211, section 5.4 */ +int flexran_get_deltaPUCCH_Shift(mid_t mod_id, int CC_id); + +/* See TS 36.211, section 5.7.1 */ +int flexran_get_prach_ConfigIndex(mid_t mod_id, int CC_id); + +/* See TS 36.211, section 5.7.1 */ +int flexran_get_prach_FreqOffset(mid_t mod_id, int CC_id); + +/* See TS 36.321 */ +int flexran_get_maxHARQ_Msg3Tx(mid_t mod_id, int CC_id); + +/* Get the length of the UL cyclic prefix */ +int flexran_get_ul_cyclic_prefix_length(mid_t mod_id, int CC_id); + +/* Get the length of the DL cyclic prefix */ +int flexran_get_dl_cyclic_prefix_length(mid_t mod_id, int CC_id); + +/* Get the physical cell id of a cell */ +int flexran_get_cell_id(mid_t mod_id, int CC_id); + +/* See TS 36.211, section 5.5.3.2 */ +int flexran_get_srs_BandwidthConfig(mid_t mod_id, int CC_id); + +/* See TS 36.211, table 5.5.3.3-1 and 2 */ +int flexran_get_srs_SubframeConfig(mid_t mod_id, int CC_id); + +/* Boolean value. See TS 36.211, + section 5.5.3.2. TDD only */ +int flexran_get_srs_MaxUpPts(mid_t mod_id, int CC_id); + +/* Get number of DL resource blocks */ +int flexran_get_N_RB_DL(mid_t mod_id, int CC_id); + +/* Get number of UL resource blocks */ +int flexran_get_N_RB_UL(mid_t mod_id, int CC_id); + +/* Get number of resource block groups */ +int flexran_get_N_RBG(mid_t mod_id, int CC_id); + +/* Get DL/UL subframe assignment. TDD only */ +int flexran_get_subframe_assignment(mid_t mod_id, int CC_id); + +/* TDD only. See TS 36.211, table 4.2.1 */ +int flexran_get_special_subframe_assignment(mid_t mod_id, int CC_id); + +/* Get the duration of the random access response window in subframes */ +int flexran_get_ra_ResponseWindowSize(mid_t mod_id, int CC_id); + +/* Get timer used for random access */ +int flexran_get_mac_ContentionResolutionTimer(mid_t mod_id, int CC_id); + +/* Get type of duplex mode (FDD/TDD) */ +int flexran_get_duplex_mode(mid_t mod_id, int CC_id); + +/* Get the SI window length */ +long flexran_get_si_window_length(mid_t mod_id, int CC_id); + +/* Get the number of PDCCH symbols configured for the cell */ +int flexran_get_num_pdcch_symb(mid_t mod_id, int CC_id); + +/* See TS 36.213, sec 5.1.1.1 */ +int flexran_get_tpc(mid_t mod_id, mid_t ue_id); + +/* Get the first available HARQ process for a specific cell and UE during + a designated frame and subframe. Returns 0 for success. The id and the + status of the HARQ process are stored in id and status respectively */ +int flexran_get_harq(const mid_t mod_id, const uint8_t CC_id, const mid_t ue_id, + const int frame, const uint8_t subframe, int *id, int *round); + +/* Uplink power control management*/ +int flexran_get_p0_pucch_dbm(mid_t mod_id, mid_t ue_id, int CC_id); + +int flexran_get_p0_nominal_pucch(mid_t mod_id, int CC_id); + +int flexran_get_p0_pucch_status(mid_t mod_id, mid_t ue_id, int CC_id); + +int flexran_update_p0_pucch(mid_t mod_id, mid_t ue_id, int CC_id); + + +/* + * ************************************ + * Get Messages for UE Configuration Reply + * ************************************ + */ + +/* Get timer in subframes. Controls the synchronization + status of the UE, not the actual timing + advance procedure. See TS 36.321 */ +int flexran_get_time_alignment_timer(mid_t mod_id, mid_t ue_id); + +/* Get measurement gap configuration. See TS 36.133 */ +int flexran_get_meas_gap_config(mid_t mod_id, mid_t ue_id); + +/* Get measurement gap configuration offset if applicable */ +int flexran_get_meas_gap_config_offset(mid_t mod_id, mid_t ue_id); + +/* DL aggregated bit-rate of non-gbr bearer + per UE. See TS 36.413 */ +int flexran_get_ue_aggregated_max_bitrate_dl (mid_t mod_id, mid_t ue_id); + +/* UL aggregated bit-rate of non-gbr bearer + per UE. See TS 36.413 */ +int flexran_get_ue_aggregated_max_bitrate_ul (mid_t mod_id, mid_t ue_id); + +/* Only half-duplex support. FDD + operation. Boolean value */ +int flexran_get_half_duplex(mid_t ue_id); + +/* Support of intra-subframe hopping. + Boolean value */ +int flexran_get_intra_sf_hopping(mid_t ue_id); + +/* UE support for type 2 hopping with + n_sb>1 */ +int flexran_get_type2_sb_1(mid_t ue_id); + +/* Get the UE category */ +int flexran_get_ue_category(mid_t ue_id); + +/* UE support for resource allocation + type 1 */ +int flexran_get_res_alloc_type1(mid_t ue_id); + +/* Get UE transmission mode */ +int flexran_get_ue_transmission_mode(mid_t mod_id, mid_t ue_id); + +/* Boolean value. See TS 36.321 */ +int flexran_get_tti_bundling(mid_t mod_id, mid_t ue_id); + +/* The max HARQ retransmission for UL. + See TS 36.321 */ +int flexran_get_maxHARQ_TX(mid_t mod_id, mid_t ue_id); + +/* See TS 36.213 */ +int flexran_get_beta_offset_ack_index(mid_t mod_id, mid_t ue_id); + +/* See TS 36.213 */ +int flexran_get_beta_offset_ri_index(mid_t mod_id, mid_t ue_id); + +/* See TS 36.213 */ +int flexran_get_beta_offset_cqi_index(mid_t mod_id, mid_t ue_id); + +/* Boolean. See TS36.213, Section 10.1 */ +int flexran_get_simultaneous_ack_nack_cqi(mid_t mod_id, mid_t ue_id); + +/* Boolean. See TS 36.213, Section 8.2 */ +int flexran_get_ack_nack_simultaneous_trans(mid_t mod_id,mid_t ue_id); + +/* Get aperiodic CQI report mode */ +int flexran_get_aperiodic_cqi_rep_mode(mid_t mod_id,mid_t ue_id); + +/* Get ACK/NACK feedback mode. TDD only */ +int flexran_get_tdd_ack_nack_feedback(mid_t mod_id, mid_t ue_id); + +/* See TS36.213, section 10.1 */ +int flexran_get_ack_nack_repetition_factor(mid_t mod_id, mid_t ue_id); + +/* Boolean. Extended buffer status report size */ +int flexran_get_extended_bsr_size(mid_t mod_id, mid_t ue_id); + +/* Get number of UE transmission antennas */ +int flexran_get_ue_transmission_antenna(mid_t mod_id, mid_t ue_id); + +/* Get logical channel group of a channel with id lc_id */ +int flexran_get_lcg(mid_t ue_id, mid_t lc_id); + +/* Get direction of logical channel with id lc_id */ +int flexran_get_direction(mid_t ue_id, mid_t lc_id); + +/******************* + * timer primitves + *******************/ + +#define TIMER_NULL -1 +#define TIMER_TYPE_INVALIDE -2 +#define TIMER_SETUP_FAILED -3 +#define TIMER_REMOVED_FAILED -4 +#define TIMER_ELEMENT_NOT_FOUND -5 + + +/* Type of the callback executed when the timer expired */ +typedef Protocol__FlexranMessage *(*flexran_agent_timer_callback_t)(void*); + +typedef enum { + /* oneshot timer: */ + FLEXRAN_AGENT_TIMER_TYPE_ONESHOT = 0x0, + + /* periodic timer */ + FLEXRAN_AGENT_TIMER_TYPE_PERIODIC = 0x1, + + /* Inactive state: initial state for any timer. */ + FLEXRAN_AGENT_TIMER_TYPE_EVENT_DRIVEN = 0x2, + + /* Max number of states available */ + FLEXRAN_AGENT_TIMER_TYPE_MAX, +} flexran_agent_timer_type_t; + +typedef enum { + /* Inactive state: initial state for any timer. */ + FLEXRAN_AGENT_TIMER_STATE_INACTIVE = 0x0, + + /* Inactive state: initial state for any timer. */ + FLEXRAN_AGENT_TIMER_STATE_ACTIVE = 0x1, + + /* Inactive state: initial state for any timer. */ + FLEXRAN_AGENT_TIMER_STATE_STOPPED = 0x2, + + /* Max number of states available */ + FLEXRAN_AGENT_TIMER_STATE_MAX, +} flexran_agent_timer_state_t; + +typedef struct flexran_agent_timer_args_s{ + mid_t mod_id; + Protocol__FlexranMessage *msg; +} flexran_agent_timer_args_t; + + + +typedef struct flexran_agent_timer_element_s{ + RB_ENTRY(flexran_agent_timer_element_s) entry; + + agent_id_t agent_id; + instance_t instance; + + flexran_agent_timer_type_t type; + flexran_agent_timer_state_t state; + + uint32_t interval_sec; + uint32_t interval_usec; + + long timer_id; /* Timer id returned by the timer API*/ + xid_t xid; /*The id of the task as received by the controller + message*/ + + flexran_agent_timer_callback_t cb; + flexran_agent_timer_args_t *timer_args; + +} flexran_agent_timer_element_t; + +typedef struct flexran_agent_timer_instance_s{ + RB_HEAD(flexran_agent_map, flexran_agent_timer_element_s) flexran_agent_head; +}flexran_agent_timer_instance_t; + + +err_code_t flexran_agent_init_timer(void); + +/* Create a timer for some agent related event with id xid. Will store the id + of the generated timer in timer_id */ +err_code_t flexran_agent_create_timer(uint32_t interval_sec, + uint32_t interval_usec, + agent_id_t agent_id, + instance_t instance, + uint32_t timer_type, + xid_t xid, + flexran_agent_timer_callback_t cb, + void* timer_args, + long *timer_id); + +/* Destroy all existing timers */ +err_code_t flexran_agent_destroy_timers(void); + +/* Destroy the timer with the given timer_id */ +err_code_t flexran_agent_destroy_timer(long timer_id); + +/* Destroy the timer for task with id xid */ +err_code_t flexran_agent_destroy_timer_by_task_id(xid_t xid); + +/* Stop a timer */ +err_code_t flexran_agent_stop_timer(long timer_id); + +/* Restart the given timer */ +err_code_t flexran_agent_restart_timer(long *timer_id); + +/* Find the timer with the given timer_id */ +struct flexran_agent_timer_element_s * get_timer_entry(long timer_id); + +/* Obtain the protocol message stored in the given expired timer */ +Protocol__FlexranMessage * flexran_agent_process_timeout(long timer_id, void* timer_args); + +/* Comparator function comparing two timers. Decides the ordering of the timers */ +int flexran_agent_compare_timer(struct flexran_agent_timer_element_s *a, struct flexran_agent_timer_element_s *b); + +/*Specify a delay in nanoseconds to timespec and sleep until then*/ +void flexran_agent_sleep_until(struct timespec *ts, int delay); + +/* RB_PROTOTYPE is for .h files */ +RB_PROTOTYPE(flexran_agent_map, flexran_agent_timer_element_s, entry, flexran_agent_compare_timer); + + +#endif diff --git a/openair2/ENB_APP/flexran_agent_common_internal.c b/openair2/ENB_APP/flexran_agent_common_internal.c new file mode 100644 index 0000000000000000000000000000000000000000..3026190863e4cd32469b84d03f8c3874b52d2b6a --- /dev/null +++ b/openair2/ENB_APP/flexran_agent_common_internal.c @@ -0,0 +1,392 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file flexran_agent_common_internal.c + * \brief internal functions for common message primitves and utilities + * \author Xenofon Foukas + * \date 2016 + * \version 0.1 + */ + +#include <stdlib.h> +#include <string.h> + +#include "flexran_agent_common_internal.h" +#include "flexran_agent_mac_internal.h" + +int apply_reconfiguration_policy(mid_t mod_id, const char *policy, size_t policy_length) { + + yaml_parser_t parser; + yaml_event_t event; + + int done = 0; + int mapping_started = 0; + + LOG_I(ENB_APP, "Time to apply a new policy \n"); + + yaml_parser_initialize(&parser); + + yaml_parser_set_input_string(&parser, policy, strlen(policy)); + + while (!done) { + if (!yaml_parser_parse(&parser, &event)) + goto error; + + switch (event.type) { + case YAML_STREAM_START_EVENT: + case YAML_STREAM_END_EVENT: + case YAML_DOCUMENT_START_EVENT: + case YAML_DOCUMENT_END_EVENT: + break; + case YAML_MAPPING_START_EVENT: + mapping_started = 1; + break; + case YAML_MAPPING_END_EVENT: + mapping_started = 0; + break; + case YAML_SCALAR_EVENT: + // Check the system name and call the proper handler + if (strcmp(event.data.scalar.value, "mac") == 0) { + LOG_D(ENB_APP, "This is intended for the mac system\n"); + // Call the mac handler + if (parse_mac_config(mod_id, &parser) == -1) { + goto error; + } + } else if (strcmp(event.data.scalar.value, "rlc") == 0) { + // Call the RLC handler + LOG_D(ENB_APP, "This is intended for the rlc system\n"); + // TODO : Just skip it for now + if (skip_system_section(&parser) == -1) { + goto error; + } + } else if (strcmp(event.data.scalar.value, "pdcp") == 0) { + // Call the PDCP handler + LOG_D(ENB_APP, "This is intended for the pdcp system\n"); + // TODO : Just skip it for now + if (skip_system_section(&parser) == -1) { + goto error; + } + } else if (strcmp(event.data.scalar.value, "rrc") == 0) { + // Call the RRC handler + LOG_D(ENB_APP, "This is intended for the rrc system\n"); + // TODO : Just skip it for now + if (skip_system_section(&parser) == -1) { + goto error; + } + } else { + goto error; + } + break; + default: + // We are not expecting to find any other type of event at this level + // of the hierarchy + yaml_event_delete(&event); + goto error; + } + + done = (event.type == YAML_STREAM_END_EVENT); + + yaml_event_delete(&event); + } + + return 0; + + error: + yaml_parser_delete(&parser); + return -1; + +} + +int skip_system_section(yaml_parser_t *parser) { + yaml_event_t event; + + int done = 0; + + int sequence_started = 0; + int mapping_started = 0; + + while (!done) { + if (!yaml_parser_parse(parser, &event)) + goto error; + + switch (event.type) { + + case YAML_SEQUENCE_START_EVENT: + LOG_D(ENB_APP, "A sequence just started as expected\n"); + sequence_started = 1; + break; + case YAML_SEQUENCE_END_EVENT: + LOG_D(ENB_APP, "A sequence ended\n"); + sequence_started = 0; + break; + case YAML_MAPPING_START_EVENT: + if (!sequence_started) { + goto error; + } + LOG_D(ENB_APP, "A mapping started\n"); + mapping_started = 1; + break; + case YAML_MAPPING_END_EVENT: + if (!mapping_started) { + goto error; + } + LOG_D(ENB_APP, "A mapping ended\n"); + mapping_started = 0; + break; + case YAML_SCALAR_EVENT: + if (!mapping_started) { + goto error; + } + // Entered a subsystem section. Let's skip it + if (skip_subsystem_section(parser) == -1) { + goto error; + } + } + + done = (event.type == YAML_SEQUENCE_END_EVENT); + + yaml_event_delete(&event); + + } + + return 0; + + error: + yaml_event_delete(&event); + return -1; +} + +int skip_subsystem_section(yaml_parser_t *parser) { + + yaml_event_t event; + + int done = 0; + int mapping_started = 0; + + while (!done) { + if (!yaml_parser_parse(parser, &event)) + goto error; + + switch (event.type) { + case YAML_MAPPING_START_EVENT: + LOG_D(ENB_APP, "The mapping of the subsystem started\n"); + mapping_started = 1; + break; + case YAML_MAPPING_END_EVENT: + LOG_D(ENB_APP, "The mapping of the subsystem ended\n"); + mapping_started = 0; + break; + case YAML_SCALAR_EVENT: + if (!mapping_started) { + goto error; + } + // Check what key needs to be set + if (strcmp(event.data.scalar.value, "behavior") == 0) { + LOG_D(ENB_APP, "Skipping the behavior attribute\n"); + yaml_event_delete(&event); + if (!yaml_parser_parse(parser, &event)) { + goto error; + } + if (event.type == YAML_SCALAR_EVENT) { + break; + } else { + goto error; + } + } else if (strcmp(event.data.scalar.value, "parameters") == 0) { + LOG_D(ENB_APP, "Skipping the parameters for this subsystem\n"); + if (skip_subsystem_parameters_config(parser) == -1) { + goto error; + } + } + break; + default: + goto error; + } + + done = (event.type == YAML_MAPPING_END_EVENT); + yaml_event_delete(&event); + } + + return 0; + + error: + yaml_event_delete(&event); + return -1; +} + +int skip_subsystem_parameters_config(yaml_parser_t *parser) { + yaml_event_t event; + + void *param; + + int done = 0; + int mapping_started = 0; + + while (!done) { + + if (!yaml_parser_parse(parser, &event)) + goto error; + + switch (event.type) { + // We are expecting a mapping of parameters + case YAML_MAPPING_START_EVENT: + LOG_D(ENB_APP, "The mapping of the parameters started\n"); + mapping_started = 1; + break; + case YAML_MAPPING_END_EVENT: + LOG_D(ENB_APP, "The mapping of the parameters ended\n"); + mapping_started = 0; + break; + case YAML_SCALAR_EVENT: + if (!mapping_started) { + goto error; + } + // Check what key needs to be set + LOG_D(ENB_APP, "Skipping parameter %s\n", event.data.scalar.value); + if (skip_parameter_modification(parser) == -1 ) { + goto error; + } + break; + default: + goto error; + } + + done = (event.type == YAML_MAPPING_END_EVENT); + yaml_event_delete(&event); + } + + return 0; + + error: + yaml_event_delete(&event); + return -1; +} + + +int skip_parameter_modification(yaml_parser_t *parser) { + yaml_event_t event; + + int done = 0; + int is_array = 0; + int i = 0; + + while (!done) { + if (!yaml_parser_parse(parser, &event)) { + goto error; + } + + // Expecting either a scalar or a sequence + switch (event.type) { + case YAML_SEQUENCE_START_EVENT: + is_array = 1; + break; + case YAML_SCALAR_EVENT: + if ((strcmp(event.data.scalar.tag, YAML_INT_TAG) == 0) || + (strcmp(event.data.scalar.tag, YAML_FLOAT_TAG) == 0) || + (strcmp(event.data.scalar.tag, YAML_STR_TAG) == 0) || + (strcmp(event.data.scalar.tag, YAML_BOOL_TAG) == 0)) { + // Do nothing + } else { + // No other type is supported at the moment, so it should be considered an error + // if we reach here + goto error; + } + if (is_array) { + i++; + } else { + done = 1; + } + break; + case YAML_SEQUENCE_END_EVENT: + done = 1; + break; + default: + goto error; + } + yaml_event_delete(&event); + } + + return 0; + + error: + yaml_event_delete(&event); + return -1; +} + +int apply_parameter_modification(void *parameter, yaml_parser_t *parser) { + yaml_event_t event; + + int done = 0; + int is_array = 0; + int i = 0; + + char *endptr; + + while (!done) { + if (!yaml_parser_parse(parser, &event)) { + goto error; + } + + // Expecting either a scalar or a sequence + switch (event.type) { + case YAML_SEQUENCE_START_EVENT: + is_array = 1; + break; + case YAML_SCALAR_EVENT: + if (strcmp(event.data.scalar.tag, YAML_INT_TAG) == 0) { + ((int *) parameter)[i] = strtol(event.data.scalar.value, &endptr, 10); + } else if (strcmp(event.data.scalar.tag, YAML_FLOAT_TAG) == 0) { + ((float *) parameter)[i] = strtof(event.data.scalar.value, &endptr); + } else if (strcmp(event.data.scalar.tag, YAML_STR_TAG) == 0) { + strncpy(&((char *) parameter)[i], event.data.scalar.value, event.data.scalar.length); + } else if (strcmp(event.data.scalar.tag, YAML_BOOL_TAG) == 0) { + if (strcmp(event.data.scalar.value, "true") == 0) { + ((int *) parameter)[i] = 1; + } else { + ((int *) parameter)[i] = 0; + } + } else { + // No other type is supported at the moment, so it should be considered an error + // if we reach here + goto error; + } + if (is_array) { + i++; + } else { + done = 1; + } + break; + case YAML_SEQUENCE_END_EVENT: + done = 1; + break; + default: + goto error; + } + yaml_event_delete(&event); + } + + return 0; + + error: + yaml_event_delete(&event); + return -1; + +} diff --git a/openair2/ENB_APP/flexran_agent_common_internal.h b/openair2/ENB_APP/flexran_agent_common_internal.h new file mode 100644 index 0000000000000000000000000000000000000000..c8f78aafe90a251c37911b398faaf457aa245c58 --- /dev/null +++ b/openair2/ENB_APP/flexran_agent_common_internal.h @@ -0,0 +1,56 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file flexran_agent_common_internal.h + * \brief internal agent functions for common message primitves and utilities + * \author Xenofon Foukas + * \date 2016 + * \version 0.1 + */ + +#ifndef FLEXRAN_AGENT_COMMON_INTERNAL_H_ +#define FLEXRAN_AGENT_COMMON_INTERNAL_H_ + +#include <yaml.h> + +#include "flexran_agent_defs.h" + +int apply_reconfiguration_policy(mid_t mod_id, const char *policy, size_t policy_length); + +int apply_parameter_modification(void *parameter, yaml_parser_t *parser); + +// This can be used when parsing for a specific system that is not yet implmeneted +// in order to skip its configuration, without affecting the rest +int skip_system_section(yaml_parser_t *parser); + +// This can be used when parsing for a specific subsystem that is not yet implmeneted +// in order to skip its configuration, without affecting the rest +int skip_subsystem_section(yaml_parser_t *parser); + +// This can be used when parsing for the parameters of a specific subsystem +//that is not yet implmeneted in order to skip its configuration, without affecting the rest +int skip_subsystem_parameters_config(yaml_parser_t *parser); + +// This can be used when configuring the parameters of a specific subsystem +//that is not yet implmeneted in order to skip its configuration, without affecting the rest +int skip_parameter_modification(yaml_parser_t *parser); + +#endif diff --git a/openair2/ENB_APP/flexran_agent_defs.h b/openair2/ENB_APP/flexran_agent_defs.h new file mode 100644 index 0000000000000000000000000000000000000000..d60510b0c782bbf39fc17a3b650bc4aa9edc2a03 --- /dev/null +++ b/openair2/ENB_APP/flexran_agent_defs.h @@ -0,0 +1,125 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file flexran_agent_defs.h + * \brief FlexRAN agent common definitions + * \author Navid Nikaein and Xenofon Foukas + * \date 2016 + * \version 0.1 + */ +#ifndef FLEXRAN_AGENT_DEFS_H_ +#define FLEXRAN_AGENT_DEFS_H_ + +#include <stdio.h> +#include <stdlib.h> +#include <pthread.h> +#include <string.h> + +#include "link_manager.h" + +#define NUM_MAX_ENB 2 +#define NUM_MAX_UE 2048 +#define DEFAULT_FLEXRAN_AGENT_IPv4_ADDRESS "127.0.0.1" +#define DEFAULT_FLEXRAN_AGENT_PORT 2210 +#define DEFAULT_FLEXRAN_AGENT_CACHE "/mnt/oai_agent_cache" + +typedef enum { + + FLEXRAN_AGENT_DEFAULT=0, + + FLEXRAN_AGENT_PHY=1, + FLEXRAN_AGENT_MAC=2, + FLEXRAN_AGENT_RLC=3, + FLEXRAN_AGENT_PDCP=4, + FLEXRAN_AGENT_RRC=5, + FLEXRAN_AGENT_S1AP=6, + FLEXRAN_AGENT_GTP=7, + FLEXRAN_AGENT_X2AP=8, + + FLEXRAN_AGENT_MAX=9, + +} agent_id_t; + +typedef enum { + /* no action */ + FLEXRAN_AGENT_ACTION_NONE = 0x0, + + /* send action */ + FLEXRAN_AGENT_ACTION_SEND = 0x1, + + /* apply action */ + FLEXRAN_AGENT_ACTION_APPLY = 0x2, + + /* clear action */ + FLEXRAN_AGENT_ACTION_CLEAR = 0x4, + + /* write action */ + FLEXRAN_AGENT_ACTION_WRITE = 0x8, + + /* filter action */ + FLEXRAN_AGENT_ACTION_FILTER = 0x10, + + /* preprocess action */ + FLEXRAN_AGENT_ACTION_PREPROCESS = 0x20, + + /* meter action */ + FLEXRAN_AGENT_ACTION_METER = 0x40, + + /* Max number of states available */ + FLEXRAN_AGENT_ACTION_MAX = 0x7f, +} agent_action_t; + + +typedef enum { + + RAN_LTE_OAI= 0, + + /* Max number of states available */ + RAN_NAME_MAX = 0x7f, +} ran_name_t; + +typedef uint8_t xid_t; +typedef uint8_t mid_t; // module or enb id +typedef uint8_t lcid_t; +typedef int32_t err_code_t; + + + +typedef struct { + /* general info */ + + /* stats */ + + uint32_t total_rx_msg; + uint32_t total_tx_msg; + + uint32_t rx_msg[NUM_MAX_ENB]; + uint32_t tx_msg[NUM_MAX_ENB]; + +} flexran_agent_info_t; + +typedef struct { + mid_t enb_id; + flexran_agent_info_t agent_info; + +} flexran_agent_instance_t; + +#endif diff --git a/openair2/ENB_APP/flexran_agent_extern.h b/openair2/ENB_APP/flexran_agent_extern.h new file mode 100644 index 0000000000000000000000000000000000000000..3a03239e6fe5c0845c74e2ac724fe875eaa78404 --- /dev/null +++ b/openair2/ENB_APP/flexran_agent_extern.h @@ -0,0 +1,48 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file ENB_APP/extern.h + * \brief FlexRAN agent - mac interface primitives + * \author Xenofon Foukas + * \date 2016 + * \version 0.1 + * \mail x.foukas@sms.ed.ac.uk + */ + +#ifndef __FLEXRAN_AGENT_EXTERN_H__ +#define __FLEXRAN_AGENT_EXTERN_H__ + +#include "flexran_agent_defs.h" +#include "flexran_agent_mac_defs.h" + + +//extern msg_context_t shared_ctxt[NUM_MAX_ENB][FLEXRAN_AGENT_MAX]; + +/* full path of the local cache for storing VSFs */ +extern char local_cache[40]; + +/* Control module interface for the communication of the MAC Control Module with the agent */ +extern AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB]; + +/* Flag indicating whether the VSFs for the MAC control module have been registered */ +extern unsigned int mac_agent_registered[NUM_MAX_ENB]; + +#endif diff --git a/openair2/ENB_APP/flexran_agent_handler.c b/openair2/ENB_APP/flexran_agent_handler.c new file mode 100644 index 0000000000000000000000000000000000000000..4967e4692334d0b8fe86a379be929c99e854f5ac --- /dev/null +++ b/openair2/ENB_APP/flexran_agent_handler.c @@ -0,0 +1,189 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file flexran_agent_handler.c + * \brief FlexRAN agent tx and rx message handler + * \author Xenofon Foukas and Navid Nikaein + * \date 2016 + * \version 0.1 + */ + + +#include "flexran_agent_common.h" +#include "flexran_agent_mac.h" +#include "log.h" + +#include "assertions.h" + +flexran_agent_message_decoded_callback agent_messages_callback[][3] = { + {flexran_agent_hello, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_HELLO_MSG*/ + {flexran_agent_echo_reply, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_ECHO_REQUEST_MSG*/ + {0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_ECHO_REPLY_MSG*/ //Must add handler when receiving echo reply + {flexran_agent_mac_handle_stats, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_STATS_REQUEST_MSG*/ + {0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_STATS_REPLY_MSG*/ + {0, 0, 0}, /*PROTOCOK__FLEXRAN_MESSAGE__MSG_SF_TRIGGER_MSG*/ + {0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_UL_SR_INFO_MSG*/ + {flexran_agent_enb_config_reply, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_ENB_CONFIG_REQUEST_MSG*/ + {0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_ENB_CONFIG_REPLY_MSG*/ + {flexran_agent_ue_config_reply, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_UE_CONFIG_REQUEST_MSG*/ + {0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_UE_CONFIG_REPLY_MSG*/ + {flexran_agent_lc_config_reply, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_LC_CONFIG_REQUEST_MSG*/ + {0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_LC_CONFIG_REPLY_MSG*/ + {flexran_agent_mac_handle_dl_mac_config, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_DL_MAC_CONFIG_MSG*/ + {0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_UE_STATE_CHANGE_MSG*/ + {flexran_agent_control_delegation, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_CONTROL_DELEGATION_MSG*/ + {flexran_agent_reconfiguration, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_AGENT_RECONFIGURATION_MSG*/ +}; + +flexran_agent_message_destruction_callback message_destruction_callback[] = { + flexran_agent_destroy_hello, + flexran_agent_destroy_echo_request, + flexran_agent_destroy_echo_reply, + flexran_agent_mac_destroy_stats_request, + flexran_agent_mac_destroy_stats_reply, + flexran_agent_mac_destroy_sf_trigger, + flexran_agent_mac_destroy_sr_info, + flexran_agent_destroy_enb_config_request, + flexran_agent_destroy_enb_config_reply, + flexran_agent_destroy_ue_config_request, + flexran_agent_destroy_ue_config_reply, + flexran_agent_destroy_lc_config_request, + flexran_agent_destroy_lc_config_reply, + flexran_agent_mac_destroy_dl_config, + flexran_agent_destroy_ue_state_change, + flexran_agent_destroy_control_delegation, + flexran_agent_destroy_agent_reconfiguration, +}; + +static const char *flexran_agent_direction2String[] = { + "", /* not_set */ + "originating message", /* originating message */ + "successfull outcome", /* successfull outcome */ + "unsuccessfull outcome", /* unsuccessfull outcome */ +}; + + +Protocol__FlexranMessage* flexran_agent_handle_message (mid_t mod_id, + uint8_t *data, + uint32_t size){ + + Protocol__FlexranMessage *decoded_message, *reply_message; + err_code_t err_code; + DevAssert(data != NULL); + + if (flexran_agent_deserialize_message(data, size, &decoded_message) < 0) { + err_code= PROTOCOL__FLEXRAN_ERR__MSG_DECODING; + goto error; + } + + if ((decoded_message->msg_case > sizeof(agent_messages_callback) / (3 * sizeof(flexran_agent_message_decoded_callback))) || + (decoded_message->msg_dir > PROTOCOL__FLEXRAN_DIRECTION__UNSUCCESSFUL_OUTCOME)){ + err_code= PROTOCOL__FLEXRAN_ERR__MSG_NOT_HANDLED; + goto error; + } + + if (agent_messages_callback[decoded_message->msg_case-1][decoded_message->msg_dir-1] == NULL) { + err_code= PROTOCOL__FLEXRAN_ERR__MSG_NOT_SUPPORTED; + goto error; + + } + + err_code = ((*agent_messages_callback[decoded_message->msg_case-1][decoded_message->msg_dir-1])(mod_id, (void *) decoded_message, &reply_message)); + if ( err_code < 0 ){ + goto error; + } else if (err_code == 1) { //If err_code > 1, we do not want to dispose the message yet + protocol__flexran_message__free_unpacked(decoded_message, NULL); + } + return reply_message; + +error: + LOG_E(FLEXRAN_AGENT,"errno %d occured\n",err_code); + return NULL; + +} + + + +void * flexran_agent_pack_message(Protocol__FlexranMessage *msg, + uint32_t * size){ + + void * buffer; + err_code_t err_code = PROTOCOL__FLEXRAN_ERR__NO_ERR; + + if (flexran_agent_serialize_message(msg, &buffer, size) < 0 ) { + err_code = PROTOCOL__FLEXRAN_ERR__MSG_ENCODING; + goto error; + } + + // free the msg --> later keep this in the data struct and just update the values + //TODO call proper destroy function + err_code = ((*message_destruction_callback[msg->msg_case-1])(msg)); + + DevAssert(buffer !=NULL); + + LOG_D(FLEXRAN_AGENT,"Serilized the enb mac stats reply (size %d)\n", *size); + + return buffer; + + error : + LOG_E(FLEXRAN_AGENT,"errno %d occured\n",err_code); + + return NULL; +} + +Protocol__FlexranMessage *flexran_agent_handle_timed_task(void *args) { + err_code_t err_code; + flexran_agent_timer_args_t *timer_args = (flexran_agent_timer_args_t *) args; + + Protocol__FlexranMessage *timed_task, *reply_message; + timed_task = timer_args->msg; + err_code = ((*agent_messages_callback[timed_task->msg_case-1][timed_task->msg_dir-1])(timer_args->mod_id, (void *) timed_task, &reply_message)); + if ( err_code < 0 ){ + goto error; + } + + return reply_message; + + error: + LOG_E(FLEXRAN_AGENT,"errno %d occured\n",err_code); + return NULL; +} + +Protocol__FlexranMessage* flexran_agent_process_timeout(long timer_id, void* timer_args){ + + struct flexran_agent_timer_element_s *found = get_timer_entry(timer_id); + + if (found == NULL ) goto error; + LOG_I(FLEXRAN_AGENT, "Found the entry (%p): timer_id is 0x%lx 0x%lx\n", found, timer_id, found->timer_id); + + if (timer_args == NULL) + LOG_W(FLEXRAN_AGENT,"null timer args\n"); + + return found->cb(timer_args); + + error: + LOG_E(FLEXRAN_AGENT, "can't get the timer element\n"); + return TIMER_ELEMENT_NOT_FOUND; +} + +err_code_t flexran_agent_destroy_flexran_message(Protocol__FlexranMessage *msg) { + return ((*message_destruction_callback[msg->msg_case-1])(msg)); +} diff --git a/openair2/ENB_APP/flexran_agent_net_comm.c b/openair2/ENB_APP/flexran_agent_net_comm.c new file mode 100644 index 0000000000000000000000000000000000000000..6e39d6089f2fbb261c0bd5e71693a8aaf2db9a6f --- /dev/null +++ b/openair2/ENB_APP/flexran_agent_net_comm.c @@ -0,0 +1,192 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file flexran_agent_net_comm.c + * \brief FlexRAN agent network interface abstraction + * \author Xenofon Foukas + * \date 2016 + * \version 0.1 + */ + +#include "flexran_agent_net_comm.h" +#include "log.h" + +flexran_agent_channel_t *agent_channel[NUM_MAX_ENB][FLEXRAN_AGENT_MAX]; +flexran_agent_channel_instance_t channel_instance; +int flexran_agent_channel_id = 0; + +int flexran_agent_msg_send(mid_t mod_id, agent_id_t agent_id, void *data, int size, int priority) { + /*Check if agent id is valid*/ + if (agent_id >= FLEXRAN_AGENT_MAX || agent_id < 0) { + goto error; + } + flexran_agent_channel_t *channel; + channel = agent_channel[mod_id][agent_id]; + + /*Check if agent has a channel registered*/ + if (channel == NULL) { + goto error; + } + + return channel->msg_send(data, size, priority, channel->channel_info); + + error: + LOG_E(FLEXRAN_AGENT, "No channel registered for agent with id %d\n", agent_id); + return -1; +} + +int flexran_agent_msg_recv(mid_t mod_id, agent_id_t agent_id, void **data, int *size, int *priority) { + /*Check if agent id is valid*/ + if (agent_id >= FLEXRAN_AGENT_MAX || agent_id < 0) { + goto error; + } + flexran_agent_channel_t *channel; + channel = agent_channel[mod_id][agent_id]; + + /*Check if agent has a channel registered*/ + if (channel == NULL) { + goto error; + } + + return channel->msg_recv(data, size, priority, channel->channel_info); + + error: + LOG_E(FLEXRAN_AGENT, "No channel registered for agent with id %d\n", agent_id); + return -1; +} + +int flexran_agent_register_channel(mid_t mod_id, flexran_agent_channel_t *channel, agent_id_t agent_id) { + int i; + + if (channel == NULL) { + return -1; + } + + if (agent_id == FLEXRAN_AGENT_MAX) { + for (i = 0; i < FLEXRAN_AGENT_MAX; i++) { + agent_channel[mod_id][i] = channel; + } + } else { + agent_channel[mod_id][agent_id] = channel; + } + return 0; +} + +void flexran_agent_unregister_channel(mid_t mod_id, agent_id_t agent_id) { + int i; + + if (agent_id == FLEXRAN_AGENT_MAX) { + for (i = 0; i < FLEXRAN_AGENT_MAX; i++) { + agent_channel[mod_id][i] = NULL; + } + } else { + agent_channel[mod_id][agent_id] = NULL; + } +} + +int flexran_agent_create_channel(void *channel_info, + int (*msg_send)(void *data, int size, int priority, void *channel_info), + int (*msg_recv)(void **data, int *size, int *priority, void *channel_info), + void (*release)(flexran_agent_channel_t *channel)) { + + int channel_id = ++flexran_agent_channel_id; + flexran_agent_channel_t *channel = (flexran_agent_channel_t *) malloc(sizeof(flexran_agent_channel_t)); + channel->channel_id = channel_id; + channel->channel_info = channel_info; + channel->msg_send = msg_send; + channel->msg_recv = msg_recv; + channel->release = release; + + /*element should be a real pointer*/ + RB_INSERT(flexran_agent_channel_map, &channel_instance.flexran_agent_head, channel); + + LOG_I(FLEXRAN_AGENT,"Created a new channel with id 0x%lx\n", channel->channel_id); + + return channel_id; +} + +int flexran_agent_destroy_channel(int channel_id) { + int i, j; + + /*Check to see if channel exists*/ + struct flexran_agent_channel_s *e = NULL; + struct flexran_agent_channel_s search; + memset(&search, 0, sizeof(struct flexran_agent_channel_s)); + + e = RB_FIND(flexran_agent_channel_map, &channel_instance.flexran_agent_head, &search); + + if (e == NULL) { + return -1; + } + + /*Unregister the channel from all agents*/ + for (i = 0; i < NUM_MAX_ENB; i++) { + for (j = 0; j < FLEXRAN_AGENT_MAX; j++) { + if (agent_channel[i][j] != NULL) { + if (agent_channel[i][j]->channel_id == e->channel_id) { + agent_channel[i][j] == NULL; + } + } + } + } + + /*Remove the channel from the tree and free memory*/ + RB_REMOVE(flexran_agent_channel_map, &channel_instance.flexran_agent_head, e); + e->release(e); + free(e); + + return 0; +} + +err_code_t flexran_agent_init_channel_container(void) { + int i, j; + LOG_I(FLEXRAN_AGENT, "init RB tree for channel container\n"); + + RB_INIT(&channel_instance.flexran_agent_head); + + for (i = 0; i < NUM_MAX_ENB; i++) { + for (j = 0; j < FLEXRAN_AGENT_MAX; j++) { + agent_channel[i][j] == NULL; + } + } + + return 0; +} + +RB_GENERATE(flexran_agent_channel_map, flexran_agent_channel_s, entry, flexran_agent_compare_channel); + +int flexran_agent_compare_channel(struct flexran_agent_channel_s *a, struct flexran_agent_channel_s *b) { + if (a->channel_id < b->channel_id) return -1; + if (a->channel_id > b->channel_id) return 1; + + // equal timers + return 0; +} + +flexran_agent_channel_t * get_channel(int channel_id) { + + struct flexran_agent_channel_s search; + memset(&search, 0, sizeof(struct flexran_agent_channel_s)); + search.channel_id = channel_id; + + return RB_FIND(flexran_agent_channel_map, &channel_instance.flexran_agent_head, &search); + +} diff --git a/openair2/ENB_APP/flexran_agent_net_comm.h b/openair2/ENB_APP/flexran_agent_net_comm.h new file mode 100644 index 0000000000000000000000000000000000000000..e4aa854c70c9f0cbb454662eaaac89de752a49c6 --- /dev/null +++ b/openair2/ENB_APP/flexran_agent_net_comm.h @@ -0,0 +1,81 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file flexran_agent_net_comm.h + * \brief FlexRAN agent network interface abstraction + * \autho Xenofon Foukas + * \date 2016 + * \version 0.1 + */ +#ifndef FLEXRAN_AGENT_NET_COMM_H_ +#define FLEXRAN_AGENT_NET_COMM_H_ + +#include "flexran_agent_defs.h" + +#include "tree.h" + +/*Channel related information used for Tx/Rx of protocol messages*/ +typedef struct flexran_agent_channel_s { + RB_ENTRY(flexran_agent_channel_s) entry; +int channel_id; +void *channel_info; +/*Callbacks for channel message Tx and Rx*/ +int (*msg_send)(void *data, int size, int priority, void *channel_info); +int (*msg_recv)(void **data, int *size, int *priority, void *channel_info); +void (*release)(struct flexran_agent_channel_s *channel); +} flexran_agent_channel_t; + +typedef struct flexran_agent_channel_instance_s{ + RB_HEAD(flexran_agent_channel_map, flexran_agent_channel_s) flexran_agent_head; +} flexran_agent_channel_instance_t; + +/*Send and receive messages using the channel registered for a specific agent*/ +int flexran_agent_msg_send(mid_t mod_id, agent_id_t agent_id, void *data, int size, int priority); +int flexran_agent_msg_recv(mid_t mod_id, agent_id_t agent_id, void **data, int *size, int *priority); + +/*Register a channel to an agent. Use FLEXRAN_AGENT_MAX to register the + *same channel to all agents*/ +int flexran_agent_register_channel(mid_t mod_id, flexran_agent_channel_t *channel, agent_id_t agent_id); + +/*Unregister the current channel of an agent. Use FLEXRAN_AGENT_MAX to unregister all channels*/ +void flexran_agent_unregister_channel(mid_t mod_id, agent_id_t agent_id); + +/*Create a new channel. Returns the id of the new channel or negative number otherwise*/ +int flexran_agent_create_channel(void *channel_info, + int (*msg_send)(void *data, int size, int priority, void *channel_info), + int (*msg_recv)(void **data, int *size, int *priority, void *channel_info), + void (*release)(flexran_agent_channel_t *channel)); + +/*Unregister a channel from all agents and destroy it. Returns 0 in case of success*/ +int flexran_agent_destroy_channel(int channel_id); + +/*Return an agent communication channel based on its id*/ +flexran_agent_channel_t * get_channel(int channel_id); + +/*Should be called before performing any channel operations*/ +err_code_t flexran_agent_init_channel_container(void); + +int flexran_agent_compare_channel(struct flexran_agent_channel_s *a, struct flexran_agent_channel_s *b); + +/* RB_PROTOTYPE is for .h files */ +RB_PROTOTYPE(flexran_agent_channel_map, flexran_agent_channel_s, entry, flexran_agent_compare_channel); + +#endif /*FLEXRAN_AGENT_COMM_H_*/ diff --git a/openair2/ENB_APP/flexran_agent_task_manager.c b/openair2/ENB_APP/flexran_agent_task_manager.c new file mode 100644 index 0000000000000000000000000000000000000000..eaa6a58af8d0cfcf2f6019f3674bcfa964df6c5f --- /dev/null +++ b/openair2/ENB_APP/flexran_agent_task_manager.c @@ -0,0 +1,304 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file flexran_agent_task_manager.h + * \brief Implementation of scheduled tasks manager for the FlexRAN agent + * \author Xenofon Foukas + * \date January 2016 + * \version 0.1 + * \email: x.foukas@sms.ed.ac.uk + * @ingroup _mac + */ + +#include <stdlib.h> +#include <string.h> +#include <stdio.h> + +#include "flexran_agent_task_manager.h" +#include "flexran_agent_common.c" + + +/* Util macros */ +#define LEFT(x) (2 * (x) + 1) +#define RIGHT(x) (2 * (x) + 2) +#define PARENT(x) ((x - 1) / 2) + +flexran_agent_task_t *flexran_agent_task_create(Protocol__FlexranMessage *msg, + uint16_t frame_num, uint8_t subframe_num) { + flexran_agent_task_t *task = NULL; + task = malloc(sizeof(flexran_agent_task_t)); + + if (task == NULL) + goto error; + + task->frame_num = frame_num; + task->subframe_num = subframe_num; + task->task = msg; + + return task; + + error: + return NULL; +} + +void flexran_agent_task_destroy(flexran_agent_task_t *task) { + if (task == NULL) + return; + + /* TODO: must free the task properly */ + free(task->task); + free(task); +} + +flexran_agent_task_queue_t *flexran_agent_task_queue_init(mid_t mod_id, size_t capacity, + int (*cmp)(mid_t mod_id, const flexran_agent_task_t *t1, + const flexran_agent_task_t *t2)) { + flexran_agent_task_queue_t *queue = NULL; + + queue = malloc(sizeof(flexran_agent_task_queue_t)); + if (queue == NULL) + goto error; + + /* If no comparator was given, use the default one */ + if (cmp == NULL) + queue->cmp = _flexran_agent_task_queue_cmp; + else + queue->cmp = cmp; + + queue->mod_id = mod_id; + + queue->first_frame = 0; + queue->first_subframe = 0; + + queue->task = malloc(capacity * sizeof(flexran_agent_task_t *)); + if (queue->task == NULL) + goto error; + + queue->count = 0; + queue->capacity = capacity; + + queue->mutex = malloc(sizeof(pthread_mutex_t)); + if (queue->mutex == NULL) + goto error; + if (pthread_mutex_init(queue->mutex, NULL)) + goto error; + + return queue; + + error: + if (queue != NULL) { + free(queue->mutex); + free(queue->task); + free(queue); + } + return NULL; +} + +flexran_agent_task_queue_t *flexran_agent_task_queue_default_init(mid_t mod_id) { + return flexran_agent_task_queue_init(mod_id, DEFAULT_CAPACITY, NULL); +} + +void flexran_agent_task_queue_destroy(flexran_agent_task_queue_t *queue) { + int i; + + if (queue == NULL) + return; + + for (i = 0; i < queue->count; i++) { + flexran_agent_task_destroy(queue->task[i]); + } + free(queue->task); + free(queue->mutex); + free(queue); +} + +int flexran_agent_task_queue_put(flexran_agent_task_queue_t *queue, flexran_agent_task_t *task) { + size_t i; + flexran_agent_task_t *tmp = NULL; + int realloc_status, err_code; + + if (pthread_mutex_lock(queue->mutex)) { + /*TODO*/ + err_code = -1; + goto error; + } + + if (queue->count >= queue->capacity) { + /*TODO: need to call realloc heap*/ + realloc_status = _flexran_agent_task_queue_realloc_heap(queue); + if (realloc_status != HEAP_OK) { + err_code = realloc_status; + goto error; + } + } + + queue->task[queue->count] = task; + i = queue->count; + queue->count++; + /*Swap elements to maintain heap properties*/ + while(i > 0 && queue->cmp(queue->mod_id, queue->task[i], queue->task[PARENT(i)]) > 0) { + tmp = queue->task[i]; + queue->task[i] = queue->task[PARENT(i)]; + queue->task[PARENT(i)] = tmp; + i = PARENT(i); + } + + if (pthread_mutex_unlock(queue->mutex)) { + // LOG_E(MAC, "%s:%d:%s: fatal error\n", __FILE__, __LINE__, __FUNCTION__); + exit(1); + } + return 0; + + error: + /*TODO*/ + return err_code; +} + + +int flexran_agent_task_queue_get_current_task(flexran_agent_task_queue_t *queue, flexran_agent_task_t **task) { + int err_code; + + if (pthread_mutex_lock(queue->mutex)) { + /*TODO*/ + err_code = -1; + goto error; + } + + if (queue->count < 1) { + /* Priority Queue is empty */ + err_code = HEAP_EMPTY; + goto error; + } + + /* Find current frame and subframe number */ + uint16_t curr_frame = flexran_get_current_frame(queue->mod_id); + uint8_t curr_subframe = flexran_get_current_subframe(queue->mod_id); + + /* If no task is scheduled for the current subframe, return without any task */ + if(queue->task[0]->frame_num != curr_frame || queue->task[0]->subframe_num != curr_subframe) { + *task = NULL; + return 0; + } + /* Otherwise, the first task should be returned */ + *task = queue->task[0]; + queue->task[0] = queue->task[queue->count-1]; + queue->count--; + /* Restore heap property */ + _flexran_agent_task_queue_heapify(queue, 0); + + /*If queue has no element*/ + if (queue->count < 1) { + queue->first_frame = 0; + queue->first_subframe = 0; + } else { + queue->first_frame = queue->task[0]->frame_num; + queue->first_subframe = queue->task[0]->subframe_num; + } + + if (pthread_mutex_unlock(queue->mutex)) { + // LOG_E(MAC, "%s:%d:%s: fatal error\n", __FILE__, __LINE__, __FUNCTION__); + exit(1); + } + return HEAP_OK; + + error: + /*TODO*/ + return err_code; +} + +/*Warning: Internal function. Should not be called as API function. Not thread safe*/ +void _flexran_agent_task_queue_heapify(flexran_agent_task_queue_t *queue, size_t idx) { + /* left index, right index, largest */ + flexran_agent_task_t *tmp = NULL; + size_t l_idx, r_idx, lrg_idx; + + l_idx = LEFT(idx); + r_idx = RIGHT(idx); + + /* Left child exists, compare left child with its parent */ + if (l_idx < queue->count && queue->cmp(queue->mod_id, queue->task[l_idx], queue->task[idx]) > 0) { + lrg_idx = l_idx; + } else { + lrg_idx = idx; + } + + /* Right child exists, compare right child with the largest element */ + if (r_idx < queue->count && queue->cmp(queue->mod_id, queue->task[r_idx], queue->task[lrg_idx]) > 0) { + lrg_idx = r_idx; + } + + /* At this point largest element was determined */ + if (lrg_idx != idx) { + /* Swap between the index at the largest element */ + tmp = queue->task[lrg_idx]; + queue->task[lrg_idx] = queue->task[idx]; + queue->task[idx] = tmp; + /* Heapify again */ + _flexran_agent_task_queue_heapify(queue, lrg_idx); + } +} + +/*Warning: Internal function. Should not be called as API function. Not thread safe*/ +int _flexran_agent_task_queue_realloc_heap(flexran_agent_task_queue_t *queue) { + flexran_agent_task_t **resized_task_heap; + if (queue->count >= queue->capacity) { + size_t task_size = sizeof(flexran_agent_task_t); + + resized_task_heap = realloc(queue->task, (2*queue->capacity) * task_size); + if (resized_task_heap != NULL) { + queue->capacity *= 2; + queue->task = (flexran_agent_task_t **) resized_task_heap; + return HEAP_OK; + } else return HEAP_REALLOCERROR; + } + return HEAP_NOREALLOC; +} + +int _flexran_agent_task_queue_cmp(mid_t mod_id, const flexran_agent_task_t *t1, const flexran_agent_task_t *t2) { + if ((t1->frame_num == t2->frame_num) && (t1->subframe_num == t2->subframe_num)) + return 0; + + uint16_t curr_frame = flexran_get_current_frame(mod_id); + uint8_t curr_subframe = flexran_get_current_subframe(mod_id); + + int f_offset, sf_offset, tmp1, tmp2; + + /*Check if the offsets have the same sign and compare the tasks position frame-wise*/ + tmp1 = t1->frame_num - curr_frame; + tmp2 = t2->frame_num - curr_frame; + if ((tmp1 >= 0) ^ (tmp2 < 0)) { + f_offset = tmp2 - tmp1; + } + else { + f_offset = tmp1 - tmp2; + } + /*Do the same for the subframe*/ + tmp1 = t1->subframe_num - curr_subframe; + tmp2 = t2->subframe_num - curr_subframe; + if ((tmp1 >= 0) ^ (tmp2 < 0)) + sf_offset = tmp2 - tmp1; + else + sf_offset = tmp1 - tmp2; + + /*Subframe position matters only if f_offset is 0. Multiply f_offset by 100 + to be the only comparisson parameter in all other cases */ + return f_offset*100 + sf_offset; +} diff --git a/openair2/ENB_APP/flexran_agent_task_manager.h b/openair2/ENB_APP/flexran_agent_task_manager.h new file mode 100644 index 0000000000000000000000000000000000000000..1b14f1f6f6754d6e45d5201a40650f54146a8eac --- /dev/null +++ b/openair2/ENB_APP/flexran_agent_task_manager.h @@ -0,0 +1,156 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file flexran_agent_task_manager.h + * \brief Implementation of scheduled tasks manager for the FlexRAN agent + * \author Xenofon Foukas + * \date January 2016 + * \version 0.1 + * \email: x.foukas@sms.ed.ac.uk + * @ingroup _mac + */ + +#ifndef FLEXRAN_AGENT_TASK_MANAGER_ +#define FLEXRAN_AGENT_TASK_MANAGER_ + +#include <stdint.h> +#include <pthread.h> + +#include "flexran.pb-c.h" + +#include "flexran_agent_common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define DEFAULT_CAPACITY 512 + +/** + * The structure containing the enb agent task to be executed + */ +typedef struct flexran_agent_task_s { + /* The frame in which the task needs to be executed */ + uint16_t frame_num; + /* The subframe in which the task needs to be executed */ + uint8_t subframe_num; + /* The task to be executed in the form of a Protocol__FlexranMessage */ + Protocol__FlexranMessage *task; +} flexran_agent_task_t; + +/** + * Priority Queue Structure for tasks + */ +typedef struct flexran_agent_task_queue_s { + mid_t mod_id; + /* The amount of allocated memory for agent tasks in the heap*/ + volatile size_t capacity; + /* The actual size of the tasks heap at a certain time */ + volatile size_t count; + /* The earliest frame that has a pending task */ + volatile uint16_t first_frame; + /* The earliest subframe within the frame that has a pending task */ + volatile uint8_t first_subframe; + /* An array of prioritized tasks stored in a heap */ + flexran_agent_task_t **task; + /* A pointer to a comparator function, used to prioritize elements */ + int (*cmp)(mid_t mod_id, const flexran_agent_task_t *t1, const flexran_agent_task_t *t2); + pthread_mutex_t *mutex; +} flexran_agent_task_queue_t; + +typedef enum { + HEAP_OK = 0, + HEAP_EMPTY, + HEAP_FAILED, + HEAP_REALLOCERROR, + HEAP_NOREALLOC, + HEAP_FATAL, +} heapstatus_e; + +/** + * Allocate memory for a task in the queue + */ +flexran_agent_task_t *flexran_agent_task_create(Protocol__FlexranMessage *msg, + uint16_t frame_num, uint8_t subframe_num); + +/** + * Free memory for a task of the queue + */ +void flexran_agent_task_destroy(flexran_agent_task_t *task); + +/** + * Allocate initial memory for storing the tasks + */ + flexran_agent_task_queue_t *flexran_agent_task_queue_init(mid_t mod_id, size_t capacity, + int (*cmp)(mid_t mod_id, const flexran_agent_task_t *t1, + const flexran_agent_task_t *t2)); + +/** + * Allocate initial memory for storing the tasks using default parameters + */ +flexran_agent_task_queue_t *flexran_agent_task_queue_default_init(mid_t mod_id); + +/** + * De-allocate memory for the tasks queue + */ +void flexran_agent_task_queue_destroy(flexran_agent_task_queue_t *queue); + +/** + * Insert task into the queue + */ +int flexran_agent_task_queue_put(flexran_agent_task_queue_t *queue, flexran_agent_task_t *task); + +/** + * Remove the task with the highest priority from the queue + * task becomes NULL if there is no task for the current frame and subframe + */ +int flexran_agent_task_queue_get_current_task(flexran_agent_task_queue_t *queue, flexran_agent_task_t **task); + +/** + * Check if the top priority task is for a specific frame and subframe + */ +int flexran_agent_task_queue_has_upcoming_task (flexran_agent_task_queue_t *queue, + const uint16_t frame, const uint8_t subframe); + +/** + * Restructure heap after modifications + */ +void _flexran_agent_task_queue_heapify(flexran_agent_task_queue_t *queue, size_t idx); + +/** + * Reallocate memory once the heap reaches max size + */ +int _flexran_agent_task_queue_realloc_heap(flexran_agent_task_queue_t *queue); + +/** + * Compare two agent tasks based on frame and subframe + * returns 0 if tasks t1, t2 have the same priority + * return negative value if t1 needs to be executed after t2 + * return positive value if t1 preceeds t2 + * Need to give eNB id for the comparisson based on the current frame-subframe + */ + int _flexran_agent_task_queue_cmp(mid_t mod_id, const flexran_agent_task_t *t1, const flexran_agent_task_t *t2); + +#ifdef __cplusplus +} +#endif + +#endif /*FLEXRAN_AGENT_TASK_MANAGER_*/ diff --git a/openair2/LAYER2/MAC/config.c b/openair2/LAYER2/MAC/config.c index 3fbcadafbbd1f1e75ddd3ed35a41b7d7784949fa..e4252ed50049afbc0f19362697f10e11956fe301 100644 --- a/openair2/LAYER2/MAC/config.c +++ b/openair2/LAYER2/MAC/config.c @@ -70,6 +70,9 @@ void ue_mac_reset(module_id_t module_idP,uint8_t eNB_index) UE_mac_inst[module_idP].scheduling_info.SR_pending=0; UE_mac_inst[module_idP].scheduling_info.SR_COUNTER=0; +//Set BSR Trigger Bmp and remove timer flags + UE_mac_inst[module_idP].BSR_reporting_active = BSR_TRIGGER_NONE; + // stop ongoing RACH procedure // discard explicitly signaled ra_PreambleIndex and ra_RACH_MaskIndex, if any @@ -178,8 +181,14 @@ rrc_mac_config_req( if (logicalChannelConfig->ul_SpecificParameters) { UE_mac_inst[Mod_idP].scheduling_info.bucket_size[logicalChannelIdentity]=logicalChannelConfig->ul_SpecificParameters->prioritisedBitRate * logicalChannelConfig->ul_SpecificParameters->bucketSizeDuration; // set the max bucket size - UE_mac_inst[Mod_idP].scheduling_info.LCGID[logicalChannelIdentity]=*logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup; - LOG_D(MAC,"[CONFIG][UE %d] LCID %d is attached to the LCGID %d\n",Mod_idP,logicalChannelIdentity,*logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup); + if (logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup != NULL) { + UE_mac_inst[Mod_idP].scheduling_info.LCGID[logicalChannelIdentity]=*logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup; + LOG_D(MAC,"[CONFIG][UE %d] LCID %d is attached to the LCGID %d\n",Mod_idP,logicalChannelIdentity,*logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup); + } + else { + UE_mac_inst[Mod_idP].scheduling_info.LCGID[logicalChannelIdentity] = MAX_NUM_LCGID; + } + UE_mac_inst[Mod_idP].scheduling_info.LCID_buffer_remain[logicalChannelIdentity] = 0; } else { LOG_E(MAC,"[CONFIG][UE %d] LCID %d NULL ul_SpecificParameters\n",Mod_idP,logicalChannelIdentity); mac_xface->macphy_exit("NULL ul_SpecificParameters"); @@ -212,6 +221,7 @@ rrc_mac_config_req( } else { UE_mac_inst[Mod_idP].scheduling_info.maxHARQ_Tx = (uint16_t) MAC_MainConfig__ul_SCH_Config__maxHARQ_Tx_n5; } + mac_xface->phy_config_harq_ue(Mod_idP,0,eNB_index,UE_mac_inst[Mod_idP].scheduling_info.maxHARQ_Tx); if (mac_MainConfig->ul_SCH_Config->retxBSR_Timer) { UE_mac_inst[Mod_idP].scheduling_info.retxBSR_Timer = (uint16_t) mac_MainConfig->ul_SCH_Config->retxBSR_Timer; @@ -225,12 +235,34 @@ rrc_mac_config_req( if (mac_MainConfig->ext1 && mac_MainConfig->ext1->sr_ProhibitTimer_r9) { UE_mac_inst[Mod_idP].scheduling_info.sr_ProhibitTimer = (uint16_t) *mac_MainConfig->ext1->sr_ProhibitTimer_r9; } else { - UE_mac_inst[Mod_idP].scheduling_info.sr_ProhibitTimer = (uint16_t) 0; + UE_mac_inst[Mod_idP].scheduling_info.sr_ProhibitTimer = 0; } + if (mac_MainConfig->ext2 && mac_MainConfig->ext2->mac_MainConfig_v1020) { + if (mac_MainConfig->ext2->mac_MainConfig_v1020->extendedBSR_Sizes_r10) { + UE_mac_inst[Mod_idP].scheduling_info.extendedBSR_Sizes_r10 = (uint16_t) *mac_MainConfig->ext2->mac_MainConfig_v1020->extendedBSR_Sizes_r10; + } else { + UE_mac_inst[Mod_idP].scheduling_info.extendedBSR_Sizes_r10 = (uint16_t)0; + } + if (mac_MainConfig->ext2->mac_MainConfig_v1020->extendedPHR_r10) { + UE_mac_inst[Mod_idP].scheduling_info.extendedPHR_r10 = (uint16_t) *mac_MainConfig->ext2->mac_MainConfig_v1020->extendedPHR_r10; + } else { + UE_mac_inst[Mod_idP].scheduling_info.extendedPHR_r10 = (uint16_t)0; + } + } else { + UE_mac_inst[Mod_idP].scheduling_info.extendedBSR_Sizes_r10 = (uint16_t)0; + UE_mac_inst[Mod_idP].scheduling_info.extendedPHR_r10 = (uint16_t)0; + } #endif - UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_SF = get_sf_periodicBSRTimer(UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_Timer); - UE_mac_inst[Mod_idP].scheduling_info.retxBSR_SF = get_sf_retxBSRTimer(UE_mac_inst[Mod_idP].scheduling_info.retxBSR_Timer); + UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_SF = MAC_UE_BSR_TIMER_NOT_RUNNING; + UE_mac_inst[Mod_idP].scheduling_info.retxBSR_SF = MAC_UE_BSR_TIMER_NOT_RUNNING; + + UE_mac_inst[Mod_idP].BSR_reporting_active = BSR_TRIGGER_NONE; + + LOG_D(MAC,"[UE %d]: periodic BSR %d (SF), retx BSR %d (SF)\n", + Mod_idP, + UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_SF, + UE_mac_inst[Mod_idP].scheduling_info.retxBSR_SF); UE_mac_inst[Mod_idP].scheduling_info.drx_config = mac_MainConfig->drx_Config; UE_mac_inst[Mod_idP].scheduling_info.phr_config = mac_MainConfig->phr_Config; @@ -252,6 +284,7 @@ rrc_mac_config_req( UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_SF = get_sf_perioidicPHR_Timer(UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_Timer); UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_SF = get_sf_prohibitPHR_Timer(UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_Timer); UE_mac_inst[Mod_idP].scheduling_info.PathlossChange_db = get_db_dl_PathlossChange(UE_mac_inst[Mod_idP].scheduling_info.PathlossChange); + UE_mac_inst[Mod_idP].PHR_reporting_active = 0; LOG_D(MAC,"[UE %d] config PHR (%d): periodic %d (SF) prohibit %d (SF) pathlosschange %d (db) \n", Mod_idP, (mac_MainConfig->phr_Config)?mac_MainConfig->phr_Config->present:-1, diff --git a/openair2/LAYER2/MAC/defs.h b/openair2/LAYER2/MAC/defs.h index 2235c3e1c41a01a2b66009692ac4a72a021a82c4..4b100389296549257aaf809471358dd08d71da6b 100644 --- a/openair2/LAYER2/MAC/defs.h +++ b/openair2/LAYER2/MAC/defs.h @@ -133,10 +133,18 @@ /*!\brief maximum value for channel quality indicator */ #define MAX_CQI_VALUE 15 +/*!\brief value for indicating BSR Timer is not running */ +#define MAC_UE_BSR_TIMER_NOT_RUNNING (0xFFFF) #define LCID_EMPTY 0 #define LCID_NOT_EMPTY 1 +/*!\brief minimum RLC PDU size to be transmitted = min RLC Status PDU or RLC UM PDU SN 5 bits */ +#define MIN_RLC_PDU_SIZE (2) + +/*!\brief minimum MAC data needed for transmitting 1 min RLC PDU size + 1 byte MAC subHeader */ +#define MIN_MAC_HDR_RLC_SIZE (1 + MIN_RLC_PDU_SIZE) + /* * eNB part */ @@ -222,11 +230,10 @@ typedef struct { typedef BSR_SHORT BSR_TRUNCATED; /*!\brief mac control element: long buffer status report for all logical channel group ID*/ typedef struct { - uint32_t Buffer_size3:6; - uint32_t Buffer_size2:6; - uint32_t Buffer_size1:6; - uint32_t Buffer_size0:6; - uint32_t padding:8; + uint8_t Buffer_size3:6; + uint8_t Buffer_size2:6; + uint8_t Buffer_size1:6; + uint8_t Buffer_size0:6; } __attribute__((__packed__))BSR_LONG; #define BSR_LONG_SIZE (sizeof(BSR_LONG)) @@ -336,6 +343,12 @@ typedef struct { #define SHORT_BSR 29 /*!\brief LCID of long BSR for ULSCH */ #define LONG_BSR 30 +/*!\bitmaps for BSR Triggers */ +#define BSR_TRIGGER_NONE (0) /* No BSR Trigger */ +#define BSR_TRIGGER_REGULAR (1) /* For Regular and ReTxBSR Expiry Triggers */ +#define BSR_TRIGGER_PERIODIC (2) /* For BSR Periodic Timer Expiry Trigger */ +#define BSR_TRIGGER_PADDING (4) /* For Padding BSR Trigger */ + /*! \brief Downlink SCH PDU Structure */ typedef struct { @@ -462,6 +475,13 @@ typedef struct { // uint32_t total_ulsch_pdus_rx; + + /// MAC agent-related stats + /// total number of scheduling decisions + int sched_decisions; + /// missed deadlines + int missed_deadlines; + } eNB_STATS; /*! \brief eNB statistics for the connected UEs*/ typedef struct { @@ -602,6 +622,12 @@ typedef struct { /// Flag to indicate UE has been configured (ACK from RRCConnectionSetup received) boolean_t configured; + /// MCS from last scheduling + uint8_t mcs[8]; + + /// TPC from last scheduling + uint8_t oldTPC[8]; + // PHY interface info /// DCI format for DLSCH @@ -945,8 +971,12 @@ typedef enum { typedef struct { /// buffer status for each lcgid uint8_t BSR[MAX_NUM_LCGID]; // should be more for mesh topology - /// keep the number of bytes in rlc buffer for each lcid - uint16_t BSR_bytes[MAX_NUM_LCGID]; + /// keep the number of bytes in rlc buffer for each lcgid + int32_t BSR_bytes[MAX_NUM_LCGID]; + /// after multiplexing buffer remain for each lcid + int32_t LCID_buffer_remain[MAX_NUM_LCID]; + /// sum of all lcid buffer size + uint16_t All_lcid_buffer_size_lastTTI; /// buffer status for each lcid uint8_t LCID_status[MAX_NUM_LCID]; /// SR pending as defined in 36.321 @@ -958,11 +988,11 @@ typedef struct { /// retxBSR-Timer, default value is sf2560 uint16_t retxBSR_Timer; /// retxBSR_SF, number of subframe before triggering a regular BSR - int16_t retxBSR_SF; + uint16_t retxBSR_SF; /// periodicBSR-Timer, default to infinity uint16_t periodicBSR_Timer; /// periodicBSR_SF, number of subframe before triggering a periodic BSR - int16_t periodicBSR_SF; + uint16_t periodicBSR_SF; /// default value is 0: not configured uint16_t sr_ProhibitTimer; /// sr ProhibitTime running @@ -987,6 +1017,12 @@ typedef struct { int16_t prohibitPHR_SF; ///DL Pathloss Change in db uint16_t PathlossChange_db; + + /// default value is false + uint16_t extendedBSR_Sizes_r10; + /// default value is false + uint16_t extendedPHR_r10; + //Bj bucket usage per lcid int16_t Bj[MAX_NUM_LCID]; // Bucket size per lcid @@ -1074,6 +1110,13 @@ typedef struct { uint8_t PHR_reporting_active; /// power backoff due to power management (as allowed by P-MPRc) for this cell uint8_t power_backoff_db[NUMBER_OF_eNB_MAX]; + /// BSR report falg management + uint8_t BSR_reporting_active; + /// retxBSR-Timer expires flag + uint8_t retxBSRTimer_expires_flag; + /// periodBSR-Timer expires flag + uint8_t periodBSRTimer_expires_flag; + /// MBSFN_Subframe Configuration struct MBSFN_SubframeConfig *mbsfn_SubframeConfig[8]; // FIXME replace 8 by MAX_MBSFN_AREA? /// number of subframe allocation pattern available for MBSFN sync area diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index 373bfd05cb93095d637f5dc9fce36e65ba8a61b6..c5dc8c88b04465ab71f69033ae2cd83cdb753acb 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -52,12 +52,23 @@ //#include "LAYER2/MAC/pre_processor.c" #include "pdcp.h" +#if defined(FLEXRAN_AGENT_SB_IF) +//Agent-related headers +#include "flexran_agent_extern.h" +#include "flexran_agent_mac.h" +#include "flexran_agent_mac_proto.h" +#endif + #if defined(ENABLE_ITTI) # include "intertask_interface.h" #endif #define ENABLE_MAC_PAYLOAD_DEBUG #define DEBUG_eNB_SCHEDULER 1 +//efine ENABLE_ENB_AGENT_DL_SCHEDULER +//#define DISABLE_SF_TRIGGER +//#define DISABLE_CONT_STATS + //#define DEBUG_HEADER_PARSING 1 //#define DEBUG_PACKET_TRACE 1 @@ -94,6 +105,10 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, void *DLSCH_dci=NULL; int size_bits=0,size_bytes=0; +#if defined(FLEXRAN_AGENT_SB_IF) + Protocol__FlexranMessage *msg; +#endif + LOG_D(MAC,"[eNB %d] Frame %d, Subframe %d, entering MAC scheduler (UE_list->head %d)\n",module_idP, frameP, subframeP,UE_list->head); start_meas(&eNB_mac_inst[module_idP].eNB_scheduler); @@ -126,8 +141,17 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, eNB_mac_inst[module_idP].UE_list.UE_sched_ctrl[i].cqi_req_timer++; + if (mac_xface->get_eNB_UE_stats(module_idP, CC_id, rnti)==NULL) { - // mac_remove_ue(module_idP, i, frameP, subframeP); + //mac_remove_ue(module_idP, i, frameP, subframeP); + //Inform the controller about the UE deactivation. Should be moved to RRC agent in the future +#if defined(FLEXRAN_AGENT_SB_IF) + if (mac_agent_registered[module_idP]) { + agent_mac_xface[module_idP]->flexran_agent_notify_ue_state_change(module_idP, + rnti, + PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED); + } +#endif } else { // check uplink failure @@ -309,7 +333,14 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, } - + +/* #ifndef DISABLE_SF_TRIGGER */ +/* //Send subframe trigger to the controller */ +/* if (mac_agent_registered[module_idP]) { */ +/* agent_mac_xface[module_idP]->flexran_agent_send_sf_trigger(module_idP); */ +/* } */ +/* #endif */ + //if (subframeP%5 == 0) //#ifdef EXMIMO PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, NOT_A_RNTI, frameP, subframeP,module_idP); @@ -363,10 +394,26 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, (mac_xface->frame_parms->tdd_config == 6)) { //schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,4);//,calibration_flag); } - +#ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); - +#else + if (mac_agent_registered[module_idP]) { + agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( + module_idP, + frameP, + subframeP, + mbsfn_status, + &msg); + + flexran_apply_dl_scheduling_decisions(module_idP, + frameP, + subframeP, + mbsfn_status, + msg); + flexran_agent_mac_destroy_dl_config(msg); + } +#endif break; case 1: @@ -378,12 +425,16 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, case 0: case 1: schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,7); +#ifndef FLEXRAN_AGENT_SB_IF fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); +#endif break; case 6: schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,8); +#ifndef FLEXRAN_AGENT_SB_IF fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); +#endif break; default: @@ -391,8 +442,26 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, } } else { //FDD schedule_ulsch(module_idP,frameP,cooperation_flag,1,5); +#ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); +#else + if (mac_agent_registered[module_idP]) { + agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( + module_idP, + frameP, + subframeP, + mbsfn_status, + &msg); + + flexran_apply_dl_scheduling_decisions(module_idP, + frameP, + subframeP, + mbsfn_status, + msg); + flexran_agent_mac_destroy_dl_config(msg); + } +#endif } break; @@ -403,8 +472,26 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, // FDD, normal UL/DLSCH if (mac_xface->frame_parms->frame_type == FDD) { //FDD schedule_ulsch(module_idP,frameP,cooperation_flag,2,6); +#ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); +#else + if (mac_agent_registered[module_idP]) { + agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( + module_idP, + frameP, + subframeP, + mbsfn_status, + &msg); + + flexran_apply_dl_scheduling_decisions(module_idP, + frameP, + subframeP, + mbsfn_status, + msg); + flexran_agent_mac_destroy_dl_config(msg); + } +#endif } break; @@ -421,8 +508,26 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, // no break here! case 5: +#ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); +#else + if (mac_agent_registered[module_idP]) { + agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( + module_idP, + frameP, + subframeP, + mbsfn_status, + &msg); + + flexran_apply_dl_scheduling_decisions(module_idP, + frameP, + subframeP, + mbsfn_status, + msg); + flexran_agent_mac_destroy_dl_config(msg); + } +#endif break; default: @@ -431,8 +536,26 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, } else { //FDD schedule_ulsch(module_idP,frameP,cooperation_flag,3,7); +#ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); +#else + if (mac_agent_registered[module_idP]) { + agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( + module_idP, + frameP, + subframeP, + mbsfn_status, + &msg); + + flexran_apply_dl_scheduling_decisions(module_idP, + frameP, + subframeP, + mbsfn_status, + msg); + flexran_agent_mac_destroy_dl_config(msg); + } +#endif } break; @@ -456,9 +579,26 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, // no break here! case 5: - +#ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); + fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); +#else + if (mac_agent_registered[module_idP]) { + agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( + module_idP, + frameP, + subframeP, + mbsfn_status, + &msg); + + flexran_apply_dl_scheduling_decisions(module_idP, + frameP, + subframeP, + mbsfn_status, + msg); + flexran_agent_mac_destroy_dl_config(msg); + } +#endif break; default: @@ -468,8 +608,26 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, if (mac_xface->frame_parms->frame_type == FDD) { //FDD schedule_ulsch(module_idP, frameP, cooperation_flag, 4, 8); +#ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP, frameP, subframeP, mbsfn_status); fill_DLSCH_dci(module_idP, frameP, subframeP, mbsfn_status); +#else + if (mac_agent_registered[module_idP]) { + agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( + module_idP, + frameP, + subframeP, + mbsfn_status, + &msg); + + flexran_apply_dl_scheduling_decisions(module_idP, + frameP, + subframeP, + mbsfn_status, + msg); + flexran_agent_mac_destroy_dl_config(msg); + } +#endif } } @@ -486,15 +644,53 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, if (mac_xface->frame_parms->frame_type == FDD) { schedule_RA(module_idP,frameP,subframeP,1); schedule_ulsch(module_idP,frameP,cooperation_flag,5,9); +#ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP, frameP, subframeP, mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); +#else + if (mac_agent_registered[module_idP]) { + agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( + module_idP, + frameP, + subframeP, + mbsfn_status, + &msg); + + flexran_apply_dl_scheduling_decisions(module_idP, + frameP, + subframeP, + mbsfn_status, + msg); + flexran_agent_mac_destroy_dl_config(msg); + } +#endif } else if ((mac_xface->frame_parms->tdd_config == 0) || // TDD Config 0 (mac_xface->frame_parms->tdd_config == 6)) { // TDD Config 6 //schedule_ulsch(module_idP,cooperation_flag,subframeP); +#ifndef FLEXRAN_AGENT_SB_IF fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); +#endif } else { +#ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); +#else + if (mac_agent_registered[module_idP]) { + agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( + module_idP, + frameP, + subframeP, + mbsfn_status, + &msg); + + flexran_apply_dl_scheduling_decisions(module_idP, + frameP, + subframeP, + mbsfn_status, + msg); + flexran_agent_mac_destroy_dl_config(msg); + } +#endif } break; @@ -512,25 +708,65 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, case 1: schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,2); // schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); +#ifndef FLEXRAN_AGENT_SB_IF fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); +#endif break; case 6: schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3); // schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); +#ifndef FLEXRAN_AGENT_SB_IF fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); +#endif break; case 5: schedule_RA(module_idP,frameP,subframeP,2); +#ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); +#else + if (mac_agent_registered[module_idP]) { + agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( + module_idP, + frameP, + subframeP, + mbsfn_status, + &msg); + + flexran_apply_dl_scheduling_decisions(module_idP, + frameP, + subframeP, + mbsfn_status, + msg); + flexran_agent_mac_destroy_dl_config(msg); + } +#endif break; case 3: case 4: +#ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); +#else + if (mac_agent_registered[module_idP]) { + agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( + module_idP, + frameP, + subframeP, + mbsfn_status, + &msg); + + flexran_apply_dl_scheduling_decisions(module_idP, + frameP, + subframeP, + mbsfn_status, + msg); + flexran_agent_mac_destroy_dl_config(msg); + } +#endif break; default: @@ -538,8 +774,26 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, } } else { //FDD schedule_ulsch(module_idP,frameP,cooperation_flag,6,0); +#ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); +#else + if (mac_agent_registered[module_idP]) { + agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( + module_idP, + frameP, + subframeP, + mbsfn_status, + &msg); + + flexran_apply_dl_scheduling_decisions(module_idP, + frameP, + subframeP, + mbsfn_status, + msg); + flexran_agent_mac_destroy_dl_config(msg); + } +#endif } break; @@ -553,13 +807,49 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, case 3: case 4: schedule_RA(module_idP,frameP,subframeP,3); // 3 = Msg3 subframeP, not +#ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); +#else + if (mac_agent_registered[module_idP]) { + agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( + module_idP, + frameP, + subframeP, + mbsfn_status, + &msg); + + flexran_apply_dl_scheduling_decisions(module_idP, + frameP, + subframeP, + mbsfn_status, + msg); + flexran_agent_mac_destroy_dl_config(msg); + } +#endif break; case 5: +#ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); +#else + if (mac_agent_registered[module_idP]) { + agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( + module_idP, + frameP, + subframeP, + mbsfn_status, + &msg); + + flexran_apply_dl_scheduling_decisions(module_idP, + frameP, + subframeP, + mbsfn_status, + msg); + flexran_agent_mac_destroy_dl_config(msg); + } +#endif break; default: @@ -567,8 +857,26 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, } } else { //FDD schedule_ulsch(module_idP,frameP,cooperation_flag,7,1); +#ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); +#else + if (mac_agent_registered[module_idP]) { + agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( + module_idP, + frameP, + subframeP, + mbsfn_status, + &msg); + + flexran_apply_dl_scheduling_decisions(module_idP, + frameP, + subframeP, + mbsfn_status, + msg); + flexran_agent_mac_destroy_dl_config(msg); + } +#endif } break; @@ -587,8 +895,26 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, // schedule_RA(module_idP,subframeP); schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,2); +#ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); +#else + if (mac_agent_registered[module_idP]) { + agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( + module_idP, + frameP, + subframeP, + mbsfn_status, + &msg); + + flexran_apply_dl_scheduling_decisions(module_idP, + frameP, + subframeP, + mbsfn_status, + msg); + flexran_agent_mac_destroy_dl_config(msg); + } +#endif break; default: @@ -596,8 +922,26 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, } } else { //FDD schedule_ulsch(module_idP,frameP,cooperation_flag,8,2); +#ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); +#else + if (mac_agent_registered[module_idP]) { + agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( + module_idP, + frameP, + subframeP, + mbsfn_status, + &msg); + + flexran_apply_dl_scheduling_decisions(module_idP, + frameP, + subframeP, + mbsfn_status, + msg); + flexran_agent_mac_destroy_dl_config(msg); + } +#endif } break; @@ -610,29 +954,101 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, case 1: schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3); schedule_RA(module_idP,frameP,subframeP,7); // 7 = Msg3 subframeP, not +#ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); +#else + if (mac_agent_registered[module_idP]) { + agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( + module_idP, + frameP, + subframeP, + mbsfn_status, + &msg); + + flexran_apply_dl_scheduling_decisions(module_idP, + frameP, + subframeP, + mbsfn_status, + msg); + flexran_agent_mac_destroy_dl_config(msg); + } +#endif break; case 3: case 4: schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3); +#ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); +#else + if (mac_agent_registered[module_idP]) { + agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( + module_idP, + frameP, + subframeP, + mbsfn_status, + &msg); + + flexran_apply_dl_scheduling_decisions(module_idP, + frameP, + subframeP, + mbsfn_status, + msg); + flexran_agent_mac_destroy_dl_config(msg); + } +#endif break; case 6: schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,4); //schedule_RA(module_idP,frameP,subframeP); +#ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); +#else + if (mac_agent_registered[module_idP]) { + agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( + module_idP, + frameP, + subframeP, + mbsfn_status, + &msg); + + flexran_apply_dl_scheduling_decisions(module_idP, + frameP, + subframeP, + mbsfn_status, + msg); + flexran_agent_mac_destroy_dl_config(msg); + } +#endif break; case 2: case 5: //schedule_RA(module_idP,frameP,subframeP); +#ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); +#else + if (mac_agent_registered[module_idP]) { + agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( + module_idP, + frameP, + subframeP, + mbsfn_status, + &msg); + + flexran_apply_dl_scheduling_decisions(module_idP, + frameP, + subframeP, + mbsfn_status, + msg); + flexran_agent_mac_destroy_dl_config(msg); + } +#endif break; default: @@ -640,8 +1056,26 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, } } else { //FDD schedule_ulsch(module_idP,frameP,cooperation_flag,9,3); +#ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); +#else + if (mac_agent_registered[module_idP]) { + agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( + module_idP, + frameP, + subframeP, + mbsfn_status, + &msg); + + flexran_apply_dl_scheduling_decisions(module_idP, + frameP, + subframeP, + mbsfn_status, + msg); + flexran_agent_mac_destroy_dl_config(msg); + } +#endif } break; @@ -654,6 +1088,15 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) allocate_CCEs(module_idP,CC_id,subframeP,0); +#if defined(FLEXRAN_AGENT_SB_IF) +#ifndef DISABLE_CONT_STATS + //Send subframe trigger to the controller + if (mac_agent_registered[module_idP]) { + agent_mac_xface[module_idP]->flexran_agent_send_update_mac_stats(module_idP); + } +#endif +#endif + /* int dummy=0; for (i=0; @@ -673,7 +1116,6 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, DCI_pdu[CC_id]->dci_alloc[i].firstCCE, DCI_pdu[CC_id]->num_pdcch_symbols); - LOG_D(MAC,"frameP %d, subframeP %d\n",frameP,subframeP); */ diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index e3af63c9a877b58fa86974631e8170712153ec74..e24281b89aeb985a17310d33cb805df5fd20cb18 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -259,7 +259,8 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un RA_template->RA_dci_fmt1, 1); - RA_template->Msg3_subframe=Msg3_subframe; + /* this will be updated when PHY calls set_msg3_subframe */ + RA_template->Msg3_subframe = -1; } } else if (RA_template->generate_Msg4 == 1) { @@ -663,7 +664,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Checking if Msg4 was acknowledged: \n", module_idP,CC_id,frameP,subframeP); // Get candidate harq_pid from PHY - mac_xface->get_ue_active_harq_pid(module_idP,CC_id,RA_template->rnti,frameP,subframeP,&harq_pid,&round,0); + mac_xface->get_ue_active_harq_pid(module_idP,CC_id,RA_template->rnti,frameP,subframeP,&harq_pid,&round,openair_harq_RA); if (round>0) { //RA_template->wait_ack_Msg4++; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 2107ad0f9a91144c4c922a79e7d97e0684b11f68..ffd9630648d1dd18811f67ee5da965cbd7d14931 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -146,7 +146,7 @@ rnti_t UE_RNTI(module_id_t mod_idP, int ue_idP) return (rnti); } - LOG_E(MAC,"[eNB %d] Couldn't find RNTI for UE %d\n",mod_idP,ue_idP); + LOG_D(MAC,"[eNB %d] Couldn't find RNTI for UE %d\n",mod_idP,ue_idP); //display_backtrace(); return(NOT_A_RNTI); } diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 8ac2094efc31c4fd4c9823d31e3d685b87efb766..c37224fbfb8e54effc0811311719b1ec1e522c0a 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -601,6 +601,29 @@ unsigned char *parse_ulsch_header(unsigned char *mac_header, return(mac_header_ptr); } +/* This function is called by PHY layer when it schedules some + * uplink for a random access message 3. + * The MAC scheduler has to skip the RBs used by this message 3 + * (done below in schedule_ulsch). + */ +void set_msg3_subframe(module_id_t Mod_id, + int CC_id, + int frame, + int subframe, + int rnti, + int Msg3_frame, + int Msg3_subframe) +{ + eNB_MAC_INST *eNB=&eNB_mac_inst[Mod_id]; + int i; + for (i=0; i<NB_RA_PROC_MAX; i++) { + if (eNB->common_channels[CC_id].RA_template[i].RA_active == TRUE && + eNB->common_channels[CC_id].RA_template[i].rnti == rnti) { + eNB->common_channels[CC_id].RA_template[i].Msg3_subframe = Msg3_subframe; + break; + } + } +} void schedule_ulsch(module_id_t module_idP, frame_t frameP, @@ -619,6 +642,7 @@ void schedule_ulsch(module_id_t module_idP, for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { + //leave out first RB for PUCCH first_rb[CC_id] = 1; // UE data info; @@ -637,9 +661,11 @@ void schedule_ulsch(module_id_t module_idP, for (i=0; i<NB_RA_PROC_MAX; i++) { if ((eNB->common_channels[CC_id].RA_template[i].RA_active == TRUE) && (eNB->common_channels[CC_id].RA_template[i].generate_rar == 0) && + (eNB->common_channels[CC_id].RA_template[i].generate_Msg4 == 0) && + (eNB->common_channels[CC_id].RA_template[i].wait_ack_Msg4 == 0) && (eNB->common_channels[CC_id].RA_template[i].Msg3_subframe == sched_subframe)) { - //leave out first RB for PUCCH first_rb[CC_id]++; + eNB->common_channels[CC_id].RA_template[i].Msg3_subframe = -1; break; } } @@ -755,7 +781,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, UE_template = &UE_list->UE_template[CC_id][UE_id]; UE_sched_ctrl = &UE_list->UE_sched_ctrl[UE_id]; - if (mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,frameP,subframeP,&harq_pid,&round,1) == -1 ) { + if (mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,frameP,subframeP,&harq_pid,&round,openair_harq_UL) == -1 ) { LOG_W(MAC,"[eNB %d] Scheduler Frame %d, subframeP %d: candidate harq_pid from PHY for UE %d CC %d RNTI %x\n", module_idP,frameP,subframeP, UE_id, CC_id, rnti); continue; @@ -854,7 +880,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, T(T_ENB_MAC_UE_UL_SCHEDULE, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP), T_INT(harq_pid), T_INT(mcs), T_INT(first_rb[CC_id]), T_INT(rb_table[rb_table_index]), - T_INT(TBS)); + T_INT(TBS), T_INT(ndi)); // bad indices : 20 (40 PRB), 21 (45 PRB), 22 (48 PRB) // increment for next UE allocation diff --git a/openair2/LAYER2/MAC/extern.h b/openair2/LAYER2/MAC/extern.h index 8726cb1349a30255dea182b349e311fad7963251..aed8424561c82690379945bab9309c786f475b3f 100644 --- a/openair2/LAYER2/MAC/extern.h +++ b/openair2/LAYER2/MAC/extern.h @@ -43,12 +43,18 @@ //#include "SIMULATION/simulation_defs.h" #endif //PHY_EMUL #include "PHY_INTERFACE/defs.h" +#include "RRC/LITE/defs.h" extern const uint32_t BSR_TABLE[BSR_TABLE_SIZE]; //extern uint32_t EBSR_Level[63]; +extern const uint32_t Extended_BSR_TABLE[BSR_TABLE_SIZE]; +//extern uint32_t Extended_BSR_TABLE[63]; ----currently not used extern UE_MAC_INST *UE_mac_inst; extern eNB_MAC_INST *eNB_mac_inst; +extern eNB_RRC_INST *eNB_rrc_inst; +extern UE_RRC_INST *UE_rrc_inst; +extern UE_MAC_INST *ue_mac_inst; extern MAC_RLC_XFACE *Mac_rlc_xface; extern uint8_t Is_rrc_registered; diff --git a/openair2/LAYER2/MAC/flexran_agent_mac_proto.h b/openair2/LAYER2/MAC/flexran_agent_mac_proto.h new file mode 100644 index 0000000000000000000000000000000000000000..060e8ab6ca3f2114b4d98ace3b2cafcee58789e2 --- /dev/null +++ b/openair2/LAYER2/MAC/flexran_agent_mac_proto.h @@ -0,0 +1,62 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file flexran_agent_mac_proto.h + * \brief MAC functions for FlexRAN agent + * \author Xenofon Foukas + * \date 2016 + * \email: x.foukas@sms.ed.ac.uk + * \version 0.1 + * @ingroup _mac + + */ + +#ifndef __LAYER2_MAC_FLEXRAN_AGENT_MAC_PROTO_H__ +#define __LAYER2_MAC_FLEXRAN_AGENT_MAC_PROTO_H__ + +#include "flexran_agent_defs.h" +#include "header.pb-c.h" +#include "flexran.pb-c.h" + +/* + * Default scheduler used by the eNB agent + */ +void flexran_schedule_ue_spec_default(mid_t mod_id, uint32_t frame, uint32_t subframe, + int *mbsfn_flag, Protocol__FlexranMessage **dl_info); + +/* + * Data plane function for applying the DL decisions of the scheduler + */ +void flexran_apply_dl_scheduling_decisions(mid_t mod_id, uint32_t frame, uint32_t subframe, int *mbsfn_flag, + const Protocol__FlexranMessage *dl_scheduling_info); + +/* + * Data plane function for applying the UE specific DL decisions of the scheduler + */ +void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, uint32_t frame, uint32_t subframe, int *mbsfn_flag, + uint32_t n_dl_ue_data, const Protocol__FlexDlData **dl_ue_data); + +/* + * Data plane function for filling the DCI structure + */ +void flexran_fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti, const Protocol__FlexDlDci *dl_dci); + +#endif diff --git a/openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c b/openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c new file mode 100644 index 0000000000000000000000000000000000000000..6d3c32a5167b1c4b6ec54eed147c20428fc119c0 --- /dev/null +++ b/openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c @@ -0,0 +1,537 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file flexran_agent_scheduler_dataplane.c + * \brief data plane procedures related to eNB scheduling + * \author Xenofon Foukas + * \date 2016 + * \email: x.foukas@sms.ed.ac.uk + * \version 0.1 + * @ingroup _mac + + */ + +#include "assertions.h" +#include "PHY/defs.h" +#include "PHY/extern.h" + +#include "SCHED/defs.h" +#include "SCHED/extern.h" + +#include "LAYER2/MAC/flexran_agent_mac_proto.h" +#include "LAYER2/MAC/defs.h" +#include "LAYER2/MAC/proto.h" +#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/flexran_dci_conversions.h" + +#include "UTIL/LOG/log.h" +#include "UTIL/LOG/vcd_signal_dumper.h" +#include "UTIL/OPT/opt.h" +#include "OCG.h" +#include "OCG_extern.h" + +#include "RRC/LITE/extern.h" +#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" + +#include "header.pb-c.h" +#include "flexran.pb-c.h" + +#include "SIMULATION/TOOLS/defs.h" // for taus + + +void flexran_apply_dl_scheduling_decisions(mid_t mod_id, + uint32_t frame, + uint32_t subframe, + int *mbsfn_flag, + const Protocol__FlexranMessage *dl_scheduling_info) { + + Protocol__FlexDlMacConfig *mac_config = dl_scheduling_info->dl_mac_config_msg; + + // Check if there is anything to schedule for random access + if (mac_config->n_dl_rar > 0) { + /*TODO: call the random access data plane function*/ + } + + // Check if there is anything to schedule for paging/broadcast + if (mac_config->n_dl_broadcast > 0) { + /*TODO: call the broadcast/paging data plane function*/ + } + + // Check if there is anything to schedule for the UEs + if (mac_config->n_dl_ue_data > 0) { + flexran_apply_ue_spec_scheduling_decisions(mod_id, frame, subframe, mbsfn_flag, + mac_config->n_dl_ue_data, mac_config->dl_ue_data); + } + +} + + +void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, + uint32_t frame, + uint32_t subframe, + int *mbsfn_flag, + uint32_t n_dl_ue_data, + const Protocol__FlexDlData **dl_ue_data) { + + uint8_t CC_id; + int UE_id; + int N_RBG[MAX_NUM_CCs]; + unsigned char aggregation; + mac_rlc_status_resp_t rlc_status; + unsigned char ta_len=0; + unsigned char header_len = 0, header_len_tmp = 0; + unsigned char sdu_lcids[11],offset,num_sdus=0; + uint16_t nb_rb,nb_rb_temp,total_nb_available_rb[MAX_NUM_CCs],nb_available_rb; + uint16_t TBS,j,sdu_lengths[11],rnti,padding=0,post_padding=0; + unsigned char dlsch_buffer[MAX_DLSCH_PAYLOAD_BYTES]; + unsigned char round = 0; + unsigned char harq_pid = 0; + + LTE_eNB_UE_stats *eNB_UE_stats = NULL; + uint16_t sdu_length_total = 0; + int mcs; + uint16_t min_rb_unit[MAX_NUM_CCs]; + short ta_update = 0; + eNB_MAC_INST *eNB = &eNB_mac_inst[mod_id]; + UE_list_t *UE_list = &eNB->UE_list; + LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]; + int32_t normalized_rx_power, target_rx_power; + int32_t tpc=1; + static int32_t tpc_accumulated=0; + UE_sched_ctrl *ue_sched_ctl; + + int last_sdu_header_len = 0; + + int i; + + Protocol__FlexDlData *dl_data; + Protocol__FlexDlDci *dl_dci; + + uint32_t rlc_size, n_lc, lcid; + + + // For each UE-related command + for (i = 0; i < n_dl_ue_data; i++) { + + dl_data = dl_ue_data[i]; + dl_dci = dl_data->dl_dci; + + CC_id = dl_data->serv_cell_index; + frame_parms[CC_id] = mac_xface->get_lte_frame_parms(mod_id, CC_id); + + rnti = dl_data->rnti; + UE_id = find_ue(rnti, PHY_vars_eNB_g[mod_id][CC_id]); + + ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; + eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id,CC_id,rnti); + + round = dl_dci->rv[0]; + harq_pid = dl_dci->harq_process; + + // If this is a new transmission + if (round == 0) { + // First we have to deal with the creation of the PDU based on the message instructions + rlc_status.bytes_in_buffer = 0; + + TBS = dl_dci->tbs_size[0]; + + if (dl_data->n_ce_bitmap > 0) { + //Check if there is TA command and set the length appropriately + ta_len = (dl_data->ce_bitmap[0] & PROTOCOL__FLEX_CE_TYPE__FLPCET_TA) ? 1 : 0; + } + + num_sdus = 0; + sdu_length_total = 0; + + if (ta_len > 0) { + // Reset the measurement + ue_sched_ctl->ta_timer = 20; + eNB_UE_stats->timing_advance_update = 0; + header_len = ta_len; + last_sdu_header_len = ta_len; + } + + n_lc = dl_data->n_rlc_pdu; + // Go through each one of the channel commands and create SDUs + for (i = 0; i < n_lc; i++) { + lcid = dl_data->rlc_pdu[i]->rlc_pdu_tb[0]->logical_channel_id; + rlc_size = dl_data->rlc_pdu[i]->rlc_pdu_tb[0]->size; + LOG_D(MAC,"[TEST] [eNB %d] Frame %d, LCID %d, CC_id %d, Requesting %d bytes from RLC (RRC message)\n", + mod_id, frame, lcid, CC_id, rlc_size); + if (rlc_size > 0) { + + rlc_status = mac_rlc_status_ind(mod_id, + rnti, + mod_id, + frame, + ENB_FLAG_YES, + MBMS_FLAG_NO, + lcid, + 0); + + if (rlc_status.bytes_in_buffer > 0) { + + if (rlc_size <= 2) { + rlc_size = 3; + } + + rlc_status = mac_rlc_status_ind(mod_id, + rnti, + mod_id, + frame, + ENB_FLAG_YES, + MBMS_FLAG_NO, + lcid, + rlc_size); // transport block set size + + sdu_lengths[i] = 0; + + LOG_D(MAC, "[TEST] RLC can give %d bytes for LCID %d during second call\n", rlc_status.bytes_in_buffer, lcid); + + if (rlc_status.bytes_in_buffer > 0) { + + sdu_lengths[i] += mac_rlc_data_req(mod_id, + rnti, + mod_id, + frame, + ENB_FLAG_YES, + MBMS_FLAG_NO, + lcid, + (char *)&dlsch_buffer[sdu_length_total]); + + LOG_D(MAC,"[eNB %d][LCID %d] CC_id %d Got %d bytes from RLC\n",mod_id, lcid, CC_id, sdu_lengths[i]); + sdu_length_total += sdu_lengths[i]; + sdu_lcids[i] = lcid; + + UE_list->eNB_UE_stats[CC_id][UE_id].num_pdu_tx[lcid] += 1; + UE_list->eNB_UE_stats[CC_id][UE_id].num_bytes_tx[lcid] += sdu_lengths[i]; + + if (sdu_lengths[i] <= 128) { + header_len += 2; + last_sdu_header_len = 2; + } else { + header_len += 3; + last_sdu_header_len = 3; + } + num_sdus++; + } + } + } + } // SDU creation end + + + if (((sdu_length_total + header_len) > 0)) { + + // header_len_tmp = header_len; + + // If we have only a single SDU, header length becomes 1 + if ((num_sdus + ta_len) == 1) { + //if (header_len == 2 || header_len == 3) { + header_len = 1; + } else { + header_len = (header_len - last_sdu_header_len) + 1; + } + + // there is a payload + if (((sdu_length_total + header_len) > 0)) { + // If we need a 1 or 2 bit padding or no padding at all + if ((TBS - header_len - sdu_length_total - ta_len) <= 2 + || (TBS - header_len - sdu_length_total - ta_len) > TBS) { //protect from overflow + padding = (TBS - header_len - sdu_length_total - ta_len); + post_padding = 0; + } else { // The last sdu needs to have a length field, since we add padding + padding = 0; + header_len = header_len_tmp; + post_padding = TBS - sdu_length_total - header_len - ta_len - 1; // 1 is for the postpadding header + } + } + + ta_update = (ta_len > 0) ? ue_sched_ctl->ta_update : 0; + + // If there is nothing to schedule, just leave + if ((sdu_length_total) <= 0) { + return; + } + + offset = generate_dlsch_header((unsigned char*)UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0], + num_sdus, //num_sdus + sdu_lengths, // + sdu_lcids, + 255, // no drx + ta_update, // timing advance + NULL, // contention res id + padding, + post_padding); + +#ifdef DEBUG_eNB_SCHEDULER + LOG_T(MAC,"[eNB %d] First 16 bytes of DLSCH : \n"); + + for (i=0; i<16; i++) { + LOG_T(MAC,"%x.",dlsch_buffer[i]); + } + + LOG_T(MAC,"\n"); +#endif + // cycle through SDUs and place in dlsch_buffer + memcpy(&UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0][offset],dlsch_buffer,sdu_length_total); + // memcpy(&eNB_mac_inst[0].DLSCH_pdu[0][0].payload[0][offset],dcch_buffer,sdu_lengths[0]); + + // fill remainder of DLSCH with random data + for (j=0; j<(TBS-sdu_length_total-offset); j++) { + UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0][offset+sdu_length_total+j] = (char)(taus()&0xff); + } + + //eNB_mac_inst[0].DLSCH_pdu[0][0].payload[0][offset+sdu_lengths[0]+j] = (char)(taus()&0xff); + if (opt_enabled == 1) { + trace_pdu(1, (uint8_t *)UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0], + TBS, mod_id, 3, UE_RNTI(mod_id, UE_id), + eNB->subframe,0,0); + LOG_D(OPT,"[eNB %d][DLSCH] CC_id %d Frame %d rnti %x with size %d\n", + mod_id, CC_id, frame, UE_RNTI(mod_id,UE_id), TBS); + } + + // store stats + eNB->eNB_stats[CC_id].dlsch_bytes_tx+=sdu_length_total; + eNB->eNB_stats[CC_id].dlsch_pdus_tx+=1; + UE_list->eNB_UE_stats[CC_id][UE_id].dl_cqi= eNB_UE_stats->DL_cqi[0]; + + UE_list->eNB_UE_stats[CC_id][UE_id].crnti= rnti; + UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status=mac_eNB_get_rrc_status(mod_id, rnti); + UE_list->eNB_UE_stats[CC_id][UE_id].harq_pid = harq_pid; + UE_list->eNB_UE_stats[CC_id][UE_id].harq_round = round; + + //nb_rb = UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid]; + //Find the number of resource blocks and set them to the template for retransmissions + nb_rb = get_min_rb_unit(mod_id, CC_id); + uint16_t stats_tbs = mac_xface->get_TBS_DL(dl_dci->mcs[0], nb_rb); + + while (stats_tbs < TBS) { + nb_rb += get_min_rb_unit(mod_id, CC_id); + stats_tbs = mac_xface->get_TBS_DL(dl_dci->mcs[0], nb_rb); + } + + UE_list->eNB_UE_stats[CC_id][UE_id].rbs_used = nb_rb; + UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used += nb_rb; + UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs1=dl_dci->mcs[0]; + UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs2=dl_dci->mcs[0]; + UE_list->eNB_UE_stats[CC_id][UE_id].TBS = TBS; + + UE_list->eNB_UE_stats[CC_id][UE_id].overhead_bytes= TBS - sdu_length_total; + UE_list->eNB_UE_stats[CC_id][UE_id].total_sdu_bytes+= sdu_length_total; + UE_list->eNB_UE_stats[CC_id][UE_id].total_pdu_bytes+= TBS; + UE_list->eNB_UE_stats[CC_id][UE_id].total_num_pdus+=1; + + //eNB_UE_stats->dlsch_mcs1 = cqi_to_mcs[eNB_UE_stats->DL_cqi[0]]; + //eNB_UE_stats->dlsch_mcs1 = cmin(eNB_UE_stats->dlsch_mcs1, openair_daq_vars.target_ue_dl_mcs); + } + } else { + // No need to create anything apart of DCI in case of retransmission + + /*TODO: Must add these */ + // eNB_UE_stats->dlsch_trials[round]++; + //UE_list->eNB_UE_stats[CC_id][UE_id].num_retransmission+=1; + //UE_list->eNB_UE_stats[CC_id][UE_id].rbs_used_retx=nb_rb; + //UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used_retx+=nb_rb; + //UE_list->eNB_UE_stats[CC_id][UE_id].ncce_used_retx=nCCECC_id]; + } + + UE_list->UE_template[CC_id][UE_id].oldNDI[dl_dci->harq_process] = dl_dci->ndi[0]; + eNB_UE_stats->dlsch_mcs1 = dl_dci->mcs[0]; + + //Fill the proper DCI of OAI + fill_oai_dci(mod_id, CC_id, rnti, dl_dci); + } +} + +void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti, + const Protocol__FlexDlDci *dl_dci) { + + void *DLSCH_dci = NULL; + DCI_PDU *DCI_pdu; + + unsigned char round = 0; + unsigned char harq_pid = 0; + LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]; + int size_bits, size_bytes; + eNB_MAC_INST *eNB = &eNB_mac_inst[mod_id]; + UE_list_t *UE_list = &eNB->UE_list; + LTE_eNB_UE_stats *eNB_UE_stats = NULL; + + int UE_id = find_ue(rnti, PHY_vars_eNB_g[mod_id][CC_id]); + + uint32_t format; + + harq_pid = dl_dci->harq_process; + round = dl_dci->rv[0]; + + // Note this code is for a specific DCI format + DLSCH_dci = (void *)UE_list->UE_template[CC_id][UE_id].DLSCH_DCI[harq_pid]; + DCI_pdu = &eNB->common_channels[CC_id].DCI_pdu; + + frame_parms[CC_id] = mac_xface->get_lte_frame_parms(mod_id, CC_id); + + if (dl_dci->has_tpc == 1) { + // Check if tpc has been set and reset measurement */ + if ((dl_dci->tpc == 0) || (dl_dci->tpc == 2)) { + eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id, CC_id, rnti); + eNB_UE_stats->Po_PUCCH_update = 0; + } + } + + + switch (frame_parms[CC_id]->N_RB_DL) { + case 6: + if (frame_parms[CC_id]->frame_type == TDD) { + if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1) { + FILL_DCI_TDD_1(DCI1_1_5MHz_TDD_t, DLSCH_dci, dl_dci); + size_bytes = sizeof(DCI1_1_5MHz_TDD_t); + size_bits = sizeof_DCI1_1_5MHz_TDD_t; + } else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_2A) { + //TODO + } else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1D) { + //TODO + } + } else { + if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1) { + FILL_DCI_FDD_1(DCI1_1_5MHz_FDD_t, DLSCH_dci, dl_dci); + size_bytes = sizeof(DCI1_1_5MHz_FDD_t); + size_bits = sizeof_DCI1_1_5MHz_FDD_t; + } else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_2A) { + //TODO + } else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1D) { + //TODO + } + } + break; + case 25: + if (frame_parms[CC_id]->frame_type == TDD) { + if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1) { + FILL_DCI_TDD_1(DCI1_5MHz_TDD_t, DLSCH_dci, dl_dci); + size_bytes = sizeof(DCI1_5MHz_TDD_t); + size_bits = sizeof_DCI1_5MHz_TDD_t; + } else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_2A) { + //TODO + } else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1D) { + //TODO + } + } else { + if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1) { + FILL_DCI_FDD_1(DCI1_5MHz_FDD_t, DLSCH_dci, dl_dci); + size_bytes = sizeof(DCI1_5MHz_FDD_t); + size_bits = sizeof_DCI1_5MHz_FDD_t; + } else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_2A) { + //TODO + } else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1D) { + //TODO + } + } + break; + case 50: + if (frame_parms[CC_id]->frame_type == TDD) { + if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1) { + FILL_DCI_TDD_1(DCI1_10MHz_TDD_t, DLSCH_dci, dl_dci); + size_bytes = sizeof(DCI1_10MHz_TDD_t); + size_bits = sizeof_DCI1_10MHz_TDD_t; + } else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_2A) { + //TODO + } else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1D) { + //TODO + } + } else { + if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1) { + FILL_DCI_FDD_1(DCI1_10MHz_FDD_t, DLSCH_dci, dl_dci); + size_bytes = sizeof(DCI1_10MHz_FDD_t); + size_bits = sizeof_DCI1_10MHz_FDD_t; + } else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_2A) { + //TODO + } else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1D) { + //TODO + } + } + break; + case 100: + if (frame_parms[CC_id]->frame_type == TDD) { + if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1) { + FILL_DCI_TDD_1(DCI1_20MHz_TDD_t, DLSCH_dci, dl_dci); + size_bytes = sizeof(DCI1_20MHz_TDD_t); + size_bits = sizeof_DCI1_20MHz_TDD_t; + } else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_2A) { + //TODO + } else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1D) { + //TODO + } + } else { + if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1) { + FILL_DCI_FDD_1(DCI1_20MHz_FDD_t, DLSCH_dci, dl_dci); + size_bytes = sizeof(DCI1_20MHz_FDD_t); + size_bits = sizeof_DCI1_20MHz_FDD_t; + } else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_2A) { + //TODO + } else if (dl_dci->format == PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1D) { + //TODO + } + } + break; + } + + //Set format to the proper type + switch(dl_dci->format) { + case PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1: + format = format1; + break; + case PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1A: + format = format1A; + break; + case PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1B: + format = format1B; + break; + case PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1C: + format = format1C; + break; + case PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1D: + format = format1E_2A_M10PRB; + break; + case PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_2: + format = format2; + break; + case PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_2A: + format = format2A; + break; + case PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_2B: + format = format2B; + break; + case PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_3: + format = 3; + break; + default: + /*TODO: Need to deal with unsupported DCI type*/ + return; + } + + add_ue_spec_dci(DCI_pdu, + DLSCH_dci, + rnti, + size_bytes, + dl_dci->aggr_level, + size_bits, + format, + 0); +} diff --git a/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c b/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c new file mode 100644 index 0000000000000000000000000000000000000000..8975465e77b11ade441f6da867c9621c4048cbe8 --- /dev/null +++ b/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c @@ -0,0 +1,1391 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file flexran_agent_scheduler_dlsch_ue.c + * \brief procedures related to eNB for the DLSCH transport channel + * \author Xenofon Foukas, Navid Nikaein and Raymond Knopp + * \date 2016 + * \email: x.foukas@sms.ed.ac.uk + * \version 0.1 + * @ingroup _mac + + */ + +#include "assertions.h" +#include "PHY/defs.h" +#include "PHY/extern.h" + +#include "SCHED/defs.h" +#include "SCHED/extern.h" + +#include "LAYER2/MAC/flexran_agent_mac_proto.h" +#include "LAYER2/MAC/defs.h" +#include "LAYER2/MAC/proto.h" +#include "LAYER2/MAC/extern.h" +#include "UTIL/LOG/log.h" +#include "UTIL/LOG/vcd_signal_dumper.h" +#include "UTIL/OPT/opt.h" +#include "OCG.h" +#include "OCG_extern.h" + +#include "RRC/LITE/extern.h" +#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" + +#include "ENB_APP/flexran_agent_defs.h" + +#include "pdcp.h" + +#include "header.pb-c.h" +#include "flexran.pb-c.h" +#include "flexran_agent_mac.h" + +#include "SIMULATION/TOOLS/defs.h" // for taus + +#if defined(ENABLE_ITTI) +# include "intertask_interface.h" +#endif + +#define ENABLE_MAC_PAYLOAD_DEBUG + + +//------------------------------------------------------------------------------ +void +flexran_schedule_ue_spec_default(mid_t mod_id, + uint32_t frame, + uint32_t subframe, + int *mbsfn_flag, + Protocol__FlexranMessage **dl_info) +//------------------------------------------------------------------------------ +{ + uint8_t CC_id; + int UE_id; + int N_RBG[MAX_NUM_CCs]; + unsigned char aggregation; + mac_rlc_status_resp_t rlc_status; + unsigned char header_len = 0, header_len_tmp = 0, ta_len = 0; + uint16_t nb_rb, nb_rb_temp, total_nb_available_rb[MAX_NUM_CCs], nb_available_rb; + uint16_t TBS, j, rnti, padding=0, post_padding=0; + unsigned char round = 0; + unsigned char harq_pid = 0; + void *DLSCH_dci = NULL; + uint16_t sdu_length_total = 0; + int mcs, mcs_tmp; + uint16_t min_rb_unit[MAX_NUM_CCs]; + eNB_MAC_INST *eNB = &eNB_mac_inst[mod_id]; + /* TODO: Must move the helper structs to scheduler implementation */ + UE_list_t *UE_list = &eNB->UE_list; + int32_t normalized_rx_power, target_rx_power; + int32_t tpc = 1; + static int32_t tpc_accumulated=0; + UE_sched_ctrl *ue_sched_ctl; + + Protocol__FlexDlData *dl_data[NUM_MAX_UE]; + int num_ues_added = 0; + int channels_added = 0; + + Protocol__FlexDlDci *dl_dci; + Protocol__FlexRlcPdu *rlc_pdus[11]; + uint32_t *ce_bitmap; + Protocol__FlexRlcPdu **rlc_pdu; + int num_tb; + uint32_t ce_flags = 0; + + uint8_t rballoc_sub[25]; + int i; + uint32_t data_to_request; + uint32_t dci_tbs; + uint8_t ue_has_transmission = 0; + uint32_t ndi; + + flexran_agent_mac_create_empty_dl_config(mod_id, dl_info); + + if (UE_list->head==-1) { + return; + } + + start_meas(&eNB->schedule_dlsch); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SCHEDULE_DLSCH,VCD_FUNCTION_IN); + + //weight = get_ue_weight(module_idP,UE_id); + aggregation = 2; // set to the maximum aggregation level + + for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { + min_rb_unit[CC_id] = get_min_rb_unit(mod_id, CC_id); + // get number of PRBs less those used by common channels + total_nb_available_rb[CC_id] = flexran_get_N_RB_DL(mod_id, CC_id); + for (i=0;i < flexran_get_N_RB_DL(mod_id, CC_id); i++) + if (eNB->common_channels[CC_id].vrb_map[i] != 0) + total_nb_available_rb[CC_id]--; + + N_RBG[CC_id] = flexran_get_N_RBG(mod_id, CC_id); + + // store the global enb stats: + eNB->eNB_stats[CC_id].num_dlactive_UEs = UE_list->num_UEs; + eNB->eNB_stats[CC_id].available_prbs = total_nb_available_rb[CC_id]; + eNB->eNB_stats[CC_id].total_available_prbs += total_nb_available_rb[CC_id]; + eNB->eNB_stats[CC_id].dlsch_bytes_tx=0; + eNB->eNB_stats[CC_id].dlsch_pdus_tx=0; + } + + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_PREPROCESSOR,VCD_FUNCTION_IN); + + start_meas(&eNB->schedule_dlsch_preprocessor); + _dlsch_scheduler_pre_processor(mod_id, + frame, + subframe, + N_RBG, + mbsfn_flag); + stop_meas(&eNB->schedule_dlsch_preprocessor); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_PREPROCESSOR,VCD_FUNCTION_OUT); + + for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { + LOG_D(MAC, "doing schedule_ue_spec for CC_id %d\n",CC_id); + + if (mbsfn_flag[CC_id]>0) + continue; + + for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) { + rnti = flexran_get_ue_crnti(mod_id, UE_id); + ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; + + if (rnti==NOT_A_RNTI) { + LOG_D(MAC,"Cannot find rnti for UE_id %d (num_UEs %d)\n", UE_id,UE_list->num_UEs); + // mac_xface->macphy_exit("Cannot find rnti for UE_id"); + continue; + } + + if (flexran_get_ue_crnti(mod_id, UE_id) == NOT_A_RNTI) { + LOG_D(MAC,"[eNB] Cannot find UE\n"); + // mac_xface->macphy_exit("[MAC][eNB] Cannot find eNB_UE_stats\n"); + continue; + } + + if ((ue_sched_ctl->pre_nb_available_rbs[CC_id] == 0) || // no RBs allocated + CCE_allocation_infeasible(mod_id, CC_id, 0, subframe, aggregation, rnti)) { + LOG_D(MAC,"[eNB %d] Frame %d : no RB allocated for UE %d on CC_id %d: continue \n", + mod_id, frame, UE_id, CC_id); + //if(mac_xface->get_transmission_mode(module_idP,rnti)==5) + continue; //to next user (there might be rbs availiable for other UEs in TM5 + // else + // break; + } + + if (flexran_get_duplex_mode(mod_id, CC_id) == PROTOCOL__FLEX_DUPLEX_MODE__FLDM_TDD) { + set_ue_dai (subframe, + flexran_get_subframe_assignment(mod_id, CC_id), + UE_id, + CC_id, + UE_list); + //TODO: update UL DAI after DLSCH scheduling + //set_ul_DAI(mod_id, UE_id, CC_id, frame, subframe,frame_parms); + } + + channels_added = 0; + + // After this point all the UEs will be scheduled + dl_data[num_ues_added] = (Protocol__FlexDlData *) malloc(sizeof(Protocol__FlexDlData)); + protocol__flex_dl_data__init(dl_data[num_ues_added]); + dl_data[num_ues_added]->has_rnti = 1; + dl_data[num_ues_added]->rnti = rnti; + dl_data[num_ues_added]->n_rlc_pdu = 0; + dl_data[num_ues_added]->has_serv_cell_index = 1; + dl_data[num_ues_added]->serv_cell_index = CC_id; + + nb_available_rb = ue_sched_ctl->pre_nb_available_rbs[CC_id]; + flexran_get_harq(mod_id, CC_id, UE_id, frame, subframe, &harq_pid, &round); + sdu_length_total=0; + mcs = cqi_to_mcs[flexran_get_ue_wcqi(mod_id, UE_id)]; + +#ifdef EXMIMO + + if (mac_xface->get_transmission_mode(mod_id, CC_id, rnti) == 5) { + mcs = cqi_to_mcs[flexran_get_ue_wcqi(mod_id, UE_id)]; + mcs = cmin(mcs,16); + } + +#endif + + // initializing the rb allocation indicator for each UE + for(j = 0; j < flexran_get_N_RBG(mod_id, CC_id); j++) { + UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][j] = 0; + rballoc_sub[j] = 0; + } + + /* LOG_D(MAC,"[eNB %d] Frame %d: Scheduling UE %d on CC_id %d (rnti %x, harq_pid %d, round %d, rb %d, cqi %d, mcs %d, rrc %d)\n", */ + /* mod_id, frame, UE_id, CC_id, rnti, harq_pid, round, nb_available_rb, */ + /* eNB_UE_stats->DL_cqi[0], mcs, */ + /* UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status); */ + + dl_dci = (Protocol__FlexDlDci*) malloc(sizeof(Protocol__FlexDlDci)); + protocol__flex_dl_dci__init(dl_dci); + dl_data[num_ues_added]->dl_dci = dl_dci; + + + dl_dci->has_rnti = 1; + dl_dci->rnti = rnti; + dl_dci->has_harq_process = 1; + dl_dci->harq_process = harq_pid; + + /* process retransmission */ + + if (round > 0) { + + if (flexran_get_duplex_mode(mod_id, CC_id) == PROTOCOL__FLEX_DUPLEX_MODE__FLDM_TDD) { + UE_list->UE_template[CC_id][UE_id].DAI++; + update_ul_dci(mod_id, CC_id, rnti, UE_list->UE_template[CC_id][UE_id].DAI); + LOG_D(MAC,"DAI update: CC_id %d subframeP %d: UE %d, DAI %d\n", + CC_id, subframe,UE_id,UE_list->UE_template[CC_id][UE_id].DAI); + } + + mcs = UE_list->UE_template[CC_id][UE_id].mcs[harq_pid]; + + // get freq_allocation + nb_rb = UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid]; + + /*TODO: Must add this to FlexRAN agent API */ + dci_tbs = mac_xface->get_TBS_DL(mcs, nb_rb); + + if (nb_rb <= nb_available_rb) { + + if(nb_rb == ue_sched_ctl->pre_nb_available_rbs[CC_id]) { + for(j = 0; j < flexran_get_N_RBG(mod_id, CC_id); j++) { // for indicating the rballoc for each sub-band + UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][j] = ue_sched_ctl->rballoc_sub_UE[CC_id][j]; + } + } else { + nb_rb_temp = nb_rb; + j = 0; + + while((nb_rb_temp > 0) && (j < flexran_get_N_RBG(mod_id, CC_id))) { + if(ue_sched_ctl->rballoc_sub_UE[CC_id][j] == 1) { + UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][j] = ue_sched_ctl->rballoc_sub_UE[CC_id][j]; + + if((j == flexran_get_N_RBG(mod_id, CC_id) - 1) && + ((flexran_get_N_RB_DL(mod_id, CC_id) == 25)|| + (flexran_get_N_RB_DL(mod_id, CC_id) == 50))) { + nb_rb_temp = nb_rb_temp - min_rb_unit[CC_id]+1; + } else { + nb_rb_temp = nb_rb_temp - min_rb_unit[CC_id]; + } + } + j = j + 1; + } + } + + nb_available_rb -= nb_rb; + aggregation = process_ue_cqi(mod_id, UE_id); + + PHY_vars_eNB_g[mod_id][CC_id]->mu_mimo_mode[UE_id].pre_nb_available_rbs = nb_rb; + PHY_vars_eNB_g[mod_id][CC_id]->mu_mimo_mode[UE_id].dl_pow_off = ue_sched_ctl->dl_pow_off[CC_id]; + + for(j=0; j < flexran_get_N_RBG(mod_id, CC_id); j++) { + PHY_vars_eNB_g[mod_id][CC_id]->mu_mimo_mode[UE_id].rballoc_sub[j] = UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][j]; + rballoc_sub[j] = UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][j]; + } + + // Keep the old NDI, do not toggle + ndi = UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid]; + tpc = UE_list->UE_template[CC_id][UE_id].oldTPC[harq_pid]; + UE_list->UE_template[CC_id][UE_id].mcs[harq_pid] = mcs; + + ue_has_transmission = 1; + num_ues_added++; + } else { + LOG_D(MAC,"[eNB %d] Frame %d CC_id %d : don't schedule UE %d, its retransmission takes more resources than we have\n", + mod_id, frame, CC_id, UE_id); + ue_has_transmission = 0; + } + //End of retransmission + } else { /* This is a potentially new SDU opportunity */ + rlc_status.bytes_in_buffer = 0; + // Now check RLC information to compute number of required RBs + // get maximum TBS size for RLC request + //TBS = mac_xface->get_TBS(eNB_UE_stats->DL_cqi[0]<<1,nb_available_rb); + TBS = mac_xface->get_TBS_DL(mcs, nb_available_rb); + dci_tbs = TBS; + + // check first for RLC data on DCCH + // add the length for all the control elements (timing adv, drx, etc) : header + payload + + ta_len = (ue_sched_ctl->ta_update!=0) ? 2 : 0; + + dl_data[num_ues_added]->n_ce_bitmap = 2; + dl_data[num_ues_added]->ce_bitmap = (uint32_t *) malloc(sizeof(uint32_t) * 2); + + if (ta_len > 0) { + ce_flags |= PROTOCOL__FLEX_CE_TYPE__FLPCET_TA; + } + + /*TODO: Add other flags if DRX and other CE are required*/ + + // Add the control element flags to the flexran message + dl_data[num_ues_added]->ce_bitmap[0] = ce_flags; + dl_data[num_ues_added]->ce_bitmap[1] = ce_flags; + + // TODO : Need to prioritize DRBs + // Loop through the UE logical channels (DCCH, DCCH1, DTCH for now) + for (j = 1; j < NB_RB_MAX; j++) { + header_len+=3; + + // Need to see if we have space for data from this channel + if (dci_tbs - ta_len - header_len - sdu_length_total > 0) { + LOG_D(MAC, "[TEST]Requested %d bytes from RLC buffer on channel %d during first call\n", dci_tbs-ta_len-header_len); + //If we have space, we need to see how much data we can request at most (if any available) + rlc_status = mac_rlc_status_ind(mod_id, + rnti, + mod_id, + frame, + ENB_FLAG_YES, + MBMS_FLAG_NO, + j, + (dci_tbs-ta_len-header_len)); // transport block set size + + //If data are available in channel j + if (rlc_status.bytes_in_buffer > 0) { + LOG_D(MAC, "[TEST]Have %d bytes in DCCH buffer during first call\n", rlc_status.bytes_in_buffer); + //Fill in as much as possible + data_to_request = cmin(dci_tbs-ta_len-header_len, rlc_status.bytes_in_buffer); + if (data_to_request < 128) { //The header will be one byte less + header_len--; + } + /* if (j == 1 || j == 2) { */ + /* data_to_request+=0; + /* } */ + LOG_D(MAC, "[TEST]Will request %d from channel %d\n", data_to_request, j); + rlc_pdus[channels_added] = (Protocol__FlexRlcPdu *) malloc(sizeof(Protocol__FlexRlcPdu)); + protocol__flex_rlc_pdu__init(rlc_pdus[channels_added]); + rlc_pdus[channels_added]->n_rlc_pdu_tb = 2; + rlc_pdus[channels_added]->rlc_pdu_tb = (Protocol__FlexRlcPduTb **) malloc(sizeof(Protocol__FlexRlcPduTb *) * 2); + rlc_pdus[channels_added]->rlc_pdu_tb[0] = (Protocol__FlexRlcPduTb *) malloc(sizeof(Protocol__FlexRlcPduTb)); + protocol__flex_rlc_pdu_tb__init(rlc_pdus[channels_added]->rlc_pdu_tb[0]); + rlc_pdus[channels_added]->rlc_pdu_tb[0]->has_logical_channel_id = 1; + rlc_pdus[channels_added]->rlc_pdu_tb[0]->logical_channel_id = j; + rlc_pdus[channels_added]->rlc_pdu_tb[0]->has_size = 1; + rlc_pdus[channels_added]->rlc_pdu_tb[0]->size = data_to_request; + rlc_pdus[channels_added]->rlc_pdu_tb[1] = (Protocol__FlexRlcPduTb *) malloc(sizeof(Protocol__FlexRlcPduTb)); + protocol__flex_rlc_pdu_tb__init(rlc_pdus[channels_added]->rlc_pdu_tb[1]); + rlc_pdus[channels_added]->rlc_pdu_tb[1]->has_logical_channel_id = 1; + rlc_pdus[channels_added]->rlc_pdu_tb[1]->logical_channel_id = j; + rlc_pdus[channels_added]->rlc_pdu_tb[1]->has_size = 1; + rlc_pdus[channels_added]->rlc_pdu_tb[1]->size = data_to_request; + dl_data[num_ues_added]->n_rlc_pdu++; + channels_added++; + //Set this to the max value that we might request + sdu_length_total += data_to_request; + } else { + //Take back the assumption of a header for this channel + header_len -= 3; + } //End rlc_status.bytes_in_buffer <= 0 + } //end of if dci_tbs - ta_len - header_len > 0 + } // End of iterating the logical channels + + // Add rlc_pdus to the dl_data message + dl_data[num_ues_added]->rlc_pdu = (Protocol__FlexRlcPdu **) malloc(sizeof(Protocol__FlexRlcPdu *) * + dl_data[num_ues_added]->n_rlc_pdu); + for (i = 0; i < dl_data[num_ues_added]->n_rlc_pdu; i++) { + dl_data[num_ues_added]->rlc_pdu[i] = rlc_pdus[i]; + } + + // there is a payload + if (( dl_data[num_ues_added]->n_rlc_pdu > 0)) { + // Now compute number of required RBs for total sdu length + // Assume RAH format 2 + // adjust header lengths + header_len_tmp = header_len; + + if (header_len == 2 || header_len == 3) { //Only one SDU, remove length field + header_len = 1; + } else { //Remove length field from the last SDU + header_len--; + } + + mcs_tmp = mcs; + if (mcs_tmp == 0) { + nb_rb = 4; // don't let the TBS get too small + } else { + nb_rb=min_rb_unit[CC_id]; + } + + LOG_D(MAC,"[TEST]The initial number of resource blocks was %d\n", nb_rb); + LOG_D(MAC,"[TEST] The initial mcs was %d\n", mcs_tmp); + + TBS = mac_xface->get_TBS_DL(mcs_tmp, nb_rb); + LOG_D(MAC,"[TEST]The TBS during rate matching was %d\n", TBS); + + while (TBS < (sdu_length_total + header_len + ta_len)) { + nb_rb += min_rb_unit[CC_id]; // + LOG_D(MAC, "[TEST]Had to increase the number of RBs\n"); + if (nb_rb > nb_available_rb) { // if we've gone beyond the maximum number of RBs + // (can happen if N_RB_DL is odd) + TBS = mac_xface->get_TBS_DL(mcs_tmp, nb_available_rb); + nb_rb = nb_available_rb; + break; + } + + TBS = mac_xface->get_TBS_DL(mcs_tmp, nb_rb); + } + + if(nb_rb == ue_sched_ctl->pre_nb_available_rbs[CC_id]) { + LOG_D(MAC, "[TEST]We had the exact number of rbs. Time to fill the rballoc subband\n"); + for(j = 0; j < flexran_get_N_RBG(mod_id, CC_id); j++) { // for indicating the rballoc for each sub-band + UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][j] = ue_sched_ctl->rballoc_sub_UE[CC_id][j]; + } + } else { + nb_rb_temp = nb_rb; + j = 0; + LOG_D(MAC, "[TEST]Will only partially fill the bitmap\n"); + while((nb_rb_temp > 0) && (j < flexran_get_N_RBG(mod_id, CC_id))) { + if(ue_sched_ctl->rballoc_sub_UE[CC_id][j] == 1) { + UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][j] = ue_sched_ctl->rballoc_sub_UE[CC_id][j]; + if ((j == flexran_get_N_RBG(mod_id, CC_id) - 1) && + ((flexran_get_N_RB_DL(mod_id, CC_id) == 25)|| + (flexran_get_N_RB_DL(mod_id, CC_id) == 50))) { + nb_rb_temp = nb_rb_temp - min_rb_unit[CC_id] + 1; + } else { + nb_rb_temp = nb_rb_temp - min_rb_unit[CC_id]; + } + } + j = j+1; + } + } + + PHY_vars_eNB_g[mod_id][CC_id]->mu_mimo_mode[UE_id].pre_nb_available_rbs = nb_rb; + PHY_vars_eNB_g[mod_id][CC_id]->mu_mimo_mode[UE_id].dl_pow_off = ue_sched_ctl->dl_pow_off[CC_id]; + + for(j = 0; j < flexran_get_N_RBG(mod_id, CC_id); j++) { + PHY_vars_eNB_g[mod_id][CC_id]->mu_mimo_mode[UE_id].rballoc_sub[j] = UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][j]; + } + + // decrease mcs until TBS falls below required length + while ((TBS > (sdu_length_total + header_len + ta_len)) && (mcs_tmp > 0)) { + mcs_tmp--; + TBS = mac_xface->get_TBS_DL(mcs_tmp, nb_rb); + } + + // if we have decreased too much or we don't have enough RBs, increase MCS + while ((TBS < (sdu_length_total + header_len + ta_len)) && + ((( ue_sched_ctl->dl_pow_off[CC_id] > 0) && (mcs_tmp < 28)) || ( (ue_sched_ctl->dl_pow_off[CC_id]==0) && (mcs_tmp <= 15)))) { + mcs_tmp++; + TBS = mac_xface->get_TBS_DL(mcs_tmp, nb_rb); + } + + dci_tbs = TBS; + mcs = mcs_tmp; + + aggregation = process_ue_cqi(mod_id,UE_id); + dl_dci->has_aggr_level = 1; + dl_dci->aggr_level = aggregation; + + UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid] = nb_rb; + + if (flexran_get_duplex_mode(mod_id, CC_id) == PROTOCOL__FLEX_DUPLEX_MODE__FLDM_TDD) { + UE_list->UE_template[CC_id][UE_id].DAI++; + // printf("DAI update: subframeP %d: UE %d, DAI %d\n",subframeP,UE_id,UE_list->UE_template[CC_id][UE_id].DAI); + //#warning only for 5MHz channel + update_ul_dci(mod_id, CC_id, rnti, UE_list->UE_template[CC_id][UE_id].DAI); + } + + // do PUCCH power control + // this is the normalized RX power + normalized_rx_power = flexran_get_p0_pucch_dbm(mod_id,UE_id, CC_id); //eNB_UE_stats->Po_PUCCH_dBm; + target_rx_power = flexran_get_p0_nominal_pucch(mod_id, CC_id) + 10; //mac_xface->get_target_pucch_rx_power(mod_id, CC_id) + 10; + + // this assumes accumulated tpc + // make sure that we are only sending a tpc update once a frame, otherwise the control loop will freak out + int32_t framex10psubframe = UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_frame*10+UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_subframe; + + if (((framex10psubframe+10)<=(frame*10+subframe)) || //normal case + ((framex10psubframe>(frame*10+subframe)) && (((10240-framex10psubframe+frame*10+subframe)>=10)))) //frame wrap-around + if (flexran_get_p0_pucch_status(mod_id, UE_id, CC_id) == 1) { + flexran_update_p0_pucch(mod_id, UE_id, CC_id); + + UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_frame = frame; + UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_subframe = subframe; + if (normalized_rx_power>(target_rx_power+1)) { + tpc = 0; //-1 + tpc_accumulated--; + } else if (normalized_rx_power<(target_rx_power-1)) { + tpc = 2; //+1 + tpc_accumulated++; + } else { + tpc = 1; //0 + } + LOG_D(MAC,"[eNB %d] DLSCH scheduler: frame %d, subframe %d, harq_pid %d, tpc %d, accumulated %d, normalized/target rx power %d/%d\n", + mod_id, frame, subframe, harq_pid, tpc, + tpc_accumulated, normalized_rx_power, target_rx_power); + } // Po_PUCCH has been updated + else { + tpc = 1; //0 + } // time to do TPC update + else { + tpc = 1; //0 + } + + for(i=0; i<PHY_vars_eNB_g[mod_id][CC_id]->frame_parms.N_RBG; i++) { + rballoc_sub[i] = UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][i]; + } + + // Toggle NDI + LOG_D(MAC,"CC_id %d Frame %d, subframeP %d: Toggling Format1 NDI for UE %d (rnti %x/%d) oldNDI %d\n", + CC_id, frame, subframe, UE_id, + UE_list->UE_template[CC_id][UE_id].rnti,harq_pid, UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid]); + UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid]= 1 - UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid]; + ndi = UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid]; + + UE_list->UE_template[CC_id][UE_id].mcs[harq_pid] = mcs; + UE_list->UE_template[CC_id][UE_id].oldTPC[harq_pid] = tpc; + + // Increase the pointer for the number of scheduled UEs + num_ues_added++; + ue_has_transmission = 1; + } else { // There is no data from RLC or MAC header, so don't schedule + ue_has_transmission = 0; + } + } // End of new scheduling + + // If we has transmission or retransmission + if (ue_has_transmission) { + switch (mac_xface->get_transmission_mode(mod_id, CC_id, rnti)) { + case 1: + case 2: + default: + dl_dci->has_res_alloc = 1; + dl_dci->res_alloc = 0; + dl_dci->has_vrb_format = 1; + dl_dci->vrb_format = PROTOCOL__FLEX_VRB_FORMAT__FLVRBF_LOCALIZED; + dl_dci->has_format = 1; + dl_dci->format = PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1; + dl_dci->has_rb_bitmap = 1; + dl_dci->rb_bitmap = allocate_prbs_sub(nb_rb, rballoc_sub); + dl_dci->has_rb_shift = 1; + dl_dci->rb_shift = 0; + dl_dci->n_ndi = 1; + dl_dci->ndi = (uint32_t *) malloc(sizeof(uint32_t) * dl_dci->n_ndi); + dl_dci->ndi[0] = ndi; + dl_dci->n_rv = 1; + dl_dci->rv = (uint32_t *) malloc(sizeof(uint32_t) * dl_dci->n_rv); + dl_dci->rv[0] = round & 3; + dl_dci->has_tpc = 1; + dl_dci->tpc = tpc; + dl_dci->n_mcs = 1; + dl_dci->mcs = (uint32_t *) malloc(sizeof(uint32_t) * dl_dci->n_mcs); + dl_dci->mcs[0] = mcs; + dl_dci->n_tbs_size = 1; + dl_dci->tbs_size = (uint32_t *) malloc(sizeof(uint32_t) * dl_dci->n_tbs_size); + dl_dci->tbs_size[0] = dci_tbs; + if (flexran_get_duplex_mode(mod_id, CC_id) == PROTOCOL__FLEX_DUPLEX_MODE__FLDM_TDD) { + dl_dci->has_dai = 1; + dl_dci->dai = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3; + } + break; + case 3: + dl_dci->has_res_alloc = 1; + dl_dci->res_alloc = 0; + dl_dci->has_vrb_format = 1; + dl_dci->vrb_format = PROTOCOL__FLEX_VRB_FORMAT__FLVRBF_LOCALIZED; + dl_dci->has_format = 1; + dl_dci->format = PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_2A; + dl_dci->has_rb_bitmap = 1; + dl_dci->rb_bitmap = allocate_prbs_sub(nb_rb, rballoc_sub); + dl_dci->has_rb_shift = 1; + dl_dci->rb_shift = 0; + dl_dci->n_ndi = 2; + dl_dci->ndi = (uint32_t *) malloc(sizeof(uint32_t) * dl_dci->n_ndi); + dl_dci->ndi[0] = ndi; + dl_dci->ndi[1] = ndi; + dl_dci->n_rv = 2; + dl_dci->rv = (uint32_t *) malloc(sizeof(uint32_t) * dl_dci->n_rv); + dl_dci->rv[0] = round & 3; + dl_dci->rv[1] = round & 3; + dl_dci->has_tpc = 1; + dl_dci->tpc = tpc; + dl_dci->n_mcs = 2; + dl_dci->mcs = (uint32_t *) malloc(sizeof(uint32_t) * dl_dci->n_mcs); + dl_dci->mcs[0] = mcs; + dl_dci->mcs[1] = mcs; + dl_dci->n_tbs_size = 2; + dl_dci->tbs_size = (uint32_t *) malloc(sizeof(uint32_t) * dl_dci->n_tbs_size); + dl_dci->tbs_size[0] = dci_tbs; + dl_dci->tbs_size[1] = dci_tbs; + if (flexran_get_duplex_mode(mod_id, CC_id) == PROTOCOL__FLEX_DUPLEX_MODE__FLDM_TDD) { + dl_dci->has_dai = 1; + dl_dci->dai = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3; + } + break; + case 4: + dl_dci->has_res_alloc = 1; + dl_dci->res_alloc = 0; + dl_dci->has_vrb_format = 1; + dl_dci->vrb_format = PROTOCOL__FLEX_VRB_FORMAT__FLVRBF_LOCALIZED; + dl_dci->has_format = 1; + dl_dci->format = PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_2A; + dl_dci->has_rb_bitmap = 1; + dl_dci->rb_bitmap = allocate_prbs_sub(nb_rb, rballoc_sub); + dl_dci->has_rb_shift = 1; + dl_dci->rb_shift = 0; + dl_dci->n_ndi = 2; + dl_dci->ndi = (uint32_t *) malloc(sizeof(uint32_t) * dl_dci->n_ndi); + dl_dci->ndi[0] = ndi; + dl_dci->ndi[1] = ndi; + dl_dci->n_rv = 2; + dl_dci->rv = (uint32_t *) malloc(sizeof(uint32_t) * dl_dci->n_rv); + dl_dci->rv[0] = round & 3; + dl_dci->rv[1] = round & 3; + dl_dci->has_tpc = 1; + dl_dci->tpc = tpc; + dl_dci->n_mcs = 2; + dl_dci->mcs = (uint32_t *) malloc(sizeof(uint32_t) * dl_dci->n_mcs); + dl_dci->mcs[0] = mcs; + dl_dci->mcs[1] = mcs; + dl_dci->n_tbs_size = 2; + dl_dci->tbs_size = (uint32_t *) malloc(sizeof(uint32_t) * dl_dci->n_tbs_size); + dl_dci->tbs_size[0] = dci_tbs; + dl_dci->tbs_size[1] = dci_tbs; + if (flexran_get_duplex_mode(mod_id, CC_id) == PROTOCOL__FLEX_DUPLEX_MODE__FLDM_TDD) { + dl_dci->has_dai = 1; + dl_dci->dai = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3; + } + break; + case 5: + dl_dci->has_res_alloc = 1; + dl_dci->res_alloc = 0; + dl_dci->has_vrb_format = 1; + dl_dci->vrb_format = PROTOCOL__FLEX_VRB_FORMAT__FLVRBF_LOCALIZED; + dl_dci->has_format = 1; + dl_dci->format = PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1D; + dl_dci->has_rb_bitmap = 1; + dl_dci->rb_bitmap = allocate_prbs_sub(nb_rb, rballoc_sub); + dl_dci->has_rb_shift = 1; + dl_dci->rb_shift = 0; + dl_dci->n_ndi = 1; + dl_dci->ndi = 1; + dl_dci->ndi[0] = ndi; + dl_dci->n_rv = 1; + dl_dci->rv = (uint32_t *) malloc(sizeof(uint32_t) * dl_dci->n_rv); + dl_dci->rv[0] = round & 3; + dl_dci->has_tpc = 1; + dl_dci->tpc = tpc; + dl_dci->n_mcs = 1; + dl_dci->mcs = (uint32_t *) malloc(sizeof(uint32_t) * dl_dci->n_mcs); + dl_dci->mcs[0] = mcs; + dl_dci->n_tbs_size = 1; + dl_dci->tbs_size = (uint32_t *) malloc(sizeof(uint32_t) * dl_dci->n_tbs_size); + dl_dci->tbs_size[0] = dci_tbs; + if (flexran_get_duplex_mode(mod_id, CC_id) == PROTOCOL__FLEX_DUPLEX_MODE__FLDM_TDD) { + dl_dci->has_dai = 1; + dl_dci->dai = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3; + } + + if(ue_sched_ctl->dl_pow_off[CC_id] == 2) { + ue_sched_ctl->dl_pow_off[CC_id] = 1; + } + + dl_dci->has_dl_power_offset = 1; + dl_dci->dl_power_offset = ue_sched_ctl->dl_pow_off[CC_id]; + dl_dci->has_precoding_info = 1; + dl_dci->precoding_info = 5; // Is this right?? + + break; + case 6: + dl_dci->has_res_alloc = 1; + dl_dci->res_alloc = 0; + dl_dci->has_vrb_format = 1; + dl_dci->vrb_format = PROTOCOL__FLEX_VRB_FORMAT__FLVRBF_LOCALIZED; + dl_dci->has_format = 1; + dl_dci->format = PROTOCOL__FLEX_DCI_FORMAT__FLDCIF_1D; + dl_dci->has_rb_bitmap = 1; + dl_dci->rb_bitmap = allocate_prbs_sub(nb_rb, rballoc_sub); + dl_dci->has_rb_shift = 1; + dl_dci->rb_shift = 0; + dl_dci->n_ndi = 1; + dl_dci->ndi = (uint32_t *) malloc(sizeof(uint32_t) * dl_dci->n_ndi); + dl_dci->ndi[0] = ndi; + dl_dci->n_rv = 1; + dl_dci->rv = (uint32_t *) malloc(sizeof(uint32_t) * dl_dci->n_rv); + dl_dci->rv[0] = round & 3; + dl_dci->has_tpc = 1; + dl_dci->tpc = tpc; + dl_dci->n_mcs = 1; + dl_dci->mcs = (uint32_t *) malloc(sizeof(uint32_t) * dl_dci->n_mcs); + dl_dci->mcs[0] = mcs; + if (flexran_get_duplex_mode(mod_id, CC_id) == PROTOCOL__FLEX_DUPLEX_MODE__FLDM_TDD) { + dl_dci->has_dai = 1; + dl_dci->dai = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3; + } + + dl_dci->has_dl_power_offset = 1; + dl_dci->dl_power_offset = ue_sched_ctl->dl_pow_off[CC_id]; + dl_dci->has_precoding_info = 1; + dl_dci->precoding_info = 5; // Is this right?? + break; + } + } + + if (flexran_get_duplex_mode(mod_id, CC_id) == PROTOCOL__FLEX_DUPLEX_MODE__FLDM_TDD) { + + /* TODO */ + //set_ul_DAI(mod_id, UE_id, CC_id, frame, subframe, frame_parms); + } + } // UE_id loop + } // CC_id loop + + // Add all the dl_data elements to the flexran message + (*dl_info)->dl_mac_config_msg->n_dl_ue_data = num_ues_added; + (*dl_info)->dl_mac_config_msg->dl_ue_data = (Protocol__FlexDlData **) malloc(sizeof(Protocol__FlexDlData *) * num_ues_added); + for (i = 0; i < num_ues_added; i++) { + (*dl_info)->dl_mac_config_msg->dl_ue_data[i] = dl_data[i]; + } + + stop_meas(&eNB->schedule_dlsch); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SCHEDULE_DLSCH,VCD_FUNCTION_OUT); +} + +// This function stores the downlink buffer for all the logical channels +void _store_dlsch_buffer (module_id_t Mod_id, + frame_t frameP, + sub_frame_t subframeP) +{ + + int UE_id,i; + rnti_t rnti; + mac_rlc_status_resp_t rlc_status; + UE_list_t *UE_list = &eNB_mac_inst[Mod_id].UE_list; + UE_TEMPLATE *UE_template; + + for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) { + + UE_template = &UE_list->UE_template[UE_PCCID(Mod_id,UE_id)][UE_id]; + + // clear logical channel interface variables + UE_template->dl_buffer_total = 0; + UE_template->dl_pdus_total = 0; + + for(i=0; i< MAX_NUM_LCID; i++) { + UE_template->dl_buffer_info[i]=0; + UE_template->dl_pdus_in_buffer[i]=0; + UE_template->dl_buffer_head_sdu_creation_time[i]=0; + UE_template->dl_buffer_head_sdu_remaining_size_to_send[i]=0; + } + + rnti = UE_RNTI(Mod_id,UE_id); + + for(i=0; i< MAX_NUM_LCID; i++) { // loop over all the logical channels + + rlc_status = mac_rlc_status_ind(Mod_id,rnti, Mod_id,frameP,ENB_FLAG_YES,MBMS_FLAG_NO,i,0 ); + UE_template->dl_buffer_info[i] = rlc_status.bytes_in_buffer; //storing the dlsch buffer for each logical channel + UE_template->dl_pdus_in_buffer[i] = rlc_status.pdus_in_buffer; + UE_template->dl_buffer_head_sdu_creation_time[i] = rlc_status.head_sdu_creation_time ; + UE_template->dl_buffer_head_sdu_creation_time_max = cmax(UE_template->dl_buffer_head_sdu_creation_time_max, + rlc_status.head_sdu_creation_time ); + UE_template->dl_buffer_head_sdu_remaining_size_to_send[i] = rlc_status.head_sdu_remaining_size_to_send; + UE_template->dl_buffer_head_sdu_is_segmented[i] = rlc_status.head_sdu_is_segmented; + UE_template->dl_buffer_total += UE_template->dl_buffer_info[i];//storing the total dlsch buffer + UE_template->dl_pdus_total += UE_template->dl_pdus_in_buffer[i]; + +#ifdef DEBUG_eNB_SCHEDULER + + /* note for dl_buffer_head_sdu_remaining_size_to_send[i] : + * 0 if head SDU has not been segmented (yet), else remaining size not already segmented and sent + */ + if (UE_template->dl_buffer_info[i]>0) + LOG_D(MAC, + "[eNB %d] Frame %d Subframe %d : RLC status for UE %d in LCID%d: total of %d pdus and size %d, head sdu queuing time %d, remaining size %d, is segmeneted %d \n", + Mod_id, frameP, subframeP, UE_id, + i, UE_template->dl_pdus_in_buffer[i],UE_template->dl_buffer_info[i], + UE_template->dl_buffer_head_sdu_creation_time[i], + UE_template->dl_buffer_head_sdu_remaining_size_to_send[i], + UE_template->dl_buffer_head_sdu_is_segmented[i] + ); + +#endif + + } + + //#ifdef DEBUG_eNB_SCHEDULER + if ( UE_template->dl_buffer_total>0) + LOG_D(MAC,"[eNB %d] Frame %d Subframe %d : RLC status for UE %d : total DL buffer size %d and total number of pdu %d \n", + Mod_id, frameP, subframeP, UE_id, + UE_template->dl_buffer_total, + UE_template->dl_pdus_total + ); + + //#endif + } +} + + +// This function returns the estimated number of RBs required by each UE for downlink scheduling +void _assign_rbs_required (module_id_t Mod_id, + frame_t frameP, + sub_frame_t subframe, + uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX], + int min_rb_unit[MAX_NUM_CCs]) +{ + + + rnti_t rnti; + uint16_t TBS = 0; + LTE_eNB_UE_stats *eNB_UE_stats[MAX_NUM_CCs]; + int UE_id,n,i,j,CC_id,pCCid,tmp; + UE_list_t *UE_list = &eNB_mac_inst[Mod_id].UE_list; + // UE_TEMPLATE *UE_template; + + // clear rb allocations across all CC_ids + for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) { + pCCid = UE_PCCID(Mod_id,UE_id); + rnti = UE_list->UE_template[pCCid][UE_id].rnti; + + //update CQI information across component carriers + for (n=0; n<UE_list->numactiveCCs[UE_id]; n++) { + CC_id = UE_list->ordered_CCids[n][UE_id]; + eNB_UE_stats[CC_id] = mac_xface->get_eNB_UE_stats(Mod_id,CC_id,rnti); + eNB_UE_stats[CC_id]->dlsch_mcs1=cqi_to_mcs[flexran_get_ue_wcqi(Mod_id, UE_id)]; + } + + // provide the list of CCs sorted according to MCS + for (i=0; i<UE_list->numactiveCCs[UE_id]; i++) { + for (j=i+1; j<UE_list->numactiveCCs[UE_id]; j++) { + DevAssert( j < MAX_NUM_CCs ); + + if (eNB_UE_stats[UE_list->ordered_CCids[i][UE_id]]->dlsch_mcs1 > + eNB_UE_stats[UE_list->ordered_CCids[j][UE_id]]->dlsch_mcs1) { + tmp = UE_list->ordered_CCids[i][UE_id]; + UE_list->ordered_CCids[i][UE_id] = UE_list->ordered_CCids[j][UE_id]; + UE_list->ordered_CCids[j][UE_id] = tmp; + } + } + } + + /* NN --> RK + * check the index of UE_template" + */ + if (UE_list->UE_template[pCCid][UE_id].dl_buffer_total> 0) { + LOG_D(MAC,"[preprocessor] assign RB for UE %d\n",UE_id); + + for (i=0; i<UE_list->numactiveCCs[UE_id]; i++) { + CC_id = UE_list->ordered_CCids[i][UE_id]; + eNB_UE_stats[CC_id] = mac_xface->get_eNB_UE_stats(Mod_id,CC_id,rnti); + + if (eNB_UE_stats[CC_id]->dlsch_mcs1==0) { + nb_rbs_required[CC_id][UE_id] = 4; // don't let the TBS get too small + } else { + nb_rbs_required[CC_id][UE_id] = min_rb_unit[CC_id]; + } + + TBS = mac_xface->get_TBS_DL(eNB_UE_stats[CC_id]->dlsch_mcs1,nb_rbs_required[CC_id][UE_id]); + + LOG_D(MAC,"[preprocessor] start RB assignement for UE %d CC_id %d dl buffer %d (RB unit %d, MCS %d, TBS %d) \n", + UE_id, CC_id, UE_list->UE_template[pCCid][UE_id].dl_buffer_total, + nb_rbs_required[CC_id][UE_id],eNB_UE_stats[CC_id]->dlsch_mcs1,TBS); + + /* calculating required number of RBs for each UE */ + while (TBS < UE_list->UE_template[pCCid][UE_id].dl_buffer_total) { + nb_rbs_required[CC_id][UE_id] += min_rb_unit[CC_id]; + + if (nb_rbs_required[CC_id][UE_id] > flexran_get_N_RB_DL(Mod_id, CC_id)) { + TBS = mac_xface->get_TBS_DL(eNB_UE_stats[CC_id]->dlsch_mcs1, flexran_get_N_RB_DL(Mod_id, CC_id)); + nb_rbs_required[CC_id][UE_id] = flexran_get_N_RB_DL(Mod_id, CC_id); + break; + } + + TBS = mac_xface->get_TBS_DL(eNB_UE_stats[CC_id]->dlsch_mcs1,nb_rbs_required[CC_id][UE_id]); + } // end of while + + LOG_D(MAC,"[eNB %d] Frame %d: UE %d on CC %d: RB unit %d, nb_required RB %d (TBS %d, mcs %d)\n", + Mod_id, frameP,UE_id, CC_id, min_rb_unit[CC_id], nb_rbs_required[CC_id][UE_id], TBS, eNB_UE_stats[CC_id]->dlsch_mcs1); + } + } + } +} + +// This function scans all CC_ids for a particular UE to find the maximum round index of its HARQ processes +int _maxround(module_id_t Mod_id,uint16_t rnti,int frame,sub_frame_t subframe,uint8_t ul_flag ) +{ + + uint8_t round,round_max=0,UE_id; + int CC_id; + UE_list_t *UE_list = &eNB_mac_inst[Mod_id].UE_list; + + for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { + + UE_id = find_UE_id(Mod_id,rnti); + round = UE_list->UE_sched_ctrl[UE_id].round[CC_id]; + if (round > round_max) { + round_max = round; + } + } + + return round_max; +} + +// This function scans all CC_ids for a particular UE to find the maximum DL CQI +int _maxcqi(module_id_t Mod_id,int32_t UE_id) +{ + + LTE_eNB_UE_stats *eNB_UE_stats = NULL; + UE_list_t *UE_list = &eNB_mac_inst[Mod_id].UE_list; + int CC_id,n; + int CQI = 0; + + for (n=0; n<UE_list->numactiveCCs[UE_id]; n++) { + CC_id = UE_list->ordered_CCids[n][UE_id]; + eNB_UE_stats = mac_xface->get_eNB_UE_stats(Mod_id,CC_id,UE_RNTI(Mod_id,UE_id)); + + if (eNB_UE_stats==NULL) { + mac_xface->macphy_exit("maxcqi: could not get eNB_UE_stats\n"); + return 0; // not reached + } + + if (eNB_UE_stats->DL_cqi[0] > CQI) { + CQI = eNB_UE_stats->DL_cqi[0]; + } + } + + return(CQI); +} + + +// This fuction sorts the UE in order their dlsch buffer and CQI +void _sort_UEs (module_id_t Mod_idP, + int frameP, + sub_frame_t subframeP) +{ + + + int UE_id1,UE_id2; + int pCC_id1,pCC_id2; + int cqi1,cqi2,round1,round2; + int i=0,ii=0;//,j=0; + rnti_t rnti1,rnti2; + + UE_list_t *UE_list = &eNB_mac_inst[Mod_idP].UE_list; + + for (i=UE_list->head; i>=0; i=UE_list->next[i]) { + + for(ii=UE_list->next[i]; ii>=0; ii=UE_list->next[ii]) { + + UE_id1 = i; + rnti1 = UE_RNTI(Mod_idP,UE_id1); + if(rnti1 == NOT_A_RNTI) + continue; + if (UE_list->UE_sched_ctrl[UE_id1].ul_out_of_sync == 1) + continue; + pCC_id1 = UE_PCCID(Mod_idP,UE_id1); + cqi1 = _maxcqi(Mod_idP,UE_id1); // + round1 = _maxround(Mod_idP,rnti1,frameP,subframeP,0); + + UE_id2 = ii; + rnti2 = UE_RNTI(Mod_idP,UE_id2); + if(rnti2 == NOT_A_RNTI) + continue; + if (UE_list->UE_sched_ctrl[UE_id2].ul_out_of_sync == 1) + continue; + cqi2 = _maxcqi(Mod_idP,UE_id2); + round2 = _maxround(Mod_idP,rnti2,frameP,subframeP,0); //mac_xface->get_ue_active_harq_pid(Mod_id,rnti2,subframe,&harq_pid2,&round2,0); + pCC_id2 = UE_PCCID(Mod_idP,UE_id2); + + if(round2 > round1) { // Check first if one of the UEs has an active HARQ process which needs service and swap order + swap_UEs(UE_list,UE_id1,UE_id2,0); + } else if (round2 == round1) { + // RK->NN : I guess this is for fairness in the scheduling. This doesn't make sense unless all UEs have the same configuration of logical channels. This should be done on the sum of all information that has to be sent. And still it wouldn't ensure fairness. It should be based on throughput seen by each UE or maybe using the head_sdu_creation_time, i.e. swap UEs if one is waiting longer for service. + + // first check the buffer status for SRB1 and SRB2 + if ( (UE_list->UE_template[pCC_id1][UE_id1].dl_buffer_info[1] + UE_list->UE_template[pCC_id1][UE_id1].dl_buffer_info[2]) < + (UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_info[1] + UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_info[2]) ) { + swap_UEs(UE_list,UE_id1,UE_id2,0); + } else if (UE_list->UE_template[pCC_id1][UE_id1].dl_buffer_head_sdu_creation_time_max < + UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_head_sdu_creation_time_max ) { + swap_UEs(UE_list,UE_id1,UE_id2,0); + } else if (UE_list->UE_template[pCC_id1][UE_id1].dl_buffer_total < + UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_total ) { + swap_UEs(UE_list,UE_id1,UE_id2,0); + } else if (cqi1 < cqi2) { + swap_UEs(UE_list,UE_id1,UE_id2,0); + } + } + } + } +} + +// This function assigns pre-available RBS to each UE in specified sub-bands before scheduling is done +void _dlsch_scheduler_pre_processor (module_id_t Mod_id, + frame_t frameP, + sub_frame_t subframeP, + int N_RBG[MAX_NUM_CCs], + int *mbsfn_flag) +{ + + unsigned char rballoc_sub[MAX_NUM_CCs][N_RBG_MAX], harq_pid=0, total_ue_count; + unsigned char MIMO_mode_indicator[MAX_NUM_CCs][N_RBG_MAX]; + int UE_id, i; + unsigned char round = 0; + uint16_t ii,j; + uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; + uint16_t nb_rbs_required_remaining[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; + uint16_t nb_rbs_required_remaining_1[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; + uint16_t average_rbs_per_user[MAX_NUM_CCs] = {0}; + rnti_t rnti; + int min_rb_unit[MAX_NUM_CCs]; + uint16_t r1=0; + uint8_t CC_id; + UE_list_t *UE_list = &eNB_mac_inst[Mod_id].UE_list; + LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs] = {0}; + + int transmission_mode = 0; + UE_sched_ctrl *ue_sched_ctl; + + for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { + + if (mbsfn_flag[CC_id]>0) // If this CC is allocated for MBSFN skip it here + continue; + + frame_parms[CC_id] = mac_xface->get_lte_frame_parms(Mod_id,CC_id); + + + min_rb_unit[CC_id]=get_min_rb_unit(Mod_id,CC_id); + + for (i=UE_list->head; i>=0; i=UE_list->next[i]) { + UE_id = i; + // Initialize scheduling information for all active UEs + + + _dlsch_scheduler_pre_processor_reset(Mod_id, + UE_id, + CC_id, + frameP, + subframeP, + N_RBG[CC_id], + nb_rbs_required, + nb_rbs_required_remaining, + rballoc_sub, + MIMO_mode_indicator); + + } + } + + // Store the DLSCH buffer for each logical channel + _store_dlsch_buffer (Mod_id,frameP,subframeP); + + // Calculate the number of RBs required by each UE on the basis of logical channel's buffer + _assign_rbs_required (Mod_id,frameP,subframeP,nb_rbs_required,min_rb_unit); + + // Sorts the user on the basis of dlsch logical channel buffer and CQI + _sort_UEs (Mod_id,frameP,subframeP); + + total_ue_count = 0; + + // loop over all active UEs + for (i=UE_list->head; i>=0; i=UE_list->next[i]) { + rnti = flexran_get_ue_crnti(Mod_id, i); + if(rnti == NOT_A_RNTI) + continue; + if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) + continue; + UE_id = i; + + // if there is no available harq_process, skip the UE + if (UE_list->UE_sched_ctrl[UE_id].harq_pid[CC_id]<0) + continue; + + for (ii=0; ii < UE_num_active_CC(UE_list,UE_id); ii++) { + CC_id = UE_list->ordered_CCids[ii][UE_id]; + ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; + flexran_get_harq(Mod_id, CC_id, UE_id, frameP, subframeP, &harq_pid, &round); + + average_rbs_per_user[CC_id]=0; + + frame_parms[CC_id] = mac_xface->get_lte_frame_parms(Mod_id,CC_id); + + // mac_xface->get_ue_active_harq_pid(Mod_id,CC_id,rnti,frameP,subframeP,&harq_pid,&round,0); + + if(round>0) { + nb_rbs_required[CC_id][UE_id] = UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid]; + } + + //nb_rbs_required_remaining[UE_id] = nb_rbs_required[UE_id]; + if (nb_rbs_required[CC_id][UE_id] > 0) { + total_ue_count = total_ue_count + 1; + } + + + // hypotetical assignement + /* + * If schedule is enabled and if the priority of the UEs is modified + * The average rbs per logical channel per user will depend on the level of + * priority. Concerning the hypothetical assignement, we should assign more + * rbs to prioritized users. Maybe, we can do a mapping between the + * average rbs per user and the level of priority or multiply the average rbs + * per user by a coefficient which represents the degree of priority. + */ + + if (total_ue_count == 0) { + average_rbs_per_user[CC_id] = 0; + } else if( (min_rb_unit[CC_id] * total_ue_count) <= (frame_parms[CC_id]->N_RB_DL) ) { + average_rbs_per_user[CC_id] = (uint16_t) floor(frame_parms[CC_id]->N_RB_DL/total_ue_count); + } else { + average_rbs_per_user[CC_id] = min_rb_unit[CC_id]; // consider the total number of use that can be scheduled UE + } + } + } + + // note: nb_rbs_required is assigned according to total_buffer_dl + // extend nb_rbs_required to capture per LCID RB required + for(i=UE_list->head; i>=0; i=UE_list->next[i]) { + rnti = UE_RNTI(Mod_id,i); + + for (ii=0; ii<UE_num_active_CC(UE_list,i); ii++) { + CC_id = UE_list->ordered_CCids[ii][i]; + + // control channel + if (mac_eNB_get_rrc_status(Mod_id,rnti) < RRC_RECONFIGURED) { + nb_rbs_required_remaining_1[CC_id][i] = nb_rbs_required[CC_id][i]; + } else { + nb_rbs_required_remaining_1[CC_id][i] = cmin(average_rbs_per_user[CC_id],nb_rbs_required[CC_id][i]); + + } + } + } + + //Allocation to UEs is done in 2 rounds, + // 1st stage: average number of RBs allocated to each UE + // 2nd stage: remaining RBs are allocated to high priority UEs + for(r1=0; r1<2; r1++) { + + for(i=UE_list->head; i>=0; i=UE_list->next[i]) { + for (ii=0; ii<UE_num_active_CC(UE_list,i); ii++) { + CC_id = UE_list->ordered_CCids[ii][i]; + + if(r1 == 0) { + nb_rbs_required_remaining[CC_id][i] = nb_rbs_required_remaining_1[CC_id][i]; + } else { // rb required based only on the buffer - rb allloctaed in the 1st round + extra reaming rb form the 1st round + nb_rbs_required_remaining[CC_id][i] = nb_rbs_required[CC_id][i]-nb_rbs_required_remaining_1[CC_id][i]+nb_rbs_required_remaining[CC_id][i]; + } + + if (nb_rbs_required[CC_id][i]> 0 ) + LOG_D(MAC,"round %d : nb_rbs_required_remaining[%d][%d]= %d (remaining_1 %d, required %d, pre_nb_available_rbs %d, N_RBG %d, rb_unit %d)\n", + r1, CC_id, i, + nb_rbs_required_remaining[CC_id][i], + nb_rbs_required_remaining_1[CC_id][i], + nb_rbs_required[CC_id][i], + UE_list->UE_sched_ctrl[i].pre_nb_available_rbs[CC_id], + N_RBG[CC_id], + min_rb_unit[CC_id]); + + } + } + + if (total_ue_count > 0 ) { + for(i=UE_list->head; i>=0; i=UE_list->next[i]) { + UE_id = i; + + for (ii=0; ii<UE_num_active_CC(UE_list,UE_id); ii++) { + CC_id = UE_list->ordered_CCids[ii][UE_id]; + ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; + flexran_get_harq(Mod_id, CC_id, UE_id, frameP, subframeP, &harq_pid, &round); + rnti = UE_RNTI(Mod_id,UE_id); + + // LOG_D(MAC,"UE %d rnti 0x\n", UE_id, rnti ); + if(rnti == NOT_A_RNTI) + continue; + if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) + continue; + + transmission_mode = mac_xface->get_transmission_mode(Mod_id,CC_id,rnti); + //rrc_status = mac_eNB_get_rrc_status(Mod_id,rnti); + /* 1st allocate for the retx */ + + // retransmission in data channels + // control channel in the 1st transmission + // data channel for all TM + LOG_T(MAC,"calling dlsch_scheduler_pre_processor_allocate .. \n "); + _dlsch_scheduler_pre_processor_allocate (Mod_id, + UE_id, + CC_id, + N_RBG[CC_id], + transmission_mode, + min_rb_unit[CC_id], + frame_parms[CC_id]->N_RB_DL, + nb_rbs_required, + nb_rbs_required_remaining, + rballoc_sub, + MIMO_mode_indicator); + } + } + } // total_ue_count + } // end of for for r1 and r2 + + for(i=UE_list->head; i>=0; i=UE_list->next[i]) { + UE_id = i; + ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; + + for (ii=0; ii<UE_num_active_CC(UE_list,UE_id); ii++) { + CC_id = UE_list->ordered_CCids[ii][UE_id]; + //PHY_vars_eNB_g[Mod_id]->mu_mimo_mode[UE_id].dl_pow_off = dl_pow_off[UE_id]; + + if (ue_sched_ctl->pre_nb_available_rbs[CC_id] > 0 ) { + LOG_D(MAC,"******************DL Scheduling Information for UE%d ************************\n",UE_id); + LOG_D(MAC,"dl power offset UE%d = %d \n",UE_id,ue_sched_ctl->dl_pow_off[CC_id]); + LOG_D(MAC,"***********RB Alloc for every subband for UE%d ***********\n",UE_id); + + for(j=0; j<N_RBG[CC_id]; j++) { + //PHY_vars_eNB_g[Mod_id]->mu_mimo_mode[UE_id].rballoc_sub[i] = rballoc_sub_UE[CC_id][UE_id][i]; + LOG_D(MAC,"RB Alloc for UE%d and Subband%d = %d\n",UE_id,j,ue_sched_ctl->rballoc_sub_UE[CC_id][j]); + } + + //PHY_vars_eNB_g[Mod_id]->mu_mimo_mode[UE_id].pre_nb_available_rbs = pre_nb_available_rbs[CC_id][UE_id]; + LOG_D(MAC,"Total RBs allocated for UE%d = %d\n",UE_id,ue_sched_ctl->pre_nb_available_rbs[CC_id]); + } + } + } +} + +#define SF05_LIMIT 1 + +void _dlsch_scheduler_pre_processor_reset (int module_idP, + int UE_id, + uint8_t CC_id, + int frameP, + int subframeP, + int N_RBG, + uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX], + uint16_t nb_rbs_required_remaining[MAX_NUM_CCs][NUMBER_OF_UE_MAX], + unsigned char rballoc_sub[MAX_NUM_CCs][N_RBG_MAX], + unsigned char MIMO_mode_indicator[MAX_NUM_CCs][N_RBG_MAX]) { + int i,j; + UE_list_t *UE_list=&eNB_mac_inst[module_idP].UE_list; + UE_sched_ctrl *ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; + rnti_t rnti = UE_RNTI(module_idP,UE_id); + uint8_t *vrb_map = eNB_mac_inst[module_idP].common_channels[CC_id].vrb_map; + int RBGsize = PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL/N_RBG; +#ifdef SF05_LIMIT + //int subframe05_limit=0; + int sf05_upper=-1,sf05_lower=-1; +#endif + LTE_eNB_UE_stats *eNB_UE_stats = mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti); + + flexran_update_TA(module_idP, UE_id, CC_id); + + if (UE_id==0) { + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_TIMING_ADVANCE,ue_sched_ctl->ta_update); + } + nb_rbs_required[CC_id][UE_id]=0; + ue_sched_ctl->pre_nb_available_rbs[CC_id] = 0; + ue_sched_ctl->dl_pow_off[CC_id] = 2; + nb_rbs_required_remaining[CC_id][UE_id] = 0; + +#ifdef SF05_LIMIT + switch (N_RBG) { + case 6: + sf05_lower=0; + sf05_upper=5; + break; + case 8: + sf05_lower=2; + sf05_upper=5; + break; + case 13: + sf05_lower=4; + sf05_upper=7; + break; + case 17: + sf05_lower=7; + sf05_upper=9; + break; + case 25: + sf05_lower=11; + sf05_upper=13; + break; + } +#endif + // Initialize Subbands according to VRB map + for (i=0; i<N_RBG; i++) { + ue_sched_ctl->rballoc_sub_UE[CC_id][i] = 0; + rballoc_sub[CC_id][i] = 0; +#ifdef SF05_LIMIT + // for avoiding 6+ PRBs around DC in subframe 0-5 (avoid excessive errors) + + if ((subframeP==0 || subframeP==5) && + (i>=sf05_lower && i<=sf05_upper)) + rballoc_sub[CC_id][i]=1; +#endif + // for SI-RNTI,RA-RNTI and P-RNTI allocations + for (j=0;j<RBGsize;j++) { + if (vrb_map[j+(i*RBGsize)]!=0) { + rballoc_sub[CC_id][i] = 1; + LOG_D(MAC,"Frame %d, subframe %d : vrb %d allocated\n",frameP,subframeP,j+(i*RBGsize)); + break; + } + } + LOG_D(MAC,"Frame %d Subframe %d CC_id %d RBG %i : rb_alloc %d\n",frameP,subframeP,CC_id,i,rballoc_sub[CC_id][i]); + MIMO_mode_indicator[CC_id][i] = 2; + } +} + + +void _dlsch_scheduler_pre_processor_allocate (module_id_t Mod_id, + int UE_id, + uint8_t CC_id, + int N_RBG, + int transmission_mode, + int min_rb_unit, + uint8_t N_RB_DL, + uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX], + uint16_t nb_rbs_required_remaining[MAX_NUM_CCs][NUMBER_OF_UE_MAX], + unsigned char rballoc_sub[MAX_NUM_CCs][N_RBG_MAX], + unsigned char MIMO_mode_indicator[MAX_NUM_CCs][N_RBG_MAX]) { + int i; + UE_list_t *UE_list=&eNB_mac_inst[Mod_id].UE_list; + UE_sched_ctrl *ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; + + for(i=0; i<N_RBG; i++) { + + if((rballoc_sub[CC_id][i] == 0) && + (ue_sched_ctl->rballoc_sub_UE[CC_id][i] == 0) && + (nb_rbs_required_remaining[CC_id][UE_id]>0) && + (ue_sched_ctl->pre_nb_available_rbs[CC_id] < nb_rbs_required[CC_id][UE_id])) { + + // if this UE is not scheduled for TM5 + if (ue_sched_ctl->dl_pow_off[CC_id] != 0 ) { + + if ((i == N_RBG-1) && ((N_RB_DL == 25) || (N_RB_DL == 50))) { + rballoc_sub[CC_id][i] = 1; + ue_sched_ctl->rballoc_sub_UE[CC_id][i] = 1; + MIMO_mode_indicator[CC_id][i] = 1; + if (transmission_mode == 5 ) { + ue_sched_ctl->dl_pow_off[CC_id] = 1; + } + nb_rbs_required_remaining[CC_id][UE_id] = nb_rbs_required_remaining[CC_id][UE_id] - min_rb_unit+1; + ue_sched_ctl->pre_nb_available_rbs[CC_id] = ue_sched_ctl->pre_nb_available_rbs[CC_id] + min_rb_unit - 1; + } else { + if (nb_rbs_required_remaining[CC_id][UE_id] >= min_rb_unit){ + rballoc_sub[CC_id][i] = 1; + ue_sched_ctl->rballoc_sub_UE[CC_id][i] = 1; + MIMO_mode_indicator[CC_id][i] = 1; + if (transmission_mode == 5 ) { + ue_sched_ctl->dl_pow_off[CC_id] = 1; + } + nb_rbs_required_remaining[CC_id][UE_id] = nb_rbs_required_remaining[CC_id][UE_id] - min_rb_unit; + ue_sched_ctl->pre_nb_available_rbs[CC_id] = ue_sched_ctl->pre_nb_available_rbs[CC_id] + min_rb_unit; + } + } + } // dl_pow_off[CC_id][UE_id] ! = 0 + } + } +} diff --git a/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue_remote.c b/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue_remote.c new file mode 100644 index 0000000000000000000000000000000000000000..7dec8d0c563169a0bb9136ce3fd30521166b5634 --- /dev/null +++ b/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue_remote.c @@ -0,0 +1,180 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file flexran_agent_scheduler_dlsch_ue_remote.c + * \brief procedures related to remote scheduling in the DLSCH transport channel + * \author Xenofon Foukas + * \date 2016 + * \email: x.foukas@sms.ed.ac.uk + * \version 0.1 + * @ingroup _mac + + */ + +#include "flexran_agent_common_internal.h" + +#include "flexran_agent_scheduler_dlsch_ue_remote.h" + +#include "LAYER2/MAC/defs.h" +#include "LAYER2/MAC/extern.h" + +struct DlMacConfigHead queue_head; + +int queue_initialized = 0; + +//uint32_t skip_subframe = 1; +//uint32_t period = 10; +//uint32_t sched [] = {1, 2, 3}; + +void flexran_schedule_ue_spec_remote(mid_t mod_id, uint32_t frame, uint32_t subframe, + int *mbsfn_flag, Protocol__FlexranMessage **dl_info) { + + + //if ((subframe == skip_subframe) && (frame % period == 0)) { + // LOG_I(MAC, "Will skip subframe %d %d\n", subframe, frame); + // for (int i = 0; i < 3; i++) { + // LOG_I(MAC, "%d\n", sched[i]); + // } + //} + + /* if (frame == 500 && subframe == 1) { */ + /* char policy[] = "rrc: \n - ul_scheduler: \n behavior : tester_function\n parameters:\n period: !!int 3\nmac: \n - dl_scheduler: \n parameters: \n period : !!int 40\n skip_subframe : !!int 3\n sched : [!!int 4, !!int 5, !!int 6]"; */ + /* apply_reconfiguration_policy(mod_id, policy, strlen(policy)); */ + /* } */ + + eNB_MAC_INST *eNB; + + if (!queue_initialized) { + TAILQ_INIT(&queue_head); + queue_initialized = 1; + } + + eNB = &eNB_mac_inst[mod_id]; + + dl_mac_config_element_t *dl_config_elem; + + int diff; + LOG_D(MAC, "[TEST] Current frame and subframe %d, %d\n", frame, subframe); + // First we check to see if we have a scheduling decision for this sfn_sf already in our queue + while(queue_head.tqh_first != NULL) { + dl_config_elem = queue_head.tqh_first; + + diff = get_sf_difference(mod_id, dl_config_elem->dl_info->dl_mac_config_msg->sfn_sf); + // Check if this decision is for now, for a later or a previous subframe + if ( diff == 0) { // Now + LOG_D(MAC, "Found a decision for this subframe in the queue. Let's use it!\n"); + TAILQ_REMOVE(&queue_head, queue_head.tqh_first, configs); + *dl_info = dl_config_elem->dl_info; + free(dl_config_elem); + eNB->eNB_stats[mod_id].sched_decisions++; + return; + } else if (diff < 0) { //previous subframe , delete message and free memory + LOG_D(MAC, "Found a decision for a previous subframe in the queue. Let's get rid of it\n"); + TAILQ_REMOVE(&queue_head, queue_head.tqh_first, configs); + flexran_agent_mac_destroy_dl_config(dl_config_elem->dl_info); + free(dl_config_elem); + eNB->eNB_stats[mod_id].sched_decisions++; + eNB->eNB_stats[mod_id].missed_deadlines++; + } else { // next subframe, nothing to do now + LOG_D(MAC, "Found a decision for a future subframe in the queue. Nothing to do now\n"); + flexran_agent_mac_create_empty_dl_config(mod_id, dl_info); + return; + } + } + + //Done with the local cache. Now we need to check if something new arrived + flexran_agent_get_pending_dl_mac_config(mod_id, dl_info); + while (*dl_info != NULL) { + + diff = get_sf_difference(mod_id, (*dl_info)->dl_mac_config_msg->sfn_sf); + if (diff == 0) { // Got a command for this sfn_sf + LOG_D(MAC, "Found a decision for this subframe pending. Let's use it\n"); + eNB->eNB_stats[mod_id].sched_decisions++; + return; + } else if (diff < 0) { + LOG_D(MAC, "Found a decision for a previous subframe. Let's get rid of it\n"); + flexran_agent_mac_destroy_dl_config(*dl_info); + *dl_info = NULL; + flexran_agent_get_pending_dl_mac_config(mod_id, dl_info); + eNB->eNB_stats[mod_id].sched_decisions++; + eNB->eNB_stats[mod_id].missed_deadlines++; + } else { // Intended for future subframe. Store it in local cache + LOG_D(MAC, "Found a decision for a future subframe in the queue. Let's store it in the cache\n"); + dl_mac_config_element_t *e = malloc(sizeof(dl_mac_config_element_t)); + e->dl_info = *dl_info; + TAILQ_INSERT_TAIL(&queue_head, e, configs); + flexran_agent_mac_create_empty_dl_config(mod_id, dl_info); + // No need to look for another. Messages arrive ordered + return; + } + } + + // We found no pending command, so we will simply pass an empty one + flexran_agent_mac_create_empty_dl_config(mod_id, dl_info); +} + +int get_sf_difference(mid_t mod_id, uint32_t sfn_sf) { + int diff_in_subframes; + + uint16_t current_frame = flexran_get_current_system_frame_num(mod_id); + uint16_t current_subframe = flexran_get_current_subframe(mod_id); + uint32_t current_sfn_sf = flexran_get_sfn_sf(mod_id); + + if (sfn_sf == current_sfn_sf) { + return 0; + } + + uint16_t frame_mask = ((1<<12) - 1); + uint16_t frame = (sfn_sf & (frame_mask << 4)) >> 4; + + uint16_t sf_mask = ((1<<4) - 1); + uint16_t subframe = (sfn_sf & sf_mask); + + LOG_D(MAC, "[TEST] Target frame and subframe %d, %d\n", frame, subframe); + + if (frame == current_frame) { + return subframe - current_subframe; + } else if (frame > current_frame) { + diff_in_subframes = ((frame*10)+subframe) - ((current_frame*10)+current_subframe); + + // diff_in_subframes = 9 - current_subframe; + //diff_in_subframes += (subframe + 1); + //diff_in_subframes += (frame-2) * 10; + if (diff_in_subframes > SCHED_AHEAD_SUBFRAMES) { + return -1; + } else { + return 1; + } + } else { //frame < current_frame + //diff_in_subframes = 9 - current_subframe; + //diff_in_subframes += (subframe + 1); + //if (frame > 0) { + // diff_in_subframes += (frame - 1) * 10; + //} + //diff_in_subframes += (1023 - current_frame) * 10; + diff_in_subframes = 10240 - ((current_frame*10)+current_subframe) + ((frame*10)+subframe); + if (diff_in_subframes > SCHED_AHEAD_SUBFRAMES) { + return -1; + } else { + return 1; + } + } +} diff --git a/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue_remote.h b/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue_remote.h new file mode 100644 index 0000000000000000000000000000000000000000..7a02ff2f1db6d278247bba94ec4481821916c6be --- /dev/null +++ b/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue_remote.h @@ -0,0 +1,69 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file flexran_agent_scheduler_dlsch_ue_remote.h + * \brief Local stub for remote scheduler used by the controller + * \author Xenofon Foukas + * \date 2016 + * \email: x.foukas@sms.ed.ac.uk + * \version 0.1 + * @ingroup _mac + + */ + +#ifndef __LAYER2_MAC_FLEXRAN_AGENT_SCHEDULER_DLSCH_UE_REMOTE_H__ +#define __LAYER2_MAC_FLEXRAN_AGENT_SCHEDULER_DLSCH_UE_REMOTE_H___ + +#include "flexran.pb-c.h" +#include "header.pb-c.h" + +#include "ENB_APP/flexran_agent_defs.h" +#include "flexran_agent_mac.h" +#include "LAYER2/MAC/flexran_agent_mac_proto.h" + +#include <sys/queue.h> + +// Maximum value of schedule ahead of time +// Required to identify if a dl_command is for the future or not +#define SCHED_AHEAD_SUBFRAMES 20 + +typedef struct dl_mac_config_element_s { + Protocol__FlexranMessage *dl_info; + TAILQ_ENTRY(dl_mac_config_element_s) configs; +} dl_mac_config_element_t; + +TAILQ_HEAD(DlMacConfigHead, dl_mac_config_element_s); + +/* + * Default scheduler used by the eNB agent + */ +void flexran_schedule_ue_spec_remote(mid_t mod_id, uint32_t frame, uint32_t subframe, + int *mbsfn_flag, Protocol__FlexranMessage **dl_info); + + +// Find the difference in subframes from the given subframe +// negative for older value +// 0 for equal +// positive for future value +// Based on +int get_sf_difference(mid_t mod_id, uint32_t sfn_sf); + +#endif diff --git a/openair2/LAYER2/MAC/flexran_dci_conversions.h b/openair2/LAYER2/MAC/flexran_dci_conversions.h new file mode 100644 index 0000000000000000000000000000000000000000..a417c39d208f853cafedb8c70974cee502c2d971 --- /dev/null +++ b/openair2/LAYER2/MAC/flexran_dci_conversions.h @@ -0,0 +1,51 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file flexran_dci_conversions.h + * \brief Conversion helpers from flexran messages to OAI formats DCI + * \author Xenofon Foukas + * \date 2016 + * \version 0.1 + */ + +#ifndef LAYER2_MAC_FLEXRAN_DCI_CONVERISIONS_H__ +#define LAYER2_MAC_DCI_FLEXRAN_CONVERISIONS_H__ + +#define FILL_DCI_FDD_1(TYPE, DCI, FLEXRAN_DCI) \ + ((TYPE*)DCI)->harq_pid = FLEXRAN_DCI->harq_process; \ + ((TYPE*)DCI)->rv = FLEXRAN_DCI->rv[0]; \ + ((TYPE*)DCI)->rballoc = FLEXRAN_DCI->rb_bitmap; \ + ((TYPE*)DCI)->rah = FLEXRAN_DCI->res_alloc; \ + ((TYPE*)DCI)->mcs = FLEXRAN_DCI->mcs[0]; \ + ((TYPE*)DCI)->TPC = FLEXRAN_DCI->tpc; \ + ((TYPE*)DCI)->ndi = FLEXRAN_DCI->ndi[0]; + +#define FILL_DCI_TDD_1(TYPE, DCI, FLEXRAN_DCI) \ + ((TYPE*)DCI)->harq_pid = FLEXRAN_DCI->harq_process; \ + ((TYPE*)DCI)->rv = FLEXRAN_DCI->rv[0]; \ + ((TYPE*)DCI)->dai = FLEXRAN_DCI->dai; \ + ((TYPE*)DCI)->rballoc = FLEXRAN_DCI->rb_bitmap; \ + ((TYPE*)DCI)->rah = FLEXRAN_DCI->res_alloc; \ + ((TYPE*)DCI)->mcs = FLEXRAN_DCI->mcs[0]; \ + ((TYPE*)DCI)->TPC = FLEXRAN_DCI->tpc; \ + ((TYPE*)DCI)->ndi = FLEXRAN_DCI->ndi[0]; + +#endif diff --git a/openair2/LAYER2/MAC/main.c b/openair2/LAYER2/MAC/main.c index 4fee906f7497bec84e9876eaf5e868c59a170f30..203bd3f36f8a9e24b75bce6627a33bc9ac63f436 100644 --- a/openair2/LAYER2/MAC/main.c +++ b/openair2/LAYER2/MAC/main.c @@ -454,6 +454,7 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer,ui mac_xface->fill_rar = fill_rar; mac_xface->initiate_ra_proc = initiate_ra_proc; mac_xface->cancel_ra_proc = cancel_ra_proc; + mac_xface->set_msg3_subframe = set_msg3_subframe; mac_xface->SR_indication = SR_indication; mac_xface->UL_failure_indication = UL_failure_indication; mac_xface->rx_sdu = rx_sdu; @@ -526,6 +527,7 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer,ui mac_xface->phy_config_dedicated_eNB = phy_config_dedicated_eNB; mac_xface->phy_config_dedicated_ue = phy_config_dedicated_ue; + mac_xface->phy_config_harq_ue = phy_config_harq_ue; mac_xface->get_lte_frame_parms = get_lte_frame_parms; mac_xface->get_mu_mimo_mode = get_mu_mimo_mode; diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index 4aea92c3e2993795e135614958dde973a3e63361..ed12d322c10d43a7a1cd7eb3b34288b401fdf979 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -763,7 +763,7 @@ void dlsch_scheduler_pre_processor_reset (int module_idP, frameP,subframeP, &ue_sched_ctl->harq_pid[CC_id], &ue_sched_ctl->round[CC_id], - 0); + openair_harq_DL); if (ue_sched_ctl->ta_timer == 0) { // WE SHOULD PROTECT the eNB_UE_stats with a mutex here ... @@ -1028,7 +1028,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, // This is the actual CC_id in the list CC_id = UE_list->ordered_ULCCids[n][UE_id]; - mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,frameP,subframeP,&harq_pid,&round,1); + mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,frameP,subframeP,&harq_pid,&round,openair_harq_UL); if(round>0) { nb_allocated_rbs[CC_id][UE_id] = UE_list->UE_template[CC_id][UE_id].nb_rb_ul[harq_pid]; diff --git a/openair2/LAYER2/MAC/proto.h b/openair2/LAYER2/MAC/proto.h index 59d6c352feca094bebe2059038059d313ed22fc9..11fde1f4433436a639e53be96d4b4aaae7c82db4 100644 --- a/openair2/LAYER2/MAC/proto.h +++ b/openair2/LAYER2/MAC/proto.h @@ -28,6 +28,7 @@ */ #ifndef __LAYER2_MAC_PROTO_H__ #define __LAYER2_MAC_PROTO_H__ + /** \addtogroup _mac * @{ */ @@ -121,6 +122,7 @@ void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,i */ void schedule_ue_spec(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,int *mbsfn_flag); + /** \brief Function for UE/PHY to compute PUSCH transmit power in power-control procedure. @param Mod_id Module id of UE @returns Po_NOMINAL_PUSCH (PREAMBLE_RECEIVED_TARGET_POWER+DELTA_PREAMBLE @@ -246,6 +248,25 @@ unsigned short fill_rar( */ void cancel_ra_proc(module_id_t module_idP,int CC_id,frame_t frameP, uint16_t preamble_index); +/* \brief Function used by PHY to inform MAC that an uplink is scheduled + for Msg3 in given subframe. This is used so that the MAC + scheduler marks as busy the RBs used by the Msg3. +@param Mod_id Instance ID of eNB +@param CC_id CC ID of eNB +@param frame current frame +@param subframe current subframe +@param rnti UE rnti concerned +@param Msg3_frame frame where scheduling takes place +@param Msg3_subframe subframe where scheduling takes place +*/ +void set_msg3_subframe(module_id_t Mod_id, + int CC_id, + int frame, + int subframe, + int rnti, + int Msg3_frame, + int Msg3_subframe); + /* \brief Function to indicate a received SDU on ULSCH. @param Mod_id Instance ID of eNB @param rnti RNTI of UE transmitting the SR @@ -538,21 +559,6 @@ UE_L2_STATE_t ue_scheduler( */ int cba_access(module_id_t module_idP,frame_t frameP,sub_frame_t subframe, uint8_t eNB_index,uint16_t buflen); -/*! \fn int get_bsr_lcgid (module_id_t module_idP); -\brief determine the lcgid for the bsr -\param[in] Mod_id instance of the UE -\param[out] lcgid -*/ -int get_bsr_lcgid (module_id_t module_idP); - -/*! \fn uint8_t get_bsr_len (module_id_t module_idP,uint16_t bufflen); -\brief determine whether the bsr is short or long assuming that the MAC pdu is built -\param[in] Mod_id instance of the UE -\param[in] bufflen size of phy transport block -\param[out] bsr_len size of bsr control element -*/ -uint8_t get_bsr_len (module_id_t module_idP, uint16_t buflen); - /*! \fn BSR_SHORT * get_bsr_short(module_id_t module_idP, uint8_t bsr_len) \brief get short bsr level \param[in] Mod_id instance of the UE @@ -569,22 +575,21 @@ BSR_SHORT *get_bsr_short(module_id_t module_idP, uint8_t bsr_len); */ BSR_LONG * get_bsr_long(module_id_t module_idP, uint8_t bsr_len); -/*! \fn boolean_t update_bsr(module_id_t module_idP, frame_t frameP, uint8_t lcid) +/*! \fn boolean_t update_bsr(module_id_t module_idP, frame_t frameP,sub_frame_t subframeP) \brief get the rlc stats and update the bsr level for each lcid \param[in] Mod_id instance of the UE \param[in] frame Frame index -\param[in] lcid logical channel identifier */ -boolean_t update_bsr(module_id_t module_idP, frame_t frameP, eNB_index_t eNB_index, uint8_t lcid, uint8_t lcgid); +boolean_t update_bsr(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP,eNB_index_t eNB_index); -/*! \fn locate (int *table, int size, int value) +/*! \fn locate_BsrIndexByBufferSize (int *table, int size, int value) \brief locate the BSR level in the table as defined in 36.321. This function requires that he values in table to be monotonic, either increasing or decreasing. The returned value is not less than 0, nor greater than n-1, where n is the size of table. \param[in] *table Pointer to BSR table \param[in] size Size of the table \param[in] value Value of the buffer \return the index in the BSR_LEVEL table */ -uint8_t locate (const uint32_t *table, int size, int value); +uint8_t locate_BsrIndexByBufferSize (const uint32_t *table, int size, int value); /*! \fn int get_sf_periodicBSRTimer(uint8_t periodicBSR_Timer) diff --git a/openair2/LAYER2/MAC/ra_procedures.c b/openair2/LAYER2/MAC/ra_procedures.c index 30137fab33409f3defdf6bbf08130051264f4728..4d5bb7aad5ad6ea949ef54009163ab5c5e2f46e0 100644 --- a/openair2/LAYER2/MAC/ra_procedures.c +++ b/openair2/LAYER2/MAC/ra_procedures.c @@ -391,7 +391,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP, 1); //post_padding return(&UE_mac_inst[module_idP].RA_prach_resources); - } else if (UE_mac_inst[module_idP].scheduling_info.BSR_bytes[DCCH] > 0) { + } else if (UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[DCCH]] > 0) { // This is for triggering a transmission on DCCH using PRACH (during handover, or sending SR for example) dcch_header_len = 2 + 2; /// SHORT Subheader + C-RNTI control element rlc_status = mac_rlc_status_ind(module_idP,UE_mac_inst[module_idP].crnti, eNB_indexP,frameP,ENB_FLAG_NO,MBMS_FLAG_NO, @@ -412,7 +412,12 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP, (char *)&ulsch_buff[0]); LOG_D(MAC,"[UE %d] TX Got %d bytes for DCCH\n",module_idP,sdu_lengths[0]); - update_bsr(module_idP, frameP, eNB_indexP,DCCH,UE_mac_inst[module_idP].scheduling_info.LCGID[DCCH]); + update_bsr(module_idP, frameP, subframeP,eNB_indexP); + UE_mac_inst[module_idP].scheduling_info.BSR[UE_mac_inst[module_idP].scheduling_info.LCGID[DCCH]] = + locate_BsrIndexByBufferSize(BSR_TABLE, BSR_TABLE_SIZE, UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[DCCH]]); + + //TO DO: fill BSR infos in UL TBS + //header_len +=2; UE_mac_inst[module_idP].RA_active = 1; UE_mac_inst[module_idP].RA_PREAMBLE_TRANSMISSION_COUNTER = 1; diff --git a/openair2/LAYER2/MAC/ue_procedures.c b/openair2/LAYER2/MAC/ue_procedures.c index d5958f6e5e3d5cf6f450b7908be42cdc3cc4e477..642475a063a25613828f8e35690ca472ed6d01bb 100644 --- a/openair2/LAYER2/MAC/ue_procedures.c +++ b/openair2/LAYER2/MAC/ue_procedures.c @@ -70,6 +70,8 @@ #define DEBUG_HEADER_PARSING 1 #define ENABLE_MAC_PAYLOAD_DEBUG 1 +extern uint8_t usim_test; + /* #ifndef USER_MODE #define msg debug_msg @@ -91,7 +93,7 @@ void ue_init_mac(module_id_t module_idP) // default values as deined in 36.331 sec 9.2.2 LOG_I(MAC,"[UE%d] Applying default macMainConfig\n",module_idP); //UE_mac_inst[module_idP].scheduling_info.macConfig=NULL; - UE_mac_inst[module_idP].scheduling_info.retxBSR_Timer= MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf2560; + UE_mac_inst[module_idP].scheduling_info.retxBSR_Timer= MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf10240; UE_mac_inst[module_idP].scheduling_info.periodicBSR_Timer=MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_infinity; UE_mac_inst[module_idP].scheduling_info.periodicPHR_Timer = MAC_MainConfig__phr_Config__setup__periodicPHR_Timer_sf20; UE_mac_inst[module_idP].scheduling_info.prohibitPHR_Timer = MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf20; @@ -102,13 +104,19 @@ void ue_init_mac(module_id_t module_idP) UE_mac_inst[module_idP].scheduling_info.sr_ProhibitTimer_Running=0; UE_mac_inst[module_idP].scheduling_info.maxHARQ_Tx=MAC_MainConfig__ul_SCH_Config__maxHARQ_Tx_n5; UE_mac_inst[module_idP].scheduling_info.ttiBundling=0; + UE_mac_inst[module_idP].scheduling_info.extendedBSR_Sizes_r10=0; + UE_mac_inst[module_idP].scheduling_info.extendedPHR_r10=0; UE_mac_inst[module_idP].scheduling_info.drx_config=NULL; UE_mac_inst[module_idP].scheduling_info.phr_config=NULL; - UE_mac_inst[module_idP].scheduling_info.periodicBSR_SF = get_sf_periodicBSRTimer(UE_mac_inst[module_idP].scheduling_info.periodicBSR_Timer); - UE_mac_inst[module_idP].scheduling_info.retxBSR_SF = get_sf_retxBSRTimer(UE_mac_inst[module_idP].scheduling_info.retxBSR_Timer); + // set init value 0xFFFF, make sure periodic timer and retx time counters are NOT active, after bsr transmission set the value configured by the NW. + UE_mac_inst[module_idP].scheduling_info.periodicBSR_SF = MAC_UE_BSR_TIMER_NOT_RUNNING; + UE_mac_inst[module_idP].scheduling_info.retxBSR_SF = MAC_UE_BSR_TIMER_NOT_RUNNING; + UE_mac_inst[module_idP].BSR_reporting_active = BSR_TRIGGER_NONE; + UE_mac_inst[module_idP].scheduling_info.periodicPHR_SF = get_sf_perioidicPHR_Timer(UE_mac_inst[module_idP].scheduling_info.periodicPHR_Timer); UE_mac_inst[module_idP].scheduling_info.prohibitPHR_SF = get_sf_prohibitPHR_Timer(UE_mac_inst[module_idP].scheduling_info.prohibitPHR_Timer); UE_mac_inst[module_idP].scheduling_info.PathlossChange_db = get_db_dl_PathlossChange(UE_mac_inst[module_idP].scheduling_info.PathlossChange); + UE_mac_inst[module_idP].PHR_reporting_active = 0; for (i=0; i < MAX_NUM_LCID; i++) { LOG_D(MAC,"[UE%d] Applying default logical channel config for LCGID %d\n",module_idP,i); @@ -121,7 +129,8 @@ void ue_init_mac(module_id_t module_idP) UE_mac_inst[module_idP].scheduling_info.LCGID[i]=1; } - UE_mac_inst[module_idP].scheduling_info.LCID_status[i]=0; + UE_mac_inst[module_idP].scheduling_info.LCID_status[i]=LCID_EMPTY; + UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[i] = 0; } #ifdef CBA @@ -304,6 +313,14 @@ uint32_t ue_get_SR(module_id_t module_idP,int CC_id,frame_t frameP,uint8_t eNB_i // notify RRC to relase PUCCH/SRS // clear any configured dl/ul // initiate RA + if (UE_mac_inst[module_idP].scheduling_info.SR_pending){ + // release all pucch resource + UE_mac_inst[module_idP].physicalConfigDedicated = NULL; + UE_mac_inst[module_idP].ul_active=0; + UE_mac_inst[module_idP].BSR_reporting_active=BSR_TRIGGER_NONE; + + LOG_I(MAC,"[UE %d] Release all SRs \n", module_idP); + } UE_mac_inst[module_idP].scheduling_info.SR_pending=0; UE_mac_inst[module_idP].scheduling_info.SR_COUNTER=0; return(0); @@ -312,12 +329,16 @@ uint32_t ue_get_SR(module_id_t module_idP,int CC_id,frame_t frameP,uint8_t eNB_i //------------------------------------------------------------------------------ void -ue_send_sdu(module_id_t module_idP, +ue_send_sdu( + module_id_t module_idP, uint8_t CC_id, frame_t frameP, uint8_t* sdu, uint16_t sdu_len, - uint8_t eNB_index) { + uint8_t eNB_index +) +//------------------------------------------------------------------------------ +{ unsigned char rx_ces[MAX_NUM_CE],num_ce,num_sdu,i,*payload_ptr; unsigned char rx_lcids[NB_RB_MAX]; @@ -1131,8 +1152,6 @@ unsigned char generate_ulsch_header(uint8_t *mac_header, *(ce_ptr) = (long_bsr->Buffer_size0 << 2) | ((long_bsr->Buffer_size1 & 0x30) >> 4); *(ce_ptr + 1) = ((long_bsr->Buffer_size1 & 0x0F) << 4) | ((long_bsr->Buffer_size2 & 0x3C) >> 2); *(ce_ptr + 2) = ((long_bsr->Buffer_size2 & 0x03) << 2) | (long_bsr->Buffer_size3 & 0x3F); - /* Padding */ - *(ce_ptr + 3) = 0; ce_ptr += BSR_LONG_SIZE; // printf("(cont_res) : offset %d\n",ce_ptr-mac_header_control_elements); @@ -1145,50 +1164,67 @@ unsigned char generate_ulsch_header(uint8_t *mac_header, LOG_T(MAC,"[UE] sdu subheader %d (lcid %d, %d bytes)\n",i,sdu_lcids[i],sdu_lengths[i]); #endif - if ((first_element>0)) { - mac_header_ptr->E = 1; -#ifdef DEBUG_HEADER_PARSING - LOG_D(MAC,"[UE] last subheader : %x (R%d,E%d,LCID%d)\n",*(unsigned char*)mac_header_ptr, - ((SCH_SUBHEADER_FIXED *)mac_header_ptr)->R, - ((SCH_SUBHEADER_FIXED *)mac_header_ptr)->E, - ((SCH_SUBHEADER_FIXED *)mac_header_ptr)->LCID); -#endif - mac_header_ptr+=last_size; - // printf("last_size %d,mac_header_ptr %p\n",last_size,mac_header_ptr); - } else { - first_element=1; - + if ((i == (num_sdus - 1)) && ((short_padding) || (post_padding == 0))) { + if (first_element>0) { + mac_header_ptr->E = 1; + #ifdef DEBUG_HEADER_PARSING + LOG_D(MAC,"[UE] last subheader : %x (R%d,E%d,LCID%d)\n",*(unsigned char*)mac_header_ptr, + ((SCH_SUBHEADER_FIXED *)mac_header_ptr)->R, + ((SCH_SUBHEADER_FIXED *)mac_header_ptr)->E, + ((SCH_SUBHEADER_FIXED *)mac_header_ptr)->LCID); + #endif + mac_header_ptr+=last_size; + } + mac_header_ptr->R = 0; + mac_header_ptr->E = 0; + mac_header_ptr->LCID = sdu_lcids[i]; } + else { + if ((first_element>0)) { + mac_header_ptr->E = 1; + #ifdef DEBUG_HEADER_PARSING + LOG_D(MAC,"[UE] last subheader : %x (R%d,E%d,LCID%d)\n",*(unsigned char*)mac_header_ptr, + ((SCH_SUBHEADER_FIXED *)mac_header_ptr)->R, + ((SCH_SUBHEADER_FIXED *)mac_header_ptr)->E, + ((SCH_SUBHEADER_FIXED *)mac_header_ptr)->LCID); + #endif + mac_header_ptr+=last_size; + // printf("last_size %d,mac_header_ptr %p\n",last_size,mac_header_ptr); + } else { + first_element=1; - if (sdu_lengths[i] < 128) { - ((SCH_SUBHEADER_SHORT *)mac_header_ptr)->R = 0; // 3 - ((SCH_SUBHEADER_SHORT *)mac_header_ptr)->E = 0; - ((SCH_SUBHEADER_SHORT *)mac_header_ptr)->F = 0; - ((SCH_SUBHEADER_SHORT *)mac_header_ptr)->LCID = sdu_lcids[i]; - ((SCH_SUBHEADER_SHORT *)mac_header_ptr)->L = (unsigned char)sdu_lengths[i]; - last_size=2; -#ifdef DEBUG_HEADER_PARSING - LOG_D(MAC,"[UE] short sdu\n"); - LOG_T(MAC,"[UE] last subheader : %x (R%d,E%d,LCID%d,F%d,L%d)\n", - ((uint16_t*)mac_header_ptr)[0], - ((SCH_SUBHEADER_SHORT *)mac_header_ptr)->R, - ((SCH_SUBHEADER_SHORT *)mac_header_ptr)->E, - ((SCH_SUBHEADER_SHORT *)mac_header_ptr)->LCID, - ((SCH_SUBHEADER_SHORT *)mac_header_ptr)->F, - ((SCH_SUBHEADER_SHORT *)mac_header_ptr)->L); -#endif - } else { - ((SCH_SUBHEADER_LONG *)mac_header_ptr)->R = 0; - ((SCH_SUBHEADER_LONG *)mac_header_ptr)->E = 0; - ((SCH_SUBHEADER_LONG *)mac_header_ptr)->F = 1; - ((SCH_SUBHEADER_LONG *)mac_header_ptr)->LCID = sdu_lcids[i]; - ((SCH_SUBHEADER_LONG *)mac_header_ptr)->L_MSB = ((unsigned short) sdu_lengths[i]>>8)&0x7f; - ((SCH_SUBHEADER_LONG *)mac_header_ptr)->L_LSB = (unsigned short) sdu_lengths[i]&0xff; - ((SCH_SUBHEADER_LONG *)mac_header_ptr)->padding = 0x00; - last_size=3; -#ifdef DEBUG_HEADER_PARSING - LOG_D(MAC,"[UE] long sdu\n"); -#endif + } + + if (sdu_lengths[i] < 128) { + ((SCH_SUBHEADER_SHORT *)mac_header_ptr)->R = 0; // 3 + ((SCH_SUBHEADER_SHORT *)mac_header_ptr)->E = 0; + ((SCH_SUBHEADER_SHORT *)mac_header_ptr)->F = 0; + ((SCH_SUBHEADER_SHORT *)mac_header_ptr)->LCID = sdu_lcids[i]; + ((SCH_SUBHEADER_SHORT *)mac_header_ptr)->L = (unsigned char)sdu_lengths[i]; + last_size=2; + #ifdef DEBUG_HEADER_PARSING + LOG_D(MAC,"[UE] short sdu\n"); + LOG_T(MAC,"[UE] last subheader : %x (R%d,E%d,LCID%d,F%d,L%d)\n", + ((uint16_t*)mac_header_ptr)[0], + ((SCH_SUBHEADER_SHORT *)mac_header_ptr)->R, + ((SCH_SUBHEADER_SHORT *)mac_header_ptr)->E, + ((SCH_SUBHEADER_SHORT *)mac_header_ptr)->LCID, + ((SCH_SUBHEADER_SHORT *)mac_header_ptr)->F, + ((SCH_SUBHEADER_SHORT *)mac_header_ptr)->L); + #endif + } else { + ((SCH_SUBHEADER_LONG *)mac_header_ptr)->R = 0; + ((SCH_SUBHEADER_LONG *)mac_header_ptr)->E = 0; + ((SCH_SUBHEADER_LONG *)mac_header_ptr)->F = 1; + ((SCH_SUBHEADER_LONG *)mac_header_ptr)->LCID = sdu_lcids[i]; + ((SCH_SUBHEADER_LONG *)mac_header_ptr)->L_MSB = ((unsigned short) sdu_lengths[i]>>8)&0x7f; + ((SCH_SUBHEADER_LONG *)mac_header_ptr)->L_LSB = (unsigned short) sdu_lengths[i]&0xff; + ((SCH_SUBHEADER_LONG *)mac_header_ptr)->padding = 0x00; + last_size=3; + #ifdef DEBUG_HEADER_PARSING + LOG_D(MAC,"[UE] long sdu\n"); + #endif + } } } @@ -1206,6 +1242,7 @@ unsigned char generate_ulsch_header(uint8_t *mac_header, //mac_header_ptr=last_size; // FIXME: should be ++ } + if ((ce_ptr-mac_header_control_elements) > 0) { memcpy((void*)mac_header_ptr,mac_header_control_elements,ce_ptr-mac_header_control_elements); mac_header_ptr+=(unsigned char)(ce_ptr-mac_header_control_elements); @@ -1228,27 +1265,36 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf { mac_rlc_status_resp_t rlc_status; - uint8_t dcch_header_len=0,dcch1_header_len=0,dtch_header_len=0,dtch_header_len_last=0; - uint8_t dcch_header_len_tmp=0, dtch_header_len_tmp=0; - uint8_t bsr_header_len=0, bsr_ce_len=0, bsr_len=0; + uint8_t total_rlc_pdu_header_len=0, rlc_pdu_header_len_last=0 ; + uint16_t buflen_remain = 0; + uint8_t bsr_len=0,bsr_ce_len=0,bsr_header_len=0; uint8_t phr_header_len=0, phr_ce_len=0,phr_len=0; - uint8_t lcid=0; + uint8_t lcid=0,lcid_rlc_pdu_count=0; + boolean_t is_lcid_processed = FALSE; uint16_t sdu_lengths[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; uint8_t sdu_lcids[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; uint8_t payload_offset=0,num_sdus=0; uint8_t ulsch_buff[MAX_ULSCH_PAYLOAD_BYTES]; uint16_t sdu_length_total=0; - BSR_SHORT bsr_short; + BSR_SHORT bsr_short,bsr_truncated; BSR_LONG bsr_long; BSR_SHORT *bsr_s=&bsr_short; BSR_LONG *bsr_l=&bsr_long; + BSR_SHORT *bsr_t=&bsr_truncated; POWER_HEADROOM_CMD phr; POWER_HEADROOM_CMD *phr_p=&phr; - unsigned short short_padding=0, post_padding=0; - int lcgid; + unsigned short short_padding=0, post_padding=0, padding_len=0; int j; // used for padding // Compute header length + int lcg_id = 0; + int lcg_id_bsr_trunc = 0; + int highest_priority = 16; + int num_lcg_id_with_data = 0; + + LOG_D(MAC,"[UE %d] MAC PROCESS UL TRANSPORT BLOCK at frame%d subframe %d TBS=%d\n", + module_idP, frameP, subframe, buflen); + if (CC_id>0) { LOG_E(MAC,"Transmission on secondary CCs is not supported yet\n"); mac_xface->macphy_exit("MAC FATAL CC_id>0"); @@ -1276,33 +1322,76 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf } #endif - dcch_header_len=2;//sizeof(SCH_SUBHEADER_SHORT); - dcch1_header_len=2;//sizeof(SCH_SUBHEADER_SHORT); - // hypo length,in case of long header skip the padding byte - dtch_header_len=(buflen > 128 ) ? 3 : 2 ; //sizeof(SCH_SUBHEADER_LONG)-1 : sizeof(SCH_SUBHEADER_SHORT); - bsr_header_len = 1;//sizeof(SCH_SUBHEADER_FIXED); + bsr_header_len = 0; phr_header_len = 1;//sizeof(SCH_SUBHEADER_FIXED); - phr_ce_len = (UE_mac_inst[module_idP].PHR_reporting_active == 1) ? 1 /* sizeof(POWER_HEADROOM_CMD)*/: 0; - if (phr_ce_len > 0) { + while (lcg_id < MAX_NUM_LCGID) { + if (UE_mac_inst[module_idP].scheduling_info.BSR_bytes[lcg_id]){ + num_lcg_id_with_data ++; + } + lcg_id ++; + } + + if (num_lcg_id_with_data){ + LOG_D(MAC,"[UE %d] MAC Tx data pending at frame%d subframe %d nb LCG =%d Bytes for LCG0=%d LCG1=%d LCG2=%d LCG3=%d BSR Trigger status =%d TBS=%d\n", + module_idP, + frameP, + subframe, + num_lcg_id_with_data, + UE_mac_inst[module_idP].scheduling_info.BSR_bytes[0], + UE_mac_inst[module_idP].scheduling_info.BSR_bytes[1], + UE_mac_inst[module_idP].scheduling_info.BSR_bytes[2], + UE_mac_inst[module_idP].scheduling_info.BSR_bytes[3], + UE_mac_inst[module_idP].BSR_reporting_active, buflen); + + } + //Restart ReTxBSR Timer at new grant indication (36.321) + if (UE_mac_inst[module_idP].scheduling_info.retxBSR_SF != MAC_UE_BSR_TIMER_NOT_RUNNING){ + UE_mac_inst[module_idP].scheduling_info.retxBSR_SF = get_sf_retxBSRTimer(UE_mac_inst[module_idP].scheduling_info.retxBSR_Timer); + } + + // periodicBSR-Timer expires, trigger BSR + if ((UE_mac_inst[module_idP].scheduling_info.periodicBSR_Timer != MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_infinity) + && (UE_mac_inst[module_idP].scheduling_info.periodicBSR_SF == 0)){ + // Trigger BSR Periodic + UE_mac_inst[module_idP].BSR_reporting_active |= BSR_TRIGGER_PERIODIC; + + LOG_D(MAC,"[UE %d] MAC BSR Triggered PeriodicBSR Timer expiry at frame%d subframe %d TBS=%d\n", + module_idP, frameP, subframe, buflen); + + } + + //Compute BSR Length if Regular or Periodic BSR is triggered + //WARNING: if BSR long is computed, it may be changed to BSR short during or after multiplexing if there remains less than 1 LCGROUP with data after Tx + if (UE_mac_inst[module_idP].BSR_reporting_active){ + + AssertFatal ((UE_mac_inst[module_idP].BSR_reporting_active & BSR_TRIGGER_PADDING) == 0 , "Inconsistent BSR Trigger=%d !\n", + UE_mac_inst[module_idP].BSR_reporting_active); + + if (buflen >= 4){ + //A Regular or Periodic BSR can only be sent if TBS >= 4 as transmitting only a BSR is not allowed if UE has data to transmit + bsr_header_len = 1; + + if (num_lcg_id_with_data <= 1){ + bsr_ce_len = sizeof(BSR_SHORT); //1 byte + } + else{ + bsr_ce_len = BSR_LONG_SIZE; //3 bytes + } + } + } + + bsr_len = bsr_ce_len + bsr_header_len; + + phr_ce_len = (UE_mac_inst[module_idP].PHR_reporting_active == 1) ? 1 /* sizeof(POWER_HEADROOM_CMD)*/: 0; + if ((phr_ce_len > 0) && ((phr_ce_len + phr_header_len + bsr_len) <= buflen)){ phr_len = phr_ce_len + phr_header_len; LOG_D(MAC,"[UE %d] header size info: PHR len %d (ce%d,hdr%d) buff_len %d\n", module_idP, phr_len, phr_ce_len, phr_header_len, buflen); } else { phr_len=0; - } - - bsr_ce_len = get_bsr_len (module_idP, buflen-phr_len); - - if (bsr_ce_len > 0 ) { - bsr_len = bsr_ce_len + bsr_header_len; - LOG_D(MAC,"[UE %d] header size info: dcch %d, dcch1 %d, dtch %d, bsr (ce%d,hdr%d) buff_len %d\n", - module_idP, dcch_header_len,dcch1_header_len,dtch_header_len, bsr_ce_len, bsr_header_len, buflen); - } else { - bsr_len=0; - //LOG_D(MAC,"[UE %d] Empty buffers, send a long BSR to reset the bsr at eNB \n ",Mod_id); - // bsr_ce_len = sizeof(BSR_LONG); - //bsr_len = bsr_ce_len + bsr_header_len; + phr_header_len = 0; + phr_ce_len = 0; } // check for UL bandwidth requests and add SR control element @@ -1310,164 +1399,308 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf // check for UL bandwidth requests and add SR control element // Check for DCCH first +// TO DO: Unrool the loop to do it at least once to avoid the if num_sdu +for (lcid=DCCH; lcid < DTCH ; lcid++) { + if (UE_mac_inst[module_idP].scheduling_info.LCID_status[lcid] == LCID_NOT_EMPTY) { - if (UE_mac_inst[module_idP].scheduling_info.LCID_status[DCCH] == LCID_NOT_EMPTY) { - - rlc_status = mac_rlc_status_ind(module_idP, - UE_mac_inst[module_idP].crnti, - eNB_index, - frameP, - ENB_FLAG_NO, - MBMS_FLAG_NO, // eNB_index - DCCH, - (buflen-dcch_header_len-bsr_len-phr_len)); - LOG_D(MAC, "[UE %d] Frame %d : UL-DCCH -> ULSCH, RRC message has %d bytes to " - "send (Transport Block size %d, mac header len %d)\n", - module_idP,frameP, rlc_status.bytes_in_buffer,buflen,dcch_header_len); - - sdu_lengths[0] += mac_rlc_data_req(module_idP, - UE_mac_inst[module_idP].crnti, - eNB_index, - frameP, - ENB_FLAG_NO, - MBMS_FLAG_NO, - DCCH, - (char *)&ulsch_buff[sdu_lengths[0]]); - - sdu_length_total += sdu_lengths[0]; - sdu_lcids[0] = DCCH; - LOG_D(MAC,"[UE %d] TX Got %d bytes for DCCH\n",module_idP,sdu_lengths[0]); - num_sdus = 1; - update_bsr(module_idP, frameP, eNB_index, DCCH, UE_mac_inst[module_idP].scheduling_info.LCGID[DCCH]); - //header_len +=2; - } else { - dcch_header_len=0; - num_sdus = 0; - } - - // if the RLC AM is used, then RLC will only provide 2 bytes for ACK - // in this case, we sould add bsr - - // DCCH1 - if (UE_mac_inst[module_idP].scheduling_info.LCID_status[DCCH1] == LCID_NOT_EMPTY) { - - rlc_status = mac_rlc_status_ind(module_idP, - UE_mac_inst[module_idP].crnti, - eNB_index, - frameP, - ENB_FLAG_NO, - MBMS_FLAG_NO, // eNB_index - DCCH1, - (buflen-bsr_len-phr_len-dcch_header_len-dcch1_header_len-sdu_length_total)); - - LOG_D(MAC,"[UE %d] Frame %d : UL-DCCH1 -> ULSCH, RRC message has %d bytes to" - " send (Transport Block size %d, mac header len %d)\n", - module_idP,frameP, rlc_status.bytes_in_buffer,buflen,dcch1_header_len); - - sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP, - UE_mac_inst[module_idP].crnti, - eNB_index, - frameP, - ENB_FLAG_NO, - MBMS_FLAG_NO, - DCCH1, - (char *)&ulsch_buff[sdu_lengths[num_sdus]]); - sdu_length_total += sdu_lengths[num_sdus]; - sdu_lcids[num_sdus] = DCCH1; - LOG_D(MAC,"[UE %d] TX Got %d bytes for DCCH1\n",module_idP,sdu_lengths[num_sdus]); - num_sdus++; - //update_bsr(module_idP, frameP, DCCH1); - //dcch_header_len +=2; // include dcch1 - } else { - dcch1_header_len =0; - } + is_lcid_processed = FALSE; + lcid_rlc_pdu_count = 0; - dtch_header_len=0; - dtch_header_len_last=0; - for (lcid=NB_RB_MAX-1; lcid>=DTCH ; lcid--){ - dtch_header_len+=3; - dtch_header_len_last=3; - - if ((UE_mac_inst[module_idP].scheduling_info.LCID_status[lcid] == LCID_NOT_EMPTY) && - ((bsr_len+phr_len+dcch_header_len+dcch1_header_len+dtch_header_len+sdu_length_total) <= buflen)) { - - // optimize the dtch header lenght - //if ((UE_mac_inst[module_idP].scheduling_info.BSR_bytes[DTCH] > 128) && - /* if (((UE_mac_inst[module_idP].scheduling_info.BSR_bytes[DTCH] >= 128) && - ((UE_mac_inst[module_idP].scheduling_info.BSR_bytes[DTCH]+bsr_len+phr_len+dcch_header_len+dcch1_header_len+dtch_header_len) > buflen)&& - buflen >=128 )) - dtch_header_len = 3;//sizeof(SCH_SUBHEADER_LONG); - else - dtch_header_len = 2;//sizeof(SCH_SUBHEADER_SHORT); - */ - rlc_status = mac_rlc_status_ind(module_idP, - UE_mac_inst[module_idP].crnti, - eNB_index, - frameP, - ENB_FLAG_NO, - MBMS_FLAG_NO, // eNB_index - lcid, - buflen-bsr_len-phr_len-dcch_header_len-dcch1_header_len-dtch_header_len-sdu_length_total); - - LOG_D(MAC,"[UE %d] Frame %d : UL-DTCH -> ULSCH%d, %d bytes to send (Transport Block size %d, mac header len %d, BSR byte[%d] %d)\n", - module_idP,frameP, lcid, rlc_status.bytes_in_buffer,buflen,dtch_header_len, - lcid, UE_mac_inst[module_idP].scheduling_info.BSR_bytes[lcid]); - - if (rlc_status.bytes_in_buffer > 0) { - sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP, - UE_mac_inst[module_idP].crnti, - eNB_index, - frameP, - ENB_FLAG_NO, - MBMS_FLAG_NO, // eNB_index - lcid, - (char *)&ulsch_buff[sdu_length_total]); - - //adjust dtch header - LOG_D(MAC,"[UE %d] TX Got %d bytes for DTCH\n",module_idP,sdu_lengths[num_sdus]); - sdu_lcids[num_sdus] = lcid; - sdu_length_total += sdu_lengths[num_sdus]; - if (sdu_lengths[num_sdus] < 128) { - dtch_header_len --; - dtch_header_len_last --; - } - num_sdus++; - UE_mac_inst[module_idP].ul_active = update_bsr(module_idP, frameP, eNB_index,lcid, UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]); - } else { - dtch_header_len -= 3; - } - } else { // no rlc pdu : generate the dummy header - dtch_header_len -= 3; - } + //Multiplex all available DCCH RLC PDUs considering to multiplex the last PDU each time for maximize the data + //Adjust at the end of the loop + while ((!is_lcid_processed) && (bsr_len + phr_len + total_rlc_pdu_header_len + sdu_length_total + MIN_MAC_HDR_RLC_SIZE <= buflen)) { + + // Workaround for issue in OAI eNB or EPC which are not able to process SRB2 message multiplexed with SRB1 on the same MAC PDU + if ((usim_test == 0) && (lcid == DCCH1) && (lcid_rlc_pdu_count == 0) && (num_sdus)) { + + // Skip SRB2 multiplex if at least one SRB1 SDU is already multiplexed + break; + } + + buflen_remain = buflen - (bsr_len + phr_len + total_rlc_pdu_header_len + sdu_length_total + 1); + + rlc_status = mac_rlc_status_ind(module_idP, + UE_mac_inst[module_idP].crnti, + eNB_index, + frameP, + ENB_FLAG_NO, + MBMS_FLAG_NO, // eNB_index + lcid, + buflen_remain); + + // Workaround for BO issue in RLC AM ReTx : RLC BO can not be bigger than stored MAC BO + if (UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid] < rlc_status.bytes_in_buffer) { + + LOG_I(MAC, "[UE %d] Frame %d Subframe%d: WARNING Inconsistent BO! for LCID=%d MAC=%d RLC=%d RLC PDU nb=%d\n", + module_idP,frameP,subframe, + lcid,UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid],rlc_status.bytes_in_buffer,lcid_rlc_pdu_count); + + // Skip multiplexing for the LCID + break; + } + + /* + AssertFatal ( UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid] >= rlc_status.bytes_in_buffer, "Inconsistent BO! for LCID=%d MAC=%d RLC=%d RLC PDU nb=%d Frame %d Subrame %d\n", + lcid,UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid],rlc_status.bytes_in_buffer,lcid_rlc_pdu_count,frameP,subframe); + */ + + if (rlc_status.bytes_in_buffer > 0) { + + + LOG_D(MAC, "[UE %d] Frame %d : UL-DCCH -> ULSCH, RLC SRB%d has %d bytes to " + "send (Transport Block size %d BSR size=%d PHR=%d SDU Length Total %d , mac header len %d BSR byte before Tx=%d)\n", + module_idP,frameP, lcid,UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid],buflen,bsr_len,phr_len,sdu_length_total,total_rlc_pdu_header_len,UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]]); + + + sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP, + UE_mac_inst[module_idP].crnti, + eNB_index, + frameP, + ENB_FLAG_NO, + MBMS_FLAG_NO, + lcid, + (char *)&ulsch_buff[sdu_length_total]); + + + AssertFatal (UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid] >= sdu_lengths[num_sdus], "LCID=%d RLC has segmented %d bytes but MAC has max=%d\n", + lcid,sdu_lengths[num_sdus],UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid]); + + + + sdu_length_total += sdu_lengths[num_sdus]; + sdu_lcids[num_sdus] = lcid; + LOG_D(MAC,"[UE %d] TX Multiplex RLC PDU TX Got %d bytes for SRB%d\n",module_idP,sdu_lengths[num_sdus],lcid); + //header_len +=2; + // update LCID remain buffer + UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid] -= sdu_lengths[num_sdus]; + /* Update BSR : substract transmitted data */ + if (UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]] >= sdu_lengths[num_sdus]){ + UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]] -= sdu_lengths[num_sdus] ; + } + else { + LOG_I(MAC, "[UE %d] Frame %d Subframe%d: WARNING Buffer occupancy =%d for LCGID%d is lower than data transmitted=%d for LCID%d\n", + module_idP,frameP,subframe, + UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]], + UE_mac_inst[module_idP].scheduling_info.LCGID[lcid], + sdu_lengths[num_sdus],lcid); + UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]] = 0; + } + + //Update the number of LCGID with data as BSR shall reflect status after BSR transmission + if ((num_lcg_id_with_data > 1) && (UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]] == 0)) + { + num_lcg_id_with_data --; + // Change BSR size to BSR SHORT if num_lcg_id_with_data becomes to 1 + if ((bsr_len) && (num_lcg_id_with_data == 1)) + { + bsr_ce_len = sizeof(BSR_SHORT); + bsr_len = bsr_ce_len + bsr_header_len; + } + + } + + if (buflen == (bsr_len + phr_len + total_rlc_pdu_header_len + sdu_length_total + 1)) { + //No more remaining TBS after this PDU + //exit the function + rlc_pdu_header_len_last = 1; + is_lcid_processed = TRUE; + } + else { + rlc_pdu_header_len_last = (sdu_lengths[num_sdus] > 128 ) ? 3 : 2 ; + + //Change to 1 byte if it does not fit in the TBS, ie last PDU + if (buflen <= (bsr_len + phr_len + total_rlc_pdu_header_len + rlc_pdu_header_len_last + sdu_length_total)) { + rlc_pdu_header_len_last = 1; + is_lcid_processed = TRUE; + } + } + + //Update number of SDU + num_sdus ++; + + //Update total MAC Header size for RLC PDUs and save last one + total_rlc_pdu_header_len += rlc_pdu_header_len_last; + + } //end if (rlc_status.bytes_in_buffer > 0) + else { + // Switch to next LCID or exit the whole loop + is_lcid_processed = TRUE; + } + lcid_rlc_pdu_count ++; + } + + UE_mac_inst[module_idP].scheduling_info.LCID_status[lcid] = LCID_EMPTY; + } +} + + +// Now Check for DTCH first +// TO DO: do it according to Logical Channel Prioritization if at least 2 DTCH +for (lcid=DTCH; lcid < MAX_NUM_LCID ; lcid++) { +if (UE_mac_inst[module_idP].scheduling_info.LCID_status[lcid] == LCID_NOT_EMPTY) { + + is_lcid_processed = FALSE; + lcid_rlc_pdu_count = 0; + + //Multiplex all available DTCH RLC PDUs considering to multiplex the last PDU each time for maximize the data + //Adjust at the end of the loop + while ((!is_lcid_processed) && (bsr_len + phr_len + total_rlc_pdu_header_len + sdu_length_total + MIN_MAC_HDR_RLC_SIZE <= buflen)) { + + buflen_remain = buflen - (bsr_len + phr_len + total_rlc_pdu_header_len + sdu_length_total + 1); + + rlc_status = mac_rlc_status_ind(module_idP, + UE_mac_inst[module_idP].crnti, + eNB_index, + frameP, + ENB_FLAG_NO, + MBMS_FLAG_NO, // eNB_index + lcid, + buflen_remain); + + // Workaround for BO issue in RLC AM ReTx : RLC BO can not be bigger than stored MAC BO + if (UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid] < rlc_status.bytes_in_buffer) { + + LOG_I(MAC, "[UE %d] Frame %d Subframe%d: WARNING Inconsistent BO! for LCID=%d MAC=%d RLC=%d RLC PDU nb=%d\n", + module_idP,frameP,subframe, + lcid,UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid],rlc_status.bytes_in_buffer,lcid_rlc_pdu_count); + + // Skip multiplexing for the LCID + break; + } + + /* + AssertFatal ( UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid] >= rlc_status.bytes_in_buffer, "Inconsistent BO! for LCID=%d MAC=%d RLC=%d RLC PDU nb=%d Frame %d Subrame %d\n", + lcid,UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid],rlc_status.bytes_in_buffer,lcid_rlc_pdu_count,frameP,subframe); + */ + + if (rlc_status.bytes_in_buffer > 0) { + + + LOG_D(MAC, "[UE %d] Frame %d : UL-DTCH -> ULSCH, RLC LCID%d has %d bytes to " + "send (Transport Block size %d BSR size=%d PHR=%d SDU Length Total %d , mac header len %d BSR byte before Tx=%d)\n", + module_idP,frameP, lcid,UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid],buflen,bsr_len,phr_len,sdu_length_total,total_rlc_pdu_header_len,UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]]); + + + sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP, + UE_mac_inst[module_idP].crnti, + eNB_index, + frameP, + ENB_FLAG_NO, + MBMS_FLAG_NO, + lcid, + (char *)&ulsch_buff[sdu_length_total]); + + AssertFatal (sdu_lengths[num_sdus] < MAX_ULSCH_PAYLOAD_BYTES, "LCID=%d RLC PDU size = %d is too big\n", + lcid,sdu_lengths[num_sdus]); + + + AssertFatal (UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid] >= sdu_lengths[num_sdus], "LCID=%d RLC has segmented %d bytes but MAC has max=%d\n", + lcid,sdu_lengths[num_sdus],UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid]); + + + + sdu_length_total += sdu_lengths[num_sdus]; + sdu_lcids[num_sdus] = lcid; + LOG_D(MAC,"[UE %d] TX Multiplex RLC PDU TX Got %d bytes for LCID%d\n",module_idP,sdu_lengths[num_sdus],lcid); + //header_len +=2; + // update LCID remain buffer + UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid] -= sdu_lengths[num_sdus]; + /* Update BSR : substract transmitted data */ + if (UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]] >= sdu_lengths[num_sdus]){ + UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]] -= sdu_lengths[num_sdus] ; + } + else { + LOG_I(MAC, "[UE %d] Frame %d Subframe%d: WARNING Buffer occupancy =%d for LCGID%d is lower than data transmitted=%d for LCID%d\n", + module_idP,frameP,subframe, + UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]], + UE_mac_inst[module_idP].scheduling_info.LCGID[lcid], + sdu_lengths[num_sdus],lcid); + UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]] = 0; + } + + //Update the number of LCGID with data as BSR shall reflect status after BSR transmission + if ((num_lcg_id_with_data > 1) && (UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]] == 0)) + { + num_lcg_id_with_data --; + // Change BSR size to BSR SHORT if num_lcg_id_with_data becomes to 1 + if ((bsr_len) && (num_lcg_id_with_data == 1)) + { + bsr_ce_len = sizeof(BSR_SHORT); + bsr_len = bsr_ce_len + bsr_header_len; + } + + } + + if (buflen == (bsr_len + phr_len + total_rlc_pdu_header_len + sdu_length_total + 1)) { + //No more remaining TBS after this PDU + //exit the function + rlc_pdu_header_len_last = 1; + is_lcid_processed = TRUE; + } + else { + rlc_pdu_header_len_last = (sdu_lengths[num_sdus] > 128 ) ? 3 : 2 ; + + //Change to 1 byte if it does not fit in the TBS, ie last PDU + if (buflen <= (bsr_len + phr_len + total_rlc_pdu_header_len + rlc_pdu_header_len_last + sdu_length_total)) { + rlc_pdu_header_len_last = 1; + is_lcid_processed = TRUE; + } + } + + //Update number of SDU + num_sdus ++; + + //Update total MAC Header size for RLC PDUs and save last one + total_rlc_pdu_header_len += rlc_pdu_header_len_last; + + } //end if (rlc_status.bytes_in_buffer > 0) + else { + // Switch to next LCID or exit the whole loop + is_lcid_processed = TRUE; + } + lcid_rlc_pdu_count ++; + } + + UE_mac_inst[module_idP].scheduling_info.LCID_status[lcid] = LCID_EMPTY; + } +} + + //lcgid= get_bsr_lcgid(module_idP); + + // Compute BSR Values and update Nb LCGID with data after multiplexing + num_lcg_id_with_data = 0; + lcg_id_bsr_trunc = 0; + for (lcg_id=0;lcg_id<MAX_NUM_LCGID;lcg_id++){ + UE_mac_inst[module_idP].scheduling_info.BSR[lcg_id] = locate_BsrIndexByBufferSize(BSR_TABLE, BSR_TABLE_SIZE, UE_mac_inst[module_idP].scheduling_info.BSR_bytes[lcg_id]); + + if (UE_mac_inst[module_idP].scheduling_info.BSR_bytes[lcg_id]){ + num_lcg_id_with_data ++; + lcg_id_bsr_trunc = lcg_id; + } } - - lcgid= get_bsr_lcgid(module_idP); - - if (lcgid < 0 ) { - bsr_s = NULL; - bsr_l = NULL ; - } else if ((lcgid ==MAX_NUM_LCGID) && (bsr_ce_len == sizeof(BSR_LONG))) { - bsr_s = NULL; - bsr_l->Buffer_size0 = UE_mac_inst[module_idP].scheduling_info.BSR[LCGID0]; - bsr_l->Buffer_size1 = UE_mac_inst[module_idP].scheduling_info.BSR[LCGID1]; - bsr_l->Buffer_size2 = UE_mac_inst[module_idP].scheduling_info.BSR[LCGID2]; - bsr_l->Buffer_size3 = UE_mac_inst[module_idP].scheduling_info.BSR[LCGID3]; - LOG_D(MAC, "[UE %d] Frame %d report long BSR (level LCGID0 %d,level LCGID1 %d,level LCGID2 %d,level LCGID3 %d)\n", module_idP,frameP, - UE_mac_inst[module_idP].scheduling_info.BSR[LCGID0], - UE_mac_inst[module_idP].scheduling_info.BSR[LCGID1], - UE_mac_inst[module_idP].scheduling_info.BSR[LCGID2], - UE_mac_inst[module_idP].scheduling_info.BSR[LCGID3]); - } else if (bsr_ce_len == sizeof(BSR_SHORT)) { - bsr_l = NULL; - bsr_s->LCGID = lcgid; - bsr_s->Buffer_size = UE_mac_inst[module_idP].scheduling_info.BSR[lcgid]; - LOG_D(MAC,"[UE %d] Frame %d report SHORT BSR with level %d for LCGID %d\n", - module_idP, frameP, UE_mac_inst[module_idP].scheduling_info.BSR[lcgid],lcgid); - } else { - bsr_s = NULL; - bsr_l = NULL; + + + if (bsr_ce_len) { + //Print updated BSR when sent + LOG_D(MAC,"[UE %d] Remaining Buffer after Tx frame%d subframe %d nb LCG =%d Bytes for LCG0=%d LCG1=%d LCG2=%d LCG3=%d BSR Trigger status =%d TBS=%d\n", + module_idP, + frameP, + subframe, + num_lcg_id_with_data, + UE_mac_inst[module_idP].scheduling_info.BSR_bytes[0], + UE_mac_inst[module_idP].scheduling_info.BSR_bytes[1], + UE_mac_inst[module_idP].scheduling_info.BSR_bytes[2], + UE_mac_inst[module_idP].scheduling_info.BSR_bytes[3], + UE_mac_inst[module_idP].BSR_reporting_active, buflen); + + LOG_D(MAC,"[UE %d] Frame %d Subframe %d TX BSR Regular or Periodic size=%d BSR0=%d BSR1=%d BSR2=%d BSR3=%d\n",module_idP,frameP,subframe,bsr_ce_len, + UE_mac_inst[module_idP].scheduling_info.BSR[0], + UE_mac_inst[module_idP].scheduling_info.BSR[1], + UE_mac_inst[module_idP].scheduling_info.BSR[2], + UE_mac_inst[module_idP].scheduling_info.BSR[3]); } + // build PHR and update the timers if (phr_ce_len == sizeof(POWER_HEADROOM_CMD)) { phr_p->PH = get_phr_mapping(module_idP,CC_id,eNB_index); @@ -1481,37 +1714,146 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf LOG_T(MAC,"[UE %d] Frame %d: bsr s %p bsr_l %p, phr_p %p\n", module_idP,frameP,bsr_s, bsr_l, phr_p); - if (dtch_header_len == 0 ) - dtch_header_len_last =0; - - // adjust the header length - dcch_header_len_tmp = dcch_header_len; - dtch_header_len_tmp = dtch_header_len; - if (dtch_header_len==0) { - dcch_header_len = (dcch_header_len>0)? 1: dcch_header_len; - } else { - dtch_header_len_last-=1; - dtch_header_len= (dtch_header_len >0)? dtch_header_len - dtch_header_len_last : dtch_header_len; - } - - if ((buflen-bsr_len-phr_len-dcch_header_len-dcch1_header_len-dtch_header_len-sdu_length_total) <= 2) { - short_padding = buflen-bsr_len-phr_len-dcch_header_len-dcch1_header_len-dtch_header_len-sdu_length_total; + // Check BSR padding: it is done after PHR according to Logical Channel Prioritization order + // Check for max padding size, ie MAC Hdr for last RLC PDU = 1 + /* For Padding BSR: + - if the number of padding bits is equal to or larger than the size of the Short BSR plus its subheader but smaller than the size of the Long BSR plus its subheader: + - if more than one LCG has data available for transmission in the TTI where the BSR is transmitted: report Truncated BSR of the LCG with the highest priority logical channel with data available for transmission; + - else report Short BSR. + - else if the number of padding bits is equal to or larger than the size of the Long BSR plus its subheader, report Long BSR. + */ + if (sdu_length_total) { + padding_len = buflen - (bsr_len + phr_len + total_rlc_pdu_header_len - rlc_pdu_header_len_last + sdu_length_total + 1); + } + else { + padding_len = buflen - (bsr_len + phr_len); + } + + + if ((padding_len) && (bsr_len == 0)) + { + /* if the number of padding bits is equal to or larger than the size of the Long BSR plus its subheader, report Long BSR*/ + if (padding_len >= (1+BSR_LONG_SIZE)) + { + bsr_ce_len = BSR_LONG_SIZE; + bsr_header_len = 1; + // Trigger BSR Padding + UE_mac_inst[module_idP].BSR_reporting_active |= BSR_TRIGGER_PADDING; + + + } else if (padding_len >= (1+sizeof(BSR_SHORT))) { + bsr_ce_len = sizeof(BSR_SHORT); + bsr_header_len = 1; + + if (num_lcg_id_with_data > 1) + { + // REPORT TRUNCATED BSR + //Get LCGID of highest priority LCID with data + for (lcid=DCCH; lcid < MAX_NUM_LCID ; lcid++) { + if (UE_mac_inst[module_idP].logicalChannelConfig[lcid] != NULL) { + lcg_id = UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]; + + if ((lcg_id < MAX_NUM_LCGID) && (UE_mac_inst[module_idP].scheduling_info.BSR_bytes[lcg_id]) + && (UE_mac_inst[module_idP].logicalChannelConfig[lcid]->ul_SpecificParameters->priority <= highest_priority)) { + highest_priority = UE_mac_inst[module_idP].logicalChannelConfig[lcid]->ul_SpecificParameters->priority; + lcg_id_bsr_trunc = lcg_id; + } + } + } + } + else + { + //Report SHORT BSR, clear bsr_t + bsr_t = NULL; + } + + // Trigger BSR Padding + UE_mac_inst[module_idP].BSR_reporting_active |= BSR_TRIGGER_PADDING; + } + bsr_len = bsr_header_len + bsr_ce_len; + } + + //Fill BSR Infos + if (bsr_ce_len == 0 ) { + bsr_s = NULL; + bsr_l = NULL; + bsr_t = NULL; + } else if (bsr_ce_len == BSR_LONG_SIZE) { + bsr_s = NULL; + bsr_t = NULL; + bsr_l->Buffer_size0 = UE_mac_inst[module_idP].scheduling_info.BSR[LCGID0]; + bsr_l->Buffer_size1 = UE_mac_inst[module_idP].scheduling_info.BSR[LCGID1]; + bsr_l->Buffer_size2 = UE_mac_inst[module_idP].scheduling_info.BSR[LCGID2]; + bsr_l->Buffer_size3 = UE_mac_inst[module_idP].scheduling_info.BSR[LCGID3]; + + LOG_D(MAC, "[UE %d] Frame %d subframe %d BSR Trig=%d report long BSR (level LCGID0 %d,level LCGID1 %d,level LCGID2 %d,level LCGID3 %d)\n", module_idP,frameP,subframe, + UE_mac_inst[module_idP].BSR_reporting_active, + UE_mac_inst[module_idP].scheduling_info.BSR[LCGID0], + UE_mac_inst[module_idP].scheduling_info.BSR[LCGID1], + UE_mac_inst[module_idP].scheduling_info.BSR[LCGID2], + UE_mac_inst[module_idP].scheduling_info.BSR[LCGID3]); + + } else if (bsr_ce_len == sizeof(BSR_SHORT)) { + bsr_l = NULL; + if ((bsr_t != NULL) && (UE_mac_inst[module_idP].BSR_reporting_active & BSR_TRIGGER_PADDING)) { + //Truncated BSR + bsr_s = NULL; + bsr_t->LCGID = lcg_id_bsr_trunc; + bsr_t->Buffer_size = UE_mac_inst[module_idP].scheduling_info.BSR[lcg_id_bsr_trunc]; + + LOG_D(MAC,"[UE %d] Frame %d subframe %d BSR Trig=%d report TRUNCATED BSR with level %d for LCGID %d\n", + module_idP, frameP, subframe, UE_mac_inst[module_idP].BSR_reporting_active, UE_mac_inst[module_idP].scheduling_info.BSR[lcg_id_bsr_trunc],lcg_id_bsr_trunc); + + } + else + { + bsr_t = NULL; + bsr_s->LCGID = lcg_id_bsr_trunc; + bsr_s->Buffer_size = UE_mac_inst[module_idP].scheduling_info.BSR[lcg_id_bsr_trunc]; + + LOG_D(MAC,"[UE %d] Frame %d subframe %d BSR Trig=%d report SHORT BSR with level %d for LCGID %d\n", + module_idP, frameP, subframe, UE_mac_inst[module_idP].BSR_reporting_active, UE_mac_inst[module_idP].scheduling_info.BSR[lcg_id_bsr_trunc],lcg_id_bsr_trunc); + } + } + +// 1-bit padding or 2-bit padding special padding subheader +// Check for max padding size, ie MAC Hdr for last RLC PDU = 1 + if (sdu_length_total) { + padding_len = buflen - (bsr_len + phr_len + total_rlc_pdu_header_len - rlc_pdu_header_len_last + sdu_length_total + 1); + } + else { + padding_len = buflen - (bsr_len + phr_len); + } + + if (padding_len <= 2) { + short_padding = padding_len; + // only add padding header post_padding = 0; - } else { - if ((buflen-bsr_len-phr_len-dcch_header_len-dcch1_header_len-dtch_header_len-sdu_length_total) == buflen) { + //update total MAC Hdr size for RLC data + if (sdu_length_total) { + total_rlc_pdu_header_len = total_rlc_pdu_header_len - rlc_pdu_header_len_last + 1; + rlc_pdu_header_len_last = 1; + } + } + else if (sdu_length_total) { + post_padding = buflen - (bsr_len + phr_len + total_rlc_pdu_header_len + sdu_length_total + 1); + // If by adding MAC Hdr for last RLC PDU the padding is 0 then set MAC Hdr for last RLC PDU = 1 and compute 1 or 2 byte padding + if (post_padding == 0) { + total_rlc_pdu_header_len -= rlc_pdu_header_len_last; + padding_len = buflen - (bsr_len + phr_len + total_rlc_pdu_header_len + sdu_length_total + 1); + short_padding = padding_len; + total_rlc_pdu_header_len ++; + } + } + else { + if (padding_len == buflen) {// nona mac pdu *access_mode=CANCELED_ACCESS; } short_padding = 0; - if (dtch_header_len==0) { - dcch_header_len = dcch_header_len_tmp; - } else { - dtch_header_len= dtch_header_len_tmp; - } - - post_padding = buflen-bsr_len-phr_len-dcch_header_len-dcch1_header_len-dtch_header_len-sdu_length_total -1 ; + post_padding = buflen - (bsr_len + phr_len + total_rlc_pdu_header_len + sdu_length_total + 1); } // Generate header @@ -1524,26 +1866,57 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf sdu_lcids, // sdu lcid phr_p, // power headroom NULL, // crnti - NULL, // truncated bsr + bsr_t, // truncated bsr bsr_s, // short bsr bsr_l, post_padding); // long_bsr LOG_D(MAC, - "[UE %d] Generate header :bufflen %d sdu_length_total %d, num_sdus %d, sdu_lengths[0] %d, sdu_lcids[0] %d => payload offset %d, dcch_header_len %d, dtch_header_len %d, padding %d,post_padding %d, bsr len %d, phr len %d, reminder %d \n", - module_idP,buflen, sdu_length_total,num_sdus,sdu_lengths[0],sdu_lcids[0],payload_offset, dcch_header_len, dtch_header_len, + "[UE %d] Generate header :bufflen %d sdu_length_total %d, num_sdus %d, sdu_lengths[0] %d, sdu_lcids[0] %d => payload offset %d, total_rlc_pdu_header_len %d, padding %d,post_padding %d, bsr len %d, phr len %d, reminder %d \n", + module_idP,buflen, sdu_length_total,num_sdus,sdu_lengths[0],sdu_lcids[0],payload_offset, total_rlc_pdu_header_len, short_padding,post_padding, bsr_len, phr_len,buflen-sdu_length_total-payload_offset); // cycle through SDUs and place in ulsch_buffer - memcpy(&ulsch_buffer[payload_offset],ulsch_buff,sdu_length_total); + if (sdu_length_total) { + memcpy(&ulsch_buffer[payload_offset],ulsch_buff,sdu_length_total); + } // fill remainder of DLSCH with random data - for (j=0; j<(buflen-sdu_length_total-payload_offset); j++) { - ulsch_buffer[payload_offset+sdu_length_total+j] = (char)(taus()&0xff); + if (post_padding) { + for (j=0; j<(buflen-sdu_length_total-payload_offset); j++) { + ulsch_buffer[payload_offset+sdu_length_total+j] = (char)(taus()&0xff); + } } LOG_D(MAC,"[UE %d][SR] Gave SDU to PHY, clearing any scheduling request\n", module_idP,payload_offset, sdu_length_total); UE_mac_inst[module_idP].scheduling_info.SR_pending=0; UE_mac_inst[module_idP].scheduling_info.SR_COUNTER=0; + + /* Actions when a BSR is sent */ + if (bsr_ce_len) + { + LOG_D(MAC,"[UE %d] MAC BSR Sent !! bsr (ce%d,hdr%d) buff_len %d\n", + module_idP, bsr_ce_len, bsr_header_len, buflen); + + // Reset ReTx BSR Timer + UE_mac_inst[module_idP].scheduling_info.retxBSR_SF = get_sf_retxBSRTimer(UE_mac_inst[module_idP].scheduling_info.retxBSR_Timer); + + LOG_D(MAC,"[UE %d] MAC ReTx BSR Timer Reset =%d\n", + UE_mac_inst[module_idP].scheduling_info.retxBSR_SF); + + // Reset Periodic Timer except when BSR is truncated + if ((bsr_t == NULL) && (UE_mac_inst[module_idP].scheduling_info.periodicBSR_Timer != MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_infinity)) + { + UE_mac_inst[module_idP].scheduling_info.periodicBSR_SF = get_sf_periodicBSRTimer(UE_mac_inst[module_idP].scheduling_info.periodicBSR_Timer); + + LOG_D(MAC,"[UE %d] MAC Periodic BSR Timer Reset =%d\n", + UE_mac_inst[module_idP].scheduling_info.periodicBSR_SF); + + } + + // Reset BSR Trigger flags + UE_mac_inst[module_idP].BSR_reporting_active = BSR_TRIGGER_NONE; + } + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GET_SDU, VCD_FUNCTION_OUT); stop_meas(&UE_mac_inst[module_idP].tx_ulsch_sdu); @@ -1572,7 +1945,6 @@ ue_scheduler( const int CC_id) //------------------------------------------------------------------------------ { - int lcid; // lcid index int TTI= 1; int bucketsizeduration = -1; @@ -1581,6 +1953,7 @@ ue_scheduler( // int8_t lcg_id; struct RACH_ConfigCommon *rach_ConfigCommon = (struct RACH_ConfigCommon *)NULL; protocol_ctxt_t ctxt; + #if defined(ENABLE_ITTI) MessageDef *msg_p; const char *msg_name; @@ -1703,13 +2076,9 @@ ue_scheduler( } - // call SR procedure to generate pending SR and BSR for next PUCCH/PUSCH TxOp. This should implement the procedures - // outlined in Sections 5.4.4 an 5.4.5 of 36.321 - // Put this in another function - // Get RLC status info and update Bj for all lcids that are active - for (lcid=DCCH; lcid <= DTCH; lcid++ ) { - if ((lcid == 0) ||(UE_mac_inst[module_idP].logicalChannelConfig[lcid])) { + for (lcid=DCCH; lcid < MAX_NUM_LCID; lcid++ ) { + if (UE_mac_inst[module_idP].logicalChannelConfig[lcid]) { // meausre the Bj if ((directionP == SF_UL)&& (UE_mac_inst[module_idP].scheduling_info.Bj[lcid] >= 0)) { if (UE_mac_inst[module_idP].logicalChannelConfig[lcid]->ul_SpecificParameters) { @@ -1727,16 +2096,42 @@ ue_scheduler( } } - if (update_bsr(module_idP,frameP, eNB_indexP, lcid, UE_mac_inst[module_idP].scheduling_info.LCGID[lcid])) { - UE_mac_inst[module_idP].scheduling_info.SR_pending= 1; - LOG_D(MAC,"[UE %d][SR] Frame %d subframe %d SR for PUSCH is pending for LCGID %d with BSR level %d (%d bytes in RLC)\n", - module_idP, frameP,subframeP,UE_mac_inst[module_idP].scheduling_info.LCGID[lcid], - UE_mac_inst[module_idP].scheduling_info.BSR[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]], - UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]]); + /* + if (lcid == DCCH) { + LOG_D(MAC,"[UE %d][SR] Frame %d subframe %d Pending data for SRB1=%d for LCGID %d \n", + module_idP, frameP,subframeP,UE_mac_inst[module_idP].scheduling_info.BSR[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]], + UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]); } + */ } } + // Call BSR procedure as described in Section 5.4.5 in 36.321 + + // First check ReTxBSR Timer because it is always configured + // Decrement ReTxBSR Timer if it is running and not null + if ((UE_mac_inst[module_idP].scheduling_info.retxBSR_SF != MAC_UE_BSR_TIMER_NOT_RUNNING) + && (UE_mac_inst[module_idP].scheduling_info.retxBSR_SF != 0)){ + UE_mac_inst[module_idP].scheduling_info.retxBSR_SF --; + } + + // Decrement Periodic Timer if it is running and not null + if ((UE_mac_inst[module_idP].scheduling_info.periodicBSR_SF != MAC_UE_BSR_TIMER_NOT_RUNNING) + && (UE_mac_inst[module_idP].scheduling_info.periodicBSR_SF != 0)){ + UE_mac_inst[module_idP].scheduling_info.periodicBSR_SF--; + } + + //Check whether Regular BSR is triggered + if (update_bsr(module_idP,frameP, subframeP,eNB_indexP) == TRUE) { + // call SR procedure to generate pending SR and BSR for next PUCCH/PUSCH TxOp. This should implement the procedures + // outlined in Sections 5.4.4 an 5.4.5 of 36.321 + UE_mac_inst[module_idP].scheduling_info.SR_pending= 1; + // Regular BSR trigger + UE_mac_inst[module_idP].BSR_reporting_active |= BSR_TRIGGER_REGULAR; + LOG_D(MAC,"[UE %d][BSR] Regular BSR Triggered Frame %d subframe %d SR for PUSCH is pending\n", + module_idP, frameP,subframeP); + } + // UE has no valid phy config dedicated || no valid/released SR if ((UE_mac_inst[module_idP].physicalConfigDedicated == NULL)) { // cancel all pending SRs @@ -1949,103 +2344,147 @@ int cba_access(module_id_t module_idP,frame_t frameP,sub_frame_t subframe, uint8 } #endif -int get_bsr_lcgid (module_id_t module_idP) -{ - int lcgid, lcgid_tmp=-1; - int num_active_lcgid = 0; - - for (lcgid = 0 ; lcgid < MAX_NUM_LCGID; lcgid++) { - if (UE_mac_inst[module_idP].scheduling_info.BSR[lcgid] > 0 ) { - lcgid_tmp = lcgid; - num_active_lcgid+=1; - } - } - - if (num_active_lcgid == 0) { - return -1; - } else if (num_active_lcgid == 1) { - return lcgid_tmp; - } else { - return MAX_NUM_LCGID; - } -} - -uint8_t get_bsr_len (module_id_t module_idP, uint16_t buflen) -{ - - int lcgid=0; - uint8_t bsr_len=0, num_lcgid=0; - int pdu = 0; - - - for (lcgid=0; lcgid < MAX_NUM_LCGID; lcgid++ ) { - if (UE_mac_inst[module_idP].scheduling_info.BSR_bytes[lcgid] > 0 ) { - pdu += (UE_mac_inst[module_idP].scheduling_info.BSR_bytes[lcgid] + bsr_len + 2); //2 = sizeof(SCH_SUBHEADER_SHORT) - } - - if (UE_mac_inst[module_idP].scheduling_info.BSR_bytes[lcgid] > 128 ) { // long header size: adjust the header size - pdu += 1; - } - - // current phy buff can not transport all sdu for this lcgid -> transmit a bsr for this lcgid - - if ( (pdu > buflen) && (UE_mac_inst[module_idP].scheduling_info.BSR_bytes[lcgid] > 0 ) ) { - num_lcgid +=1; - bsr_len = (num_lcgid >= 2 ) ? sizeof(BSR_LONG) : sizeof(BSR_SHORT) ; - } - - LOG_D(MAC,"BSR Bytes %d for lcgid %d bsr len %d num lcgid %d\n", UE_mac_inst[module_idP].scheduling_info.BSR_bytes[lcgid], lcgid, bsr_len, num_lcgid); - } - - if ( bsr_len > 0 ) - LOG_D(MAC,"[UE %d] Prepare a %s (Transport Block Size %d, MAC pdu Size %d) \n", - module_idP, map_int_to_str(BSR_names, bsr_len), buflen, pdu); - - return bsr_len; -} - -boolean_t update_bsr(module_id_t module_idP, frame_t frameP, eNB_index_t eNB_index, uint8_t lcid, uint8_t lcg_id) +boolean_t update_bsr(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP,eNB_index_t eNB_index) { mac_rlc_status_resp_t rlc_status; - boolean_t sr_pending = FALSE; - - - if ((lcg_id < 0) || (lcg_id >= MAX_NUM_LCGID) ) { - return sr_pending; - } - - // fixme: need a better way to reset - if ((lcid == DCCH) || (lcid == DTCH)) { - UE_mac_inst[module_idP].scheduling_info.BSR[lcg_id]=0; - UE_mac_inst[module_idP].scheduling_info.BSR_bytes[lcg_id]=0; - } - - // for (lcid =0 ; lcid < MAX_NUM_LCID; lcid++) { - if (UE_mac_inst[module_idP].scheduling_info.LCGID[lcid] == lcg_id) { - rlc_status = mac_rlc_status_ind(module_idP, UE_mac_inst[module_idP].crnti,eNB_index,frameP,ENB_FLAG_NO,MBMS_FLAG_NO, - lcid, - 0); - - if (rlc_status.bytes_in_buffer > 0 ) { - sr_pending = TRUE; - UE_mac_inst[module_idP].scheduling_info.LCID_status[lcid] = LCID_NOT_EMPTY; - UE_mac_inst[module_idP].scheduling_info.BSR[lcg_id] += locate (BSR_TABLE,BSR_TABLE_SIZE, rlc_status.bytes_in_buffer); - UE_mac_inst[module_idP].scheduling_info.BSR_bytes[lcg_id] += rlc_status.bytes_in_buffer; - // UE_mac_inst[module_idP].scheduling_info.BSR_short_lcid = lcid; // only applicable to short bsr - LOG_D(MAC,"[UE %d] BSR level %d (LCGID %d, rlc buffer %d byte)\n", - module_idP, UE_mac_inst[module_idP].scheduling_info.BSR[lcg_id],lcg_id, UE_mac_inst[module_idP].scheduling_info.BSR_bytes[lcg_id]); - } else { - UE_mac_inst[module_idP].scheduling_info.LCID_status[lcid]=LCID_EMPTY; - } - } - - //} - return sr_pending; + boolean_t bsr_regular_triggered = FALSE; + uint8_t lcid; + uint8_t lcgid; + uint8_t num_lcid_with_data = 0; // for LCID with data only if LCGID is defined + uint16_t lcgid_buffer_remain[MAX_NUM_LCGID] = {0,0,0,0}; + int32_t lcid_bytes_in_buffer[MAX_NUM_LCID]; + /* Array for ordering LCID with data per decreasing priority order */ + uint8_t lcid_reordered_array[MAX_NUM_LCID]= + {MAX_NUM_LCID,MAX_NUM_LCID,MAX_NUM_LCID,MAX_NUM_LCID,MAX_NUM_LCID,MAX_NUM_LCID,MAX_NUM_LCID,MAX_NUM_LCID,MAX_NUM_LCID,MAX_NUM_LCID,MAX_NUM_LCID}; + uint8_t pos_next = 0; + uint8_t highest_priority = 16; + uint8_t array_index = 0; + + // Reset All BSR Infos + lcid_bytes_in_buffer[0] = 0; + for (lcid=DCCH; lcid < MAX_NUM_LCID; lcid++) + { + // Reset transmission status + lcid_bytes_in_buffer[lcid] = 0; + UE_mac_inst[module_idP].scheduling_info.LCID_status[lcid]=LCID_EMPTY; + } + + for (lcgid=0; lcgid < MAX_NUM_LCGID; lcgid++) + { + // Reset Buffer Info + UE_mac_inst[module_idP].scheduling_info.BSR[lcgid]=0; + UE_mac_inst[module_idP].scheduling_info.BSR_bytes[lcgid]=0; + } + + //Get Buffer Occupancy and fill lcid_reordered_array + for (lcid=DCCH; lcid < MAX_NUM_LCID; lcid++) + { + if (UE_mac_inst[module_idP].logicalChannelConfig[lcid]) + { + lcgid = UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]; + + // Store already available data to transmit per Group + if (lcgid < MAX_NUM_LCGID) + { + lcgid_buffer_remain[lcgid] += UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid]; + } + + rlc_status = mac_rlc_status_ind(module_idP, UE_mac_inst[module_idP].crnti,eNB_index,frameP,ENB_FLAG_NO,MBMS_FLAG_NO, + lcid, + 0); + + lcid_bytes_in_buffer[lcid] = rlc_status.bytes_in_buffer; + + if (rlc_status.bytes_in_buffer > 0) + { + LOG_D(MAC,"[UE %d] PDCCH Tick : LCID%d LCGID%d has data to transmit =%d bytes at frame %d subframe %d\n", + module_idP, lcid,lcgid,rlc_status.bytes_in_buffer,frameP,subframeP); + + UE_mac_inst[module_idP].scheduling_info.LCID_status[lcid] = LCID_NOT_EMPTY; + //Update BSR_bytes and position in lcid_reordered_array only if Group is defined + if (lcgid < MAX_NUM_LCGID) + { + num_lcid_with_data ++; + // sum lcid buffer which has same lcgid + UE_mac_inst[module_idP].scheduling_info.BSR_bytes[lcgid] += rlc_status.bytes_in_buffer; + + //Fill in the array + array_index = 0; + do + { + if (UE_mac_inst[module_idP].logicalChannelConfig[lcid]->ul_SpecificParameters->priority <= highest_priority) + { + //Insert if priority is higher or equal (lower or equal in value) + for (pos_next=num_lcid_with_data-1; pos_next > array_index; pos_next--) + { + lcid_reordered_array[pos_next] = lcid_reordered_array[pos_next - 1]; + + } + lcid_reordered_array[array_index] = lcid; + break; + + } + array_index ++; + } + while ((array_index < num_lcid_with_data) && (array_index < MAX_NUM_LCID)); + } + } + } + + } + + // Check whether a regular BSR can be triggered according to the first cases in 36.321 + if (num_lcid_with_data) + { + LOG_D(MAC,"[UE %d] PDCCH Tick at frame %d subframe %d: NumLCID with data=%d Reordered LCID0=%d LCID1=%d LCID2=%d\n", + module_idP, frameP, subframeP,num_lcid_with_data,lcid_reordered_array[0],lcid_reordered_array[1],lcid_reordered_array[2]); + + for (array_index=0; array_index < num_lcid_with_data; array_index++) + { + lcid = lcid_reordered_array[array_index]; + /* UL data, for a logical channel which belongs to a LCG, becomes available for transmission in the RLC entity + either the data belongs to a logical channel with higher priority than the priorities of the logical channels + which belong to any LCG and for which data is already available for transmission + */ + if ((UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid] == 0) + /* or there is no data available for any of the logical channels which belong to a LCG */ + ||(lcgid_buffer_remain[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]] == 0) + ) + { + bsr_regular_triggered = TRUE; + + LOG_D(MAC,"[UE %d] PDCCH Tick : MAC BSR Triggered LCID%d LCGID%d data become available at frame %d subframe %d\n", + module_idP, lcid,UE_mac_inst[module_idP].scheduling_info.LCGID[lcid],frameP, subframeP); + + break; + } + } + + // Trigger Regular BSR if ReTxBSR Timer has expired and UE has data for transmission + if (UE_mac_inst[module_idP].scheduling_info.retxBSR_SF == 0) + { + bsr_regular_triggered = TRUE; + + if ((UE_mac_inst[module_idP].BSR_reporting_active & BSR_TRIGGER_REGULAR) == 0) { + LOG_I(MAC,"[UE %d] PDCCH Tick : MAC BSR Triggered ReTxBSR Timer expiry at frame %d subframe %d\n", + module_idP, frameP, subframeP); + } + + } + } + + //Store Buffer Occupancy in remain buffers for next TTI + for (lcid=DCCH; lcid < MAX_NUM_LCID; lcid++) + { + UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid] = lcid_bytes_in_buffer[lcid]; + } + + return bsr_regular_triggered; } -uint8_t locate (const uint32_t *table, int size, int value) +uint8_t locate_BsrIndexByBufferSize (const uint32_t *table, int size, int value) { uint8_t ju, jm, jl; @@ -2144,7 +2583,7 @@ int get_sf_periodicBSRTimer(uint8_t sf_offset) case MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_infinity: default: - return -1; + return 0xFFFF; break; } } diff --git a/openair2/LAYER2/MAC/vars.h b/openair2/LAYER2/MAC/vars.h index 83d159f910a8521e7ebcf1a73692dbeddcd5d670..236439c6e5b732fff57292c5f3e71326974c0ed8 100644 --- a/openair2/LAYER2/MAC/vars.h +++ b/openair2/LAYER2/MAC/vars.h @@ -45,6 +45,15 @@ const uint32_t BSR_TABLE[BSR_TABLE_SIZE]= {0,10,12,14,17,19,22,26,31,36,42,49,57 1326,1552,1817,2127,2490,2915,3413,3995,4677,5467,6411,7505,8787,10287,12043,14099, 16507,19325,22624,26487,31009,36304,42502,49759,58255,68201,79846,93479,109439, 128125,150000, 300000 }; +// extended bsr table--currently not used +const uint32_t Extended_BSR_TABLE[BSR_TABLE_SIZE] = {0,10,13,16,19,23,29,35,43,53,65,80,98,120,147, + 181,223,274,337,414,509,625,769,945,1162,1429, + 1757,2161,2657,3267,4017,4940,6074,7469,9185, + 11294,13888,17077,20999,25822,31752,39045,48012, + 59039,72598,89272,109774,134986,165989,204111, + 250990,308634,379519,466683,573866,705666,867737, + 1067031,1312097,1613447,1984009,2439678,3000000, + 6000000}; //uint32_t EBSR_Level[63]={0,10,13,16,19,23,29,35,43,53,65,80,98,120,147,181}; diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c index 17808c03ffcbc221f644b85dcd7082cac1d06243..fedef42b60c9d10641d3fd884706f9ef85283d38 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c @@ -493,7 +493,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP) ctxt.enb_flag = ctxt_cpy.enb_flag; #ifdef PDCP_DEBUG - LOG_I(PDCP, "[PDCP][NETLINK] pdcp_read_header_g.rb_id = %d\n", pdcp_read_header_g.rb_id); + LOG_D(PDCP, "[PDCP][NETLINK] pdcp_read_header_g.rb_id = %d\n", pdcp_read_header_g.rb_id); #endif if (ctxt_cpy.enb_flag) { diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c index 85104b940cb235a2e4705699760817cb738d2495..ded7dc078393adc116d0c0e1ddf5861da94872b9 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c @@ -341,6 +341,7 @@ rlc_am_get_pdus ( if (pdu) { list_add_tail_eurecom (pdu, &rlc_pP->pdus_to_mac_layer); rlc_pP->status_requested = 0; + rlc_pP->status_buffer_occupancy = 0; rlc_am_start_timer_status_prohibit(ctxt_pP, rlc_pP); return; } diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c index 3232399d105bd9936862fd7964f53ea3142d7b32..51440d0bfa33bbd6688374173bb5e2d9ad630f28 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c @@ -426,7 +426,7 @@ rlc_um_rx (const protocol_ctxt_t* const ctxt_pP, void *argP, struct mac_data_ind //----------------------------------------------------------------------------- struct mac_status_resp -rlc_um_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP) +rlc_um_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP,const eNB_flag_t enb_flagP) { struct mac_status_resp status_resp; uint16_t sdu_size = 0; @@ -434,6 +434,7 @@ rlc_um_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP int32_t diff_time=0; rlc_um_entity_t *rlc_p = NULL; mem_block_t *mb_p = NULL; + unsigned int max_li_overhead = 0; status_resp.buffer_occupancy_in_pdus = 0; status_resp.buffer_occupancy_in_bytes = 0; @@ -453,7 +454,20 @@ rlc_um_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP if ((status_resp.buffer_occupancy_in_bytes > 0) && ((mb_p = list_get_head(&rlc_p->input_sdus)) != NULL)) { - status_resp.buffer_occupancy_in_bytes += rlc_p->tx_header_min_length_in_bytes; + //Fix on full Header size + if (enb_flagP == ENB_FLAG_NO) + { + // compute Length Indicator overhead to inform MAC of maximum full RLC PDU size according to stored SDUs + // For UE scheduler + // Could be useful for eNB: to be checked + if (rlc_p->input_sdus.nb_elements <= 1) { + max_li_overhead = 0; + } else { + unsigned int num_li = rlc_p->input_sdus.nb_elements - 1; + max_li_overhead = num_li + (num_li >> 1) + (num_li & 1); + } + } + status_resp.buffer_occupancy_in_bytes += (rlc_p->tx_header_min_length_in_bytes + max_li_overhead); status_resp.buffer_occupancy_in_pdus = rlc_p->input_sdus.nb_elements; diff_time = ctxt_pP->frame - ((struct rlc_um_tx_sdu_management *)mb_p->data)->sdu_creation_time; diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.h b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.h index d87f1e29d03f18e9fcd8fc0d180059e1bc0dbd1e..5951eaf1490c58f9b62cc4fca0aabeb4875ce163 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.h +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.h @@ -186,7 +186,7 @@ protected_rlc_um( void rlc_um_rx (const protocol_ctxt_t* const ctxt_pP, rlc_ * \param[in] tx_statusP Transmission status given by MAC on previous MAC transmission of the PDU. * \return The maximum number of bytes that can be served by RLC instance to MAC. */ -public_rlc_um( struct mac_status_resp rlc_um_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP);) +public_rlc_um( struct mac_status_resp rlc_um_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP, const eNB_flag_t enb_flagP);) /*! \fn struct mac_data_req rlc_um_mac_data_request (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP) * \brief Gives PDUs to lower layer MAC. diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_test.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_test.c index c9a82e12f6b1a827aced44e407f063210e0f1e41..92f18e72d7629e228aa4627dc850b3493d7888d5 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_test.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_test.c @@ -471,9 +471,9 @@ void rlc_um_v9_3_0_test_exchange_pdus(rlc_um_entity_t *um_txP, memset(&mac_rlc_status_resp_tx, 0, sizeof(struct mac_status_resp)); memset(&mac_rlc_status_resp_rx, 0, sizeof(struct mac_status_resp)); - mac_rlc_status_resp_tx = rlc_um_mac_status_indication(um_txP, g_frame, 1, bytes_txP, tx_status); + mac_rlc_status_resp_tx = rlc_um_mac_status_indication(um_txP, g_frame, 1, bytes_txP, tx_status,ENB_FLAG_YES); data_request_tx = rlc_um_mac_data_request(um_txP, g_frame); - mac_rlc_status_resp_rx = rlc_um_mac_status_indication(um_rxP, g_frame, 0, bytes_rxP, tx_status); + mac_rlc_status_resp_rx = rlc_um_mac_status_indication(um_rxP, g_frame, 0, bytes_rxP, tx_status,ENB_FLAG_YES); data_request_rx = rlc_um_mac_data_request(um_rxP, g_frame); @@ -517,9 +517,9 @@ void rlc_um_v9_3_0_test_exchange_delayed_pdus(rlc_um_entity_t *um_txP, memset(&mac_rlc_status_resp_tx, 0, sizeof(struct mac_status_resp)); memset(&mac_rlc_status_resp_rx, 0, sizeof(struct mac_status_resp)); - mac_rlc_status_resp_tx = rlc_um_mac_status_indication(um_txP, g_frame, 1, bytes_txP, tx_status); + mac_rlc_status_resp_tx = rlc_um_mac_status_indication(um_txP, g_frame, 1, bytes_txP, tx_status,ENB_FLAG_YES); data_request_tx = rlc_um_mac_data_request(um_txP, g_frame); - mac_rlc_status_resp_rx = rlc_um_mac_status_indication(um_rxP, g_frame, 0, bytes_rxP, tx_status); + mac_rlc_status_resp_rx = rlc_um_mac_status_indication(um_rxP, g_frame, 0, bytes_rxP, tx_status,ENB_FLAG_YES); data_request_rx = rlc_um_mac_data_request(um_rxP, g_frame); diff --git a/openair2/LAYER2/RLC/rlc_mac.c b/openair2/LAYER2/RLC/rlc_mac.c index 6462bb9abb0500afe2c22b9af59e5a9cc7c78248..d59b187dc763ea19dca362597393309fb1e03969 100644 --- a/openair2/LAYER2/RLC/rlc_mac.c +++ b/openair2/LAYER2/RLC/rlc_mac.c @@ -406,7 +406,7 @@ mac_rlc_status_resp_t mac_rlc_status_ind( break; case RLC_MODE_UM: - status_resp = rlc_um_mac_status_indication(&ctxt, &rlc_union_p->rlc.um, tb_sizeP, tx_status); + status_resp = rlc_um_mac_status_indication(&ctxt, &rlc_union_p->rlc.um, tb_sizeP, tx_status, enb_flagP); mac_rlc_status_resp.bytes_in_buffer = status_resp.buffer_occupancy_in_bytes; mac_rlc_status_resp.pdus_in_buffer = status_resp.buffer_occupancy_in_pdus; mac_rlc_status_resp.head_sdu_creation_time = status_resp.head_sdu_creation_time; diff --git a/openair2/LAYER2/openair2_proc.c b/openair2/LAYER2/openair2_proc.c index 702ddde45b2fbdae1ed240deffa6b30513f93993..677d49bb65b48ed6fd4339bd8db6930396a6a4e7 100644 --- a/openair2/LAYER2/openair2_proc.c +++ b/openair2/LAYER2/openair2_proc.c @@ -115,11 +115,13 @@ int dump_eNB_l2_stats(char *buffer, int length) for (CC_id=0 ; CC_id < MAX_NUM_CCs; CC_id++) { eNB->eNB_stats[CC_id].dlsch_bitrate= 0; - len += sprintf(&buffer[len],"eNB %d CC %d Frame %d: Active UEs %d, Available PRBs %d, nCCE %d \n", + len += sprintf(&buffer[len],"eNB %d CC %d Frame %d: Active UEs %d, Available PRBs %d, nCCE %d, Scheduling decisions %d, Missed Deadlines %d \n", eNB_id, CC_id, eNB->frame, eNB->eNB_stats[CC_id].num_dlactive_UEs, eNB->eNB_stats[CC_id].available_prbs, - eNB->eNB_stats[CC_id].available_ncces); + eNB->eNB_stats[CC_id].available_ncces, + eNB->eNB_stats[CC_id].sched_decisions, + eNB->eNB_stats[CC_id].missed_deadlines); len += sprintf(&buffer[len],"BCCH , NB_TX_MAC = %d, transmitted bytes (TTI %d, total %d) MCS (TTI %d)\n", eNB->eNB_stats[CC_id].total_num_bcch_pdu, diff --git a/openair2/NETWORK_DRIVER/UE_IP/common.c b/openair2/NETWORK_DRIVER/UE_IP/common.c index 6bef269de874ce0e60805d6e9c1f1c5ebf82e282..86968015975e09e05e37a6639bdcf6eee3cd6cff 100644 --- a/openair2/NETWORK_DRIVER/UE_IP/common.c +++ b/openair2/NETWORK_DRIVER/UE_IP/common.c @@ -99,7 +99,8 @@ ue_ip_common_class_wireless2ip( hard_header_len = ue_ip_dev[instP]->hard_header_len; skb_set_mac_header(skb_p, 0); - + skb_set_network_header(skb_p, hard_header_len); +skb_p->mark = rb_idP; //printk("[NAC_COMMIN_RECEIVE]: Packet Type %d (%d,%d)",skb_p->pkt_type,PACKET_HOST,PACKET_BROADCAST); skb_p->pkt_type = PACKET_HOST; @@ -344,7 +345,7 @@ void ue_ip_common_wireless2ip(struct nlmsghdr *nlh_pP) ue_ip_common_class_wireless2ip(pdcph_p->data_size, (unsigned char *)NLMSG_DATA(nlh_pP) + UE_IP_PDCPH_SIZE, - pdcph_p->inst, + 1, //pdcph_p->inst, pdcph_p->rb_id); } diff --git a/openair2/PHY_INTERFACE/defs.h b/openair2/PHY_INTERFACE/defs.h index 0892b4d0b17775667d898f65f315359af37edc2d..aeab9dfe665d84f25b8143312ec690ebc1aa4065 100644 --- a/openair2/PHY_INTERFACE/defs.h +++ b/openair2/PHY_INTERFACE/defs.h @@ -72,6 +72,16 @@ typedef struct { /// cancel an ongoing RA procedure void (*cancel_ra_proc)(module_id_t Mod_id,int CC_id,frame_t frameP,uint16_t preamble); + /// Inform MAC layer that an uplink is scheduled for Msg3 in given subframe. + /// This is used so that the MAC scheduler marks as busy the RBs used by the Msg3. + void (*set_msg3_subframe)(module_id_t Mod_id, + int CC_id, + int frame, + int subframe, + int rnti, + int Msg3_frame, + int Msg3_subframe); + /// Get DCI for current subframe from MAC DCI_PDU* (*get_dci_sdu)(module_id_t Mod_id,int CC_id,frame_t frameP,sub_frame_t subframe); @@ -175,6 +185,9 @@ typedef struct { void (*phy_config_dedicated_ue)(module_id_t Mod_id,int CC_id,uint8_t CH_index, struct PhysicalConfigDedicated *physicalConfigDedicated); + /// PHY-Config-harq UE + void (*phy_config_harq_ue)(module_id_t Mod_id,int CC_id,uint8_t CH_index, + uint16_t max_harq_tx); /// Configure Common PHY parameters from SIB1 void (*phy_config_sib1_ue)(module_id_t Mod_id,int CC_id,uint8_t CH_index, TDD_Config_t *tdd_config, diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index 7d2fc3a3d81752beba0d1c05a097930d6cc67a9a..b4290e8b9de4c61219a8580f9b67f7a9d881c5ae 100644 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -1388,6 +1388,7 @@ uint8_t do_RRCConnectionSetup( const protocol_ctxt_t* const ctxt_pP, rrc_eNB_ue_context_t* const ue_context_pP, + int CC_id, uint8_t* const buffer, const uint8_t transmission_mode, const uint8_t Transaction_id, @@ -1492,7 +1493,10 @@ do_RRCConnectionSetup( physicalConfigDedicated2->tpc_PDCCH_ConfigPUCCH = CALLOC(1,sizeof(*physicalConfigDedicated2->tpc_PDCCH_ConfigPUCCH)); physicalConfigDedicated2->tpc_PDCCH_ConfigPUSCH = CALLOC(1,sizeof(*physicalConfigDedicated2->tpc_PDCCH_ConfigPUSCH)); physicalConfigDedicated2->cqi_ReportConfig = CALLOC(1,sizeof(*physicalConfigDedicated2->cqi_ReportConfig)); - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated = CALLOC(1,sizeof(*physicalConfigDedicated2->soundingRS_UL_ConfigDedicated)); + if (enb_properties.properties[ctxt_pP->module_id]->srs_enable[CC_id]) + physicalConfigDedicated2->soundingRS_UL_ConfigDedicated = CALLOC(1,sizeof(*physicalConfigDedicated2->soundingRS_UL_ConfigDedicated)); + else + physicalConfigDedicated2->soundingRS_UL_ConfigDedicated = NULL; physicalConfigDedicated2->antennaInfo = CALLOC(1,sizeof(*physicalConfigDedicated2->antennaInfo)); physicalConfigDedicated2->schedulingRequestConfig = CALLOC(1,sizeof(*physicalConfigDedicated2->schedulingRequestConfig)); #ifdef CBA @@ -1578,17 +1582,19 @@ do_RRCConnectionSetup( */ //soundingRS-UL-ConfigDedicated - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->present = SoundingRS_UL_ConfigDedicated_PR_setup; - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_Bandwidth = - SoundingRS_UL_ConfigDedicated__setup__srs_Bandwidth_bw0; - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_HoppingBandwidth = - SoundingRS_UL_ConfigDedicated__setup__srs_HoppingBandwidth_hbw0; - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.freqDomainPosition=0; - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.duration=1; - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex=45; - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb=0; - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.cyclicShift= - SoundingRS_UL_ConfigDedicated__setup__cyclicShift_cs0; + if (enb_properties.properties[ctxt_pP->module_id]->srs_enable[CC_id]) { + physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->present = SoundingRS_UL_ConfigDedicated_PR_setup; + physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_Bandwidth = + SoundingRS_UL_ConfigDedicated__setup__srs_Bandwidth_bw0; + physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_HoppingBandwidth = + SoundingRS_UL_ConfigDedicated__setup__srs_HoppingBandwidth_hbw0; + physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.freqDomainPosition=0; + physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.duration=1; + physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex=45; + physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb=0; + physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.cyclicShift= + SoundingRS_UL_ConfigDedicated__setup__cyclicShift_cs0; + } //AntennaInfoDedicated diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.h b/openair2/RRC/LITE/MESSAGES/asn1_msg.h index 661914ea6ec730f2dc824ec8080d7a1799509e89..881a778030294a2d1e9262c57fedd43dd6576f64 100644 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.h +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.h @@ -133,6 +133,7 @@ do_RRCConnectionReconfigurationComplete( PhysicalConfigDedicated IEs. The latter does not enable periodic CQI reporting (PUCCH format 2/2a/2b) or SRS. @param ctxt_pP Running context @param ue_context_pP UE context +@param CC_id Component Carrier ID @param buffer Pointer to PER-encoded ASN.1 description of DL-CCCH-Message PDU @param transmission_mode Transmission mode for UE (1-9) @param UE_id UE index for this message @@ -144,6 +145,7 @@ uint8_t do_RRCConnectionSetup( const protocol_ctxt_t* const ctxt_pP, rrc_eNB_ue_context_t* const ue_context_pP, + int CC_id, uint8_t* const buffer, const uint8_t transmission_mode, const uint8_t Transaction_id, diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index d311e4bad0526e8095c32294b78b3d46e1c375f2..08d50da39cc92964d1ae44a8db1551924dce87d3 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -93,6 +93,9 @@ #include "SIMULATION/TOOLS/defs.h" // for taus +#if defined(FLEXRAN_AGENT_SB_IF) +#include "flexran_agent_extern.h" +#endif #define XER_PRINT #ifdef PHY_EMUL @@ -644,6 +647,9 @@ void rrc_eNB_emulation_notify_ue_module_id( // find enb_module_id for (enb_module_id = 0; enb_module_id < NUMBER_OF_eNB_MAX; enb_module_id++) { + if(enb_module_id>0){ /*FIX LATER*/ + return; + } for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { if (eNB_rrc_inst[enb_module_id].carrier[CC_id].sib1 != NULL) { if ( @@ -652,7 +658,6 @@ void rrc_eNB_emulation_notify_ue_module_id( (eNB_rrc_inst[enb_module_id].carrier[CC_id].sib1->cellAccessRelatedInfo.cellIdentity.buf[2] == cell_identity_byte2P) && (eNB_rrc_inst[enb_module_id].carrier[CC_id].sib1->cellAccessRelatedInfo.cellIdentity.buf[3] == cell_identity_byte3P) ) { - oai_emulation.info.eNB_ue_module_id_to_rnti[enb_module_id][ue_module_idP] = rntiP; ue_context_p = rrc_eNB_get_ue_context( &eNB_rrc_inst[enb_module_id], rntiP @@ -662,10 +667,11 @@ void rrc_eNB_emulation_notify_ue_module_id( oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[enb_module_id][ue_context_p->local_uid] = ue_module_idP; } - return; + //return; } } } + oai_emulation.info.eNB_ue_module_id_to_rnti[enb_module_id][ue_module_idP] = rntiP; } AssertFatal(enb_module_id == NUMBER_OF_eNB_MAX, @@ -3737,6 +3743,7 @@ rrc_eNB_generate_RRCConnectionSetup( eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0.Tx_buffer.payload_size = do_RRCConnectionSetup(ctxt_pP, ue_context_pP, + CC_id, (uint8_t*) eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0.Tx_buffer.Payload, (fp->nb_antennas_tx_eNB==2)?2:1, //at this point we do not have the UE capability information, so it can only be TM1 or TM2 rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id), @@ -4535,7 +4542,16 @@ rrc_eNB_decode_dcch( rrc_eNB_process_RRCConnectionReconfigurationComplete( ctxt_pP, ue_context_p, - ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier); + ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier); + +#if defined(FLEXRAN_AGENT_SB_IF) + //WARNING:Inform the controller about the UE activation. Should be moved to RRC agent in the future + if (mac_agent_registered[ctxt_pP->module_id]) { + agent_mac_xface[ctxt_pP->eNB_index]->flexran_agent_notify_ue_state_change(ctxt_pP->module_id, + ue_context_p->ue_id_rnti, + PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_UPDATED); + } +#endif } #if defined(ENABLE_ITTI) # if defined(ENABLE_USE_MME) @@ -4631,6 +4647,15 @@ rrc_eNB_decode_dcch( ue_context_p->ue_context.Status = RRC_CONNECTED; LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_CONNECTED \n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP)); + +#if defined(FLEXRAN_AGENT_SB_IF) + //WARNING:Inform the controller about the UE activation. Should be moved to RRC agent in the future + if (mac_agent_registered[ctxt_pP->module_id]) { + agent_mac_xface[ctxt_pP->eNB_index]->flexran_agent_notify_ue_state_change(ctxt_pP->module_id, + ue_context_p->ue_id_rnti, + PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_ACTIVATED); + } +#endif } } diff --git a/openair2/UTIL/ASYNC_IF/link_manager.c b/openair2/UTIL/ASYNC_IF/link_manager.c new file mode 100644 index 0000000000000000000000000000000000000000..1c9fb72bfe3f79d9636fd2808799b09af85e51ab --- /dev/null +++ b/openair2/UTIL/ASYNC_IF/link_manager.c @@ -0,0 +1,254 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file link_manager.c + * \brief this is the implementation of a link manager + * \author Cedric Roux + * \date November 2015 + * \version 1.0 + * \email: cedric.roux@eurecom.fr + * @ingroup _mac + */ + +#include "link_manager.h" +#include "log.h" + +#include <stdio.h> +#include <stdlib.h> +#include <pthread.h> + +/* that thread reads messages in the queue and sends them to the link */ +static void *link_manager_sender_thread(void *_manager) +{ + link_manager_t *manager = _manager; + void *data; + int size; + int priority; + + LOG_D(MAC, "starting link manager sender thread\n"); + + while (manager->run) { + while (message_get(manager->send_queue, &data, &size, &priority) == 0) { + link_send_packet(manager->socket_link, data, size); + free(data); + } + // if (message_get(manager->send_queue, &data, &size, &priority)) + // goto error; + //if (link_send_packet(manager->socket_link, data, size)) + // goto error; + //free(data); + } + + LOG_D(MAC, "link manager sender thread quits\n"); + + return NULL; + +error: + LOG_E(MAC, "%s: error\n", __FUNCTION__); + return NULL; +} + +/* that thread receives messages from the link and puts them in the queue */ +static void *link_manager_receiver_thread(void *_manager) +{ + link_manager_t *manager = _manager; + void *data; + int size; + + LOG_D(MAC, "starting link manager receiver thread\n"); + + while (manager->run) { + if (link_receive_packet(manager->socket_link, &data, &size)) + goto error; + /* todo: priority */ + if (message_put(manager->receive_queue, data, size, 0)) + goto error; + } + + LOG_D(MAC, "link manager receiver thread quits\n"); + + return NULL; + +error: + LOG_E(MAC, "%s: error\n", __FUNCTION__); + return NULL; +} + +link_manager_t *create_link_manager( + message_queue_t *send_queue, + message_queue_t *receive_queue, + socket_link_t *link) +{ + link_manager_t *ret = NULL; + pthread_attr_t attr; + pthread_t t; + + LOG_D(MAC, "create new link manager\n"); + + ret = calloc(1, sizeof(link_manager_t)); + if (ret == NULL) + goto error; + + ret->send_queue = send_queue; + ret->receive_queue = receive_queue; + ret->socket_link = link; + ret->run = 1; + + if (pthread_attr_init(&attr)) + goto error; + + // Make the async interface threads real-time + //#ifndef LOWLATENCY + struct sched_param sched_param_recv_thread; + struct sched_param sched_param_send_thread; + + sched_param_recv_thread.sched_priority = sched_get_priority_max(SCHED_RR) - 1; + pthread_attr_setschedparam(&attr, &sched_param_recv_thread); + pthread_attr_setschedpolicy(&attr, SCHED_RR); + //#endif + + if (pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED)) + goto error; + + if (pthread_create(&t, &attr, link_manager_sender_thread, ret)) + goto error; + ret->sender = t; + + if (pthread_create(&t, &attr, link_manager_receiver_thread, ret)) + /* we should destroy the other thread here */ + goto error; + ret->receiver = t; + + if (pthread_attr_destroy(&attr)) + /* to be clean we should destroy the threads at this point, + * even if in practice we never reach it */ + goto error; + + return ret; + +error: + LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); + free(ret); + return NULL; +} + +void destroy_link_manager(link_manager_t *manager) +{ + LOG_D(MAC, "destroying link manager\n"); + manager->run = 0; + /* todo: force threads to stop (using a dummy message?) */ +} + +#ifdef SERVER_TEST + +#include <string.h> + +int main(void) +{ + socket_link_t *link; + message_queue_t *send_queue; + message_queue_t *receive_queue; + link_manager_t *manager; + void *data; + int size; + int priority; + + printf("starting server\n"); + + link = new_link_server(2210); + if (link == NULL) goto error; + + send_queue = new_message_queue(); + if (send_queue == NULL) goto error; + receive_queue = new_message_queue(); + if (receive_queue == NULL) goto error; + + manager = create_link_manager(send_queue, receive_queue, link); + if (manager == NULL) goto error; + + data = strdup("hello"); if (data == NULL) goto error; + if (message_put(send_queue, data, 6, 100)) goto error; + + if (message_get(receive_queue, &data, &size, &priority)) goto error; + printf("received message:\n"); + printf(" data: %s\n", (char *)data); + printf(" size: %d\n", size); + printf(" priority: %d\n", priority); + + printf("server ends\n"); + return 0; + +error: + printf("there was an error\n"); + return 1; +} + +#endif + +#ifdef CLIENT_TEST + +#include <string.h> +#include <unistd.h> + +int main(void) +{ + socket_link_t *link; + message_queue_t *send_queue; + message_queue_t *receive_queue; + link_manager_t *manager; + void *data; + int size; + int priority; + + printf("starting client\n"); + + link = new_link_client("127.0.0.1", 2210); + if (link == NULL) goto error; + + send_queue = new_message_queue(); + if (send_queue == NULL) goto error; + receive_queue = new_message_queue(); + if (receive_queue == NULL) goto error; + + manager = create_link_manager(send_queue, receive_queue, link); + if (manager == NULL) goto error; + + if (message_get(receive_queue, &data, &size, &priority)) goto error; + printf("received message:\n"); + printf(" data: %s\n", (char *)data); + printf(" size: %d\n", size); + printf(" priority: %d\n", priority); + + data = strdup("world"); if (data == NULL) goto error; + if (message_put(send_queue, data, 6, 200)) goto error; + + /* let's wait for the message to be sent (unreliable sleep, but does it for the test) */ + sleep(1); + + printf("client ends\n"); + return 0; + +error: + printf("there was an error\n"); + return 1; +} + +#endif diff --git a/openair2/UTIL/ASYNC_IF/link_manager.h b/openair2/UTIL/ASYNC_IF/link_manager.h new file mode 100644 index 0000000000000000000000000000000000000000..a25c072b41245d17915b044dfde7e01c669452fd --- /dev/null +++ b/openair2/UTIL/ASYNC_IF/link_manager.h @@ -0,0 +1,63 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file link_manager.h + * \brief this is the implementation of a link manager + * \author Cedric Roux + * \date November 2015 + * \version 1.0 + * \email: cedric.roux@eurecom.fr + * @ingroup _mac + */ + +#ifndef LINK_MANAGER_H +#define LINK_MANAGER_H + +//#include "message_queue.h" +#include "ringbuffer_queue.h" +#include "socket_link.h" + +#include <pthread.h> + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + message_queue_t *send_queue; + message_queue_t *receive_queue; + socket_link_t *socket_link; + pthread_t sender; + pthread_t receiver; + volatile int run; +} link_manager_t; + +link_manager_t *create_link_manager( + message_queue_t *send_queue, + message_queue_t *receive_queue, + socket_link_t *link); +void destroy_link_manager(link_manager_t *); + +#ifdef __cplusplus +} +#endif + +#endif /* LINK_MANAGER_H */ diff --git a/openair2/UTIL/ASYNC_IF/message_queue.c b/openair2/UTIL/ASYNC_IF/message_queue.c new file mode 100644 index 0000000000000000000000000000000000000000..ee6c92d852a670d276720e7038f043a06eee8d94 --- /dev/null +++ b/openair2/UTIL/ASYNC_IF/message_queue.c @@ -0,0 +1,204 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file message_queue.c + * \brief this is the implementation of a message queue + * \author Cedric Roux + * \date November 2015 + * \version 1.0 + * \email: cedric.roux@eurecom.fr + * @ingroup _mac + */ + +#include "message_queue.h" +#include "log.h" + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <pthread.h> + +message_queue_t *new_message_queue(void) +{ + message_queue_t *ret = NULL; + + ret = calloc(1, sizeof(message_queue_t)); + if (ret == NULL) + goto error; + + ret->mutex = calloc(1, sizeof(pthread_mutex_t)); + if (ret->mutex == NULL) + goto error; + if (pthread_mutex_init(ret->mutex, NULL)) + goto error; + + ret->cond = calloc(1, sizeof(pthread_cond_t)); + if (ret->cond == NULL) + goto error; + if (pthread_cond_init(ret->cond, NULL)) + goto error; + + return ret; + +error: + LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); + if (ret != NULL) { + free(ret->mutex); + free(ret->cond); + memset(ret, 0, sizeof(message_queue_t)); + free(ret); + } + return NULL; +} + +int message_put(message_queue_t *queue, void *data, int size, int priority) +{ + message_t *m = NULL; + + m = calloc(1, sizeof(message_t)); + if (m == NULL) + goto error; + + m->data = data; + m->size = size; + m->priority = priority; + m->next = NULL; + + if (pthread_mutex_lock(queue->mutex)) + goto error; + + if (queue->count == 0) + queue->head = m; + else + queue->tail->next = m; + queue->tail = m; + + queue->count++; + + if (pthread_cond_signal(queue->cond)) { + LOG_E(MAC, "%s:%d:%s: fatal error\n", __FILE__, __LINE__, __FUNCTION__); + pthread_mutex_unlock(queue->mutex); + exit(1); + } + if (pthread_mutex_unlock(queue->mutex)) { + LOG_E(MAC, "%s:%d:%s: fatal error\n", __FILE__, __LINE__, __FUNCTION__); + exit(1); + } + + return 0; + +error: + free(m); + LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); + return -1; +} + +int message_get(message_queue_t *queue, void **data, int *size, int *priority) +{ + message_t *m; + + if (pthread_mutex_lock(queue->mutex)) + goto error; + + while (queue->count == 0) { + if (pthread_cond_wait(queue->cond, queue->mutex)) { + pthread_mutex_unlock(queue->mutex); + goto error; + } + } + + m = queue->head; + queue->head = queue->head->next; + if (queue->head == NULL) + queue->tail = NULL; + + queue->count--; + + if (pthread_mutex_unlock(queue->mutex)) + goto error; + + *data = m->data; + *size = m->size; + *priority = m->priority; + free(m); + + return 0; + +error: + LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); + return -1; +} + +/* when calling this function, the queue must not be used anymore (we don't lock it) */ +/* we suppose that the data pointer in messages was allocated by malloc/calloc/realloc */ +void destroy_message_queue(message_queue_t *queue) +{ + while (queue->head) { + message_t *m = queue->head; + queue->head = queue->head->next; + free(m->data); + memset(m, 0, sizeof(message_t)); + free(m); + } + free(queue->mutex); + free(queue->cond); + memset(queue, 0, sizeof(message_queue_t)); + free(queue); +} + +#ifdef TEST + +/* some very basic tests */ +int main(void) +{ + void *data; + int size; + int priority; + message_queue_t *q; + char *s; + + q = new_message_queue(); + if (q == NULL) goto error; + + if (message_put(q, "hello", 6, 0)) goto error; + if (message_put(q, "world", 6, 1)) goto error; + + if (message_get(q, &data, &size, &priority)) goto error; + printf("message:\n data: '%s'\n size: %d\n priority: %d\n", + (char *)data, size, priority); + if (message_get(q, &data, &size, &priority)) goto error; + printf("message:\n data: '%s'\n size: %d\n priority: %d\n", + (char *)data, size, priority); + + /* let's put a message before destroying the queue */ + s = malloc(10); if (s == NULL) goto error; + sprintf(s, "hello"); + if (message_put(q, s, 6, 0)) goto error; + destroy_message_queue(q); + + return 0; + +error: + printf("error\n"); + return 1; +} + +#endif diff --git a/openair2/UTIL/ASYNC_IF/message_queue.h b/openair2/UTIL/ASYNC_IF/message_queue.h new file mode 100644 index 0000000000000000000000000000000000000000..4e46ec08d673064702f025edd879405526b6fbe0 --- /dev/null +++ b/openair2/UTIL/ASYNC_IF/message_queue.h @@ -0,0 +1,64 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file message_queue.h + * \brief this is the implementation of a message queue + * \author Cedric Roux + * \date November 2015 + * \version 1.0 + * \email: cedric.roux@eurecom.fr + * @ingroup _mac + */ + +#ifndef MESSAGE_QUEUE_H +#define MESSAGE_QUEUE_H + +#include <pthread.h> + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct message_t { + void *data; + int size; + int priority; + struct message_t *next; +} message_t; + +typedef struct { + message_t *head; + message_t *tail; + volatile int count; + pthread_mutex_t *mutex; + pthread_cond_t *cond; +} message_queue_t; + +message_queue_t *new_message_queue(void); +int message_put(message_queue_t *queue, void *data, int size, int priority); +int message_get(message_queue_t *queue, void **data, int *size, int *priority); +void destroy_message_queue(message_queue_t *queue); + +#ifdef __cplusplus +} +#endif + +#endif /* MESSAGE_QUEUE_H */ diff --git a/openair2/UTIL/ASYNC_IF/ringbuffer_queue.c b/openair2/UTIL/ASYNC_IF/ringbuffer_queue.c new file mode 100644 index 0000000000000000000000000000000000000000..047e3f716c67cba5558948356fdaa76518acf9db --- /dev/null +++ b/openair2/UTIL/ASYNC_IF/ringbuffer_queue.c @@ -0,0 +1,136 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file ringbuffer_queue.c + * \brief Lock-free ringbuffer used for async message passing of agent + * \author Xenofon Foukas + * \date March 2016 + * \version 1.0 + * \email: x.foukas@sms.ed.ac.uk + * @ingroup _mac + */ + +#include "ringbuffer_queue.h" +#include "log.h" + +message_queue_t * new_message_queue(int size) { + + message_queue_t *ret = NULL; + + ret = calloc(1, sizeof(message_queue_t)); + if (ret == NULL) + goto error; + + lfds700_misc_library_init_valid_on_current_logical_core(); + lfds700_misc_prng_init(&(ret->ps)); + ret->ringbuffer_array = malloc(sizeof(struct lfds700_ringbuffer_element) * size); + lfds700_ringbuffer_init_valid_on_current_logical_core(&(ret->ringbuffer_state), + ret->ringbuffer_array, + size, + &(ret->ps), + NULL); + + return ret; + + error: + LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); + if (ret != NULL) { + free(ret->ringbuffer_array); + memset(ret, 0, sizeof(message_queue_t)); + free(ret); + } + return NULL; +} + +int message_put(message_queue_t *queue, void *data, int size, int priority) { + + struct lfds700_misc_prng_state ls; + enum lfds700_misc_flag overwrite_occurred_flag; + message_t *overwritten_msg; + message_t *m = NULL; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + lfds700_misc_prng_init(&ls); + + m = calloc(1, sizeof(message_t)); + if (m == NULL) + goto error; + + m->data = data; + m->size = size; + m->priority = priority; + + lfds700_ringbuffer_write(&(queue->ringbuffer_state), + NULL, + (void *) m, + &overwrite_occurred_flag, + NULL, + (void **) &overwritten_msg, + &ls); + + if (overwrite_occurred_flag == LFDS700_MISC_FLAG_RAISED) { + free(overwritten_msg->data); + free(overwritten_msg); + } + + return 0; + + error: + free(m); + LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); + return -1; +} + +int message_get(message_queue_t *queue, void **data, int *size, int *priority) { + message_t *m; + struct lfds700_misc_prng_state ls; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + lfds700_misc_prng_init(&ls); + + if (lfds700_ringbuffer_read(&(queue->ringbuffer_state), NULL, (void **) &m, &ls) == 0) { + return -1; + } + + *data = m->data; + *size = m->size; + *priority = m->priority; + free(m); + return 0; +} + +message_queue_t destroy_message_queue(message_queue_t *queue) { + struct lfds700_misc_prng_state ls; + + message_t *m; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + lfds700_misc_prng_init(&ls); + + while (lfds700_ringbuffer_read(&(queue->ringbuffer_state), NULL, (void **) &m, &ls) != 0) { + free(m->data); + memset(m, 0, sizeof(message_t)); + free(m); + } + free(queue->ringbuffer_array); + memset(queue, 0, sizeof(message_queue_t)); + free(queue); +} diff --git a/openair2/UTIL/ASYNC_IF/ringbuffer_queue.h b/openair2/UTIL/ASYNC_IF/ringbuffer_queue.h new file mode 100644 index 0000000000000000000000000000000000000000..7dc4637404773c67457b8ec7680e5aedcbce167f --- /dev/null +++ b/openair2/UTIL/ASYNC_IF/ringbuffer_queue.h @@ -0,0 +1,53 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file ringbuffer_queue.h + * \brief Lock-free ringbuffer used for async message passing of agent + * \author Xenofon Foukas + * \date March 2016 + * \version 1.0 + * \email: x.foukas@sms.ed.ac.uk + * @ingroup _mac + */ + +#ifndef RINGBUFFER_QUEUE_H +#define RINGBUFFER_QUEUE_H + +#include "liblfds700.h" + +typedef struct message_s { + void *data; + int size; + int priority; +} message_t; + +typedef struct { + struct lfds700_misc_prng_state ps; + struct lfds700_ringbuffer_element *ringbuffer_array; + struct lfds700_ringbuffer_state ringbuffer_state; +} message_queue_t; + +message_queue_t * new_message_queue(int size); +int message_put(message_queue_t *queue, void *data, int size, int priority); +int message_get(message_queue_t *queue, void **data, int *size, int *priority); +message_queue_t destroy_message_queue(message_queue_t *queue); + +#endif /* RINGBUFFER_QUEUE_H */ diff --git a/openair2/UTIL/ASYNC_IF/socket_link.c b/openair2/UTIL/ASYNC_IF/socket_link.c new file mode 100644 index 0000000000000000000000000000000000000000..720a55398c5b719510c0a1dea304cecf416afbd8 --- /dev/null +++ b/openair2/UTIL/ASYNC_IF/socket_link.c @@ -0,0 +1,357 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file socket_link.c + * \brief this is the implementation of a TCP socket ASYNC IF + * \author Cedric Roux + * \date November 2015 + * \version 1.0 + * \email: cedric.roux@eurecom.fr + * @ingroup _mac + */ + +#include "socket_link.h" +#include "log.h" + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <errno.h> +#include <unistd.h> +#include <sys/types.h> +#include <sys/socket.h> +#include <netinet/ip.h> +#include <netinet/tcp.h> +#include <arpa/inet.h> +#include <stdint.h> + +socket_link_t *new_link_server(int port) +{ + socket_link_t *ret = NULL; + int reuse; + struct sockaddr_in addr; + socklen_t addrlen; + int socket_server = -1; + int no_delay; + + ret = calloc(1, sizeof(socket_link_t)); + if (ret == NULL) { + LOG_E(MAC, "%s:%d: out of memory\n", __FILE__, __LINE__); + goto error; + } + ret->socket_fd = -1; + + LOG_D(MAC, "create a new link server socket at port %d\n", port); + + socket_server = socket(AF_INET, SOCK_STREAM, 0); + if (socket_server == -1) { + LOG_E(MAC, "%s:%d: socket: %s\n", __FILE__, __LINE__, strerror(errno)); + goto error; + } + + reuse = 1; + if (setsockopt(socket_server, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse)) == -1) { + LOG_E(MAC, "%s:%d: setsockopt: %s\n", __FILE__, __LINE__, strerror(errno)); + goto error; + } + + no_delay = 1; + if (setsockopt(socket_server, IPPROTO_TCP, TCP_NODELAY, &no_delay, sizeof(no_delay)) == -1) { + LOG_E(MAC, "%s:%d: setsockopt: %s\n", __FILE__, __LINE__, strerror(errno)); + goto error; + } + + addr.sin_family = AF_INET; + addr.sin_port = htons(port); + addr.sin_addr.s_addr = INADDR_ANY; + if (bind(socket_server, (struct sockaddr *)&addr, sizeof(addr)) == -1) { + LOG_E(MAC, "%s:%d: bind: %s\n", __FILE__, __LINE__, strerror(errno)); + goto error; + } + + if (listen(socket_server, 5)) { + LOG_E(MAC, "%s:%d: listen: %s\n", __FILE__, __LINE__, strerror(errno)); + goto error; + } + + addrlen = sizeof(addr); + ret->socket_fd = accept(socket_server, (struct sockaddr *)&addr, &addrlen); + if (ret->socket_fd == -1) { + LOG_E(MAC, "%s:%d: accept: %s\n", __FILE__, __LINE__, strerror(errno)); + goto error; + } + + close(socket_server); + + LOG_D(MAC, "connection from %s:%d\n", inet_ntoa(addr.sin_addr), ntohs(addr.sin_port)); + return ret; + +error: + close(socket_server); + if (ret != NULL) close(ret->socket_fd); + free(ret); + LOG_E(MAC, "ERROR in new_link_server (see above), returning NULL\n"); + return NULL; +} + +socket_link_t *new_link_client(char *server, int port) +{ + socket_link_t *ret = NULL; + struct sockaddr_in addr; + int no_delay; + + ret = calloc(1, sizeof(socket_link_t)); + if (ret == NULL) { + LOG_E(MAC, "%s:%d: out of memory\n", __FILE__, __LINE__); + goto error; + } + ret->socket_fd = -1; + + LOG_D(MAC, "create a new link client socket connecting to %s:%d\n", server, port); + + ret->socket_fd = socket(AF_INET, SOCK_STREAM, 0); + if (ret->socket_fd == -1) { + LOG_E(MAC, "%s:%d: socket: %s\n", __FILE__, __LINE__, strerror(errno)); + goto error; + } + + no_delay = 1; + if (setsockopt(ret->socket_fd, SOL_TCP, TCP_NODELAY, &no_delay, sizeof(no_delay)) == -1) { + LOG_E(MAC, "%s:%d: setsockopt: %s\n", __FILE__, __LINE__, strerror(errno)); + goto error; + } + + addr.sin_family = AF_INET; + addr.sin_port = htons(port); + if (inet_aton(server, &addr.sin_addr) == 0) { + LOG_E(MAC, "invalid IP address '%s', use a.b.c.d notation\n", server); + goto error; + } + if (connect(ret->socket_fd, (struct sockaddr *)&addr, sizeof(addr)) == -1) { + LOG_E(MAC, "%s:%d: connect: %s\n", __FILE__, __LINE__, strerror(errno)); + goto error; + } + + LOG_D(MAC, "connection to %s:%d established\n", inet_ntoa(addr.sin_addr), ntohs(addr.sin_port)); + return ret; + +error: + if (ret != NULL) close(ret->socket_fd); + free(ret); + LOG_E(MAC, "ERROR in new_link_client (see above), returning NULL\n"); + return NULL; +} + +/* + * return -1 on error and 0 if the sending was fine + */ +static int socket_send(int socket_fd, void *buf, int size) +{ + char *s = buf; + int l; + + while (size) { + l = send(socket_fd, s, size, MSG_NOSIGNAL); + if (l == -1) goto error; + if (l == 0) { LOG_E(MAC, "%s:%d: this cannot happen, normally...\n", __FILE__, __LINE__); abort(); } + size -= l; + s += l; + } + + return 0; + +error: + LOG_E(MAC, "socket_send: ERROR: %s\n", strerror(errno)); + return -1; +} + +/* + * return -1 on error and 0 if the receiving was fine + */ +static int socket_receive(int socket_fd, void *buf, int size) +{ + char *s = buf; + int l; + + while (size) { + l = read(socket_fd, s, size); + if (l == -1) goto error; + if (l == 0) goto socket_closed; + size -= l; + s += l; + } + + return 0; + +error: + LOG_E(MAC, "socket_receive: ERROR: %s\n", strerror(errno)); + return -1; + +socket_closed: + LOG_E(MAC, "socket_receive: socket closed\n"); + return -1; +} + +/* + * return -1 on error and 0 if the sending was fine + */ +int link_send_packet(socket_link_t *link, void *data, int size) +{ + char sizebuf[4]; + int32_t s = size; + + /* send the size first, maximum is 2^31 bytes */ + sizebuf[0] = (s >> 24) & 255; + sizebuf[1] = (s >> 16) & 255; + sizebuf[2] = (s >> 8) & 255; + sizebuf[3] = s & 255; + + if (socket_send(link->socket_fd, sizebuf, 4) == -1) + goto error; + + link->bytes_sent += 4; + + if (socket_send(link->socket_fd, data, size) == -1) + goto error; + + link->bytes_sent += size; + link->packets_sent++; + + return 0; + +error: + return -1; +} + +/* + * return -1 on error and 0 if the sending was fine + */ +int link_receive_packet(socket_link_t *link, void **ret_data, int *ret_size) +{ + unsigned char sizebuf[4]; + int32_t size; + void *data = NULL; + + /* received the size first, maximum is 2^31 bytes */ + if (socket_receive(link->socket_fd, sizebuf, 4) == -1) + goto error; + + size = (sizebuf[0] << 24) | + (sizebuf[1] << 16) | + (sizebuf[2] << 8) | + sizebuf[3]; + + link->bytes_received += 4; + + data = malloc(size); + if (data == NULL) { + LOG_E(MAC, "%s:%d: out of memory\n", __FILE__, __LINE__); + goto error; + } + + if (socket_receive(link->socket_fd, data, size) == -1) + goto error; + + link->bytes_received += size; + link->packets_received++; + + *ret_data = data; + *ret_size = size; + return 0; + +error: + free(data); + *ret_data = NULL; + *ret_size = 0; + return -1; +} + +/* + * return -1 on error, 0 if all is fine + */ +int close_link(socket_link_t *link) +{ + close(link->socket_fd); + memset(link, 0, sizeof(socket_link_t)); + free(link); + return 0; +} + +#ifdef SERVER_TEST + +#include <inttypes.h> + +int main(void) +{ + void *data; + int size; + socket_link_t *l = new_link_server(2210); + if (l == NULL) { printf("no link created\n"); return 1; } + printf("link is up\n"); + printf("server starts sleeping...\n"); + /* this sleep is here to test for broken pipe. You can run "nc localhost 2210" + * and interrupt it quickly so that the server gets a 'broken' pipe on the + * following link_send_packet. + */ + sleep(1); + printf("... done\n"); + if (link_send_packet(l, "hello\n", 6+1) || + link_send_packet(l, "world\n", 6+1)) return 1; + if (link_receive_packet(l, &data, &size)) return 1; printf("%s", (char *)data); free(data); + if (link_receive_packet(l, &data, &size)) return 1; printf("%s", (char *)data); free(data); + printf("stats:\n"); + printf(" sent packets %"PRIu64"\n", l->packets_sent); + printf(" sent bytes %"PRIu64"\n", l->bytes_sent); + printf(" received packets %"PRIu64"\n", l->packets_received); + printf(" received bytes %"PRIu64"\n", l->bytes_received); + if (close_link(l)) return 1; + printf("link is down\n"); + return 0; +} + +#endif + +#ifdef CLIENT_TEST + +#include <inttypes.h> + +int main(void) +{ + void *data; + int size; + socket_link_t *l = new_link_client("127.0.0.1", 2210); + if (l == NULL) { printf("no link created\n"); return 1; } + printf("link is up\n"); + if (link_receive_packet(l, &data, &size)) return 1; printf("%s", (char *)data); free(data); + if (link_receive_packet(l, &data, &size)) return 1; printf("%s", (char *)data); free(data); + if (link_send_packet(l, "bye\n", 4+1) || + link_send_packet(l, "server\n", 7+1)) return 1; + printf("stats:\n"); + printf(" sent packets %"PRIu64"\n", l->packets_sent); + printf(" sent bytes %"PRIu64"\n", l->bytes_sent); + printf(" received packets %"PRIu64"\n", l->packets_received); + printf(" received bytes %"PRIu64"\n", l->bytes_received); + if (close_link(l)) return 1; + printf("link is down\n"); + return 0; +} + +#endif diff --git a/openair2/UTIL/ASYNC_IF/socket_link.h b/openair2/UTIL/ASYNC_IF/socket_link.h new file mode 100644 index 0000000000000000000000000000000000000000..5b9f438c8aa0747eecd759fb02939e701ddc004d --- /dev/null +++ b/openair2/UTIL/ASYNC_IF/socket_link.h @@ -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.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file socket_link.h + * \brief this is the implementation of a TCP socket ASYNC IF + * \author Cedric Roux + * \date November 2015 + * \version 1.0 + * \email: cedric.roux@eurecom.fr + * @ingroup _mac + */ + +#ifndef SOCKET_LINK_H +#define SOCKET_LINK_H + +#include <stdint.h> + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + int socket_fd; + uint64_t bytes_sent; + uint64_t packets_sent; + uint64_t bytes_received; + uint64_t packets_received; +} socket_link_t; + +socket_link_t *new_link_server(int port); +socket_link_t *new_link_client(char *server, int port); +int link_send_packet(socket_link_t *link, void *data, int size); +int link_receive_packet(socket_link_t *link, void **data, int *size); +int close_link(socket_link_t *link); + +#ifdef __cplusplus +} +#endif + +#endif /* SOCKET_LINK_H */ diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/gcc_and_gnumake/Makefile b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/gcc_and_gnumake/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..27e4d91df3c2f7a1dafd98aa6ac8b04441961194 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/gcc_and_gnumake/Makefile @@ -0,0 +1,168 @@ +##### paths ##### +BINDIR := ../../bin +INCDIR := ../../inc +OBJDIR := ../../obj +SRCDIR := ../../src + +##### misc ##### +QUIETLY := 1>/dev/null 2>/dev/null +VERSION_NUMBER := 1 +MINOR_NUMBER := 0 +RELEASE_NUMBER := 0 + +##### sources, objects and libraries ##### +BINNAME := liblfds700 +ARFILENAME := $(BINNAME).a +ARPATHNAME := $(BINDIR)/$(ARFILENAME) +SOBASENAME := $(BINNAME).so +SONAME := $(SOBASENAME).$(VERSION_NUMBER) +SOFILENAME := $(SONAME).$(MINOR_NUMBER).$(RELEASE_NUMBER) +SOPATHNAME := $(BINDIR)/$(SOFILENAME) +INCNAME := $(INCDIR)/$(BINNAME).h +SRCDIRS := lfds700_btree_addonly_unbalanced lfds700_freelist lfds700_hash_addonly lfds700_list_addonly_ordered_singlylinked lfds700_list_addonly_singlylinked_unordered lfds700_misc lfds700_queue lfds700_queue_bounded_singleconsumer_singleproducer lfds700_ringbuffer lfds700_stack +SOURCES := lfds700_hash_addonly_cleanup.c lfds700_hash_addonly_get.c lfds700_hash_addonly_init.c lfds700_hash_addonly_insert.c lfds700_hash_addonly_iterate.c lfds700_hash_addonly_query.c \ + lfds700_list_addonly_ordered_singlylinked_cleanup.c lfds700_list_addonly_ordered_singlylinked_get.c lfds700_list_addonly_ordered_singlylinked_init.c lfds700_list_addonly_ordered_singlylinked_insert.c lfds700_list_addonly_ordered_singlylinked_query.c \ + lfds700_list_addonly_singlylinked_unordered_cleanup.c lfds700_list_addonly_singlylinked_unordered_get.c lfds700_list_addonly_singlylinked_unordered_init.c lfds700_list_addonly_singlylinked_unordered_insert.c lfds700_list_addonly_singlylinked_unordered_query.c \ + lfds700_btree_addonly_unbalanced_cleanup.c lfds700_btree_addonly_unbalanced_get.c lfds700_btree_addonly_unbalanced_init.c lfds700_btree_addonly_unbalanced_insert.c lfds700_btree_addonly_unbalanced_query.c \ + lfds700_freelist_cleanup.c lfds700_freelist_init.c lfds700_freelist_pop.c lfds700_freelist_push.c lfds700_freelist_query.c \ + lfds700_misc_cleanup.c lfds700_misc_globals.c lfds700_misc_init.c lfds700_misc_prng.c lfds700_misc_query.c \ + lfds700_queue_cleanup.c lfds700_queue_dequeue.c lfds700_queue_enqueue.c lfds700_queue_init.c lfds700_queue_query.c \ + lfds700_queue_bounded_singleconsumer_singleproducer_cleanup.c lfds700_queue_bounded_singleconsumer_singleproducer_dequeue.c lfds700_queue_bounded_singleconsumer_singleproducer_enqueue.c lfds700_queue_bounded_singleconsumer_singleproducer_init.c lfds700_queue_bounded_singleconsumer_singleproducer_query.c \ + lfds700_ringbuffer_cleanup.c lfds700_ringbuffer_init.c lfds700_ringbuffer_query.c lfds700_ringbuffer_read.c lfds700_ringbuffer_write.c \ + lfds700_stack_cleanup.c lfds700_stack_init.c lfds700_stack_pop.c lfds700_stack_push.c lfds700_stack_query.c +OBJECTS := $(patsubst %.c,$(OBJDIR)/%.o,$(notdir $(SOURCES))) +SYSLIBS := + +##### default paths fix up ##### +CPATH := $(subst : ,:,$(SRCDIR):$(INCDIR)) + +##### tools ##### +MAKE := make +MFLAGS := + +DG := gcc +DGFLAGS := -MM -std=gnu89 + +CC := gcc +CFBASE := -c -fno-strict-aliasing -std=gnu89 -Wall -Werror -Wno-unknown-pragmas -Wno-unused-but-set-variable -Wno-unused-variable +CFCOV := -O0 -ggdb -DCOVERAGE -fprofile-arcs -ftest-coverage +CFDBG := -O0 -ggdb -D_DEBUG +CFPROF := -O0 -ggdb -DPROF -pg +CFREL := -O2 -DNDEBUG -finline-functions +CFTSAN := -O0 -ggdb -DTSAN -fsanitize=thread -fPIC +CFBARE := -ffreestanding -nodefaultlibs -nostdinc -nostdlib + +AR := ar +AFLAGS := -rcs + +LD := gcc +LFBASE := -pthread -shared -std=gnu89 -Wl,-soname,$(SONAME) -o $(SOPATHNAME) -Wall -Werror +LFCOV := -O0 -fprofile-arcs -ftest-coverage +LFDBG := -O0 -ggdb +LFPROF := -O0 -pg +LFREL := -O2 -s -finline-functions +LFTSAN := -O0 -fsanitize=thread -fPIC +LFBARE := -ffreestanding -nodefaultlibs -nostdinc -nostdlib + +##### CPU variants ##### +GCCARCH := native +CFBASE += -march=$(GCCARCH) + +##### build variants ##### +ifeq ($(findstring so,$(MAKECMDGOALS)),so) + CFBASE += -fPIC +endif + +CFLAGS += $(CFBASE) +LFLAGS += $(LFBASE) + +ifeq ($(MAKECMDGOALS),) + CFLAGS += $(CFDBG) + LFLAGS += $(LFDBG) +endif + +ifeq ($(findstring cov,$(MAKECMDGOALS)),cov) + CFLAGS += $(CFCOV) + LFLAGS += $(LFCOV) + SYSLIBS += -lgcov +endif + +ifeq ($(findstring dbg,$(MAKECMDGOALS)),dbg) + CFLAGS += $(CFDBG) + LFLAGS += $(LFDBG) +endif + +ifeq ($(findstring prof,$(MAKECMDGOALS)),prof) + CFLAGS += $(CFPROF) + LFLAGS += $(LFPROF) +endif + +ifeq ($(findstring rel,$(MAKECMDGOALS)),rel) + CFLAGS += $(CFREL) + LFLAGS += $(LFREL) +endif + +ifeq ($(findstring tsan,$(MAKECMDGOALS)),tsan) + CFLAGS += $(CFTSAN) + LFLAGS += $(LFTSAN) +endif + +ifeq ($(findstring b_,$(MAKECMDGOALS)),b_) + CFLAGS += $(CFBARE) + LFLAGS += $(CFBARE) +endif + +##### search paths ##### +vpath %.c $(patsubst %,$(SRCDIR)/%:,$(SRCDIRS)) + +##### implicit rules ##### +$(OBJDIR)/%.o : %.c + $(DG) $(DGFLAGS) $< >$(OBJDIR)/$*.d + $(CC) $(CFLAGS) -o $@ $< + +##### explicit rules ##### +$(ARPATHNAME) : $(OBJECTS) + $(AR) $(AFLAGS) $(ARPATHNAME) $(OBJECTS) + +$(SOPATHNAME) : $(OBJECTS) + $(LD) $(LFLAGS) $(OBJECTS) -o $(SOPATHNAME) + @ln -fs $(SOFILENAME) $(BINDIR)/$(SONAME) + @ln -fs $(SOFILENAME) $(BINDIR)/$(SOBASENAME) + +##### phony ##### +.PHONY : clean bare_ar_cov bare_ar_dbg bare_ar_prof bare_ar_rel bare_ar_tsan bare_so_cov bare_so_dbg bare_so_prof bare_so_rel bare_so_tsan hosted_ar_cov hosted_ar_dbg hosted_ar_prof hosted_ar_rel hosted_ar_tsan hosted_so_cov hosted_so_dbg hosted_so_prof hosted_so_rel hosted_so_tsan + +clean : + @rm -f $(BINDIR)/* $(OBJDIR)/* + +bare_ar_cov : $(ARPATHNAME) # bare, archive (.a), coverage +bare_ar_dbg : $(ARPATHNAME) # bare, archive (.a), debug +bare_ar_prof : $(ARPATHNAME) # bare, archive (.a), profiling +bare_ar_rel : $(ARPATHNAME) # bare, archive (.a), release +bare_ar_tsan : $(ARPATHNAME) # bare, archive (.a), thread sanitizer + +bare_so_cov : $(SOPATHNAME) # bare, shared (.so), coverage +bare_so_dbg : $(SOPATHNAME) # bare, shared (.so), debug +bare_so_prof : $(SOPATHNAME) # bare, shared (.so), profiling +bare_so_rel : $(SOPATHNAME) # bare, shared (.so), release +bare_so_tsan : $(SOPATHNAME) # bare, shared (.so), thread sanitizer + +hosted_ar_cov : $(ARPATHNAME) # hosted implementation, archive (.a), coverage +hosted_ar_dbg : $(ARPATHNAME) # hosted implementation, archive (.a), debug +hosted_ar_prof : $(ARPATHNAME) # hosted implementation, archive (.a), profiling +hosted_ar_rel : $(ARPATHNAME) # hosted implementation, archive (.a), release +hosted_ar_tsan : $(ARPATHNAME) # hosted implementation, archive (.a), thread sanitizer + +hosted_so_cov : $(SOPATHNAME) # hosted implementation, shared (.so), coverage +hosted_so_dbg : $(SOPATHNAME) # hosted implementation, shared (.so), debug +hosted_so_prof : $(SOPATHNAME) # hosted implementation, shared (.so), profiling +hosted_so_rel : $(SOPATHNAME) # hosted implementation, shared (.so), release +hosted_so_tsan : $(SOPATHNAME) # hosted implementation, shared (.so), thread sanitizer + +##### dependencies ##### +-include $(DEPENDS) + +##### notes ##### +# TRD : we use -std=gnu89 for C++ style comments +# hosted implementation differs from bare simply in that <assert.h> ends up being included + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/gcc_kbuild_and_gnumake/Kbuild b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/gcc_kbuild_and_gnumake/Kbuild new file mode 100644 index 0000000000000000000000000000000000000000..1ae6b362404b0755a923764ce82201c4fa82dd5c --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/gcc_kbuild_and_gnumake/Kbuild @@ -0,0 +1,76 @@ +lib-y := + +lib-y += ../../src/lfds700_btree_addonly_unbalanced/lfds700_btree_addonly_unbalanced_cleanup.o +lib-y += ../../src/lfds700_btree_addonly_unbalanced/lfds700_btree_addonly_unbalanced_get.o +lib-y += ../../src/lfds700_btree_addonly_unbalanced/lfds700_btree_addonly_unbalanced_init.o +lib-y += ../../src/lfds700_btree_addonly_unbalanced/lfds700_btree_addonly_unbalanced_insert.o +lib-y += ../../src/lfds700_btree_addonly_unbalanced/lfds700_btree_addonly_unbalanced_query.o + +lib-y += ../../src/lfds700_freelist/lfds700_freelist_cleanup.o +lib-y += ../../src/lfds700_freelist/lfds700_freelist_init.o +lib-y += ../../src/lfds700_freelist/lfds700_freelist_pop.o +lib-y += ../../src/lfds700_freelist/lfds700_freelist_push.o +lib-y += ../../src/lfds700_freelist/lfds700_freelist_query.o + +lib-y += ../../src/lfds700_hash_addonly/lfds700_hash_addonly_cleanup.o +lib-y += ../../src/lfds700_hash_addonly/lfds700_hash_addonly_get.o +lib-y += ../../src/lfds700_hash_addonly/lfds700_hash_addonly_init.o +lib-y += ../../src/lfds700_hash_addonly/lfds700_hash_addonly_insert.o +lib-y += ../../src/lfds700_hash_addonly/lfds700_hash_addonly_iterate.o +lib-y += ../../src/lfds700_hash_addonly/lfds700_hash_addonly_query.o + +lib-y += ../../src/lfds700_list_addonly_ordered_singlylinked/lfds700_list_addonly_ordered_singlylinked_cleanup.o +lib-y += ../../src/lfds700_list_addonly_ordered_singlylinked/lfds700_list_addonly_ordered_singlylinked_get.o +lib-y += ../../src/lfds700_list_addonly_ordered_singlylinked/lfds700_list_addonly_ordered_singlylinked_init.o +lib-y += ../../src/lfds700_list_addonly_ordered_singlylinked/lfds700_list_addonly_ordered_singlylinked_insert.o +lib-y += ../../src/lfds700_list_addonly_ordered_singlylinked/lfds700_list_addonly_ordered_singlylinked_query.o + +lib-y += ../../src/lfds700_list_addonly_singlylinked_unordered/lfds700_list_addonly_singlylinked_unordered_cleanup.o +lib-y += ../../src/lfds700_list_addonly_singlylinked_unordered/lfds700_list_addonly_singlylinked_unordered_get.o +lib-y += ../../src/lfds700_list_addonly_singlylinked_unordered/lfds700_list_addonly_singlylinked_unordered_init.o +lib-y += ../../src/lfds700_list_addonly_singlylinked_unordered/lfds700_list_addonly_singlylinked_unordered_insert.o +lib-y += ../../src/lfds700_list_addonly_singlylinked_unordered/lfds700_list_addonly_singlylinked_unordered_query.o + +lib-y += ../../src/lfds700_misc/lfds700_misc_cleanup.o +lib-y += ../../src/lfds700_misc/lfds700_misc_globals.o +lib-y += ../../src/lfds700_misc/lfds700_misc_init.o +lib-y += ../../src/lfds700_misc/lfds700_misc_prng.o +lib-y += ../../src/lfds700_misc/lfds700_misc_query.o + +lib-y += ../../src/lfds700_queue/lfds700_queue_cleanup.o +lib-y += ../../src/lfds700_queue/lfds700_queue_dequeue.o +lib-y += ../../src/lfds700_queue/lfds700_queue_enqueue.o +lib-y += ../../src/lfds700_queue/lfds700_queue_init.o +lib-y += ../../src/lfds700_queue/lfds700_queue_query.o + +lib-y += ../../src/lfds700_queue_bounded_singleconsumer_singleproducer/lfds700_queue_bounded_singleconsumer_singleproducer_cleanup.o +lib-y += ../../src/lfds700_queue_bounded_singleconsumer_singleproducer/lfds700_queue_bounded_singleconsumer_singleproducer_dequeue.o +lib-y += ../../src/lfds700_queue_bounded_singleconsumer_singleproducer/lfds700_queue_bounded_singleconsumer_singleproducer_enqueue.o +lib-y += ../../src/lfds700_queue_bounded_singleconsumer_singleproducer/lfds700_queue_bounded_singleconsumer_singleproducer_init.o +lib-y += ../../src/lfds700_queue_bounded_singleconsumer_singleproducer/lfds700_queue_bounded_singleconsumer_singleproducer_query.o + +lib-y += ../../src/lfds700_ringbuffer/lfds700_ringbuffer_cleanup.o +lib-y += ../../src/lfds700_ringbuffer/lfds700_ringbuffer_init.o +lib-y += ../../src/lfds700_ringbuffer/lfds700_ringbuffer_query.o +lib-y += ../../src/lfds700_ringbuffer/lfds700_ringbuffer_read.o +lib-y += ../../src/lfds700_ringbuffer/lfds700_ringbuffer_write.o + +lib-y += ../../src/lfds700_stack/lfds700_stack_cleanup.o +lib-y += ../../src/lfds700_stack/lfds700_stack_init.o +lib-y += ../../src/lfds700_stack/lfds700_stack_pop.o +lib-y += ../../src/lfds700_stack/lfds700_stack_push.o +lib-y += ../../src/lfds700_stack/lfds700_stack_query.o + +libs-y := ../../bin/ + +ccflags-y := -I$(src)/../../inc +ccflags-y += -I$(src)/../../inc/liblfds700 +ccflags-y += -D_KERNEL_MODE +ccflags-y += -fno-strict-aliasing +ccflags-y += -std=gnu89 +ccflags-y += -Wall +ccflags-y += -Werror +ccflags-y += -Wno-unknown-pragmas +ccflags-y += -Wno-unused-but-set-variable +ccflags-y += -Wno-unused-variable + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/gcc_kbuild_and_gnumake/Makefile b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/gcc_kbuild_and_gnumake/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..d6de5f4b5dbf897b5a74fcba0d28050cc6e0b53a --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/gcc_kbuild_and_gnumake/Makefile @@ -0,0 +1,14 @@ +default: + $(MAKE) -C /lib/modules/`uname -r`/build M=$(PWD) + +clean: + $(MAKE) -C /lib/modules/`uname -r`/build M=$(PWD) clean + find ../../src/ -name "*.o" -type f -delete + +help: + $(MAKE) -C /lib/modules/`uname -r`/build M=$(PWD) help + +modules: + $(MAKE) -C /lib/modules/`uname -r`/build M=$(PWD) modules + + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/sdk_for_windows_7_and_gnumake/liblfds700.def b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/sdk_for_windows_7_and_gnumake/liblfds700.def new file mode 100644 index 0000000000000000000000000000000000000000..583ce35dbdb08c553e2cb2a7f335f4bcaf9458da --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/sdk_for_windows_7_and_gnumake/liblfds700.def @@ -0,0 +1,69 @@ +EXPORTS + +lfds700_btree_au_init_valid_on_current_logical_core = lfds700_btree_au_init_valid_on_current_logical_core +lfds700_btree_au_cleanup = lfds700_btree_au_cleanup +lfds700_btree_au_insert = lfds700_btree_au_insert +lfds700_btree_au_get_by_absolute_position_and_then_by_relative_position = lfds700_btree_au_get_by_absolute_position_and_then_by_relative_position +lfds700_btree_au_get_by_absolute_position = lfds700_btree_au_get_by_absolute_position +lfds700_btree_au_get_by_relative_position = lfds700_btree_au_get_by_relative_position +lfds700_btree_au_get_by_key = lfds700_btree_au_get_by_key +lfds700_btree_au_query = lfds700_btree_au_query + +lfds700_freelist_init_valid_on_current_logical_core = lfds700_freelist_init_valid_on_current_logical_core +lfds700_freelist_cleanup = lfds700_freelist_cleanup +lfds700_freelist_push = lfds700_freelist_push +lfds700_freelist_pop = lfds700_freelist_pop +lfds700_freelist_query = lfds700_freelist_query + +lfds700_hash_a_init_valid_on_current_logical_core = lfds700_hash_a_init_valid_on_current_logical_core +lfds700_hash_a_cleanup = lfds700_hash_a_cleanup +lfds700_hash_a_insert = lfds700_hash_a_insert +lfds700_hash_a_get_by_key = lfds700_hash_a_get_by_key +lfds700_hash_a_iterate_init = lfds700_hash_a_iterate_init +lfds700_hash_a_iterate = lfds700_hash_a_iterate +lfds700_hash_a_query = lfds700_hash_a_query + +lfds700_list_aos_init_valid_on_current_logical_core = lfds700_list_aos_init_valid_on_current_logical_core +lfds700_list_aos_cleanup = lfds700_list_aos_cleanup +lfds700_list_aos_insert = lfds700_list_aos_insert +lfds700_list_aos_get_by_key = lfds700_list_aos_get_by_key +lfds700_list_aos_query = lfds700_list_aos_query + +lfds700_list_asu_init_valid_on_current_logical_core = lfds700_list_asu_init_valid_on_current_logical_core +lfds700_list_asu_cleanup = lfds700_list_asu_cleanup +lfds700_list_asu_insert_at_position = lfds700_list_asu_insert_at_position +lfds700_list_asu_insert_at_start = lfds700_list_asu_insert_at_start +lfds700_list_asu_insert_at_end = lfds700_list_asu_insert_at_end +lfds700_list_asu_insert_after_element = lfds700_list_asu_insert_after_element +lfds700_list_asu_get_by_key = lfds700_list_asu_get_by_key +lfds700_list_asu_query = lfds700_list_asu_query + +lfds700_misc_library_init_valid_on_current_logical_core = lfds700_misc_library_init_valid_on_current_logical_core +lfds700_misc_library_cleanup = lfds700_misc_library_cleanup +lfds700_misc_prng_init = lfds700_misc_prng_init +lfds700_misc_query = lfds700_misc_query + +lfds700_queue_init_valid_on_current_logical_core = lfds700_queue_init_valid_on_current_logical_core +lfds700_queue_cleanup = lfds700_queue_cleanup +lfds700_queue_enqueue = lfds700_queue_enqueue +lfds700_queue_dequeue = lfds700_queue_dequeue +lfds700_queue_query = lfds700_queue_query + +lfds700_queue_bss_init_valid_on_current_logical_core = lfds700_queue_bss_init_valid_on_current_logical_core +lfds700_queue_bss_cleanup = lfds700_queue_bss_cleanup +lfds700_queue_bss_enqueue = lfds700_queue_bss_enqueue +lfds700_queue_bss_dequeue = lfds700_queue_bss_dequeue +lfds700_queue_bss_query = lfds700_queue_bss_query + +lfds700_ringbuffer_init_valid_on_current_logical_core = lfds700_ringbuffer_init_valid_on_current_logical_core +lfds700_ringbuffer_cleanup = lfds700_ringbuffer_cleanup +lfds700_ringbuffer_read = lfds700_ringbuffer_read +lfds700_ringbuffer_write = lfds700_ringbuffer_write +lfds700_ringbuffer_query = lfds700_ringbuffer_query + +lfds700_stack_init_valid_on_current_logical_core = lfds700_stack_init_valid_on_current_logical_core +lfds700_stack_cleanup = lfds700_stack_cleanup +lfds700_stack_push = lfds700_stack_push +lfds700_stack_pop = lfds700_stack_pop +lfds700_stack_query = lfds700_stack_query + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/sdk_for_windows_7_and_gnumake/makefile b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/sdk_for_windows_7_and_gnumake/makefile new file mode 100644 index 0000000000000000000000000000000000000000..7b257c92777703bc11c4c864f4cea3ddd5b10fa8 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/sdk_for_windows_7_and_gnumake/makefile @@ -0,0 +1,114 @@ +##### paths ##### +BINDIR := ..\..\bin +INCDIR := ..\..\inc +OBJDIR := ..\..\obj +SRCDIR := ..\..\src + +##### misc ##### +QUIETLY := 1>nul 2>nul +NULL := +SPACE := $(NULL) # TRD : with a trailing space + +##### sources, objects and libraries ##### +BINNAME := liblfds700 +LIB_BINARY := $(BINDIR)\$(BINNAME).lib +DLL_BINARY := $(BINDIR)\$(BINNAME).dll +SRCDIRS := lfds700_btree_addonly_unbalanced lfds700_freelist lfds700_hash_addonly lfds700_list_addonly_ordered_singlylinked lfds700_list_addonly_singlylinked_unordered lfds700_misc lfds700_queue lfds700_queue_bounded_singleconsumer_singleproducer lfds700_ringbuffer lfds700_stack +SOURCES := lfds700_hash_addonly_cleanup.c lfds700_hash_addonly_get.c lfds700_hash_addonly_init.c lfds700_hash_addonly_insert.c lfds700_hash_addonly_iterate.c lfds700_hash_addonly_query.c \ + lfds700_list_addonly_ordered_singlylinked_cleanup.c lfds700_list_addonly_ordered_singlylinked_get.c lfds700_list_addonly_ordered_singlylinked_init.c lfds700_list_addonly_ordered_singlylinked_insert.c lfds700_list_addonly_ordered_singlylinked_query.c \ + lfds700_list_addonly_singlylinked_unordered_cleanup.c lfds700_list_addonly_singlylinked_unordered_get.c lfds700_list_addonly_singlylinked_unordered_init.c lfds700_list_addonly_singlylinked_unordered_insert.c lfds700_list_addonly_singlylinked_unordered_query.c \ + lfds700_btree_addonly_unbalanced_cleanup.c lfds700_btree_addonly_unbalanced_get.c lfds700_btree_addonly_unbalanced_init.c lfds700_btree_addonly_unbalanced_insert.c lfds700_btree_addonly_unbalanced_query.c \ + lfds700_freelist_cleanup.c lfds700_freelist_init.c lfds700_freelist_pop.c lfds700_freelist_push.c lfds700_freelist_query.c \ + lfds700_misc_cleanup.c lfds700_misc_globals.c lfds700_misc_init.c lfds700_misc_prng.c lfds700_misc_query.c \ + lfds700_queue_cleanup.c lfds700_queue_dequeue.c lfds700_queue_enqueue.c lfds700_queue_init.c lfds700_queue_query.c \ + lfds700_queue_bounded_singleconsumer_singleproducer_cleanup.c lfds700_queue_bounded_singleconsumer_singleproducer_dequeue.c lfds700_queue_bounded_singleconsumer_singleproducer_enqueue.c lfds700_queue_bounded_singleconsumer_singleproducer_init.c lfds700_queue_bounded_singleconsumer_singleproducer_query.c \ + lfds700_ringbuffer_cleanup.c lfds700_ringbuffer_init.c lfds700_ringbuffer_query.c lfds700_ringbuffer_read.c lfds700_ringbuffer_write.c \ + lfds700_stack_cleanup.c lfds700_stack_init.c lfds700_stack_pop.c lfds700_stack_push.c lfds700_stack_query.c +OBJECTS := $(patsubst %.c,$(OBJDIR)/%.obj,$(notdir $(SOURCES))) +SYSLIBS := kernel32.lib + +##### default paths fix up ##### +INCDIRS := $(patsubst %,%;,$(INCDIR)) +INCLUDE += $(subst $(SPACE),,$(INCDIRS)) + +##### tools ##### +MAKE := make +MFLAGS := + +CC := cl +CBASE := /c "-I$(SRCDIR)" "/Fd$(BINDIR)\$(BINNAME).pdb" /D_CRT_SECURE_NO_WARNINGS /DWIN32_LEAN_AND_MEAN /DUNICODE /D_UNICODE /DUNICODE /nologo /W4 /wd 4068 /WX +CFREL := /DNDEBUG /Ox +CFDBG := /D_DEBUG /Gm /Od /Zi + +AR := lib +AFLAGS := /nologo /subsystem:console /verbose /wx + +LD := link +LFBASE := /def:$(BINNAME).def /dll /nodefaultlib /nologo /nxcompat /subsystem:console /wx +LFREL := /incremental:no +LFDBG := /debug "/pdb:$(BINDIR)\$(BINNAME).pdb" + +##### variants ##### +CFLAGS := $(CBASE) $(CFDBG) /MTd +ASFLAGS := $(ASBASE) $(ASDBG) +LFLAGS := $(LFBASE) $(LFDBG) +CLIB := libcmtd.lib + +ifeq ($(MAKECMDGOALS),librel) + CFLAGS := $(CBASE) $(CFREL) /MT + ASFLAGS := $(ASBASE) $(ASREL) + LFLAGS := $(LFBASE) $(LFREL) + CLIB := libcmt.lib +endif + +ifeq ($(MAKECMDGOALS),libdbg) + CFLAGS := $(CBASE) $(CFDBG) /MTd + ASFLAGS := $(ASBASE) $(ASDBG) + LFLAGS := $(LFBASE) $(LFDBG) + CLIB := libcmtd.lib +endif + +ifeq ($(MAKECMDGOALS),dllrel) + CFLAGS := $(CBASE) $(CFREL) /MD + ASFLAGS := $(ASBASE) $(ASREL) + LFLAGS := $(LFBASE) $(LFREL) + CLIB := msvcrt.lib +endif + +ifeq ($(MAKECMDGOALS),dlldbg) + CFLAGS := $(CBASE) $(CFDBG) /MDd + ASFLAGS := $(ASBASE) $(ASDBG) + LFLAGS := $(LFBASE) $(LFDBG) + CLIB := msvcrtd.lib +endif + +##### search paths ##### +vpath %.c $(patsubst %,$(SRCDIR)/%;,$(SRCDIRS)) + +##### implicit rules ##### +$(OBJDIR)/%.obj : %.c + $(CC) $(CFLAGS) "/Fo$@" $< + +##### explicit rules ##### +$(LIB_BINARY) : $(OBJECTS) + $(AR) $(AFLAGS) $(OBJECTS) /out:$(LIB_BINARY) + +$(DLL_BINARY) : $(OBJECTS) + $(LD) $(LFLAGS) $(CLIB) $(SYSLIBS) $(OBJECTS) /out:$(DLL_BINARY) + +##### phony ##### +.PHONY : clean librel libdbg dllrel dlldbg + +clean : + @erase /Q $(BINDIR)\$(BINNAME).* $(OBJDIR)\*.obj $(QUIETLY) + +dlldbg : $(DLL_BINARY) +dllrel : $(DLL_BINARY) + +libdbg : $(LIB_BINARY) +librel : $(LIB_BINARY) + +##### notes ##### +# /wd 4068 : turn off "unknown pragma" warning + + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012/liblfds700.def b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012/liblfds700.def new file mode 100644 index 0000000000000000000000000000000000000000..583ce35dbdb08c553e2cb2a7f335f4bcaf9458da --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012/liblfds700.def @@ -0,0 +1,69 @@ +EXPORTS + +lfds700_btree_au_init_valid_on_current_logical_core = lfds700_btree_au_init_valid_on_current_logical_core +lfds700_btree_au_cleanup = lfds700_btree_au_cleanup +lfds700_btree_au_insert = lfds700_btree_au_insert +lfds700_btree_au_get_by_absolute_position_and_then_by_relative_position = lfds700_btree_au_get_by_absolute_position_and_then_by_relative_position +lfds700_btree_au_get_by_absolute_position = lfds700_btree_au_get_by_absolute_position +lfds700_btree_au_get_by_relative_position = lfds700_btree_au_get_by_relative_position +lfds700_btree_au_get_by_key = lfds700_btree_au_get_by_key +lfds700_btree_au_query = lfds700_btree_au_query + +lfds700_freelist_init_valid_on_current_logical_core = lfds700_freelist_init_valid_on_current_logical_core +lfds700_freelist_cleanup = lfds700_freelist_cleanup +lfds700_freelist_push = lfds700_freelist_push +lfds700_freelist_pop = lfds700_freelist_pop +lfds700_freelist_query = lfds700_freelist_query + +lfds700_hash_a_init_valid_on_current_logical_core = lfds700_hash_a_init_valid_on_current_logical_core +lfds700_hash_a_cleanup = lfds700_hash_a_cleanup +lfds700_hash_a_insert = lfds700_hash_a_insert +lfds700_hash_a_get_by_key = lfds700_hash_a_get_by_key +lfds700_hash_a_iterate_init = lfds700_hash_a_iterate_init +lfds700_hash_a_iterate = lfds700_hash_a_iterate +lfds700_hash_a_query = lfds700_hash_a_query + +lfds700_list_aos_init_valid_on_current_logical_core = lfds700_list_aos_init_valid_on_current_logical_core +lfds700_list_aos_cleanup = lfds700_list_aos_cleanup +lfds700_list_aos_insert = lfds700_list_aos_insert +lfds700_list_aos_get_by_key = lfds700_list_aos_get_by_key +lfds700_list_aos_query = lfds700_list_aos_query + +lfds700_list_asu_init_valid_on_current_logical_core = lfds700_list_asu_init_valid_on_current_logical_core +lfds700_list_asu_cleanup = lfds700_list_asu_cleanup +lfds700_list_asu_insert_at_position = lfds700_list_asu_insert_at_position +lfds700_list_asu_insert_at_start = lfds700_list_asu_insert_at_start +lfds700_list_asu_insert_at_end = lfds700_list_asu_insert_at_end +lfds700_list_asu_insert_after_element = lfds700_list_asu_insert_after_element +lfds700_list_asu_get_by_key = lfds700_list_asu_get_by_key +lfds700_list_asu_query = lfds700_list_asu_query + +lfds700_misc_library_init_valid_on_current_logical_core = lfds700_misc_library_init_valid_on_current_logical_core +lfds700_misc_library_cleanup = lfds700_misc_library_cleanup +lfds700_misc_prng_init = lfds700_misc_prng_init +lfds700_misc_query = lfds700_misc_query + +lfds700_queue_init_valid_on_current_logical_core = lfds700_queue_init_valid_on_current_logical_core +lfds700_queue_cleanup = lfds700_queue_cleanup +lfds700_queue_enqueue = lfds700_queue_enqueue +lfds700_queue_dequeue = lfds700_queue_dequeue +lfds700_queue_query = lfds700_queue_query + +lfds700_queue_bss_init_valid_on_current_logical_core = lfds700_queue_bss_init_valid_on_current_logical_core +lfds700_queue_bss_cleanup = lfds700_queue_bss_cleanup +lfds700_queue_bss_enqueue = lfds700_queue_bss_enqueue +lfds700_queue_bss_dequeue = lfds700_queue_bss_dequeue +lfds700_queue_bss_query = lfds700_queue_bss_query + +lfds700_ringbuffer_init_valid_on_current_logical_core = lfds700_ringbuffer_init_valid_on_current_logical_core +lfds700_ringbuffer_cleanup = lfds700_ringbuffer_cleanup +lfds700_ringbuffer_read = lfds700_ringbuffer_read +lfds700_ringbuffer_write = lfds700_ringbuffer_write +lfds700_ringbuffer_query = lfds700_ringbuffer_query + +lfds700_stack_init_valid_on_current_logical_core = lfds700_stack_init_valid_on_current_logical_core +lfds700_stack_cleanup = lfds700_stack_cleanup +lfds700_stack_push = lfds700_stack_push +lfds700_stack_pop = lfds700_stack_pop +lfds700_stack_query = lfds700_stack_query + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012/liblfds700.sln b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012/liblfds700.sln new file mode 100644 index 0000000000000000000000000000000000000000..b52c44e46f36cfc3de33a8a5663832062c6de1cf --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012/liblfds700.sln @@ -0,0 +1,46 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblfds700", "liblfds700.vcxproj", "{1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug DLL|Win32 = Debug DLL|Win32 + Debug DLL|x64 = Debug DLL|x64 + Debug LIB|Win32 = Debug LIB|Win32 + Debug LIB|x64 = Debug LIB|x64 + Release DLL|Win32 = Release DLL|Win32 + Release DLL|x64 = Release DLL|x64 + Release LIB|Win32 = Release LIB|Win32 + Release LIB|x64 = Release LIB|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug DLL|Win32.ActiveCfg = Debug DLL|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug DLL|Win32.Build.0 = Debug DLL|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug DLL|Win32.Deploy.0 = Debug DLL|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug DLL|x64.ActiveCfg = Debug DLL|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug DLL|x64.Build.0 = Debug DLL|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug DLL|x64.Deploy.0 = Debug DLL|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug LIB|Win32.ActiveCfg = Debug LIB|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug LIB|Win32.Build.0 = Debug LIB|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug LIB|Win32.Deploy.0 = Debug LIB|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug LIB|x64.ActiveCfg = Debug LIB|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug LIB|x64.Build.0 = Debug LIB|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug LIB|x64.Deploy.0 = Debug LIB|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release DLL|Win32.ActiveCfg = Release DLL|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release DLL|Win32.Build.0 = Release DLL|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release DLL|Win32.Deploy.0 = Release DLL|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release DLL|x64.ActiveCfg = Release DLL|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release DLL|x64.Build.0 = Release DLL|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release DLL|x64.Deploy.0 = Release DLL|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release LIB|Win32.ActiveCfg = Release LIB|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release LIB|Win32.Build.0 = Release LIB|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release LIB|Win32.Deploy.0 = Release LIB|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release LIB|x64.ActiveCfg = Release LIB|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release LIB|x64.Build.0 = Release LIB|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release LIB|x64.Deploy.0 = Release LIB|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012/liblfds700.vcxproj b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012/liblfds700.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..3d4bf6364f8d8d7f85cc85e8bdf812d5bfb6bb7f --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012/liblfds700.vcxproj @@ -0,0 +1,705 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug DLL|Win32"> + <Configuration>Debug DLL</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug DLL|x64"> + <Configuration>Debug DLL</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug LIB|Win32"> + <Configuration>Debug LIB</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug LIB|x64"> + <Configuration>Debug LIB</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release DLL|Win32"> + <Configuration>Release DLL</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release DLL|x64"> + <Configuration>Release DLL</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release LIB|Win32"> + <Configuration>Release LIB</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release LIB|x64"> + <Configuration>Release LIB</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}</ProjectGuid> + <Keyword>Win32Proj</Keyword> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v110</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v110</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|x64'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v110</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v110</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v110</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v110</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|x64'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v110</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v110</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug LIB|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release LIB|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|Win32'"> + <LinkIncremental>true</LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'"> + <LinkIncremental> + </LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|x64'"> + <LinkIncremental>true</LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'"> + <LinkIncremental> + </LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|Win32'"> + <LinkIncremental>true</LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'"> + <LinkIncremental> + </LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|x64'"> + <LinkIncremental>true</LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'"> + <LinkIncremental> + </LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|Win32'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;LFDS700_BUILD_TYPE_STRING="Debug";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories> + </AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <Optimization>Disabled</Optimization> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <IntrinsicFunctions>true</IntrinsicFunctions> + <StringPooling>true</StringPooling> + <ExceptionHandling>false</ExceptionHandling> + <SmallerTypeCheck>true</SmallerTypeCheck> + <FunctionLevelLinking> + </FunctionLevelLinking> + <EnableParallelCodeGeneration> + </EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet> + </EnableEnhancedInstructionSet> + <FloatingPointExceptions>true</FloatingPointExceptions> + <CreateHotpatchableImage>false</CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <BrowseInformation>true</BrowseInformation> + <CompileAs>CompileAsC</CompileAs> + <UseFullPaths>true</UseFullPaths> + <ErrorReporting>None</ErrorReporting> + <SDLCheck>true</SDLCheck> + <MinimalRebuild>false</MinimalRebuild> + <DisableSpecificWarnings>4068</DisableSpecificWarnings> + </ClCompile> + <Link> + <TargetMachine>MachineX86</TargetMachine> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Windows</SubSystem> + </Link> + <Lib> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> + </Lib> + <Lib> + <TargetMachine>MachineX86</TargetMachine> + </Lib> + <Lib> + <SubSystem>Console</SubSystem> + </Lib> + <Lib> + <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + </Lib> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;LFDS700_BUILD_TYPE_STRING="Debug";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories> + </AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <Optimization>Disabled</Optimization> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <IntrinsicFunctions>true</IntrinsicFunctions> + <StringPooling>true</StringPooling> + <ExceptionHandling>false</ExceptionHandling> + <SmallerTypeCheck>true</SmallerTypeCheck> + <FunctionLevelLinking> + </FunctionLevelLinking> + <EnableParallelCodeGeneration> + </EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet> + </EnableEnhancedInstructionSet> + <FloatingPointExceptions>true</FloatingPointExceptions> + <CreateHotpatchableImage>false</CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <BrowseInformation>true</BrowseInformation> + <CompileAs>CompileAsC</CompileAs> + <UseFullPaths>true</UseFullPaths> + <ErrorReporting>None</ErrorReporting> + <SDLCheck>true</SDLCheck> + <MinimalRebuild>false</MinimalRebuild> + <DisableSpecificWarnings>4068</DisableSpecificWarnings> + </ClCompile> + <Link> + <TargetMachine>MachineX86</TargetMachine> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <AdditionalDependencies>kernel32.lib;msvcrtd.lib</AdditionalDependencies> + <LinkStatus> + </LinkStatus> + <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + <ModuleDefinitionFile>liblfds700.def</ModuleDefinitionFile> + <MapExports>true</MapExports> + <LinkErrorReporting>NoErrorReport</LinkErrorReporting> + <GenerateMapFile>true</GenerateMapFile> + </Link> + <Lib> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> + </Lib> + <Lib> + <TargetMachine>MachineX86</TargetMachine> + </Lib> + <Lib> + <SubSystem>Console</SubSystem> + </Lib> + <Lib> + <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + </Lib> + <ProjectReference> + <LinkLibraryDependencies>true</LinkLibraryDependencies> + </ProjectReference> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|x64'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;LFDS700_BUILD_TYPE_STRING="Debug";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories> + </AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <Optimization>Disabled</Optimization> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <IntrinsicFunctions>true</IntrinsicFunctions> + <StringPooling>true</StringPooling> + <ExceptionHandling>false</ExceptionHandling> + <SmallerTypeCheck>true</SmallerTypeCheck> + <FunctionLevelLinking> + </FunctionLevelLinking> + <EnableParallelCodeGeneration> + </EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet> + </EnableEnhancedInstructionSet> + <FloatingPointExceptions>true</FloatingPointExceptions> + <CreateHotpatchableImage>false</CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <BrowseInformation>true</BrowseInformation> + <CompileAs>CompileAsC</CompileAs> + <UseFullPaths>true</UseFullPaths> + <ErrorReporting>None</ErrorReporting> + <SDLCheck>true</SDLCheck> + <MinimalRebuild>false</MinimalRebuild> + <DisableSpecificWarnings>4068</DisableSpecificWarnings> + <OmitFramePointers>false</OmitFramePointers> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Windows</SubSystem> + </Link> + <Lib> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> + </Lib> + <Lib> + <TargetMachine>MachineX64</TargetMachine> + </Lib> + <Lib> + <SubSystem>Console</SubSystem> + </Lib> + <Lib> + <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + </Lib> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;LFDS700_BUILD_TYPE_STRING="Debug";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories> + </AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <Optimization>Disabled</Optimization> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <IntrinsicFunctions>true</IntrinsicFunctions> + <StringPooling>true</StringPooling> + <ExceptionHandling>false</ExceptionHandling> + <SmallerTypeCheck>true</SmallerTypeCheck> + <FunctionLevelLinking> + </FunctionLevelLinking> + <EnableParallelCodeGeneration> + </EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet> + </EnableEnhancedInstructionSet> + <FloatingPointExceptions>true</FloatingPointExceptions> + <CreateHotpatchableImage>false</CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <BrowseInformation>true</BrowseInformation> + <CompileAs>CompileAsC</CompileAs> + <UseFullPaths>true</UseFullPaths> + <ErrorReporting>None</ErrorReporting> + <SDLCheck>true</SDLCheck> + <MinimalRebuild>false</MinimalRebuild> + <DisableSpecificWarnings>4068</DisableSpecificWarnings> + <OmitFramePointers>false</OmitFramePointers> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + <ModuleDefinitionFile>liblfds700.def</ModuleDefinitionFile> + <MapExports>true</MapExports> + <OptimizeReferences>false</OptimizeReferences> + <LinkErrorReporting>NoErrorReport</LinkErrorReporting> + <AdditionalDependencies>kernel32.lib;msvcrtd.lib</AdditionalDependencies> + <GenerateMapFile>true</GenerateMapFile> + </Link> + <Lib> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> + </Lib> + <Lib> + <TargetMachine>MachineX64</TargetMachine> + </Lib> + <Lib> + <SubSystem>Console</SubSystem> + </Lib> + <Lib> + <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + </Lib> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|Win32'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;LFDS700_BUILD_TYPE_STRING="Release";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories> + </AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>None</DebugInformationFormat> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> + <StringPooling>true</StringPooling> + <ExceptionHandling>false</ExceptionHandling> + <BufferSecurityCheck>false</BufferSecurityCheck> + <FunctionLevelLinking> + </FunctionLevelLinking> + <EnableParallelCodeGeneration> + </EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet> + </EnableEnhancedInstructionSet> + <FloatingPointExceptions>false</FloatingPointExceptions> + <CreateHotpatchableImage> + </CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <CompileAs>CompileAsC</CompileAs> + <UseFullPaths>true</UseFullPaths> + <ErrorReporting>None</ErrorReporting> + <OmitFramePointers>true</OmitFramePointers> + <DisableSpecificWarnings>4068</DisableSpecificWarnings> + <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations> + </ClCompile> + <Link> + <TargetMachine>MachineX86</TargetMachine> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Windows</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + <Lib> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> + </Lib> + <Lib> + <TargetMachine>MachineX86</TargetMachine> + </Lib> + <Lib> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + </Lib> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;LFDS700_BUILD_TYPE_STRING="Release";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories> + </AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>None</DebugInformationFormat> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> + <StringPooling>true</StringPooling> + <ExceptionHandling>false</ExceptionHandling> + <BufferSecurityCheck>false</BufferSecurityCheck> + <FunctionLevelLinking> + </FunctionLevelLinking> + <EnableParallelCodeGeneration> + </EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet> + </EnableEnhancedInstructionSet> + <FloatingPointExceptions>false</FloatingPointExceptions> + <CreateHotpatchableImage> + </CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <CompileAs>CompileAsC</CompileAs> + <UseFullPaths>true</UseFullPaths> + <ErrorReporting>None</ErrorReporting> + <OmitFramePointers>true</OmitFramePointers> + <DisableSpecificWarnings>4068</DisableSpecificWarnings> + <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations> + </ClCompile> + <Link> + <TargetMachine>MachineX86</TargetMachine> + <GenerateDebugInformation>false</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <AdditionalDependencies>kernel32.lib;msvcrt.lib</AdditionalDependencies> + <LinkStatus> + </LinkStatus> + <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + <ModuleDefinitionFile>liblfds700.def</ModuleDefinitionFile> + <LinkErrorReporting>NoErrorReport</LinkErrorReporting> + </Link> + <Lib> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> + </Lib> + <Lib> + <TargetMachine>MachineX86</TargetMachine> + </Lib> + <Lib> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + </Lib> + <ProjectReference> + <LinkLibraryDependencies>true</LinkLibraryDependencies> + </ProjectReference> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|x64'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;LFDS700_BUILD_TYPE_STRING="Release";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories> + </AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>None</DebugInformationFormat> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> + <StringPooling>true</StringPooling> + <ExceptionHandling>false</ExceptionHandling> + <BufferSecurityCheck>false</BufferSecurityCheck> + <FunctionLevelLinking> + </FunctionLevelLinking> + <EnableParallelCodeGeneration> + </EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet> + </EnableEnhancedInstructionSet> + <FloatingPointExceptions>false</FloatingPointExceptions> + <CreateHotpatchableImage> + </CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <CompileAs>CompileAsC</CompileAs> + <UseFullPaths>true</UseFullPaths> + <ErrorReporting>None</ErrorReporting> + <OmitFramePointers>true</OmitFramePointers> + <DisableSpecificWarnings>4068</DisableSpecificWarnings> + <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Windows</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + <Lib> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> + </Lib> + <Lib> + <TargetMachine>MachineX64</TargetMachine> + </Lib> + <Lib> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + </Lib> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;LFDS700_BUILD_TYPE_STRING="Release";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories> + </AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>None</DebugInformationFormat> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> + <StringPooling>true</StringPooling> + <ExceptionHandling>false</ExceptionHandling> + <BufferSecurityCheck>false</BufferSecurityCheck> + <FunctionLevelLinking> + </FunctionLevelLinking> + <EnableParallelCodeGeneration> + </EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet> + </EnableEnhancedInstructionSet> + <FloatingPointExceptions>false</FloatingPointExceptions> + <CreateHotpatchableImage> + </CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <CompileAs>CompileAsC</CompileAs> + <UseFullPaths>true</UseFullPaths> + <ErrorReporting>None</ErrorReporting> + <OmitFramePointers>true</OmitFramePointers> + <DisableSpecificWarnings>4068</DisableSpecificWarnings> + <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations> + </ClCompile> + <Link> + <GenerateDebugInformation>false</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + <ModuleDefinitionFile>liblfds700.def</ModuleDefinitionFile> + <LinkErrorReporting>NoErrorReport</LinkErrorReporting> + <AdditionalDependencies>kernel32.lib;msvcrt.lib</AdditionalDependencies> + </Link> + <Lib> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> + </Lib> + <Lib> + <TargetMachine>MachineX64</TargetMachine> + </Lib> + <Lib> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + </Lib> + </ItemDefinitionGroup> + <ItemGroup> + <ClInclude Include="..\..\inc\liblfds700.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_btree_addonly_unbalanced.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_freelist.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_hash_addonly.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_list_addonly_ordered_singlylinked.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_list_addonly_singlylinked_unordered.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_misc.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_porting_abstraction_layer_compiler.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_porting_abstraction_layer_operating_system.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_porting_abstraction_layer_processor.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_queue.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_queue_bounded_singleconsumer_singleproducer.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_ringbuffer.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_stack.h" /> + <ClInclude Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_internal.h" /> + <ClInclude Include="..\..\src\lfds700_freelist\lfds700_freelist_internal.h" /> + <ClInclude Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_internal.h" /> + <ClInclude Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_internal.h" /> + <ClInclude Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_internal.h" /> + <ClInclude Include="..\..\src\lfds700_misc\lfds700_misc_internal.h" /> + <ClInclude Include="..\..\src\lfds700_queue\lfds700_queue_internal.h" /> + <ClInclude Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_internal.h" /> + <ClInclude Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_internal.h" /> + <ClInclude Include="..\..\src\lfds700_stack\lfds700_stack_internal.h" /> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_get.c" /> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_init.c" /> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_insert.c" /> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_query.c" /> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_init.c" /> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_pop.c" /> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_push.c" /> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_query.c" /> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_get.c" /> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_init.c" /> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_insert.c" /> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_iterate.c" /> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_query.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_get.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_init.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_insert.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_query.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_get.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_init.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_insert.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_query.c" /> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_globals.c" /> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_init.c" /> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_prng.c" /> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_query.c" /> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_dequeue.c" /> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_enqueue.c" /> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_init.c" /> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_query.c" /> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_dequeue.c" /> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_enqueue.c" /> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_init.c" /> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_query.c" /> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_init.c" /> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_query.c" /> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_read.c" /> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_write.c" /> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_init.c" /> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_pop.c" /> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_push.c" /> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_query.c" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project> \ No newline at end of file diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012/liblfds700.vcxproj.filters b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012/liblfds700.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..5ec0bea579b2125c7e4bfcc4e919e99e00b5e90f --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012/liblfds700.vcxproj.filters @@ -0,0 +1,279 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> + </Filter> + <Filter Include="Resource Files"> + <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions> + </Filter> + <Filter Include="Header Files\liblfds700"> + <UniqueIdentifier>{258be429-7dac-4999-b995-753aa2f0c505}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_freelist"> + <UniqueIdentifier>{469abf8e-47d8-4678-bd66-7c7e65c5f52e}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_ringbuffer"> + <UniqueIdentifier>{62ee141b-2acb-4555-b016-7be20a57f2bf}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_stack"> + <UniqueIdentifier>{19c73b0f-25e0-4166-9093-427f1dfb4f70}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_queue"> + <UniqueIdentifier>{00eb30fe-e638-4c2b-8ca1-1f09c4a0ed45}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_misc"> + <UniqueIdentifier>{400ae4e9-2281-4549-b918-59d1a27a2d07}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_btree_addonly_unbalanced"> + <UniqueIdentifier>{0b1fafc3-817b-4c18-8eb1-121884e3a29b}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_hash_addonly"> + <UniqueIdentifier>{bcbadc74-1748-4696-aad7-7fdbe5614624}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_list_addonly_ordered_singlylinked"> + <UniqueIdentifier>{c45194af-7b41-4c28-bc0e-1095ec347664}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_queue_bounded_singleconsumer_singleproducer"> + <UniqueIdentifier>{6250c4d5-ac8e-4c28-93de-0954c5bed1cb}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_list_addonly_singlylinked_unordered"> + <UniqueIdentifier>{3ac93721-1d81-49e4-9581-dbc12ace5c0c}</UniqueIdentifier> + </Filter> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\inc\liblfds700.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_freelist\lfds700_freelist_internal.h"> + <Filter>Source Files\lfds700_freelist</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_queue\lfds700_queue_internal.h"> + <Filter>Source Files\lfds700_queue</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_stack\lfds700_stack_internal.h"> + <Filter>Source Files\lfds700_stack</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_btree_addonly_unbalanced.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_freelist.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_hash_addonly.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_list_addonly_ordered_singlylinked.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_list_addonly_singlylinked_unordered.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_misc.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_porting_abstraction_layer_compiler.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_porting_abstraction_layer_operating_system.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_porting_abstraction_layer_processor.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_queue.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_queue_bounded_singleconsumer_singleproducer.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_ringbuffer.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_stack.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_internal.h"> + <Filter>Source Files\lfds700_hash_addonly</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_misc\lfds700_misc_internal.h"> + <Filter>Source Files\lfds700_misc</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_internal.h"> + <Filter>Source Files\lfds700_btree_addonly_unbalanced</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_internal.h"> + <Filter>Source Files\lfds700_ringbuffer</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_internal.h"> + <Filter>Source Files\lfds700_queue_bounded_singleconsumer_singleproducer</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_internal.h"> + <Filter>Source Files\lfds700_list_addonly_ordered_singlylinked</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_internal.h"> + <Filter>Source Files\lfds700_list_addonly_singlylinked_unordered</Filter> + </ClInclude> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_cleanup.c"> + <Filter>Source Files\lfds700_freelist</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_init.c"> + <Filter>Source Files\lfds700_freelist</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_pop.c"> + <Filter>Source Files\lfds700_freelist</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_push.c"> + <Filter>Source Files\lfds700_freelist</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_query.c"> + <Filter>Source Files\lfds700_freelist</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_cleanup.c"> + <Filter>Source Files\lfds700_queue</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_dequeue.c"> + <Filter>Source Files\lfds700_queue</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_enqueue.c"> + <Filter>Source Files\lfds700_queue</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_init.c"> + <Filter>Source Files\lfds700_queue</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_query.c"> + <Filter>Source Files\lfds700_queue</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_cleanup.c"> + <Filter>Source Files\lfds700_stack</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_init.c"> + <Filter>Source Files\lfds700_stack</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_pop.c"> + <Filter>Source Files\lfds700_stack</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_push.c"> + <Filter>Source Files\lfds700_stack</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_query.c"> + <Filter>Source Files\lfds700_stack</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_cleanup.c"> + <Filter>Source Files\lfds700_hash_addonly</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_get.c"> + <Filter>Source Files\lfds700_hash_addonly</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_init.c"> + <Filter>Source Files\lfds700_hash_addonly</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_insert.c"> + <Filter>Source Files\lfds700_hash_addonly</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_iterate.c"> + <Filter>Source Files\lfds700_hash_addonly</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_query.c"> + <Filter>Source Files\lfds700_hash_addonly</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_cleanup.c"> + <Filter>Source Files\lfds700_misc</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_globals.c"> + <Filter>Source Files\lfds700_misc</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_init.c"> + <Filter>Source Files\lfds700_misc</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_prng.c"> + <Filter>Source Files\lfds700_misc</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_query.c"> + <Filter>Source Files\lfds700_misc</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_cleanup.c"> + <Filter>Source Files\lfds700_btree_addonly_unbalanced</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_get.c"> + <Filter>Source Files\lfds700_btree_addonly_unbalanced</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_init.c"> + <Filter>Source Files\lfds700_btree_addonly_unbalanced</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_insert.c"> + <Filter>Source Files\lfds700_btree_addonly_unbalanced</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_query.c"> + <Filter>Source Files\lfds700_btree_addonly_unbalanced</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_cleanup.c"> + <Filter>Source Files\lfds700_ringbuffer</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_init.c"> + <Filter>Source Files\lfds700_ringbuffer</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_query.c"> + <Filter>Source Files\lfds700_ringbuffer</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_read.c"> + <Filter>Source Files\lfds700_ringbuffer</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_write.c"> + <Filter>Source Files\lfds700_ringbuffer</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_cleanup.c"> + <Filter>Source Files\lfds700_queue_bounded_singleconsumer_singleproducer</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_dequeue.c"> + <Filter>Source Files\lfds700_queue_bounded_singleconsumer_singleproducer</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_enqueue.c"> + <Filter>Source Files\lfds700_queue_bounded_singleconsumer_singleproducer</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_init.c"> + <Filter>Source Files\lfds700_queue_bounded_singleconsumer_singleproducer</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_query.c"> + <Filter>Source Files\lfds700_queue_bounded_singleconsumer_singleproducer</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_cleanup.c"> + <Filter>Source Files\lfds700_list_addonly_ordered_singlylinked</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_get.c"> + <Filter>Source Files\lfds700_list_addonly_ordered_singlylinked</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_init.c"> + <Filter>Source Files\lfds700_list_addonly_ordered_singlylinked</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_insert.c"> + <Filter>Source Files\lfds700_list_addonly_ordered_singlylinked</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_query.c"> + <Filter>Source Files\lfds700_list_addonly_ordered_singlylinked</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_cleanup.c"> + <Filter>Source Files\lfds700_list_addonly_singlylinked_unordered</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_get.c"> + <Filter>Source Files\lfds700_list_addonly_singlylinked_unordered</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_init.c"> + <Filter>Source Files\lfds700_list_addonly_singlylinked_unordered</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_insert.c"> + <Filter>Source Files\lfds700_list_addonly_singlylinked_unordered</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_query.c"> + <Filter>Source Files\lfds700_list_addonly_singlylinked_unordered</Filter> + </ClCompile> + </ItemGroup> +</Project> \ No newline at end of file diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012/liblfds700.vcxproj.user b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012/liblfds700.vcxproj.user new file mode 100644 index 0000000000000000000000000000000000000000..7cbb3216adb733fd25e1bd27d504ac8419b8c5bb --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012/liblfds700.vcxproj.user @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup /> +</Project> \ No newline at end of file diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012_and_wdk_8.0/driver_entry.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012_and_wdk_8.0/driver_entry.c new file mode 100644 index 0000000000000000000000000000000000000000..9ea5612e54cbfd9a804db99cea19270e596d3eef --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012_and_wdk_8.0/driver_entry.c @@ -0,0 +1 @@ +#include <wdf.h> diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012_and_wdk_8.0/liblfds700.def b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012_and_wdk_8.0/liblfds700.def new file mode 100644 index 0000000000000000000000000000000000000000..583ce35dbdb08c553e2cb2a7f335f4bcaf9458da --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012_and_wdk_8.0/liblfds700.def @@ -0,0 +1,69 @@ +EXPORTS + +lfds700_btree_au_init_valid_on_current_logical_core = lfds700_btree_au_init_valid_on_current_logical_core +lfds700_btree_au_cleanup = lfds700_btree_au_cleanup +lfds700_btree_au_insert = lfds700_btree_au_insert +lfds700_btree_au_get_by_absolute_position_and_then_by_relative_position = lfds700_btree_au_get_by_absolute_position_and_then_by_relative_position +lfds700_btree_au_get_by_absolute_position = lfds700_btree_au_get_by_absolute_position +lfds700_btree_au_get_by_relative_position = lfds700_btree_au_get_by_relative_position +lfds700_btree_au_get_by_key = lfds700_btree_au_get_by_key +lfds700_btree_au_query = lfds700_btree_au_query + +lfds700_freelist_init_valid_on_current_logical_core = lfds700_freelist_init_valid_on_current_logical_core +lfds700_freelist_cleanup = lfds700_freelist_cleanup +lfds700_freelist_push = lfds700_freelist_push +lfds700_freelist_pop = lfds700_freelist_pop +lfds700_freelist_query = lfds700_freelist_query + +lfds700_hash_a_init_valid_on_current_logical_core = lfds700_hash_a_init_valid_on_current_logical_core +lfds700_hash_a_cleanup = lfds700_hash_a_cleanup +lfds700_hash_a_insert = lfds700_hash_a_insert +lfds700_hash_a_get_by_key = lfds700_hash_a_get_by_key +lfds700_hash_a_iterate_init = lfds700_hash_a_iterate_init +lfds700_hash_a_iterate = lfds700_hash_a_iterate +lfds700_hash_a_query = lfds700_hash_a_query + +lfds700_list_aos_init_valid_on_current_logical_core = lfds700_list_aos_init_valid_on_current_logical_core +lfds700_list_aos_cleanup = lfds700_list_aos_cleanup +lfds700_list_aos_insert = lfds700_list_aos_insert +lfds700_list_aos_get_by_key = lfds700_list_aos_get_by_key +lfds700_list_aos_query = lfds700_list_aos_query + +lfds700_list_asu_init_valid_on_current_logical_core = lfds700_list_asu_init_valid_on_current_logical_core +lfds700_list_asu_cleanup = lfds700_list_asu_cleanup +lfds700_list_asu_insert_at_position = lfds700_list_asu_insert_at_position +lfds700_list_asu_insert_at_start = lfds700_list_asu_insert_at_start +lfds700_list_asu_insert_at_end = lfds700_list_asu_insert_at_end +lfds700_list_asu_insert_after_element = lfds700_list_asu_insert_after_element +lfds700_list_asu_get_by_key = lfds700_list_asu_get_by_key +lfds700_list_asu_query = lfds700_list_asu_query + +lfds700_misc_library_init_valid_on_current_logical_core = lfds700_misc_library_init_valid_on_current_logical_core +lfds700_misc_library_cleanup = lfds700_misc_library_cleanup +lfds700_misc_prng_init = lfds700_misc_prng_init +lfds700_misc_query = lfds700_misc_query + +lfds700_queue_init_valid_on_current_logical_core = lfds700_queue_init_valid_on_current_logical_core +lfds700_queue_cleanup = lfds700_queue_cleanup +lfds700_queue_enqueue = lfds700_queue_enqueue +lfds700_queue_dequeue = lfds700_queue_dequeue +lfds700_queue_query = lfds700_queue_query + +lfds700_queue_bss_init_valid_on_current_logical_core = lfds700_queue_bss_init_valid_on_current_logical_core +lfds700_queue_bss_cleanup = lfds700_queue_bss_cleanup +lfds700_queue_bss_enqueue = lfds700_queue_bss_enqueue +lfds700_queue_bss_dequeue = lfds700_queue_bss_dequeue +lfds700_queue_bss_query = lfds700_queue_bss_query + +lfds700_ringbuffer_init_valid_on_current_logical_core = lfds700_ringbuffer_init_valid_on_current_logical_core +lfds700_ringbuffer_cleanup = lfds700_ringbuffer_cleanup +lfds700_ringbuffer_read = lfds700_ringbuffer_read +lfds700_ringbuffer_write = lfds700_ringbuffer_write +lfds700_ringbuffer_query = lfds700_ringbuffer_query + +lfds700_stack_init_valid_on_current_logical_core = lfds700_stack_init_valid_on_current_logical_core +lfds700_stack_cleanup = lfds700_stack_cleanup +lfds700_stack_push = lfds700_stack_push +lfds700_stack_pop = lfds700_stack_pop +lfds700_stack_query = lfds700_stack_query + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012_and_wdk_8.0/liblfds700.sln b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012_and_wdk_8.0/liblfds700.sln new file mode 100644 index 0000000000000000000000000000000000000000..b52c44e46f36cfc3de33a8a5663832062c6de1cf --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012_and_wdk_8.0/liblfds700.sln @@ -0,0 +1,46 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblfds700", "liblfds700.vcxproj", "{1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug DLL|Win32 = Debug DLL|Win32 + Debug DLL|x64 = Debug DLL|x64 + Debug LIB|Win32 = Debug LIB|Win32 + Debug LIB|x64 = Debug LIB|x64 + Release DLL|Win32 = Release DLL|Win32 + Release DLL|x64 = Release DLL|x64 + Release LIB|Win32 = Release LIB|Win32 + Release LIB|x64 = Release LIB|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug DLL|Win32.ActiveCfg = Debug DLL|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug DLL|Win32.Build.0 = Debug DLL|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug DLL|Win32.Deploy.0 = Debug DLL|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug DLL|x64.ActiveCfg = Debug DLL|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug DLL|x64.Build.0 = Debug DLL|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug DLL|x64.Deploy.0 = Debug DLL|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug LIB|Win32.ActiveCfg = Debug LIB|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug LIB|Win32.Build.0 = Debug LIB|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug LIB|Win32.Deploy.0 = Debug LIB|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug LIB|x64.ActiveCfg = Debug LIB|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug LIB|x64.Build.0 = Debug LIB|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug LIB|x64.Deploy.0 = Debug LIB|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release DLL|Win32.ActiveCfg = Release DLL|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release DLL|Win32.Build.0 = Release DLL|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release DLL|Win32.Deploy.0 = Release DLL|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release DLL|x64.ActiveCfg = Release DLL|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release DLL|x64.Build.0 = Release DLL|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release DLL|x64.Deploy.0 = Release DLL|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release LIB|Win32.ActiveCfg = Release LIB|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release LIB|Win32.Build.0 = Release LIB|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release LIB|Win32.Deploy.0 = Release LIB|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release LIB|x64.ActiveCfg = Release LIB|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release LIB|x64.Build.0 = Release LIB|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release LIB|x64.Deploy.0 = Release LIB|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012_and_wdk_8.0/liblfds700.vcxproj b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012_and_wdk_8.0/liblfds700.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..f19ead0c18bbf81a532e866d71d98d4ca1c6726d --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012_and_wdk_8.0/liblfds700.vcxproj @@ -0,0 +1,733 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug DLL|Win32"> + <Configuration>Debug DLL</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug DLL|x64"> + <Configuration>Debug DLL</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug LIB|Win32"> + <Configuration>Debug LIB</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug LIB|x64"> + <Configuration>Debug LIB</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release DLL|Win32"> + <Configuration>Release DLL</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release DLL|x64"> + <Configuration>Release DLL</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release LIB|Win32"> + <Configuration>Release LIB</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release LIB|x64"> + <Configuration>Release LIB</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}</ProjectGuid> + <Keyword>Win32Proj</Keyword> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>WindowsKernelModeDriver8.0</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>WindowsKernelModeDriver8.0</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|x64'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>WindowsKernelModeDriver8.0</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>WindowsKernelModeDriver8.0</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>WindowsKernelModeDriver8.0</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>WindowsKernelModeDriver8.0</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|x64'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>WindowsKernelModeDriver8.0</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>WindowsKernelModeDriver8.0</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug LIB|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release LIB|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|Win32'"> + <LinkIncremental>true</LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + <IncludePath>$(ProjectDir);$(IncludePath);</IncludePath> + <LibraryPath>$(WDKContentRoot)lib\$(DDKSpec)\KM\$(DDKPlatform);$(LibraryPath);</LibraryPath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'"> + <LinkIncremental> + </LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + <IncludePath>$(ProjectDir);$(IncludePath);</IncludePath> + <LibraryPath>$(WDKContentRoot)lib\$(DDKSpec)\KM\$(DDKPlatform);$(LibraryPath);</LibraryPath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|x64'"> + <LinkIncremental>true</LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + <IncludePath>$(ProjectDir);$(IncludePath);</IncludePath> + <LibraryPath>$(WDKContentRoot)lib\$(DDKSpec)\KM\$(DDKPlatform);$(LibraryPath);</LibraryPath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'"> + <LinkIncremental> + </LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + <IncludePath>$(ProjectDir);$(IncludePath);</IncludePath> + <LibraryPath>$(WDKContentRoot)lib\$(DDKSpec)\KM\$(DDKPlatform);$(LibraryPath);</LibraryPath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|Win32'"> + <LinkIncremental>true</LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + <IncludePath>$(ProjectDir);$(IncludePath);</IncludePath> + <LibraryPath>$(WDKContentRoot)lib\$(DDKSpec)\KM\$(DDKPlatform);$(LibraryPath);</LibraryPath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'"> + <LinkIncremental> + </LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + <IncludePath>$(ProjectDir);$(IncludePath);</IncludePath> + <LibraryPath>$(WDKContentRoot)lib\$(DDKSpec)\KM\$(DDKPlatform);$(LibraryPath);</LibraryPath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|x64'"> + <LinkIncremental>true</LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + <IncludePath>$(ProjectDir);$(IncludePath);</IncludePath> + <LibraryPath>$(WDKContentRoot)lib\$(DDKSpec)\KM\$(DDKPlatform);$(LibraryPath);</LibraryPath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'"> + <LinkIncremental> + </LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + <IncludePath>$(ProjectDir);$(IncludePath);</IncludePath> + <LibraryPath>$(WDKContentRoot)lib\$(DDKSpec)\KM\$(DDKPlatform);$(LibraryPath);</LibraryPath> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|Win32'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;LFDS700_BUILD_TYPE_STRING="Debug";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories> + </AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <Optimization>Disabled</Optimization> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <IntrinsicFunctions>true</IntrinsicFunctions> + <StringPooling>true</StringPooling> + <ExceptionHandling>false</ExceptionHandling> + <SmallerTypeCheck>true</SmallerTypeCheck> + <FunctionLevelLinking> + </FunctionLevelLinking> + <EnableParallelCodeGeneration> + </EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet> + </EnableEnhancedInstructionSet> + <FloatingPointExceptions>true</FloatingPointExceptions> + <CreateHotpatchableImage>false</CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <BrowseInformation>true</BrowseInformation> + <CompileAs>CompileAsC</CompileAs> + <UseFullPaths>true</UseFullPaths> + <ErrorReporting>None</ErrorReporting> + <SDLCheck>true</SDLCheck> + <MinimalRebuild>false</MinimalRebuild> + <DisableSpecificWarnings>4068</DisableSpecificWarnings> + <AdditionalOptions>/kernel %(AdditionalOptions)</AdditionalOptions> + </ClCompile> + <Link> + <TargetMachine>MachineX86</TargetMachine> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Windows</SubSystem> + </Link> + <Lib> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> + </Lib> + <Lib> + <TargetMachine>MachineX86</TargetMachine> + </Lib> + <Lib> + <SubSystem>Native</SubSystem> + </Lib> + <Lib> + <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + </Lib> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;LFDS700_BUILD_TYPE_STRING="Debug";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories> + </AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <Optimization>Disabled</Optimization> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <IntrinsicFunctions>true</IntrinsicFunctions> + <StringPooling>true</StringPooling> + <ExceptionHandling>false</ExceptionHandling> + <SmallerTypeCheck>true</SmallerTypeCheck> + <FunctionLevelLinking> + </FunctionLevelLinking> + <EnableParallelCodeGeneration> + </EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet> + </EnableEnhancedInstructionSet> + <FloatingPointExceptions>true</FloatingPointExceptions> + <CreateHotpatchableImage>false</CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <BrowseInformation>true</BrowseInformation> + <CompileAs>CompileAsC</CompileAs> + <UseFullPaths>true</UseFullPaths> + <ErrorReporting>None</ErrorReporting> + <SDLCheck>true</SDLCheck> + <MinimalRebuild>false</MinimalRebuild> + <DisableSpecificWarnings>4068</DisableSpecificWarnings> + <AdditionalOptions>/kernel %(AdditionalOptions)</AdditionalOptions> + </ClCompile> + <Link> + <TargetMachine>MachineX86</TargetMachine> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Native</SubSystem> + <AdditionalDependencies>kernel32.lib;msvcrtd.lib</AdditionalDependencies> + <LinkStatus> + </LinkStatus> + <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + <ModuleDefinitionFile>liblfds700.def</ModuleDefinitionFile> + <MapExports>true</MapExports> + <LinkErrorReporting>NoErrorReport</LinkErrorReporting> + <GenerateMapFile>true</GenerateMapFile> + <Driver>WDM</Driver> + </Link> + <Lib> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> + </Lib> + <Lib> + <TargetMachine>MachineX86</TargetMachine> + </Lib> + <Lib> + <SubSystem>Console</SubSystem> + </Lib> + <Lib> + <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + </Lib> + <ProjectReference> + <LinkLibraryDependencies>true</LinkLibraryDependencies> + </ProjectReference> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|x64'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;LFDS700_BUILD_TYPE_STRING="Debug";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories> + </AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <Optimization>Disabled</Optimization> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <IntrinsicFunctions>true</IntrinsicFunctions> + <StringPooling>true</StringPooling> + <ExceptionHandling>false</ExceptionHandling> + <SmallerTypeCheck>true</SmallerTypeCheck> + <FunctionLevelLinking> + </FunctionLevelLinking> + <EnableParallelCodeGeneration> + </EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet> + </EnableEnhancedInstructionSet> + <FloatingPointExceptions>true</FloatingPointExceptions> + <CreateHotpatchableImage>false</CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <BrowseInformation>true</BrowseInformation> + <CompileAs>CompileAsC</CompileAs> + <UseFullPaths>true</UseFullPaths> + <ErrorReporting>None</ErrorReporting> + <SDLCheck>true</SDLCheck> + <MinimalRebuild>false</MinimalRebuild> + <DisableSpecificWarnings>4068</DisableSpecificWarnings> + <OmitFramePointers>false</OmitFramePointers> + <AdditionalOptions>/kernel %(AdditionalOptions)</AdditionalOptions> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Windows</SubSystem> + </Link> + <Lib> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> + </Lib> + <Lib> + <TargetMachine>MachineX64</TargetMachine> + </Lib> + <Lib> + <SubSystem>Native</SubSystem> + </Lib> + <Lib> + <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + </Lib> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;LFDS700_BUILD_TYPE_STRING="Debug";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories> + </AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <Optimization>Disabled</Optimization> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <IntrinsicFunctions>true</IntrinsicFunctions> + <StringPooling>true</StringPooling> + <ExceptionHandling>false</ExceptionHandling> + <SmallerTypeCheck>true</SmallerTypeCheck> + <FunctionLevelLinking> + </FunctionLevelLinking> + <EnableParallelCodeGeneration> + </EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet> + </EnableEnhancedInstructionSet> + <FloatingPointExceptions>true</FloatingPointExceptions> + <CreateHotpatchableImage>false</CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <BrowseInformation>true</BrowseInformation> + <CompileAs>CompileAsC</CompileAs> + <UseFullPaths>true</UseFullPaths> + <ErrorReporting>None</ErrorReporting> + <SDLCheck>true</SDLCheck> + <MinimalRebuild>false</MinimalRebuild> + <DisableSpecificWarnings>4068</DisableSpecificWarnings> + <OmitFramePointers>false</OmitFramePointers> + <AdditionalOptions>/kernel %(AdditionalOptions)</AdditionalOptions> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Native</SubSystem> + <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + <ModuleDefinitionFile>liblfds700.def</ModuleDefinitionFile> + <MapExports>true</MapExports> + <OptimizeReferences>false</OptimizeReferences> + <LinkErrorReporting>NoErrorReport</LinkErrorReporting> + <AdditionalDependencies>kernel32.lib;msvcrtd.lib</AdditionalDependencies> + <GenerateMapFile>true</GenerateMapFile> + <Driver>WDM</Driver> + </Link> + <Lib> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> + </Lib> + <Lib> + <TargetMachine>MachineX64</TargetMachine> + </Lib> + <Lib> + <SubSystem>Console</SubSystem> + </Lib> + <Lib> + <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + </Lib> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|Win32'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;LFDS700_BUILD_TYPE_STRING="Release";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories> + </AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>None</DebugInformationFormat> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> + <StringPooling>true</StringPooling> + <ExceptionHandling>false</ExceptionHandling> + <BufferSecurityCheck>false</BufferSecurityCheck> + <FunctionLevelLinking> + </FunctionLevelLinking> + <EnableParallelCodeGeneration> + </EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet> + </EnableEnhancedInstructionSet> + <FloatingPointExceptions>false</FloatingPointExceptions> + <CreateHotpatchableImage> + </CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <CompileAs>CompileAsC</CompileAs> + <UseFullPaths>true</UseFullPaths> + <ErrorReporting>None</ErrorReporting> + <OmitFramePointers>true</OmitFramePointers> + <DisableSpecificWarnings>4068</DisableSpecificWarnings> + <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations> + <AdditionalOptions>/kernel %(AdditionalOptions)</AdditionalOptions> + </ClCompile> + <Link> + <TargetMachine>MachineX86</TargetMachine> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Windows</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + <Lib> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> + </Lib> + <Lib> + <TargetMachine>MachineX86</TargetMachine> + </Lib> + <Lib> + <SubSystem>Native</SubSystem> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + </Lib> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;LFDS700_BUILD_TYPE_STRING="Release";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories> + </AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>None</DebugInformationFormat> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> + <StringPooling>true</StringPooling> + <ExceptionHandling>false</ExceptionHandling> + <BufferSecurityCheck>false</BufferSecurityCheck> + <FunctionLevelLinking> + </FunctionLevelLinking> + <EnableParallelCodeGeneration> + </EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet> + </EnableEnhancedInstructionSet> + <FloatingPointExceptions>false</FloatingPointExceptions> + <CreateHotpatchableImage> + </CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <CompileAs>CompileAsC</CompileAs> + <UseFullPaths>true</UseFullPaths> + <ErrorReporting>None</ErrorReporting> + <OmitFramePointers>true</OmitFramePointers> + <DisableSpecificWarnings>4068</DisableSpecificWarnings> + <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations> + <AdditionalOptions>/kernel %(AdditionalOptions)</AdditionalOptions> + </ClCompile> + <Link> + <TargetMachine>MachineX86</TargetMachine> + <GenerateDebugInformation>false</GenerateDebugInformation> + <SubSystem>Native</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <AdditionalDependencies>kernel32.lib;msvcrt.lib</AdditionalDependencies> + <LinkStatus> + </LinkStatus> + <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + <ModuleDefinitionFile>liblfds700.def</ModuleDefinitionFile> + <LinkErrorReporting>NoErrorReport</LinkErrorReporting> + <Driver>WDM</Driver> + </Link> + <Lib> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> + </Lib> + <Lib> + <TargetMachine>MachineX86</TargetMachine> + </Lib> + <Lib> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + </Lib> + <ProjectReference> + <LinkLibraryDependencies>true</LinkLibraryDependencies> + </ProjectReference> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|x64'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;LFDS700_BUILD_TYPE_STRING="Release";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories> + </AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>None</DebugInformationFormat> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> + <StringPooling>true</StringPooling> + <ExceptionHandling>false</ExceptionHandling> + <BufferSecurityCheck>false</BufferSecurityCheck> + <FunctionLevelLinking> + </FunctionLevelLinking> + <EnableParallelCodeGeneration> + </EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet> + </EnableEnhancedInstructionSet> + <FloatingPointExceptions>false</FloatingPointExceptions> + <CreateHotpatchableImage> + </CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <CompileAs>CompileAsC</CompileAs> + <UseFullPaths>true</UseFullPaths> + <ErrorReporting>None</ErrorReporting> + <OmitFramePointers>true</OmitFramePointers> + <DisableSpecificWarnings>4068</DisableSpecificWarnings> + <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations> + <AdditionalOptions>/kernel %(AdditionalOptions)</AdditionalOptions> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Windows</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + <Lib> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> + </Lib> + <Lib> + <TargetMachine>MachineX64</TargetMachine> + </Lib> + <Lib> + <SubSystem>Native</SubSystem> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + </Lib> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;LFDS700_BUILD_TYPE_STRING="Release";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories> + </AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>None</DebugInformationFormat> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> + <StringPooling>true</StringPooling> + <ExceptionHandling>false</ExceptionHandling> + <BufferSecurityCheck>false</BufferSecurityCheck> + <FunctionLevelLinking> + </FunctionLevelLinking> + <EnableParallelCodeGeneration> + </EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet> + </EnableEnhancedInstructionSet> + <FloatingPointExceptions>false</FloatingPointExceptions> + <CreateHotpatchableImage> + </CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <CompileAs>CompileAsC</CompileAs> + <UseFullPaths>true</UseFullPaths> + <ErrorReporting>None</ErrorReporting> + <OmitFramePointers>true</OmitFramePointers> + <DisableSpecificWarnings>4068</DisableSpecificWarnings> + <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations> + <AdditionalOptions>/kernel %(AdditionalOptions)</AdditionalOptions> + </ClCompile> + <Link> + <GenerateDebugInformation>false</GenerateDebugInformation> + <SubSystem>Native</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + <ModuleDefinitionFile>liblfds700.def</ModuleDefinitionFile> + <LinkErrorReporting>NoErrorReport</LinkErrorReporting> + <AdditionalDependencies>kernel32.lib;msvcrt.lib</AdditionalDependencies> + <Driver>WDM</Driver> + </Link> + <Lib> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> + </Lib> + <Lib> + <TargetMachine>MachineX64</TargetMachine> + </Lib> + <Lib> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + </Lib> + </ItemDefinitionGroup> + <ItemGroup> + <ClInclude Include="..\..\inc\liblfds700.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_btree_addonly_unbalanced.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_freelist.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_hash_addonly.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_list_addonly_ordered_singlylinked.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_list_addonly_singlylinked_unordered.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_misc.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_porting_abstraction_layer_compiler.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_porting_abstraction_layer_operating_system.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_porting_abstraction_layer_processor.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_queue.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_queue_bounded_singleconsumer_singleproducer.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_ringbuffer.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_stack.h" /> + <ClInclude Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_internal.h" /> + <ClInclude Include="..\..\src\lfds700_freelist\lfds700_freelist_internal.h" /> + <ClInclude Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_internal.h" /> + <ClInclude Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_internal.h" /> + <ClInclude Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_internal.h" /> + <ClInclude Include="..\..\src\lfds700_misc\lfds700_misc_internal.h" /> + <ClInclude Include="..\..\src\lfds700_queue\lfds700_queue_internal.h" /> + <ClInclude Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_internal.h" /> + <ClInclude Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_internal.h" /> + <ClInclude Include="..\..\src\lfds700_stack\lfds700_stack_internal.h" /> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_get.c" /> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_init.c" /> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_insert.c" /> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_query.c" /> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_init.c" /> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_pop.c" /> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_push.c" /> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_query.c" /> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_get.c" /> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_init.c" /> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_insert.c" /> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_iterate.c" /> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_query.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_get.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_init.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_insert.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_query.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_get.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_init.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_insert.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_query.c" /> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_globals.c" /> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_init.c" /> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_prng.c" /> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_query.c" /> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_dequeue.c" /> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_enqueue.c" /> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_init.c" /> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_query.c" /> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_dequeue.c" /> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_enqueue.c" /> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_init.c" /> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_query.c" /> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_init.c" /> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_query.c" /> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_read.c" /> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_write.c" /> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_init.c" /> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_pop.c" /> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_push.c" /> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_query.c" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project> \ No newline at end of file diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012_and_wdk_8.0/liblfds700.vcxproj.filters b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012_and_wdk_8.0/liblfds700.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..978f8ec1c98008cec77c0e4b7676a8cdcd1179c3 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012_and_wdk_8.0/liblfds700.vcxproj.filters @@ -0,0 +1,279 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> + </Filter> + <Filter Include="Resource Files"> + <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions> + </Filter> + <Filter Include="Header Files\liblfds700"> + <UniqueIdentifier>{258be429-7dac-4999-b995-753aa2f0c505}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_freelist"> + <UniqueIdentifier>{469abf8e-47d8-4678-bd66-7c7e65c5f52e}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_ringbuffer"> + <UniqueIdentifier>{62ee141b-2acb-4555-b016-7be20a57f2bf}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_stack"> + <UniqueIdentifier>{19c73b0f-25e0-4166-9093-427f1dfb4f70}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_queue"> + <UniqueIdentifier>{00eb30fe-e638-4c2b-8ca1-1f09c4a0ed45}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_queue_bounded_singleconsumer_singleproducer"> + <UniqueIdentifier>{6250c4d5-ac8e-4c28-93de-0954c5bed1cb}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_misc"> + <UniqueIdentifier>{400ae4e9-2281-4549-b918-59d1a27a2d07}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_list_addonly_ordered_singlylinked"> + <UniqueIdentifier>{c45194af-7b41-4c28-bc0e-1095ec347664}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_list_addonly_singlylinked_unordered"> + <UniqueIdentifier>{8b3cbb5c-7436-429f-9b72-bae1f4721746}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_hash_addonly"> + <UniqueIdentifier>{bcbadc74-1748-4696-aad7-7fdbe5614624}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_btree_addonly_unbalanced"> + <UniqueIdentifier>{0b1fafc3-817b-4c18-8eb1-121884e3a29b}</UniqueIdentifier> + </Filter> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\inc\liblfds700.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_freelist\lfds700_freelist_internal.h"> + <Filter>Source Files\lfds700_freelist</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_stack\lfds700_stack_internal.h"> + <Filter>Source Files\lfds700_stack</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_queue\lfds700_queue_internal.h"> + <Filter>Source Files\lfds700_queue</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_btree_addonly_unbalanced.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_freelist.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_hash_addonly.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_list_addonly_ordered_singlylinked.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_list_addonly_singlylinked_unordered.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_misc.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_porting_abstraction_layer_compiler.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_porting_abstraction_layer_operating_system.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_porting_abstraction_layer_processor.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_queue.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_queue_bounded_singleconsumer_singleproducer.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_ringbuffer.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_stack.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_internal.h"> + <Filter>Source Files\lfds700_hash_addonly</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_internal.h"> + <Filter>Source Files\lfds700_list_addonly_ordered_singlylinked</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_internal.h"> + <Filter>Source Files\lfds700_btree_addonly_unbalanced</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_misc\lfds700_misc_internal.h"> + <Filter>Source Files\lfds700_misc</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_internal.h"> + <Filter>Source Files\lfds700_queue_bounded_singleconsumer_singleproducer</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_internal.h"> + <Filter>Source Files\lfds700_list_addonly_singlylinked_unordered</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_internal.h"> + <Filter>Source Files\lfds700_ringbuffer</Filter> + </ClInclude> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_cleanup.c"> + <Filter>Source Files\lfds700_freelist</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_init.c"> + <Filter>Source Files\lfds700_freelist</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_pop.c"> + <Filter>Source Files\lfds700_freelist</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_push.c"> + <Filter>Source Files\lfds700_freelist</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_query.c"> + <Filter>Source Files\lfds700_freelist</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_cleanup.c"> + <Filter>Source Files\lfds700_stack</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_init.c"> + <Filter>Source Files\lfds700_stack</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_pop.c"> + <Filter>Source Files\lfds700_stack</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_push.c"> + <Filter>Source Files\lfds700_stack</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_query.c"> + <Filter>Source Files\lfds700_stack</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_cleanup.c"> + <Filter>Source Files\lfds700_queue</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_dequeue.c"> + <Filter>Source Files\lfds700_queue</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_enqueue.c"> + <Filter>Source Files\lfds700_queue</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_init.c"> + <Filter>Source Files\lfds700_queue</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_query.c"> + <Filter>Source Files\lfds700_queue</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_cleanup.c"> + <Filter>Source Files\lfds700_hash_addonly</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_get.c"> + <Filter>Source Files\lfds700_hash_addonly</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_init.c"> + <Filter>Source Files\lfds700_hash_addonly</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_insert.c"> + <Filter>Source Files\lfds700_hash_addonly</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_iterate.c"> + <Filter>Source Files\lfds700_hash_addonly</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_query.c"> + <Filter>Source Files\lfds700_hash_addonly</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_cleanup.c"> + <Filter>Source Files\lfds700_list_addonly_ordered_singlylinked</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_get.c"> + <Filter>Source Files\lfds700_list_addonly_ordered_singlylinked</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_init.c"> + <Filter>Source Files\lfds700_list_addonly_ordered_singlylinked</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_insert.c"> + <Filter>Source Files\lfds700_list_addonly_ordered_singlylinked</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_query.c"> + <Filter>Source Files\lfds700_list_addonly_ordered_singlylinked</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_cleanup.c"> + <Filter>Source Files\lfds700_btree_addonly_unbalanced</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_get.c"> + <Filter>Source Files\lfds700_btree_addonly_unbalanced</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_init.c"> + <Filter>Source Files\lfds700_btree_addonly_unbalanced</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_insert.c"> + <Filter>Source Files\lfds700_btree_addonly_unbalanced</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_query.c"> + <Filter>Source Files\lfds700_btree_addonly_unbalanced</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_cleanup.c"> + <Filter>Source Files\lfds700_misc</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_globals.c"> + <Filter>Source Files\lfds700_misc</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_init.c"> + <Filter>Source Files\lfds700_misc</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_prng.c"> + <Filter>Source Files\lfds700_misc</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_query.c"> + <Filter>Source Files\lfds700_misc</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_cleanup.c"> + <Filter>Source Files\lfds700_queue_bounded_singleconsumer_singleproducer</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_dequeue.c"> + <Filter>Source Files\lfds700_queue_bounded_singleconsumer_singleproducer</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_enqueue.c"> + <Filter>Source Files\lfds700_queue_bounded_singleconsumer_singleproducer</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_init.c"> + <Filter>Source Files\lfds700_queue_bounded_singleconsumer_singleproducer</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_query.c"> + <Filter>Source Files\lfds700_queue_bounded_singleconsumer_singleproducer</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_cleanup.c"> + <Filter>Source Files\lfds700_list_addonly_singlylinked_unordered</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_get.c"> + <Filter>Source Files\lfds700_list_addonly_singlylinked_unordered</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_init.c"> + <Filter>Source Files\lfds700_list_addonly_singlylinked_unordered</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_insert.c"> + <Filter>Source Files\lfds700_list_addonly_singlylinked_unordered</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_query.c"> + <Filter>Source Files\lfds700_list_addonly_singlylinked_unordered</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_cleanup.c"> + <Filter>Source Files\lfds700_ringbuffer</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_init.c"> + <Filter>Source Files\lfds700_ringbuffer</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_query.c"> + <Filter>Source Files\lfds700_ringbuffer</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_read.c"> + <Filter>Source Files\lfds700_ringbuffer</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_write.c"> + <Filter>Source Files\lfds700_ringbuffer</Filter> + </ClCompile> + </ItemGroup> +</Project> \ No newline at end of file diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012_and_wdk_8.0/liblfds700.vcxproj.user b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012_and_wdk_8.0/liblfds700.vcxproj.user new file mode 100644 index 0000000000000000000000000000000000000000..7cbb3216adb733fd25e1bd27d504ac8419b8c5bb --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2012_and_wdk_8.0/liblfds700.vcxproj.user @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup /> +</Project> \ No newline at end of file diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2013_and_wdk_8.1/driver_entry.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2013_and_wdk_8.1/driver_entry.c new file mode 100644 index 0000000000000000000000000000000000000000..9ea5612e54cbfd9a804db99cea19270e596d3eef --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2013_and_wdk_8.1/driver_entry.c @@ -0,0 +1 @@ +#include <wdf.h> diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2013_and_wdk_8.1/liblfds700.def b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2013_and_wdk_8.1/liblfds700.def new file mode 100644 index 0000000000000000000000000000000000000000..583ce35dbdb08c553e2cb2a7f335f4bcaf9458da --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2013_and_wdk_8.1/liblfds700.def @@ -0,0 +1,69 @@ +EXPORTS + +lfds700_btree_au_init_valid_on_current_logical_core = lfds700_btree_au_init_valid_on_current_logical_core +lfds700_btree_au_cleanup = lfds700_btree_au_cleanup +lfds700_btree_au_insert = lfds700_btree_au_insert +lfds700_btree_au_get_by_absolute_position_and_then_by_relative_position = lfds700_btree_au_get_by_absolute_position_and_then_by_relative_position +lfds700_btree_au_get_by_absolute_position = lfds700_btree_au_get_by_absolute_position +lfds700_btree_au_get_by_relative_position = lfds700_btree_au_get_by_relative_position +lfds700_btree_au_get_by_key = lfds700_btree_au_get_by_key +lfds700_btree_au_query = lfds700_btree_au_query + +lfds700_freelist_init_valid_on_current_logical_core = lfds700_freelist_init_valid_on_current_logical_core +lfds700_freelist_cleanup = lfds700_freelist_cleanup +lfds700_freelist_push = lfds700_freelist_push +lfds700_freelist_pop = lfds700_freelist_pop +lfds700_freelist_query = lfds700_freelist_query + +lfds700_hash_a_init_valid_on_current_logical_core = lfds700_hash_a_init_valid_on_current_logical_core +lfds700_hash_a_cleanup = lfds700_hash_a_cleanup +lfds700_hash_a_insert = lfds700_hash_a_insert +lfds700_hash_a_get_by_key = lfds700_hash_a_get_by_key +lfds700_hash_a_iterate_init = lfds700_hash_a_iterate_init +lfds700_hash_a_iterate = lfds700_hash_a_iterate +lfds700_hash_a_query = lfds700_hash_a_query + +lfds700_list_aos_init_valid_on_current_logical_core = lfds700_list_aos_init_valid_on_current_logical_core +lfds700_list_aos_cleanup = lfds700_list_aos_cleanup +lfds700_list_aos_insert = lfds700_list_aos_insert +lfds700_list_aos_get_by_key = lfds700_list_aos_get_by_key +lfds700_list_aos_query = lfds700_list_aos_query + +lfds700_list_asu_init_valid_on_current_logical_core = lfds700_list_asu_init_valid_on_current_logical_core +lfds700_list_asu_cleanup = lfds700_list_asu_cleanup +lfds700_list_asu_insert_at_position = lfds700_list_asu_insert_at_position +lfds700_list_asu_insert_at_start = lfds700_list_asu_insert_at_start +lfds700_list_asu_insert_at_end = lfds700_list_asu_insert_at_end +lfds700_list_asu_insert_after_element = lfds700_list_asu_insert_after_element +lfds700_list_asu_get_by_key = lfds700_list_asu_get_by_key +lfds700_list_asu_query = lfds700_list_asu_query + +lfds700_misc_library_init_valid_on_current_logical_core = lfds700_misc_library_init_valid_on_current_logical_core +lfds700_misc_library_cleanup = lfds700_misc_library_cleanup +lfds700_misc_prng_init = lfds700_misc_prng_init +lfds700_misc_query = lfds700_misc_query + +lfds700_queue_init_valid_on_current_logical_core = lfds700_queue_init_valid_on_current_logical_core +lfds700_queue_cleanup = lfds700_queue_cleanup +lfds700_queue_enqueue = lfds700_queue_enqueue +lfds700_queue_dequeue = lfds700_queue_dequeue +lfds700_queue_query = lfds700_queue_query + +lfds700_queue_bss_init_valid_on_current_logical_core = lfds700_queue_bss_init_valid_on_current_logical_core +lfds700_queue_bss_cleanup = lfds700_queue_bss_cleanup +lfds700_queue_bss_enqueue = lfds700_queue_bss_enqueue +lfds700_queue_bss_dequeue = lfds700_queue_bss_dequeue +lfds700_queue_bss_query = lfds700_queue_bss_query + +lfds700_ringbuffer_init_valid_on_current_logical_core = lfds700_ringbuffer_init_valid_on_current_logical_core +lfds700_ringbuffer_cleanup = lfds700_ringbuffer_cleanup +lfds700_ringbuffer_read = lfds700_ringbuffer_read +lfds700_ringbuffer_write = lfds700_ringbuffer_write +lfds700_ringbuffer_query = lfds700_ringbuffer_query + +lfds700_stack_init_valid_on_current_logical_core = lfds700_stack_init_valid_on_current_logical_core +lfds700_stack_cleanup = lfds700_stack_cleanup +lfds700_stack_push = lfds700_stack_push +lfds700_stack_pop = lfds700_stack_pop +lfds700_stack_query = lfds700_stack_query + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2013_and_wdk_8.1/liblfds700.sln b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2013_and_wdk_8.1/liblfds700.sln new file mode 100644 index 0000000000000000000000000000000000000000..1cc19a8e23b313d31807285fd75813feb699abdb --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2013_and_wdk_8.1/liblfds700.sln @@ -0,0 +1,59 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.40629.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblfds700", "liblfds700.vcxproj", "{1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug DLL|ARM = Debug DLL|ARM + Debug DLL|Win32 = Debug DLL|Win32 + Debug DLL|x64 = Debug DLL|x64 + Debug LIB|ARM = Debug LIB|ARM + Debug LIB|Win32 = Debug LIB|Win32 + Debug LIB|x64 = Debug LIB|x64 + Release DLL|ARM = Release DLL|ARM + Release DLL|Win32 = Release DLL|Win32 + Release DLL|x64 = Release DLL|x64 + Release LIB|ARM = Release LIB|ARM + Release LIB|Win32 = Release LIB|Win32 + Release LIB|x64 = Release LIB|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug DLL|ARM.ActiveCfg = Debug DLL|ARM + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug DLL|ARM.Build.0 = Debug DLL|ARM + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug DLL|Win32.ActiveCfg = Debug DLL|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug DLL|Win32.Build.0 = Debug DLL|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug DLL|Win32.Deploy.0 = Debug DLL|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug DLL|x64.ActiveCfg = Debug DLL|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug DLL|x64.Build.0 = Debug DLL|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug DLL|x64.Deploy.0 = Debug DLL|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug LIB|ARM.ActiveCfg = Debug LIB|ARM + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug LIB|ARM.Build.0 = Debug LIB|ARM + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug LIB|Win32.ActiveCfg = Debug LIB|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug LIB|Win32.Build.0 = Debug LIB|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug LIB|Win32.Deploy.0 = Debug LIB|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug LIB|x64.ActiveCfg = Debug LIB|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug LIB|x64.Build.0 = Debug LIB|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug LIB|x64.Deploy.0 = Debug LIB|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release DLL|ARM.ActiveCfg = Release DLL|ARM + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release DLL|ARM.Build.0 = Release DLL|ARM + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release DLL|Win32.ActiveCfg = Release DLL|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release DLL|Win32.Build.0 = Release DLL|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release DLL|Win32.Deploy.0 = Release DLL|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release DLL|x64.ActiveCfg = Release DLL|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release DLL|x64.Build.0 = Release DLL|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release DLL|x64.Deploy.0 = Release DLL|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release LIB|ARM.ActiveCfg = Release LIB|ARM + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release LIB|ARM.Build.0 = Release LIB|ARM + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release LIB|Win32.ActiveCfg = Release LIB|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release LIB|Win32.Build.0 = Release LIB|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release LIB|Win32.Deploy.0 = Release LIB|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release LIB|x64.ActiveCfg = Release LIB|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release LIB|x64.Build.0 = Release LIB|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release LIB|x64.Deploy.0 = Release LIB|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2013_and_wdk_8.1/liblfds700.vcxproj b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2013_and_wdk_8.1/liblfds700.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..e67a540e3703147000ca84131a519accc4ebe193 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2013_and_wdk_8.1/liblfds700.vcxproj @@ -0,0 +1,1054 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug DLL|ARM"> + <Configuration>Debug DLL</Configuration> + <Platform>ARM</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug DLL|Win32"> + <Configuration>Debug DLL</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug DLL|x64"> + <Configuration>Debug DLL</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug LIB|ARM"> + <Configuration>Debug LIB</Configuration> + <Platform>ARM</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug LIB|Win32"> + <Configuration>Debug LIB</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug LIB|x64"> + <Configuration>Debug LIB</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release DLL|ARM"> + <Configuration>Release DLL</Configuration> + <Platform>ARM</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release DLL|Win32"> + <Configuration>Release DLL</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release DLL|x64"> + <Configuration>Release DLL</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release LIB|ARM"> + <Configuration>Release LIB</Configuration> + <Platform>ARM</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release LIB|Win32"> + <Configuration>Release LIB</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release LIB|x64"> + <Configuration>Release LIB</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}</ProjectGuid> + <Keyword>Win32Proj</Keyword> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|ARM'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|ARM'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|x64'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|ARM'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|ARM'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|x64'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug LIB|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|ARM'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|ARM'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release LIB|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|ARM'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|ARM'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|Win32'"> + <LinkIncremental>true</LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + <IncludePath>$(ProjectDir);$(IncludePath);$(WDKContentRoot)include\km\;$(WDKContentRoot)include\wdf\kmdf\1.11\</IncludePath> + <LibraryPath>$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSDK_LibraryPath_x86);$(WDKContentRoot)lib\wdf\kmdf\x86\</LibraryPath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|ARM'"> + <LinkIncremental>true</LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + <IncludePath>$(ProjectDir);$(IncludePath)</IncludePath> + <LibraryPath>$(WDKContentRoot)lib\$(DDKSpec)\KM\$(DDKPlatform);$(LibraryPath)</LibraryPath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'"> + <LinkIncremental> + </LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + <IncludePath>$(ProjectDir);$(IncludePath);$(WDKContentRoot)include\km\;$(WDKContentRoot)include\wdf\kmdf\1.11\</IncludePath> + <LibraryPath>$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSDK_LibraryPath_x86);$(WDKContentRoot)lib\wdf\kmdf\x86\</LibraryPath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|ARM'"> + <LinkIncremental /> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + <IncludePath>$(ProjectDir);$(IncludePath)</IncludePath> + <LibraryPath>$(WDKContentRoot)lib\$(DDKSpec)\KM\$(DDKPlatform);$(LibraryPath)</LibraryPath> + <ExcludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(MSBuildToolsPath);$(MSBuildFrameworkToolsPath);$(MSBuild_ExecutablePath);$(VC_LibraryPath_ARM);</ExcludePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|x64'"> + <LinkIncremental>true</LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + <IncludePath>$(ProjectDir);$(IncludePath);$(WDKContentRoot)include\km\;$(WDKContentRoot)include\wdf\kmdf\1.11\</IncludePath> + <LibraryPath>$(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(WindowsSDK_LibraryPath_x64);;$(WDKContentRoot)lib\wdf\kmdf\x64\</LibraryPath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'"> + <LinkIncremental> + </LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + <IncludePath>$(ProjectDir);$(IncludePath);$(WDKContentRoot)include\km\;$(WDKContentRoot)include\wdf\kmdf\1.11\</IncludePath> + <LibraryPath>$(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(WindowsSDK_LibraryPath_x64);;$(WDKContentRoot)lib\wdf\kmdf\x64\</LibraryPath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|Win32'"> + <LinkIncremental>true</LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + <IncludePath>$(ProjectDir);$(IncludePath);$(WDKContentRoot)include\km\;$(WDKContentRoot)include\wdf\kmdf\1.11\</IncludePath> + <LibraryPath>$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSDK_LibraryPath_x86);$(WDKContentRoot)lib\wdf\kmdf\x86\</LibraryPath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|ARM'"> + <LinkIncremental>true</LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + <IncludePath>$(ProjectDir);$(IncludePath)</IncludePath> + <LibraryPath>$(WDKContentRoot)lib\$(DDKSpec)\KM\$(DDKPlatform);$(LibraryPath)</LibraryPath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'"> + <LinkIncremental> + </LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + <IncludePath>$(ProjectDir);$(IncludePath);$(WDKContentRoot)include\km\;$(WDKContentRoot)include\wdf\kmdf\1.11\</IncludePath> + <LibraryPath>$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSDK_LibraryPath_x86);$(WDKContentRoot)lib\wdf\kmdf\x86\</LibraryPath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|ARM'"> + <LinkIncremental /> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + <IncludePath>$(ProjectDir);$(IncludePath)</IncludePath> + <LibraryPath>$(WDKContentRoot)lib\$(DDKSpec)\KM\$(DDKPlatform);$(LibraryPath)</LibraryPath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|x64'"> + <LinkIncremental>true</LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + <IncludePath>$(ProjectDir);$(IncludePath);$(WDKContentRoot)include\km\;$(WDKContentRoot)include\wdf\kmdf\1.11\</IncludePath> + <LibraryPath>$(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(WindowsSDK_LibraryPath_x64);;$(WDKContentRoot)lib\wdf\kmdf\x64\</LibraryPath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'"> + <LinkIncremental> + </LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + <IncludePath>$(ProjectDir);$(IncludePath);$(WDKContentRoot)include\km\;$(WDKContentRoot)include\wdf\kmdf\1.11\</IncludePath> + <LibraryPath>$(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(WindowsSDK_LibraryPath_x64);;$(WDKContentRoot)lib\wdf\kmdf\x64\</LibraryPath> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|Win32'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;LFDS700_BUILD_TYPE_STRING="Debug";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories> + </AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <Optimization>Disabled</Optimization> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <IntrinsicFunctions>true</IntrinsicFunctions> + <StringPooling>true</StringPooling> + <ExceptionHandling>false</ExceptionHandling> + <SmallerTypeCheck>true</SmallerTypeCheck> + <FunctionLevelLinking> + </FunctionLevelLinking> + <EnableParallelCodeGeneration> + </EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet> + </EnableEnhancedInstructionSet> + <FloatingPointExceptions>true</FloatingPointExceptions> + <CreateHotpatchableImage>false</CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <BrowseInformation>true</BrowseInformation> + <CompileAs>CompileAsC</CompileAs> + <UseFullPaths>true</UseFullPaths> + <ErrorReporting>None</ErrorReporting> + <SDLCheck>true</SDLCheck> + <MinimalRebuild>false</MinimalRebuild> + <DisableSpecificWarnings>4068</DisableSpecificWarnings> + <AdditionalOptions>/kernel %(AdditionalOptions)</AdditionalOptions> + </ClCompile> + <Link> + <TargetMachine>MachineX86</TargetMachine> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Windows</SubSystem> + </Link> + <Lib> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> + </Lib> + <Lib> + <TargetMachine>MachineX86</TargetMachine> + </Lib> + <Lib> + <SubSystem>Native</SubSystem> + </Lib> + <Lib> + <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + </Lib> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|ARM'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;LFDS700_BUILD_TYPE_STRING="Debug";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories> + </AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <Optimization>Disabled</Optimization> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <IntrinsicFunctions>true</IntrinsicFunctions> + <StringPooling>true</StringPooling> + <ExceptionHandling>false</ExceptionHandling> + <SmallerTypeCheck>true</SmallerTypeCheck> + <FunctionLevelLinking> + </FunctionLevelLinking> + <EnableParallelCodeGeneration> + </EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet> + </EnableEnhancedInstructionSet> + <FloatingPointExceptions>true</FloatingPointExceptions> + <CreateHotpatchableImage>false</CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <BrowseInformation>true</BrowseInformation> + <CompileAs>CompileAsC</CompileAs> + <UseFullPaths>true</UseFullPaths> + <ErrorReporting>None</ErrorReporting> + <SDLCheck>true</SDLCheck> + <MinimalRebuild>false</MinimalRebuild> + <DisableSpecificWarnings>4068</DisableSpecificWarnings> + <AdditionalOptions>/kernel %(AdditionalOptions)</AdditionalOptions> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Windows</SubSystem> + </Link> + <Lib> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> + </Lib> + <Lib> + <TargetMachine>MachineARM</TargetMachine> + </Lib> + <Lib> + <SubSystem>Native</SubSystem> + </Lib> + <Lib> + <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + </Lib> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;LFDS700_BUILD_TYPE_STRING="Debug";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories> + </AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <Optimization>Disabled</Optimization> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <IntrinsicFunctions>true</IntrinsicFunctions> + <StringPooling>true</StringPooling> + <ExceptionHandling>false</ExceptionHandling> + <SmallerTypeCheck>true</SmallerTypeCheck> + <FunctionLevelLinking> + </FunctionLevelLinking> + <EnableParallelCodeGeneration> + </EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet> + </EnableEnhancedInstructionSet> + <FloatingPointExceptions>true</FloatingPointExceptions> + <CreateHotpatchableImage>false</CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <BrowseInformation>true</BrowseInformation> + <CompileAs>CompileAsC</CompileAs> + <UseFullPaths>true</UseFullPaths> + <ErrorReporting>None</ErrorReporting> + <SDLCheck>true</SDLCheck> + <MinimalRebuild>false</MinimalRebuild> + <DisableSpecificWarnings>4068</DisableSpecificWarnings> + <AdditionalOptions>/kernel %(AdditionalOptions)</AdditionalOptions> + </ClCompile> + <Link> + <TargetMachine>MachineX86</TargetMachine> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Native</SubSystem> + <AdditionalDependencies>kernel32.lib;msvcrtd.lib</AdditionalDependencies> + <LinkStatus> + </LinkStatus> + <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + <ModuleDefinitionFile>liblfds700.def</ModuleDefinitionFile> + <MapExports>true</MapExports> + <LinkErrorReporting>NoErrorReport</LinkErrorReporting> + <GenerateMapFile>true</GenerateMapFile> + <Driver>WDM</Driver> + </Link> + <Lib> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> + </Lib> + <Lib> + <TargetMachine>MachineX86</TargetMachine> + </Lib> + <Lib> + <SubSystem>Console</SubSystem> + </Lib> + <Lib> + <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + </Lib> + <ProjectReference> + <LinkLibraryDependencies>true</LinkLibraryDependencies> + </ProjectReference> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|ARM'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;LFDS700_BUILD_TYPE_STRING="Debug";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories> + </AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <Optimization>Disabled</Optimization> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <IntrinsicFunctions>true</IntrinsicFunctions> + <StringPooling>true</StringPooling> + <ExceptionHandling>false</ExceptionHandling> + <SmallerTypeCheck>true</SmallerTypeCheck> + <FunctionLevelLinking> + </FunctionLevelLinking> + <EnableParallelCodeGeneration> + </EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet> + </EnableEnhancedInstructionSet> + <FloatingPointExceptions>true</FloatingPointExceptions> + <CreateHotpatchableImage>false</CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <BrowseInformation>true</BrowseInformation> + <CompileAs>CompileAsC</CompileAs> + <UseFullPaths>true</UseFullPaths> + <ErrorReporting>None</ErrorReporting> + <SDLCheck>true</SDLCheck> + <MinimalRebuild>false</MinimalRebuild> + <DisableSpecificWarnings>4068</DisableSpecificWarnings> + <AdditionalOptions>/kernel %(AdditionalOptions)</AdditionalOptions> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Native</SubSystem> + <AdditionalDependencies>kernel32.lib;msvcrtd.lib</AdditionalDependencies> + <LinkStatus> + </LinkStatus> + <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + <ModuleDefinitionFile>liblfds700.def</ModuleDefinitionFile> + <MapExports>true</MapExports> + <LinkErrorReporting>NoErrorReport</LinkErrorReporting> + <GenerateMapFile>true</GenerateMapFile> + <Driver>WDM</Driver> + <IgnoreSpecificDefaultLibraries /> + </Link> + <Lib> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> + </Lib> + <Lib> + <TargetMachine>MachineX86</TargetMachine> + </Lib> + <Lib> + <SubSystem>Console</SubSystem> + </Lib> + <Lib> + <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + </Lib> + <ProjectReference> + <LinkLibraryDependencies>true</LinkLibraryDependencies> + </ProjectReference> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|x64'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;LFDS700_BUILD_TYPE_STRING="Debug";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories> + </AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <Optimization>Disabled</Optimization> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <IntrinsicFunctions>true</IntrinsicFunctions> + <StringPooling>true</StringPooling> + <ExceptionHandling>false</ExceptionHandling> + <SmallerTypeCheck>true</SmallerTypeCheck> + <FunctionLevelLinking> + </FunctionLevelLinking> + <EnableParallelCodeGeneration> + </EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet> + </EnableEnhancedInstructionSet> + <FloatingPointExceptions>true</FloatingPointExceptions> + <CreateHotpatchableImage>false</CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <BrowseInformation>true</BrowseInformation> + <CompileAs>CompileAsC</CompileAs> + <UseFullPaths>true</UseFullPaths> + <ErrorReporting>None</ErrorReporting> + <SDLCheck>true</SDLCheck> + <MinimalRebuild>false</MinimalRebuild> + <DisableSpecificWarnings>4068</DisableSpecificWarnings> + <OmitFramePointers>false</OmitFramePointers> + <AdditionalOptions>/kernel %(AdditionalOptions)</AdditionalOptions> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Windows</SubSystem> + </Link> + <Lib> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> + </Lib> + <Lib> + <TargetMachine>MachineX64</TargetMachine> + </Lib> + <Lib> + <SubSystem>Native</SubSystem> + </Lib> + <Lib> + <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + </Lib> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;LFDS700_BUILD_TYPE_STRING="Debug";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories> + </AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <Optimization>Disabled</Optimization> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <IntrinsicFunctions>true</IntrinsicFunctions> + <StringPooling>true</StringPooling> + <ExceptionHandling>false</ExceptionHandling> + <SmallerTypeCheck>true</SmallerTypeCheck> + <FunctionLevelLinking> + </FunctionLevelLinking> + <EnableParallelCodeGeneration> + </EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet> + </EnableEnhancedInstructionSet> + <FloatingPointExceptions>true</FloatingPointExceptions> + <CreateHotpatchableImage>false</CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <BrowseInformation>true</BrowseInformation> + <CompileAs>CompileAsC</CompileAs> + <UseFullPaths>true</UseFullPaths> + <ErrorReporting>None</ErrorReporting> + <SDLCheck>true</SDLCheck> + <MinimalRebuild>false</MinimalRebuild> + <DisableSpecificWarnings>4068</DisableSpecificWarnings> + <OmitFramePointers>false</OmitFramePointers> + <AdditionalOptions>/kernel %(AdditionalOptions)</AdditionalOptions> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Native</SubSystem> + <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + <ModuleDefinitionFile>liblfds700.def</ModuleDefinitionFile> + <MapExports>true</MapExports> + <OptimizeReferences>false</OptimizeReferences> + <LinkErrorReporting>NoErrorReport</LinkErrorReporting> + <AdditionalDependencies>kernel32.lib;msvcrtd.lib</AdditionalDependencies> + <GenerateMapFile>true</GenerateMapFile> + <Driver>WDM</Driver> + </Link> + <Lib> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> + </Lib> + <Lib> + <TargetMachine>MachineX64</TargetMachine> + </Lib> + <Lib> + <SubSystem>Console</SubSystem> + </Lib> + <Lib> + <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + </Lib> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|Win32'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;LFDS700_BUILD_TYPE_STRING="Release";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories> + </AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>None</DebugInformationFormat> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> + <StringPooling>true</StringPooling> + <ExceptionHandling>false</ExceptionHandling> + <BufferSecurityCheck>false</BufferSecurityCheck> + <FunctionLevelLinking> + </FunctionLevelLinking> + <EnableParallelCodeGeneration> + </EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet> + </EnableEnhancedInstructionSet> + <FloatingPointExceptions>false</FloatingPointExceptions> + <CreateHotpatchableImage> + </CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <CompileAs>CompileAsC</CompileAs> + <UseFullPaths>true</UseFullPaths> + <ErrorReporting>None</ErrorReporting> + <OmitFramePointers>true</OmitFramePointers> + <DisableSpecificWarnings>4068</DisableSpecificWarnings> + <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations> + <AdditionalOptions>/kernel %(AdditionalOptions)</AdditionalOptions> + </ClCompile> + <Link> + <TargetMachine>MachineX86</TargetMachine> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Windows</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + <Lib> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> + </Lib> + <Lib> + <TargetMachine>MachineX86</TargetMachine> + </Lib> + <Lib> + <SubSystem>Native</SubSystem> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + </Lib> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|ARM'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;LFDS700_BUILD_TYPE_STRING="Release";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories> + </AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>None</DebugInformationFormat> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> + <StringPooling>true</StringPooling> + <ExceptionHandling>false</ExceptionHandling> + <BufferSecurityCheck>false</BufferSecurityCheck> + <FunctionLevelLinking> + </FunctionLevelLinking> + <EnableParallelCodeGeneration> + </EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet> + </EnableEnhancedInstructionSet> + <FloatingPointExceptions>false</FloatingPointExceptions> + <CreateHotpatchableImage> + </CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <CompileAs>CompileAsC</CompileAs> + <UseFullPaths>true</UseFullPaths> + <ErrorReporting>None</ErrorReporting> + <OmitFramePointers>true</OmitFramePointers> + <DisableSpecificWarnings>4068</DisableSpecificWarnings> + <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations> + <AdditionalOptions>/kernel %(AdditionalOptions)</AdditionalOptions> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Windows</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + <Lib> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> + </Lib> + <Lib> + <TargetMachine>MachineARM</TargetMachine> + </Lib> + <Lib> + <SubSystem>Native</SubSystem> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + </Lib> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;LFDS700_BUILD_TYPE_STRING="Release";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories> + </AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>None</DebugInformationFormat> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> + <StringPooling>true</StringPooling> + <ExceptionHandling>false</ExceptionHandling> + <BufferSecurityCheck>false</BufferSecurityCheck> + <FunctionLevelLinking> + </FunctionLevelLinking> + <EnableParallelCodeGeneration> + </EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet> + </EnableEnhancedInstructionSet> + <FloatingPointExceptions>false</FloatingPointExceptions> + <CreateHotpatchableImage> + </CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <CompileAs>CompileAsC</CompileAs> + <UseFullPaths>true</UseFullPaths> + <ErrorReporting>None</ErrorReporting> + <OmitFramePointers>true</OmitFramePointers> + <DisableSpecificWarnings>4068</DisableSpecificWarnings> + <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations> + <AdditionalOptions>/kernel %(AdditionalOptions)</AdditionalOptions> + </ClCompile> + <Link> + <TargetMachine>MachineX86</TargetMachine> + <GenerateDebugInformation>false</GenerateDebugInformation> + <SubSystem>Native</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <AdditionalDependencies>kernel32.lib;msvcrt.lib</AdditionalDependencies> + <LinkStatus> + </LinkStatus> + <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + <ModuleDefinitionFile>liblfds700.def</ModuleDefinitionFile> + <LinkErrorReporting>NoErrorReport</LinkErrorReporting> + <Driver>WDM</Driver> + </Link> + <Lib> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> + </Lib> + <Lib> + <TargetMachine>MachineX86</TargetMachine> + </Lib> + <Lib> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + </Lib> + <ProjectReference> + <LinkLibraryDependencies>true</LinkLibraryDependencies> + </ProjectReference> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|ARM'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;LFDS700_BUILD_TYPE_STRING="Release";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories> + </AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>None</DebugInformationFormat> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> + <StringPooling>true</StringPooling> + <ExceptionHandling>false</ExceptionHandling> + <BufferSecurityCheck>false</BufferSecurityCheck> + <FunctionLevelLinking> + </FunctionLevelLinking> + <EnableParallelCodeGeneration> + </EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet> + </EnableEnhancedInstructionSet> + <FloatingPointExceptions>false</FloatingPointExceptions> + <CreateHotpatchableImage> + </CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <CompileAs>CompileAsC</CompileAs> + <UseFullPaths>true</UseFullPaths> + <ErrorReporting>None</ErrorReporting> + <OmitFramePointers>true</OmitFramePointers> + <DisableSpecificWarnings>4068</DisableSpecificWarnings> + <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations> + <AdditionalOptions>/kernel %(AdditionalOptions)</AdditionalOptions> + </ClCompile> + <Link> + <GenerateDebugInformation>false</GenerateDebugInformation> + <SubSystem>Native</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <AdditionalDependencies>kernel32.lib;msvcrt.lib</AdditionalDependencies> + <LinkStatus> + </LinkStatus> + <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + <ModuleDefinitionFile>liblfds700.def</ModuleDefinitionFile> + <LinkErrorReporting>NoErrorReport</LinkErrorReporting> + <Driver>WDM</Driver> + <IgnoreSpecificDefaultLibraries /> + </Link> + <Lib> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> + </Lib> + <Lib> + <TargetMachine>MachineX86</TargetMachine> + </Lib> + <Lib> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + </Lib> + <ProjectReference> + <LinkLibraryDependencies>true</LinkLibraryDependencies> + </ProjectReference> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|x64'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;LFDS700_BUILD_TYPE_STRING="Release";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories> + </AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>None</DebugInformationFormat> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> + <StringPooling>true</StringPooling> + <ExceptionHandling>false</ExceptionHandling> + <BufferSecurityCheck>false</BufferSecurityCheck> + <FunctionLevelLinking> + </FunctionLevelLinking> + <EnableParallelCodeGeneration> + </EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet> + </EnableEnhancedInstructionSet> + <FloatingPointExceptions>false</FloatingPointExceptions> + <CreateHotpatchableImage> + </CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <CompileAs>CompileAsC</CompileAs> + <UseFullPaths>true</UseFullPaths> + <ErrorReporting>None</ErrorReporting> + <OmitFramePointers>true</OmitFramePointers> + <DisableSpecificWarnings>4068</DisableSpecificWarnings> + <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations> + <AdditionalOptions>/kernel %(AdditionalOptions)</AdditionalOptions> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Windows</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + <Lib> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> + </Lib> + <Lib> + <TargetMachine>MachineX64</TargetMachine> + </Lib> + <Lib> + <SubSystem>Native</SubSystem> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + </Lib> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;LFDS700_BUILD_TYPE_STRING="Release";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories> + </AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>None</DebugInformationFormat> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> + <StringPooling>true</StringPooling> + <ExceptionHandling>false</ExceptionHandling> + <BufferSecurityCheck>false</BufferSecurityCheck> + <FunctionLevelLinking> + </FunctionLevelLinking> + <EnableParallelCodeGeneration> + </EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet> + </EnableEnhancedInstructionSet> + <FloatingPointExceptions>false</FloatingPointExceptions> + <CreateHotpatchableImage> + </CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <CompileAs>CompileAsC</CompileAs> + <UseFullPaths>true</UseFullPaths> + <ErrorReporting>None</ErrorReporting> + <OmitFramePointers>true</OmitFramePointers> + <DisableSpecificWarnings>4068</DisableSpecificWarnings> + <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations> + <AdditionalOptions>/kernel %(AdditionalOptions)</AdditionalOptions> + </ClCompile> + <Link> + <GenerateDebugInformation>false</GenerateDebugInformation> + <SubSystem>Native</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + <ModuleDefinitionFile>liblfds700.def</ModuleDefinitionFile> + <LinkErrorReporting>NoErrorReport</LinkErrorReporting> + <AdditionalDependencies>kernel32.lib;msvcrt.lib</AdditionalDependencies> + <Driver>WDM</Driver> + </Link> + <Lib> + <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors> + </Lib> + <Lib> + <TargetMachine>MachineX64</TargetMachine> + </Lib> + <Lib> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> + </Lib> + </ItemDefinitionGroup> + <ItemGroup> + <ClInclude Include="..\..\inc\liblfds700.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_btree_addonly_unbalanced.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_freelist.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_hash_addonly.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_list_addonly_ordered_singlylinked.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_list_addonly_singlylinked_unordered.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_misc.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_porting_abstraction_layer_compiler.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_porting_abstraction_layer_operating_system.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_porting_abstraction_layer_processor.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_queue.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_queue_bounded_singleconsumer_singleproducer.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_ringbuffer.h" /> + <ClInclude Include="..\..\inc\liblfds700\lfds700_stack.h" /> + <ClInclude Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_internal.h" /> + <ClInclude Include="..\..\src\lfds700_freelist\lfds700_freelist_internal.h" /> + <ClInclude Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_internal.h" /> + <ClInclude Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_internal.h" /> + <ClInclude Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_internal.h" /> + <ClInclude Include="..\..\src\lfds700_misc\lfds700_misc_internal.h" /> + <ClInclude Include="..\..\src\lfds700_queue\lfds700_queue_internal.h" /> + <ClInclude Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_internal.h" /> + <ClInclude Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_internal.h" /> + <ClInclude Include="..\..\src\lfds700_stack\lfds700_stack_internal.h" /> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_get.c" /> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_init.c" /> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_insert.c" /> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_query.c" /> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_init.c" /> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_pop.c" /> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_push.c" /> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_query.c" /> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_get.c" /> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_init.c" /> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_insert.c" /> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_iterate.c" /> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_query.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_get.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_init.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_insert.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_query.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_get.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_init.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_insert.c" /> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_query.c" /> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_globals.c" /> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_init.c" /> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_prng.c" /> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_query.c" /> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_dequeue.c" /> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_enqueue.c" /> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_init.c" /> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_query.c" /> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_dequeue.c" /> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_enqueue.c" /> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_init.c" /> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_query.c" /> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_init.c" /> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_query.c" /> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_read.c" /> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_write.c" /> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_cleanup.c" /> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_init.c" /> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_pop.c" /> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_push.c" /> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_query.c" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project> \ No newline at end of file diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2013_and_wdk_8.1/liblfds700.vcxproj.filters b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2013_and_wdk_8.1/liblfds700.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..978f8ec1c98008cec77c0e4b7676a8cdcd1179c3 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2013_and_wdk_8.1/liblfds700.vcxproj.filters @@ -0,0 +1,279 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> + </Filter> + <Filter Include="Resource Files"> + <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions> + </Filter> + <Filter Include="Header Files\liblfds700"> + <UniqueIdentifier>{258be429-7dac-4999-b995-753aa2f0c505}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_freelist"> + <UniqueIdentifier>{469abf8e-47d8-4678-bd66-7c7e65c5f52e}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_ringbuffer"> + <UniqueIdentifier>{62ee141b-2acb-4555-b016-7be20a57f2bf}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_stack"> + <UniqueIdentifier>{19c73b0f-25e0-4166-9093-427f1dfb4f70}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_queue"> + <UniqueIdentifier>{00eb30fe-e638-4c2b-8ca1-1f09c4a0ed45}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_queue_bounded_singleconsumer_singleproducer"> + <UniqueIdentifier>{6250c4d5-ac8e-4c28-93de-0954c5bed1cb}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_misc"> + <UniqueIdentifier>{400ae4e9-2281-4549-b918-59d1a27a2d07}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_list_addonly_ordered_singlylinked"> + <UniqueIdentifier>{c45194af-7b41-4c28-bc0e-1095ec347664}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_list_addonly_singlylinked_unordered"> + <UniqueIdentifier>{8b3cbb5c-7436-429f-9b72-bae1f4721746}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_hash_addonly"> + <UniqueIdentifier>{bcbadc74-1748-4696-aad7-7fdbe5614624}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\lfds700_btree_addonly_unbalanced"> + <UniqueIdentifier>{0b1fafc3-817b-4c18-8eb1-121884e3a29b}</UniqueIdentifier> + </Filter> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\inc\liblfds700.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_freelist\lfds700_freelist_internal.h"> + <Filter>Source Files\lfds700_freelist</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_stack\lfds700_stack_internal.h"> + <Filter>Source Files\lfds700_stack</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_queue\lfds700_queue_internal.h"> + <Filter>Source Files\lfds700_queue</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_btree_addonly_unbalanced.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_freelist.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_hash_addonly.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_list_addonly_ordered_singlylinked.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_list_addonly_singlylinked_unordered.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_misc.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_porting_abstraction_layer_compiler.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_porting_abstraction_layer_operating_system.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_porting_abstraction_layer_processor.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_queue.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_queue_bounded_singleconsumer_singleproducer.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_ringbuffer.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\inc\liblfds700\lfds700_stack.h"> + <Filter>Header Files\liblfds700</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_internal.h"> + <Filter>Source Files\lfds700_hash_addonly</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_internal.h"> + <Filter>Source Files\lfds700_list_addonly_ordered_singlylinked</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_internal.h"> + <Filter>Source Files\lfds700_btree_addonly_unbalanced</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_misc\lfds700_misc_internal.h"> + <Filter>Source Files\lfds700_misc</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_internal.h"> + <Filter>Source Files\lfds700_queue_bounded_singleconsumer_singleproducer</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_internal.h"> + <Filter>Source Files\lfds700_list_addonly_singlylinked_unordered</Filter> + </ClInclude> + <ClInclude Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_internal.h"> + <Filter>Source Files\lfds700_ringbuffer</Filter> + </ClInclude> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_cleanup.c"> + <Filter>Source Files\lfds700_freelist</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_init.c"> + <Filter>Source Files\lfds700_freelist</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_pop.c"> + <Filter>Source Files\lfds700_freelist</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_push.c"> + <Filter>Source Files\lfds700_freelist</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_freelist\lfds700_freelist_query.c"> + <Filter>Source Files\lfds700_freelist</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_cleanup.c"> + <Filter>Source Files\lfds700_stack</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_init.c"> + <Filter>Source Files\lfds700_stack</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_pop.c"> + <Filter>Source Files\lfds700_stack</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_push.c"> + <Filter>Source Files\lfds700_stack</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_stack\lfds700_stack_query.c"> + <Filter>Source Files\lfds700_stack</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_cleanup.c"> + <Filter>Source Files\lfds700_queue</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_dequeue.c"> + <Filter>Source Files\lfds700_queue</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_enqueue.c"> + <Filter>Source Files\lfds700_queue</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_init.c"> + <Filter>Source Files\lfds700_queue</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue\lfds700_queue_query.c"> + <Filter>Source Files\lfds700_queue</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_cleanup.c"> + <Filter>Source Files\lfds700_hash_addonly</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_get.c"> + <Filter>Source Files\lfds700_hash_addonly</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_init.c"> + <Filter>Source Files\lfds700_hash_addonly</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_insert.c"> + <Filter>Source Files\lfds700_hash_addonly</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_iterate.c"> + <Filter>Source Files\lfds700_hash_addonly</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_hash_addonly\lfds700_hash_addonly_query.c"> + <Filter>Source Files\lfds700_hash_addonly</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_cleanup.c"> + <Filter>Source Files\lfds700_list_addonly_ordered_singlylinked</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_get.c"> + <Filter>Source Files\lfds700_list_addonly_ordered_singlylinked</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_init.c"> + <Filter>Source Files\lfds700_list_addonly_ordered_singlylinked</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_insert.c"> + <Filter>Source Files\lfds700_list_addonly_ordered_singlylinked</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_ordered_singlylinked\lfds700_list_addonly_ordered_singlylinked_query.c"> + <Filter>Source Files\lfds700_list_addonly_ordered_singlylinked</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_cleanup.c"> + <Filter>Source Files\lfds700_btree_addonly_unbalanced</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_get.c"> + <Filter>Source Files\lfds700_btree_addonly_unbalanced</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_init.c"> + <Filter>Source Files\lfds700_btree_addonly_unbalanced</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_insert.c"> + <Filter>Source Files\lfds700_btree_addonly_unbalanced</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_btree_addonly_unbalanced\lfds700_btree_addonly_unbalanced_query.c"> + <Filter>Source Files\lfds700_btree_addonly_unbalanced</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_cleanup.c"> + <Filter>Source Files\lfds700_misc</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_globals.c"> + <Filter>Source Files\lfds700_misc</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_init.c"> + <Filter>Source Files\lfds700_misc</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_prng.c"> + <Filter>Source Files\lfds700_misc</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_misc\lfds700_misc_query.c"> + <Filter>Source Files\lfds700_misc</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_cleanup.c"> + <Filter>Source Files\lfds700_queue_bounded_singleconsumer_singleproducer</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_dequeue.c"> + <Filter>Source Files\lfds700_queue_bounded_singleconsumer_singleproducer</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_enqueue.c"> + <Filter>Source Files\lfds700_queue_bounded_singleconsumer_singleproducer</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_init.c"> + <Filter>Source Files\lfds700_queue_bounded_singleconsumer_singleproducer</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\lfds700_queue_bounded_singleconsumer_singleproducer_query.c"> + <Filter>Source Files\lfds700_queue_bounded_singleconsumer_singleproducer</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_cleanup.c"> + <Filter>Source Files\lfds700_list_addonly_singlylinked_unordered</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_get.c"> + <Filter>Source Files\lfds700_list_addonly_singlylinked_unordered</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_init.c"> + <Filter>Source Files\lfds700_list_addonly_singlylinked_unordered</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_insert.c"> + <Filter>Source Files\lfds700_list_addonly_singlylinked_unordered</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_list_addonly_singlylinked_unordered\lfds700_list_addonly_singlylinked_unordered_query.c"> + <Filter>Source Files\lfds700_list_addonly_singlylinked_unordered</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_cleanup.c"> + <Filter>Source Files\lfds700_ringbuffer</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_init.c"> + <Filter>Source Files\lfds700_ringbuffer</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_query.c"> + <Filter>Source Files\lfds700_ringbuffer</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_read.c"> + <Filter>Source Files\lfds700_ringbuffer</Filter> + </ClCompile> + <ClCompile Include="..\..\src\lfds700_ringbuffer\lfds700_ringbuffer_write.c"> + <Filter>Source Files\lfds700_ringbuffer</Filter> + </ClCompile> + </ItemGroup> +</Project> \ No newline at end of file diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2013_and_wdk_8.1/liblfds700.vcxproj.user b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2013_and_wdk_8.1/liblfds700.vcxproj.user new file mode 100644 index 0000000000000000000000000000000000000000..7cbb3216adb733fd25e1bd27d504ac8419b8c5bb --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/visual_studio_professional_2013_and_wdk_8.1/liblfds700.vcxproj.user @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup /> +</Project> \ No newline at end of file diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/wdk_7.1/dirs b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/wdk_7.1/dirs new file mode 100644 index 0000000000000000000000000000000000000000..64e002cc57abf19f52e3d3c5dbc24a8629e36d1f --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/wdk_7.1/dirs @@ -0,0 +1,3 @@ +DIRS = single_dir_for_windows_kernel + + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/wdk_7.1/driver_entry_renamed_to_avoid_compiler_warning.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/wdk_7.1/driver_entry_renamed_to_avoid_compiler_warning.c new file mode 100644 index 0000000000000000000000000000000000000000..09d7acb7fca0761205e16a3d470b224881cb5a5c --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/wdk_7.1/driver_entry_renamed_to_avoid_compiler_warning.c @@ -0,0 +1,23 @@ +#include "liblfds700_internal.h" + + + + + +/****************************************************************************/ +DRIVER_INITIALIZE DriverEntry; + + + + + +/****************************************************************************/ +#pragma warning( disable : 4100 ) + +NTSTATUS DriverEntry( struct _DRIVER_OBJECT *DriverObject, PUNICODE_STRING RegistryPath ) +{ + return( STATUS_SUCCESS ); +} + +#pragma warning( default : 4100 ) + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/wdk_7.1/liblfds700.def b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/wdk_7.1/liblfds700.def new file mode 100644 index 0000000000000000000000000000000000000000..583ce35dbdb08c553e2cb2a7f335f4bcaf9458da --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/wdk_7.1/liblfds700.def @@ -0,0 +1,69 @@ +EXPORTS + +lfds700_btree_au_init_valid_on_current_logical_core = lfds700_btree_au_init_valid_on_current_logical_core +lfds700_btree_au_cleanup = lfds700_btree_au_cleanup +lfds700_btree_au_insert = lfds700_btree_au_insert +lfds700_btree_au_get_by_absolute_position_and_then_by_relative_position = lfds700_btree_au_get_by_absolute_position_and_then_by_relative_position +lfds700_btree_au_get_by_absolute_position = lfds700_btree_au_get_by_absolute_position +lfds700_btree_au_get_by_relative_position = lfds700_btree_au_get_by_relative_position +lfds700_btree_au_get_by_key = lfds700_btree_au_get_by_key +lfds700_btree_au_query = lfds700_btree_au_query + +lfds700_freelist_init_valid_on_current_logical_core = lfds700_freelist_init_valid_on_current_logical_core +lfds700_freelist_cleanup = lfds700_freelist_cleanup +lfds700_freelist_push = lfds700_freelist_push +lfds700_freelist_pop = lfds700_freelist_pop +lfds700_freelist_query = lfds700_freelist_query + +lfds700_hash_a_init_valid_on_current_logical_core = lfds700_hash_a_init_valid_on_current_logical_core +lfds700_hash_a_cleanup = lfds700_hash_a_cleanup +lfds700_hash_a_insert = lfds700_hash_a_insert +lfds700_hash_a_get_by_key = lfds700_hash_a_get_by_key +lfds700_hash_a_iterate_init = lfds700_hash_a_iterate_init +lfds700_hash_a_iterate = lfds700_hash_a_iterate +lfds700_hash_a_query = lfds700_hash_a_query + +lfds700_list_aos_init_valid_on_current_logical_core = lfds700_list_aos_init_valid_on_current_logical_core +lfds700_list_aos_cleanup = lfds700_list_aos_cleanup +lfds700_list_aos_insert = lfds700_list_aos_insert +lfds700_list_aos_get_by_key = lfds700_list_aos_get_by_key +lfds700_list_aos_query = lfds700_list_aos_query + +lfds700_list_asu_init_valid_on_current_logical_core = lfds700_list_asu_init_valid_on_current_logical_core +lfds700_list_asu_cleanup = lfds700_list_asu_cleanup +lfds700_list_asu_insert_at_position = lfds700_list_asu_insert_at_position +lfds700_list_asu_insert_at_start = lfds700_list_asu_insert_at_start +lfds700_list_asu_insert_at_end = lfds700_list_asu_insert_at_end +lfds700_list_asu_insert_after_element = lfds700_list_asu_insert_after_element +lfds700_list_asu_get_by_key = lfds700_list_asu_get_by_key +lfds700_list_asu_query = lfds700_list_asu_query + +lfds700_misc_library_init_valid_on_current_logical_core = lfds700_misc_library_init_valid_on_current_logical_core +lfds700_misc_library_cleanup = lfds700_misc_library_cleanup +lfds700_misc_prng_init = lfds700_misc_prng_init +lfds700_misc_query = lfds700_misc_query + +lfds700_queue_init_valid_on_current_logical_core = lfds700_queue_init_valid_on_current_logical_core +lfds700_queue_cleanup = lfds700_queue_cleanup +lfds700_queue_enqueue = lfds700_queue_enqueue +lfds700_queue_dequeue = lfds700_queue_dequeue +lfds700_queue_query = lfds700_queue_query + +lfds700_queue_bss_init_valid_on_current_logical_core = lfds700_queue_bss_init_valid_on_current_logical_core +lfds700_queue_bss_cleanup = lfds700_queue_bss_cleanup +lfds700_queue_bss_enqueue = lfds700_queue_bss_enqueue +lfds700_queue_bss_dequeue = lfds700_queue_bss_dequeue +lfds700_queue_bss_query = lfds700_queue_bss_query + +lfds700_ringbuffer_init_valid_on_current_logical_core = lfds700_ringbuffer_init_valid_on_current_logical_core +lfds700_ringbuffer_cleanup = lfds700_ringbuffer_cleanup +lfds700_ringbuffer_read = lfds700_ringbuffer_read +lfds700_ringbuffer_write = lfds700_ringbuffer_write +lfds700_ringbuffer_query = lfds700_ringbuffer_query + +lfds700_stack_init_valid_on_current_logical_core = lfds700_stack_init_valid_on_current_logical_core +lfds700_stack_cleanup = lfds700_stack_cleanup +lfds700_stack_push = lfds700_stack_push +lfds700_stack_pop = lfds700_stack_pop +lfds700_stack_query = lfds700_stack_query + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/wdk_7.1/readme_before_win_kernel_build.txt b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/wdk_7.1/readme_before_win_kernel_build.txt new file mode 100644 index 0000000000000000000000000000000000000000..1481c8d08aa8fa829a554dfb3510c04eaa775baf --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/wdk_7.1/readme_before_win_kernel_build.txt @@ -0,0 +1,32 @@ +The Windows kernel build environment is primitive and has a number +of severe limitations; in particular, all source files must be in +one directory and it is not possible to choose the output binary type +(static or dynamic library) from the build command line; rather, +a string has to be modified in a text file used by the build (!) + +To deal with these limitations, it is necessary for a Windows kernel +build to run a batch file prior to building. + +There are two batch files, one for static library builds and the other +for dynamic library builds. + +They are both idempotent; you can run them as often as you like and +switch between them as often as you want. It's all fine; whenever +you run one of them, it will take you from whatever state you were +previously in, into the state you want to be in. + +Both batch files copy all the sources file into a single directory, +"/src/single_dir_for_windows_kernel/". + +The static library batch file will then copy "/sources.static" into +"/src/single_dir_for_windows_kernel/", which will cause a static +library to be built. + +The dynamic library batch file will then copy "/sources.dynamic" into +"/src/single_dir_for_windows_kernel/", which will cause a dynamic +library to be built. It will also copy "src/driver_entry.c" into +"/src/single_dir_for_windows_kernel/", since the linker requires +the DriverEntry function to exist for dynamic libraries, even +though it's not used. + + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/wdk_7.1/runme_before_win_kernel_dynamic_lib_build.bat b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/wdk_7.1/runme_before_win_kernel_dynamic_lib_build.bat new file mode 100644 index 0000000000000000000000000000000000000000..ff6fc8a1f36abbe2ba2fd4136abd983a7db35bed --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/wdk_7.1/runme_before_win_kernel_dynamic_lib_build.bat @@ -0,0 +1,22 @@ +@echo off +rmdir /q /s single_dir_for_windows_kernel 1>nul 2>nul +mkdir single_dir_for_windows_kernel 1>nul 2>nul + +copy /y ..\..\src\lfds700_btree_addonly_unbalanced\* single_dir_for_windows_kernel\ 1>nul 2>nul +copy /y ..\..\src\lfds700_freelist\* single_dir_for_windows_kernel\ 1>nul 2>nul +copy /y ..\..\src\lfds700_hash_addonly\* single_dir_for_windows_kernel\ 1>nul 2>nul +copy /y ..\..\src\lfds700_list_addonly_ordered_singlylinked\* single_dir_for_windows_kernel\ 1>nul 2>nul +copy /y ..\..\src\lfds700_list_addonly_singlylinked_unordered\* single_dir_for_windows_kernel\ 1>nul 2>nul +copy /y ..\..\src\lfds700_misc\* single_dir_for_windows_kernel\ 1>nul 2>nul +copy /y ..\..\src\lfds700_queue\* single_dir_for_windows_kernel\ 1>nul 2>nul +copy /y ..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\* single_dir_for_windows_kernel\ 1>nul 2>nul +copy /y ..\..\src\lfds700_ringbuffer\* single_dir_for_windows_kernel\ 1>nul 2>nul +copy /y ..\..\src\lfds700_stack\* single_dir_for_windows_kernel\ 1>nul 2>nul + +copy /y ..\..\src\liblfds700_internal.h single_dir_for_windows_kernel\ 1>nul 2>nul +copy /y driver_entry_renamed_to_avoid_compiler_warning.c single_dir_for_windows_kernel\driver_entry.c 1>nul 2>nul +copy /y sources.dynamic single_dir_for_windows_kernel\sources 1>nul 2>nul + +echo Windows kernel dynamic library build directory structure created. +echo (Note the effects of this batch file are idempotent). + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/wdk_7.1/runme_before_win_kernel_static_lib_build.bat b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/wdk_7.1/runme_before_win_kernel_static_lib_build.bat new file mode 100644 index 0000000000000000000000000000000000000000..81c35e99c8e56591d478b897c89d43bb6292bbe1 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/wdk_7.1/runme_before_win_kernel_static_lib_build.bat @@ -0,0 +1,21 @@ +@echo off +rmdir /q /s single_dir_for_windows_kernel 1>nul 2>nul +mkdir single_dir_for_windows_kernel 1>nul 2>nul + +copy /y ..\..\src\lfds700_btree_addonly_unbalanced\* single_dir_for_windows_kernel\ 1>nul 2>nul +copy /y ..\..\src\lfds700_freelist\* single_dir_for_windows_kernel\ 1>nul 2>nul +copy /y ..\..\src\lfds700_hash_addonly\* single_dir_for_windows_kernel\ 1>nul 2>nul +copy /y ..\..\src\lfds700_list_addonly_ordered_singlylinked\* single_dir_for_windows_kernel\ 1>nul 2>nul +copy /y ..\..\src\lfds700_list_addonly_singlylinked_unordered\* single_dir_for_windows_kernel\ 1>nul 2>nul +copy /y ..\..\src\lfds700_misc\* single_dir_for_windows_kernel\ 1>nul 2>nul +copy /y ..\..\src\lfds700_queue\* single_dir_for_windows_kernel\ 1>nul 2>nul +copy /y ..\..\src\lfds700_queue_bounded_singleconsumer_singleproducer\* single_dir_for_windows_kernel\ 1>nul 2>nul +copy /y ..\..\src\lfds700_ringbuffer\* single_dir_for_windows_kernel\ 1>nul 2>nul +copy /y ..\..\src\lfds700_stack\* single_dir_for_windows_kernel\ 1>nul 2>nul + +copy /y ..\..\src\liblfds700_internal.h single_dir_for_windows_kernel\ 1>nul 2>nul +copy /y sources.static single_dir_for_windows_kernel\sources 1>nul 2>nul + +echo Windows kernel static library build directory structure created. +echo (Note the effects of this batch file are idempotent). + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/wdk_7.1/sources.dynamic b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/wdk_7.1/sources.dynamic new file mode 100644 index 0000000000000000000000000000000000000000..b0d241f85f6885598b57d58e992224a658317ece --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/wdk_7.1/sources.dynamic @@ -0,0 +1,62 @@ +MSC_WARNING_LEVEL = /WX /wd4127 /W4 +DLLDEF = ../liblfds700.def +TARGETNAME = liblfds700 +TARGETPATH = ../../../bin/ +TARGETTYPE = EXPORT_DRIVER +UMTYPE = nt +USER_C_FLAGS = /D_KERNEL_MODE + +INCLUDES = ../../../inc/ +SOURCES = lfds700_hash_addonly_cleanup.c \ + lfds700_hash_addonly_get.c \ + lfds700_hash_addonly_init.c \ + lfds700_hash_addonly_insert.c \ + lfds700_hash_addonly_iterate.c \ + lfds700_hash_addonly_query.c \ + lfds700_list_addonly_ordered_singlylinked_cleanup.c \ + lfds700_list_addonly_ordered_singlylinked_get.c \ + lfds700_list_addonly_ordered_singlylinked_init.c \ + lfds700_list_addonly_ordered_singlylinked_insert.c \ + lfds700_list_addonly_ordered_singlylinked_query.c \ + lfds700_list_addonly_singlylinked_unordered_cleanup.c \ + lfds700_list_addonly_singlylinked_unordered_get.c \ + lfds700_list_addonly_singlylinked_unordered_init.c \ + lfds700_list_addonly_singlylinked_unordered_insert.c \ + lfds700_list_addonly_singlylinked_unordered_query.c \ + lfds700_btree_addonly_unbalanced_cleanup.c \ + lfds700_btree_addonly_unbalanced_get.c \ + lfds700_btree_addonly_unbalanced_init.c \ + lfds700_btree_addonly_unbalanced_insert.c \ + lfds700_btree_addonly_unbalanced_query.c \ + lfds700_freelist_cleanup.c \ + lfds700_freelist_init.c \ + lfds700_freelist_pop.c \ + lfds700_freelist_push.c \ + lfds700_freelist_query.c \ + lfds700_misc_cleanup.c \ + lfds700_misc_globals.c \ + lfds700_misc_init.c \ + lfds700_misc_prng.c \ + lfds700_misc_query.c \ + lfds700_queue_cleanup.c \ + lfds700_queue_dequeue.c \ + lfds700_queue_enqueue.c \ + lfds700_queue_init.c \ + lfds700_queue_query.c \ + lfds700_queue_bounded_singleconsumer_singleproducer_cleanup.c \ + lfds700_queue_bounded_singleconsumer_singleproducer_dequeue.c \ + lfds700_queue_bounded_singleconsumer_singleproducer_enqueue.c \ + lfds700_queue_bounded_singleconsumer_singleproducer_init.c \ + lfds700_queue_bounded_singleconsumer_singleproducer_query.c \ + lfds700_ringbuffer_cleanup.c \ + lfds700_ringbuffer_init.c \ + lfds700_ringbuffer_query.c \ + lfds700_ringbuffer_read.c \ + lfds700_ringbuffer_write.c \ + lfds700_stack_cleanup.c \ + lfds700_stack_init.c \ + lfds700_stack_pop.c \ + lfds700_stack_push.c \ + lfds700_stack_query.c \ + driver_entry.c + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/wdk_7.1/sources.static b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/wdk_7.1/sources.static new file mode 100644 index 0000000000000000000000000000000000000000..401b381c7d0274b777edb7228edcd69a7d6e7909 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/build/wdk_7.1/sources.static @@ -0,0 +1,60 @@ +MSC_WARNING_LEVEL = /WX /wd4127 /W4 +TARGETNAME = liblfds700 +TARGETPATH = ../../../bin/ +TARGETTYPE = DRIVER_LIBRARY +UMTYPE = nt +USER_C_FLAGS = /D_KERNEL_MODE + +INCLUDES = ../../../inc/ +SOURCES = lfds700_hash_addonly_cleanup.c \ + lfds700_hash_addonly_get.c \ + lfds700_hash_addonly_init.c \ + lfds700_hash_addonly_insert.c \ + lfds700_hash_addonly_iterate.c \ + lfds700_hash_addonly_query.c \ + lfds700_list_addonly_ordered_singlylinked_cleanup.c \ + lfds700_list_addonly_ordered_singlylinked_get.c \ + lfds700_list_addonly_ordered_singlylinked_init.c \ + lfds700_list_addonly_ordered_singlylinked_insert.c \ + lfds700_list_addonly_ordered_singlylinked_query.c \ + lfds700_list_addonly_singlylinked_unordered_cleanup.c \ + lfds700_list_addonly_singlylinked_unordered_get.c \ + lfds700_list_addonly_singlylinked_unordered_init.c \ + lfds700_list_addonly_singlylinked_unordered_insert.c \ + lfds700_list_addonly_singlylinked_unordered_query.c \ + lfds700_btree_addonly_unbalanced_cleanup.c \ + lfds700_btree_addonly_unbalanced_get.c \ + lfds700_btree_addonly_unbalanced_init.c \ + lfds700_btree_addonly_unbalanced_insert.c \ + lfds700_btree_addonly_unbalanced_query.c \ + lfds700_freelist_cleanup.c \ + lfds700_freelist_init.c \ + lfds700_freelist_pop.c \ + lfds700_freelist_push.c \ + lfds700_freelist_query.c \ + lfds700_misc_cleanup.c \ + lfds700_misc_globals.c \ + lfds700_misc_init.c \ + lfds700_misc_prng.c \ + lfds700_misc_query.c \ + lfds700_queue_cleanup.c \ + lfds700_queue_dequeue.c \ + lfds700_queue_enqueue.c \ + lfds700_queue_init.c \ + lfds700_queue_query.c \ + lfds700_queue_bounded_singleconsumer_singleproducer_cleanup.c \ + lfds700_queue_bounded_singleconsumer_singleproducer_dequeue.c \ + lfds700_queue_bounded_singleconsumer_singleproducer_enqueue.c \ + lfds700_queue_bounded_singleconsumer_singleproducer_init.c \ + lfds700_queue_bounded_singleconsumer_singleproducer_query.c \ + lfds700_ringbuffer_cleanup.c \ + lfds700_ringbuffer_init.c \ + lfds700_ringbuffer_query.c \ + lfds700_ringbuffer_read.c \ + lfds700_ringbuffer_write.c \ + lfds700_stack_cleanup.c \ + lfds700_stack_init.c \ + lfds700_stack_pop.c \ + lfds700_stack_push.c \ + lfds700_stack_query.c + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700.h b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700.h new file mode 100644 index 0000000000000000000000000000000000000000..fdda50cefba67824e61c23fd2229129637d324ff --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700.h @@ -0,0 +1,31 @@ +#ifndef LIBLFDS700_H + + /***** defines *****/ + #define LIBLFDS700_H + + /***** pragmas on *****/ + #pragma warning( disable : 4324 ) // TRD : 4324 disables MSVC warnings for structure alignment padding due to alignment specifiers + + #pragma prefast( disable : 28113 28182 28183, "blah" ) + + /***** includes *****/ + #include "liblfds700/lfds700_porting_abstraction_layer_compiler.h" + #include "liblfds700/lfds700_porting_abstraction_layer_operating_system.h" + #include "liblfds700/lfds700_porting_abstraction_layer_processor.h" + + #include "liblfds700/lfds700_misc.h" // TRD : everything after depends on misc + #include "liblfds700/lfds700_btree_addonly_unbalanced.h" // TRD : hash_addonly depends on btree_addonly_unbalanced + #include "liblfds700/lfds700_freelist.h" + #include "liblfds700/lfds700_hash_addonly.h" + #include "liblfds700/lfds700_list_addonly_ordered_singlylinked.h" + #include "liblfds700/lfds700_list_addonly_singlylinked_unordered.h" + #include "liblfds700/lfds700_queue.h" + #include "liblfds700/lfds700_queue_bounded_singleconsumer_singleproducer.h" + #include "liblfds700/lfds700_ringbuffer.h" + #include "liblfds700/lfds700_stack.h" + + /***** pragmas off *****/ + #pragma warning( default : 4324 ) + +#endif + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_btree_addonly_unbalanced.h b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_btree_addonly_unbalanced.h new file mode 100644 index 0000000000000000000000000000000000000000..bdc63a4273b6976011403203177fa3160763513b --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_btree_addonly_unbalanced.h @@ -0,0 +1,113 @@ +/***** defines *****/ +#define LFDS700_BTREE_AU_GET_KEY_FROM_ELEMENT( btree_au_element ) ( (btree_au_element).key ) +#define LFDS700_BTREE_AU_SET_KEY_IN_ELEMENT( btree_au_element, new_key ) ( (btree_au_element).key = (void *) (lfds700_pal_uint_t) (new_key) ) +#define LFDS700_BTREE_AU_GET_VALUE_FROM_ELEMENT( btree_au_element ) ( LFDS700_MISC_BARRIER_LOAD, (btree_au_element).value ) +#define LFDS700_BTREE_AU_SET_VALUE_IN_ELEMENT( btree_au_element, new_value ) { void *local_new_value = (void *) (lfds700_pal_uint_t) (new_value); LFDS700_PAL_ATOMIC_EXCHANGE( &(btree_au_element).value, &local_new_value ); } +#define LFDS700_BTREE_AU_GET_USER_STATE_FROM_STATE( btree_au_state ) ( (btree_au_state).user_state ) + +/***** enums *****/ +enum lfds700_btree_au_absolute_position +{ + LFDS700_BTREE_AU_ABSOLUTE_POSITION_ROOT, + LFDS700_BTREE_AU_ABSOLUTE_POSITION_SMALLEST_IN_TREE, + LFDS700_BTREE_AU_ABSOLUTE_POSITION_LARGEST_IN_TREE +}; + +enum lfds700_btree_au_existing_key +{ + LFDS700_BTREE_AU_EXISTING_KEY_OVERWRITE, + LFDS700_BTREE_AU_EXISTING_KEY_FAIL +}; + +enum lfds700_btree_au_insert_result +{ + LFDS700_BTREE_AU_INSERT_RESULT_FAILURE_EXISTING_KEY, + LFDS700_BTREE_AU_INSERT_RESULT_SUCCESS_OVERWRITE, + LFDS700_BTREE_AU_INSERT_RESULT_SUCCESS +}; + +enum lfds700_btree_au_relative_position +{ + LFDS700_BTREE_AU_RELATIVE_POSITION_UP, + LFDS700_BTREE_AU_RELATIVE_POSITION_LEFT, + LFDS700_BTREE_AU_RELATIVE_POSITION_RIGHT, + LFDS700_BTREE_AU_RELATIVE_POSITION_SMALLEST_ELEMENT_BELOW_CURRENT_ELEMENT, + LFDS700_BTREE_AU_RELATIVE_POSITION_LARGEST_ELEMENT_BELOW_CURRENT_ELEMENT, + LFDS700_BTREE_AU_RELATIVE_POSITION_NEXT_SMALLER_ELEMENT_IN_ENTIRE_TREE, + LFDS700_BTREE_AU_RELATIVE_POSITION_NEXT_LARGER_ELEMENT_IN_ENTIRE_TREE +}; + +enum lfds700_btree_au_query +{ + LFDS700_BTREE_AU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, + LFDS700_BTREE_AU_QUERY_SINGLETHREADED_VALIDATE +}; + +/***** structs *****/ +struct lfds700_btree_au_element +{ + struct lfds700_btree_au_element LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + *volatile left, + *volatile right, + *volatile up; + + void LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + *volatile value; + + void LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + *key; +}; + +struct lfds700_btree_au_state +{ + struct lfds700_btree_au_element LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + *volatile root; + + int LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + (*key_compare_function)( void const *new_key, void const *existing_key ); + + enum lfds700_btree_au_existing_key + existing_key; + + void + *user_state; +}; + +/***** public prototypes *****/ +void lfds700_btree_au_init_valid_on_current_logical_core( struct lfds700_btree_au_state *baus, + int (*key_compare_function)(void const *new_key, void const *existing_key), + enum lfds700_btree_au_existing_key existing_key, + void *user_state ); + // TRD : used in conjunction with the #define LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE + +void lfds700_btree_au_cleanup( struct lfds700_btree_au_state *baus, + void (*element_cleanup_callback)(struct lfds700_btree_au_state *baus, struct lfds700_btree_au_element *baue) ); + +enum lfds700_btree_au_insert_result lfds700_btree_au_insert( struct lfds700_btree_au_state *baus, + struct lfds700_btree_au_element *baue, + struct lfds700_btree_au_element **existing_baue, + struct lfds700_misc_prng_state *ps ); + // TRD : if a link collides with an existing key and existing_baue is non-NULL, existing_baue is set to the existing element + +int lfds700_btree_au_get_by_key( struct lfds700_btree_au_state *baus, + void *key, + struct lfds700_btree_au_element **baue ); + +int lfds700_btree_au_get_by_absolute_position_and_then_by_relative_position( struct lfds700_btree_au_state *baus, + struct lfds700_btree_au_element **baue, + enum lfds700_btree_au_absolute_position absolute_position, + enum lfds700_btree_au_relative_position relative_position ); + // TRD : if *baue is NULL, we get the element at position, otherwise we move from *baue according to direction + +int lfds700_btree_au_get_by_absolute_position( struct lfds700_btree_au_state *baus, + struct lfds700_btree_au_element **baue, + enum lfds700_btree_au_absolute_position absolute_position ); + +int lfds700_btree_au_get_by_relative_position( struct lfds700_btree_au_element **baue, + enum lfds700_btree_au_relative_position relative_position ); + +void lfds700_btree_au_query( struct lfds700_btree_au_state *baus, + enum lfds700_btree_au_query query_type, + void *query_input, + void *query_output ); + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_freelist.h b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_freelist.h new file mode 100644 index 0000000000000000000000000000000000000000..6a89386c5d33316d7bc401b364078d112390393e --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_freelist.h @@ -0,0 +1,54 @@ +/***** defines *****/ +#define LFDS700_FREELIST_GET_KEY_FROM_ELEMENT( freelist_element ) ( (freelist_element).key ) +#define LFDS700_FREELIST_SET_KEY_IN_ELEMENT( freelist_element, new_key ) ( (freelist_element).key = (void *) (lfds700_pal_uint_t) (new_key) ) +#define LFDS700_FREELIST_GET_VALUE_FROM_ELEMENT( freelist_element ) ( (freelist_element).value ) +#define LFDS700_FREELIST_SET_VALUE_IN_ELEMENT( freelist_element, new_value ) ( (freelist_element).value = (void *) (lfds700_pal_uint_t) (new_value) ) +#define LFDS700_FREELIST_GET_USER_STATE_FROM_STATE( freelist_state ) ( (freelist_state).user_state ) + +/***** enums *****/ +enum lfds700_freelist_query +{ + LFDS700_FREELIST_QUERY_SINGLETHREADED_GET_COUNT, + LFDS700_FREELIST_QUERY_SINGLETHREADED_VALIDATE +}; + +/***** structures *****/ +struct lfds700_freelist_element +{ + struct lfds700_freelist_element + *volatile next; + + void + *key, + *value; +}; + +struct lfds700_freelist_state +{ + struct lfds700_freelist_element LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + *volatile top[PAC_SIZE]; + + void LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + *user_state; +}; + +/***** public prototypes *****/ +void lfds700_freelist_init_valid_on_current_logical_core( struct lfds700_freelist_state *fs, void *user_state ); + // TRD : used in conjunction with the #define LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE + +void lfds700_freelist_cleanup( struct lfds700_freelist_state *fs, + void (*element_cleanup_callback)(struct lfds700_freelist_state *fs, struct lfds700_freelist_element *fe) ); + +void lfds700_freelist_push( struct lfds700_freelist_state *fs, + struct lfds700_freelist_element *fe, + struct lfds700_misc_prng_state *ps ); + +int lfds700_freelist_pop( struct lfds700_freelist_state *fs, + struct lfds700_freelist_element **fe, + struct lfds700_misc_prng_state *ps ); + +void lfds700_freelist_query( struct lfds700_freelist_state *fs, + enum lfds700_freelist_query query_type, + void *query_input, + void *query_output ); + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_hash_addonly.h b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_hash_addonly.h new file mode 100644 index 0000000000000000000000000000000000000000..f7962db9e03680c33b5b163ac4526260819c53c1 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_hash_addonly.h @@ -0,0 +1,127 @@ +/***** defines *****/ +#define LFDS700_HASH_A_GET_KEY_FROM_ELEMENT( hash_a_element ) ( (hash_a_element).key ) +#define LFDS700_HASH_A_SET_KEY_IN_ELEMENT( hash_a_element, new_key ) ( (hash_a_element).key = (void *) (lfds700_pal_uint_t) (new_key) ) +#define LFDS700_HASH_A_GET_VALUE_FROM_ELEMENT( hash_a_element ) ( LFDS700_MISC_BARRIER_LOAD, (hash_a_element).value ) +#define LFDS700_HASH_A_SET_VALUE_IN_ELEMENT( hash_a_element, new_value ) { void *local_new_value = (void *) (lfds700_pal_uint_t) (new_value); LFDS700_PAL_ATOMIC_EXCHANGE( &(hash_a_element).value, &local_new_value ); } +#define LFDS700_HASH_A_GET_USER_STATE_FROM_STATE( hash_a_state ) ( (hash_a_state).user_state ) + +#define LFDS700_HASH_A_32BIT_HASH_FUNCTION( data, data_length_in_bytes, hash ) { \ + lfds700_pal_uint_t \ + loop; \ + \ + for( loop = 0 ; loop < (data_length_in_bytes) ; loop++ ) \ + { \ + (hash) += *( (char unsigned *) (data) + loop ); \ + (hash) += ((hash) << 10); \ + (hash) ^= ((hash) >> 6); \ + } \ + \ + (hash) += ((hash) << 3); \ + (hash) ^= ((hash) >> 11); \ + (hash) += ((hash) << 15); \ + } + /* TRD : this is the Jenkins one-at-a-time hash + it produces a 32 bit hash + http://en.wikipedia.org/wiki/Jenkins_hash_function + + we ourselves do *not* initialize the value of *hash, so that + our caller has the option to call us multiple times, each + time with for example a different member of a struct, which is + then hashed into the existing, built-up-so-far hash value, and + so build up a quality hash + */ + +/***** enums *****/ +enum lfds700_hash_a_existing_key +{ + LFDS700_HASH_A_EXISTING_KEY_OVERWRITE, + LFDS700_HASH_A_EXISTING_KEY_FAIL +}; + +enum lfds700_hash_a_insert_result +{ + LFDS700_HASH_A_PUT_RESULT_FAILURE_EXISTING_KEY, + LFDS700_HASH_A_PUT_RESULT_SUCCESS_OVERWRITE, + LFDS700_HASH_A_PUT_RESULT_SUCCESS +}; + +enum lfds700_hash_a_query +{ + LFDS700_HASH_A_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, + LFDS700_HASH_A_QUERY_SINGLETHREADED_VALIDATE +}; + +/***** structs *****/ +struct lfds700_hash_a_element +{ + struct lfds700_btree_au_element + baue; + + void + *key; + + void LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + *volatile value; +}; + +struct lfds700_hash_a_iterate +{ + struct lfds700_btree_au_element + *baue; + + struct lfds700_btree_au_state + *baus, + *baus_end; +}; + +struct lfds700_hash_a_state +{ + enum lfds700_hash_a_existing_key + existing_key; + + int + (*key_compare_function)( void const *new_key, void const *existing_key ); + + lfds700_pal_uint_t + array_size; + + struct lfds700_btree_au_state + *baus_array; + + void + (*element_cleanup_callback)( struct lfds700_hash_a_state *has, struct lfds700_hash_a_element *hae ), + (*key_hash_function)( void const *key, lfds700_pal_uint_t *hash ), + *user_state; +}; + +/***** public prototypes *****/ +void lfds700_hash_a_init_valid_on_current_logical_core( struct lfds700_hash_a_state *has, + struct lfds700_btree_au_state *baus_array, + lfds700_pal_uint_t array_size, + int (*key_compare_function)(void const *new_key, void const *existing_key), + void (*key_hash_function)(void const *key, lfds700_pal_uint_t *hash), + enum lfds700_hash_a_existing_key existing_key, + void *user_state ); + // TRD : used in conjunction with the #define LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE + +void lfds700_hash_a_cleanup( struct lfds700_hash_a_state *has, + void (*element_cleanup_function)(struct lfds700_hash_a_state *has, struct lfds700_hash_a_element *hae) ); + +enum lfds700_hash_a_insert_result lfds700_hash_a_insert( struct lfds700_hash_a_state *has, + struct lfds700_hash_a_element *hae, + struct lfds700_hash_a_element **existing_hae, + struct lfds700_misc_prng_state *ps ); + // TRD : if existing_value is not NULL and the key exists, existing_value is set to the value of the existing key + +int lfds700_hash_a_get_by_key( struct lfds700_hash_a_state *has, + void *key, + struct lfds700_hash_a_element **hae ); + +void lfds700_hash_a_iterate_init( struct lfds700_hash_a_state *has, struct lfds700_hash_a_iterate *hai ); +int lfds700_hash_a_iterate( struct lfds700_hash_a_iterate *hai, struct lfds700_hash_a_element **hae ); + +void lfds700_hash_a_query( struct lfds700_hash_a_state *has, + enum lfds700_hash_a_query query_type, + void *query_input, + void *query_output ); + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_list_addonly_ordered_singlylinked.h b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_list_addonly_ordered_singlylinked.h new file mode 100644 index 0000000000000000000000000000000000000000..dffab0aa6b1901e85008faf900a513e8ede980ed --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_list_addonly_ordered_singlylinked.h @@ -0,0 +1,85 @@ +/***** defines *****/ +#define LFDS700_LIST_AOS_GET_START( list_aos_state ) ( LFDS700_MISC_BARRIER_LOAD, (list_aos_state).start->next ) +#define LFDS700_LIST_AOS_GET_NEXT( list_aos_element ) ( LFDS700_MISC_BARRIER_LOAD, (list_aos_element).next ) +#define LFDS700_LIST_AOS_GET_START_AND_THEN_NEXT( list_aos_state, pointer_to_list_aos_element ) ( (pointer_to_list_aos_element) == NULL ? ( (pointer_to_list_aos_element) = LFDS700_LIST_AOS_GET_START(list_aos_state) ) : ( (pointer_to_list_aos_element) = LFDS700_LIST_AOS_GET_NEXT(*(pointer_to_list_aos_element)) ) ) +#define LFDS700_LIST_AOS_GET_KEY_FROM_ELEMENT( list_aos_element ) ( (list_aos_element).key ) +#define LFDS700_LIST_AOS_SET_KEY_IN_ELEMENT( list_aos_element, new_key ) ( (list_aos_element).key = (void *) (lfds700_pal_uint_t) (new_key) ) +#define LFDS700_LIST_AOS_GET_VALUE_FROM_ELEMENT( list_aos_element ) ( LFDS700_MISC_BARRIER_LOAD, (list_aos_element).value ) +#define LFDS700_LIST_AOS_SET_VALUE_IN_ELEMENT( list_aos_element, new_value ) { void *local_new_value = (void *) (lfds700_pal_uint_t) (new_value); LFDS700_PAL_ATOMIC_EXCHANGE( &(list_aos_element).value, &local_new_value ); } +#define LFDS700_LIST_AOS_GET_USER_STATE_FROM_STATE( list_aos_state ) ( (list_aos_state).user_state ) + +/***** enums *****/ +enum lfds700_list_aos_existing_key +{ + LFDS700_LIST_AOS_EXISTING_KEY_OVERWRITE, + LFDS700_LIST_AOS_EXISTING_KEY_FAIL +}; + +enum lfds700_list_aos_insert_result +{ + LFDS700_LIST_AOS_INSERT_RESULT_FAILURE_EXISTING_KEY, + LFDS700_LIST_AOS_INSERT_RESULT_SUCCESS_OVERWRITE, + LFDS700_LIST_AOS_INSERT_RESULT_SUCCESS +}; + +enum lfds700_list_aos_query +{ + LFDS700_LIST_AOS_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, + LFDS700_LIST_AOS_QUERY_SINGLETHREADED_VALIDATE +}; + +/***** structures *****/ +struct lfds700_list_aos_element +{ + struct lfds700_list_aos_element LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + *volatile next; + + void LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + *volatile value; + + void LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + *key; +}; + +struct lfds700_list_aos_state +{ + struct lfds700_list_aos_element LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + *volatile start; + + struct lfds700_list_aos_element LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + dummy_element; + + int LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + (*key_compare_function)( void const *new_key, void const *existing_key ); + + enum lfds700_list_aos_existing_key + existing_key; + + void + *user_state; +}; + +/***** public prototypes *****/ +void lfds700_list_aos_init_valid_on_current_logical_core( struct lfds700_list_aos_state *laoss, + int (*key_compare_function)(void const *new_key, void const *existing_key), + enum lfds700_list_aos_existing_key existing_key, + void *user_state ); + // TRD : used in conjunction with the #define LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE + +void lfds700_list_aos_cleanup( struct lfds700_list_aos_state *laoss, + void (*element_cleanup_callback)(struct lfds700_list_aos_state *laoss, struct lfds700_list_aos_element *laose) ); + +enum lfds700_list_aos_insert_result lfds700_list_aos_insert( struct lfds700_list_aos_state *laoss, + struct lfds700_list_aos_element *laose, + struct lfds700_list_aos_element **existing_laose, + struct lfds700_misc_prng_state *ps ); + +int lfds700_list_aos_get_by_key( struct lfds700_list_aos_state *laoss, + void *key, + struct lfds700_list_aos_element **laose ); + +void lfds700_list_aos_query( struct lfds700_list_aos_state *laoss, + enum lfds700_list_aos_query query_type, + void *query_input, + void *query_output ); + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_list_addonly_singlylinked_unordered.h b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_list_addonly_singlylinked_unordered.h new file mode 100644 index 0000000000000000000000000000000000000000..38d21511a1d9da781dc6a4f131374d02102f7e6e --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_list_addonly_singlylinked_unordered.h @@ -0,0 +1,90 @@ +/***** defines *****/ +#define LFDS700_LIST_ASU_GET_START( list_asu_state ) ( LFDS700_MISC_BARRIER_LOAD, (list_asu_state).start->next ) +#define LFDS700_LIST_ASU_GET_NEXT( list_asu_element ) ( LFDS700_MISC_BARRIER_LOAD, (list_asu_element).next ) +#define LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT( list_asu_state, pointer_to_list_asu_element ) ( (pointer_to_list_asu_element) == NULL ? ( (pointer_to_list_asu_element) = LFDS700_LIST_ASU_GET_START(list_asu_state) ) : ( (pointer_to_list_asu_element) = LFDS700_LIST_ASU_GET_NEXT(*(pointer_to_list_asu_element)) ) ) +#define LFDS700_LIST_ASU_GET_KEY_FROM_ELEMENT( list_asu_element ) ( (list_asu_element).key ) +#define LFDS700_LIST_ASU_SET_KEY_IN_ELEMENT( list_asu_element, new_key ) ( (list_asu_element).key = (void *) (lfds700_pal_uint_t) (new_key) ) +#define LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( list_asu_element ) ( LFDS700_MISC_BARRIER_LOAD, (list_asu_element).value ) +#define LFDS700_LIST_ASU_SET_VALUE_IN_ELEMENT( list_asu_element, new_value ) { void *local_new_value = (void *) (lfds700_pal_uint_t) (new_value); LFDS700_PAL_ATOMIC_EXCHANGE( &(list_asu_element).value, &local_new_value ); } +#define LFDS700_LIST_ASU_GET_USER_STATE_FROM_STATE( list_asu_state ) ( (list_asu_state).user_state ) + +/***** enums *****/ +enum lfds700_list_asu_position +{ + LFDS700_LIST_ASU_POSITION_START, + LFDS700_LIST_ASU_POSITION_END, + LFDS700_LIST_ASU_POSITION_AFTER +}; + +enum lfds700_list_asu_query +{ + LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, + LFDS700_LIST_ASU_QUERY_SINGLETHREADED_VALIDATE +}; + +/***** structures *****/ +struct lfds700_list_asu_element +{ + struct lfds700_list_asu_element LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + *volatile next; + + void LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + *volatile value; + + void LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + *key; +}; + +struct lfds700_list_asu_state +{ + struct lfds700_list_asu_element LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + *volatile end, + *volatile start; + + struct lfds700_list_asu_element LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + dummy_element; + + int LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + (*key_compare_function)( void const *new_key, void const *existing_key ); + + void + *user_state; +}; + +/***** public prototypes *****/ +void lfds700_list_asu_init_valid_on_current_logical_core( struct lfds700_list_asu_state *lasus, + int (*key_compare_function)(void const *new_key, void const *existing_key), + void *user_state ); + // TRD : used in conjunction with the #define LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE + +void lfds700_list_asu_cleanup( struct lfds700_list_asu_state *lasus, + void (*element_cleanup_callback)(struct lfds700_list_asu_state *lasus, struct lfds700_list_asu_element *lasue) ); + +void lfds700_list_asu_insert_at_position( struct lfds700_list_asu_state *lasus, + struct lfds700_list_asu_element *lasue, + struct lfds700_list_asu_element *lasue_predecessor, + enum lfds700_list_asu_position position, + struct lfds700_misc_prng_state *ps ); + +void lfds700_list_asu_insert_at_start( struct lfds700_list_asu_state *lasus, + struct lfds700_list_asu_element *lasue, + struct lfds700_misc_prng_state *ps ); + +void lfds700_list_asu_insert_at_end( struct lfds700_list_asu_state *lasus, + struct lfds700_list_asu_element *lasue, + struct lfds700_misc_prng_state *ps ); + +void lfds700_list_asu_insert_after_element( struct lfds700_list_asu_state *lasus, + struct lfds700_list_asu_element *lasue, + struct lfds700_list_asu_element *lasue_predecessor, + struct lfds700_misc_prng_state *ps ); + +int lfds700_list_asu_get_by_key( struct lfds700_list_asu_state *lasus, + void *key, + struct lfds700_list_asu_element **lasue ); + +void lfds700_list_asu_query( struct lfds700_list_asu_state *lasus, + enum lfds700_list_asu_query query_type, + void *query_input, + void *query_output ); + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_misc.h b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_misc.h new file mode 100644 index 0000000000000000000000000000000000000000..014f72dac533b8cdcf902ef69bae8adbca39a425 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_misc.h @@ -0,0 +1,192 @@ +/***** defines *****/ +#define LFDS700_MISC_VERSION_STRING "7.0.0" +#define LFDS700_MISC_VERSION_INTEGER 700 + +#ifndef NULL + #define NULL ( (void *) 0 ) +#endif + +#define POINTER 0 +#define COUNTER 1 +#define PAC_SIZE 2 + +#define LFDS700_MISC_ABSTRACTION_BACKOFF_INITIAL_VALUE 0 +#define LFDS700_MISC_PRNG_MAX ( (lfds700_pal_uint_t) -1 ) +#define LFDS700_MISC_DELIBERATELY_CRASH { char *c = 0; *c = 0; } +#define LFDS700_MISC_PRNG_SEED 0x0a34655d34c092feULL + /* TRD : from an on-line hardware RNG, using atmospheric noise + the URL eblow will generate another 16 random hex digits (e.g. a 64-bit number) and is + the RNG used to generate the number above (0x0a34655d34c092fe) + http://www.random.org/integers/?num=16&min=0&max=15&col=1&base=16&format=plain&rnd=new + + this seed is a fixed seed which is used for the slow, high quality PRNG, + which in turn is used when thread start to generate a single high quality seed + for the fast, low quality PRNG used for the CAS exponential backoff + */ + +#if( LFDS700_PAL_ALIGN_SINGLE_POINTER == 4 ) // TRD : any 32-bit platform + // TRD : PRNG is a 32-bit xorshift, numbers suggested by George Marsaglia, in his paper http://www.jstatsoft.org/v08/i14/paper + #define LFDS700_MISC_PRNG_GENERATE( pointer_to_lfds700_misc_prng_state ) ( (pointer_to_lfds700_misc_prng_state)->prng_state ^= (pointer_to_lfds700_misc_prng_state)->prng_state >> 13, (pointer_to_lfds700_misc_prng_state)->prng_state ^= (pointer_to_lfds700_misc_prng_state)->prng_state << 17, (pointer_to_lfds700_misc_prng_state)->prng_state ^= (pointer_to_lfds700_misc_prng_state)->prng_state >> 5 ) +#endif + +#if( LFDS700_PAL_ALIGN_SINGLE_POINTER == 8 ) // TRD : any 64-bit platform + // TRD : PRNG is 64-bit xorshift (xorshift64*), from Sebastiano Vigna (vigna at acm dot org), http://creativecommons.org/publicdomain/zero/1.0/ + #define LFDS700_MISC_PRNG_GENERATE( pointer_to_lfds700_misc_prng_state ) ( (pointer_to_lfds700_misc_prng_state)->prng_state ^= (pointer_to_lfds700_misc_prng_state)->prng_state >> 12, (pointer_to_lfds700_misc_prng_state)->prng_state ^= (pointer_to_lfds700_misc_prng_state)->prng_state << 25, (pointer_to_lfds700_misc_prng_state)->prng_state ^= (pointer_to_lfds700_misc_prng_state)->prng_state >> 27, (pointer_to_lfds700_misc_prng_state)->prng_state *= 2685821657736338717LL ) +#endif + +#if( !defined LFDS700_PAL_ATOMIC_CAS ) + #define LFDS700_PAL_NO_ATOMIC_CAS + + // TRD : lfds700_pal_atom_t volatile *destination, lfds700_pal_atom_t *compare, lfds700_pal_atom_t new_destination, enum lfds700_misc_cas_strength cas_strength, char unsigned result + + #define LFDS700_PAL_ATOMIC_CAS( pointer_to_destination, pointer_to_compare, new_destination, cas_strength, result ) \ + { \ + LFDS700_PAL_ASSERT( !"LFDS700_PAL_ATOMIC_CAS not implemented for this platform." ); \ + LFDS700_MISC_DELIBERATELY_CRASH; \ + (result) = (char unsigned) 1; \ + } +#endif + +#if( !defined LFDS700_PAL_ATOMIC_DWCAS ) + #define LFDS700_PAL_NO_ATOMIC_DWCAS + + // TRD : lfds700_pal_atom_t volatile (*destination)[2], lfds700_pal_atom_t (*compare)[2], lfds700_pal_atom_t (*new_destination)[2], enum lfds700_misc_cas_strength cas_strength, unsigned char result + + #define LFDS700_PAL_ATOMIC_DWCAS( pointer_to_destination, pointer_to_compare, pointer_to_new_destination, cas_strength, result ) \ + { \ + LFDS700_PAL_ASSERT( !"LFDS700_PAL_ATOMIC_DWCAS not implemented for this platform." ); \ + LFDS700_MISC_DELIBERATELY_CRASH; \ + (result) = (char unsigned) 1; \ + } +#endif + +#if( !defined LFDS700_PAL_ATOMIC_EXCHANGE ) + #define LFDS700_PAL_NO_ATOMIC_EXCHANGE + // TRD : lfds700_pal_atom_t volatile *destination, lfds700_pal_atom_t *exchange + #define LFDS700_PAL_ATOMIC_EXCHANGE( pointer_to_destination, pointer_to_exchange ) \ + { \ + LFDS700_PAL_ASSERT( !"LFDS700_PAL_ATOMIC_EXCHANGE not implemented for this platform." ); \ + LFDS700_MISC_DELIBERATELY_CRASH; \ + } +#endif + +#if( defined LFDS700_PAL_NO_COMPILER_BARRIERS ) + #define LFDS700_MISC_BARRIER_LOAD ( LFDS700_PAL_BARRIER_PROCESSOR_LOAD ) + #define LFDS700_MISC_BARRIER_STORE ( LFDS700_PAL_BARRIER_PROCESSOR_STORE ) + #define LFDS700_MISC_BARRIER_FULL ( LFDS700_PAL_BARRIER_PROCESSOR_FULL ) +#else + #define LFDS700_MISC_BARRIER_LOAD ( LFDS700_PAL_BARRIER_COMPILER_LOAD, LFDS700_PAL_BARRIER_PROCESSOR_LOAD, LFDS700_PAL_BARRIER_COMPILER_LOAD ) + #define LFDS700_MISC_BARRIER_STORE ( LFDS700_PAL_BARRIER_COMPILER_STORE, LFDS700_PAL_BARRIER_PROCESSOR_STORE, LFDS700_PAL_BARRIER_COMPILER_STORE ) + #define LFDS700_MISC_BARRIER_FULL ( LFDS700_PAL_BARRIER_COMPILER_FULL, LFDS700_PAL_BARRIER_PROCESSOR_FULL, LFDS700_PAL_BARRIER_COMPILER_FULL ) +#endif + +#define LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE LFDS700_MISC_BARRIER_LOAD + +#if( defined LFDS700_PAL_NO_ATOMIC_CAS ) + #define LFDS700_MISC_ATOMIC_SUPPORT_CAS 0 +#else + #define LFDS700_MISC_ATOMIC_SUPPORT_CAS 1 +#endif + +#if( defined LFDS700_PAL_NO_ATOMIC_DWCAS ) + #define LFDS700_MISC_ATOMIC_SUPPORT_DWCAS 0 +#else + #define LFDS700_MISC_ATOMIC_SUPPORT_DWCAS 1 +#endif + +#if( defined LFDS700_PAL_NO_ATOMIC_EXCHANGE ) + #define LFDS700_MISC_ATOMIC_SUPPORT_EXCHANGE 0 +#else + #define LFDS700_MISC_ATOMIC_SUPPORT_EXCHANGE 1 +#endif + +/***** enums *****/ +enum lfds700_misc_cas_strength +{ + // TRD : yes, weak is 1 (one) - blame GCC! + LFDS700_MISC_CAS_STRENGTH_WEAK = 1, + LFDS700_MISC_CAS_STRENGTH_STRONG = 0 +}; + +enum lfds700_misc_validity +{ + LFDS700_MISC_VALIDITY_VALID, + LFDS700_MISC_VALIDITY_INVALID_LOOP, + LFDS700_MISC_VALIDITY_INVALID_MISSING_ELEMENTS, + LFDS700_MISC_VALIDITY_INVALID_ADDITIONAL_ELEMENTS, + LFDS700_MISC_VALIDITY_INVALID_TEST_DATA, + LFDS700_MISC_VALIDITY_INVALID_ORDER +}; + +enum lfds700_misc_flag +{ + LFDS700_MISC_FLAG_LOWERED, + LFDS700_MISC_FLAG_RAISED +}; + +enum lfds700_misc_query +{ + LFDS700_MISC_QUERY_GET_EXPONENTIAL_BACKOFF_TIMESLOT_LENGTH_IN_LOOP_ITERATIONS_FOR_CAS, + LFDS700_MISC_QUERY_SET_EXPONENTIAL_BACKOFF_TIMESLOT_LENGTH_IN_LOOP_ITERATIONS_FOR_CAS, + LFDS700_MISC_QUERY_GET_EXPONENTIAL_BACKOFF_TIMESLOT_LENGTH_IN_LOOP_ITERATIONS_FOR_DWCAS, + LFDS700_MISC_QUERY_SET_EXPONENTIAL_BACKOFF_TIMESLOT_LENGTH_IN_LOOP_ITERATIONS_FOR_DWCAS, + LFDS700_MISC_QUERY_GET_BUILD_AND_VERSION_STRING +}; + +/***** struct *****/ +struct lfds700_misc_globals +{ + lfds700_pal_atom_t + exponential_backoff_timeslot_length_in_loop_iterations_for_cas, + exponential_backoff_timeslot_length_in_loop_iterations_for_dwcas; +}; + +struct lfds700_misc_prng_state +{ + lfds700_pal_uint_t + prng_state; + + // TRD : here to be on the same cache-line as prng_state, and so all are obtained from one cache-line read + lfds700_pal_atom_t + local_copy_of_global_exponential_backoff_timeslot_length_in_loop_iterations_for_cas, + local_copy_of_global_exponential_backoff_timeslot_length_in_loop_iterations_for_dwcas; +}; + +struct lfds700_misc_validation_info +{ + lfds700_pal_uint_t + min_elements, + max_elements; +}; + +/***** externs *****/ +extern struct lfds700_misc_globals + lfds700_misc_globals; + +/***** public prototypes *****/ +void lfds700_misc_library_init_valid_on_current_logical_core( void ); + // TRD : used in conjunction with the #define LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE +void lfds700_misc_library_cleanup( void ); + +static LFDS700_PAL_INLINE void lfds700_misc_force_store( void ); + +void lfds700_misc_prng_init( struct lfds700_misc_prng_state *ps ); + +void lfds700_misc_query( enum lfds700_misc_query query_type, void *query_input, void *query_output ); + +/***** public in-line functions *****/ +#pragma prefast( disable : 28112, "blah" ) + +static LFDS700_PAL_INLINE void lfds700_misc_force_store() +{ + lfds700_pal_uint_t + exchange = 0; + + lfds700_pal_atom_t volatile LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + destination; + + LFDS700_PAL_ATOMIC_EXCHANGE( &destination, &exchange ); + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_porting_abstraction_layer_compiler.h b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_porting_abstraction_layer_compiler.h new file mode 100644 index 0000000000000000000000000000000000000000..c628ddd03af42949754008ec3c5be2b54e59a6a7 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_porting_abstraction_layer_compiler.h @@ -0,0 +1,478 @@ +/****************************************************************************/ +#if( defined __GNUC__ ) + // TRD : makes checking GCC versions much tidier + #define LFDS700_PAL_GCC_VERSION ( __GNUC__ * 100 + __GNUC_MINOR__ * 10 + __GNUC_PATCHLEVEL__ ) +#endif + + + + + +/****************************************************************************/ +#if( defined _MSC_VER && _MSC_VER >= 1400 ) + + /* TRD : MSVC 8.0 and greater + + _MSC_VER indicates Microsoft C compiler and version + - __declspec(align) requires 7.1 (1310) + - __nop requires 8.0 (1400) + - _ReadBarrier requires 8.0 (1400) + - _WriteBarrier requires 8.0 (1400) + - _ReadWriteBarrier requires 7.1 (1310) + - _InterlockedCompareExchangePointer requires 8.0 (1400) + - _InterlockedExchange requires 7.1 (1310) + - _InterlockedExchangePointer requires 8.0 (1400) + - _InterlockedCompareExchange64 requires 8.0 (1400) (seems to, docs unclear) + - _InterlockedCompareExchange128 requires 9.0 (1500) + + load/store barriers are mandatory for liblfds, which means the earliest viable version of MSCV is 1400 + strictly we could get away with 1310 and use _ReadWriteBarrier, but the difference between 1310 and 1400 is small, so WTH + + _InterlockedCompareExchange128 is needed on 64-bit platforms to provide DWCAS, but DWCAS is not mandatory, + so we check against the compiler version - remember, any unimplemented atomic will be masked by its dummy define, + so everything will compile - it just means you can't use data structures which require that atomic + */ + + #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_COMPILER + #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_compiler.h + #endif + + #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_COMPILER + + #define LFDS700_PAL_COMPILER_STRING "MSVC" + + #define LFDS700_PAL_ALIGN(alignment) __declspec( align(alignment) ) + #define LFDS700_PAL_INLINE __forceinline + + #define LFDS700_PAL_BARRIER_COMPILER_LOAD _ReadBarrier() + #define LFDS700_PAL_BARRIER_COMPILER_STORE _WriteBarrier() + #define LFDS700_PAL_BARRIER_COMPILER_FULL _ReadWriteBarrier() + + /* TRD : there are four processors to consider; + + . ARM32 (32 bit, CAS, DWCAS) (defined _M_ARM) + . Itanium (64 bit, CAS) (defined _M_IA64) + . x64 (64 bit, CAS, DWCAS) (defined _M_X64 || defined _M_AMD64) + . x86 (32 bit, CAS, DWCAS) (defined _M_IX86) + + can't find any indications of 64-bit ARM support yet + + ARM has better intrinsics than the others, as there are no-fence variants + + in theory we also have to deal with 32-bit Windows on a 64-bit platform, + and I presume we'd see the compiler properly indicate this in its macros, + but this would require that we use 32-bit atomics on the 64-bit platforms, + while keeping 64-bit cache line lengths and so on, and this is just so + wierd a thing to do these days that it's not supported + + note that _InterlockedCompareExchangePointer performs CAS on all processors + however, it is documented as being available for x86 when in fact it is not + so we have to #if for processor type and use the length specific intrinsics + */ + + #if( defined _M_ARM ) + #define LFDS700_PAL_BARRIER_PROCESSOR_LOAD __dmb( _ARM_BARRIER_ISH ) + #define LFDS700_PAL_BARRIER_PROCESSOR_STORE __dmb( _ARM_BARRIER_ISHST ) + #define LFDS700_PAL_BARRIER_PROCESSOR_FULL __dmb( _ARM_BARRIER_ISH ) + + #define LFDS700_PAL_ATOMIC_CAS( pointer_to_destination, pointer_to_compare, new_destination, cas_strength, result ) \ + { \ + lfds700_pal_atom_t \ + original_compare; \ + \ + /* LFDS700_PAL_ASSERT( (pointer_to_destination) != NULL ); */ \ + /* LFDS700_PAL_ASSERT( (pointer_to_compare) != NULL ); */ \ + /* TRD : new_destination can be any value in its range */ \ + /* TRD : cas_strength can be any value in its range */ \ + /* TRD : result can be any value in its range */ \ + \ + original_compare = (lfds700_pal_atom_t) *(pointer_to_compare); \ + \ + LFDS700_PAL_BARRIER_COMPILER_FULL; \ + *(lfds700_pal_atom_t *) (pointer_to_compare) = (lfds700_pal_atom_t) _InterlockedCompareExchange_nf( (long volatile *) (pointer_to_destination), (long) (new_destination), (long) *(pointer_to_compare) ); \ + LFDS700_PAL_BARRIER_COMPILER_FULL; \ + \ + result = (char unsigned) ( original_compare == (lfds700_pal_atom_t) *(pointer_to_compare) ); \ + } + + #define LFDS700_PAL_ATOMIC_DWCAS( pointer_to_destination, pointer_to_compare, pointer_to_new_destination, cas_strength, result ) \ + { \ + __int64 \ + original_compare; \ + \ + /* LFDS700_PAL_ASSERT( (pointer_to_destination) != NULL ); */ \ + /* LFDS700_PAL_ASSERT( (pointer_to_compare) != NULL ); */ \ + /* LFDS700_PAL_ASSERT( (pointer_to_new_destination) != NULL ); */ \ + /* TRD : cas_strength can be any value in its range */ \ + /* TRD : result can be any value in its range */ \ + \ + original_compare = *(__int64 *) (pointer_to_compare); \ + \ + LFDS700_PAL_BARRIER_COMPILER_FULL; \ + *(__int64 *) (pointer_to_compare) = _InterlockedCompareExchange64_nf( (__int64 volatile *) (pointer_to_destination), *(__int64 *) (pointer_to_new_destination), *(__int64 *) (pointer_to_compare) ); \ + LFDS700_PAL_BARRIER_COMPILER_FULL; \ + \ + result = (char unsigned) ( *(__int64 *) (pointer_to_compare) == original_compare ); \ + } + + #define LFDS700_PAL_ATOMIC_EXCHANGE( pointer_to_destination, pointer_to_exchange ) \ + { \ + /* LFDS700_PAL_ASSERT( (pointer_to_destination) != NULL ); */ \ + /* LFDS700_PAL_ASSERT( (pointer_to_exchange) != NULL ); */ \ + \ + LFDS700_PAL_BARRIER_COMPILER_FULL; \ + *(lfds700_pal_atom_t *) (pointer_to_exchange) = (lfds700_pal_atom_t) _InterlockedExchange_nf( (int long volatile *) (pointer_to_destination), (int long) *(pointer_to_exchange) ); \ + LFDS700_PAL_BARRIER_COMPILER_FULL; \ + } + #endif + + #if( defined _M_IA64 ) + #define LFDS700_PAL_BARRIER_PROCESSOR_LOAD __mf() + #define LFDS700_PAL_BARRIER_PROCESSOR_STORE __mf() + #define LFDS700_PAL_BARRIER_PROCESSOR_FULL __mf() + + #define LFDS700_PAL_ATOMIC_CAS( pointer_to_destination, pointer_to_compare, new_destination, cas_strength, result ) \ + { \ + lfds700_pal_atom_t \ + original_compare; \ + \ + /* LFDS700_PAL_ASSERT( (pointer_to_destination) != NULL ); */ \ + /* LFDS700_PAL_ASSERT( (pointer_to_compare) != NULL ); */ \ + /* TRD : new_destination can be any value in its range */ \ + /* TRD : cas_strength can be any value in its range */ \ + /* TRD : result can be any value in its range */ \ + \ + original_compare = (lfds700_pal_atom_t) *(pointer_to_compare); \ + \ + LFDS700_PAL_BARRIER_COMPILER_FULL; \ + *(lfds700_pal_atom_t *) (pointer_to_compare) = (lfds700_pal_atom_t) _InterlockedCompareExchange64_acq( (__int64 volatile *) (pointer_to_destination), (__int64) (new_destination), (__int64) *(pointer_to_compare) ); \ + LFDS700_PAL_BARRIER_COMPILER_FULL; \ + \ + result = (char unsigned) ( original_compare == (lfds700_pal_atom_t) *(pointer_to_compare) ); \ + } + + #define LFDS700_PAL_ATOMIC_EXCHANGE( pointer_to_destination, pointer_to_exchange ) \ + { \ + /* LFDS700_PAL_ASSERT( (pointer_to_destination) != NULL ); */ \ + /* LFDS700_PAL_ASSERT( (pointer_to_exchange) != NULL ); */ \ + \ + LFDS700_PAL_BARRIER_COMPILER_FULL; \ + *(lfds700_pal_atom_t *) (pointer_to_exchange) = (lfds700_pal_atom_t) _InterlockedExchange64_acq( (__int64 volatile *) (pointer_to_destination), (__int64) *(pointer_to_exchange) ); \ + LFDS700_PAL_BARRIER_COMPILER_FULL; \ + } + #endif + + #if( defined _M_X64 || defined _M_AMD64 ) + #define LFDS700_PAL_BARRIER_PROCESSOR_LOAD _mm_lfence() + #define LFDS700_PAL_BARRIER_PROCESSOR_STORE _mm_sfence() + #define LFDS700_PAL_BARRIER_PROCESSOR_FULL _mm_mfence() + + #define LFDS700_PAL_ATOMIC_CAS( pointer_to_destination, pointer_to_compare, new_destination, cas_strength, result ) \ + { \ + lfds700_pal_atom_t \ + original_compare; \ + \ + /* LFDS700_PAL_ASSERT( (pointer_to_destination) != NULL ); */ \ + /* LFDS700_PAL_ASSERT( (pointer_to_compare) != NULL ); */ \ + /* TRD : new_destination can be any value in its range */ \ + /* TRD : cas_strength can be any value in its range */ \ + /* TRD : result can be any value in its range */ \ + \ + original_compare = (lfds700_pal_atom_t) *(pointer_to_compare); \ + \ + LFDS700_PAL_BARRIER_COMPILER_FULL; \ + *(lfds700_pal_atom_t *) (pointer_to_compare) = (lfds700_pal_atom_t) _InterlockedCompareExchange64( (__int64 volatile *) (pointer_to_destination), (__int64) (new_destination), (__int64) *(pointer_to_compare) ); \ + LFDS700_PAL_BARRIER_COMPILER_FULL; \ + \ + result = (char unsigned) ( original_compare == (lfds700_pal_atom_t) *(pointer_to_compare) ); \ + } + + #if( _MSC_VER >= 1500 ) + #define LFDS700_PAL_ATOMIC_DWCAS( pointer_to_destination, pointer_to_compare, pointer_to_new_destination, cas_strength, result ) \ + { \ + /* LFDS700_PAL_ASSERT( (pointer_to_new_destination) != NULL ); */ \ + /* LFDS700_PAL_ASSERT( (pointer_to_destination) != NULL ); */ \ + /* LFDS700_PAL_ASSERT( (pointer_to_compare) != NULL ); */ \ + /* TRD : cas_strength can be any value in its range */ \ + /* TRD : result can be any value in its range */ \ + \ + LFDS700_PAL_BARRIER_COMPILER_FULL; \ + result = (char unsigned) _InterlockedCompareExchange128( (__int64 volatile *) (pointer_to_destination), (__int64) (pointer_to_new_destination[1]), (__int64) (pointer_to_new_destination[0]), (__int64 *) (pointer_to_compare) ); \ + LFDS700_PAL_BARRIER_COMPILER_FULL; \ + } + #endif + + #define LFDS700_PAL_ATOMIC_EXCHANGE( pointer_to_destination, pointer_to_exchange ) \ + { \ + /* LFDS700_PAL_ASSERT( (pointer_to_destination) != NULL ); */ \ + /* LFDS700_PAL_ASSERT( (pointer_to_exchange) != NULL ); */ \ + \ + LFDS700_PAL_BARRIER_COMPILER_FULL; \ + *(lfds700_pal_atom_t *) (pointer_to_exchange) = (lfds700_pal_atom_t) _InterlockedExchangePointer( (void * volatile *) (pointer_to_destination), (void *) *(pointer_to_exchange) ); \ + LFDS700_PAL_BARRIER_COMPILER_FULL; \ + } + #endif + + #if( defined _M_IX86 ) + #define LFDS700_PAL_BARRIER_PROCESSOR_LOAD lfds700_misc_force_store() + #define LFDS700_PAL_BARRIER_PROCESSOR_STORE lfds700_misc_force_store() + #define LFDS700_PAL_BARRIER_PROCESSOR_FULL lfds700_misc_force_store() + + #define LFDS700_PAL_ATOMIC_CAS( pointer_to_destination, pointer_to_compare, new_destination, cas_strength, result ) \ + { \ + lfds700_pal_atom_t \ + original_compare; \ + \ + /* LFDS700_PAL_ASSERT( (pointer_to_destination) != NULL ); */ \ + /* LFDS700_PAL_ASSERT( (pointer_to_compare) != NULL ); */ \ + /* TRD : new_destination can be any value in its range */ \ + /* TRD : cas_strength can be any value in its range */ \ + /* TRD : result can be any value in its range */ \ + \ + original_compare = (lfds700_pal_atom_t) *(pointer_to_compare); \ + \ + LFDS700_PAL_BARRIER_COMPILER_FULL; \ + *(lfds700_pal_atom_t *) (pointer_to_compare) = (lfds700_pal_atom_t) _InterlockedCompareExchange( (long volatile *) (pointer_to_destination), (long) (new_destination), (long) *(pointer_to_compare) ); \ + LFDS700_PAL_BARRIER_COMPILER_FULL; \ + \ + result = (char unsigned) ( original_compare == (lfds700_pal_atom_t) *(pointer_to_compare) ); \ + } + + #define LFDS700_PAL_ATOMIC_DWCAS( pointer_to_destination, pointer_to_compare, pointer_to_new_destination, cas_strength, result ) \ + { \ + __int64 \ + original_compare; \ + \ + /* LFDS700_PAL_ASSERT( (pointer_to_destination) != NULL ); */ \ + /* LFDS700_PAL_ASSERT( (pointer_to_compare) != NULL ); */ \ + /* LFDS700_PAL_ASSERT( (pointer_to_new_destination) != NULL ); */ \ + /* TRD : cas_strength can be any value in its range */ \ + /* TRD : result can be any value in its range */ \ + \ + original_compare = *(__int64 *) (pointer_to_compare); \ + \ + LFDS700_PAL_BARRIER_COMPILER_FULL; \ + *(__int64 *) (pointer_to_compare) = _InterlockedCompareExchange64( (__int64 volatile *) (pointer_to_destination), *(__int64 *) (pointer_to_new_destination), *(__int64 *) (pointer_to_compare) ); \ + LFDS700_PAL_BARRIER_COMPILER_FULL; \ + \ + result = (char unsigned) ( *(__int64 *) (pointer_to_compare) == original_compare ); \ + } + + #define LFDS700_PAL_ATOMIC_EXCHANGE( pointer_to_destination, pointer_to_exchange ) \ + { \ + /* LFDS700_PAL_ASSERT( (pointer_to_destination) != NULL ); */ \ + /* LFDS700_PAL_ASSERT( (pointer_to_exchange) != NULL ); */ \ + \ + LFDS700_PAL_BARRIER_COMPILER_FULL; \ + *(lfds700_pal_atom_t *) (pointer_to_exchange) = (lfds700_pal_atom_t) _InterlockedExchange( (int long volatile *) (pointer_to_destination), (int long) *(pointer_to_exchange) ); \ + LFDS700_PAL_BARRIER_COMPILER_FULL; \ + } + #endif + +#endif + + + + + +/****************************************************************************/ +#if( defined __GNUC__ && LFDS700_PAL_GCC_VERSION >= 412 && LFDS700_PAL_GCC_VERSION < 473 ) + + /* TRD : GCC 4.1.2 up to 4.7.3 + + __GNUC__ indicates GCC + LFDS700_PAL_GCC_VERSION indicates which version + - __sync_synchronize requires 4.1.2 + + GCC 4.1.2 introduced the __sync_*() atomic intrinsics + */ + + #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_COMPILER + #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_compiler.h + #endif + + #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_COMPILER + + #define LFDS700_PAL_COMPILER_STRING "GCC < 4.7.3" + + #define LFDS700_PAL_ALIGN(alignment) __attribute__( (aligned(alignment)) ) + #define LFDS700_PAL_INLINE inline + + static LFDS700_PAL_INLINE void lfds700_pal_barrier_compiler( void ) + { + __asm__ __volatile__ ( "" : : : "memory" ); + } + + #define LFDS700_PAL_BARRIER_COMPILER_LOAD lfds700_pal_barrier_compiler() + #define LFDS700_PAL_BARRIER_COMPILER_STORE lfds700_pal_barrier_compiler() + #define LFDS700_PAL_BARRIER_COMPILER_FULL lfds700_pal_barrier_compiler() + + #define LFDS700_PAL_BARRIER_PROCESSOR_LOAD __sync_synchronize() + #define LFDS700_PAL_BARRIER_PROCESSOR_STORE __sync_synchronize() + #define LFDS700_PAL_BARRIER_PROCESSOR_FULL __sync_synchronize() + + #define LFDS700_PAL_ATOMIC_CAS( pointer_to_destination, pointer_to_compare, new_destination, cas_strength, result ) \ + { \ + lfds700_pal_atom_t \ + original_compare; \ + \ + /* LFDS700_PAL_ASSERT( (pointer_to_destination) != NULL ); */ \ + /* LFDS700_PAL_ASSERT( (pointer_to_compare) != NULL ); */ \ + /* TRD : new_destination can be any value in its range */ \ + /* TRD : cas_strength can be any value in its range */ \ + /* TRD : result can be any value in its range */ \ + \ + original_compare = (lfds700_pal_atom_t) *(pointer_to_compare); \ + \ + LFDS700_PAL_BARRIER_COMPILER_FULL; \ + *(pointer_to_compare) = __sync_val_compare_and_swap( pointer_to_destination, *(pointer_to_compare), new_destination ); \ + LFDS700_PAL_BARRIER_COMPILER_FULL; \ + \ + result = (unsigned char) ( original_compare == (lfds700_pal_atom_t) *(pointer_to_compare) ); \ + } + + // TRD : ARM and x86 have DWCAS which we can get via GCC intrinsics + #if( defined __arm__ || defined __i686__ || defined __i586__ || defined __i486__ ) + #define LFDS700_PAL_ATOMIC_DWCAS( pointer_to_destination, pointer_to_compare, pointer_to_new_destination, cas_strength, result ) \ + { \ + int long long unsigned \ + original_destination; \ + \ + /* LFDS700_PAL_ASSERT( (pointer_to_destination) != NULL ); */ \ + /* LFDS700_PAL_ASSERT( (pointer_to_compare) != NULL ); */ \ + /* LFDS700_PAL_ASSERT( (pointer_to_new_destination) != NULL ); */ \ + /* TRD : cas_strength can be any value in its range */ \ + /* TRD : result can be any value in its range */ \ + \ + LFDS700_PAL_BARRIER_COMPILER_FULL; \ + original_destination = __sync_val_compare_and_swap( (int long long unsigned volatile *) (pointer_to_destination), *(int long long unsigned *) (pointer_to_compare), *(int long long unsigned *) (pointer_to_new_destination) ); \ + LFDS700_PAL_BARRIER_COMPILER_FULL; \ + \ + result = (char unsigned) ( original_destination == *(int long long unsigned *) (pointer_to_compare) ); \ + \ + *(int long long unsigned *) (pointer_to_compare) = original_destination; \ + } + #endif + + #define LFDS700_PAL_ATOMIC_EXCHANGE( pointer_to_destination, pointer_to_exchange ) \ + { \ + /* LFDS700_PAL_ASSERT( (pointer_to_destination) != NULL ); */ \ + /* LFDS700_PAL_ASSERT( (pointer_to_exchange) != NULL ); */ \ + \ + LFDS700_PAL_BARRIER_COMPILER_FULL; \ + *( (lfds700_pal_atom_t *) pointer_to_exchange) = (lfds700_pal_atom_t) __sync_lock_test_and_set( pointer_to_destination, *(pointer_to_exchange) ); \ + LFDS700_PAL_BARRIER_COMPILER_FULL; \ + } + +#endif + + + + + +/****************************************************************************/ +#if( defined __GNUC__ && LFDS700_PAL_GCC_VERSION >= 473 ) + + /* TRD : GCC 4.7.3 and greater + + __GNUC__ indicates GCC + LFDS700_PAL_GCC_VERSION indicates which version + - __atomic_thread_fence requires 4.7.3 + + GCC 4.7.3 introduced the better __atomic*() atomic intrinsics + */ + + #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_COMPILER + #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_compiler.h + #endif + + #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_COMPILER + + #define LFDS700_PAL_COMPILER_STRING "GCC >= 4.7.3" + + #define LFDS700_PAL_ALIGN(alignment) __attribute__( (aligned(alignment)) ) + #define LFDS700_PAL_INLINE inline + + // TRD : GCC >= 4.7.3 compiler barriers are built into the intrinsics + #define LFDS700_PAL_NO_COMPILER_BARRIERS + + #define LFDS700_PAL_BARRIER_PROCESSOR_LOAD __atomic_thread_fence( __ATOMIC_ACQUIRE ) + #define LFDS700_PAL_BARRIER_PROCESSOR_STORE __atomic_thread_fence( __ATOMIC_RELEASE ) + #define LFDS700_PAL_BARRIER_PROCESSOR_FULL __atomic_thread_fence( __ATOMIC_ACQ_REL ) + + #define LFDS700_PAL_ATOMIC_CAS( pointer_to_destination, pointer_to_compare, new_destination, cas_strength, result ) \ + { \ + /* LFDS700_PAL_ASSERT( (pointer_to_destination) != NULL ); */ \ + /* LFDS700_PAL_ASSERT( (pointer_to_compare) != NULL ); */ \ + /* TRD : new_destination can be any value in its range */ \ + /* TRD : cas_strength can be any value in its range */ \ + /* TRD : result can be any value in its range */ \ + \ + result = (char unsigned) __atomic_compare_exchange_n( pointer_to_destination, (void *) (pointer_to_compare), (new_destination), (cas_strength), __ATOMIC_RELAXED, __ATOMIC_RELAXED ); \ + } + + // TRD : ARM and x86 have DWCAS which we can get via GCC intrinsics + #if( defined __arm__ || defined __i686__ || defined __i586__ || defined __i486__ ) + #define LFDS700_PAL_ATOMIC_DWCAS( pointer_to_destination, pointer_to_compare, pointer_to_new_destination, cas_strength, result ) \ + { \ + /* LFDS700_PAL_ASSERT( (pointer_to_destination) != NULL ); */ \ + /* LFDS700_PAL_ASSERT( (pointer_to_compare) != NULL ); */ \ + /* LFDS700_PAL_ASSERT( (pointer_to_new_destination) != NULL ); */ \ + /* TRD : cas_strength can be any value in its range */ \ + /* TRD : result can be any value in its range */ \ + \ + (result) = (char unsigned) __atomic_compare_exchange_n( (int long long unsigned volatile *) (pointer_to_destination), (int long long unsigned *) (pointer_to_compare), *(int long long unsigned *) (pointer_to_new_destination), (cas_strength), __ATOMIC_RELAXED, __ATOMIC_RELAXED ); \ + } + #endif + + #if( defined __x86_64__ ) + /* TRD : __GNUC__ indicates GCC + - __asm__ requires GCC + - __volatile__ requires GCC + __x86_64__ indicates x64 + - cmpxchg16b requires x64 + + On 64 bit platforms, unsigned long long int is 64 bit, so we must manually use cmpxchg16b, + as __sync_val_compare_and_swap() will only emit cmpxchg8b + */ + + // TRD : lfds700_pal_atom_t volatile (*destination)[2], lfds700_pal_atom_t (*compare)[2], lfds700_pal_atom_t (*new_destination)[2], enum lfds700_misc_cas_strength cas_strength, char unsigned result + + #define LFDS700_PAL_ATOMIC_DWCAS( pointer_to_destination, pointer_to_compare, pointer_to_new_destination, cas_strength, result ) \ + { \ + /* LFDS700_PAL_ASSERT( (pointer_to_destination) != NULL ); */ \ + /* LFDS700_PAL_ASSERT( (pointer_to_compare) != NULL ); */ \ + /* LFDS700_PAL_ASSERT( (pointer_to_new_destination) != NULL ); */ \ + /* TRD : cas_strength can be any value in its range */ \ + /* TRD : result can be any value in its range */ \ + \ + (result) = 0; \ + \ + __asm__ __volatile__ \ + ( \ + "lock;" /* make cmpxchg16b atomic */ \ + "cmpxchg16b %0;" /* cmpxchg16b sets ZF on success */ \ + "setz %3;" /* if ZF set, set result to 1 */ \ + \ + /* output */ \ + : "+m" (*pointer_to_destination), "+a" ((pointer_to_compare)[0]), "+d" ((pointer_to_compare)[1]), "=q" (result) \ + \ + /* input */ \ + : "b" ((pointer_to_new_destination)[0]), "c" ((pointer_to_new_destination)[1]) \ + \ + /* clobbered */ \ + : "cc", "memory" \ + ); \ + } + #endif + + #define LFDS700_PAL_ATOMIC_EXCHANGE( pointer_to_destination, pointer_to_exchange ) \ + { \ + /* LFDS700_PAL_ASSERT( (pointer_to_destination) != NULL ); */ \ + /* LFDS700_PAL_ASSERT( (pointer_to_exchange) != NULL ); */ \ + \ + *(pointer_to_exchange) = __atomic_exchange_n( (pointer_to_destination), *(pointer_to_exchange), __ATOMIC_RELAXED ); \ + } + +#endif + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_porting_abstraction_layer_operating_system.h b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_porting_abstraction_layer_operating_system.h new file mode 100644 index 0000000000000000000000000000000000000000..0c1eba628a5a33553240c645810687114871a746 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_porting_abstraction_layer_operating_system.h @@ -0,0 +1,133 @@ +/****************************************************************************/ +#if( defined _MSC_VER ) + /* TRD : MSVC compiler + + an unfortunately necessary hack for MSVC + MSVC only defines __STDC__ if /Za is given, where /Za turns off MSVC C extensions - + which prevents Windows header files from compiling. + */ + + #define __STDC__ 1 + #define __STDC_HOSTED__ 1 +#endif + + + + + +/****************************************************************************/ +#if( defined _MSC_VER && _MSC_VER >= 1400 && __STDC_HOSTED__ == 1 && !defined _KERNEL_MODE ) + + // TRD : MSVC + + #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_OPERATING_SYSTEM + #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_operating_system.h + #endif + + #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_OPERATING_SYSTEM + + #include <assert.h> + + #define LFDS700_PAL_OS_STRING "Windows" + #define LFDS700_PAL_ASSERT( expression ) assert( expression ) + +#endif + + + + + +/****************************************************************************/ +#if( defined _MSC_VER && _MSC_VER >= 1400 && defined __STDC_HOSTED__ && __STDC_HOSTED__ == 1 && defined _WIN32 && defined _KERNEL_MODE ) + + // TRD : MSVC, Windows kernel-mode + + #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_OPERATING_SYSTEM + #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_operating_system.h + #endif + + #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_OPERATING_SYSTEM + + #include <assert.h> + #include <intrin.h> + + #define LFDS700_PAL_OS_STRING "Windows" + #define LFDS700_PAL_ASSERT( expression ) assert( expression ) + +#endif + + + + + +/****************************************************************************/ +#if( defined __GNUC__ && __STDC_HOSTED__ == 1 && !(defined __linux__ && defined _KERNEL_MODE) ) + + // TRD : GCC, hosted implementation (except for Linux kernel mode) + + #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_OPERATING_SYSTEM + #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_operating_system.h + #endif + + #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_OPERATING_SYSTEM + + #include <assert.h> + + #define LFDS700_PAL_OS_STRING "Embedded (hosted)" + #define LFDS700_PAL_ASSERT( expression ) assert( expression ) + +#endif + + + + + +/****************************************************************************/ +#if( defined __GNUC__ && __STDC_HOSTED__ == 0 ) + + // TRD : GCC, freestanding or bare implementation + + #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_OPERATING_SYSTEM + #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_operating_system.h + #endif + + #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_OPERATING_SYSTEM + + #define LFDS700_PAL_OS_STRING "Embedded (freestanding/bare)" + #define LFDS700_PAL_ASSERT( expression ) + +#endif + + + + + +/****************************************************************************/ +#if( defined __GNUC__ && defined __linux__ && defined _KERNEL_MODE ) + + // TRD : GCC, Linux kernel-mode + + #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_OPERATING_SYSTEM + #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_operating_system.h + #endif + + #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_OPERATING_SYSTEM + + #include <linux/module.h> + + #define LFDS700_PAL_OS_STRING "Linux" + #define LFDS700_PAL_ASSERT( expression ) BUG_ON( expression ) + +#endif + + + + + +/****************************************************************************/ +#if( !defined LFDS700_PAL_PORTING_ABSTRACTION_LAYER_OPERATING_SYSTEM ) + + #error No matching porting abstraction layer in lfds700_porting_abstraction_layer_operating_system.h + +#endif + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_porting_abstraction_layer_processor.h b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_porting_abstraction_layer_processor.h new file mode 100644 index 0000000000000000000000000000000000000000..1e81c0eae27234127e6dffabeb8ac8fa7cfda941 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_porting_abstraction_layer_processor.h @@ -0,0 +1,544 @@ +/****************************************************************************/ +#if( defined _MSC_VER && _MSC_VER >= 1400 && defined _M_IX86 ) + + /* TRD : MSVC, x86 + x86 is CAS, so isolation is cache-line length + */ + + #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h + #endif + + #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + + typedef int long unsigned lfds700_pal_atom_t; + typedef int long unsigned lfds700_pal_uint_t; + + #define LFDS700_PAL_PROCESSOR_STRING "x86" + + #define LFDS700_PAL_ALIGN_SINGLE_POINTER 4 + #define LFDS700_PAL_ALIGN_DOUBLE_POINTER 8 + + #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES 32 + #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES 32 + +#endif + + + + + +/****************************************************************************/ +#if( defined _MSC_VER && _MSC_VER >= 1400 && (defined _M_X64 || defined _M_AMD64) ) + + /* TRD : MSVC, x64 + x64 is CAS, so isolation is cache-line length + */ + + #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h + #endif + + #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + + typedef int long long unsigned lfds700_pal_atom_t; + typedef int long long unsigned lfds700_pal_uint_t; + + #define LFDS700_PAL_PROCESSOR_STRING "x64" + + #define LFDS700_PAL_ALIGN_SINGLE_POINTER 8 + #define LFDS700_PAL_ALIGN_DOUBLE_POINTER 16 + + #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES 64 + #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES 64 + +#endif + + + + + +/****************************************************************************/ +#if( defined _MSC_VER && _MSC_VER >= 1400 && defined _M_IA64 ) + + /* TRD : MSVC, Itanium + IA64 is CAS, so isolation is cache-line length + */ + + #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h + #endif + + #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + + typedef int long long unsigned lfds700_pal_atom_t; + typedef int long long unsigned lfds700_pal_uint_t; + + #define LFDS700_PAL_PROCESSOR_STRING "IA64" + + #define LFDS700_PAL_ALIGN_SINGLE_POINTER 8 + #define LFDS700_PAL_ALIGN_DOUBLE_POINTER 16 + + #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES 64 + #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES 64 + +#endif + + + + + + /****************************************************************************/ +#if( defined _MSC_VER && _MSC_VER >= 1400 && defined _M_ARM ) + + /* TRD : MSVC, 32-bit ARM + + ARM is LL/SC and uses a reservation granule of 8 to 2048 bytes + so the isolation value used here is worst-case - be sure to set + this correctly, otherwise structures are painfully large + */ + +#ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR +#error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h +#endif + +#define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + + typedef int long unsigned lfds700_pal_atom_t; + typedef int long unsigned lfds700_pal_uint_t; + +#define LFDS700_PAL_PROCESSOR_STRING "ARM (32-bit)" + +#define LFDS700_PAL_ALIGN_SINGLE_POINTER 4 +#define LFDS700_PAL_ALIGN_DOUBLE_POINTER 8 + +#define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES 32 +#define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES 2048 + +#endif + + + + + +/****************************************************************************/ +#if( defined __GNUC__ && defined __arm__ ) + + /* TRD : GCC, 32-bit ARM + + ARM is LL/SC and uses a reservation granule of 8 to 2048 bytes + so the isolation value used here is worst-case - be sure to set + this correctly, otherwise structures are painfully large + */ + + #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h + #endif + + #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + + typedef int long unsigned lfds700_pal_atom_t; + typedef int long unsigned lfds700_pal_uint_t; + + #define LFDS700_PAL_PROCESSOR_STRING "ARM (32-bit)" + + #define LFDS700_PAL_ALIGN_SINGLE_POINTER 4 + #define LFDS700_PAL_ALIGN_DOUBLE_POINTER 8 + + #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES 32 + #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES 2048 + +#endif + + + + + +/****************************************************************************/ +#if( defined __GNUC__ && defined __aarch64__ ) + + /* TRD : GCC, 64-bit ARM + + ARM is LL/SC and uses a reservation granule of 8 to 2048 bytes + so the isolation value used here is worst-case - be sure to set + this correctly, otherwise structures are painfully large + */ + + #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h + #endif + + #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + + typedef int long long unsigned lfds700_pal_atom_t; + typedef int long long unsigned lfds700_pal_uint_t; + + #define LFDS700_PAL_PROCESSOR_STRING "ARM (64-bit)" + + #define LFDS700_PAL_ALIGN_SINGLE_POINTER 8 + #define LFDS700_PAL_ALIGN_DOUBLE_POINTER 16 + + #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES 64 + #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES 2048 + +#endif + + + + + +/****************************************************************************/ +#if( defined __GNUC__ && (defined __i686__ || defined __i586__ || defined __i486__) ) + + /* TRD : GCC, x86 + + x86 is CAS, so isolation is cache-line length + */ + + #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h + #endif + + #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + + typedef int long unsigned lfds700_pal_atom_t; + typedef int long unsigned lfds700_pal_uint_t; + + #define LFDS700_PAL_PROCESSOR_STRING "x86" + + #define LFDS700_PAL_ALIGN_SINGLE_POINTER 4 + #define LFDS700_PAL_ALIGN_DOUBLE_POINTER 8 + + #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES 32 + #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES 32 + +#endif + + + + + +/****************************************************************************/ +#if( defined __GNUC__ && defined __x86_64__ ) + + /* TRD : GCC, x86 + + x64 is CAS, so isolation is cache-line length + */ + + #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h + #endif + + #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + + typedef int long long unsigned lfds700_pal_atom_t; + typedef int long long unsigned lfds700_pal_uint_t; + + #define LFDS700_PAL_PROCESSOR_STRING "x64" + + #define LFDS700_PAL_ALIGN_SINGLE_POINTER 8 + #define LFDS700_PAL_ALIGN_DOUBLE_POINTER 16 + + #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES 64 + #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES 64 + +#endif + + + + + +/****************************************************************************/ +#if( defined __GNUC__ && defined __alpha__ ) + + /* TRD : GCC, alpha + + alpha is LL/SC, but there is only one reservation per processor, + so the isolation value used here is cache-line length + */ + + #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h + #endif + + #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + + typedef int long unsigned lfds700_pal_atom_t; + typedef int long unsigned lfds700_pal_uint_t; + + #define LFDS700_PAL_PROCESSOR_STRING "alpha" + + #define LFDS700_PAL_ALIGN_SINGLE_POINTER 8 + #define LFDS700_PAL_ALIGN_DOUBLE_POINTER 16 + + #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES 32 + #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES 64 + +#endif + + + + + +/****************************************************************************/ +#if( defined __GNUC__ && defined __ia64__ ) + + /* TRD : GCC, Itanium + + Itanium is CAS, so isolation is cache-line length + */ + + #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h + #endif + + #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + + typedef int long long unsigned lfds700_pal_atom_t; + typedef int long long unsigned lfds700_pal_uint_t; + + #define LFDS700_PAL_PROCESSOR_STRING "IA64" + + #define LFDS700_PAL_ALIGN_SINGLE_POINTER 8 + #define LFDS700_PAL_ALIGN_DOUBLE_POINTER 16 + + #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES 64 + #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES 64 + +#endif + + + + + +/****************************************************************************/ +#if( defined __GNUC__ && defined __mips__ ) + + /* TRD : GCC, MIPS (32-bit) + + MIPS is LL/SC, but there is only one reservation per processor, + so the isolation value used here is cache-line length + */ + + #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h + #endif + + #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + + typedef int long unsigned lfds700_pal_atom_t; + typedef int long unsigned lfds700_pal_uint_t; + + #define LFDS700_PAL_PROCESSOR_STRING "MIPS (32-bit)" + + #define LFDS700_PAL_ALIGN_SINGLE_POINTER 4 + #define LFDS700_PAL_ALIGN_DOUBLE_POINTER 8 + + #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES 32 + #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES 32 + +#endif + + + + + +/****************************************************************************/ +#if( defined __GNUC__ && defined __mips64 ) + + /* TRD : GCC, MIPS (64-bit) + + MIPS is LL/SC, but there is only one reservation per processor, + so the isolation value used here is cache-line length + */ + + #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h + #endif + + #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + + typedef int long long unsigned lfds700_pal_atom_t; + typedef int long long unsigned lfds700_pal_uint_t; + + #define LFDS700_PAL_PROCESSOR_STRING "MIPS (64-bit)" + + #define LFDS700_PAL_ALIGN_SINGLE_POINTER 8 + #define LFDS700_PAL_ALIGN_DOUBLE_POINTER 16 + + #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES 64 + #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES 64 + +#endif + + + + + +/****************************************************************************/ +#if( defined __GNUC__ && defined __ppc__ ) + + /* TRD : GCC, POWERPC (32-bit) + + POWERPC is LL/SC and uses a reservation granule but I can't find + canonical documentation for its size - 128 bytes seems to be the + largest value I've found + */ + + #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h + #endif + + #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + + typedef int long unsigned lfds700_pal_atom_t; + typedef int long unsigned lfds700_pal_uint_t; + + #define LFDS700_PAL_PROCESSOR_STRING "POWERPC (32-bit)" + + #define LFDS700_PAL_ALIGN_SINGLE_POINTER 4 + #define LFDS700_PAL_ALIGN_DOUBLE_POINTER 8 + + #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES 32 + #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES 128 + +#endif + + + + + +/****************************************************************************/ +#if( defined __GNUC__ && defined __ppc64__ ) + + /* TRD : GCC, POWERPC (64-bit) + + POWERPC is LL/SC and uses a reservation granule but I can't find + canonical documentation for its size - 128 bytes seems to be the + largest value I've found + */ + + #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h + #endif + + #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + + typedef int long long unsigned lfds700_pal_atom_t; + typedef int long long unsigned lfds700_pal_uint_t; + + #define LFDS700_PAL_PROCESSOR_STRING "POWERPC (64-bit)" + + #define LFDS700_PAL_ALIGN_SINGLE_POINTER 8 + #define LFDS700_PAL_ALIGN_DOUBLE_POINTER 16 + + #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES 64 + #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES 128 + +#endif + + + + + +/****************************************************************************/ +#if( defined __GNUC__ && defined __sparc__ && !defined __sparc_v9__ ) + + /* TRD : GCC, SPARC (32-bit) + + SPARC is CAS, so isolation is cache-line length + */ + + #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h + #endif + + #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + + typedef int long unsigned lfds700_pal_atom_t; + typedef int long unsigned lfds700_pal_uint_t; + + #define LFDS700_PAL_PROCESSOR_STRING "SPARC (32-bit)" + + #define LFDS700_PAL_ALIGN_SINGLE_POINTER 4 + #define LFDS700_PAL_ALIGN_DOUBLE_POINTER 8 + + #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES 32 + #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES 32 + +#endif + + + + + +/****************************************************************************/ +#if( defined __GNUC__ && defined __sparc__ && defined __sparc_v9__ ) + + /* TRD : GCC, SPARC (64-bit) + + SPARC is CAS, so isolation is cache-line length + */ + + #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h + #endif + + #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + + typedef int long long unsigned lfds700_pal_atom_t; + typedef int long long unsigned lfds700_pal_uint_t; + + #define LFDS700_PAL_PROCESSOR_STRING "SPARC (64-bit)" + + #define LFDS700_PAL_ALIGN_SINGLE_POINTER 8 + #define LFDS700_PAL_ALIGN_DOUBLE_POINTER 16 + + #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES 64 + #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES 64 + +#endif + + + + + +/****************************************************************************/ +#if( defined __GNUC__ && defined __m68k__ ) + + /* TRD : GCC, 680x0 + + 680x0 is CAS, so isolation is cache-line length + */ + + #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h + #endif + + #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR + + typedef int long unsigned lfds700_pal_atom_t; + typedef int long unsigned lfds700_pal_uint_t; + + #define LFDS700_PAL_PROCESSOR_STRING "680x0" + + #define LFDS700_PAL_ALIGN_SINGLE_POINTER 4 + #define LFDS700_PAL_ALIGN_DOUBLE_POINTER 8 + + #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES 32 + #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES 32 + +#endif + + + + + +/****************************************************************************/ +#if( !defined LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR ) + + #error No matching porting abstraction layer in lfds700_porting_abstraction_layer_processor.h + +#endif + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_queue.h b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_queue.h new file mode 100644 index 0000000000000000000000000000000000000000..025b0673e991852ab8476d5376a37ede95e11228 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_queue.h @@ -0,0 +1,60 @@ +/***** defines *****/ +#define LFDS700_QUEUE_GET_KEY_FROM_ELEMENT( queue_element ) ( (queue_element).key ) +#define LFDS700_QUEUE_SET_KEY_IN_ELEMENT( queue_element, new_key ) ( (queue_element).key = (void *) (lfds700_pal_uint_t) (new_key) ) +#define LFDS700_QUEUE_GET_VALUE_FROM_ELEMENT( queue_element ) ( (queue_element).value ) +#define LFDS700_QUEUE_SET_VALUE_IN_ELEMENT( queue_element, new_value ) ( (queue_element).value = (void *) (lfds700_pal_uint_t) (new_value) ) +#define LFDS700_QUEUE_GET_USER_STATE_FROM_STATE( queue_state ) ( (queue_state).user_state ) + +/***** enums *****/ +enum lfds700_queue_query +{ + LFDS700_QUEUE_QUERY_SINGLETHREADED_GET_COUNT, + LFDS700_QUEUE_QUERY_SINGLETHREADED_VALIDATE +}; + +/***** structures *****/ +struct lfds700_queue_element +{ + struct lfds700_queue_element LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + *volatile next[PAC_SIZE]; + + void LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + *key; + + void + *value; +}; + +struct lfds700_queue_state +{ + struct lfds700_queue_element LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + *volatile enqueue[PAC_SIZE], + *volatile dequeue[PAC_SIZE]; + + void LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + *user_state; +}; + +/***** public prototypes *****/ +void lfds700_queue_init_valid_on_current_logical_core( struct lfds700_queue_state *qs, + struct lfds700_queue_element *qe_dummy, + struct lfds700_misc_prng_state *ps, + void *user_state ); + // TRD : used in conjunction with the #define LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE + +void lfds700_queue_cleanup( struct lfds700_queue_state *qs, + void (*element_cleanup_callback)(struct lfds700_queue_state *qs, struct lfds700_queue_element *qe, enum lfds700_misc_flag dummy_element_flag) ); + +void lfds700_queue_enqueue( struct lfds700_queue_state *qs, + struct lfds700_queue_element *qe, + struct lfds700_misc_prng_state *ps ); + +int lfds700_queue_dequeue( struct lfds700_queue_state *qs, + struct lfds700_queue_element **qe, + struct lfds700_misc_prng_state *ps ); + +void lfds700_queue_query( struct lfds700_queue_state *qs, + enum lfds700_queue_query query_type, + void *query_input, + void *query_output ); + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_queue_bounded_singleconsumer_singleproducer.h b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_queue_bounded_singleconsumer_singleproducer.h new file mode 100644 index 0000000000000000000000000000000000000000..3b090e1d450dad72281a2d11175bbbdd306c27ad --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_queue_bounded_singleconsumer_singleproducer.h @@ -0,0 +1,59 @@ +/***** defines *****/ +#define LFDS700_QUEUE_BSS_GET_USER_STATE_FROM_STATE( queue_bss_state ) ( (queue_bss_state).user_state ) + +/***** enums *****/ +enum lfds700_queue_bss_query +{ + LFDS700_QUEUE_BSS_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, + LFDS700_QUEUE_BSS_QUERY_VALIDATE +}; + +/***** structures *****/ +struct lfds700_queue_bss_element +{ + void + *volatile key, + *volatile value; +}; + +struct lfds700_queue_bss_state +{ + lfds700_pal_uint_t + number_elements, + mask; + + lfds700_pal_uint_t volatile + read_index, + write_index; + + struct lfds700_queue_bss_element + *element_array; + + void + *user_state; +}; + +/***** public prototypes *****/ +void lfds700_queue_bss_init_valid_on_current_logical_core( struct lfds700_queue_bss_state *qbsss, + struct lfds700_queue_bss_element *element_array, + lfds700_pal_uint_t number_elements, + void *user_state ); + // TRD : number_elements must be a positive integer power of 2 + // TRD : used in conjunction with the #define LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE + +void lfds700_queue_bss_cleanup( struct lfds700_queue_bss_state *qbsss, + void (*element_cleanup_callback)(struct lfds700_queue_bss_state *qbsss, void *key, void *value) ); + +int lfds700_queue_bss_enqueue( struct lfds700_queue_bss_state *qbsss, + void *key, + void *value ); + +int lfds700_queue_bss_dequeue( struct lfds700_queue_bss_state *qbsss, + void **key, + void **value ); + +void lfds700_queue_bss_query( struct lfds700_queue_bss_state *qbsss, + enum lfds700_queue_bss_query query_type, + void *query_input, + void *query_output ); + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_ringbuffer.h b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_ringbuffer.h new file mode 100644 index 0000000000000000000000000000000000000000..fbb21d2be4d4cba782e9c9c7cb7468d1220cba69 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_ringbuffer.h @@ -0,0 +1,69 @@ +/***** enums *****/ +#define LFDS700_RINGBUFFER_GET_USER_STATE_FROM_STATE( ringbuffer_state ) ( (ringbuffer_state).user_state ) + +/***** enums *****/ +enum lfds700_ringbuffer_query +{ + LFDS700_RINGBUFFER_QUERY_SINGLETHREADED_GET_COUNT, + LFDS700_RINGBUFFER_QUERY_SINGLETHREADED_VALIDATE +}; + +/***** structures *****/ +struct lfds700_ringbuffer_element +{ + struct lfds700_freelist_element LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + fe; + + struct lfds700_queue_element LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + qe; + + struct lfds700_queue_element + *qe_use; // TRD : hack for 7.0.0; we need a new queue with no dummy element + + void + *key, + *value; +}; + +struct lfds700_ringbuffer_state +{ + struct lfds700_freelist_state LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + fs; + + struct lfds700_queue_state LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + qs; + + void + (*element_cleanup_callback)( struct lfds700_ringbuffer_state *rs, void *key, void *value, enum lfds700_misc_flag unread_flag ), + *user_state; +}; + +/***** public prototypes *****/ +void lfds700_ringbuffer_init_valid_on_current_logical_core( struct lfds700_ringbuffer_state *rs, + struct lfds700_ringbuffer_element *re_array_inc_dummy, + lfds700_pal_uint_t number_elements, + struct lfds700_misc_prng_state *ps, + void *user_state ); + // TRD : used in conjunction with the #define LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE + +void lfds700_ringbuffer_cleanup( struct lfds700_ringbuffer_state *rs, + void (*element_cleanup_callback)(struct lfds700_ringbuffer_state *rs, void *key, void *value, enum lfds700_misc_flag unread_flag) ); + +int lfds700_ringbuffer_read( struct lfds700_ringbuffer_state *rs, + void **key, + void **value, + struct lfds700_misc_prng_state *ps ); + +void lfds700_ringbuffer_write( struct lfds700_ringbuffer_state *rs, + void *key, + void *value, + enum lfds700_misc_flag *overwrite_occurred_flag, + void **overwritten_key, + void **overwritten_value, + struct lfds700_misc_prng_state *ps ); + +void lfds700_ringbuffer_query( struct lfds700_ringbuffer_state *rs, + enum lfds700_ringbuffer_query query_type, + void *query_input, + void *query_output ); + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_stack.h b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_stack.h new file mode 100644 index 0000000000000000000000000000000000000000..3faed80308a41bb5d2072a9b5f0f9df4f584fc15 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_stack.h @@ -0,0 +1,55 @@ +/***** defines *****/ +#define LFDS700_STACK_GET_KEY_FROM_ELEMENT( stack_element ) ( (stack_element).key ) +#define LFDS700_STACK_SET_KEY_IN_ELEMENT( stack_element, new_key ) ( (stack_element).key = (void *) (lfds700_pal_uint_t) (new_key) ) +#define LFDS700_STACK_GET_VALUE_FROM_ELEMENT( stack_element ) ( (stack_element).value ) +#define LFDS700_STACK_SET_VALUE_IN_ELEMENT( stack_element, new_value ) ( (stack_element).value = (void *) (lfds700_pal_uint_t) (new_value) ) +#define LFDS700_STACK_GET_USER_STATE_FROM_STATE( stack_state ) ( (stack_state).user_state ) + +/***** enums *****/ +enum lfds700_stack_query +{ + LFDS700_STACK_QUERY_SINGLETHREADED_GET_COUNT, + LFDS700_STACK_QUERY_SINGLETHREADED_VALIDATE +}; + +/***** structures *****/ +struct lfds700_stack_element +{ + struct lfds700_stack_element + *volatile next; + + void + *key, + *value; +}; + +struct lfds700_stack_state +{ + struct lfds700_stack_element LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + *volatile top[PAC_SIZE]; + + void LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + *user_state; +}; + +/***** public prototypes *****/ +void lfds700_stack_init_valid_on_current_logical_core( struct lfds700_stack_state *ss, void *user_state ); + // TRD : used in conjunction with the #define LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE + +void lfds700_stack_cleanup( struct lfds700_stack_state *ss, + void (*element_cleanup_callback)(struct lfds700_stack_state *ss, struct lfds700_stack_element *se) ); + +void lfds700_stack_push( struct lfds700_stack_state *ss, + struct lfds700_stack_element *se, + struct lfds700_misc_prng_state *ps ); + +int lfds700_stack_pop( struct lfds700_stack_state *ss, + struct lfds700_stack_element **se, + struct lfds700_misc_prng_state *ps ); + +void lfds700_stack_query( struct lfds700_stack_state *ss, + enum lfds700_stack_query query_type, + void *query_input, + void *query_output ); + + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_btree_addonly_unbalanced/lfds700_btree_addonly_unbalanced_cleanup.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_btree_addonly_unbalanced/lfds700_btree_addonly_unbalanced_cleanup.c new file mode 100644 index 0000000000000000000000000000000000000000..2927c98628453417fd5c3e1443f54709e73df6b6 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_btree_addonly_unbalanced/lfds700_btree_addonly_unbalanced_cleanup.c @@ -0,0 +1,117 @@ +/***** includes *****/ +#include "lfds700_btree_addonly_unbalanced_internal.h" + + + + + +/****************************************************************************/ +void lfds700_btree_au_cleanup( struct lfds700_btree_au_state *baus, + void (*element_cleanup_callback)(struct lfds700_btree_au_state *baus, struct lfds700_btree_au_element *baue) ) +{ + enum lfds700_btree_au_delete_action + delete_action = LFDS700_BTREE_AU_DELETE_SELF; // TRD : to remove compiler warning + + struct lfds700_btree_au_element + *baue; + + struct lfds700_btree_au_element + *temp; + + LFDS700_PAL_ASSERT( baus != NULL ); + // TRD : element_delete_function can be NULL + + /* TRD : we're not lock-free now, so delete at will + but be iterative, so can be used in kernels (where there's little stack) + and be performant, since the user may be + creating/destroying many of these trees + also remember the user may be deallocating user data + so we cannot visit an element twice + + we start at the root and iterate till we go to NULL + if the element has zero children, we delete it and move up to its parent + if the element has one child, we delete it, move its child into its place, and continue from its child + if the element has two children, we move left + + the purpose of this is to minimize walking around the tree + to prevent visiting an element twice + while also minimizing code complexity + */ + + if( element_cleanup_callback == NULL ) + return; + + LFDS700_MISC_BARRIER_LOAD; + + lfds700_btree_au_get_by_absolute_position( baus, &baue, LFDS700_BTREE_AU_ABSOLUTE_POSITION_ROOT ); + + while( baue != NULL ) + { + if( baue->left == NULL and baue->right == NULL ) + delete_action = LFDS700_BTREE_AU_DELETE_SELF; + + if( baue->left != NULL and baue->right == NULL ) + delete_action = LFDS700_BTREE_AU_DELETE_SELF_REPLACE_WITH_LEFT_CHILD; + + if( baue->left == NULL and baue->right != NULL ) + delete_action = LFDS700_BTREE_AU_DELETE_SELF_REPLACE_WITH_RIGHT_CHILD; + + if( baue->left != NULL and baue->right != NULL ) + delete_action = LFDS700_BTREE_AU_DELETE_MOVE_LEFT; + + switch( delete_action ) + { + case LFDS700_BTREE_AU_DELETE_SELF: + // TRD : if we have a parent (we could be root) set his point to us to NULL + if( baue->up != NULL ) + { + if( baue->up->left == baue ) + baue->up->left = NULL; + if( baue->up->right == baue ) + baue->up->right = NULL; + } + + temp = baue; + lfds700_btree_au_get_by_relative_position( &baue, LFDS700_BTREE_AU_RELATIVE_POSITION_UP ); + element_cleanup_callback( baus, temp ); + break; + + case LFDS700_BTREE_AU_DELETE_SELF_REPLACE_WITH_LEFT_CHILD: + baue->left->up = baue->up; + if( baue->up != NULL ) + { + if( baue->up->left == baue ) + baue->up->left = baue->left; + if( baue->up->right == baue ) + baue->up->right = baue->left; + } + + temp = baue; + lfds700_btree_au_get_by_relative_position( &baue, LFDS700_BTREE_AU_RELATIVE_POSITION_LEFT ); + element_cleanup_callback( baus, temp ); + break; + + case LFDS700_BTREE_AU_DELETE_SELF_REPLACE_WITH_RIGHT_CHILD: + baue->right->up = baue->up; + if( baue->up != NULL ) + { + if( baue->up->left == baue ) + baue->up->left = baue->right; + if( baue->up->right == baue ) + baue->up->right = baue->right; + } + + temp = baue; + lfds700_btree_au_get_by_relative_position( &baue, LFDS700_BTREE_AU_RELATIVE_POSITION_RIGHT ); + element_cleanup_callback( baus, temp ); + break; + + case LFDS700_BTREE_AU_DELETE_MOVE_LEFT: + lfds700_btree_au_get_by_relative_position( &baue, LFDS700_BTREE_AU_RELATIVE_POSITION_LEFT ); + break; + } + } + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_btree_addonly_unbalanced/lfds700_btree_addonly_unbalanced_get.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_btree_addonly_unbalanced/lfds700_btree_addonly_unbalanced_get.c new file mode 100644 index 0000000000000000000000000000000000000000..8a2cdf93e81198a77018fcd0ee69ccfd973b89da --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_btree_addonly_unbalanced/lfds700_btree_addonly_unbalanced_get.c @@ -0,0 +1,467 @@ +/***** includes *****/ +#include "lfds700_btree_addonly_unbalanced_internal.h" + +/***** private prototypes *****/ +static void lfds700_btree_au_internal_inorder_walk_from_largest_get_next_smallest_element( struct lfds700_btree_au_element **baue ); +static void lfds700_btree_au_internal_inorder_walk_from_smallest_get_next_largest_element( struct lfds700_btree_au_element **baue ); + + + + + +/****************************************************************************/ +int lfds700_btree_au_get_by_key( struct lfds700_btree_au_state *baus, + void *key, + struct lfds700_btree_au_element **baue ) +{ + int + compare_result = !0, + rv = 1; + + LFDS700_PAL_ASSERT( baus != NULL ); + // TRD : key can be NULL + LFDS700_PAL_ASSERT( baue != NULL ); + + LFDS700_MISC_BARRIER_LOAD; + + *baue = baus->root; + + LFDS700_MISC_BARRIER_LOAD; + + while( *baue != NULL and compare_result != 0 ) + { + compare_result = baus->key_compare_function( key, (*baue)->key ); + + if( compare_result < 0 ) + { + *baue = (*baue)->left; + LFDS700_MISC_BARRIER_LOAD; + } + + if( compare_result > 0 ) + { + *baue = (*baue)->right; + LFDS700_MISC_BARRIER_LOAD; + } + } + + if( *baue == NULL ) + rv = 0; + + return( rv ); +} + + + + + +/****************************************************************************/ +int lfds700_btree_au_get_by_absolute_position( struct lfds700_btree_au_state *baus, struct lfds700_btree_au_element **baue, enum lfds700_btree_au_absolute_position absolute_position ) +{ + int + rv = 1; + + LFDS700_PAL_ASSERT( baus != NULL ); + LFDS700_PAL_ASSERT( baue != NULL ); + // TRD : absolute_position can be any value in its range + + LFDS700_MISC_BARRIER_LOAD; + + *baue = baus->root; + + LFDS700_MISC_BARRIER_LOAD; + + switch( absolute_position ) + { + case LFDS700_BTREE_AU_ABSOLUTE_POSITION_ROOT: + break; + + case LFDS700_BTREE_AU_ABSOLUTE_POSITION_LARGEST_IN_TREE: + if( *baue != NULL ) + while( (*baue)->right != NULL ) + { + *baue = (*baue)->right; + LFDS700_MISC_BARRIER_LOAD; + } + break; + + case LFDS700_BTREE_AU_ABSOLUTE_POSITION_SMALLEST_IN_TREE: + if( *baue != NULL ) + while( (*baue)->left != NULL ) + { + *baue = (*baue)->left; + LFDS700_MISC_BARRIER_LOAD; + } + break; + } + + if( *baue == NULL ) + rv = 0; + + return( rv ); +} + + + + + +/****************************************************************************/ +int lfds700_btree_au_get_by_relative_position( struct lfds700_btree_au_element **baue, enum lfds700_btree_au_relative_position relative_position ) +{ + int + rv = 1; + + LFDS700_PAL_ASSERT( baue != NULL ); + // TRD : relative_position can baue any value in its range + + if( *baue == NULL ) + return( 0 ); + + LFDS700_MISC_BARRIER_LOAD; + + switch( relative_position ) + { + case LFDS700_BTREE_AU_RELATIVE_POSITION_UP: + *baue = (*baue)->up; + // TRD : no load barrier - up already existed, so is known to be safely propagated + break; + + case LFDS700_BTREE_AU_RELATIVE_POSITION_LEFT: + *baue = (*baue)->left; + LFDS700_MISC_BARRIER_LOAD; + break; + + case LFDS700_BTREE_AU_RELATIVE_POSITION_RIGHT: + *baue = (*baue)->right; + LFDS700_MISC_BARRIER_LOAD; + break; + + case LFDS700_BTREE_AU_RELATIVE_POSITION_SMALLEST_ELEMENT_BELOW_CURRENT_ELEMENT: + *baue = (*baue)->left; + if( *baue != NULL ) + { + LFDS700_MISC_BARRIER_LOAD; + while( (*baue)->right != NULL ) + { + *baue = (*baue)->right; + LFDS700_MISC_BARRIER_LOAD; + } + } + break; + + case LFDS700_BTREE_AU_RELATIVE_POSITION_LARGEST_ELEMENT_BELOW_CURRENT_ELEMENT: + *baue = (*baue)->right; + if( *baue != NULL ) + { + LFDS700_MISC_BARRIER_LOAD; + while( (*baue)->left != NULL ) + { + *baue = (*baue)->left; + LFDS700_MISC_BARRIER_LOAD; + } + } + break; + + case LFDS700_BTREE_AU_RELATIVE_POSITION_NEXT_SMALLER_ELEMENT_IN_ENTIRE_TREE: + lfds700_btree_au_internal_inorder_walk_from_largest_get_next_smallest_element( baue ); + break; + + case LFDS700_BTREE_AU_RELATIVE_POSITION_NEXT_LARGER_ELEMENT_IN_ENTIRE_TREE: + lfds700_btree_au_internal_inorder_walk_from_smallest_get_next_largest_element( baue ); + break; + } + + if( *baue == NULL ) + rv = 0; + + return( rv ); +} + + + + + +/****************************************************************************/ +static void lfds700_btree_au_internal_inorder_walk_from_largest_get_next_smallest_element( struct lfds700_btree_au_element **baue ) +{ + enum lfds700_btree_au_move + action = LFDS700_BTREE_AU_MOVE_INVALID; + + enum lfds700_misc_flag + finished_flag = LFDS700_MISC_FLAG_LOWERED, + load_finished_flag = LFDS700_MISC_FLAG_LOWERED; + + struct lfds700_btree_au_element + *left = NULL, + *right = NULL, + *up = NULL, + *up_left = NULL, + *up_right = NULL; + + LFDS700_PAL_ASSERT( baue != NULL ); + + /* TRD : from any given element, the next smallest element is; + 1. if we have a left, it's the largest element on the right branch of our left child + 2. if we don't have a left, and we're on the right of our parent, then it's our parent + 3. if we don't have a left, and we're on the left of our parent or we have no parent, + iterative up the tree until we find the first child who is on the right of its parent; then it's the parent + */ + + /* TRD : we need to ensure the variables we use to decide our action are self-consistent + to do this, we make local copies of them all + then, if they are all not NULL, we can know they cannot change and we can continue + if however any of them are NULL, they could have changed while we were reading + and so our variables could be non-self-consistent + to check for this, we issue another processor read barrier + and then compare our local variables with the values in the tree + if they all match, then we know our variable set is self-consistent + (even though it may now be wrong - but we will discover this when we try the atomic operation) + */ + + LFDS700_MISC_BARRIER_LOAD; + + while( load_finished_flag == LFDS700_MISC_FLAG_LOWERED ) + { + left = (*baue)->left; + right = (*baue)->right; + up = (*baue)->up; + if( up != NULL ) + { + up_left = (*baue)->up->left; + up_right = (*baue)->up->right; + } + + if( left != NULL and right != NULL and (up == NULL or (up != NULL and up_left != NULL and up_right != NULL)) ) + break; + + LFDS700_MISC_BARRIER_LOAD; + + if( left == (*baue)->left and right == (*baue)->right and (up == NULL or (up != NULL and up == (*baue)->up and up_left == (*baue)->up->left and up_right == (*baue)->up->right)) ) + load_finished_flag = LFDS700_MISC_FLAG_RAISED; + } + + if( left != NULL ) + action = LFDS700_BTREE_AU_MOVE_LARGEST_FROM_LEFT_CHILD; + + if( left == NULL and up != NULL and up_right == *baue ) + action = LFDS700_BTREE_AU_MOVE_GET_PARENT; + + if( (left == NULL and up == NULL) or (up != NULL and up_left == *baue and left == NULL) ) + action = LFDS700_BTREE_AU_MOVE_MOVE_UP_TREE; + + switch( action ) + { + case LFDS700_BTREE_AU_MOVE_INVALID: + case LFDS700_BTREE_AU_MOVE_SMALLEST_FROM_RIGHT_CHILD: + // TRD : eliminates a compiler warning + break; + + case LFDS700_BTREE_AU_MOVE_LARGEST_FROM_LEFT_CHILD: + *baue = left; + if( *baue != NULL ) + { + LFDS700_MISC_BARRIER_LOAD; + while( (*baue)->right != NULL ) + { + *baue = (*baue)->right; + LFDS700_MISC_BARRIER_LOAD; + } + } + break; + + case LFDS700_BTREE_AU_MOVE_GET_PARENT: + *baue = up; + break; + + case LFDS700_BTREE_AU_MOVE_MOVE_UP_TREE: + while( finished_flag == LFDS700_MISC_FLAG_LOWERED ) + { + load_finished_flag = LFDS700_MISC_FLAG_LOWERED; + + while( load_finished_flag == LFDS700_MISC_FLAG_LOWERED ) + { + up = (*baue)->up; + if( up != NULL ) + up_left = (*baue)->up->left; + + if( up == NULL or (up != NULL and up_left != NULL) ) + break; + + LFDS700_MISC_BARRIER_LOAD; + + if( up == (*baue)->up and up_left == (*baue)->up->left ) + load_finished_flag = LFDS700_MISC_FLAG_RAISED; + } + + if( *baue != NULL and up != NULL and *baue == up_left ) + *baue = up; + else + finished_flag = LFDS700_MISC_FLAG_RAISED; + } + + *baue = up; + + /* + + while( *baue != NULL and (*baue)->up != NULL and *baue == (*baue)->up->left ) + *baue = (*baue)->up; + + *baue = (*baue)->up; + + */ + break; + } + + return; +} + + + + + +/****************************************************************************/ +static void lfds700_btree_au_internal_inorder_walk_from_smallest_get_next_largest_element( struct lfds700_btree_au_element **baue ) +{ + enum lfds700_btree_au_move + action = LFDS700_BTREE_AU_MOVE_INVALID; + + enum lfds700_misc_flag + finished_flag = LFDS700_MISC_FLAG_LOWERED, + load_finished_flag = LFDS700_MISC_FLAG_LOWERED; + + struct lfds700_btree_au_element + *left = NULL, + *right = NULL, + *up = NULL, + *up_left = NULL, + *up_right = NULL; + + LFDS700_PAL_ASSERT( baue != NULL ); + + /* TRD : from any given element, the next largest element is; + 1. if we have a right, it's the smallest element on the left branch of our right child + 2. if we don't have a right, and we're on the left of our parent, then it's our parent + 3. if we don't have a right, and we're on the right of our parent or we have no parent, + iterate up the tree until we find the first child who is on the left of its parent; then it's the parent + */ + + LFDS700_MISC_BARRIER_LOAD; + + while( load_finished_flag == LFDS700_MISC_FLAG_LOWERED ) + { + left = (*baue)->left; + right = (*baue)->right; + up = (*baue)->up; + if( up != NULL ) + { + up_left = (*baue)->up->left; + up_right = (*baue)->up->right; + } + + if( left != NULL and right != NULL and (up == NULL or (up != NULL and up_left != NULL and up_right != NULL)) ) + break; + + LFDS700_MISC_BARRIER_LOAD; + + if( left == (*baue)->left and right == (*baue)->right and (up == NULL or (up != NULL and up == (*baue)->up and up_left == (*baue)->up->left and up_right == (*baue)->up->right)) ) + load_finished_flag = LFDS700_MISC_FLAG_RAISED; + } + + if( right != NULL ) + action = LFDS700_BTREE_AU_MOVE_SMALLEST_FROM_RIGHT_CHILD; + + if( right == NULL and up != NULL and up_left == *baue ) + action = LFDS700_BTREE_AU_MOVE_GET_PARENT; + + if( (right == NULL and up == NULL) or (up != NULL and up_right == *baue and right == NULL) ) + action = LFDS700_BTREE_AU_MOVE_MOVE_UP_TREE; + + switch( action ) + { + case LFDS700_BTREE_AU_MOVE_INVALID: + case LFDS700_BTREE_AU_MOVE_LARGEST_FROM_LEFT_CHILD: + // TRD : remove compiler warning + break; + + case LFDS700_BTREE_AU_MOVE_SMALLEST_FROM_RIGHT_CHILD: + *baue = right; + if( *baue != NULL ) + { + LFDS700_MISC_BARRIER_LOAD; + while( (*baue)->left != NULL ) + { + *baue = (*baue)->left; + LFDS700_MISC_BARRIER_LOAD; + } + } + break; + + case LFDS700_BTREE_AU_MOVE_GET_PARENT: + *baue = up; + break; + + case LFDS700_BTREE_AU_MOVE_MOVE_UP_TREE: + while( finished_flag == LFDS700_MISC_FLAG_LOWERED ) + { + load_finished_flag = LFDS700_MISC_FLAG_LOWERED; + + while( load_finished_flag == LFDS700_MISC_FLAG_LOWERED ) + { + up = (*baue)->up; + if( up != NULL ) + up_right = (*baue)->up->right; + + if( up == NULL or (up != NULL and up_right != NULL) ) + break; + + LFDS700_MISC_BARRIER_LOAD; + + if( up == (*baue)->up and up_right == (*baue)->up->right ) + load_finished_flag = LFDS700_MISC_FLAG_RAISED; + } + + if( *baue != NULL and up != NULL and *baue == up_right ) + *baue = up; + else + finished_flag = LFDS700_MISC_FLAG_RAISED; + } + + *baue = up; + + /* + + while( *baue != NULL and (*baue)->up != NULL and *baue == (*baue)->up->right ) + *baue = (*baue)->up; + + *baue = (*baue)->up; + + */ + break; + } + + return; +} + + + + + +/****************************************************************************/ +int lfds700_btree_au_get_by_absolute_position_and_then_by_relative_position( struct lfds700_btree_au_state *baus, struct lfds700_btree_au_element **baue, enum lfds700_btree_au_absolute_position absolute_position, enum lfds700_btree_au_relative_position relative_position ) +{ + int + rv; + + LFDS700_PAL_ASSERT( baus != NULL ); + LFDS700_PAL_ASSERT( baue != NULL ); + // TRD: absolute_position can be any value in its range + // TRD: relative_position can be any value in its range + + if( *baue == NULL ) + rv = lfds700_btree_au_get_by_absolute_position( baus, baue, absolute_position ); + else + rv = lfds700_btree_au_get_by_relative_position( baue, relative_position ); + + return( rv ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_btree_addonly_unbalanced/lfds700_btree_addonly_unbalanced_init.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_btree_addonly_unbalanced/lfds700_btree_addonly_unbalanced_init.c new file mode 100644 index 0000000000000000000000000000000000000000..7dd0efd6c01629053326cca950af01fe95298206 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_btree_addonly_unbalanced/lfds700_btree_addonly_unbalanced_init.c @@ -0,0 +1,32 @@ +/***** includes *****/ +#include "lfds700_btree_addonly_unbalanced_internal.h" + + + + + +/****************************************************************************/ +void lfds700_btree_au_init_valid_on_current_logical_core( struct lfds700_btree_au_state *baus, + int (*key_compare_function)(void const *new_key, void const *existing_key), + enum lfds700_btree_au_existing_key existing_key, + void *user_state ) +{ + LFDS700_PAL_ASSERT( baus != NULL ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &baus->root % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &baus->key_compare_function % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( key_compare_function != NULL ); + // TRD : existing_key can be any value in its range + // TRD : user_state can be NULL + + baus->root = NULL; + baus->key_compare_function = key_compare_function; + baus->existing_key = existing_key; + baus->user_state = user_state; + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_btree_addonly_unbalanced/lfds700_btree_addonly_unbalanced_insert.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_btree_addonly_unbalanced/lfds700_btree_addonly_unbalanced_insert.c new file mode 100644 index 0000000000000000000000000000000000000000..8808177a4c6dbfd9ed69f21bbd78036ff7789ec8 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_btree_addonly_unbalanced/lfds700_btree_addonly_unbalanced_insert.c @@ -0,0 +1,156 @@ +/***** includes *****/ +#include "lfds700_btree_addonly_unbalanced_internal.h" + + + + + +/****************************************************************************/ +enum lfds700_btree_au_insert_result lfds700_btree_au_insert( struct lfds700_btree_au_state *baus, + struct lfds700_btree_au_element *baue, + struct lfds700_btree_au_element **existing_baue, + struct lfds700_misc_prng_state *ps ) +{ + char unsigned + result = 0; + + int + compare_result = 0; + + lfds700_pal_uint_t + backoff_iteration = LFDS700_MISC_ABSTRACTION_BACKOFF_INITIAL_VALUE; + + struct lfds700_btree_au_element + *volatile compare = NULL, + *volatile baue_next = NULL, + *volatile baue_parent = NULL, + *volatile baue_temp; + + LFDS700_PAL_ASSERT( baus != NULL ); + LFDS700_PAL_ASSERT( baue != NULL ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &baue->left % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &baue->right % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &baue->up % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &baue->value % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &baue->key % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + // TRD : existing_baue can be NULL + LFDS700_PAL_ASSERT( ps != NULL ); + + /* TRD : we follow a normal search for the insert node and which side to insert + + the difference is that insertion may fail because someone else inserts + there before we do + + in this case, we resume searching for the insert node from the node + we were attempting to insert upon + + (if we attempted to insert the root node and this failed, i.e. we thought + the tree was empty but then it wasn't, then we start searching from the + new root) + */ + + baue->up = baue->left = baue->right = NULL; + + LFDS700_MISC_BARRIER_LOAD; + + baue_temp = baus->root; + + LFDS700_MISC_BARRIER_LOAD; + + while( result == 0 ) + { + // TRD : first we find where to insert + while( baue_temp != NULL ) + { + compare_result = baus->key_compare_function( baue->key, baue_temp->key ); + + if( compare_result == 0 ) + { + if( existing_baue != NULL ) + *existing_baue = baue_temp; + + switch( baus->existing_key ) + { + case LFDS700_BTREE_AU_EXISTING_KEY_OVERWRITE: + LFDS700_BTREE_AU_SET_VALUE_IN_ELEMENT( *baue_temp, baue->value ); + return( LFDS700_BTREE_AU_INSERT_RESULT_SUCCESS_OVERWRITE ); + break; + + case LFDS700_BTREE_AU_EXISTING_KEY_FAIL: + return( LFDS700_BTREE_AU_INSERT_RESULT_FAILURE_EXISTING_KEY ); + break; + } + } + + if( compare_result < 0 ) + baue_next = baue_temp->left; + + if( compare_result > 0 ) + baue_next = baue_temp->right; + + baue_parent = baue_temp; + baue_temp = baue_next; + if( baue_temp != NULL ) + LFDS700_MISC_BARRIER_LOAD; + } + + /* TRD : second, we actually insert + + at this point baue_temp has come to NULL + and baue_parent is the element to insert at + and result of the last compare indicates + the direction of insertion + + it may be that another tree has already inserted an element with + the same key as ourselves, or other elements which mean our position + is now wrong + + in this case, it is either inserted in the position we're trying + to insert in now, in which case our insert will fail + + or, similarly, other elements will have come in where we are, + and our insert will fail + */ + + if( baue_parent == NULL ) + { + compare = NULL; + baue->up = baus->root; + LFDS700_MISC_BARRIER_STORE; + LFDS700_PAL_ATOMIC_CAS_WITH_BACKOFF( &baus->root, &compare, baue, LFDS700_MISC_CAS_STRENGTH_WEAK, result, backoff_iteration, ps ); + + if( result == 0 ) + baue_temp = baus->root; + } + + if( baue_parent != NULL ) + { + if( compare_result <= 0 ) + { + compare = NULL; + baue->up = baue_parent; + LFDS700_MISC_BARRIER_STORE; + LFDS700_PAL_ATOMIC_CAS_WITH_BACKOFF( &baue_parent->left, &compare, baue, LFDS700_MISC_CAS_STRENGTH_WEAK, result, backoff_iteration, ps ); + } + + if( compare_result > 0 ) + { + compare = NULL; + baue->up = baue_parent; + LFDS700_MISC_BARRIER_STORE; + LFDS700_PAL_ATOMIC_CAS_WITH_BACKOFF( &baue_parent->right, &compare, baue, LFDS700_MISC_CAS_STRENGTH_WEAK, result, backoff_iteration, ps ); + } + + // TRD : if the insert fails, resume searching at the insert node + if( result == 0 ) + baue_temp = baue_parent; + } + } + + // TRD : if we get to here, we added (not failed or overwrite on exist) a new element + if( existing_baue != NULL ) + *existing_baue = NULL; + + return( LFDS700_BTREE_AU_INSERT_RESULT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_btree_addonly_unbalanced/lfds700_btree_addonly_unbalanced_internal.h b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_btree_addonly_unbalanced/lfds700_btree_addonly_unbalanced_internal.h new file mode 100644 index 0000000000000000000000000000000000000000..54149bac9941bf33a45f3426b90ea09b0f8a3c65 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_btree_addonly_unbalanced/lfds700_btree_addonly_unbalanced_internal.h @@ -0,0 +1,23 @@ +/***** the library-wide header file *****/ +#include "../liblfds700_internal.h" + +/***** enums *****/ +enum lfds700_btree_au_move +{ + LFDS700_BTREE_AU_MOVE_INVALID, + LFDS700_BTREE_AU_MOVE_SMALLEST_FROM_RIGHT_CHILD, + LFDS700_BTREE_AU_MOVE_LARGEST_FROM_LEFT_CHILD, + LFDS700_BTREE_AU_MOVE_GET_PARENT, + LFDS700_BTREE_AU_MOVE_MOVE_UP_TREE +}; + +enum lfds700_btree_au_delete_action +{ + LFDS700_BTREE_AU_DELETE_SELF, + LFDS700_BTREE_AU_DELETE_SELF_REPLACE_WITH_LEFT_CHILD, + LFDS700_BTREE_AU_DELETE_SELF_REPLACE_WITH_RIGHT_CHILD, + LFDS700_BTREE_AU_DELETE_MOVE_LEFT +}; + +/***** private prototypes *****/ + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_btree_addonly_unbalanced/lfds700_btree_addonly_unbalanced_query.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_btree_addonly_unbalanced/lfds700_btree_addonly_unbalanced_query.c new file mode 100644 index 0000000000000000000000000000000000000000..dce958792988dcf3b86202d4a1e55917b34a9325 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_btree_addonly_unbalanced/lfds700_btree_addonly_unbalanced_query.c @@ -0,0 +1,121 @@ +/***** includes *****/ +#include "lfds700_btree_addonly_unbalanced_internal.h" + +/***** private prototypes *****/ +static void lfds700_btree_au_internal_validate( struct lfds700_btree_au_state *abs, struct lfds700_misc_validation_info *vi, enum lfds700_misc_validity *lfds700_btree_au_validity ); + + + + + +/****************************************************************************/ +void lfds700_btree_au_query( struct lfds700_btree_au_state *baus, enum lfds700_btree_au_query query_type, void *query_input, void *query_output ) +{ + LFDS700_PAL_ASSERT( baus != NULL ); + // TRD : query_type can be any value in its range + + LFDS700_MISC_BARRIER_LOAD; + + switch( query_type ) + { + case LFDS700_BTREE_AU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT: + { + struct lfds700_btree_au_element + *baue = NULL; + + LFDS700_PAL_ASSERT( query_input == NULL ); + LFDS700_PAL_ASSERT( query_output != NULL ); + + *(lfds700_pal_uint_t *) query_output = 0; + + while( lfds700_btree_au_get_by_absolute_position_and_then_by_relative_position(baus, &baue, LFDS700_BTREE_AU_ABSOLUTE_POSITION_SMALLEST_IN_TREE, LFDS700_BTREE_AU_RELATIVE_POSITION_NEXT_LARGER_ELEMENT_IN_ENTIRE_TREE) ) + ( *(lfds700_pal_uint_t *) query_output )++; + } + break; + + case LFDS700_BTREE_AU_QUERY_SINGLETHREADED_VALIDATE: + // TRD : query_input can be NULL + LFDS700_PAL_ASSERT( query_output != NULL ); + + lfds700_btree_au_internal_validate( baus, (struct lfds700_misc_validation_info *) query_input, (enum lfds700_misc_validity *) query_output ); + break; + } + + return; +} + + + + + +/****************************************************************************/ +static void lfds700_btree_au_internal_validate( struct lfds700_btree_au_state *baus, struct lfds700_misc_validation_info *vi, enum lfds700_misc_validity *lfds700_btree_au_validity ) +{ + lfds700_pal_uint_t + number_elements_from_query_tree = 0, + number_elements_from_walk = 0; + + struct lfds700_btree_au_element + *baue = NULL, + *baue_prev = NULL; + + LFDS700_PAL_ASSERT( baus!= NULL ); + // TRD : vi can be NULL + LFDS700_PAL_ASSERT( lfds700_btree_au_validity != NULL ); + + *lfds700_btree_au_validity = LFDS700_MISC_VALIDITY_VALID; + + /* TRD : validation is performed by; + + performing an in-order walk + we should see every element is larger than the preceeding element + we count elements as we go along (visited elements, that is) + and check our tally equals the expected count + */ + + LFDS700_MISC_BARRIER_LOAD; + + while( lfds700_btree_au_get_by_absolute_position_and_then_by_relative_position(baus, &baue, LFDS700_BTREE_AU_ABSOLUTE_POSITION_SMALLEST_IN_TREE, LFDS700_BTREE_AU_RELATIVE_POSITION_NEXT_LARGER_ELEMENT_IN_ENTIRE_TREE) ) + { + // TRD : baue_prev should always be smaller than or equal to baue + if( baue_prev != NULL ) + if( baus->key_compare_function(baue_prev->key, baue->key) > 0 ) + { + *lfds700_btree_au_validity = LFDS700_MISC_VALIDITY_INVALID_ORDER; + return; + } + + baue_prev = baue; + number_elements_from_walk++; + } + + if( *lfds700_btree_au_validity == LFDS700_MISC_VALIDITY_VALID ) + { + lfds700_btree_au_query( (struct lfds700_btree_au_state *) baus, LFDS700_BTREE_AU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, &number_elements_from_query_tree ); + + if( number_elements_from_walk > number_elements_from_query_tree ) + *lfds700_btree_au_validity = LFDS700_MISC_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; + + if( number_elements_from_walk < number_elements_from_query_tree ) + *lfds700_btree_au_validity = LFDS700_MISC_VALIDITY_INVALID_MISSING_ELEMENTS; + } + + /* TRD : now check for expected number of elements + vi can be NULL, in which case we do not check + we know we don't have a loop from our earlier check + */ + + if( *lfds700_btree_au_validity == LFDS700_MISC_VALIDITY_VALID and vi != NULL ) + { + lfds700_btree_au_query( (struct lfds700_btree_au_state *) baus, LFDS700_BTREE_AU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, &number_elements_from_query_tree ); + + if( number_elements_from_query_tree < vi->min_elements ) + *lfds700_btree_au_validity = LFDS700_MISC_VALIDITY_INVALID_MISSING_ELEMENTS; + + if( number_elements_from_query_tree > vi->max_elements ) + *lfds700_btree_au_validity = LFDS700_MISC_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; + } + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_freelist/lfds700_freelist_cleanup.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_freelist/lfds700_freelist_cleanup.c new file mode 100644 index 0000000000000000000000000000000000000000..f7a088a39a7111c7c2605aa7da751481eef74776 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_freelist/lfds700_freelist_cleanup.c @@ -0,0 +1,36 @@ +/***** includes *****/ +#include "lfds700_freelist_internal.h" + + + + + +/****************************************************************************/ +void lfds700_freelist_cleanup( struct lfds700_freelist_state *fs, + void (*element_cleanup_callback)(struct lfds700_freelist_state *fs, struct lfds700_freelist_element *fe) ) +{ + struct lfds700_freelist_element + *fe, + *fe_temp; + + LFDS700_PAL_ASSERT( fs != NULL ); + // TRD : element_cleanup_callback can be NULL + + LFDS700_MISC_BARRIER_LOAD; + + if( element_cleanup_callback != NULL ) + { + fe = fs->top[POINTER]; + + while( fe != NULL ) + { + fe_temp = fe; + fe = fe->next; + + element_cleanup_callback( fs, fe_temp ); + } + } + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_freelist/lfds700_freelist_init.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_freelist/lfds700_freelist_init.c new file mode 100644 index 0000000000000000000000000000000000000000..fcacd1b32f06ef5d4497994c5ab506a2fbffd48f --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_freelist/lfds700_freelist_init.c @@ -0,0 +1,27 @@ +/***** includes *****/ +#include "lfds700_freelist_internal.h" + + + + + +/****************************************************************************/ +void lfds700_freelist_init_valid_on_current_logical_core( struct lfds700_freelist_state *fs, void *user_state ) +{ + LFDS700_PAL_ASSERT( fs != NULL ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) fs->top % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &fs->user_state % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + // TRD : user_state can be NULL + + fs->top[POINTER] = NULL; + fs->top[COUNTER] = 0; + + fs->user_state = user_state; + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_freelist/lfds700_freelist_internal.h b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_freelist/lfds700_freelist_internal.h new file mode 100644 index 0000000000000000000000000000000000000000..7a7d54180421c96cce9b0a1b6529d4cee90b5564 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_freelist/lfds700_freelist_internal.h @@ -0,0 +1,5 @@ +/***** the library wide include file *****/ +#include "../liblfds700_internal.h" + +/***** private prototypes *****/ + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_freelist/lfds700_freelist_pop.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_freelist/lfds700_freelist_pop.c new file mode 100644 index 0000000000000000000000000000000000000000..c0a3545d9194ab0011381003524a71fac8aef37a --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_freelist/lfds700_freelist_pop.c @@ -0,0 +1,52 @@ +/***** includes *****/ +#include "lfds700_freelist_internal.h" + + + + + +/****************************************************************************/ +int lfds700_freelist_pop( struct lfds700_freelist_state *fs, struct lfds700_freelist_element **fe, struct lfds700_misc_prng_state *ps ) +{ + char unsigned + result; + + lfds700_pal_uint_t + backoff_iteration = LFDS700_MISC_ABSTRACTION_BACKOFF_INITIAL_VALUE; + + struct lfds700_freelist_element LFDS700_PAL_ALIGN(LFDS700_PAL_ALIGN_DOUBLE_POINTER) + *new_top[PAC_SIZE], + *volatile original_top[PAC_SIZE]; + + LFDS700_PAL_ASSERT( fs != NULL ); + LFDS700_PAL_ASSERT( fe != NULL ); + LFDS700_PAL_ASSERT( ps != NULL ); + + LFDS700_PAL_BARRIER_PROCESSOR_LOAD; + + original_top[COUNTER] = fs->top[COUNTER]; + original_top[POINTER] = fs->top[POINTER]; + + do + { + if( original_top[POINTER] == NULL ) + { + *fe = NULL; + return( 0 ); + } + + new_top[COUNTER] = original_top[COUNTER] + 1; + new_top[POINTER] = original_top[POINTER]->next; + + LFDS700_PAL_ATOMIC_DWCAS_WITH_BACKOFF( &fs->top, original_top, new_top, LFDS700_MISC_CAS_STRENGTH_WEAK, result, backoff_iteration, ps ); + + if( result != 1 ) + LFDS700_PAL_BARRIER_PROCESSOR_LOAD; + } + while( result != 1 ); + + *fe = original_top[POINTER]; + + return( 1 ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_freelist/lfds700_freelist_push.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_freelist/lfds700_freelist_push.c new file mode 100644 index 0000000000000000000000000000000000000000..67fe38dadbe948feb8f14cc3059627929816cc87 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_freelist/lfds700_freelist_push.c @@ -0,0 +1,42 @@ +/***** includes *****/ +#include "lfds700_freelist_internal.h" + + + + + +/****************************************************************************/ +void lfds700_freelist_push( struct lfds700_freelist_state *fs, struct lfds700_freelist_element *fe, struct lfds700_misc_prng_state *ps ) +{ + char unsigned + result; + + lfds700_pal_uint_t + backoff_iteration = LFDS700_MISC_ABSTRACTION_BACKOFF_INITIAL_VALUE; + + struct lfds700_freelist_element LFDS700_PAL_ALIGN(LFDS700_PAL_ALIGN_DOUBLE_POINTER) + *new_top[PAC_SIZE], + *volatile original_top[PAC_SIZE]; + + LFDS700_PAL_ASSERT( fs != NULL ); + LFDS700_PAL_ASSERT( fe != NULL ); + LFDS700_PAL_ASSERT( ps != NULL ); + + new_top[POINTER] = fe; + + original_top[COUNTER] = fs->top[COUNTER]; + original_top[POINTER] = fs->top[POINTER]; + + do + { + new_top[COUNTER] = original_top[COUNTER] + 1; + fe->next = original_top[POINTER]; + + LFDS700_PAL_BARRIER_PROCESSOR_STORE; + LFDS700_PAL_ATOMIC_DWCAS_WITH_BACKOFF( &fs->top, original_top, new_top, LFDS700_MISC_CAS_STRENGTH_WEAK, result, backoff_iteration, ps ); + } + while( result != 1 ); + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_freelist/lfds700_freelist_query.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_freelist/lfds700_freelist_query.c new file mode 100644 index 0000000000000000000000000000000000000000..43b8bc263dc8b26b7448b4a6da914b84c664e38a --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_freelist/lfds700_freelist_query.c @@ -0,0 +1,123 @@ +/***** includes *****/ +#include "lfds700_freelist_internal.h" + +/***** private prototypes *****/ +static void lfds700_freelist_internal_freelist_validate( struct lfds700_freelist_state *fs, struct lfds700_misc_validation_info *vi, enum lfds700_misc_validity *lfds700_freelist_validity ); + + + + + +/****************************************************************************/ +void lfds700_freelist_query( struct lfds700_freelist_state *fs, enum lfds700_freelist_query query_type, void *query_input, void *query_output ) +{ + struct lfds700_freelist_element + *fe; + + LFDS700_PAL_ASSERT( fs != NULL ); + // TRD : query_type can be any value in its range + + LFDS700_MISC_BARRIER_LOAD; + + switch( query_type ) + { + case LFDS700_FREELIST_QUERY_SINGLETHREADED_GET_COUNT: + LFDS700_PAL_ASSERT( query_input == NULL ); + LFDS700_PAL_ASSERT( query_output != NULL ); + + *(lfds700_pal_uint_t *) query_output = 0; + + fe = (struct lfds700_freelist_element *) fs->top[POINTER]; + + while( fe != NULL ) + { + ( *(lfds700_pal_uint_t *) query_output )++; + fe = (struct lfds700_freelist_element *) fe->next; + } + break; + + case LFDS700_FREELIST_QUERY_SINGLETHREADED_VALIDATE: + // TRD : query_input can be NULL + LFDS700_PAL_ASSERT( query_output != NULL ); + + lfds700_freelist_internal_freelist_validate( fs, (struct lfds700_misc_validation_info *) query_input, (enum lfds700_misc_validity *) query_output ); + break; + } + + return; +} + + + + + +/****************************************************************************/ +static void lfds700_freelist_internal_freelist_validate( struct lfds700_freelist_state *fs, struct lfds700_misc_validation_info *vi, enum lfds700_misc_validity *lfds700_freelist_validity ) +{ + lfds700_pal_uint_t + number_elements = 0; + + struct lfds700_freelist_element + *fe_slow, + *fe_fast; + + LFDS700_PAL_ASSERT( fs != NULL ); + // TRD : vi can be NULL + LFDS700_PAL_ASSERT( lfds700_freelist_validity != NULL ); + + *lfds700_freelist_validity = LFDS700_MISC_VALIDITY_VALID; + + fe_slow = fe_fast = (struct lfds700_freelist_element *) fs->top[POINTER]; + + /* TRD : first, check for a loop + we have two pointers + both of which start at the top of the freelist + we enter a loop + and on each iteration + we advance one pointer by one element + and the other by two + + we exit the loop when both pointers are NULL + (have reached the end of the freelist) + + or + + if we fast pointer 'sees' the slow pointer + which means we have a loop + */ + + if( fe_slow != NULL ) + do + { + fe_slow = fe_slow->next; + + if( fe_fast != NULL ) + fe_fast = fe_fast->next; + + if( fe_fast != NULL ) + fe_fast = fe_fast->next; + } + while( fe_slow != NULL and fe_fast != fe_slow ); + + if( fe_fast != NULL and fe_slow != NULL and fe_fast == fe_slow ) + *lfds700_freelist_validity = LFDS700_MISC_VALIDITY_INVALID_LOOP; + + /* TRD : now check for expected number of elements + vi can be NULL, in which case we do not check + we know we don't have a loop from our earlier check + */ + + if( *lfds700_freelist_validity == LFDS700_MISC_VALIDITY_VALID and vi != NULL ) + { + lfds700_freelist_query( fs, LFDS700_FREELIST_QUERY_SINGLETHREADED_GET_COUNT, NULL, (void *) &number_elements ); + + if( number_elements < vi->min_elements ) + *lfds700_freelist_validity = LFDS700_MISC_VALIDITY_INVALID_MISSING_ELEMENTS; + + if( number_elements > vi->max_elements ) + *lfds700_freelist_validity = LFDS700_MISC_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; + } + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_hash_addonly/lfds700_hash_addonly_cleanup.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_hash_addonly/lfds700_hash_addonly_cleanup.c new file mode 100644 index 0000000000000000000000000000000000000000..af88b19179727689e4437f7d848a8b530c755b39 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_hash_addonly/lfds700_hash_addonly_cleanup.c @@ -0,0 +1,61 @@ +/***** includes *****/ +#include "lfds700_hash_addonly_internal.h" + +/***** private prototypes*****/ +static void btree_au_element_cleanup_function( struct lfds700_btree_au_state *baus, struct lfds700_btree_au_element *baue ); + + + + + +/****************************************************************************/ +void lfds700_hash_a_cleanup( struct lfds700_hash_a_state *has, + void (*element_cleanup_callback)(struct lfds700_hash_a_state *has, struct lfds700_hash_a_element *hae) ) +{ + lfds700_pal_uint_t + loop; + + LFDS700_PAL_ASSERT( has != NULL ); + // TRD : element_cleanup_callback can be NULL + + if( element_cleanup_callback == NULL ) + return; + + LFDS700_MISC_BARRIER_LOAD; + + has->element_cleanup_callback = element_cleanup_callback; + + for( loop = 0 ; loop < has->array_size ; loop++ ) + lfds700_btree_au_cleanup( has->baus_array+loop, btree_au_element_cleanup_function ); + + return; +} + + + + + +/****************************************************************************/ +#pragma warning( disable : 4100 ) + +static void btree_au_element_cleanup_function( struct lfds700_btree_au_state *baus, struct lfds700_btree_au_element *baue ) +{ + struct lfds700_hash_a_state + *has; + + struct lfds700_hash_a_element + *hae; + + LFDS700_PAL_ASSERT( baus != NULL ); + LFDS700_PAL_ASSERT( baue != NULL ); + + hae = (struct lfds700_hash_a_element *) LFDS700_BTREE_AU_GET_VALUE_FROM_ELEMENT( *baue ); + has = (struct lfds700_hash_a_state *) LFDS700_BTREE_AU_GET_USER_STATE_FROM_STATE( *baus ); + + has->element_cleanup_callback( has, hae ); + + return; +} + +#pragma warning( default : 4100 ) + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_hash_addonly/lfds700_hash_addonly_get.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_hash_addonly/lfds700_hash_addonly_get.c new file mode 100644 index 0000000000000000000000000000000000000000..8d010664abfc96f0dcdaace7129b09d555e26de6 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_hash_addonly/lfds700_hash_addonly_get.c @@ -0,0 +1,37 @@ +/***** includes *****/ +#include "lfds700_hash_addonly_internal.h" + + + + + +/****************************************************************************/ +int lfds700_hash_a_get_by_key( struct lfds700_hash_a_state *has, + void *key, + struct lfds700_hash_a_element **hae ) +{ + int + rv; + + lfds700_pal_uint_t + hash = 0; + + struct lfds700_btree_au_element + *baue; + + LFDS700_PAL_ASSERT( has != NULL ); + // TRD : key can be NULL + LFDS700_PAL_ASSERT( hae != NULL ); + + has->key_hash_function( key, &hash ); + + rv = lfds700_btree_au_get_by_key( has->baus_array + (hash % has->array_size), key, &baue ); + + if( rv == 1 ) + *hae = LFDS700_BTREE_AU_GET_VALUE_FROM_ELEMENT( *baue ); + else + *hae = NULL; + + return( rv ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_hash_addonly/lfds700_hash_addonly_init.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_hash_addonly/lfds700_hash_addonly_init.c new file mode 100644 index 0000000000000000000000000000000000000000..022024ce27a76f3f0124c156d6bd7ab71392172e --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_hash_addonly/lfds700_hash_addonly_init.c @@ -0,0 +1,54 @@ +/***** includes *****/ +#include "lfds700_hash_addonly_internal.h" + + + + + +/****************************************************************************/ +void lfds700_hash_a_init_valid_on_current_logical_core( struct lfds700_hash_a_state *has, + struct lfds700_btree_au_state *baus_array, + lfds700_pal_uint_t array_size, + int (*key_compare_function)(void const *new_key, void const *existing_key), + void (*key_hash_function)(void const *key, lfds700_pal_uint_t *hash), + enum lfds700_hash_a_existing_key existing_key, + void *user_state ) +{ + enum lfds700_btree_au_existing_key + btree_au_existing_key = LFDS700_BTREE_AU_EXISTING_KEY_OVERWRITE; // TRD : for compiler warning + + lfds700_pal_uint_t + loop; + + LFDS700_PAL_ASSERT( has != NULL ); + LFDS700_PAL_ASSERT( baus_array != NULL ); + LFDS700_PAL_ASSERT( array_size > 0 ); + LFDS700_PAL_ASSERT( key_compare_function != NULL ); + LFDS700_PAL_ASSERT( key_hash_function != NULL ); + // TRD : existing_key can be any value in its range + // TRD : user_state can be NULL + + has->array_size = array_size; + has->key_compare_function = key_compare_function; + has->key_hash_function = key_hash_function; + has->existing_key = existing_key; + has->baus_array = baus_array; + has->user_state = user_state; + + if( has->existing_key == LFDS700_HASH_A_EXISTING_KEY_OVERWRITE ) + btree_au_existing_key = LFDS700_BTREE_AU_EXISTING_KEY_OVERWRITE; + + if( has->existing_key == LFDS700_HASH_A_EXISTING_KEY_FAIL ) + btree_au_existing_key = LFDS700_BTREE_AU_EXISTING_KEY_FAIL; + + // TRD : since the addonly_hash atomic counts, if that flag is set, the btree_addonly_unbalanceds don't have to + for( loop = 0 ; loop < array_size ; loop++ ) + lfds700_btree_au_init_valid_on_current_logical_core( has->baus_array+loop, key_compare_function, btree_au_existing_key, user_state ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_hash_addonly/lfds700_hash_addonly_insert.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_hash_addonly/lfds700_hash_addonly_insert.c new file mode 100644 index 0000000000000000000000000000000000000000..25df3e7f9396dcd1101e14fb36c081a5e9956172 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_hash_addonly/lfds700_hash_addonly_insert.c @@ -0,0 +1,62 @@ +/***** includes *****/ +#include "lfds700_hash_addonly_internal.h" + + + + + +/****************************************************************************/ +enum lfds700_hash_a_insert_result lfds700_hash_a_insert( struct lfds700_hash_a_state *has, + struct lfds700_hash_a_element *hae, + struct lfds700_hash_a_element **existing_hae, + struct lfds700_misc_prng_state *ps ) +{ + enum lfds700_hash_a_insert_result + apr = LFDS700_HASH_A_PUT_RESULT_SUCCESS; + + enum lfds700_btree_au_insert_result + alr; + + lfds700_pal_uint_t + hash = 0; + + struct lfds700_btree_au_element + *existing_baue; + + LFDS700_PAL_ASSERT( has != NULL ); + LFDS700_PAL_ASSERT( hae != NULL ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &hae->value % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + // TRD : existing_hae can be NULL + LFDS700_PAL_ASSERT( ps != NULL ); + + // TRD : alignment checks + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &hae->baue % LFDS700_PAL_ALIGN_SINGLE_POINTER == 0 ); + + has->key_hash_function( hae->key, &hash ); + + LFDS700_BTREE_AU_SET_KEY_IN_ELEMENT( hae->baue, hae->key ); + LFDS700_BTREE_AU_SET_VALUE_IN_ELEMENT( hae->baue, hae ); + + alr = lfds700_btree_au_insert( has->baus_array + (hash % has->array_size), &hae->baue, &existing_baue, ps ); + + switch( alr ) + { + case LFDS700_BTREE_AU_INSERT_RESULT_FAILURE_EXISTING_KEY: + if( existing_hae != NULL ) + *existing_hae = LFDS700_BTREE_AU_GET_VALUE_FROM_ELEMENT( *existing_baue ); + + apr = LFDS700_HASH_A_PUT_RESULT_FAILURE_EXISTING_KEY; + break; + + case LFDS700_BTREE_AU_INSERT_RESULT_SUCCESS_OVERWRITE: + apr = LFDS700_HASH_A_PUT_RESULT_SUCCESS_OVERWRITE; + break; + + case LFDS700_BTREE_AU_INSERT_RESULT_SUCCESS: + apr = LFDS700_HASH_A_PUT_RESULT_SUCCESS; + break; + } + + return( apr ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_hash_addonly/lfds700_hash_addonly_internal.h b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_hash_addonly/lfds700_hash_addonly_internal.h new file mode 100644 index 0000000000000000000000000000000000000000..7a7d54180421c96cce9b0a1b6529d4cee90b5564 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_hash_addonly/lfds700_hash_addonly_internal.h @@ -0,0 +1,5 @@ +/***** the library wide include file *****/ +#include "../liblfds700_internal.h" + +/***** private prototypes *****/ + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_hash_addonly/lfds700_hash_addonly_iterate.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_hash_addonly/lfds700_hash_addonly_iterate.c new file mode 100644 index 0000000000000000000000000000000000000000..3e06be3f901d2ed4cef8b0741eb52ff0e8237a77 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_hash_addonly/lfds700_hash_addonly_iterate.c @@ -0,0 +1,58 @@ +/***** includes *****/ +#include "lfds700_hash_addonly_internal.h" + + + + + +/****************************************************************************/ +void lfds700_hash_a_iterate_init( struct lfds700_hash_a_state *has, struct lfds700_hash_a_iterate *hai ) +{ + LFDS700_PAL_ASSERT( has != NULL ); + LFDS700_PAL_ASSERT( hai != NULL ); + + hai->baus = has->baus_array; + hai->baus_end = has->baus_array + has->array_size; + hai->baue = NULL; + + return; +} + + + + + +/****************************************************************************/ +int lfds700_hash_a_iterate( struct lfds700_hash_a_iterate *hai, struct lfds700_hash_a_element **hae ) +{ + enum lfds700_misc_flag + finished_flag = LFDS700_MISC_FLAG_LOWERED; + + int + rv = 0; + + LFDS700_PAL_ASSERT( hai != NULL ); + LFDS700_PAL_ASSERT( hae != NULL ); + + while( finished_flag == LFDS700_MISC_FLAG_LOWERED ) + { + lfds700_btree_au_get_by_absolute_position_and_then_by_relative_position( hai->baus, &hai->baue, LFDS700_BTREE_AU_ABSOLUTE_POSITION_SMALLEST_IN_TREE, LFDS700_BTREE_AU_RELATIVE_POSITION_NEXT_LARGER_ELEMENT_IN_ENTIRE_TREE ); + + if( hai->baue != NULL ) + { + *hae = LFDS700_BTREE_AU_GET_VALUE_FROM_ELEMENT( *hai->baue ); + finished_flag = LFDS700_MISC_FLAG_RAISED; + rv = 1; + } + + if( hai->baue == NULL ) + if( ++hai->baus == hai->baus_end ) + { + *hae = NULL; + finished_flag = LFDS700_MISC_FLAG_RAISED; + } + } + + return( rv ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_hash_addonly/lfds700_hash_addonly_query.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_hash_addonly/lfds700_hash_addonly_query.c new file mode 100644 index 0000000000000000000000000000000000000000..9d89a8838de9bdc576805a1ad39e7736d5f73164 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_hash_addonly/lfds700_hash_addonly_query.c @@ -0,0 +1,112 @@ +/***** includes *****/ +#include "lfds700_hash_addonly_internal.h" + +/***** private prototypes *****/ +static void lfds700_hash_a_internal_validate( struct lfds700_hash_a_state *has, struct lfds700_misc_validation_info *vi, enum lfds700_misc_validity *lfds700_hash_a_validity ); + + + + + +/****************************************************************************/ +void lfds700_hash_a_query( struct lfds700_hash_a_state *has, enum lfds700_hash_a_query query_type, void *query_input, void *query_output ) +{ + LFDS700_PAL_ASSERT( has != NULL ); + // TRD : query_type can be any value in its range + + LFDS700_MISC_BARRIER_LOAD; + + switch( query_type ) + { + case LFDS700_HASH_A_QUERY_GET_POTENTIALLY_INACCURATE_COUNT: + { + struct lfds700_hash_a_iterate + ai; + + struct lfds700_hash_a_element + *hae; + + LFDS700_PAL_ASSERT( query_input == NULL ); + LFDS700_PAL_ASSERT( query_output != NULL ); + + *(lfds700_pal_uint_t *) query_output = 0; + + lfds700_hash_a_iterate_init( has, &ai ); + + while( lfds700_hash_a_iterate(&ai, &hae) ) + ( *(lfds700_pal_uint_t *) query_output )++; + } + break; + + case LFDS700_HASH_A_QUERY_SINGLETHREADED_VALIDATE: + // TRD: query_input can be any value in its range + LFDS700_PAL_ASSERT( query_output != NULL ); + + lfds700_hash_a_internal_validate( has, (struct lfds700_misc_validation_info *) query_input, (enum lfds700_misc_validity *) query_output ); + break; + } + + return; +} + + + + + +/****************************************************************************/ +static void lfds700_hash_a_internal_validate( struct lfds700_hash_a_state *has, struct lfds700_misc_validation_info *vi, enum lfds700_misc_validity *lfds700_hash_a_validity ) +{ + lfds700_pal_uint_t + lfds700_hash_a_total_number_elements = 0, + lfds700_btree_au_total_number_elements = 0, + number_elements; + + lfds700_pal_uint_t + loop; + + LFDS700_PAL_ASSERT( has!= NULL ); + // TRD : vi can be NULL + LFDS700_PAL_ASSERT( lfds700_hash_a_validity != NULL ); + + /* TRD : validate every btree_addonly_unbalanced in the addonly_hash + sum elements in each btree_addonly_unbalanced + check matches expected element counts (if vi is provided) + */ + + *lfds700_hash_a_validity = LFDS700_MISC_VALIDITY_VALID; + + for( loop = 0 ; *lfds700_hash_a_validity == LFDS700_MISC_VALIDITY_VALID and loop < has->array_size ; loop++ ) + lfds700_btree_au_query( has->baus_array+loop, LFDS700_BTREE_AU_QUERY_SINGLETHREADED_VALIDATE, NULL, (void *) lfds700_hash_a_validity ); + + if( *lfds700_hash_a_validity == LFDS700_MISC_VALIDITY_VALID ) + { + for( loop = 0 ; loop < has->array_size ; loop++ ) + { + lfds700_btree_au_query( has->baus_array+loop, LFDS700_BTREE_AU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void *) &number_elements ); + lfds700_btree_au_total_number_elements += number_elements; + } + + // TRD : first, check btree_addonly_unbalanced total vs the addonly_hash total + lfds700_hash_a_query( has, LFDS700_HASH_A_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, &lfds700_hash_a_total_number_elements ); + + // TRD : the btree_addonly_unbalanceds are assumed to speak the truth + if( lfds700_hash_a_total_number_elements < lfds700_btree_au_total_number_elements ) + *lfds700_hash_a_validity = LFDS700_MISC_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; + + if( lfds700_hash_a_total_number_elements > lfds700_btree_au_total_number_elements ) + *lfds700_hash_a_validity = LFDS700_MISC_VALIDITY_INVALID_MISSING_ELEMENTS; + + // TRD : second, if we're still valid and vi is provided, check the btree_addonly_unbalanced total against vi + if( *lfds700_hash_a_validity == LFDS700_MISC_VALIDITY_VALID and vi != NULL ) + { + if( lfds700_btree_au_total_number_elements < vi->min_elements ) + *lfds700_hash_a_validity = LFDS700_MISC_VALIDITY_INVALID_MISSING_ELEMENTS; + + if( lfds700_btree_au_total_number_elements > vi->max_elements ) + *lfds700_hash_a_validity = LFDS700_MISC_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; + } + } + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_ordered_singlylinked/lfds700_list_addonly_ordered_singlylinked_cleanup.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_ordered_singlylinked/lfds700_list_addonly_ordered_singlylinked_cleanup.c new file mode 100644 index 0000000000000000000000000000000000000000..580fa9b3ac41c92491b6bb08b3d2a3eb7722dce7 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_ordered_singlylinked/lfds700_list_addonly_ordered_singlylinked_cleanup.c @@ -0,0 +1,37 @@ +/***** includes *****/ +#include "lfds700_list_addonly_ordered_singlylinked_internal.h" + + + + + +/****************************************************************************/ +void lfds700_list_aos_cleanup( struct lfds700_list_aos_state *laoss, + void (*element_cleanup_callback)(struct lfds700_list_aos_state *laoss, struct lfds700_list_aos_element *laose) ) +{ + struct lfds700_list_aos_element + *laose, + *temp; + + LFDS700_PAL_ASSERT( laoss != NULL ); + // TRD : element_cleanup_callback can be NULL + + LFDS700_MISC_BARRIER_LOAD; + + if( element_cleanup_callback == NULL ) + return; + + laose = LFDS700_LIST_AOS_GET_START( *laoss ); + + while( laose != NULL ) + { + temp = laose; + + laose = LFDS700_LIST_AOS_GET_NEXT( *laose ); + + element_cleanup_callback( laoss, temp ); + } + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_ordered_singlylinked/lfds700_list_addonly_ordered_singlylinked_get.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_ordered_singlylinked/lfds700_list_addonly_ordered_singlylinked_get.c new file mode 100644 index 0000000000000000000000000000000000000000..9d4cab5e53a6cce69c06ccc77747df8e9cd76589 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_ordered_singlylinked/lfds700_list_addonly_ordered_singlylinked_get.c @@ -0,0 +1,29 @@ +/***** includes *****/ +#include "lfds700_list_addonly_ordered_singlylinked_internal.h" + + + + + +/****************************************************************************/ +int lfds700_list_aos_get_by_key( struct lfds700_list_aos_state *laoss, + void *key, + struct lfds700_list_aos_element **laose ) +{ + int + cr = !0, + rv = 1; + + LFDS700_PAL_ASSERT( laoss != NULL ); + LFDS700_PAL_ASSERT( key != NULL ); + LFDS700_PAL_ASSERT( laose != NULL ); + + while( cr != 0 and LFDS700_LIST_AOS_GET_START_AND_THEN_NEXT(*laoss, *laose) ) + cr = laoss->key_compare_function( key, (*laose)->key ); + + if( *laose == NULL ) + rv = 0; + + return( rv ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_ordered_singlylinked/lfds700_list_addonly_ordered_singlylinked_init.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_ordered_singlylinked/lfds700_list_addonly_ordered_singlylinked_init.c new file mode 100644 index 0000000000000000000000000000000000000000..4c92835ce56581ad1298b61fed19046a3f8c0a76 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_ordered_singlylinked/lfds700_list_addonly_ordered_singlylinked_init.c @@ -0,0 +1,37 @@ +/***** includes *****/ +#include "lfds700_list_addonly_ordered_singlylinked_internal.h" + + + + + +/****************************************************************************/ +void lfds700_list_aos_init_valid_on_current_logical_core( struct lfds700_list_aos_state *laoss, + int (*key_compare_function)(void const *new_key, void const *existing_key), + enum lfds700_list_aos_existing_key existing_key, + void *user_state ) +{ + LFDS700_PAL_ASSERT( laoss != NULL ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &laoss->start % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &laoss->dummy_element % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &laoss->key_compare_function % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( key_compare_function != NULL ); + // TRD : existing_key can be any value in its range + // TRD : user_state can be NULL + + // TRD : dummy start element - makes code easier when you can always use ->next + laoss->start = &laoss->dummy_element; + + laoss->start->next = NULL; + laoss->start->value = NULL; + laoss->key_compare_function = key_compare_function; + laoss->existing_key = existing_key; + laoss->user_state = user_state; + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_ordered_singlylinked/lfds700_list_addonly_ordered_singlylinked_insert.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_ordered_singlylinked/lfds700_list_addonly_ordered_singlylinked_insert.c new file mode 100644 index 0000000000000000000000000000000000000000..9beead4e1d1b023b66c3e6036a0017422e8e4e03 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_ordered_singlylinked/lfds700_list_addonly_ordered_singlylinked_insert.c @@ -0,0 +1,134 @@ +/***** includes *****/ +#include "lfds700_list_addonly_ordered_singlylinked_internal.h" + + + + + +/****************************************************************************/ +enum lfds700_list_aos_insert_result lfds700_list_aos_insert( struct lfds700_list_aos_state *laoss, + struct lfds700_list_aos_element *laose, + struct lfds700_list_aos_element **existing_laose, + struct lfds700_misc_prng_state *ps ) +{ + char unsigned + result; + + enum lfds700_misc_flag + finished_flag = LFDS700_MISC_FLAG_LOWERED; + + int + compare_result = 0; + + lfds700_pal_uint_t + backoff_iteration = LFDS700_MISC_ABSTRACTION_BACKOFF_INITIAL_VALUE; + + struct lfds700_list_aos_element + *volatile laose_temp = NULL, + *volatile laose_trailing; + + LFDS700_PAL_ASSERT( laoss != NULL ); + LFDS700_PAL_ASSERT( laose != NULL ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &laose->next % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &laose->value % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &laose->key % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + // TRD : existing_laose can be NULL + LFDS700_PAL_ASSERT( ps != NULL ); + + /* TRD : imagine a list, sorted small to large + + we arrive at an element + we obtain its next pointer + we check we are greater than the current element and smaller than the next element + this means we have found the correct location to insert + we try to CAS ourselves in; in the meantime, + someone else has *aready* swapped in an element which is smaller than we are + + e.g. + + the list is { 1, 10 } and we are the value 5 + + we arrive at 1; we check the next element and see it is 10 + so we are larger than the current element and smaller than the next + we are in the correct location to insert and we go to insert... + + in the meantime, someone else with the value 3 comes along + he too finds this is the correct location and inserts before we do + the list is now { 1, 3, 10 } and we are trying to insert now after + 1 and before 3! + + our insert CAS fails, because the next pointer of 1 has changed aready; + but we see we are in the wrong location - we need to move forward an + element + */ + + LFDS700_MISC_BARRIER_LOAD; + + /* TRD : we need to begin with the leading dummy element + as the element to be inserted + may be smaller than all elements in the list + */ + + laose_trailing = laoss->start; + laose_temp = laoss->start->next; + + while( finished_flag == LFDS700_MISC_FLAG_LOWERED ) + { + if( laose_temp == NULL ) + compare_result = -1; + + if( laose_temp != NULL ) + { + LFDS700_MISC_BARRIER_LOAD; + compare_result = laoss->key_compare_function( laose->key, laose_temp->key ); + } + + if( compare_result == 0 ) + { + if( existing_laose != NULL ) + *existing_laose = laose_temp; + + switch( laoss->existing_key ) + { + case LFDS700_LIST_AOS_EXISTING_KEY_OVERWRITE: + LFDS700_LIST_AOS_SET_VALUE_IN_ELEMENT( *laose_temp, laose->value ); + return( LFDS700_LIST_AOS_INSERT_RESULT_SUCCESS_OVERWRITE ); + break; + + case LFDS700_LIST_AOS_EXISTING_KEY_FAIL: + return( LFDS700_LIST_AOS_INSERT_RESULT_FAILURE_EXISTING_KEY ); + break; + } + + finished_flag = LFDS700_MISC_FLAG_RAISED; + } + + if( compare_result < 0 ) + { + laose->next = laose_temp; + LFDS700_MISC_BARRIER_STORE; + LFDS700_PAL_ATOMIC_CAS_WITH_BACKOFF( &laose_trailing->next, &laose->next, laose, LFDS700_MISC_CAS_STRENGTH_WEAK, result, backoff_iteration, ps ); + + if( result == 1 ) + finished_flag = LFDS700_MISC_FLAG_RAISED; + else + // TRD : if we fail to link, someone else has linked and so we need to redetermine our position is correct + laose_temp = laose_trailing->next; + } + + if( compare_result > 0 ) + { + // TRD : move trailing along by one element + laose_trailing = laose_trailing->next; + + /* TRD : set temp as the element after trailing + if the new element we're linking is larger than all elements in the list, + laose_temp will now go to NULL and we'll link at the end + */ + laose_temp = laose_trailing->next; + } + } + + return( LFDS700_LIST_AOS_INSERT_RESULT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_ordered_singlylinked/lfds700_list_addonly_ordered_singlylinked_internal.h b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_ordered_singlylinked/lfds700_list_addonly_ordered_singlylinked_internal.h new file mode 100644 index 0000000000000000000000000000000000000000..7a7d54180421c96cce9b0a1b6529d4cee90b5564 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_ordered_singlylinked/lfds700_list_addonly_ordered_singlylinked_internal.h @@ -0,0 +1,5 @@ +/***** the library wide include file *****/ +#include "../liblfds700_internal.h" + +/***** private prototypes *****/ + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_ordered_singlylinked/lfds700_list_addonly_ordered_singlylinked_query.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_ordered_singlylinked/lfds700_list_addonly_ordered_singlylinked_query.c new file mode 100644 index 0000000000000000000000000000000000000000..a1d990ab79b3b2ff2c390d401f81205ee30908c5 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_ordered_singlylinked/lfds700_list_addonly_ordered_singlylinked_query.c @@ -0,0 +1,121 @@ +/***** includes *****/ +#include "lfds700_list_addonly_ordered_singlylinked_internal.h" + +/***** private prototypes *****/ +static void lfds700_list_aos_internal_validate( struct lfds700_list_aos_state *laoss, struct lfds700_misc_validation_info *vi, enum lfds700_misc_validity *lfds700_list_aos_validity ); + + + + + +/****************************************************************************/ +void lfds700_list_aos_query( struct lfds700_list_aos_state *laoss, enum lfds700_list_aos_query query_type, void *query_input, void *query_output ) +{ + LFDS700_PAL_ASSERT( laoss != NULL ); + // TRD : query_type can be any value in its range + + LFDS700_MISC_BARRIER_LOAD; + + switch( query_type ) + { + case LFDS700_LIST_AOS_QUERY_GET_POTENTIALLY_INACCURATE_COUNT: + { + struct lfds700_list_aos_element + *laose = NULL; + + LFDS700_PAL_ASSERT( query_input == NULL ); + LFDS700_PAL_ASSERT( query_output != NULL ); + + *(lfds700_pal_uint_t *) query_output = 0; + + while( LFDS700_LIST_AOS_GET_START_AND_THEN_NEXT(*laoss, laose) ) + ( *(lfds700_pal_uint_t *) query_output )++; + } + break; + + case LFDS700_LIST_AOS_QUERY_SINGLETHREADED_VALIDATE: + // TRD : query_input can be NULL + LFDS700_PAL_ASSERT( query_output != NULL ); + + lfds700_list_aos_internal_validate( laoss, (struct lfds700_misc_validation_info *) query_input, (enum lfds700_misc_validity *) query_output ); + break; + } + + return; +} + + + + + + +/****************************************************************************/ +static void lfds700_list_aos_internal_validate( struct lfds700_list_aos_state *laoss, struct lfds700_misc_validation_info *vi, enum lfds700_misc_validity *lfds700_list_aos_validity ) +{ + lfds700_pal_uint_t + number_elements = 0; + + struct lfds700_list_aos_element + *laose_fast, + *laose_slow; + + LFDS700_PAL_ASSERT( laoss!= NULL ); + // TRD : vi can be NULL + LFDS700_PAL_ASSERT( lfds700_list_aos_validity != NULL ); + + *lfds700_list_aos_validity = LFDS700_MISC_VALIDITY_VALID; + + laose_slow = laose_fast = laoss->start->next; + + /* TRD : first, check for a loop + we have two pointers + both of which start at the start of the list + we enter a loop + and on each iteration + we advance one pointer by one element + and the other by two + + we exit the loop when both pointers are NULL + (have reached the end of the queue) + + or + + if we fast pointer 'sees' the slow pointer + which means we have a loop + */ + + if( laose_slow != NULL ) + do + { + laose_slow = laose_slow->next; + + if( laose_fast != NULL ) + laose_fast = laose_fast->next; + + if( laose_fast != NULL ) + laose_fast = laose_fast->next; + } + while( laose_slow != NULL and laose_fast != laose_slow ); + + if( laose_fast != NULL and laose_slow != NULL and laose_fast == laose_slow ) + *lfds700_list_aos_validity = LFDS700_MISC_VALIDITY_INVALID_LOOP; + + /* TRD : now check for expected number of elements + vi can be NULL, in which case we do not check + we know we don't have a loop from our earlier check + */ + + if( *lfds700_list_aos_validity == LFDS700_MISC_VALIDITY_VALID and vi != NULL ) + { + lfds700_list_aos_query( laoss, LFDS700_LIST_AOS_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, &number_elements ); + + if( number_elements < vi->min_elements ) + *lfds700_list_aos_validity = LFDS700_MISC_VALIDITY_INVALID_MISSING_ELEMENTS; + + if( number_elements > vi->max_elements ) + *lfds700_list_aos_validity = LFDS700_MISC_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; + } + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_singlylinked_unordered/lfds700_list_addonly_singlylinked_unordered_cleanup.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_singlylinked_unordered/lfds700_list_addonly_singlylinked_unordered_cleanup.c new file mode 100644 index 0000000000000000000000000000000000000000..ef19ce1f86994d6c4a56c8a525e31c8e7c5f8b2b --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_singlylinked_unordered/lfds700_list_addonly_singlylinked_unordered_cleanup.c @@ -0,0 +1,37 @@ +/***** includes *****/ +#include "lfds700_list_addonly_singlylinked_unordered_internal.h" + + + + + +/****************************************************************************/ +void lfds700_list_asu_cleanup( struct lfds700_list_asu_state *lasus, + void (*element_cleanup_callback)(struct lfds700_list_asu_state *lasus, struct lfds700_list_asu_element *lasue) ) +{ + struct lfds700_list_asu_element + *lasue, + *temp; + + LFDS700_PAL_ASSERT( lasus != NULL ); + // TRD : element_cleanup_callback can be NULL + + LFDS700_MISC_BARRIER_LOAD; + + if( element_cleanup_callback == NULL ) + return; + + lasue = LFDS700_LIST_ASU_GET_START( *lasus ); + + while( lasue != NULL ) + { + temp = lasue; + + lasue = LFDS700_LIST_ASU_GET_NEXT( *lasue ); + + element_cleanup_callback( lasus, temp ); + } + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_singlylinked_unordered/lfds700_list_addonly_singlylinked_unordered_get.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_singlylinked_unordered/lfds700_list_addonly_singlylinked_unordered_get.c new file mode 100644 index 0000000000000000000000000000000000000000..ae99ebfca47d67a994bb84583d7bd62078013d1d --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_singlylinked_unordered/lfds700_list_addonly_singlylinked_unordered_get.c @@ -0,0 +1,29 @@ +/***** includes *****/ +#include "lfds700_list_addonly_singlylinked_unordered_internal.h" + + + + + +/****************************************************************************/ +int lfds700_list_asu_get_by_key( struct lfds700_list_asu_state *lasus, + void *key, + struct lfds700_list_asu_element **lasue ) +{ + int + cr = !0, + rv = 1; + + LFDS700_PAL_ASSERT( lasus != NULL ); + LFDS700_PAL_ASSERT( key != NULL ); + LFDS700_PAL_ASSERT( lasue != NULL ); + + while( cr != 0 and LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*lasus, *lasue) ) + cr = lasus->key_compare_function( key, (*lasue)->key ); + + if( *lasue == NULL ) + rv = 0; + + return( rv ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_singlylinked_unordered/lfds700_list_addonly_singlylinked_unordered_init.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_singlylinked_unordered/lfds700_list_addonly_singlylinked_unordered_init.c new file mode 100644 index 0000000000000000000000000000000000000000..78b0d8eae66305e87fa4788117d9478f78f4f4b6 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_singlylinked_unordered/lfds700_list_addonly_singlylinked_unordered_init.c @@ -0,0 +1,35 @@ +/***** includes *****/ +#include "lfds700_list_addonly_singlylinked_unordered_internal.h" + + + + + +/****************************************************************************/ +void lfds700_list_asu_init_valid_on_current_logical_core( struct lfds700_list_asu_state *lasus, + int (*key_compare_function)(void const *new_key, void const *existing_key), + void *user_state ) +{ + LFDS700_PAL_ASSERT( lasus != NULL ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &lasus->end % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &lasus->start % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &lasus->dummy_element % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &lasus->key_compare_function % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + // TRD : key_compare_function can be NULL + // TRD : user_state can be NULL + + // TRD : dummy start element - makes code easier when you can always use ->next + lasus->start = lasus->end = &lasus->dummy_element; + + lasus->start->next = NULL; + lasus->start->value = NULL; + lasus->key_compare_function = key_compare_function; + lasus->user_state = user_state; + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_singlylinked_unordered/lfds700_list_addonly_singlylinked_unordered_insert.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_singlylinked_unordered/lfds700_list_addonly_singlylinked_unordered_insert.c new file mode 100644 index 0000000000000000000000000000000000000000..ce2ee825aac80a2358d34ac7f29aeb721c75cb1e --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_singlylinked_unordered/lfds700_list_addonly_singlylinked_unordered_insert.c @@ -0,0 +1,193 @@ +/***** includes *****/ +#include "lfds700_list_addonly_singlylinked_unordered_internal.h" + + + + + +/****************************************************************************/ +void lfds700_list_asu_insert_at_position( struct lfds700_list_asu_state *lasus, + struct lfds700_list_asu_element *lasue, + struct lfds700_list_asu_element *lasue_predecessor, + enum lfds700_list_asu_position position, + struct lfds700_misc_prng_state *ps ) +{ + LFDS700_PAL_ASSERT( lasus != NULL ); + LFDS700_PAL_ASSERT( lasue != NULL ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &lasue->next % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &lasue->value % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &lasue->key % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + // TRD : lasue_predecessor asserted in the switch + // TRD : position can be any value in its range + LFDS700_PAL_ASSERT( ps != NULL ); + + switch( position ) + { + case LFDS700_LIST_ASU_POSITION_START: + lfds700_list_asu_insert_at_start( lasus, lasue, ps ); + break; + + case LFDS700_LIST_ASU_POSITION_END: + lfds700_list_asu_insert_at_end( lasus, lasue, ps ); + break; + + case LFDS700_LIST_ASU_POSITION_AFTER: + lfds700_list_asu_insert_after_element( lasus, lasue, lasue_predecessor, ps ); + break; + } + + return; +} + + + + + +/****************************************************************************/ +void lfds700_list_asu_insert_at_start( struct lfds700_list_asu_state *lasus, + struct lfds700_list_asu_element *lasue, + struct lfds700_misc_prng_state *ps ) +{ + char unsigned + result; + + lfds700_pal_uint_t + backoff_iteration = LFDS700_MISC_ABSTRACTION_BACKOFF_INITIAL_VALUE; + + LFDS700_PAL_ASSERT( lasus != NULL ); + LFDS700_PAL_ASSERT( lasue != NULL ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &lasue->next % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &lasue->value % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &lasue->key % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( ps != NULL ); + + LFDS700_MISC_BARRIER_LOAD; + + lasue->next = lasus->start->next; + + do + { + LFDS700_MISC_BARRIER_STORE; + LFDS700_PAL_ATOMIC_CAS_WITH_BACKOFF( &lasus->start->next, &lasue->next, lasue, LFDS700_MISC_CAS_STRENGTH_WEAK, result, backoff_iteration, ps ); + } + while( result != 1 ); + + return; +} + + + + + +/****************************************************************************/ +void lfds700_list_asu_insert_at_end( struct lfds700_list_asu_state *lasus, + struct lfds700_list_asu_element *lasue, + struct lfds700_misc_prng_state *ps ) +{ + char unsigned + result; + + enum lfds700_misc_flag + finished_flag = LFDS700_MISC_FLAG_LOWERED; + + lfds700_pal_uint_t + backoff_iteration = LFDS700_MISC_ABSTRACTION_BACKOFF_INITIAL_VALUE; + + struct lfds700_list_asu_element LFDS700_PAL_ALIGN(LFDS700_PAL_ALIGN_SINGLE_POINTER) + *compare; + + struct lfds700_list_asu_element + *volatile lasue_next, + *volatile lasue_end; + + LFDS700_PAL_ASSERT( lasus != NULL ); + LFDS700_PAL_ASSERT( lasue != NULL ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &lasue->next % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &lasue->value % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &lasue->key % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( ps != NULL ); + + /* TRD : begin by assuming end is correctly pointing to the final element + try to link (comparing for next being NULL) + if we fail, move down list till we find last element + and retry + when successful, update end to ourselves + + note there's a leading dummy element + so lasus->end always points to an element + */ + + LFDS700_MISC_BARRIER_LOAD; + + lasue->next = NULL; + lasue_end = lasus->end; + + while( finished_flag == LFDS700_MISC_FLAG_LOWERED ) + { + compare = NULL; + + LFDS700_MISC_BARRIER_STORE; + LFDS700_PAL_ATOMIC_CAS_WITH_BACKOFF( &lasue_end->next, &compare, lasue, LFDS700_MISC_CAS_STRENGTH_STRONG, result, backoff_iteration, ps ); + + if( result == 1 ) + finished_flag = LFDS700_MISC_FLAG_RAISED; + else + { + lasue_end = compare; + lasue_next = LFDS700_LIST_ASU_GET_NEXT( *lasue_end ); + + while( lasue_next != NULL ) + { + lasue_end = lasue_next; + lasue_next = LFDS700_LIST_ASU_GET_NEXT( *lasue_end ); + } + } + } + + lasus->end = lasue; + + return; +} + + + + + +/****************************************************************************/ +#pragma warning( disable : 4100 ) + +void lfds700_list_asu_insert_after_element( struct lfds700_list_asu_state *lasus, + struct lfds700_list_asu_element *lasue, + struct lfds700_list_asu_element *lasue_predecessor, + struct lfds700_misc_prng_state *ps ) +{ + char unsigned + result; + + lfds700_pal_uint_t + backoff_iteration = LFDS700_MISC_ABSTRACTION_BACKOFF_INITIAL_VALUE; + + LFDS700_PAL_ASSERT( lasus != NULL ); + LFDS700_PAL_ASSERT( lasue != NULL ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &lasue->next % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &lasue->value % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &lasue->key % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( lasue_predecessor != NULL ); + LFDS700_PAL_ASSERT( ps != NULL ); + + LFDS700_MISC_BARRIER_LOAD; + + lasue->next = lasue_predecessor->next; + + do + { + LFDS700_MISC_BARRIER_STORE; + LFDS700_PAL_ATOMIC_CAS_WITH_BACKOFF( &lasue_predecessor->next, &lasue->next, lasue, LFDS700_MISC_CAS_STRENGTH_WEAK, result, backoff_iteration, ps ); + } + while( result != 1 ); + + return; +} + +#pragma warning( default : 4100 ) + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_singlylinked_unordered/lfds700_list_addonly_singlylinked_unordered_internal.h b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_singlylinked_unordered/lfds700_list_addonly_singlylinked_unordered_internal.h new file mode 100644 index 0000000000000000000000000000000000000000..7a7d54180421c96cce9b0a1b6529d4cee90b5564 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_singlylinked_unordered/lfds700_list_addonly_singlylinked_unordered_internal.h @@ -0,0 +1,5 @@ +/***** the library wide include file *****/ +#include "../liblfds700_internal.h" + +/***** private prototypes *****/ + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_singlylinked_unordered/lfds700_list_addonly_singlylinked_unordered_query.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_singlylinked_unordered/lfds700_list_addonly_singlylinked_unordered_query.c new file mode 100644 index 0000000000000000000000000000000000000000..0adf5a8032697d468e297977fd8d3dd9cf6ab6f4 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_singlylinked_unordered/lfds700_list_addonly_singlylinked_unordered_query.c @@ -0,0 +1,121 @@ +/***** includes *****/ +#include "lfds700_list_addonly_singlylinked_unordered_internal.h" + +/***** private prototypes *****/ +static void lfds700_list_asu_internal_validate( struct lfds700_list_asu_state *lasus, struct lfds700_misc_validation_info *vi, enum lfds700_misc_validity *lfds700_list_asu_validity ); + + + + + +/****************************************************************************/ +void lfds700_list_asu_query( struct lfds700_list_asu_state *lasus, enum lfds700_list_asu_query query_type, void *query_input, void *query_output ) +{ + LFDS700_PAL_ASSERT( lasus != NULL ); + // TRD : query_type can be any value in its range + + LFDS700_MISC_BARRIER_LOAD; + + switch( query_type ) + { + case LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT: + { + struct lfds700_list_asu_element + *lasue = NULL; + + LFDS700_PAL_ASSERT( query_input == NULL ); + LFDS700_PAL_ASSERT( query_output != NULL ); + + *(lfds700_pal_uint_t *) query_output = 0; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*lasus, lasue) ) + ( *(lfds700_pal_uint_t *) query_output )++; + } + break; + + case LFDS700_LIST_ASU_QUERY_SINGLETHREADED_VALIDATE: + // TRD : query_input can be NULL + LFDS700_PAL_ASSERT( query_output != NULL ); + + lfds700_list_asu_internal_validate( lasus, (struct lfds700_misc_validation_info *) query_input, (enum lfds700_misc_validity *) query_output ); + break; + } + + return; +} + + + + + + +/****************************************************************************/ +static void lfds700_list_asu_internal_validate( struct lfds700_list_asu_state *lasus, struct lfds700_misc_validation_info *vi, enum lfds700_misc_validity *lfds700_list_asu_validity ) +{ + lfds700_pal_uint_t + number_elements = 0; + + struct lfds700_list_asu_element + *lasue_fast, + *lasue_slow; + + LFDS700_PAL_ASSERT( lasus!= NULL ); + // TRD : vi can be NULL + LFDS700_PAL_ASSERT( lfds700_list_asu_validity != NULL ); + + *lfds700_list_asu_validity = LFDS700_MISC_VALIDITY_VALID; + + lasue_slow = lasue_fast = lasus->start->next; + + /* TRD : first, check for a loop + we have two pointers + both of which start at the start of the list + we enter a loop + and on each iteration + we advance one pointer by one element + and the other by two + + we exit the loop when both pointers are NULL + (have reached the end of the queue) + + or + + if we fast pointer 'sees' the slow pointer + which means we have a loop + */ + + if( lasue_slow != NULL ) + do + { + lasue_slow = lasue_slow->next; + + if( lasue_fast != NULL ) + lasue_fast = lasue_fast->next; + + if( lasue_fast != NULL ) + lasue_fast = lasue_fast->next; + } + while( lasue_slow != NULL and lasue_fast != lasue_slow ); + + if( lasue_fast != NULL and lasue_slow != NULL and lasue_fast == lasue_slow ) + *lfds700_list_asu_validity = LFDS700_MISC_VALIDITY_INVALID_LOOP; + + /* TRD : now check for expected number of elements + vi can be NULL, in which case we do not check + we know we don't have a loop from our earlier check + */ + + if( *lfds700_list_asu_validity == LFDS700_MISC_VALIDITY_VALID and vi != NULL ) + { + lfds700_list_asu_query( lasus, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, &number_elements ); + + if( number_elements < vi->min_elements ) + *lfds700_list_asu_validity = LFDS700_MISC_VALIDITY_INVALID_MISSING_ELEMENTS; + + if( number_elements > vi->max_elements ) + *lfds700_list_asu_validity = LFDS700_MISC_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; + } + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_misc/lfds700_misc_cleanup.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_misc/lfds700_misc_cleanup.c new file mode 100644 index 0000000000000000000000000000000000000000..d93c95db0f1054f1705003b71d2f7ebb59df4661 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_misc/lfds700_misc_cleanup.c @@ -0,0 +1,15 @@ +/***** includes *****/ +#include "lfds700_misc_internal.h" + + + + + +/****************************************************************************/ +void lfds700_misc_library_cleanup( void ) +{ + // TRD : we do nuuuuuuthin' + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_misc/lfds700_misc_globals.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_misc/lfds700_misc_globals.c new file mode 100644 index 0000000000000000000000000000000000000000..af2826675a11230d8a4dff20fb8503b52fcb1228 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_misc/lfds700_misc_globals.c @@ -0,0 +1,11 @@ +/***** includes *****/ +#include "lfds700_misc_internal.h" + + + + + +/****************************************************************************/ +struct lfds700_misc_globals + lfds700_misc_globals; + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_misc/lfds700_misc_init.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_misc/lfds700_misc_init.c new file mode 100644 index 0000000000000000000000000000000000000000..32685077bf112d74e4360d8753ce52684d503b2d --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_misc/lfds700_misc_init.c @@ -0,0 +1,53 @@ +/***** includes *****/ +#include "lfds700_misc_internal.h" + + + + + +/****************************************************************************/ +void lfds700_misc_library_init_valid_on_current_logical_core() +{ + /* TRD : the PRNG arrangement is that each thread has its own state, for a maximum-speed PRNG, where output + quality is second consideration to performance + + on 64-bit platforms this is xorshift64*, on 32-bit platforms, an unadorned xorshift32 + + the seed for each thread however comes from a single, global, maximum-quality PRNG, where quality of + output is the primary consideration + + for this, I'm using a xorshift1024* + + since the generation from this global PRNG state is not thread safe, but is still quick in + thread start-up terms, I run a little spin-lock around it + + regarding the seed for this high quality PRNG; it is customary to use time(), but this has a number of + drawbacks; + + 1. liblfds would depend on time() (currently it does not depend on a hosted implementation of standard library) + 2. the output from time may only be 32 bit, and even when it isn't, the top 32 bits are currently all zero... + 3. many threads can begin in the same second; I'd need to add in their thread number, + which means I'd need to *get* their thread number... + + as such, I've decided to use a *fixed* 64-bit seed for the high-quality PRNG; this seed is run + through the MurmerHash3 avalanche phase to generate successive 64-bit values, which populate + the 1024 state of xorshift1024* + + if you have access to a high-frequency clock (often 64-bit), you can use this for the seed + (don't use it for the per-thread PRNG, unless you know the clock can be read without a context switch) + + murmurhash3 code from here; http://xorshift.di.unimi.it/murmurhash3.c + */ + + lfds700_misc_prng_internal_big_slow_high_quality_init( LFDS700_MISC_PRNG_SEED ); + + lfds700_misc_globals.exponential_backoff_timeslot_length_in_loop_iterations_for_cas = EXPONENTIAL_BACKOFF_TIMESLOT_LENGTH_IN_INCS_FOR_CAS; + lfds700_misc_globals.exponential_backoff_timeslot_length_in_loop_iterations_for_dwcas = EXPONENTIAL_BACKOFF_TIMESLOT_LENGTH_IN_INCS_FOR_DWCAS; + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_misc/lfds700_misc_internal.h b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_misc/lfds700_misc_internal.h new file mode 100644 index 0000000000000000000000000000000000000000..9ed927efc9f4061ce96c701b571f43748ec9b121 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_misc/lfds700_misc_internal.h @@ -0,0 +1,10 @@ +/***** the library wide include file *****/ +#include "../liblfds700_internal.h" + +/***** defines *****/ +#define EXPONENTIAL_BACKOFF_TIMESLOT_LENGTH_IN_INCS_FOR_CAS 8 +#define EXPONENTIAL_BACKOFF_TIMESLOT_LENGTH_IN_INCS_FOR_DWCAS 16 + +/***** private prototypes *****/ +void lfds700_misc_prng_internal_big_slow_high_quality_init( int long long unsigned seed ); + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_misc/lfds700_misc_prng.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_misc/lfds700_misc_prng.c new file mode 100644 index 0000000000000000000000000000000000000000..84ae25fe71c1a530f14461a75446fee6db44aad4 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_misc/lfds700_misc_prng.c @@ -0,0 +1,144 @@ +/***** includes *****/ +#include "lfds700_misc_internal.h" + +/***** defines *****/ +#define LFDS700_PRNG_STATE_SIZE 16 + +/***** struct *****/ +struct lfds700_misc_prng_big_slow_high_quality_state +{ + lfds700_pal_atom_t LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + xorshift1024star_spinlock; + + // TRD : must be a 32 bit signed int + int + xorshift1024star_index; + + int long long unsigned + xorshift1024star_state[LFDS700_PRNG_STATE_SIZE]; +}; + +/***** locals *****/ +struct lfds700_misc_prng_big_slow_high_quality_state + pbshqs; + +/***** private prototypes *****/ +static void lfds700_misc_prng_internal_hash_murmurhash3( int long long unsigned *murmurhash3_state ); +static void lfds700_misc_prng_internal_big_slow_high_quality_generate( struct lfds700_misc_prng_big_slow_high_quality_state *ps, lfds700_pal_uint_t *random_value ); + + + + + +/****************************************************************************/ +void lfds700_misc_prng_init( struct lfds700_misc_prng_state *ps ) +{ + LFDS700_PAL_ASSERT( ps != NULL ); + + /* TRD : we use the big, slow, high quality PRNG to generate the initial value + for the small, fast, low qulity PRNG, which is used in exponential backoff + + we need the load barrier to catch any changes to the backoff periods + */ + + lfds700_misc_prng_internal_big_slow_high_quality_generate( &pbshqs, &ps->prng_state ); + + LFDS700_MISC_BARRIER_LOAD; + + ps->local_copy_of_global_exponential_backoff_timeslot_length_in_loop_iterations_for_cas = lfds700_misc_globals.exponential_backoff_timeslot_length_in_loop_iterations_for_cas; + ps->local_copy_of_global_exponential_backoff_timeslot_length_in_loop_iterations_for_dwcas = lfds700_misc_globals.exponential_backoff_timeslot_length_in_loop_iterations_for_dwcas; + + return; +} + + + + + +/****************************************************************************/ +void lfds700_misc_prng_internal_big_slow_high_quality_init( int long long unsigned seed ) +{ + lfds700_pal_uint_t + loop; + + LFDS700_PAL_ASSERT( seed != 0 ); // TRD : a 0 seed causes all zeros in the entropy state, so is forbidden + + pbshqs.xorshift1024star_spinlock = LFDS700_MISC_FLAG_LOWERED; + + for( loop = 0 ; loop < LFDS700_PRNG_STATE_SIZE ; loop++ ) + { + lfds700_misc_prng_internal_hash_murmurhash3( &seed ); + pbshqs.xorshift1024star_state[loop] = seed; + } + + pbshqs.xorshift1024star_index = 0; + + return; +} + + + + + +/****************************************************************************/ +static void lfds700_misc_prng_internal_hash_murmurhash3( int long long unsigned *murmurhash3_state ) +{ + LFDS700_PAL_ASSERT( murmurhash3_state != NULL ); + + *murmurhash3_state ^= *murmurhash3_state >> 33; + *murmurhash3_state *= 0xff51afd7ed558ccdULL; + *murmurhash3_state ^= *murmurhash3_state >> 33; + *murmurhash3_state *= 0xc4ceb9fe1a85ec53ULL; + *murmurhash3_state ^= *murmurhash3_state >> 33; + + return; +} + + + + + +/****************************************************************************/ +static void lfds700_misc_prng_internal_big_slow_high_quality_generate( struct lfds700_misc_prng_big_slow_high_quality_state *ps, lfds700_pal_uint_t *random_value ) +{ + char unsigned + result; + + int long long unsigned + xs_temp_one, + xs_temp_two; + + lfds700_pal_atom_t + compare = LFDS700_MISC_FLAG_LOWERED, + exchange = LFDS700_MISC_FLAG_LOWERED; + + LFDS700_PAL_ASSERT( ps != NULL ); + LFDS700_PAL_ASSERT( random_value != NULL ); + + // TRD : this is single-threaded code, on a per-state basis + do + { + compare = LFDS700_MISC_FLAG_LOWERED; + LFDS700_PAL_ATOMIC_CAS( &ps->xorshift1024star_spinlock, &compare, (lfds700_pal_atom_t) LFDS700_MISC_FLAG_RAISED, LFDS700_MISC_CAS_STRENGTH_STRONG, result ); + } + while( result == 0 ); + + // TRD : xorshift1024* code from here; http://xorshift.di.unimi.it/xorshift1024star.c + + xs_temp_one = ps->xorshift1024star_state[ ps->xorshift1024star_index ]; + ps->xorshift1024star_index = ( ps->xorshift1024star_index + 1 ) & 15; + xs_temp_two = ps->xorshift1024star_state[ ps->xorshift1024star_index ]; + + xs_temp_two ^= xs_temp_two << 31; + xs_temp_two ^= xs_temp_two >> 11; + xs_temp_one ^= xs_temp_one >> 30; + + ps->xorshift1024star_state[ ps->xorshift1024star_index ] = xs_temp_one ^ xs_temp_two; + + *random_value = (lfds700_pal_uint_t) ( ps->xorshift1024star_state[ ps->xorshift1024star_index ] * 1181783497276652981LL ); + + LFDS700_PAL_ATOMIC_EXCHANGE( &ps->xorshift1024star_spinlock, &exchange ); + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_misc/lfds700_misc_query.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_misc/lfds700_misc_query.c new file mode 100644 index 0000000000000000000000000000000000000000..fd3595d86a66c25cc0910ccb51e89cada291c3fd --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_misc/lfds700_misc_query.c @@ -0,0 +1,48 @@ +/***** includes *****/ +#include "lfds700_misc_internal.h" + + + + + +/****************************************************************************/ +void lfds700_misc_query( enum lfds700_misc_query query_type, void *query_input, void *query_output ) +{ + // TRD : query type can be any value in its range + // TRD : query_input can be NULL in some cases + // TRD : query_outputput can be NULL in some cases + + switch( query_type ) + { + case LFDS700_MISC_QUERY_GET_EXPONENTIAL_BACKOFF_TIMESLOT_LENGTH_IN_LOOP_ITERATIONS_FOR_CAS: + *(lfds700_pal_atom_t *) query_output = lfds700_misc_globals.exponential_backoff_timeslot_length_in_loop_iterations_for_cas; + break; + + case LFDS700_MISC_QUERY_SET_EXPONENTIAL_BACKOFF_TIMESLOT_LENGTH_IN_LOOP_ITERATIONS_FOR_CAS: + LFDS700_PAL_ATOMIC_EXCHANGE( &lfds700_misc_globals.exponential_backoff_timeslot_length_in_loop_iterations_for_cas, (lfds700_pal_atom_t *) query_input ); + break; + + case LFDS700_MISC_QUERY_GET_EXPONENTIAL_BACKOFF_TIMESLOT_LENGTH_IN_LOOP_ITERATIONS_FOR_DWCAS: + *(lfds700_pal_atom_t *) query_output = lfds700_misc_globals.exponential_backoff_timeslot_length_in_loop_iterations_for_dwcas; + break; + + case LFDS700_MISC_QUERY_SET_EXPONENTIAL_BACKOFF_TIMESLOT_LENGTH_IN_LOOP_ITERATIONS_FOR_DWCAS: + LFDS700_PAL_ATOMIC_EXCHANGE( &lfds700_misc_globals.exponential_backoff_timeslot_length_in_loop_iterations_for_dwcas, (lfds700_pal_atom_t *) query_input ); + break; + + case LFDS700_MISC_QUERY_GET_BUILD_AND_VERSION_STRING: + { + char static const + * const build_and_version_string = "liblfds " LFDS700_MISC_VERSION_STRING " (" BUILD_TYPE_STRING ", " LFDS700_PAL_OS_STRING ", " MODE_TYPE_STRING ", " LFDS700_PAL_PROCESSOR_STRING ", " LFDS700_PAL_COMPILER_STRING ")"; + + LFDS700_PAL_ASSERT( query_input == NULL ); + LFDS700_PAL_ASSERT( query_output != NULL ); + + *(char const **) query_output = build_and_version_string; + } + break; + } + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue/lfds700_queue_cleanup.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue/lfds700_queue_cleanup.c new file mode 100644 index 0000000000000000000000000000000000000000..f2da905dbe12b5ff44ad959247ecb0dacdde4cdd --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue/lfds700_queue_cleanup.c @@ -0,0 +1,48 @@ +/***** includes *****/ +#include "lfds700_queue_internal.h" + + + + + +/****************************************************************************/ +void lfds700_queue_cleanup( struct lfds700_queue_state *qs, + void (*element_cleanup_callback)(struct lfds700_queue_state *qs, struct lfds700_queue_element *qe, enum lfds700_misc_flag dummy_element_flag) ) +{ + struct lfds700_queue_element + *qe; + + void + *value; + + LFDS700_PAL_ASSERT( qs != NULL ); + // TRD : element_cleanup_callback can be NULL + + LFDS700_MISC_BARRIER_LOAD; + + if( element_cleanup_callback != NULL ) + { + while( qs->dequeue[POINTER] != qs->enqueue[POINTER] ) + { + // TRD : trailing dummy element, so the first real value is in the next element + value = qs->dequeue[POINTER]->next[POINTER]->value; + + // TRD : user is given back *an* element, but not the one his user data was in + qe = qs->dequeue[POINTER]; + + // TRD : remove the element from queue + qs->dequeue[POINTER] = qs->dequeue[POINTER]->next[POINTER]; + + // TRD : write value into the qe we're going to give the user + qe->value = value; + + element_cleanup_callback( qs, qe, LFDS700_MISC_FLAG_LOWERED ); + } + + // TRD : and now the final element + element_cleanup_callback( qs, (struct lfds700_queue_element *) qs->dequeue[POINTER], LFDS700_MISC_FLAG_RAISED ); + } + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue/lfds700_queue_dequeue.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue/lfds700_queue_dequeue.c new file mode 100644 index 0000000000000000000000000000000000000000..853c585039ee02900aab080ff989b1fa712f70aa --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue/lfds700_queue_dequeue.c @@ -0,0 +1,109 @@ +/***** includes *****/ +#include "lfds700_queue_internal.h" + + + + + +/****************************************************************************/ +int lfds700_queue_dequeue( struct lfds700_queue_state *qs, + struct lfds700_queue_element **qe, + struct lfds700_misc_prng_state *ps ) +{ + char unsigned + result = 0, + unwanted_result; + + enum lfds700_queue_queue_state + state = LFDS700_QUEUE_QUEUE_STATE_UNKNOWN; + + int + rv = 1, + finished_flag = LFDS700_MISC_FLAG_LOWERED; + + lfds700_pal_uint_t + backoff_iteration = LFDS700_MISC_ABSTRACTION_BACKOFF_INITIAL_VALUE; + + struct lfds700_queue_element LFDS700_PAL_ALIGN(LFDS700_PAL_ALIGN_DOUBLE_POINTER) + *dequeue[PAC_SIZE], + *enqueue[PAC_SIZE], + *next[PAC_SIZE]; + + void + *key = NULL, + *value = NULL; + + LFDS700_PAL_ASSERT( qs != NULL ); + LFDS700_PAL_ASSERT( qe != NULL ); + LFDS700_PAL_ASSERT( ps != NULL ); + + LFDS700_MISC_BARRIER_LOAD; + + do + { + dequeue[COUNTER] = qs->dequeue[COUNTER]; + dequeue[POINTER] = qs->dequeue[POINTER]; + + enqueue[COUNTER] = qs->enqueue[COUNTER]; + enqueue[POINTER] = qs->enqueue[POINTER]; + + next[COUNTER] = qs->dequeue[POINTER]->next[COUNTER]; + next[POINTER] = qs->dequeue[POINTER]->next[POINTER]; + + LFDS700_MISC_BARRIER_LOAD; + + if( dequeue[COUNTER] == qs->dequeue[COUNTER] and dequeue[POINTER] == qs->dequeue[POINTER] ) + { + if( enqueue[POINTER] == dequeue[POINTER] and next[POINTER] == NULL ) + state = LFDS700_QUEUE_QUEUE_STATE_EMPTY; + + if( enqueue[POINTER] == dequeue[POINTER] and next[POINTER] != NULL ) + state = LFDS700_QUEUE_QUEUE_STATE_ENQUEUE_OUT_OF_PLACE; + + if( enqueue[POINTER] != dequeue[POINTER] ) + state = LFDS700_QUEUE_QUEUE_STATE_ATTEMPT_DEQUEUE; + + switch( state ) + { + case LFDS700_QUEUE_QUEUE_STATE_UNKNOWN: + // TRD : eliminates compiler warning + break; + + case LFDS700_QUEUE_QUEUE_STATE_EMPTY: + rv = 0; + *qe = NULL; + finished_flag = LFDS700_MISC_FLAG_RAISED; + break; + + case LFDS700_QUEUE_QUEUE_STATE_ENQUEUE_OUT_OF_PLACE: + next[COUNTER] = enqueue[COUNTER] + 1; + LFDS700_MISC_BARRIER_STORE; + LFDS700_PAL_ATOMIC_DWCAS( qs->enqueue, enqueue, next, LFDS700_MISC_CAS_STRENGTH_WEAK, unwanted_result ); + break; + + case LFDS700_QUEUE_QUEUE_STATE_ATTEMPT_DEQUEUE: + key = next[POINTER]->key; + value = next[POINTER]->value; + + next[COUNTER] = dequeue[COUNTER] + 1; + LFDS700_MISC_BARRIER_STORE; + LFDS700_PAL_ATOMIC_DWCAS_WITH_BACKOFF( qs->dequeue, dequeue, next, LFDS700_MISC_CAS_STRENGTH_WEAK, result, backoff_iteration, ps ); + + if( result == 1 ) + finished_flag = LFDS700_MISC_FLAG_RAISED; + break; + } + } + } + while( finished_flag == LFDS700_MISC_FLAG_LOWERED ); + + if( result == 1 ) + { + *qe = dequeue[POINTER]; + (*qe)->key = key; + (*qe)->value = value; + } + + return( rv ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue/lfds700_queue_enqueue.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue/lfds700_queue_enqueue.c new file mode 100644 index 0000000000000000000000000000000000000000..07df84d851a0bc2dd733e14851842c007de780f9 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue/lfds700_queue_enqueue.c @@ -0,0 +1,74 @@ +/***** includes *****/ +#include "lfds700_queue_internal.h" + + + + + +/****************************************************************************/ +void lfds700_queue_enqueue( struct lfds700_queue_state *qs, + struct lfds700_queue_element *qe, + struct lfds700_misc_prng_state *ps ) +{ + char unsigned + result = 0, + unwanted_result; + + lfds700_pal_uint_t + backoff_iteration = LFDS700_MISC_ABSTRACTION_BACKOFF_INITIAL_VALUE; + + struct lfds700_queue_element LFDS700_PAL_ALIGN(LFDS700_PAL_ALIGN_DOUBLE_POINTER) + *volatile enqueue[PAC_SIZE], + *new_enqueue[PAC_SIZE], + *volatile next[PAC_SIZE]; + + LFDS700_PAL_ASSERT( qs != NULL ); + LFDS700_PAL_ASSERT( qe != NULL ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) qe->next % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &qe->key % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( ps != NULL ); + + qe->next[COUNTER] = (struct lfds700_queue_element *) LFDS700_MISC_PRNG_GENERATE( ps ); + qe->next[POINTER] = NULL; + + new_enqueue[POINTER] = qe; + + LFDS700_MISC_BARRIER_LOAD; + + do + { + enqueue[COUNTER] = qs->enqueue[COUNTER]; + enqueue[POINTER] = qs->enqueue[POINTER]; + + next[COUNTER] = qs->enqueue[POINTER]->next[COUNTER]; + next[POINTER] = qs->enqueue[POINTER]->next[POINTER]; + + LFDS700_MISC_BARRIER_LOAD; + + if( qs->enqueue[COUNTER] == enqueue[COUNTER] and qs->enqueue[POINTER] == enqueue[POINTER] ) + { + if( next[POINTER] == NULL ) + { + new_enqueue[COUNTER] = next[COUNTER] + 1; + LFDS700_MISC_BARRIER_STORE; + LFDS700_PAL_ATOMIC_DWCAS_WITH_BACKOFF( enqueue[POINTER]->next, next, new_enqueue, LFDS700_MISC_CAS_STRENGTH_WEAK, result, backoff_iteration, ps ); + } + else + { + next[COUNTER] = enqueue[COUNTER] + 1; + LFDS700_MISC_BARRIER_STORE; + // TRD : strictly, this is a weak CAS, but we do an extra iteration of the main loop on a fake failure, so we set it to be strong + LFDS700_PAL_ATOMIC_DWCAS( qs->enqueue, enqueue, next, LFDS700_MISC_CAS_STRENGTH_STRONG, unwanted_result ); + } + } + } + while( result != 1 ); + + new_enqueue[COUNTER] = enqueue[COUNTER] + 1; + LFDS700_MISC_BARRIER_STORE; + // TRD : move enqueue along; only a weak CAS as the dequeue will solve this if its out of place + LFDS700_PAL_ATOMIC_DWCAS( qs->enqueue, enqueue, new_enqueue, LFDS700_MISC_CAS_STRENGTH_WEAK, unwanted_result ); + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue/lfds700_queue_init.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue/lfds700_queue_init.c new file mode 100644 index 0000000000000000000000000000000000000000..15f4e64d8d9ce6879b969837dd7c99a7533483c3 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue/lfds700_queue_init.c @@ -0,0 +1,43 @@ +/***** includes *****/ +#include "lfds700_queue_internal.h" + + + + + +/****************************************************************************/ +void lfds700_queue_init_valid_on_current_logical_core( struct lfds700_queue_state *qs, struct lfds700_queue_element *qe_dummy, struct lfds700_misc_prng_state *ps, void *user_state ) +{ + LFDS700_PAL_ASSERT( qs != NULL ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &qs->enqueue % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &qs->dequeue % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &qs->user_state % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( qe_dummy != NULL ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) qe_dummy->next % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &qe_dummy->key % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( ps != NULL ); + // TRD : user_state can be UNLL + + /* TRD : qe_dummy is a dummy element, needed for init + the qs->enqueue and qs->dequeue counters do not need to be initialized + but it does no harm to do so, and stops a valgrind complaint + */ + + qs->enqueue[POINTER] = qe_dummy; + qs->enqueue[COUNTER] = (struct lfds700_queue_element *) 0; + qs->dequeue[POINTER] = qe_dummy; + qs->dequeue[COUNTER] = (struct lfds700_queue_element *) 0; + + qe_dummy->next[POINTER] = NULL; + qe_dummy->next[COUNTER] = (struct lfds700_queue_element *) LFDS700_MISC_PRNG_GENERATE( ps ); + qe_dummy->value = NULL; + + qs->user_state = user_state; + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue/lfds700_queue_internal.h b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue/lfds700_queue_internal.h new file mode 100644 index 0000000000000000000000000000000000000000..81c9b69f481e7afe9a9723d13a375dbb53e77abd --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue/lfds700_queue_internal.h @@ -0,0 +1,14 @@ +/***** the library wide include file *****/ +#include "../liblfds700_internal.h" + +/***** enums *****/ +enum lfds700_queue_queue_state +{ + LFDS700_QUEUE_QUEUE_STATE_UNKNOWN, + LFDS700_QUEUE_QUEUE_STATE_EMPTY, + LFDS700_QUEUE_QUEUE_STATE_ENQUEUE_OUT_OF_PLACE, + LFDS700_QUEUE_QUEUE_STATE_ATTEMPT_DEQUEUE +}; + +/***** private prototypes *****/ + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue/lfds700_queue_query.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue/lfds700_queue_query.c new file mode 100644 index 0000000000000000000000000000000000000000..15b4307ff2c94d467c8251a32877f8c8469cdd6e --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue/lfds700_queue_query.c @@ -0,0 +1,126 @@ +/***** includes *****/ +#include "lfds700_queue_internal.h" + +/***** private prototypes *****/ +static void lfds700_queue_internal_validate( struct lfds700_queue_state *qs, struct lfds700_misc_validation_info *vi, enum lfds700_misc_validity *lfds700_queue_validity ); + + + + + +/****************************************************************************/ +void lfds700_queue_query( struct lfds700_queue_state *qs, enum lfds700_queue_query query_type, void *query_input, void *query_output ) +{ + struct lfds700_queue_element + *qe; + + LFDS700_MISC_BARRIER_LOAD; + + LFDS700_PAL_ASSERT( qs != NULL ); + // TRD : query_type can be any value in its range + + switch( query_type ) + { + case LFDS700_QUEUE_QUERY_SINGLETHREADED_GET_COUNT: + LFDS700_PAL_ASSERT( query_input == NULL ); + LFDS700_PAL_ASSERT( query_output != NULL ); + + *(lfds700_pal_uint_t *) query_output = 0; + + qe = (struct lfds700_queue_element *) qs->dequeue[POINTER]; + + while( qe != NULL ) + { + ( *(lfds700_pal_uint_t *) query_output )++; + qe = (struct lfds700_queue_element *) qe->next[POINTER]; + } + + // TRD : remember there is a dummy element in the queue + ( *(lfds700_pal_uint_t *) query_output )--; + break; + + case LFDS700_QUEUE_QUERY_SINGLETHREADED_VALIDATE: + // TRD : query_input can be NULL + LFDS700_PAL_ASSERT( query_output != NULL ); + + lfds700_queue_internal_validate( qs, (struct lfds700_misc_validation_info *) query_input, (enum lfds700_misc_validity *) query_output ); + break; + } + + return; +} + + + + + +/****************************************************************************/ +static void lfds700_queue_internal_validate( struct lfds700_queue_state *qs, struct lfds700_misc_validation_info *vi, enum lfds700_misc_validity *lfds700_queue_validity ) +{ + lfds700_pal_uint_t + number_elements = 0; + + struct lfds700_queue_element + *qe_fast, + *qe_slow; + + LFDS700_PAL_ASSERT( qs != NULL ); + // TRD : vi can be NULL + LFDS700_PAL_ASSERT( lfds700_queue_validity != NULL ); + + *lfds700_queue_validity = LFDS700_MISC_VALIDITY_VALID; + + qe_slow = qe_fast = (struct lfds700_queue_element *) qs->dequeue[POINTER]; + + /* TRD : first, check for a loop + we have two pointers + both of which start at the dequeue end of the queue + we enter a loop + and on each iteration + we advance one pointer by one element + and the other by two + + we exit the loop when both pointers are NULL + (have reached the end of the queue) + + or + + if we fast pointer 'sees' the slow pointer + which means we have a loop + */ + + if( qe_slow != NULL ) + do + { + qe_slow = qe_slow->next[POINTER]; + + if( qe_fast != NULL ) + qe_fast = qe_fast->next[POINTER]; + + if( qe_fast != NULL ) + qe_fast = qe_fast->next[POINTER]; + } + while( qe_slow != NULL and qe_fast != qe_slow ); + + if( qe_fast != NULL and qe_slow != NULL and qe_fast == qe_slow ) + *lfds700_queue_validity = LFDS700_MISC_VALIDITY_INVALID_LOOP; + + /* TRD : now check for expected number of elements + vi can be NULL, in which case we do not check + we know we don't have a loop from our earlier check + */ + + if( *lfds700_queue_validity == LFDS700_MISC_VALIDITY_VALID and vi != NULL ) + { + lfds700_queue_query( qs, LFDS700_QUEUE_QUERY_SINGLETHREADED_GET_COUNT, NULL, (void *) &number_elements ); + + if( number_elements < vi->min_elements ) + *lfds700_queue_validity = LFDS700_MISC_VALIDITY_INVALID_MISSING_ELEMENTS; + + if( number_elements > vi->max_elements ) + *lfds700_queue_validity = LFDS700_MISC_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; + } + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue_bounded_singleconsumer_singleproducer/lfds700_queue_bounded_singleconsumer_singleproducer_cleanup.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue_bounded_singleconsumer_singleproducer/lfds700_queue_bounded_singleconsumer_singleproducer_cleanup.c new file mode 100644 index 0000000000000000000000000000000000000000..2b157bd973cbeba75f010b4e715b85e898909ee4 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue_bounded_singleconsumer_singleproducer/lfds700_queue_bounded_singleconsumer_singleproducer_cleanup.c @@ -0,0 +1,30 @@ +/***** includes *****/ +#include "lfds700_queue_bounded_singleconsumer_singleproducer_internal.h" + + + + + +/****************************************************************************/ +void lfds700_queue_bss_cleanup( struct lfds700_queue_bss_state *qbsss, + void (*element_cleanup_callback)(struct lfds700_queue_bss_state *qbsss, void *key, void *value) ) +{ + int long long unsigned + loop; + + struct lfds700_queue_bss_element + *qbsse; + + LFDS700_PAL_ASSERT( qbsss != NULL ); + // TRD : element_cleanup_callback can be NULL + + if( element_cleanup_callback != NULL ) + for( loop = qbsss->read_index ; loop < qbsss->read_index + qbsss->number_elements ; loop++ ) + { + qbsse = qbsss->element_array + (loop % qbsss->number_elements); + element_cleanup_callback( qbsss, qbsse->key, qbsse->value ); + } + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue_bounded_singleconsumer_singleproducer/lfds700_queue_bounded_singleconsumer_singleproducer_dequeue.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue_bounded_singleconsumer_singleproducer/lfds700_queue_bounded_singleconsumer_singleproducer_dequeue.c new file mode 100644 index 0000000000000000000000000000000000000000..28f735f6101be6c45c5a1fdc0e68844899949df1 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue_bounded_singleconsumer_singleproducer/lfds700_queue_bounded_singleconsumer_singleproducer_dequeue.c @@ -0,0 +1,42 @@ +/***** includes *****/ +#include "lfds700_queue_bounded_singleconsumer_singleproducer_internal.h" + + + + + +/****************************************************************************/ +int lfds700_queue_bss_dequeue( struct lfds700_queue_bss_state *qbsss, void **key, void **value ) +{ + int + rv = 0; + + struct lfds700_queue_bss_element + *qbsse; + + LFDS700_PAL_ASSERT( qbsss != NULL ); + // TRD : key can be NULL + // TRD : value can be NULL + + LFDS700_MISC_BARRIER_LOAD; + + if( qbsss->read_index != qbsss->write_index ) + { + qbsse = qbsss->element_array + qbsss->read_index; + + if( key != NULL ) + *key = qbsse->key; + + if( value != NULL ) + *value = qbsse->value; + + qbsss->read_index = (qbsss->read_index + 1) & qbsss->mask; + + LFDS700_MISC_BARRIER_STORE; + + rv = 1; + } + + return( rv ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue_bounded_singleconsumer_singleproducer/lfds700_queue_bounded_singleconsumer_singleproducer_enqueue.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue_bounded_singleconsumer_singleproducer/lfds700_queue_bounded_singleconsumer_singleproducer_enqueue.c new file mode 100644 index 0000000000000000000000000000000000000000..c74091a23eacd257472153b2f10f4082566073b7 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue_bounded_singleconsumer_singleproducer/lfds700_queue_bounded_singleconsumer_singleproducer_enqueue.c @@ -0,0 +1,39 @@ +/***** includes *****/ +#include "lfds700_queue_bounded_singleconsumer_singleproducer_internal.h" + + + + + +/****************************************************************************/ +int lfds700_queue_bss_enqueue( struct lfds700_queue_bss_state *qbsss, void *key, void *value ) +{ + int + rv = 0; + + struct lfds700_queue_bss_element + *qbsse; + + LFDS700_PAL_ASSERT( qbsss != NULL ); + // TRD : key can be NULL + // TRD : value can be NULL + + LFDS700_MISC_BARRIER_LOAD; + + if( ( (qbsss->write_index+1) & qbsss->mask ) != qbsss->read_index ) + { + qbsse = qbsss->element_array + qbsss->write_index; + + qbsse->key = key; + qbsse->value = value; + + LFDS700_MISC_BARRIER_STORE; + + qbsss->write_index = (qbsss->write_index + 1) & qbsss->mask; + + rv = 1; + } + + return( rv ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue_bounded_singleconsumer_singleproducer/lfds700_queue_bounded_singleconsumer_singleproducer_init.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue_bounded_singleconsumer_singleproducer/lfds700_queue_bounded_singleconsumer_singleproducer_init.c new file mode 100644 index 0000000000000000000000000000000000000000..9127fef443811670579702b39be660d0d3ba50b4 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue_bounded_singleconsumer_singleproducer/lfds700_queue_bounded_singleconsumer_singleproducer_init.c @@ -0,0 +1,63 @@ +/***** includes *****/ +#include "lfds700_queue_bounded_singleconsumer_singleproducer_internal.h" + + + + + +/****************************************************************************/ +void lfds700_queue_bss_init_valid_on_current_logical_core( struct lfds700_queue_bss_state *qbsss, + struct lfds700_queue_bss_element *element_array, + lfds700_pal_uint_t number_elements, + void *user_state ) +{ + LFDS700_PAL_ASSERT( qbsss != NULL ); + LFDS700_PAL_ASSERT( element_array != NULL ); + LFDS700_PAL_ASSERT( number_elements >= 2 ); + LFDS700_PAL_ASSERT( ( number_elements & (number_elements-1) ) == 0 ); // TRD : number_elements must be a positive integer power of 2 + // TRD : user_state can be NULL + + /* TRD : the use of mask and the restriction on a power of two + upon the number of elements bears some remark + + in this queue, there are a fixed number of elements + we have a read index and a write index + when we write, and thre is space to write, we increment the write index + (if no space to write, we just return) + when we read, and there are elements to be read, we after reading increment the read index + (if no elements to read, we just return) + the problem is - how do we handle wrap around? + e.g. when I write, but my write index is now equal to the number of elements + the usual solution is to modulus the write index by the nunmber of elements + problem is modulus is slow + there is a better way + first, we restrict the number of elements to be a power of two + so imagine we have a 64-bit system and we set the number of elements to be 2^64 + this gives us a bit pattern of 1000 0000 0000 0000 (...etc, lots of zeros) + now (just roll with this for a bit) subtract one from this + this gives us a mask (on a two's compliment machine) + 0111 1111 1111 1111 (...etc, lots of ones) + so what we do now, when we increment an index (think of the write index as the example) + we bitwise and it with the mask + now think about thwt happens + all the numbers up to 2^64 will be unchanged - their MSB is never set, and we and with all the other bits + but when we finally hit 2^64 and need to roll over... bingo! + we drop MSB (which we finally have) and have the value 0! + this is exactly what we want + bitwise and is much faster than modulus + */ + + qbsss->number_elements = number_elements; + qbsss->mask = qbsss->number_elements - 1; + qbsss->read_index = 0; + qbsss->write_index = 0; + qbsss->element_array = element_array; + qbsss->user_state = user_state; + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue_bounded_singleconsumer_singleproducer/lfds700_queue_bounded_singleconsumer_singleproducer_internal.h b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue_bounded_singleconsumer_singleproducer/lfds700_queue_bounded_singleconsumer_singleproducer_internal.h new file mode 100644 index 0000000000000000000000000000000000000000..7a7d54180421c96cce9b0a1b6529d4cee90b5564 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue_bounded_singleconsumer_singleproducer/lfds700_queue_bounded_singleconsumer_singleproducer_internal.h @@ -0,0 +1,5 @@ +/***** the library wide include file *****/ +#include "../liblfds700_internal.h" + +/***** private prototypes *****/ + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue_bounded_singleconsumer_singleproducer/lfds700_queue_bounded_singleconsumer_singleproducer_query.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue_bounded_singleconsumer_singleproducer/lfds700_queue_bounded_singleconsumer_singleproducer_query.c new file mode 100644 index 0000000000000000000000000000000000000000..aabcae23f3de3a9929264406fe6e584b3684fc61 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_queue_bounded_singleconsumer_singleproducer/lfds700_queue_bounded_singleconsumer_singleproducer_query.c @@ -0,0 +1,70 @@ +/***** includes *****/ +#include "lfds700_queue_bounded_singleconsumer_singleproducer_internal.h" + +/***** private prototypes *****/ +static void lfds700_queue_bss_internal_validate( struct lfds700_queue_bss_state *qbsss, struct lfds700_misc_validation_info *vi, enum lfds700_misc_validity *lfds700_validity ); + + + + + +/****************************************************************************/ +void lfds700_queue_bss_query( struct lfds700_queue_bss_state *qbsss, enum lfds700_queue_bss_query query_type, void *query_input, void *query_output ) +{ + LFDS700_PAL_ASSERT( qbsss != NULL ); + // TRD : query_type can be any value in its range + + switch( query_type ) + { + case LFDS700_QUEUE_BSS_QUERY_GET_POTENTIALLY_INACCURATE_COUNT: + LFDS700_PAL_ASSERT( query_input == NULL ); + LFDS700_PAL_ASSERT( query_output != NULL ); + + LFDS700_MISC_BARRIER_LOAD; + + *(lfds700_pal_uint_t *) query_output = +( qbsss->write_index - qbsss->read_index ); + if( qbsss->read_index > qbsss->write_index ) + *(lfds700_pal_uint_t *) query_output = qbsss->number_elements - *(lfds700_pal_uint_t *) query_output; + break; + + case LFDS700_QUEUE_BSS_QUERY_VALIDATE: + // TRD : query_input can be NULL + LFDS700_PAL_ASSERT( query_output != NULL ); + + lfds700_queue_bss_internal_validate( qbsss, (struct lfds700_misc_validation_info *) query_input, (enum lfds700_misc_validity *) query_output ); + break; + } + + return; +} + + + + + +/****************************************************************************/ +static void lfds700_queue_bss_internal_validate( struct lfds700_queue_bss_state *qbsss, struct lfds700_misc_validation_info *vi, enum lfds700_misc_validity *lfds700_validity ) +{ + LFDS700_PAL_ASSERT( qbsss != NULL ); + // TRD : vi can be NULL + LFDS700_PAL_ASSERT( lfds700_validity != NULL ); + + *lfds700_validity = LFDS700_MISC_VALIDITY_VALID; + + if( vi != NULL ) + { + lfds700_pal_uint_t + number_elements; + + lfds700_queue_bss_query( qbsss, LFDS700_QUEUE_BSS_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void *) &number_elements ); + + if( number_elements < vi->min_elements ) + *lfds700_validity = LFDS700_MISC_VALIDITY_INVALID_MISSING_ELEMENTS; + + if( number_elements > vi->max_elements ) + *lfds700_validity = LFDS700_MISC_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; + } + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_ringbuffer/lfds700_ringbuffer_cleanup.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_ringbuffer/lfds700_ringbuffer_cleanup.c new file mode 100644 index 0000000000000000000000000000000000000000..447c93041e36e8b626d2da09610b94c919efd61d --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_ringbuffer/lfds700_ringbuffer_cleanup.c @@ -0,0 +1,86 @@ +/***** includes *****/ +#include "lfds700_ringbuffer_internal.h" + +/***** private prototypes *****/ +static void lfds700_ringbuffer_internal_queue_element_cleanup_callback( struct lfds700_queue_state *qs, struct lfds700_queue_element *qe, enum lfds700_misc_flag dummy_element_flag ); +static void lfds700_ringbuffer_internal_freelist_element_cleanup_callback( struct lfds700_freelist_state *fs, struct lfds700_freelist_element *fe ); + + + + + +/****************************************************************************/ +void lfds700_ringbuffer_cleanup( struct lfds700_ringbuffer_state *rs, + void (*element_cleanup_callback)(struct lfds700_ringbuffer_state *rs, void *key, void *value, enum lfds700_misc_flag unread_flag) ) +{ + LFDS700_PAL_ASSERT( rs != NULL ); + // TRD : element_cleanup_callback can be NULL + + if( element_cleanup_callback != NULL ) + { + rs->element_cleanup_callback = element_cleanup_callback; + lfds700_queue_cleanup( &rs->qs, lfds700_ringbuffer_internal_queue_element_cleanup_callback ); + lfds700_freelist_cleanup( &rs->fs, lfds700_ringbuffer_internal_freelist_element_cleanup_callback ); + } + + return; +} + + + + + +/****************************************************************************/ +#pragma warning( disable : 4100 ) + +static void lfds700_ringbuffer_internal_queue_element_cleanup_callback( struct lfds700_queue_state *qs, struct lfds700_queue_element *qe, enum lfds700_misc_flag dummy_element_flag ) +{ + struct lfds700_ringbuffer_element + *re; + + struct lfds700_ringbuffer_state + *rs; + + LFDS700_PAL_ASSERT( qs != NULL ); + LFDS700_PAL_ASSERT( qe != NULL ); + // TRD : dummy_element can be any value in its range + + rs = (struct lfds700_ringbuffer_state *) LFDS700_QUEUE_GET_USER_STATE_FROM_STATE( *qs ); + re = (struct lfds700_ringbuffer_element *) LFDS700_QUEUE_GET_VALUE_FROM_ELEMENT( *qe ); + + if( dummy_element_flag == LFDS700_MISC_FLAG_LOWERED ) + rs->element_cleanup_callback( rs, re->key, re->value, LFDS700_MISC_FLAG_RAISED ); + + return; +} + +#pragma warning( default : 4100 ) + + + + + +/****************************************************************************/ +#pragma warning( disable : 4100 ) + +static void lfds700_ringbuffer_internal_freelist_element_cleanup_callback( struct lfds700_freelist_state *fs, struct lfds700_freelist_element *fe ) +{ + struct lfds700_ringbuffer_element + *re; + + struct lfds700_ringbuffer_state + *rs; + + LFDS700_PAL_ASSERT( fs != NULL ); + LFDS700_PAL_ASSERT( fe != NULL ); + + rs = (struct lfds700_ringbuffer_state *) LFDS700_FREELIST_GET_USER_STATE_FROM_STATE( *fs ); + re = (struct lfds700_ringbuffer_element *) LFDS700_FREELIST_GET_VALUE_FROM_ELEMENT( *fe ); + + rs->element_cleanup_callback( rs, re->key, re->value, LFDS700_MISC_FLAG_LOWERED ); + + return; +} + +#pragma warning( default : 4100 ) + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_ringbuffer/lfds700_ringbuffer_init.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_ringbuffer/lfds700_ringbuffer_init.c new file mode 100644 index 0000000000000000000000000000000000000000..a6cd1e36161272ec6fec43ce1878413a6839cbb5 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_ringbuffer/lfds700_ringbuffer_init.c @@ -0,0 +1,51 @@ +/***** includes *****/ +#include "lfds700_ringbuffer_internal.h" + + + + + +/****************************************************************************/ +void lfds700_ringbuffer_init_valid_on_current_logical_core( struct lfds700_ringbuffer_state *rs, + struct lfds700_ringbuffer_element *re_array_inc_dummy, + lfds700_pal_uint_t number_elements, + struct lfds700_misc_prng_state *ps, + void *user_state ) +{ + lfds700_pal_uint_t + loop; + + LFDS700_PAL_ASSERT( rs != NULL ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &rs->fs % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &rs->qs % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( re_array_inc_dummy != NULL ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &re_array_inc_dummy[0].fe % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &re_array_inc_dummy[0].qe % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( number_elements >= 2 ); + LFDS700_PAL_ASSERT( ps != NULL ); + // TRD : user_state can be NULL + + rs->user_state = user_state; + + re_array_inc_dummy[0].qe_use = &re_array_inc_dummy[0].qe; + + lfds700_freelist_init_valid_on_current_logical_core( &rs->fs, rs ); + lfds700_queue_init_valid_on_current_logical_core( &rs->qs, &re_array_inc_dummy[0].qe, ps, rs ); + + for( loop = 1 ; loop < number_elements ; loop++ ) + { + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &re_array_inc_dummy[loop].fe % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &re_array_inc_dummy[loop].qe % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + + re_array_inc_dummy[loop].qe_use = &re_array_inc_dummy[loop].qe; + LFDS700_FREELIST_SET_VALUE_IN_ELEMENT( re_array_inc_dummy[loop].fe, &re_array_inc_dummy[loop] ); + lfds700_freelist_push( &rs->fs, &re_array_inc_dummy[loop].fe, ps ); + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_ringbuffer/lfds700_ringbuffer_internal.h b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_ringbuffer/lfds700_ringbuffer_internal.h new file mode 100644 index 0000000000000000000000000000000000000000..7a7d54180421c96cce9b0a1b6529d4cee90b5564 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_ringbuffer/lfds700_ringbuffer_internal.h @@ -0,0 +1,5 @@ +/***** the library wide include file *****/ +#include "../liblfds700_internal.h" + +/***** private prototypes *****/ + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_ringbuffer/lfds700_ringbuffer_query.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_ringbuffer/lfds700_ringbuffer_query.c new file mode 100644 index 0000000000000000000000000000000000000000..58b7b3a9cbc0e23dbd25ae8d7d461e368089bd14 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_ringbuffer/lfds700_ringbuffer_query.c @@ -0,0 +1,72 @@ +/***** includes *****/ +#include "lfds700_ringbuffer_internal.h" + +/***** private prototypes *****/ +static void lfds700_ringbuffer_internal_validate( struct lfds700_ringbuffer_state *rs, struct lfds700_misc_validation_info *vi, enum lfds700_misc_validity *lfds700_queue_validity, enum lfds700_misc_validity *lfds700_freelist_validity ); + + + +/****************************************************************************/ +void lfds700_ringbuffer_query( struct lfds700_ringbuffer_state *rs, enum lfds700_ringbuffer_query query_type, void *query_input, void *query_output ) +{ + LFDS700_PAL_ASSERT( rs != NULL ); + // TRD : query_type can be any value in its range + + LFDS700_MISC_BARRIER_LOAD; + + switch( query_type ) + { + case LFDS700_RINGBUFFER_QUERY_SINGLETHREADED_GET_COUNT: + LFDS700_PAL_ASSERT( query_input == NULL ); + LFDS700_PAL_ASSERT( query_output != NULL ); + + lfds700_queue_query( &rs->qs, LFDS700_QUEUE_QUERY_SINGLETHREADED_GET_COUNT, NULL, query_output ); + break; + + case LFDS700_RINGBUFFER_QUERY_SINGLETHREADED_VALIDATE: + // TRD : query_input can be NULL + LFDS700_PAL_ASSERT( query_output != NULL ); + + lfds700_ringbuffer_internal_validate( rs, (struct lfds700_misc_validation_info *) query_input, (enum lfds700_misc_validity *) query_output, ((enum lfds700_misc_validity *) query_output)+1 ); + break; + } + + return; +} + + + + + +/****************************************************************************/ +static void lfds700_ringbuffer_internal_validate( struct lfds700_ringbuffer_state *rs, struct lfds700_misc_validation_info *vi, enum lfds700_misc_validity *lfds700_queue_validity, enum lfds700_misc_validity *lfds700_freelist_validity ) +{ + LFDS700_PAL_ASSERT( rs != NULL ); + // TRD : vi can be NULL + LFDS700_PAL_ASSERT( lfds700_queue_validity != NULL ); + LFDS700_PAL_ASSERT( lfds700_freelist_validity != NULL ); + + if( vi == NULL ) + { + lfds700_queue_query( &rs->qs, LFDS700_QUEUE_QUERY_SINGLETHREADED_VALIDATE, NULL, lfds700_queue_validity ); + lfds700_freelist_query( &rs->fs, LFDS700_FREELIST_QUERY_SINGLETHREADED_VALIDATE, NULL, lfds700_freelist_validity ); + } + + if( vi != NULL ) + { + struct lfds700_misc_validation_info + freelist_vi, + queue_vi; + + queue_vi.min_elements = 0; + freelist_vi.min_elements = 0; + queue_vi.max_elements = vi->max_elements; + freelist_vi.max_elements = vi->max_elements; + + lfds700_queue_query( &rs->qs, LFDS700_QUEUE_QUERY_SINGLETHREADED_VALIDATE, &queue_vi, lfds700_queue_validity ); + lfds700_freelist_query( &rs->fs, LFDS700_FREELIST_QUERY_SINGLETHREADED_VALIDATE, &freelist_vi, lfds700_freelist_validity ); + } + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_ringbuffer/lfds700_ringbuffer_read.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_ringbuffer/lfds700_ringbuffer_read.c new file mode 100644 index 0000000000000000000000000000000000000000..42dbe189e2307ce937790501e6c7476fe6d24155 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_ringbuffer/lfds700_ringbuffer_read.c @@ -0,0 +1,44 @@ +/***** includes *****/ +#include "lfds700_ringbuffer_internal.h" + + + + + +/****************************************************************************/ +int lfds700_ringbuffer_read( struct lfds700_ringbuffer_state *rs, + void **key, + void **value, + struct lfds700_misc_prng_state *ps ) +{ + int + rv; + + struct lfds700_queue_element + *qe; + + struct lfds700_ringbuffer_element + *re; + + LFDS700_PAL_ASSERT( rs != NULL ); + // TRD : key can be NULL + // TRD : value can be NULL + LFDS700_PAL_ASSERT( ps != NULL ); + + rv = lfds700_queue_dequeue( &rs->qs, &qe, ps ); + + if( rv == 1 ) + { + re = LFDS700_QUEUE_GET_VALUE_FROM_ELEMENT( *qe ); + re->qe_use = (struct lfds700_queue_element *) qe; + if( key != NULL ) + *key = re->key; + if( value != NULL ) + *value = re->value; + LFDS700_FREELIST_SET_VALUE_IN_ELEMENT( re->fe, re ); + lfds700_freelist_push( &rs->fs, &re->fe, ps ); + } + + return( rv ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_ringbuffer/lfds700_ringbuffer_write.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_ringbuffer/lfds700_ringbuffer_write.c new file mode 100644 index 0000000000000000000000000000000000000000..a16a8686c104f486a6b8981bf89033b9a237502c --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_ringbuffer/lfds700_ringbuffer_write.c @@ -0,0 +1,78 @@ +/***** includes *****/ +#include "lfds700_ringbuffer_internal.h" + + + + + +/****************************************************************************/ +void lfds700_ringbuffer_write( struct lfds700_ringbuffer_state *rs, + void *key, + void *value, + enum lfds700_misc_flag *overwrite_occurred_flag, + void **overwritten_key, + void **overwritten_value, + struct lfds700_misc_prng_state *ps ) +{ + int + rv = 0; + + struct lfds700_freelist_element + *fe; + + struct lfds700_queue_element + *qe; + + struct lfds700_ringbuffer_element + *re = NULL; + + LFDS700_PAL_ASSERT( rs != NULL ); + // TRD : key can be NULL + // TRD : value can be NULL + // TRD : overwrite_occurred_flag can be NULL + // TRD : overwritten_key can be NULL + // TRD : overwritten_value can be NULL + LFDS700_PAL_ASSERT( ps != NULL ); + + if( overwrite_occurred_flag != NULL ) + *overwrite_occurred_flag = LFDS700_MISC_FLAG_LOWERED; + + do + { + rv = lfds700_freelist_pop( &rs->fs, &fe, ps ); + + if( rv == 1 ) + re = LFDS700_FREELIST_GET_VALUE_FROM_ELEMENT( *fe ); + + if( rv == 0 ) + { + // TRD : the queue can return empty as well - remember, we're lock-free; anything could have happened since the previous instruction + rv = lfds700_queue_dequeue( &rs->qs, &qe, ps ); + + if( rv == 1 ) + { + re = LFDS700_QUEUE_GET_VALUE_FROM_ELEMENT( *qe ); + re->qe_use = (struct lfds700_queue_element *) qe; + + if( overwrite_occurred_flag != NULL ) + *overwrite_occurred_flag = LFDS700_MISC_FLAG_RAISED; + + if( overwritten_key != NULL ) + *overwritten_key = re->key; + + if( overwritten_value != NULL ) + *overwritten_value = re->value; + } + } + } + while( rv == 0 ); + + re->key = key; + re->value = value; + + LFDS700_QUEUE_SET_VALUE_IN_ELEMENT( *re->qe_use, re ); + lfds700_queue_enqueue( &rs->qs, re->qe_use, ps ); + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_stack/lfds700_stack_cleanup.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_stack/lfds700_stack_cleanup.c new file mode 100644 index 0000000000000000000000000000000000000000..efcebf35436301c3300dbc3be6ef029a7fe08acf --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_stack/lfds700_stack_cleanup.c @@ -0,0 +1,36 @@ +/***** includes *****/ +#include "lfds700_stack_internal.h" + + + + + +/****************************************************************************/ +void lfds700_stack_cleanup( struct lfds700_stack_state *ss, + void (*element_cleanup_callback)(struct lfds700_stack_state *ss, struct lfds700_stack_element *se) ) +{ + struct lfds700_stack_element + *se, + *se_temp; + + LFDS700_PAL_ASSERT( ss != NULL ); + // TRD : element_cleanup_callback can be NULL + + LFDS700_MISC_BARRIER_LOAD; + + if( element_cleanup_callback != NULL ) + { + se = ss->top[POINTER]; + + while( se != NULL ) + { + se_temp = se; + se = se->next; + + element_cleanup_callback( ss, se_temp ); + } + } + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_stack/lfds700_stack_init.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_stack/lfds700_stack_init.c new file mode 100644 index 0000000000000000000000000000000000000000..745017c029c390bf360b9bd821a843ee70d6c2d1 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_stack/lfds700_stack_init.c @@ -0,0 +1,27 @@ +/***** includes *****/ +#include "lfds700_stack_internal.h" + + + + + +/****************************************************************************/ +void lfds700_stack_init_valid_on_current_logical_core( struct lfds700_stack_state *ss, void *user_state ) +{ + LFDS700_PAL_ASSERT( ss != NULL ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) ss->top % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + LFDS700_PAL_ASSERT( (lfds700_pal_uint_t) &ss->user_state % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES == 0 ); + // TRD : user_state can be NULL + + ss->top[POINTER] = NULL; + ss->top[COUNTER] = 0; + + ss->user_state = user_state; + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_stack/lfds700_stack_internal.h b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_stack/lfds700_stack_internal.h new file mode 100644 index 0000000000000000000000000000000000000000..7a7d54180421c96cce9b0a1b6529d4cee90b5564 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_stack/lfds700_stack_internal.h @@ -0,0 +1,5 @@ +/***** the library wide include file *****/ +#include "../liblfds700_internal.h" + +/***** private prototypes *****/ + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_stack/lfds700_stack_pop.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_stack/lfds700_stack_pop.c new file mode 100644 index 0000000000000000000000000000000000000000..3cae2e563e160e526f62bd9ec04d6e553f4a2a0c --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_stack/lfds700_stack_pop.c @@ -0,0 +1,52 @@ +/***** includes *****/ +#include "lfds700_stack_internal.h" + + + + + +/****************************************************************************/ +int lfds700_stack_pop( struct lfds700_stack_state *ss, struct lfds700_stack_element **se, struct lfds700_misc_prng_state *ps ) +{ + char unsigned + result; + + lfds700_pal_uint_t + backoff_iteration = LFDS700_MISC_ABSTRACTION_BACKOFF_INITIAL_VALUE; + + struct lfds700_stack_element LFDS700_PAL_ALIGN(LFDS700_PAL_ALIGN_DOUBLE_POINTER) + *new_top[PAC_SIZE], + *volatile original_top[PAC_SIZE]; + + LFDS700_PAL_ASSERT( ss != NULL ); + LFDS700_PAL_ASSERT( se != NULL ); + LFDS700_PAL_ASSERT( ps != NULL ); + + LFDS700_PAL_BARRIER_PROCESSOR_LOAD; + + original_top[COUNTER] = ss->top[COUNTER]; + original_top[POINTER] = ss->top[POINTER]; + + do + { + if( original_top[POINTER] == NULL ) + { + *se = NULL; + return( 0 ); + } + + new_top[COUNTER] = original_top[COUNTER] + 1; + new_top[POINTER] = original_top[POINTER]->next; + + LFDS700_PAL_ATOMIC_DWCAS_WITH_BACKOFF( &ss->top, original_top, new_top, LFDS700_MISC_CAS_STRENGTH_WEAK, result, backoff_iteration, ps ); + + if( result != 1 ) + LFDS700_PAL_BARRIER_PROCESSOR_LOAD; + } + while( result != 1 ); + + *se = original_top[POINTER]; + + return( 1 ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_stack/lfds700_stack_push.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_stack/lfds700_stack_push.c new file mode 100644 index 0000000000000000000000000000000000000000..ff84c5ed553009506bcfe0e29da0f102bad283dd --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_stack/lfds700_stack_push.c @@ -0,0 +1,42 @@ +/***** includes *****/ +#include "lfds700_stack_internal.h" + + + + + +/****************************************************************************/ +void lfds700_stack_push( struct lfds700_stack_state *ss, struct lfds700_stack_element *se, struct lfds700_misc_prng_state *ps ) +{ + char unsigned + result; + + lfds700_pal_uint_t + backoff_iteration = LFDS700_MISC_ABSTRACTION_BACKOFF_INITIAL_VALUE; + + struct lfds700_stack_element LFDS700_PAL_ALIGN(LFDS700_PAL_ALIGN_DOUBLE_POINTER) + *new_top[PAC_SIZE], + *volatile original_top[PAC_SIZE]; + + LFDS700_PAL_ASSERT( ss != NULL ); + LFDS700_PAL_ASSERT( se != NULL ); + LFDS700_PAL_ASSERT( ps != NULL ); + + new_top[POINTER] = se; + + original_top[COUNTER] = ss->top[COUNTER]; + original_top[POINTER] = ss->top[POINTER]; + + do + { + new_top[COUNTER] = original_top[COUNTER] + 1; + se->next = original_top[POINTER]; + + LFDS700_PAL_BARRIER_PROCESSOR_STORE; + LFDS700_PAL_ATOMIC_DWCAS_WITH_BACKOFF( &ss->top, original_top, new_top, LFDS700_MISC_CAS_STRENGTH_WEAK, result, backoff_iteration, ps ); + } + while( result != 1 ); + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_stack/lfds700_stack_query.c b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_stack/lfds700_stack_query.c new file mode 100644 index 0000000000000000000000000000000000000000..b9abdf9f2d8020be448099a225ab450c4786a0c4 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/lfds700_stack/lfds700_stack_query.c @@ -0,0 +1,123 @@ +/***** includes *****/ +#include "lfds700_stack_internal.h" + +/***** private prototypes *****/ +static void lfds700_stack_internal_stack_validate( struct lfds700_stack_state *ss, struct lfds700_misc_validation_info *vi, enum lfds700_misc_validity *lfds700_stack_validity ); + + + + + +/****************************************************************************/ +void lfds700_stack_query( struct lfds700_stack_state *ss, enum lfds700_stack_query query_type, void *query_input, void *query_output ) +{ + struct lfds700_stack_element + *se; + + LFDS700_MISC_BARRIER_LOAD; + + LFDS700_PAL_ASSERT( ss != NULL ); + // TRD : query_type can be any value in its range + + switch( query_type ) + { + case LFDS700_STACK_QUERY_SINGLETHREADED_GET_COUNT: + LFDS700_PAL_ASSERT( query_input == NULL ); + LFDS700_PAL_ASSERT( query_output != NULL ); + + *(lfds700_pal_uint_t *) query_output = 0; + + se = (struct lfds700_stack_element *) ss->top[POINTER]; + + while( se != NULL ) + { + ( *(lfds700_pal_uint_t *) query_output )++; + se = (struct lfds700_stack_element *) se->next; + } + break; + + case LFDS700_STACK_QUERY_SINGLETHREADED_VALIDATE: + // TRD : query_input can be NULL + LFDS700_PAL_ASSERT( query_output != NULL ); + + lfds700_stack_internal_stack_validate( ss, (struct lfds700_misc_validation_info *) query_input, (enum lfds700_misc_validity *) query_output ); + break; + } + + return; +} + + + + + +/****************************************************************************/ +static void lfds700_stack_internal_stack_validate( struct lfds700_stack_state *ss, struct lfds700_misc_validation_info *vi, enum lfds700_misc_validity *lfds700_stack_validity ) +{ + lfds700_pal_uint_t + number_elements = 0; + + struct lfds700_stack_element + *se_fast, + *se_slow; + + LFDS700_PAL_ASSERT( ss != NULL ); + // TRD : vi can be NULL + LFDS700_PAL_ASSERT( lfds700_stack_validity != NULL ); + + *lfds700_stack_validity = LFDS700_MISC_VALIDITY_VALID; + + se_slow = se_fast = (struct lfds700_stack_element *) ss->top[POINTER]; + + /* TRD : first, check for a loop + we have two pointers + both of which start at the top of the stack + we enter a loop + and on each iteration + we advance one pointer by one element + and the other by two + + we exit the loop when both pointers are NULL + (have reached the end of the stack) + + or + + if we fast pointer 'sees' the slow pointer + which means we have a loop + */ + + if( se_slow != NULL ) + do + { + se_slow = se_slow->next; + + if( se_fast != NULL ) + se_fast = se_fast->next; + + if( se_fast != NULL ) + se_fast = se_fast->next; + } + while( se_slow != NULL and se_fast != se_slow ); + + if( se_fast != NULL and se_slow != NULL and se_fast == se_slow ) + *lfds700_stack_validity = LFDS700_MISC_VALIDITY_INVALID_LOOP; + + /* TRD : now check for expected number of elements + vi can be NULL, in which case we do not check + we know we don't have a loop from our earlier check + */ + + if( *lfds700_stack_validity == LFDS700_MISC_VALIDITY_VALID and vi != NULL ) + { + lfds700_stack_query( ss, LFDS700_STACK_QUERY_SINGLETHREADED_GET_COUNT, NULL, (void *) &number_elements ); + + if( number_elements < vi->min_elements ) + *lfds700_stack_validity = LFDS700_MISC_VALIDITY_INVALID_MISSING_ELEMENTS; + + if( number_elements > vi->max_elements ) + *lfds700_stack_validity = LFDS700_MISC_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; + } + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/liblfds700_internal.h b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/liblfds700_internal.h new file mode 100644 index 0000000000000000000000000000000000000000..fdd8c363eb026f5be0a424eb5e3955e96b5fe87c --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/liblfds700/src/liblfds700_internal.h @@ -0,0 +1,93 @@ +/***** public prototypes *****/ +#include "../inc/liblfds700.h" + +/***** defines *****/ +#define and && +#define or || + +#define NO_FLAGS 0x0 + +#define LFDS700_ABSTRACTION_BACKOFF_LIMIT (0x1 << 10) + +#if( defined _KERNEL_MODE ) + #define MODE_TYPE_STRING "kernel-mode" +#endif + +#if( !defined _KERNEL_MODE ) + #define MODE_TYPE_STRING "user-mode" +#endif + +#if( defined NDEBUG && !defined COVERAGE && !defined TSAN ) + #define BUILD_TYPE_STRING "release" +#endif + +#if( !defined NDEBUG && !defined COVERAGE && !defined TSAN ) + #define BUILD_TYPE_STRING "debug" +#endif + +#if( !defined NDEBUG && defined COVERAGE && !defined TSAN ) + #define BUILD_TYPE_STRING "coverage" +#endif + +#if( !defined NDEBUG && !defined COVERAGE && defined TSAN ) + #define BUILD_TYPE_STRING "threadsanitizer" +#endif + +// TRD : lfds700_pal_atom_t volatile *destination, lfds700_pal_atom_t *compare, lfds700_pal_atom_t new_destination, enum lfds700_misc_cas_strength cas_strength, char unsigned result, lfds700_pal_uint_t *backoff_iteration +#define LFDS700_PAL_ATOMIC_CAS_WITH_BACKOFF( pointer_to_destination, pointer_to_compare, new_destination, cas_strength, result, backoff_iteration, ps ) \ +{ \ + LFDS700_PAL_ATOMIC_CAS( pointer_to_destination, pointer_to_compare, new_destination, cas_strength, result ); \ + \ + if( result == 0 ) \ + { \ + lfds700_pal_uint_t \ + endloop; \ + \ + lfds700_pal_uint_t volatile \ + loop; \ + \ + if( (backoff_iteration) == LFDS700_ABSTRACTION_BACKOFF_LIMIT ) \ + (backoff_iteration) = LFDS700_MISC_ABSTRACTION_BACKOFF_INITIAL_VALUE; \ + \ + if( (backoff_iteration) == LFDS700_MISC_ABSTRACTION_BACKOFF_INITIAL_VALUE ) \ + (backoff_iteration) = 1; \ + else \ + { \ + endloop = ( LFDS700_MISC_PRNG_GENERATE(ps) % (backoff_iteration) ) * ps->local_copy_of_global_exponential_backoff_timeslot_length_in_loop_iterations_for_cas; \ + for( loop = 0 ; loop < endloop ; loop++ ); \ + } \ + \ + (backoff_iteration) <<= 1; \ + } \ +} + +// TRD : lfds700_pal_atom_t volatile (*destination)[2], lfds700_pal_atom_t (*compare)[2], lfds700_pal_atom_t (*new_destination)[2], enum lfds700_misc_cas_strength cas_strength, char unsigned result, lfds700_pal_uint_t *backoff_iteration +#define LFDS700_PAL_ATOMIC_DWCAS_WITH_BACKOFF( pointer_to_destination, pointer_to_compare, pointer_to_new_destination, cas_strength, result, backoff_iteration, ps ) \ +{ \ + LFDS700_PAL_ATOMIC_DWCAS( pointer_to_destination, pointer_to_compare, pointer_to_new_destination, cas_strength, result ); \ + \ + if( result == 0 ) \ + { \ + lfds700_pal_uint_t \ + endloop; \ + \ + lfds700_pal_uint_t volatile \ + loop; \ + \ + if( (backoff_iteration) == LFDS700_ABSTRACTION_BACKOFF_LIMIT ) \ + (backoff_iteration) = LFDS700_MISC_ABSTRACTION_BACKOFF_INITIAL_VALUE; \ + \ + if( (backoff_iteration) == LFDS700_MISC_ABSTRACTION_BACKOFF_INITIAL_VALUE ) \ + (backoff_iteration) = 1; \ + else \ + { \ + endloop = ( LFDS700_MISC_PRNG_GENERATE(ps) % (backoff_iteration) ) * ps->local_copy_of_global_exponential_backoff_timeslot_length_in_loop_iterations_for_dwcas; \ + for( loop = 0 ; loop < endloop ; loop++ ); \ + } \ + \ + (backoff_iteration) <<= 1; \ + } \ +} + +/***** library-wide prototypes *****/ + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/build/gcc_and_gnumake/Makefile b/openair2/UTIL/LFDS/liblfds7.0.0/test/build/gcc_and_gnumake/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..489e5b19e573623e9adc92487303d808ea70d270 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/build/gcc_and_gnumake/Makefile @@ -0,0 +1,129 @@ +##### paths ##### +BINDIR := ../../bin +OBJDIR := ../../obj +SRCDIR := ../../src +LIBINCDIRS := ../../../liblfds700/inc/ +LIBBINDIRS := ../../../liblfds700/bin/ + +##### misc ##### +QUIETLY := 1>nul 2>nul + +##### sources, objects and libraries ##### +BINNAME := test +BINARY := $(BINDIR)/$(BINNAME) +SRCDIRS := . +SOURCES := main.c misc.c \ + test_lfds700_btree_addonly_unbalanced.c test_lfds700_btree_addonly_unbalanced_alignment.c test_lfds700_btree_addonly_unbalanced_random_adds_fail.c test_lfds700_btree_addonly_unbalanced_random_adds_fail_and_overwrite.c test_lfds700_btree_addonly_unbalanced_random_adds_overwrite.c \ + test_lfds700_freelist.c test_lfds700_freelist_alignment.c test_lfds700_freelist_popping.c test_lfds700_freelist_popping_and_pushing.c test_lfds700_freelist_pushing.c test_lfds700_freelist_rapid_popping_and_pushing.c \ + test_lfds700_hash_addonly.c test_lfds700_hash_addonly_alignment.c test_lfds700_hash_addonly_iterate.c test_lfds700_hash_addonly_random_adds_fail.c test_lfds700_hash_addonly_random_adds_fail_and_overwrite.c test_lfds700_hash_addonly_random_adds_overwrite.c \ + test_lfds700_list_addonly_ordered_singlylinked.c test_lfds700_list_addonly_ordered_singlylinked_alignment.c test_lfds700_list_addonly_ordered_singlylinked_new_ordered.c test_lfds700_list_addonly_ordered_singlylinked_new_ordered_with_cursor.c \ + test_lfds700_list_addonly_singlylinked_unordered.c test_lfds700_list_addonly_singlylinked_unordered_alignment.c test_lfds700_list_addonly_singlylinked_unordered_new_after.c test_lfds700_list_addonly_singlylinked_unordered_new_end.c test_lfds700_list_addonly_singlylinked_unordered_new_start.c \ + test_lfds700_porting_abstraction_layer_atomic.c test_lfds700_porting_abstraction_layer_atomic_cas.c test_lfds700_porting_abstraction_layer_atomic_dcas.c test_lfds700_porting_abstraction_layer_atomic_exchange.c \ + test_lfds700_queue.c test_lfds700_queue_alignment.c test_lfds700_queue_dequeuing.c test_lfds700_queue_enqueuing.c test_lfds700_queue_enqueuing_and_dequeuing.c test_lfds700_queue_enqueuing_and_dequeuing_with_free.c test_lfds700_queue_enqueuing_with_malloc_and_dequeuing_with_free.c test_lfds700_queue_rapid_enqueuing_and_dequeuing.c \ + test_lfds700_queue_bounded_singleconsumer_singleproducer.c test_lfds700_queue_bounded_singleconsumer_singleproducer_dequeuing.c test_lfds700_queue_bounded_singleconsumer_singleproducer_enqueuing.c test_lfds700_queue_bounded_singleconsumer_singleproducer_enqueuing_and_dequeuing.c \ + test_lfds700_ringbuffer.c test_lfds700_ringbuffer_reading.c test_lfds700_ringbuffer_reading_and_writing.c test_lfds700_ringbuffer_writing.c \ + test_lfds700_stack.c test_lfds700_stack_alignment.c test_lfds700_stack_popping.c test_lfds700_stack_popping_and_pushing.c test_lfds700_stack_pushing.c test_lfds700_stack_rapid_popping_and_pushing.c \ + test_porting_abstraction_layer_get_logical_core_ids.c test_porting_abstraction_layer_thread_start.c test_porting_abstraction_layer_thread_wait.c \ + util_cmdline.c util_memory_helpers.c util_thread_starter.c +OBJECTS := $(patsubst %.c,$(OBJDIR)/%.o,$(notdir $(SOURCES))) +SYSLIBS := -lm -lpthread -lrt +USRLIBS := -llfds700 + +##### default paths ##### +CPATH += $(LIBINCDIRS) +LIBRARY_PATH += $(LIBBINDIRS) +export CPATH +export LIBRARY_PATH + +##### tools ##### +MAKE := make +MFLAGS := + +DG := gcc +DGFLAGS := -MM -std=gnu89 + +CC := gcc +CFBASE := -c -pthread -std=gnu89 -Wall -Wno-unknown-pragmas +CFCOV := -O0 -ggdb -DCOVERAGE -fprofile-arcs -ftest-coverage +CFDBG := -O0 -ggdb -D_DEBUG +CFPROF := -O0 -ggdb -DPROF -pg +CFREL := -O2 -DNDEBUG -finline-functions -Wno-strict-aliasing +CFTSAN := -O0 -ggdb -DTSAN -fsanitize=thread -fPIE + +LD := gcc +LFBASE := -pthread -std=gnu89 -Wall -Werror +LFCOV := -O0 -fprofile-arcs -ftest-coverage +LFDBG := -O0 -ggdb +LFPROF := -O0 -pg +LFREL := -O2 -s -finline-functions +LFTSAN := -O0 -fsanitize=thread -pie + +PROF := gprof +PFBASE := -b -p -Q $(BINARY) gmon.out + +##### variants and libnuma check ##### +CFLAGS += $(CFBASE) +LFLAGS += $(LFBASE) + +ifeq ($(MAKECMDGOALS),) + CFLAGS += $(CFDBG) + LFLAGS += $(LFDBG) +endif + +ifeq ($(MAKECMDGOALS),cov) + CFLAGS += $(CFCOV) + LFLAGS += $(LFCOV) + SYSLIBS += -lgcov +endif + +ifeq ($(MAKECMDGOALS),dbg) + CFLAGS += $(CFDBG) + LFLAGS += $(LFDBG) +endif + +ifeq ($(MAKECMDGOALS),prof) + CFLAGS += $(CFPROF) + LFLAGS += $(LFPROF) +endif + +ifeq ($(MAKECMDGOALS),rel) + CFLAGS += $(CFREL) + LFLAGS += $(LFREL) +endif + +ifeq ($(MAKECMDGOALS),tsan) + CFLAGS += $(CFTSAN) + LFLAGS += $(LFTSAN) +endif + +##### search paths ##### +vpath %.c $(patsubst %,$(SRCDIR)/%:,$(SRCDIRS)) + +##### implicit rules ##### +$(OBJDIR)/%.o : %.c + $(DG) $(DGFLAGS) $< >$(OBJDIR)/$*.d + $(CC) $(CFLAGS) -o $@ $< + +##### explicit rules ##### +$(BINARY) : $(OBJECTS) + $(LD) -o $(BINARY) $(LFLAGS) $(OBJECTS) $(USRLIBS) $(SYSLIBS) + chmod +x $(BINARY) + +##### phony ##### +.PHONY : clean cov dbg prof rel tsan + +clean : + @rm -f $(BINDIR)/$(BINNAME) $(OBJDIR)/*.o $(OBJDIR)/*.d $(OBJDIR)/*.gcno + +cov : $(BINARY) +dbg : $(BINARY) +prof : $(BINARY) +rel : $(BINARY) +tsan : $(BINARY) + +genprof : + @$(PROF) $(PFBASE) + +##### dependencies ##### +-include $(DEPENDS) + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/build/sdk_for_windows_7_and_gnumake/makefile b/openair2/UTIL/LFDS/liblfds7.0.0/test/build/sdk_for_windows_7_and_gnumake/makefile new file mode 100644 index 0000000000000000000000000000000000000000..c54d16635b09f7e52185bdc75730377b2e9b01ed --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/build/sdk_for_windows_7_and_gnumake/makefile @@ -0,0 +1,106 @@ +##### paths ##### +BINDIR := ..\..\bin +OBJDIR := ..\..\obj +SRCDIR := ..\..\src + +##### misc ##### +QUIETLY := 1>nul 2>nul +NULL := +SPACE := $(NULL) # TRD : necessary trailing space after the close bracket + +##### sources, objects and libraries ##### +BINNAME := test +BINARY := $(BINDIR)\$(BINNAME).exe +SRCDIRS := . +SOURCES := main.c misc.c \ + test_lfds700_btree_addonly_unbalanced.c test_lfds700_btree_addonly_unbalanced_alignment.c test_lfds700_btree_addonly_unbalanced_random_adds_fail.c test_lfds700_btree_addonly_unbalanced_random_adds_fail_and_overwrite.c test_lfds700_btree_addonly_unbalanced_random_adds_overwrite.c \ + test_lfds700_freelist.c test_lfds700_freelist_alignment.c test_lfds700_freelist_popping.c test_lfds700_freelist_popping_and_pushing.c test_lfds700_freelist_pushing.c test_lfds700_freelist_rapid_popping_and_pushing.c \ + test_lfds700_hash_addonly.c test_lfds700_hash_addonly_alignment.c test_lfds700_hash_addonly_iterate.c test_lfds700_hash_addonly_random_adds_fail.c test_lfds700_hash_addonly_random_adds_fail_and_overwrite.c test_lfds700_hash_addonly_random_adds_overwrite.c \ + test_lfds700_list_addonly_ordered_singlylinked.c test_lfds700_list_addonly_ordered_singlylinked_alignment.c test_lfds700_list_addonly_ordered_singlylinked_new_ordered.c test_lfds700_list_addonly_ordered_singlylinked_new_ordered_with_cursor.c \ + test_lfds700_list_addonly_singlylinked_unordered.c test_lfds700_list_addonly_singlylinked_unordered_alignment.c test_lfds700_list_addonly_singlylinked_unordered_new_after.c test_lfds700_list_addonly_singlylinked_unordered_new_end.c test_lfds700_list_addonly_singlylinked_unordered_new_start.c \ + test_lfds700_porting_abstraction_layer_atomic.c test_lfds700_porting_abstraction_layer_atomic_cas.c test_lfds700_porting_abstraction_layer_atomic_dcas.c test_lfds700_porting_abstraction_layer_atomic_exchange.c \ + test_lfds700_queue.c test_lfds700_queue_alignment.c test_lfds700_queue_dequeuing.c test_lfds700_queue_enqueuing.c test_lfds700_queue_enqueuing_and_dequeuing.c test_lfds700_queue_enqueuing_and_dequeuing_with_free.c test_lfds700_queue_enqueuing_with_malloc_and_dequeuing_with_free.c test_lfds700_queue_rapid_enqueuing_and_dequeuing.c \ + test_lfds700_queue_bounded_singleconsumer_singleproducer.c test_lfds700_queue_bounded_singleconsumer_singleproducer_dequeuing.c test_lfds700_queue_bounded_singleconsumer_singleproducer_enqueuing.c test_lfds700_queue_bounded_singleconsumer_singleproducer_enqueuing_and_dequeuing.c \ + test_lfds700_ringbuffer.c test_lfds700_ringbuffer_reading.c test_lfds700_ringbuffer_reading_and_writing.c test_lfds700_ringbuffer_writing.c \ + test_lfds700_stack.c test_lfds700_stack_alignment.c test_lfds700_stack_popping.c test_lfds700_stack_popping_and_pushing.c test_lfds700_stack_pushing.c test_lfds700_stack_rapid_popping_and_pushing.c \ + test_porting_abstraction_layer_get_logical_core_ids.c test_porting_abstraction_layer_thread_start.c test_porting_abstraction_layer_thread_wait.c \ + util_cmdline.c util_memory_helpers.c util_thread_starter.c +OBJECTS := $(patsubst %.c,$(OBJDIR)/%.obj,$(notdir $(SOURCES))) +RESFILE := $(patsubst %.rc,$(OBJDIR)/%.res,$(notdir $(RCFILE))) +SYSLIBS := kernel32.lib +EXTLIBS := +USRLIBS := ../../../liblfds700/bin/liblfds700.lib + +##### default paths fix up ##### +INCLUDE += ;../../../../liblfds700/inc/ +LIB += ;../../../../liblfds700/bin/ + +##### tools ##### +MAKE := make +MFLAGS := + +CC := cl +CFBASE := /c /D_CRT_SECURE_NO_WARNINGS /DWIN32_LEAN_AND_MEAN /DUNICODE /D_UNICODE /DUNICODE "/Fd$(BINDIR)\$(BINNAME).pdb" /nologo /W4 /WX +CFREL := /DNDEBUG /Ox +CFDBG := /D_DEBUG /Od /Gm /Zi + +LD := link +LFBASE := /nologo /subsystem:console /nodefaultlib /nxcompat /wx +LFREL := /incremental:no +LFDBG := /debug "/pdb:$(BINDIR)\$(BINNAME).pdb" + +##### variants ##### +CFLAGS := $(CFBASE) $(CFDBG) /MTd +LFLAGS := $(LFBASE) $(LFDBG) +CLIB := libcmtd.lib + +ifeq ($(MAKECMDGOALS),librel) + CFLAGS := $(CFBASE) $(CFREL) /MT + LFLAGS := $(LFBASE) $(LFREL) + CLIB := libcmt.lib +endif + +ifeq ($(MAKECMDGOALS),libdbg) + CFLAGS := $(CFBASE) $(CFDBG) /MTd + LFLAGS := $(LFBASE) $(LFDBG) + CLIB := libcmtd.lib +endif + +ifeq ($(MAKECMDGOALS),dllrel) + CFLAGS := $(CFBASE) $(CFREL) /MD + LFLAGS := $(LFBASE) $(LFREL) + CLIB := msvcrt.lib +endif + +ifeq ($(MAKECMDGOALS),dlldbg) + CFLAGS := $(CFBASE) $(CFDBG) /MDd + LFLAGS := $(LFBASE) $(LFDBG) + CLIB := msvcrtd.lib +endif + +##### search paths ##### +vpath %.c $(patsubst %,$(SRCDIR)/%;,$(SRCDIRS)) + +##### implicit rules ##### +$(OBJDIR)/%.obj : %.c + $(CC) $(CFLAGS) "/Fo$@" $< + +##### explicit rules ##### +$(BINARY) : $(OBJECTS) $(USRLIBS) + $(LD) $(LFLAGS) $(CLIB) $(SYSLIBS) $(EXTLIBS) $(USRLIBS) $(OBJECTS) /out:$(BINARY) + +##### phony ##### +.PHONY : clean librel libdbg dllrel dlldbg + +clean : + @erase /Q $(OBJDIR)\*.obj $(OBJDIR)\*.res $(BINDIR)\$(BINNAME).* $(QUIETLY) + +dlldbg : $(BINARY) +dllrel : $(BINARY) + +libdbg : $(BINARY) +librel : $(BINARY) + +##### notes ##### +# TRD : we fix up the default paths because cl and link require an extra argument per additional path, which is ugly as hell + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/build/visual_studio_professional_2012/test.sln b/openair2/UTIL/LFDS/liblfds7.0.0/test/build/visual_studio_professional_2012/test.sln new file mode 100644 index 0000000000000000000000000000000000000000..cc8727482fbf464386817e2585714f68cbc3eac3 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/build/visual_studio_professional_2012/test.sln @@ -0,0 +1,67 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "test.vcxproj", "{A6BA3A68-A1D4-4C07-A0D5-7EAE73272A43}" + ProjectSection(ProjectDependencies) = postProject + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0} = {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblfds700", "..\..\..\liblfds700\build\visual_studio_professional_2012\liblfds700.vcxproj", "{1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug DLL|Win32 = Debug DLL|Win32 + Debug DLL|x64 = Debug DLL|x64 + Debug LIB|Win32 = Debug LIB|Win32 + Debug LIB|x64 = Debug LIB|x64 + Release DLL|Win32 = Release DLL|Win32 + Release DLL|x64 = Release DLL|x64 + Release LIB|Win32 = Release LIB|Win32 + Release LIB|x64 = Release LIB|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A6BA3A68-A1D4-4C07-A0D5-7EAE73272A43}.Debug DLL|Win32.ActiveCfg = Debug DLL|Win32 + {A6BA3A68-A1D4-4C07-A0D5-7EAE73272A43}.Debug DLL|Win32.Build.0 = Debug DLL|Win32 + {A6BA3A68-A1D4-4C07-A0D5-7EAE73272A43}.Debug DLL|Win32.Deploy.0 = Debug DLL|Win32 + {A6BA3A68-A1D4-4C07-A0D5-7EAE73272A43}.Debug DLL|x64.ActiveCfg = Debug DLL|x64 + {A6BA3A68-A1D4-4C07-A0D5-7EAE73272A43}.Debug DLL|x64.Build.0 = Debug DLL|x64 + {A6BA3A68-A1D4-4C07-A0D5-7EAE73272A43}.Debug DLL|x64.Deploy.0 = Debug DLL|x64 + {A6BA3A68-A1D4-4C07-A0D5-7EAE73272A43}.Debug LIB|Win32.ActiveCfg = Debug LIB|Win32 + {A6BA3A68-A1D4-4C07-A0D5-7EAE73272A43}.Debug LIB|Win32.Build.0 = Debug LIB|Win32 + {A6BA3A68-A1D4-4C07-A0D5-7EAE73272A43}.Debug LIB|Win32.Deploy.0 = Debug LIB|Win32 + {A6BA3A68-A1D4-4C07-A0D5-7EAE73272A43}.Debug LIB|x64.ActiveCfg = Debug LIB|x64 + {A6BA3A68-A1D4-4C07-A0D5-7EAE73272A43}.Debug LIB|x64.Build.0 = Debug LIB|x64 + {A6BA3A68-A1D4-4C07-A0D5-7EAE73272A43}.Debug LIB|x64.Deploy.0 = Debug LIB|x64 + {A6BA3A68-A1D4-4C07-A0D5-7EAE73272A43}.Release DLL|Win32.ActiveCfg = Release DLL|Win32 + {A6BA3A68-A1D4-4C07-A0D5-7EAE73272A43}.Release DLL|Win32.Build.0 = Release DLL|Win32 + {A6BA3A68-A1D4-4C07-A0D5-7EAE73272A43}.Release DLL|Win32.Deploy.0 = Release DLL|Win32 + {A6BA3A68-A1D4-4C07-A0D5-7EAE73272A43}.Release DLL|x64.ActiveCfg = Release DLL|x64 + {A6BA3A68-A1D4-4C07-A0D5-7EAE73272A43}.Release DLL|x64.Build.0 = Release DLL|x64 + {A6BA3A68-A1D4-4C07-A0D5-7EAE73272A43}.Release DLL|x64.Deploy.0 = Release DLL|x64 + {A6BA3A68-A1D4-4C07-A0D5-7EAE73272A43}.Release LIB|Win32.ActiveCfg = Release LIB|Win32 + {A6BA3A68-A1D4-4C07-A0D5-7EAE73272A43}.Release LIB|Win32.Build.0 = Release LIB|Win32 + {A6BA3A68-A1D4-4C07-A0D5-7EAE73272A43}.Release LIB|Win32.Deploy.0 = Release LIB|Win32 + {A6BA3A68-A1D4-4C07-A0D5-7EAE73272A43}.Release LIB|x64.ActiveCfg = Release LIB|x64 + {A6BA3A68-A1D4-4C07-A0D5-7EAE73272A43}.Release LIB|x64.Build.0 = Release LIB|x64 + {A6BA3A68-A1D4-4C07-A0D5-7EAE73272A43}.Release LIB|x64.Deploy.0 = Release LIB|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug DLL|Win32.ActiveCfg = Debug DLL|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug DLL|Win32.Build.0 = Debug DLL|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug DLL|x64.ActiveCfg = Debug DLL|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug DLL|x64.Build.0 = Debug DLL|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug LIB|Win32.ActiveCfg = Debug LIB|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug LIB|Win32.Build.0 = Debug LIB|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug LIB|x64.ActiveCfg = Debug LIB|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Debug LIB|x64.Build.0 = Debug LIB|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release DLL|Win32.ActiveCfg = Release DLL|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release DLL|Win32.Build.0 = Release DLL|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release DLL|x64.ActiveCfg = Release DLL|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release DLL|x64.Build.0 = Release DLL|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release LIB|Win32.ActiveCfg = Release LIB|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release LIB|Win32.Build.0 = Release LIB|Win32 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release LIB|x64.ActiveCfg = Release LIB|x64 + {1E5D7D09-94F2-455D-AE5E-6C7F4C96BCE0}.Release LIB|x64.Build.0 = Release LIB|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/build/visual_studio_professional_2012/test.vcxproj b/openair2/UTIL/LFDS/liblfds7.0.0/test/build/visual_studio_professional_2012/test.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..3fbf8d78ee5d21ea4327f3438ba3d54d1e819933 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/build/visual_studio_professional_2012/test.vcxproj @@ -0,0 +1,554 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug DLL|Win32"> + <Configuration>Debug DLL</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug DLL|x64"> + <Configuration>Debug DLL</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug LIB|Win32"> + <Configuration>Debug LIB</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug LIB|x64"> + <Configuration>Debug LIB</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release DLL|Win32"> + <Configuration>Release DLL</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release DLL|x64"> + <Configuration>Release DLL</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release LIB|Win32"> + <Configuration>Release LIB</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release LIB|x64"> + <Configuration>Release LIB</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\src\internal.h" /> + <ClInclude Include="..\..\src\test_porting_abstraction_layer_operating_system.h" /> + <ClInclude Include="..\..\src\util_cmdline.h" /> + <ClInclude Include="..\..\src\util_memory_helpers.h" /> + <ClInclude Include="..\..\src\util_thread_starter.h" /> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\src\main.c" /> + <ClCompile Include="..\..\src\misc.c" /> + <ClCompile Include="..\..\src\test_lfds700_btree_addonly_unbalanced.c" /> + <ClCompile Include="..\..\src\test_lfds700_btree_addonly_unbalanced_alignment.c" /> + <ClCompile Include="..\..\src\test_lfds700_btree_addonly_unbalanced_random_adds_fail.c" /> + <ClCompile Include="..\..\src\test_lfds700_btree_addonly_unbalanced_random_adds_fail_and_overwrite.c" /> + <ClCompile Include="..\..\src\test_lfds700_btree_addonly_unbalanced_random_adds_overwrite.c" /> + <ClCompile Include="..\..\src\test_lfds700_freelist.c" /> + <ClCompile Include="..\..\src\test_lfds700_freelist_alignment.c" /> + <ClCompile Include="..\..\src\test_lfds700_freelist_popping.c" /> + <ClCompile Include="..\..\src\test_lfds700_freelist_popping_and_pushing.c" /> + <ClCompile Include="..\..\src\test_lfds700_freelist_pushing.c" /> + <ClCompile Include="..\..\src\test_lfds700_freelist_rapid_popping_and_pushing.c" /> + <ClCompile Include="..\..\src\test_lfds700_hash_addonly.c" /> + <ClCompile Include="..\..\src\test_lfds700_hash_addonly_alignment.c" /> + <ClCompile Include="..\..\src\test_lfds700_hash_addonly_iterate.c" /> + <ClCompile Include="..\..\src\test_lfds700_hash_addonly_random_adds_fail.c" /> + <ClCompile Include="..\..\src\test_lfds700_hash_addonly_random_adds_fail_and_overwrite.c" /> + <ClCompile Include="..\..\src\test_lfds700_hash_addonly_random_adds_overwrite.c" /> + <ClCompile Include="..\..\src\test_lfds700_list_addonly_ordered_singlylinked.c" /> + <ClCompile Include="..\..\src\test_lfds700_list_addonly_ordered_singlylinked_alignment.c" /> + <ClCompile Include="..\..\src\test_lfds700_list_addonly_ordered_singlylinked_new_ordered.c" /> + <ClCompile Include="..\..\src\test_lfds700_list_addonly_ordered_singlylinked_new_ordered_with_cursor.c" /> + <ClCompile Include="..\..\src\test_lfds700_list_addonly_singlylinked_unordered.c" /> + <ClCompile Include="..\..\src\test_lfds700_list_addonly_singlylinked_unordered_alignment.c" /> + <ClCompile Include="..\..\src\test_lfds700_list_addonly_singlylinked_unordered_new_after.c" /> + <ClCompile Include="..\..\src\test_lfds700_list_addonly_singlylinked_unordered_new_end.c" /> + <ClCompile Include="..\..\src\test_lfds700_list_addonly_singlylinked_unordered_new_start.c" /> + <ClCompile Include="..\..\src\test_lfds700_porting_abstraction_layer_atomic.c" /> + <ClCompile Include="..\..\src\test_lfds700_porting_abstraction_layer_atomic_cas.c" /> + <ClCompile Include="..\..\src\test_lfds700_porting_abstraction_layer_atomic_dcas.c" /> + <ClCompile Include="..\..\src\test_lfds700_porting_abstraction_layer_atomic_exchange.c" /> + <ClCompile Include="..\..\src\test_lfds700_queue.c" /> + <ClCompile Include="..\..\src\test_lfds700_queue_alignment.c" /> + <ClCompile Include="..\..\src\test_lfds700_queue_bounded_singleconsumer_singleproducer.c" /> + <ClCompile Include="..\..\src\test_lfds700_queue_bounded_singleconsumer_singleproducer_dequeuing.c" /> + <ClCompile Include="..\..\src\test_lfds700_queue_bounded_singleconsumer_singleproducer_enqueuing.c" /> + <ClCompile Include="..\..\src\test_lfds700_queue_bounded_singleconsumer_singleproducer_enqueuing_and_dequeuing.c" /> + <ClCompile Include="..\..\src\test_lfds700_queue_dequeuing.c" /> + <ClCompile Include="..\..\src\test_lfds700_queue_enqueuing.c" /> + <ClCompile Include="..\..\src\test_lfds700_queue_enqueuing_and_dequeuing.c" /> + <ClCompile Include="..\..\src\test_lfds700_queue_enqueuing_and_dequeuing_with_free.c" /> + <ClCompile Include="..\..\src\test_lfds700_queue_enqueuing_with_malloc_and_dequeuing_with_free.c" /> + <ClCompile Include="..\..\src\test_lfds700_queue_rapid_enqueuing_and_dequeuing.c" /> + <ClCompile Include="..\..\src\test_lfds700_ringbuffer.c" /> + <ClCompile Include="..\..\src\test_lfds700_ringbuffer_reading.c" /> + <ClCompile Include="..\..\src\test_lfds700_ringbuffer_reading_and_writing.c" /> + <ClCompile Include="..\..\src\test_lfds700_ringbuffer_writing.c" /> + <ClCompile Include="..\..\src\test_lfds700_stack.c" /> + <ClCompile Include="..\..\src\test_lfds700_stack_alignment.c" /> + <ClCompile Include="..\..\src\test_lfds700_stack_popping.c" /> + <ClCompile Include="..\..\src\test_lfds700_stack_popping_and_pushing.c" /> + <ClCompile Include="..\..\src\test_lfds700_stack_pushing.c" /> + <ClCompile Include="..\..\src\test_lfds700_stack_rapid_popping_and_pushing.c" /> + <ClCompile Include="..\..\src\test_porting_abstraction_layer_get_logical_core_ids.c" /> + <ClCompile Include="..\..\src\test_porting_abstraction_layer_thread_start.c" /> + <ClCompile Include="..\..\src\test_porting_abstraction_layer_thread_wait.c" /> + <ClCompile Include="..\..\src\util_cmdline.c" /> + <ClCompile Include="..\..\src\util_memory_helpers.c" /> + <ClCompile Include="..\..\src\util_thread_starter.c" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\..\liblfds700\build\visual_studio_professional_2012\liblfds700.vcxproj"> + <Project>{1e5d7d09-94f2-455d-ae5e-6c7f4c96bce0}</Project> + </ProjectReference> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{A6BA3A68-A1D4-4C07-A0D5-7EAE73272A43}</ProjectGuid> + <Keyword>Win32Proj</Keyword> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v110</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v110</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v110</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v110</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v110</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v110</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v110</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v110</PlatformToolset> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'"> + <LinkIncremental>false</LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|Win32'"> + <LinkIncremental>false</LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'"> + <LinkIncremental>false</LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|x64'"> + <LinkIncremental>false</LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'"> + <LinkIncremental>false</LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|Win32'"> + <LinkIncremental>false</LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'"> + <LinkIncremental>false</LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|x64'"> + <LinkIncremental>false</LinkIncremental> + <OutDir>$(ProjectDir)..\..\bin\$(Platform) $(Configuration)\</OutDir> + <IntDir>$(ProjectDir)..\..\obj\$(Platform) $(Configuration)\</IntDir> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <Optimization>Disabled</Optimization> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <SDLCheck>true</SDLCheck> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <IntrinsicFunctions>true</IntrinsicFunctions> + <StringPooling>true</StringPooling> + <MinimalRebuild>false</MinimalRebuild> + <ExceptionHandling>false</ExceptionHandling> + <FunctionLevelLinking>false</FunctionLevelLinking> + <EnableParallelCodeGeneration>false</EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet> + <FloatingPointExceptions>false</FloatingPointExceptions> + <CreateHotpatchableImage>false</CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <BrowseInformation>true</BrowseInformation> + <CompileAs>CompileAsC</CompileAs> + <ErrorReporting>None</ErrorReporting> + <AdditionalIncludeDirectories>..\liblfds700\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <BufferSecurityCheck>true</BufferSecurityCheck> + </ClCompile> + <Link> + <TargetMachine>MachineX86</TargetMachine> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors> + <LinkTimeCodeGeneration> + </LinkTimeCodeGeneration> + <LinkStatus> + </LinkStatus> + <AdditionalDependencies>kernel32.lib;%(AdditionalDependencies)</AdditionalDependencies> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|Win32'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <Optimization>Disabled</Optimization> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <SDLCheck>true</SDLCheck> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <IntrinsicFunctions>true</IntrinsicFunctions> + <StringPooling>true</StringPooling> + <MinimalRebuild>false</MinimalRebuild> + <ExceptionHandling>false</ExceptionHandling> + <FunctionLevelLinking>false</FunctionLevelLinking> + <EnableParallelCodeGeneration>false</EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet> + <FloatingPointExceptions>false</FloatingPointExceptions> + <CreateHotpatchableImage>false</CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <BrowseInformation>true</BrowseInformation> + <CompileAs>CompileAsC</CompileAs> + <ErrorReporting>None</ErrorReporting> + <AdditionalIncludeDirectories>..\liblfds700\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <BufferSecurityCheck>true</BufferSecurityCheck> + </ClCompile> + <Link> + <TargetMachine>MachineX86</TargetMachine> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors> + <LinkTimeCodeGeneration> + </LinkTimeCodeGeneration> + <LinkStatus> + </LinkStatus> + <AdditionalDependencies>kernel32.lib;%(AdditionalDependencies)</AdditionalDependencies> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <Optimization>Disabled</Optimization> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <SDLCheck>true</SDLCheck> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <IntrinsicFunctions>true</IntrinsicFunctions> + <StringPooling>true</StringPooling> + <MinimalRebuild>false</MinimalRebuild> + <ExceptionHandling>false</ExceptionHandling> + <FunctionLevelLinking>false</FunctionLevelLinking> + <EnableParallelCodeGeneration>false</EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet> + <FloatingPointExceptions>false</FloatingPointExceptions> + <CreateHotpatchableImage>false</CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <BrowseInformation>true</BrowseInformation> + <CompileAs>CompileAsC</CompileAs> + <ErrorReporting>None</ErrorReporting> + <BufferSecurityCheck>true</BufferSecurityCheck> + <OmitFramePointers>false</OmitFramePointers> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors> + <LinkTimeCodeGeneration> + </LinkTimeCodeGeneration> + <AdditionalDependencies>kernel32.lib;%(AdditionalDependencies)</AdditionalDependencies> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug LIB|x64'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <Optimization>Disabled</Optimization> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <TreatWarningAsError>true</TreatWarningAsError> + <SDLCheck>true</SDLCheck> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <IntrinsicFunctions>true</IntrinsicFunctions> + <StringPooling>true</StringPooling> + <MinimalRebuild>false</MinimalRebuild> + <ExceptionHandling>false</ExceptionHandling> + <FunctionLevelLinking>false</FunctionLevelLinking> + <EnableParallelCodeGeneration>false</EnableParallelCodeGeneration> + <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet> + <FloatingPointExceptions>false</FloatingPointExceptions> + <CreateHotpatchableImage>false</CreateHotpatchableImage> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <BrowseInformation>true</BrowseInformation> + <CompileAs>CompileAsC</CompileAs> + <ErrorReporting>None</ErrorReporting> + <BufferSecurityCheck>true</BufferSecurityCheck> + <OmitFramePointers>false</OmitFramePointers> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors> + <LinkTimeCodeGeneration> + </LinkTimeCodeGeneration> + <AdditionalDependencies>kernel32.lib;%(AdditionalDependencies)</AdditionalDependencies> + </Link> + <ProjectReference> + <LinkLibraryDependencies>true</LinkLibraryDependencies> + </ProjectReference> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>None</DebugInformationFormat> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <ExceptionHandling>false</ExceptionHandling> + <CreateHotpatchableImage>false</CreateHotpatchableImage> + <CompileAs>CompileAsC</CompileAs> + <TreatWarningAsError>true</TreatWarningAsError> + <SDLCheck> + </SDLCheck> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> + <OmitFramePointers>true</OmitFramePointers> + <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations> + <WholeProgramOptimization>true</WholeProgramOptimization> + <StringPooling>true</StringPooling> + <BufferSecurityCheck>false</BufferSecurityCheck> + <FunctionLevelLinking>true</FunctionLevelLinking> + <EnableParallelCodeGeneration>true</EnableParallelCodeGeneration> + <FloatingPointExceptions>false</FloatingPointExceptions> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <ErrorReporting>None</ErrorReporting> + </ClCompile> + <Link> + <TargetMachine>MachineX86</TargetMachine> + <GenerateDebugInformation>false</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors> + <SetChecksum>true</SetChecksum> + <LinkErrorReporting>NoErrorReport</LinkErrorReporting> + <AdditionalDependencies>kernel32.lib;%(AdditionalDependencies)</AdditionalDependencies> + <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|Win32'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>None</DebugInformationFormat> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <ExceptionHandling>false</ExceptionHandling> + <CreateHotpatchableImage>false</CreateHotpatchableImage> + <CompileAs>CompileAsC</CompileAs> + <TreatWarningAsError>true</TreatWarningAsError> + <SDLCheck> + </SDLCheck> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> + <OmitFramePointers>true</OmitFramePointers> + <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations> + <WholeProgramOptimization>true</WholeProgramOptimization> + <StringPooling>true</StringPooling> + <BufferSecurityCheck>false</BufferSecurityCheck> + <FunctionLevelLinking>true</FunctionLevelLinking> + <EnableParallelCodeGeneration>true</EnableParallelCodeGeneration> + <FloatingPointExceptions>false</FloatingPointExceptions> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <ErrorReporting>None</ErrorReporting> + </ClCompile> + <Link> + <TargetMachine>MachineX86</TargetMachine> + <GenerateDebugInformation>false</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors> + <SetChecksum>true</SetChecksum> + <LinkErrorReporting>NoErrorReport</LinkErrorReporting> + <AdditionalDependencies>kernel32.lib;%(AdditionalDependencies)</AdditionalDependencies> + <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>None</DebugInformationFormat> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <ExceptionHandling>false</ExceptionHandling> + <CreateHotpatchableImage>false</CreateHotpatchableImage> + <CompileAs>CompileAsC</CompileAs> + <TreatWarningAsError>true</TreatWarningAsError> + <SDLCheck> + </SDLCheck> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> + <OmitFramePointers>true</OmitFramePointers> + <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations> + <WholeProgramOptimization>true</WholeProgramOptimization> + <StringPooling>true</StringPooling> + <BufferSecurityCheck>false</BufferSecurityCheck> + <FunctionLevelLinking>true</FunctionLevelLinking> + <EnableParallelCodeGeneration>true</EnableParallelCodeGeneration> + <FloatingPointExceptions>false</FloatingPointExceptions> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <ErrorReporting>None</ErrorReporting> + </ClCompile> + <Link> + <GenerateDebugInformation>false</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors> + <SetChecksum>true</SetChecksum> + <LinkErrorReporting>NoErrorReport</LinkErrorReporting> + <AdditionalDependencies>kernel32.lib;%(AdditionalDependencies)</AdditionalDependencies> + <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release LIB|x64'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>None</DebugInformationFormat> + <CompileAsManaged>false</CompileAsManaged> + <CompileAsWinRT>false</CompileAsWinRT> + <ExceptionHandling>false</ExceptionHandling> + <CreateHotpatchableImage>false</CreateHotpatchableImage> + <CompileAs>CompileAsC</CompileAs> + <TreatWarningAsError>true</TreatWarningAsError> + <SDLCheck> + </SDLCheck> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> + <OmitFramePointers>true</OmitFramePointers> + <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations> + <WholeProgramOptimization>true</WholeProgramOptimization> + <StringPooling>true</StringPooling> + <BufferSecurityCheck>false</BufferSecurityCheck> + <FunctionLevelLinking>true</FunctionLevelLinking> + <EnableParallelCodeGeneration>true</EnableParallelCodeGeneration> + <FloatingPointExceptions>false</FloatingPointExceptions> + <RuntimeTypeInfo>false</RuntimeTypeInfo> + <OpenMPSupport>false</OpenMPSupport> + <ErrorReporting>None</ErrorReporting> + </ClCompile> + <Link> + <GenerateDebugInformation>false</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors> + <SetChecksum>true</SetChecksum> + <LinkErrorReporting>NoErrorReport</LinkErrorReporting> + <AdditionalDependencies>kernel32.lib;%(AdditionalDependencies)</AdditionalDependencies> + <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration> + </Link> + </ItemDefinitionGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project> \ No newline at end of file diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/build/visual_studio_professional_2012/test.vcxproj.filters b/openair2/UTIL/LFDS/liblfds7.0.0/test/build/visual_studio_professional_2012/test.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..69da4b9836a87a84e42d2e73d58efcbfb9e9b028 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/build/visual_studio_professional_2012/test.vcxproj.filters @@ -0,0 +1,216 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> + </Filter> + <Filter Include="Resource Files"> + <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions> + </Filter> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\src\internal.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\src\test_porting_abstraction_layer_operating_system.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\src\util_cmdline.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\src\util_memory_helpers.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\src\util_thread_starter.h"> + <Filter>Header Files</Filter> + </ClInclude> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\src\main.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\misc.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_btree_addonly_unbalanced.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_btree_addonly_unbalanced_alignment.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_btree_addonly_unbalanced_random_adds_fail.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_btree_addonly_unbalanced_random_adds_fail_and_overwrite.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_btree_addonly_unbalanced_random_adds_overwrite.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_freelist.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_freelist_alignment.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_freelist_popping.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_freelist_popping_and_pushing.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_freelist_pushing.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_freelist_rapid_popping_and_pushing.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_hash_addonly.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_hash_addonly_alignment.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_hash_addonly_iterate.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_hash_addonly_random_adds_fail.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_hash_addonly_random_adds_fail_and_overwrite.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_hash_addonly_random_adds_overwrite.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_list_addonly_ordered_singlylinked.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_list_addonly_ordered_singlylinked_alignment.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_list_addonly_ordered_singlylinked_new_ordered.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_list_addonly_ordered_singlylinked_new_ordered_with_cursor.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_list_addonly_singlylinked_unordered.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_list_addonly_singlylinked_unordered_alignment.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_list_addonly_singlylinked_unordered_new_after.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_list_addonly_singlylinked_unordered_new_end.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_list_addonly_singlylinked_unordered_new_start.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_porting_abstraction_layer_atomic.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_porting_abstraction_layer_atomic_cas.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_porting_abstraction_layer_atomic_dcas.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_porting_abstraction_layer_atomic_exchange.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_queue.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_queue_alignment.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_queue_bounded_singleconsumer_singleproducer.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_queue_bounded_singleconsumer_singleproducer_dequeuing.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_queue_bounded_singleconsumer_singleproducer_enqueuing.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_queue_bounded_singleconsumer_singleproducer_enqueuing_and_dequeuing.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_queue_dequeuing.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_queue_enqueuing.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_queue_enqueuing_and_dequeuing.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_queue_enqueuing_and_dequeuing_with_free.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_queue_enqueuing_with_malloc_and_dequeuing_with_free.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_queue_rapid_enqueuing_and_dequeuing.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_ringbuffer.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_ringbuffer_reading.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_ringbuffer_reading_and_writing.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_ringbuffer_writing.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_stack.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_stack_alignment.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_stack_popping.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_stack_popping_and_pushing.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_stack_pushing.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_lfds700_stack_rapid_popping_and_pushing.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_porting_abstraction_layer_get_logical_core_ids.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_porting_abstraction_layer_thread_start.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\test_porting_abstraction_layer_thread_wait.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\util_cmdline.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\util_memory_helpers.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\util_thread_starter.c"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> +</Project> \ No newline at end of file diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/build/visual_studio_professional_2012/test.vcxproj.user b/openair2/UTIL/LFDS/liblfds7.0.0/test/build/visual_studio_professional_2012/test.vcxproj.user new file mode 100644 index 0000000000000000000000000000000000000000..7cbb3216adb733fd25e1bd27d504ac8419b8c5bb --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/build/visual_studio_professional_2012/test.vcxproj.user @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup /> +</Project> \ No newline at end of file diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/internal.h b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/internal.h new file mode 100644 index 0000000000000000000000000000000000000000..14bf02c74c9278eed5b59bc669d0d3f25e0fe293 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/internal.h @@ -0,0 +1,157 @@ +/***** includes *****/ +#define _GNU_SOURCE +#include <assert.h> +#include <ctype.h> +#include <limits.h> +#include <math.h> +#include <stdarg.h> +#include <stddef.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> +#include "../../liblfds700/inc/liblfds700.h" +#include "test_porting_abstraction_layer_operating_system.h" + +/***** defines *****/ +#define and && +#define or || + +#define NO_FLAGS 0x0 + +#define BITS_PER_BYTE 8 + +#define TEST_DURATION_IN_SECONDS 5 +#define TIME_LOOP_COUNT 10000 +#define REDUCED_TIME_LOOP_COUNT 1000 +#define NUMBER_OF_NANOSECONDS_IN_ONE_SECOND 1000000000LLU +#define ONE_MEGABYTE_IN_BYTES (1024 * 1024) +#define DEFAULT_TEST_MEMORY_IN_MEGABYTES 512U +#define TEST_PAL_DEFAULT_NUMA_NODE_ID 0 +#define LFDS700_TEST_VERSION_STRING "7.0.0" +#define LFDS700_TEST_VERSION_INTEGER 700 + +#if( defined _KERNEL_MODE ) + #define MODE_TYPE_STRING "kernel-mode" +#endif + +#if( !defined _KERNEL_MODE ) + #define MODE_TYPE_STRING "user-mode" +#endif + +#if( defined NDEBUG && !defined COVERAGE && !defined TSAN ) + #define BUILD_TYPE_STRING "release" +#endif + +#if( !defined NDEBUG && !defined COVERAGE && !defined TSAN ) + #define BUILD_TYPE_STRING "debug" +#endif + +#if( !defined NDEBUG && defined COVERAGE && !defined TSAN ) + #define BUILD_TYPE_STRING "coverage" +#endif + +#if( !defined NDEBUG && !defined COVERAGE && defined TSAN ) + #define BUILD_TYPE_STRING "threadsanitizer" +#endif + +/***** enums *****/ +enum flag +{ + LOWERED, + RAISED +}; + +/***** structs *****/ +struct test_pal_logical_processor +{ + lfds700_pal_uint_t + logical_processor_number, + windows_logical_processor_group_number; + + struct lfds700_list_asu_element + lasue; +}; + +/***** prototypes *****/ +int main( int argc, char **argv ); + +void internal_display_test_name( char *format_string, ... ); +void internal_display_test_result( lfds700_pal_uint_t number_name_dvs_pairs, ... ); +void internal_display_data_structure_validity( enum lfds700_misc_validity dvs ); +void internal_show_version( void ); +void internal_logical_core_id_element_cleanup_callback( struct lfds700_list_asu_state *lasus, struct lfds700_list_asu_element *lasue ); + +int test_pal_thread_start( test_pal_thread_state_t *thread_state, struct test_pal_logical_processor *lp, test_pal_thread_return_t (TEST_PAL_CALLING_CONVENTION *thread_function)(void *thread_user_state), void *thread_user_state ); +void test_pal_thread_wait( test_pal_thread_state_t thread_state ); +void test_pal_get_logical_core_ids( struct lfds700_list_asu_state *lasus ); + +void test_lfds700_pal_atomic( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + void test_lfds700_pal_atomic_cas( struct lfds700_list_asu_state *list_of_logical_processors ); + void test_lfds700_pal_atomic_dwcas( struct lfds700_list_asu_state *list_of_logical_processors ); + void test_lfds700_pal_atomic_exchange( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + +void test_lfds700_hash_a( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + void test_lfds700_hash_a_alignment( void ); + void test_lfds700_hash_a_fail_and_overwrite_on_existing_key( void ); + void test_lfds700_hash_a_random_adds_fail_on_existing( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + void test_lfds700_hash_a_random_adds_overwrite_on_existing( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + void test_lfds700_hash_a_iterate( void ); + +void test_lfds700_list_aos( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + void test_lfds700_list_aos_alignment( void ); + void test_lfds700_list_aos_new_ordered( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + void test_lfds700_list_aos_new_ordered_with_cursor( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + +void test_lfds700_list_asu( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + void test_lfds700_list_asu_alignment( void ); + void test_lfds700_list_asu_new_start( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + void test_lfds700_list_asu_new_end( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + void test_lfds700_list_asu_new_after( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + +void test_lfds700_btree_au( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + void test_lfds700_btree_au_alignment( void ); + void test_lfds700_btree_au_fail_and_overwrite_on_existing_key( void ); + void test_lfds700_btree_au_random_adds_fail_on_existing( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + void test_lfds700_btree_au_random_adds_overwrite_on_existing( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + +void test_lfds700_freelist( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + void test_lfds700_freelist_alignment( void ); + void test_lfds700_freelist_popping( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + void test_lfds700_freelist_pushing( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + void test_lfds700_freelist_popping_and_pushing( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + void test_lfds700_freelist_rapid_popping_and_pushing( struct lfds700_list_asu_state *list_of_logical_processors ); + void test_lfds700_freelist_pushing_array( void ); + +void test_lfds700_queue( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + void test_lfds700_queue_alignment( void ); + void test_lfds700_queue_enqueuing( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + void test_lfds700_queue_dequeuing( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + void test_lfds700_queue_enqueuing_and_dequeuing( struct lfds700_list_asu_state *list_of_logical_processors ); + void test_lfds700_queue_rapid_enqueuing_and_dequeuing( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + void test_lfds700_queue_enqueuing_and_dequeuing_with_free( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + void test_lfds700_queue_enqueuing_with_malloc_and_dequeuing_with_free( struct lfds700_list_asu_state *list_of_logical_processors ); + +void test_lfds700_queue_bss( struct lfds700_list_asu_state *list_of_logical_processors ); + void test_lfds700_queue_bss_enqueuing( void ); + void test_lfds700_queue_bss_dequeuing( void ); + void test_lfds700_queue_bss_enqueuing_and_dequeuing( struct lfds700_list_asu_state *list_of_logical_processors ); + +void test_lfds700_ringbuffer( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + void test_lfds700_ringbuffer_reading( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + void test_lfds700_ringbuffer_reading_and_writing( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + void test_lfds700_ringbuffer_writing( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + +void test_lfds700_stack( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + void test_lfds700_stack_alignment( void ); + void test_lfds700_stack_pushing( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + void test_lfds700_stack_popping( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + void test_lfds700_stack_popping_and_pushing( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ); + void test_lfds700_stack_rapid_popping_and_pushing( struct lfds700_list_asu_state *list_of_logical_processors ); + void test_lfds700_stack_pushing_array( void ); + +/***** late includes *****/ +#include "util_cmdline.h" +#include "util_memory_helpers.h" +#include "util_thread_starter.h" + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/main.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/main.c new file mode 100644 index 0000000000000000000000000000000000000000..fa6afc8747f5d56f70bcfd3373a3081c448b5ae3 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/main.c @@ -0,0 +1,135 @@ +/***** includes *****/ +#include "internal.h" + + + + + +/****************************************************************************/ +int main( int argc, char **argv ) +{ + enum flag + run_flag = LOWERED, + show_error_flag = LOWERED, + show_help_flag = LOWERED, + show_version_flag = LOWERED; + + int + rv; + + lfds700_pal_uint_t + loop, + iterations = 1, + memory_in_megabytes = DEFAULT_TEST_MEMORY_IN_MEGABYTES; + + struct lfds700_list_asu_state + list_of_logical_processors; + + struct util_cmdline_state + cs; + + union util_cmdline_arg_data + *arg_data; + + assert( argc >= 1 ); + assert( argv != NULL ); + + lfds700_misc_library_init_valid_on_current_logical_core(); + + util_cmdline_init( &cs ); + + util_cmdline_add_arg( &cs, 'h', LIBCOMMON_CMDLINE_ARG_TYPE_FLAG ); + util_cmdline_add_arg( &cs, 'i', LIBCOMMON_CMDLINE_ARG_TYPE_INTEGER ); + util_cmdline_add_arg( &cs, 'm', LIBCOMMON_CMDLINE_ARG_TYPE_INTEGER ); + util_cmdline_add_arg( &cs, 'r', LIBCOMMON_CMDLINE_ARG_TYPE_FLAG ); + util_cmdline_add_arg( &cs, 'v', LIBCOMMON_CMDLINE_ARG_TYPE_FLAG ); + + rv = util_cmdline_process_args( &cs, argc, argv ); + + if( rv == 0 ) + show_error_flag = RAISED; + + if( rv == 1 ) + { + util_cmdline_get_arg_data( &cs, 'h', &arg_data ); + if( arg_data != NULL ) + show_help_flag = RAISED; + + util_cmdline_get_arg_data( &cs, 'i', &arg_data ); + if( arg_data != NULL ) + iterations = (lfds700_pal_uint_t) arg_data->integer.integer; + + util_cmdline_get_arg_data( &cs, 'm', &arg_data ); + if( arg_data != NULL ) + memory_in_megabytes = (lfds700_pal_uint_t) arg_data->integer.integer; + + util_cmdline_get_arg_data( &cs, 'r', &arg_data ); + if( arg_data != NULL ) + run_flag = RAISED; + + util_cmdline_get_arg_data( &cs, 'v', &arg_data ); + if( arg_data != NULL ) + show_version_flag = RAISED; + } + + util_cmdline_cleanup( &cs ); + + if( argc == 1 or (run_flag == LOWERED and show_version_flag == LOWERED) ) + show_help_flag = RAISED; + + if( show_error_flag == RAISED ) + { + printf( "\nInvalid arguments. Sorry - it's a simple parser, so no clues.\n" + "-h or run with no args to see the help text.\n" ); + + return( EXIT_SUCCESS ); + } + + if( show_help_flag == RAISED ) + { + printf( "test -h -i [n] -m [n] -r -v\n" + " -h : help\n" + " -i [n] : number of iterations (default : 1)\n" + " -m [n] : memory for tests, in mb (default : %u)\n" + " -r : run (causes test to run; present so no args gives help)\n" + " -v : version\n", DEFAULT_TEST_MEMORY_IN_MEGABYTES ); + + return( EXIT_SUCCESS ); + } + + if( show_version_flag == RAISED ) + { + internal_show_version(); + return( EXIT_SUCCESS ); + } + + if( run_flag == RAISED ) + { + test_pal_get_logical_core_ids( &list_of_logical_processors ); + + for( loop = 0 ; loop < (lfds700_pal_uint_t) iterations ; loop++ ) + { + printf( "\n" + "Test Iteration %02llu\n" + "=================\n", (int long long unsigned) (loop+1) ); + + test_lfds700_pal_atomic( &list_of_logical_processors, memory_in_megabytes ); + test_lfds700_btree_au( &list_of_logical_processors, memory_in_megabytes ); + test_lfds700_freelist( &list_of_logical_processors, memory_in_megabytes ); + test_lfds700_hash_a( &list_of_logical_processors, memory_in_megabytes ); + test_lfds700_list_aos( &list_of_logical_processors, memory_in_megabytes ); + test_lfds700_list_asu( &list_of_logical_processors, memory_in_megabytes ); + test_lfds700_queue( &list_of_logical_processors, memory_in_megabytes ); + test_lfds700_queue_bss( &list_of_logical_processors ); + test_lfds700_ringbuffer( &list_of_logical_processors, memory_in_megabytes ); + test_lfds700_stack( &list_of_logical_processors, memory_in_megabytes ); + } + + lfds700_list_asu_cleanup( &list_of_logical_processors, internal_logical_core_id_element_cleanup_callback ); + } + + lfds700_misc_library_cleanup(); + + return( EXIT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/misc.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/misc.c new file mode 100644 index 0000000000000000000000000000000000000000..4fa794f68dd02a08767f42584595305e136b38f3 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/misc.c @@ -0,0 +1,191 @@ +/***** includes *****/ +#include "internal.h" + + + + + +/****************************************************************************/ +void internal_display_test_name( char *format_string, ... ) +{ + va_list + va; + + assert( format_string != NULL ); + + va_start( va, format_string ); + + vprintf( format_string, va ); + + printf( "..." ); + + va_end( va ); + + fflush( stdout ); + + return; +} + + + + + +/****************************************************************************/ +void internal_display_test_result( lfds700_pal_uint_t number_name_dvs_pairs, ... ) +{ + char + *name; + + enum flag + passed_flag = RAISED; + + enum lfds700_misc_validity + dvs; + + lfds700_pal_uint_t + loop; + + va_list + va; + + // TRD : number_name_dvs_pairs can be any value in its range + + va_start( va, number_name_dvs_pairs ); + + for( loop = 0 ; loop < number_name_dvs_pairs ; loop++ ) + { + name = va_arg( va, char * ); + dvs = va_arg( va, enum lfds700_misc_validity ); + + if( dvs != LFDS700_MISC_VALIDITY_VALID ) + { + passed_flag = LOWERED; + break; + } + } + + va_end( va ); + + if( passed_flag == RAISED ) + puts( "passed" ); + + if( passed_flag == LOWERED ) + { + printf( "failed (" ); + + va_start( va, number_name_dvs_pairs ); + + for( loop = 0 ; loop < number_name_dvs_pairs ; loop++ ) + { + name = va_arg( va, char * ); + dvs = va_arg( va, enum lfds700_misc_validity ); + + printf( "%s ", name ); + internal_display_data_structure_validity( dvs ); + + if( loop+1 < number_name_dvs_pairs ) + printf( ", " ); + } + + va_end( va ); + + printf( ")\n" ); + + /* TRD : quick hack + the whole test programme needs rewriting + and for now I just want to make it so we + exit with failure upon any test failing + */ + + exit( EXIT_FAILURE ); + } + + return; +} + + + + + +/****************************************************************************/ +void internal_display_data_structure_validity( enum lfds700_misc_validity dvs ) +{ + char + *string = NULL; + + switch( dvs ) + { + case LFDS700_MISC_VALIDITY_VALID: + string = "valid"; + break; + + case LFDS700_MISC_VALIDITY_INVALID_LOOP: + string = "invalid - loop detected"; + break; + + case LFDS700_MISC_VALIDITY_INVALID_ORDER: + string = "invalid - invalid order detected"; + break; + + case LFDS700_MISC_VALIDITY_INVALID_MISSING_ELEMENTS: + string = "invalid - missing elements"; + break; + + case LFDS700_MISC_VALIDITY_INVALID_ADDITIONAL_ELEMENTS: + string = "invalid - additional elements"; + break; + + case LFDS700_MISC_VALIDITY_INVALID_TEST_DATA: + string = "invalid - invalid test data"; + break; + } + + printf( "%s", string ); + + return; +} + + + + + +/****************************************************************************/ +void internal_show_version() +{ + char const + *version_and_build_string; + + printf( "test %s (%s, %s) (" __DATE__ " " __TIME__ ")\n", LFDS700_TEST_VERSION_STRING, BUILD_TYPE_STRING, MODE_TYPE_STRING ); + + lfds700_misc_query( LFDS700_MISC_QUERY_GET_BUILD_AND_VERSION_STRING, NULL, (void **) &version_and_build_string ); + + printf( "%s\n", version_and_build_string ); + + return; +} + + + + + +/****************************************************************************/ +#pragma warning( disable : 4100 ) + +void internal_logical_core_id_element_cleanup_callback( struct lfds700_list_asu_state *lasus, struct lfds700_list_asu_element *lasue ) +{ + struct test_pal_logical_processor + *lp; + + assert( lasus != NULL ); + assert( lasue != NULL ); + + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + + util_aligned_free( lp ); + + return; +} + +#pragma warning( default : 4100 ) + + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_btree_addonly_unbalanced.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_btree_addonly_unbalanced.c new file mode 100644 index 0000000000000000000000000000000000000000..55b94ca5bbf50caa037519092228a1af66c180b4 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_btree_addonly_unbalanced.c @@ -0,0 +1,32 @@ +/***** includes *****/ +#include "internal.h" + + + + + +/****************************************************************************/ +#pragma warning( disable : 4127 ) // TRD : disables MSVC warning for condition expressions being const + +void test_lfds700_btree_au( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + if( LFDS700_MISC_ATOMIC_SUPPORT_CAS and LFDS700_MISC_ATOMIC_SUPPORT_EXCHANGE ) + { + printf( "\n" + "Binary Tree (add-only, unbalanced) Tests\n" + "========================================\n" ); + + test_lfds700_btree_au_alignment(); + test_lfds700_btree_au_fail_and_overwrite_on_existing_key(); + test_lfds700_btree_au_random_adds_fail_on_existing( list_of_logical_processors, memory_in_megabytes ); + test_lfds700_btree_au_random_adds_overwrite_on_existing( list_of_logical_processors, memory_in_megabytes ); + } + + return; +} + +#pragma warning( default : 4127 ) + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_btree_addonly_unbalanced_alignment.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_btree_addonly_unbalanced_alignment.c new file mode 100644 index 0000000000000000000000000000000000000000..ecdaf29adb6a4de87c47ad0497a19d907c0da48a --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_btree_addonly_unbalanced_alignment.c @@ -0,0 +1,64 @@ +/***** includes *****/ +#include "internal.h" + + + + + +/****************************************************************************/ +#pragma warning( disable : 4127 ) // TRD : disables MSVC warning for condition expressions being const + +void test_lfds700_btree_au_alignment() +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + /* TRD : these are compile time checks + but we do them here because this is a test programme + and it should indicate issues to users when it is *run*, + not when it is compiled, because a compile error normally + indicates a problem with the code itself and so is misleading + */ + + internal_display_test_name( "Alignment" ); + + + + // TRD : struct lfds700_btree_au_element + if( offsetof(struct lfds700_btree_au_element,up) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + if( offsetof(struct lfds700_btree_au_element,left) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + if( offsetof(struct lfds700_btree_au_element,right) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + if( offsetof(struct lfds700_btree_au_element,key) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + if( offsetof(struct lfds700_btree_au_element,value) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + if( offsetof(struct lfds700_btree_au_element,key) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + + + // TRD : struct lfds700_btree_au_state + if( offsetof(struct lfds700_btree_au_state,root) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + if( offsetof(struct lfds700_btree_au_state,key_compare_function) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + + + // TRD : print the test result + internal_display_test_result( 1, "btree_au", dvs ); + + return; +} + +#pragma warning( default : 4127 ) + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_btree_addonly_unbalanced_random_adds_fail.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_btree_addonly_unbalanced_random_adds_fail.c new file mode 100644 index 0000000000000000000000000000000000000000..ae043a06691a7889f8c740df3d8ee6ab5bee3a5d --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_btree_addonly_unbalanced_random_adds_fail.c @@ -0,0 +1,319 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_element +{ + struct lfds700_btree_au_element + baue; + + lfds700_pal_uint_t + key; +}; + +struct test_state +{ + lfds700_pal_uint_t + insert_fail_count, + number_elements; + + struct lfds700_btree_au_state + *baus; + + struct test_element + *element_array; +}; + +/***** private prototypes *****/ +static int key_compare_function( void const *new_value, void const *value_in_tree ); +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_adding( void *util_thread_starter_thread_state ); + + + + + +/****************************************************************************/ +void test_lfds700_btree_au_random_adds_fail_on_existing( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + lfds700_pal_uint_t + actual_sum_insert_failure_count, + expected_sum_insert_failure_count, + index = 0, + *key_count_array, + loop, + number_elements, + number_logical_processors, + random_value, + subloop; + + struct lfds700_list_asu_element + *lasue; + + struct lfds700_btree_au_element + *baue = NULL; + + struct lfds700_btree_au_state + baus; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_misc_validation_info + vi; + + struct test_pal_logical_processor + *lp; + + struct util_thread_starter_state + *tts; + + struct test_state + *ts; + + test_pal_thread_state_t + *thread_handles; + + void + *key; + + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + /* TRD : we create a single btree_au + we generate 10k elements per thread (one per logical processor) in an array + we set a random number in each element, which is the key + random numbers are generated are from 0 to 5000, so we must have some duplicates + (we don't use value, so we always pass in a NULL for that when we insert) + + each thread loops, adds those elements into the btree, and counts the total number of insert fails + (we don't count on a per value basis because of the performance hit - we'll be TLBing all the time) + this test has the btree_au set to fail on add, so duplicates should be eliminated + + we then merge the per-thread arrays + + we should find in the tree one of every value, and the sum of the counts of each value (beyond the + first value, which was inserted) in the merged arrays should equal the sum of the insert fails from + each thread + + we check the count of unique values in the merged array and use that when calling the btree_au validation function + + we in-order walk and check that what we have in the tree matches what we have in the merged array + and then check the fail counts + */ + + internal_display_test_name( "Random adds and walking (fail on existing key)" ); + + lfds700_misc_prng_init( &ps ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + lfds700_btree_au_init_valid_on_current_logical_core( &baus, key_compare_function, LFDS700_BTREE_AU_EXISTING_KEY_FAIL, NULL ); + + ts = util_malloc_wrapper( sizeof(struct test_state) * number_logical_processors ); + number_elements = ( memory_in_megabytes * ONE_MEGABYTE_IN_BYTES ) / ( sizeof(struct test_element) * number_logical_processors ); + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + { + (ts+loop)->baus = &baus; + (ts+loop)->element_array = util_aligned_malloc( sizeof(struct test_element) * number_elements, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + (ts+loop)->number_elements = number_elements; + (ts+loop)->insert_fail_count = 0; + + for( subloop = 0 ; subloop < number_elements ; subloop++ ) + { + random_value = LFDS700_MISC_PRNG_GENERATE( &ps ); + ((ts+loop)->element_array+subloop)->key = (lfds700_pal_uint_t) floor( (number_elements/2) * ((double) random_value / (double) LFDS700_MISC_PRNG_MAX) ); + } + } + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors ); + + util_thread_starter_new( &tts, number_logical_processors ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + lasue = NULL; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, thread_adding, ts+loop ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + free( thread_handles ); + + LFDS700_MISC_BARRIER_LOAD; + + /* TRD : now for validation + make an array equal to number_elements, set all to 0 + iterate over every per-thread array, counting the number of each value into this array + so we can know how many elements ought to have failed to be inserted + as well as being able to work out the actual number of elements which should be present in the btree, for the btree validation call + */ + + key_count_array = util_malloc_wrapper( sizeof(lfds700_pal_uint_t) * number_elements ); + for( loop = 0 ; loop < number_elements ; loop++ ) + *(key_count_array+loop) = 0; + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + for( subloop = 0 ; subloop < number_elements ; subloop++ ) + ( *(key_count_array+( (ts+loop)->element_array+subloop)->key) )++; + + // TRD : first, btree validation function + vi.min_elements = number_elements; + + for( loop = 0 ; loop < number_elements ; loop++ ) + if( *(key_count_array+loop) == 0 ) + vi.min_elements--; + + vi.max_elements = vi.min_elements; + + lfds700_btree_au_query( &baus, LFDS700_BTREE_AU_QUERY_SINGLETHREADED_VALIDATE, (void *) &vi, (void *) &dvs ); + + /* TRD : now check the sum of per-thread insert failures + is what it should be, which is the sum of key_count_array, + but with every count minus one (for the single succesful insert) + and where elements of 0 are ignored (i.e. do not have -1 applied) + */ + + expected_sum_insert_failure_count = 0; + + for( loop = 0 ; loop < number_elements ; loop++ ) + if( *(key_count_array+loop) != 0 ) + expected_sum_insert_failure_count += *(key_count_array+loop) - 1; + + actual_sum_insert_failure_count = 0; + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + actual_sum_insert_failure_count += (ts+loop)->insert_fail_count; + + if( expected_sum_insert_failure_count != actual_sum_insert_failure_count ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + /* TRD : now compared the combined array and an in-order walk of the tree + ignoring array elements with the value 0, we should find an exact match + */ + + if( dvs == LFDS700_MISC_VALIDITY_VALID ) + { + // TRD : in-order walk over btree_au and check key_count_array matches + while( dvs == LFDS700_MISC_VALIDITY_VALID and lfds700_btree_au_get_by_absolute_position_and_then_by_relative_position(&baus, &baue, LFDS700_BTREE_AU_ABSOLUTE_POSITION_SMALLEST_IN_TREE, LFDS700_BTREE_AU_RELATIVE_POSITION_NEXT_LARGER_ELEMENT_IN_ENTIRE_TREE) ) + { + key = LFDS700_BTREE_AU_GET_KEY_FROM_ELEMENT( *baue ); + + while( *(key_count_array+index) == 0 ) + index++; + + if( index++ != (lfds700_pal_uint_t) key ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + } + } + + // TRD : cleanup + free( key_count_array ); + + lfds700_btree_au_cleanup( &baus, NULL ); + + // TRD : cleanup + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + util_aligned_free( (ts+loop)->element_array ); + + free( ts ); + + // TRD : print the test result + internal_display_test_result( 1, "btree_au", dvs ); + + return; +} + + + + + +/****************************************************************************/ +#pragma warning( disable : 4100 ) + +static int key_compare_function( void const *new_key, void const *key_in_tree ) +{ + int + cr = 0; + + // TRD : key_new can be any value in its range + // TRD : key_in_tree can be any value in its range + + if( (lfds700_pal_uint_t) new_key < (lfds700_pal_uint_t) key_in_tree ) + cr = -1; + + if( (lfds700_pal_uint_t) new_key > (lfds700_pal_uint_t) key_in_tree ) + cr = 1; + + return( cr ); +} + +#pragma warning( default : 4100 ) + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_adding( void *util_thread_starter_thread_state ) +{ + enum lfds700_btree_au_insert_result + alr; + + lfds700_pal_uint_t + index = 0; + + struct test_state + *ts; + + struct lfds700_misc_prng_state + ps; + + struct util_thread_starter_thread_state + *tsts; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + lfds700_misc_prng_init( &ps ); + + util_thread_starter_ready_and_wait( tsts ); + + while( index < ts->number_elements ) + { + LFDS700_BTREE_AU_SET_KEY_IN_ELEMENT( (ts->element_array+index)->baue, (ts->element_array+index)->key ); + LFDS700_BTREE_AU_SET_VALUE_IN_ELEMENT( (ts->element_array+index)->baue, 0 ); + alr = lfds700_btree_au_insert( ts->baus, &(ts->element_array+index)->baue, NULL, &ps ); + + if( alr == LFDS700_BTREE_AU_INSERT_RESULT_FAILURE_EXISTING_KEY ) + ts->insert_fail_count++; + + index++; + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_btree_addonly_unbalanced_random_adds_fail_and_overwrite.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_btree_addonly_unbalanced_random_adds_fail_and_overwrite.c new file mode 100644 index 0000000000000000000000000000000000000000..4c638c86005722e04a059ca2383959c9f3f6119e --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_btree_addonly_unbalanced_random_adds_fail_and_overwrite.c @@ -0,0 +1,140 @@ +/***** includes *****/ +#include "internal.h" + +/***** private prototypes *****/ +static int key_compare_function( void const *new_value, void const *value_in_tree ); + + + + + +/****************************************************************************/ +void test_lfds700_btree_au_fail_and_overwrite_on_existing_key() +{ + enum lfds700_btree_au_insert_result + alr; + + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + struct lfds700_btree_au_element + baue_one, + baue_two, + *existing_baue; + + struct lfds700_btree_au_state + baus; + + struct lfds700_misc_prng_state + ps; + + void + *value; + + /* TRD : the random_adds tests with fail and overwrite don't (can't, not in a performant manner) + test that the fail and/or overwrite of user data has *actually* happened - they use the + return value from the link function call, rather than empirically observing the final + state of the tree + + as such, we now have a couple of single threaded tests where we check that the user data + value really is being modified (or not modified, as the case may be) + */ + + internal_display_test_name( "Fail and overwrite on existing key" ); + + lfds700_misc_prng_init( &ps ); + + /* TRD : so, we make a tree which is fail on existing + add one element, with a known user data + we then try to add the same key again, with a different user data + the call should fail, and then we get the element by its key + and check its user data is unchanged + (and confirm the failed link returned the correct existing_baue) + that's the first test done + */ + + lfds700_btree_au_init_valid_on_current_logical_core( &baus, key_compare_function, LFDS700_BTREE_AU_EXISTING_KEY_FAIL, NULL ); + + LFDS700_BTREE_AU_SET_KEY_IN_ELEMENT( baue_one, 0 ); + LFDS700_BTREE_AU_SET_VALUE_IN_ELEMENT( baue_one, 1 ); + alr = lfds700_btree_au_insert( &baus, &baue_one, NULL, &ps ); + + if( alr != LFDS700_BTREE_AU_INSERT_RESULT_SUCCESS ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + LFDS700_BTREE_AU_SET_KEY_IN_ELEMENT( baue_two, 0 ); + LFDS700_BTREE_AU_SET_VALUE_IN_ELEMENT( baue_two, 2 ); + alr = lfds700_btree_au_insert( &baus, &baue_two, &existing_baue, &ps ); + + if( alr != LFDS700_BTREE_AU_INSERT_RESULT_FAILURE_EXISTING_KEY ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + if( existing_baue != &baue_one ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + value = LFDS700_BTREE_AU_GET_VALUE_FROM_ELEMENT( *existing_baue ); + + if( (void *) (lfds700_pal_uint_t) value != (void *) (lfds700_pal_uint_t) 1 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + lfds700_btree_au_cleanup( &baus, NULL ); + + /* TRD : second test, make a tree which is overwrite on existing + add one element, with a known user data + we then try to add the same key again, with a different user data + the call should succeed, and then we get the element by its key + and check its user data is changed + (and confirm the failed link returned the correct existing_baue) + that's the secondtest done + */ + + lfds700_btree_au_init_valid_on_current_logical_core( &baus, key_compare_function, LFDS700_BTREE_AU_EXISTING_KEY_OVERWRITE, NULL ); + + LFDS700_BTREE_AU_SET_KEY_IN_ELEMENT( baue_one, 0 ); + LFDS700_BTREE_AU_SET_VALUE_IN_ELEMENT( baue_one, 1 ); + alr = lfds700_btree_au_insert( &baus, &baue_one, NULL, &ps ); + + if( alr != LFDS700_BTREE_AU_INSERT_RESULT_SUCCESS ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + LFDS700_BTREE_AU_SET_KEY_IN_ELEMENT( baue_two, 0 ); + LFDS700_BTREE_AU_SET_VALUE_IN_ELEMENT( baue_two, 2 ); + alr = lfds700_btree_au_insert( &baus, &baue_two, NULL, &ps ); + + if( alr != LFDS700_BTREE_AU_INSERT_RESULT_SUCCESS_OVERWRITE ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + lfds700_btree_au_cleanup( &baus, NULL ); + + // TRD : print the test result + internal_display_test_result( 1, "btree_au", dvs ); + + return; +} + + + + + +/****************************************************************************/ +#pragma warning( disable : 4100 ) + +static int key_compare_function( void const *new_key, void const *key_in_tree ) +{ + int + cr = 0; + + // TRD : key_new can be any value in its range + // TRD : key_in_tree can be any value in its range + + if( (lfds700_pal_uint_t) new_key < (lfds700_pal_uint_t) key_in_tree ) + cr = -1; + + if( (lfds700_pal_uint_t) new_key > (lfds700_pal_uint_t) key_in_tree ) + cr = 1; + + return( cr ); +} + +#pragma warning( default : 4100 ) + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_btree_addonly_unbalanced_random_adds_overwrite.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_btree_addonly_unbalanced_random_adds_overwrite.c new file mode 100644 index 0000000000000000000000000000000000000000..c9b162128b3e0316e05c0065e8fc22405df39662 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_btree_addonly_unbalanced_random_adds_overwrite.c @@ -0,0 +1,322 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_element +{ + struct lfds700_btree_au_element + baue; + + lfds700_pal_uint_t + key; +}; + +struct test_state +{ + lfds700_pal_uint_t + insert_existing_count, + number_elements; + + struct lfds700_btree_au_state + *baus; + + struct test_element + *element_array; +}; + +/***** private prototypes *****/ +static int key_compare_function( void const *new_value, void const *value_in_tree ); +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_adding( void *util_thread_starter_thread_state ); + + + + + +/****************************************************************************/ +void test_lfds700_btree_au_random_adds_overwrite_on_existing( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + lfds700_pal_uint_t + actual_sum_insert_existing_count, + expected_sum_insert_existing_count, + index = 0, + *key_count_array, + loop, + number_elements, + number_logical_processors, + random_value, + subloop; + + struct lfds700_list_asu_element + *lasue; + + struct lfds700_btree_au_element + *baue = NULL; + + struct lfds700_btree_au_state + baus; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_misc_validation_info + vi; + + struct test_pal_logical_processor + *lp; + + struct util_thread_starter_state + *tts; + + struct test_state + *ts; + + test_pal_thread_state_t + *thread_handles; + + void + *key; + + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + /* TRD : we create a single btree_au + we generate 10k elements per thread (one per logical processor) in an array + we set a random number in each element, which is the key + random numbers are generated are from 0 to 5000, so we must have some duplicates + (we don't use value, so we always pass in a NULL for that when we insert) + + each thread loops, adds those elements into the btree, and counts the total number of insert fails + (we don't count on a per value basis because of the performance hit - we'll be TLBing all the time) + this test has the btree_au set to overwrite on add, so duplicates should be eliminated + + we then merge the per-thread arrays + + we should find in the tree one of every value, and the sum of the counts of each value (beyond the + first value, which was inserted) in the merged arrays should equal the sum of the existing_baues returned + from each thread when they inserted and found an existing element + + we check the count of unique values in the merged array and use that when calling the btree_au validation function + + we in-order walk and check that what we have in the tree matches what we have in the merged array + and then check the fail counts + */ + + internal_display_test_name( "Random adds and walking (overwrite on existing key)" ); + + lfds700_misc_prng_init( &ps ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + lfds700_btree_au_init_valid_on_current_logical_core( &baus, key_compare_function, LFDS700_BTREE_AU_EXISTING_KEY_OVERWRITE, NULL ); + + ts = util_malloc_wrapper( sizeof(struct test_state) * number_logical_processors ); + number_elements = ( memory_in_megabytes * ONE_MEGABYTE_IN_BYTES ) / ( sizeof(struct test_element) * number_logical_processors ); + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + { + (ts+loop)->baus = &baus; + (ts+loop)->element_array = util_aligned_malloc( sizeof(struct test_element) * number_elements, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + (ts+loop)->number_elements = number_elements; + (ts+loop)->insert_existing_count = 0; + + for( subloop = 0 ; subloop < number_elements ; subloop++ ) + { + random_value = LFDS700_MISC_PRNG_GENERATE( &ps ); + ((ts+loop)->element_array+subloop)->key = (lfds700_pal_uint_t) floor( (number_elements/2) * ((double) random_value / (double) LFDS700_MISC_PRNG_MAX) ); + } + } + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors ); + + util_thread_starter_new( &tts, number_logical_processors ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + lasue = NULL; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, thread_adding, ts+loop ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + free( thread_handles ); + + LFDS700_MISC_BARRIER_LOAD; + + /* TRD : now for validation + make an array equal to number_elements, set all to 0 + iterate over every per-thread array, counting the number of each value into this array + so we can know how many elements ought to have failed to be inserted + as well as being able to work out the actual number of elements which should be present in the btree, for the btree validation call + */ + + key_count_array = util_malloc_wrapper( sizeof(lfds700_pal_uint_t) * number_elements ); + for( loop = 0 ; loop < number_elements ; loop++ ) + *(key_count_array+loop) = 0; + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + for( subloop = 0 ; subloop < number_elements ; subloop++ ) + ( *(key_count_array+( (ts+loop)->element_array+subloop)->key) )++; + + // TRD : first, btree validation function + vi.min_elements = number_elements; + + for( loop = 0 ; loop < number_elements ; loop++ ) + if( *(key_count_array+loop) == 0 ) + vi.min_elements--; + + vi.max_elements = vi.min_elements; + + lfds700_btree_au_query( &baus, LFDS700_BTREE_AU_QUERY_SINGLETHREADED_VALIDATE, (void *) &vi, (void *) &dvs ); + + /* TRD : now check the sum of per-thread insert failures + is what it should be, which is the sum of key_count_array, + but with every count minus one (for the single succesful insert) + and where elements of 0 are ignored (i.e. do not have -1 applied) + */ + + expected_sum_insert_existing_count = 0; + + for( loop = 0 ; loop < number_elements ; loop++ ) + if( *(key_count_array+loop) != 0 ) + expected_sum_insert_existing_count += *(key_count_array+loop) - 1; + + actual_sum_insert_existing_count = 0; + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + actual_sum_insert_existing_count += (ts+loop)->insert_existing_count; + + if( expected_sum_insert_existing_count != actual_sum_insert_existing_count ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + /* TRD : now compared the combined array and an in-order walk of the tree + ignoring array elements with the value 0, we should find an exact match + */ + + if( dvs == LFDS700_MISC_VALIDITY_VALID ) + { + // TRD : in-order walk over btree_au and check key_count_array matches + while( dvs == LFDS700_MISC_VALIDITY_VALID and lfds700_btree_au_get_by_absolute_position_and_then_by_relative_position(&baus, &baue, LFDS700_BTREE_AU_ABSOLUTE_POSITION_SMALLEST_IN_TREE, LFDS700_BTREE_AU_RELATIVE_POSITION_NEXT_LARGER_ELEMENT_IN_ENTIRE_TREE) ) + { + key = LFDS700_BTREE_AU_GET_KEY_FROM_ELEMENT( *baue ); + + while( *(key_count_array+index) == 0 ) + index++; + + if( index++ != (lfds700_pal_uint_t) key ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + } + } + + // TRD : cleanup + free( key_count_array ); + + lfds700_btree_au_cleanup( &baus, NULL ); + + // TRD : cleanup + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + util_aligned_free( (ts+loop)->element_array ); + + free( ts ); + + // TRD : print the test result + internal_display_test_result( 1, "btree_au", dvs ); + + return; +} + + + + + +/****************************************************************************/ +#pragma warning( disable : 4100 ) + +static int key_compare_function( void const *new_key, void const *key_in_tree ) +{ + int + cr = 0; + + // TRD : key_new can be any value in its range + // TRD : key_in_tree can be any value in its range + + if( (lfds700_pal_uint_t) new_key < (lfds700_pal_uint_t) key_in_tree ) + cr = -1; + + if( (lfds700_pal_uint_t) new_key > (lfds700_pal_uint_t) key_in_tree ) + cr = 1; + + return( cr ); +} + +#pragma warning( default : 4100 ) + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_adding( void *util_thread_starter_thread_state ) +{ + enum lfds700_btree_au_insert_result + alr; + + lfds700_pal_uint_t + index = 0; + + struct test_state + *ts; + + struct lfds700_btree_au_element + *existing_baue; + + struct lfds700_misc_prng_state + ps; + + struct util_thread_starter_thread_state + *tsts; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + lfds700_misc_prng_init( &ps ); + + util_thread_starter_ready_and_wait( tsts ); + + while( index < ts->number_elements ) + { + LFDS700_BTREE_AU_SET_KEY_IN_ELEMENT( (ts->element_array+index)->baue, (ts->element_array+index)->key ); + LFDS700_BTREE_AU_SET_VALUE_IN_ELEMENT( (ts->element_array+index)->baue, 0 ); + alr = lfds700_btree_au_insert( ts->baus, &(ts->element_array+index)->baue, &existing_baue, &ps ); + + if( alr == LFDS700_BTREE_AU_INSERT_RESULT_SUCCESS_OVERWRITE ) + ts->insert_existing_count++; + + index++; + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_freelist.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_freelist.c new file mode 100644 index 0000000000000000000000000000000000000000..1968ae7167c04d30bf4bb61e23f4b6efaae50503 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_freelist.c @@ -0,0 +1,33 @@ +/***** includes *****/ +#include "internal.h" + + + + + +/****************************************************************************/ +#pragma warning( disable : 4127 ) // TRD : disables MSVC warning for condition expressions being const + +void test_lfds700_freelist( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + if( LFDS700_MISC_ATOMIC_SUPPORT_DWCAS ) + { + printf( "\n" + "Freelist Tests\n" + "==============\n" ); + + test_lfds700_freelist_alignment(); + test_lfds700_freelist_popping( list_of_logical_processors, memory_in_megabytes ); + test_lfds700_freelist_pushing( list_of_logical_processors, memory_in_megabytes ); + test_lfds700_freelist_popping_and_pushing( list_of_logical_processors, memory_in_megabytes ); + test_lfds700_freelist_rapid_popping_and_pushing( list_of_logical_processors ); + } + + return; +} + +#pragma warning( default : 4127 ) + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_freelist_alignment.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_freelist_alignment.c new file mode 100644 index 0000000000000000000000000000000000000000..885ecbf8c4ab6bfb9c7ee16e95cc1845f5624d95 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_freelist_alignment.c @@ -0,0 +1,43 @@ +/***** includes *****/ +#include "internal.h" + + + + + +/****************************************************************************/ +#pragma warning( disable : 4127 ) // TRD : disables MSVC warning for condition expressions being const + +void test_lfds700_freelist_alignment() +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + /* TRD : these are compile time checks + but we do them here because this is a test programme + and it should indicate issues to users when it is *run*, + not when it is compiled, because a compile error normally + indicates a problem with the code itself and so is misleading + */ + + internal_display_test_name( "Alignment" ); + + + + // TRD : struct lfds700_freelist_state + if( offsetof(struct lfds700_freelist_state,top) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + if( offsetof(struct lfds700_freelist_state,user_state) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + + + // TRD : print the test result + internal_display_test_result( 1, "freelist", dvs ); + + return; +} + +#pragma warning( default : 4127 ) + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_freelist_popping.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_freelist_popping.c new file mode 100644 index 0000000000000000000000000000000000000000..6dcbd0847abbca5839e2b0cb8055a457d1ff546a --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_freelist_popping.c @@ -0,0 +1,205 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_state +{ + struct lfds700_freelist_state + *fs; +}; + +struct test_element +{ + struct lfds700_freelist_element + fe; + + enum flag + popped_flag; +}; + +/***** private prototypes *****/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_popping( void *util_thread_starter_thread_state ); + + + + + +/****************************************************************************/ +void test_lfds700_freelist_popping( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + lfds700_pal_uint_t + loop, + number_elements, + number_logical_processors; + + struct lfds700_list_asu_element + *lasue; + + struct lfds700_freelist_state + fs; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_misc_validation_info + vi = { 0, 0 }; + + struct test_pal_logical_processor + *lp; + + struct util_thread_starter_state + *tts; + + struct test_element + *te_array; + + struct test_state + *ts; + + test_pal_thread_state_t + *thread_handles; + + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + /* TRD : we create a freelist with 1,000,000 elements + + the creation function runs in a single thread and creates + and pushes those elements onto the freelist + + each element contains a void pointer to the container test element + + we then run one thread per CPU + where each thread loops, popping as quickly as possible + each test element has a flag which indicates it has been popped + + the threads run till the source freelist is empty + + we then check the test elements + every element should have been popped + + then tidy up + + we have no extra code for CAS/GC as we're only popping + */ + + internal_display_test_name( "Popping" ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + lfds700_misc_prng_init( &ps ); + + lfds700_freelist_init_valid_on_current_logical_core( &fs, NULL ); + + number_elements = ( memory_in_megabytes * ONE_MEGABYTE_IN_BYTES ) / sizeof(struct test_element); + + te_array = util_aligned_malloc( sizeof(struct test_element) * number_elements, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + for( loop = 0 ; loop < number_elements ; loop++ ) + { + (te_array+loop)->popped_flag = LOWERED; + LFDS700_FREELIST_SET_VALUE_IN_ELEMENT( (te_array+loop)->fe, te_array+loop ); + lfds700_freelist_push( &fs, &(te_array+loop)->fe, &ps ); + } + + ts = util_aligned_malloc( sizeof(struct test_state) * number_logical_processors, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + (ts+loop)->fs = &fs; + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors ); + + util_thread_starter_new( &tts, number_logical_processors ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + lasue = NULL; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, thread_popping, ts+loop ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + free( thread_handles ); + + LFDS700_MISC_BARRIER_LOAD; + + lfds700_freelist_query( &fs, LFDS700_FREELIST_QUERY_SINGLETHREADED_VALIDATE, &vi, &dvs ); + + // TRD : now we check each element has popped_flag set to RAISED + for( loop = 0 ; loop < number_elements ; loop++ ) + if( (te_array+loop)->popped_flag == LOWERED ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + // TRD : cleanup + lfds700_freelist_cleanup( &fs, NULL ); + util_aligned_free( ts ); + util_aligned_free( te_array ); + + // TRD : print the test result + internal_display_test_result( 1, "freelist", dvs ); + + return; +} + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_popping( void *util_thread_starter_thread_state ) +{ + struct lfds700_freelist_element + *fe; + + struct lfds700_misc_prng_state + ps; + + struct test_element + *te; + + struct test_state + *ts; + + struct util_thread_starter_thread_state + *tsts; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + lfds700_misc_prng_init( &ps ); + + util_thread_starter_ready_and_wait( tsts ); + + while( lfds700_freelist_pop(ts->fs, &fe, &ps) ) + { + te = LFDS700_FREELIST_GET_VALUE_FROM_ELEMENT( *fe ); + te->popped_flag = RAISED; + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_freelist_popping_and_pushing.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_freelist_popping_and_pushing.c new file mode 100644 index 0000000000000000000000000000000000000000..8c411151d3795967962c62f4a0f82031d05685bb --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_freelist_popping_and_pushing.c @@ -0,0 +1,319 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_element; + +struct test_state +{ + struct lfds700_freelist_state + fs_thread_local, + *fs; + + lfds700_pal_uint_t + number_elements; + + struct test_element + *fs_thread_local_te_array; +}; + +struct test_element +{ + struct lfds700_freelist_element + fe, + thread_local_fe; + + lfds700_pal_uint_t + datum; +}; + +/***** private prototypes *****/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_popping_and_pushing_start_popping( void *util_thread_starter_thread_state ); +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_popping_and_pushing_start_pushing( void *util_thread_starter_thread_state ); + + + + + +/****************************************************************************/ +void test_lfds700_freelist_popping_and_pushing( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + enum lfds700_misc_validity + dvs; + + lfds700_pal_uint_t + loop, + number_elements, + number_logical_processors, + subloop; + + struct lfds700_list_asu_element + *lasue; + + struct lfds700_freelist_state + fs; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_misc_validation_info + vi; + + struct test_pal_logical_processor + *lp; + + struct util_thread_starter_state + *tts; + + struct test_element + *te_array; + + struct test_state + *ts; + + test_pal_thread_state_t + *thread_handles; + + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + /* TRD : we have two threads per CPU + the threads loop for ten seconds + the first thread pushes 10000 elements then pops 10000 elements + the second thread pops 10000 elements then pushes 10000 elements + all pushes and pops go onto the single main freelist + with a per-thread local freelist to store the pops + + after time is up, all threads push what they have remaining onto + the main freelist + + we then validate the main freelist + */ + + internal_display_test_name( "Popping and pushing (%d seconds)", TEST_DURATION_IN_SECONDS ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + lfds700_misc_prng_init( &ps ); + + number_elements = ( memory_in_megabytes * ONE_MEGABYTE_IN_BYTES ) / ( sizeof(struct test_element) * number_logical_processors * 2 ); + + lfds700_freelist_init_valid_on_current_logical_core( &fs, NULL ); + + // TRD : we allocate half the total elements here, and half again later, which is why *2 above, but not here + te_array = util_aligned_malloc( sizeof(struct test_element) * number_elements * number_logical_processors, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + // TRD : initial elements in the main freelist so the popping threads can start immediately + for( loop = 0 ; loop < number_elements * number_logical_processors ; loop++ ) + { + (te_array+loop)->datum = loop; + LFDS700_FREELIST_SET_VALUE_IN_ELEMENT( (te_array+loop)->fe, te_array+loop ); + lfds700_freelist_push( &fs, &(te_array+loop)->fe, &ps ); + } + + ts = util_aligned_malloc( sizeof(struct test_state) * number_logical_processors * 2, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + { + // TRD : first set of threads (poppers) + (ts+loop)->fs = &fs; + (ts+loop)->number_elements = number_elements; + lfds700_freelist_init_valid_on_current_logical_core( &(ts+loop)->fs_thread_local, NULL ); + + // TRD : second set of threads (pushers - who need elements in their per-thread freelists) + (ts+loop+number_logical_processors)->fs = &fs; + (ts+loop+number_logical_processors)->number_elements = number_elements; + lfds700_freelist_init_valid_on_current_logical_core( &(ts+loop+number_logical_processors)->fs_thread_local, NULL ); + + // TRD : fill the pushing thread freelists + (ts+loop+number_logical_processors)->fs_thread_local_te_array = util_aligned_malloc( sizeof(struct test_element) * number_elements, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + for( subloop = 0 ; subloop < number_elements ; subloop++ ) + { + ((ts+loop+number_logical_processors)->fs_thread_local_te_array+subloop)->datum = loop; + LFDS700_FREELIST_SET_VALUE_IN_ELEMENT( ((ts+loop+number_logical_processors)->fs_thread_local_te_array+subloop)->thread_local_fe, (ts+loop+number_logical_processors)->fs_thread_local_te_array+subloop ); + lfds700_freelist_push( &(ts+loop+number_logical_processors)->fs_thread_local, &((ts+loop+number_logical_processors)->fs_thread_local_te_array+subloop)->thread_local_fe, &ps ); + } + } + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors * 2 ); + + util_thread_starter_new( &tts, number_logical_processors * 2 ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + lasue = NULL; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, thread_popping_and_pushing_start_popping, ts+loop ); + util_thread_starter_start( tts, &thread_handles[loop+number_logical_processors], loop+number_logical_processors, lp, thread_popping_and_pushing_start_pushing, ts+loop+number_logical_processors ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors * 2 ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + free( thread_handles ); + + LFDS700_MISC_BARRIER_LOAD; + + vi.min_elements = vi.max_elements = number_elements * number_logical_processors * 2; + + lfds700_freelist_query( &fs, LFDS700_FREELIST_QUERY_SINGLETHREADED_VALIDATE, (void *) &vi, (void *) &dvs ); + + lfds700_freelist_cleanup( &fs, NULL ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + { + lfds700_freelist_cleanup( &(ts+loop)->fs_thread_local, NULL ); + lfds700_freelist_cleanup( &(ts+loop+number_logical_processors)->fs_thread_local, NULL ); + util_aligned_free( (ts+loop+number_logical_processors)->fs_thread_local_te_array ); + } + + util_aligned_free( ts ); + + util_aligned_free( te_array ); + + // TRD : print the test result + internal_display_test_result( 1, "freelist", dvs ); + + return; +} + + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_popping_and_pushing_start_popping( void *util_thread_starter_thread_state ) +{ + lfds700_pal_uint_t + count; + + struct lfds700_freelist_element + *fe; + + struct lfds700_misc_prng_state + ps; + + struct util_thread_starter_thread_state + *tsts; + + struct test_state + *ts; + + time_t + start_time; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + lfds700_misc_prng_init( &ps ); + + util_thread_starter_ready_and_wait( tsts ); + + start_time = time( NULL ); + + while( time(NULL) < start_time + TEST_DURATION_IN_SECONDS ) + { + count = 0; + + while( count < ts->number_elements ) + if( lfds700_freelist_pop(ts->fs, &fe, &ps) ) + { + // TRD : we do nothing with the test data, so there'ss no GET or SET here + lfds700_freelist_push( &ts->fs_thread_local, fe, &ps ); + count++; + } + + // TRD : return our local freelist to the main freelist + while( lfds700_freelist_pop(&ts->fs_thread_local, &fe, &ps) ) + lfds700_freelist_push( ts->fs, fe, &ps ); + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_popping_and_pushing_start_pushing( void *util_thread_starter_thread_state ) +{ + lfds700_pal_uint_t + count; + + struct lfds700_freelist_element + *fe; + + struct lfds700_misc_prng_state + ps; + + struct test_state + *ts; + + struct util_thread_starter_thread_state + *tsts; + + time_t + start_time; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + lfds700_misc_prng_init( &ps ); + + util_thread_starter_ready_and_wait( tsts ); + + start_time = time( NULL ); + + while( time(NULL) < start_time + TEST_DURATION_IN_SECONDS ) + { + // TRD : return our local freelist to the main freelist + while( lfds700_freelist_pop(&ts->fs_thread_local, &fe, &ps) ) + lfds700_freelist_push( ts->fs, fe, &ps ); + + count = 0; + + while( count < ts->number_elements ) + if( lfds700_freelist_pop(ts->fs, &fe, &ps) ) + { + lfds700_freelist_push( &ts->fs_thread_local, fe, &ps ); + count++; + } + } + + // TRD : now push whatever we have in our local freelist + while( lfds700_freelist_pop(&ts->fs_thread_local, &fe, &ps) ) + lfds700_freelist_push( ts->fs, fe, &ps ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_freelist_pushing.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_freelist_pushing.c new file mode 100644 index 0000000000000000000000000000000000000000..0e756c5e2d42f37dad150229204d11d68a106bd7 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_freelist_pushing.c @@ -0,0 +1,246 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_state +{ + lfds700_pal_uint_t + number_elements, + thread_number; + + struct lfds700_freelist_state + *fs; + + struct test_element + *te_array; +}; + +struct test_element +{ + struct lfds700_freelist_element + fe; + + lfds700_pal_uint_t + datum, + thread_number; +}; + +/***** private prototypes *****/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_pushing( void *util_thread_starter_thread_state ); + + + + + +/****************************************************************************/ +void test_lfds700_freelist_pushing( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + lfds700_pal_uint_t + loop, + number_elements, + number_logical_processors, + *per_thread_counters; + + struct lfds700_list_asu_element + *lasue; + + struct lfds700_freelist_element + *fe; + + struct lfds700_freelist_state + fs; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_misc_validation_info + vi; + + struct test_pal_logical_processor + *lp; + + struct util_thread_starter_state + *tts; + + struct test_element + *te, + *first_te = NULL; + + struct test_state + *ts; + + test_pal_thread_state_t + *thread_handles; + + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + /* TRD : we create an empty freelist + + we then create one thread per CPU, where each thread + pushes 100,000 elements each as quickly as possible to the freelist + + the data pushed is a counter and a thread ID + + the threads exit when the freelist is full + + we then validate the freelist; + + checking that the counts increment on a per unique ID basis + and that the number of elements we pop equals 100,000 per thread + (since each element has an incrementing counter which is + unique on a per unique ID basis, we can know we didn't lose + any elements) + */ + + internal_display_test_name( "Pushing" ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + lfds700_misc_prng_init( &ps ); + + number_elements = ( memory_in_megabytes * ONE_MEGABYTE_IN_BYTES ) / ( sizeof(struct test_element) * number_logical_processors ); + + // TRD : the main freelist + lfds700_freelist_init_valid_on_current_logical_core( &fs, NULL ); + + ts = util_malloc_wrapper( sizeof(struct test_state) * number_logical_processors ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + { + (ts+loop)->fs = &fs; + (ts+loop)->thread_number = loop; + (ts+loop)->number_elements = number_elements; + } + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors ); + + util_thread_starter_new( &tts, number_logical_processors ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + lasue = NULL; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, thread_pushing, ts+loop ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + free( thread_handles ); + + LFDS700_MISC_BARRIER_LOAD; + + per_thread_counters = util_malloc_wrapper( sizeof(lfds700_pal_uint_t) * number_logical_processors ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + *(per_thread_counters+loop) = number_elements - 1; + + vi.min_elements = vi.max_elements = number_elements * number_logical_processors; + + lfds700_freelist_query( &fs, LFDS700_STACK_QUERY_SINGLETHREADED_VALIDATE, &vi, &dvs ); + + while( dvs == LFDS700_MISC_VALIDITY_VALID and lfds700_freelist_pop(&fs, &fe, &ps) ) + { + te = LFDS700_FREELIST_GET_VALUE_FROM_ELEMENT( *fe ); + + if( first_te == NULL ) + first_te = te; + + if( te->thread_number >= number_logical_processors ) + { + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + break; + } + + if( te->datum > per_thread_counters[te->thread_number] ) + dvs = LFDS700_MISC_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; + + if( te->datum < per_thread_counters[te->thread_number] ) + dvs = LFDS700_MISC_VALIDITY_INVALID_MISSING_ELEMENTS; + + if( te->datum == per_thread_counters[te->thread_number] ) + per_thread_counters[te->thread_number]--; + } + + // TRD : clean up + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + util_aligned_free( (ts+loop)->te_array ); + + free( per_thread_counters ); + + free( ts ); + + lfds700_freelist_cleanup( &fs, NULL ); + + // TRD : print the test result + internal_display_test_result( 1, "freelist", dvs ); + + return; +} + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_pushing( void *util_thread_starter_thread_state ) +{ + lfds700_pal_uint_t + loop; + + struct lfds700_misc_prng_state + ps; + + struct test_state + *ts; + + struct util_thread_starter_thread_state + *tsts; + + LFDS700_MISC_BARRIER_LOAD; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + lfds700_misc_prng_init( &ps ); + + ts->te_array = util_aligned_malloc( sizeof(struct test_element) * ts->number_elements, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + for( loop = 0 ; loop < ts->number_elements ; loop++ ) + { + (ts->te_array+loop)->thread_number = ts->thread_number; + (ts->te_array+loop)->datum = loop; + } + + util_thread_starter_ready_and_wait( tsts ); + + for( loop = 0 ; loop < ts->number_elements ; loop++ ) + { + LFDS700_FREELIST_SET_VALUE_IN_ELEMENT( (ts->te_array+loop)->fe, ts->te_array+loop ); + lfds700_freelist_push( ts->fs, &(ts->te_array+loop)->fe, &ps ); + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_freelist_rapid_popping_and_pushing.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_freelist_rapid_popping_and_pushing.c new file mode 100644 index 0000000000000000000000000000000000000000..15a0f9fd69a3ce186b35a2cf5221dde3a0a94741 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_freelist_rapid_popping_and_pushing.c @@ -0,0 +1,216 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_state +{ + struct lfds700_freelist_state + *fs; +}; + +struct test_element +{ + struct lfds700_freelist_element + fe; + + lfds700_pal_uint_t + datum; +}; + +/***** private prototypes *****/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_rapid_popping_and_pushing( void *util_thread_starter_thread_state ); + + + + + +/****************************************************************************/ +void test_lfds700_freelist_rapid_popping_and_pushing( struct lfds700_list_asu_state *list_of_logical_processors ) +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + lfds700_pal_uint_t + loop, + number_logical_processors; + + struct lfds700_list_asu_element + *lasue; + + struct lfds700_freelist_state + fs; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_misc_validation_info + vi = { 0, 0 }; + + struct test_pal_logical_processor + *lp; + + struct util_thread_starter_state + *tts; + + struct test_element + *te_array; + + struct test_state + *ts; + + test_pal_thread_state_t + *thread_handles; + + assert( list_of_logical_processors != NULL ); + + /* TRD : in these tests there is a fundamental antagonism between + how much checking/memory clean up that we do and the + likelyhood of collisions between threads in their lock-free + operations + + the lock-free operations are very quick; if we do anything + much at all between operations, we greatly reduce the chance + of threads colliding + + so we have some tests which do enough checking/clean up that + they can tell the freelist is valid and don't leak memory + and here, this test now is one of those which does minimal + checking - in fact, the nature of the test is that you can't + do any real checking - but goes very quickly + + what we do is create a small freelist and then run one thread + per CPU, where each thread simply pushes and then immediately + pops + + the test runs for ten seconds + + after the test is done, the only check we do is to traverse + the freelist, checking for loops and ensuring the number of + elements is correct + */ + + internal_display_test_name( "Rapid popping and pushing (10 seconds)" ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + lfds700_misc_prng_init( &ps ); + + lfds700_freelist_init_valid_on_current_logical_core( &fs, NULL ); + + ts = util_malloc_wrapper( sizeof(struct test_state) * number_logical_processors ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + (ts+loop)->fs = &fs; + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors ); + + // TRD : we need one element per thread + te_array = util_aligned_malloc( sizeof(struct test_element) * number_logical_processors, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + { + LFDS700_FREELIST_SET_VALUE_IN_ELEMENT( (te_array+loop)->fe, te_array+loop ); + lfds700_freelist_push( &fs, &(te_array+loop)->fe, &ps ); + } + + util_thread_starter_new( &tts, number_logical_processors ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + lasue = NULL; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, thread_rapid_popping_and_pushing, ts+loop ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + free( thread_handles ); + + LFDS700_MISC_BARRIER_LOAD; + + vi.min_elements = vi.max_elements = number_logical_processors; + + lfds700_freelist_query( &fs, LFDS700_STACK_QUERY_SINGLETHREADED_VALIDATE, &vi, &dvs ); + + lfds700_freelist_cleanup( &fs, NULL ); + + util_aligned_free( te_array ); + + free( ts ); + + // TRD : print the test result + internal_display_test_result( 1, "freelist", dvs ); + + return; +} + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_rapid_popping_and_pushing( void *util_thread_starter_thread_state ) +{ + lfds700_pal_uint_t + time_loop = 0; + + struct lfds700_freelist_element + *fe; + + struct lfds700_misc_prng_state + ps; + + struct test_state + *ts; + + struct util_thread_starter_thread_state + *tsts; + + time_t + current_time, + start_time; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + lfds700_misc_prng_init( &ps ); + + util_thread_starter_ready_and_wait( tsts ); + + current_time = start_time = time( NULL ); + + while( current_time < start_time + TEST_DURATION_IN_SECONDS ) + { + lfds700_freelist_pop( ts->fs, &fe, &ps ); + lfds700_freelist_push( ts->fs, fe, &ps ); + + if( time_loop++ == TIME_LOOP_COUNT ) + { + time_loop = 0; + time( ¤t_time ); + } + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_hash_addonly.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_hash_addonly.c new file mode 100644 index 0000000000000000000000000000000000000000..eeb98727c5251da0eddfd00ba470e6dc989f3191 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_hash_addonly.c @@ -0,0 +1,33 @@ +/***** includes *****/ +#include "internal.h" + + + + + +/****************************************************************************/ +#pragma warning( disable : 4127 ) // TRD : disables MSVC warning for condition expressions being const + +void test_lfds700_hash_a( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + if( LFDS700_MISC_ATOMIC_SUPPORT_CAS ) + { + printf( "\n" + "Hash (add-only) Tests\n" + "=====================\n" ); + + test_lfds700_hash_a_alignment(); + test_lfds700_hash_a_fail_and_overwrite_on_existing_key(); + test_lfds700_hash_a_random_adds_fail_on_existing( list_of_logical_processors, memory_in_megabytes ); + test_lfds700_hash_a_random_adds_overwrite_on_existing( list_of_logical_processors, memory_in_megabytes ); + test_lfds700_hash_a_iterate(); + } + + return; +} + +#pragma warning( default : 4127 ) + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_hash_addonly_alignment.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_hash_addonly_alignment.c new file mode 100644 index 0000000000000000000000000000000000000000..2d0a0a5b8e235435815544c291dea14c523c0bd7 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_hash_addonly_alignment.c @@ -0,0 +1,40 @@ +/***** includes *****/ +#include "internal.h" + + + + + +/****************************************************************************/ +#pragma warning( disable : 4127 ) // TRD : disables MSVC warning for condition expressions being const + +void test_lfds700_hash_a_alignment() +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + /* TRD : these are compile time checks + but we do them here because this is a test programme + and it should indicate issues to users when it is *run*, + not when it is compiled, because a compile error normally + indicates a problem with the code itself and so is misleading + */ + + internal_display_test_name( "Alignment" ); + + + + // TRD : struct lfds700_hash_a_element + if( offsetof(struct lfds700_hash_a_element,value) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + + + // TRD : print the test result + internal_display_test_result( 1, "freelist", dvs ); + + return; +} + +#pragma warning( default : 4127 ) + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_hash_addonly_iterate.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_hash_addonly_iterate.c new file mode 100644 index 0000000000000000000000000000000000000000..cf4899e31bdad4b41b23f8fb772b6ce7e58a4d0a --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_hash_addonly_iterate.c @@ -0,0 +1,224 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_element +{ + struct lfds700_btree_au_element + baue; + + lfds700_pal_uint_t + datum; +}; + +struct test_state +{ + enum lfds700_misc_flag + error_flag; + + struct lfds700_hash_a_state + *has; + + struct test_element + *element_array; +}; + +/***** private prototypes *****/ +static int key_compare_function( void const *new_key, void const *existing_key ); +static void key_hash_function( void const *key, lfds700_pal_uint_t *hash ); + + + + + +/****************************************************************************/ +void test_lfds700_hash_a_iterate( void ) +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + lfds700_pal_uint_t + *counter_array, + loop; + + struct lfds700_hash_a_element + *hae; + + struct lfds700_hash_a_iterate + hai; + + struct lfds700_hash_a_state + has; + + struct lfds700_hash_a_element + *element_array; + + struct lfds700_btree_au_state + *baus; + + struct lfds700_misc_prng_state + ps; + + void + *value; + + /* TRD : single-threaded test + we create a single hash_a + we populate with 1000 elements + where key and value is the number of the element (e.g. 0 to 999) + we then allocate 1000 counters, init to 0 + we then iterate + we increment each element as we see it in the iterate + if any are missing or seen more than once, problemo! + + we do this once with a table of 10, to ensure each table has (or almost certainly has) something in + and then a second tiem with a table of 10000, to ensure some empty tables exist + */ + + internal_display_test_name( "Iterate" ); + + lfds700_misc_prng_init( &ps ); + + element_array = util_aligned_malloc( sizeof(struct lfds700_hash_a_element) * 1000, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + counter_array = util_malloc_wrapper( sizeof(lfds700_pal_uint_t) * 1000 ); + + // TRD : first time around + baus = util_aligned_malloc( sizeof(struct lfds700_btree_au_state) * 10, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + lfds700_hash_a_init_valid_on_current_logical_core( &has, baus, 10, key_compare_function, key_hash_function, LFDS700_HASH_A_EXISTING_KEY_FAIL, NULL ); + + for( loop = 0 ; loop < 1000 ; loop++ ) + { + LFDS700_HASH_A_SET_KEY_IN_ELEMENT( *(element_array+loop), loop ); + LFDS700_HASH_A_SET_VALUE_IN_ELEMENT( *(element_array+loop), loop ); + lfds700_hash_a_insert( &has, element_array+loop, NULL, &ps ); + } + + for( loop = 0 ; loop < 1000 ; loop++ ) + *(counter_array+loop) = 0; + + lfds700_hash_a_iterate_init( &has, &hai ); + + while( dvs == LFDS700_MISC_VALIDITY_VALID and lfds700_hash_a_iterate(&hai, &hae) ) + { + value = LFDS700_HASH_A_GET_VALUE_FROM_ELEMENT( *hae ); + ( *(counter_array + (lfds700_pal_uint_t) value) )++; + } + + if( dvs == LFDS700_MISC_VALIDITY_VALID ) + for( loop = 0 ; loop < 1000 ; loop++ ) + { + if( *(counter_array+loop) > 1 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; + + if( *(counter_array+loop) == 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_MISSING_ELEMENTS; + } + + lfds700_hash_a_cleanup( &has, NULL ); + + util_aligned_free( baus ); + + // TRD : second time around + if( dvs == LFDS700_MISC_VALIDITY_VALID ) + { + baus = util_aligned_malloc( sizeof(struct lfds700_btree_au_state) * 10000, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + lfds700_hash_a_init_valid_on_current_logical_core( &has, baus, 10000, key_compare_function, key_hash_function, LFDS700_HASH_A_EXISTING_KEY_FAIL, NULL ); + + for( loop = 0 ; loop < 1000 ; loop++ ) + { + LFDS700_HASH_A_SET_KEY_IN_ELEMENT( *(element_array+loop), loop ); + LFDS700_HASH_A_SET_VALUE_IN_ELEMENT( *(element_array+loop), loop ); + lfds700_hash_a_insert( &has, element_array+loop, NULL, &ps ); + } + + for( loop = 0 ; loop < 1000 ; loop++ ) + *(counter_array+loop) = 0; + + lfds700_hash_a_iterate_init( &has, &hai ); + + while( dvs == LFDS700_MISC_VALIDITY_VALID and lfds700_hash_a_iterate(&hai, &hae) ) + { + value = LFDS700_HASH_A_GET_VALUE_FROM_ELEMENT( *hae ); + ( *(counter_array + (lfds700_pal_uint_t) value ) )++; + } + + if( dvs == LFDS700_MISC_VALIDITY_VALID ) + for( loop = 0 ; loop < 1000 ; loop++ ) + { + if( *(counter_array+loop) > 1 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; + + if( *(counter_array+loop) == 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_MISSING_ELEMENTS; + } + + lfds700_hash_a_cleanup( &has, NULL ); + + util_aligned_free( baus ); + } + + // TRD : cleanup + util_aligned_free( element_array ); + free( counter_array ); + + // TRD : print the test result + internal_display_test_result( 1, "hash_a", dvs ); + + return; +} + + + + + +/****************************************************************************/ +#pragma warning( disable : 4100 ) + +static int key_compare_function( void const *new_key, void const *existing_key ) +{ + int + cr = 0; + + // TRD : new_key can be NULL (i.e. 0) + // TRD : existing_key can be NULL (i.e. 0) + + if( (lfds700_pal_uint_t) new_key < (lfds700_pal_uint_t) existing_key ) + cr = -1; + + if( (lfds700_pal_uint_t) new_key > (lfds700_pal_uint_t) existing_key ) + cr = 1; + + return( cr ); +} + +#pragma warning( default : 4100 ) + + + + + +/****************************************************************************/ +#pragma warning( disable : 4100 ) + +static void key_hash_function( void const *key, lfds700_pal_uint_t *hash ) +{ + // TRD : key can be NULL + assert( hash != NULL ); + + *hash = 0; + + /* TRD : this function iterates over the user data + and we are using the void pointer AS user data + so here we need to pass in the addy of value + */ + + LFDS700_HASH_A_32BIT_HASH_FUNCTION( (void *) &key, sizeof(lfds700_pal_uint_t), *hash ); + + return; +} + +#pragma warning( default : 4100 ) + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_hash_addonly_random_adds_fail.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_hash_addonly_random_adds_fail.c new file mode 100644 index 0000000000000000000000000000000000000000..5d36e47a3164da9bde30fea5cb3467c9541fa135 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_hash_addonly_random_adds_fail.c @@ -0,0 +1,314 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_element +{ + struct lfds700_hash_a_element + hae; + + lfds700_pal_uint_t + datum, + key; +}; + +struct test_state +{ + enum flag + error_flag; + + lfds700_pal_uint_t + number_elements_per_thread; + + struct lfds700_hash_a_state + *has; + + struct test_element + *element_array; +}; + +/***** private prototypes *****/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_adding( void *util_thread_starter_thread_state ); +static int key_compare_function( void const *new_key, void const *existing_key ); +static void key_hash_function( void const *key, lfds700_pal_uint_t *hash ); + + + + + +/****************************************************************************/ +void test_lfds700_hash_a_random_adds_fail_on_existing( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + lfds700_pal_uint_t + loop, + number_elements_per_thread, + number_elements_total, + number_logical_processors, + offset, + temp, + value; + + struct lfds700_hash_a_element + *hae; + + struct lfds700_hash_a_state + has; + + struct lfds700_list_asu_element + *lasue = NULL; + + struct lfds700_btree_au_state + *baus; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_misc_validation_info + vi; + + struct test_pal_logical_processor + *lp; + + struct util_thread_starter_state + *tts; + + struct test_element + *element_array; + + struct test_state + *ts; + + test_pal_thread_state_t + *thread_handles; + + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + /* TRD : we create a single hash_a + we generate 100k elements per thread (with one thread per logical processor) in an array + each element is unique + we randomly sort the elements + then each thread loops, adds those elements into the hash_a + we check that each datum inserts okay - failure will occur on non-unique data, i.e. two identical keys + we should have no failures + we then call the hash_a validation function + then using the hash_a get() we check all the elements we added are present + */ + + internal_display_test_name( "Random adds and get (fail on existing key)" ); + + lfds700_misc_prng_init( &ps ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + baus = util_aligned_malloc( sizeof(struct lfds700_btree_au_state) * 1000, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + lfds700_hash_a_init_valid_on_current_logical_core( &has, baus, 1000, key_compare_function, key_hash_function, LFDS700_HASH_A_EXISTING_KEY_FAIL, NULL ); + + number_elements_per_thread = ( memory_in_megabytes * ONE_MEGABYTE_IN_BYTES ) / ( sizeof(struct test_element) * number_logical_processors ); + number_elements_total = number_elements_per_thread * number_logical_processors; + + // TRD : created an ordered list of unique numbers + element_array = util_aligned_malloc( sizeof(struct test_element) * number_elements_total, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + for( loop = 0 ; loop < number_elements_total ; loop++ ) + { + (element_array+loop)->key = loop; + // TRD : + number_elements just to make it different to the key + (element_array+loop)->datum = loop + number_elements_total; + } + + for( loop = 0 ; loop < number_elements_total ; loop++ ) + { + offset = LFDS700_MISC_PRNG_GENERATE( &ps ); + offset %= number_elements_total; + temp = (element_array + offset)->key; + (element_array + offset)->key = (element_array + loop)->key; + (element_array + loop)->key = temp; + } + + ts = util_malloc_wrapper( sizeof(struct test_state) * number_logical_processors ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + { + (ts+loop)->has = &has; + (ts+loop)->element_array = element_array + number_elements_per_thread*loop; + (ts+loop)->error_flag = LOWERED; + (ts+loop)->number_elements_per_thread = number_elements_per_thread; + } + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors ); + + util_thread_starter_new( &tts, number_logical_processors ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, thread_adding, ts+loop ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + free( thread_handles ); + + LFDS700_MISC_BARRIER_LOAD; + + // TRD : now for validation + vi.min_elements = vi.max_elements = number_elements_total; + lfds700_hash_a_query( &has, LFDS700_HASH_A_QUERY_SINGLETHREADED_VALIDATE, (void *) &vi, (void *) &dvs ); + + /* TRD : now we attempt to lfds700_hash_a_get_by_key() for every element in number_array + any failure to find is an error + we also check we've obtained the correct element + */ + + for( loop = 0 ; dvs == LFDS700_MISC_VALIDITY_VALID and loop < number_elements_total ; loop++ ) + if( 0 == lfds700_hash_a_get_by_key(&has, (void *) (ts->element_array+loop)->key, &hae) ) + dvs = LFDS700_MISC_VALIDITY_INVALID_MISSING_ELEMENTS; + else + { + value = (lfds700_pal_uint_t) LFDS700_HASH_A_GET_VALUE_FROM_ELEMENT( *hae ); + if( (ts->element_array+loop)->datum != value ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + } + + // TRD : just check error_flags weren't raised + if( dvs == LFDS700_MISC_VALIDITY_VALID ) + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + if( (ts+loop)->error_flag == RAISED ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + // TRD : cleanup + lfds700_hash_a_cleanup( &has, NULL ); + + util_aligned_free( baus ); + + free( ts ); + + util_aligned_free( element_array ); + + // TRD : print the test result + internal_display_test_result( 1, "hash_a", dvs ); + + return; +} + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_adding( void *util_thread_starter_thread_state ) +{ + enum lfds700_hash_a_insert_result + apr; + + lfds700_pal_uint_t + index = 0; + + struct test_state + *ts; + + struct lfds700_misc_prng_state + ps; + + struct util_thread_starter_thread_state + *tsts; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + lfds700_misc_prng_init( &ps ); + + util_thread_starter_ready_and_wait( tsts ); + + while( index < ts->number_elements_per_thread ) + { + LFDS700_HASH_A_SET_KEY_IN_ELEMENT( (ts->element_array+index)->hae, (ts->element_array+index)->key ); + LFDS700_HASH_A_SET_VALUE_IN_ELEMENT( (ts->element_array+index)->hae, (ts->element_array+index)->datum ); + apr = lfds700_hash_a_insert( ts->has, &(ts->element_array+index)->hae, NULL, &ps ); + + if( apr == LFDS700_HASH_A_PUT_RESULT_FAILURE_EXISTING_KEY ) + ts->error_flag = RAISED; + + index++; + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + + + + + +/****************************************************************************/ +#pragma warning( disable : 4100 ) + +static int key_compare_function( void const *new_key, void const *existing_key ) +{ + int + cr = 0; + + // TRD : new_key can be NULL (i.e. 0) + // TRD : existing_key can be NULL (i.e. 0) + + if( (lfds700_pal_uint_t) new_key < (lfds700_pal_uint_t) existing_key ) + cr = -1; + + if( (lfds700_pal_uint_t) new_key > (lfds700_pal_uint_t) existing_key ) + cr = 1; + + return( cr ); +} + +#pragma warning( default : 4100 ) + + + + + +/****************************************************************************/ +#pragma warning( disable : 4100 ) + +static void key_hash_function( void const *key, lfds700_pal_uint_t *hash ) +{ + // TRD : key can be NULL + assert( hash != NULL ); + + *hash = 0; + + /* TRD : this function iterates over the user data + and we are using the void pointer *as* key data + so here we need to pass in the addy of key + */ + + LFDS700_HASH_A_32BIT_HASH_FUNCTION( (void *) &key, sizeof(lfds700_pal_uint_t), *hash ); + + return; +} + +#pragma warning( default : 4100 ) + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_hash_addonly_random_adds_fail_and_overwrite.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_hash_addonly_random_adds_fail_and_overwrite.c new file mode 100644 index 0000000000000000000000000000000000000000..cc18900273cf4699b0e6a3b9e1a85539824ff135 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_hash_addonly_random_adds_fail_and_overwrite.c @@ -0,0 +1,137 @@ +/***** includes *****/ +#include "internal.h" + +/***** private prototypes *****/ +static int key_compare_function( void const *new_value, void const *value_in_tree ); +static void key_hash_function( void const *key, lfds700_pal_uint_t *hash ); + + + + + +/****************************************************************************/ +void test_lfds700_hash_a_fail_and_overwrite_on_existing_key() +{ + enum lfds700_hash_a_insert_result + apr; + + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + struct lfds700_hash_a_element + hae_one, + hae_two; + + struct lfds700_hash_a_state + has; + + struct lfds700_btree_au_state + *baus; + + struct lfds700_misc_prng_state + ps; + + internal_display_test_name( "Fail and overwrite on existing key" ); + + lfds700_misc_prng_init( &ps ); + + baus = util_aligned_malloc( sizeof(struct lfds700_btree_au_state) * 10, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + // TRD : fail on overwrite + lfds700_hash_a_init_valid_on_current_logical_core( &has, baus, 10, key_compare_function, key_hash_function, LFDS700_HASH_A_EXISTING_KEY_FAIL, NULL ); + + LFDS700_HASH_A_SET_KEY_IN_ELEMENT( hae_one, 1 ); + LFDS700_HASH_A_SET_VALUE_IN_ELEMENT( hae_one, 0 ); + apr = lfds700_hash_a_insert( &has, &hae_one, NULL, &ps ); + + if( apr != LFDS700_HASH_A_PUT_RESULT_SUCCESS ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + LFDS700_HASH_A_SET_KEY_IN_ELEMENT( hae_two, 1 ); + LFDS700_HASH_A_SET_VALUE_IN_ELEMENT( hae_two, 1 ); + apr = lfds700_hash_a_insert( &has, &hae_two, NULL, &ps ); + + if( apr != LFDS700_HASH_A_PUT_RESULT_FAILURE_EXISTING_KEY ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + lfds700_hash_a_cleanup( &has, NULL ); + + // TRD : success on overwrite + lfds700_hash_a_init_valid_on_current_logical_core( &has, baus, 10, key_compare_function, key_hash_function, LFDS700_HASH_A_EXISTING_KEY_OVERWRITE, NULL ); + + LFDS700_HASH_A_SET_KEY_IN_ELEMENT( hae_one, 1 ); + LFDS700_HASH_A_SET_VALUE_IN_ELEMENT( hae_one, 1 ); + apr = lfds700_hash_a_insert( &has, &hae_one, NULL, &ps ); + + if( apr != LFDS700_HASH_A_PUT_RESULT_SUCCESS ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + LFDS700_HASH_A_SET_KEY_IN_ELEMENT( hae_two, 1 ); + LFDS700_HASH_A_SET_VALUE_IN_ELEMENT( hae_two, 1 ); + apr = lfds700_hash_a_insert( &has, &hae_two, NULL, &ps ); + + if( apr != LFDS700_HASH_A_PUT_RESULT_SUCCESS_OVERWRITE ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + lfds700_hash_a_cleanup( &has, NULL ); + + util_aligned_free( baus ); + + // TRD : print the test result + internal_display_test_result( 1, "hash_a", dvs ); + + return; +} + + + + + +/****************************************************************************/ +#pragma warning( disable : 4100 ) + +static int key_compare_function( void const *new_key, void const *key_in_tree ) +{ + int + cr = 0; + + // TRD : key_new can be any value in its range + // TRD : key_in_tree can be any value in its range + + if( (lfds700_pal_uint_t) new_key < (lfds700_pal_uint_t) key_in_tree ) + cr = -1; + + if( (lfds700_pal_uint_t) new_key > (lfds700_pal_uint_t) key_in_tree ) + cr = 1; + + return( cr ); +} + +#pragma warning( default : 4100 ) + + + + + +/****************************************************************************/ +#pragma warning( disable : 4100 ) + +static void key_hash_function( void const *key, lfds700_pal_uint_t *hash ) +{ + // TRD : key can be NULL + assert( hash != NULL ); + + *hash = 0; + + /* TRD : this function iterates over the user data + and we are using the void pointer *as* key data + so here we need to pass in the addy of key + */ + + LFDS700_HASH_A_32BIT_HASH_FUNCTION( (void *) &key, sizeof(lfds700_pal_uint_t), *hash ); + + return; +} + +#pragma warning( default : 4100 ) + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_hash_addonly_random_adds_overwrite.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_hash_addonly_random_adds_overwrite.c new file mode 100644 index 0000000000000000000000000000000000000000..29c5fae8653d11e23bec29fdb47a9eaf47696773 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_hash_addonly_random_adds_overwrite.c @@ -0,0 +1,388 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_element +{ + struct lfds700_hash_a_element + hae; + + lfds700_pal_uint_t + key; +}; + +struct test_state +{ + lfds700_pal_uint_t + number_elements_per_thread, + overwrite_count; + + struct lfds700_hash_a_state + *has; + + struct test_element + *element_array; +}; + +/***** private prototypes *****/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_adding( void *util_thread_starter_thread_state ); +static int key_compare_function( void const *new_key, void const *existing_key ); +static void key_hash_function( void const *key, lfds700_pal_uint_t *hash ); +static int qsort_and_bsearch_key_compare_function( void const *e1, void const *e2 ); + + + + + +/****************************************************************************/ +void test_lfds700_hash_a_random_adds_overwrite_on_existing( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + int + rv; + + lfds700_pal_uint_t + actual_sum_overwrite_existing_count, + expected_sum_overwrite_existing_count, + *key_count_array, + loop, + number_elements_per_thread, + number_elements_total, + number_logical_processors, + random_value; + + struct lfds700_hash_a_iterate + hai; + + struct lfds700_hash_a_element + *hae; + + struct lfds700_hash_a_state + has; + + struct lfds700_list_asu_element + *lasue = NULL; + + struct lfds700_btree_au_state + *baus; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_misc_validation_info + vi; + + struct test_pal_logical_processor + *lp; + + struct util_thread_starter_state + *tts; + + struct test_element + *element_array; + + struct test_state + *ts; + + test_pal_thread_state_t + *thread_handles; + + void + *key_pointer, + *key; + + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + /* TRD : we create a single hash_a + we generate n elements per thread + each element contains a key value, which is set to a random value + (we don't use value, so it's just set to 0) + the threads then run, putting + the threads count their number of overwrite hits + once the threads are done, then we + count the number of each key + from this we figure out the min/max element for hash_a validation, so we call validation + we check the sum of overwrites for each thread is what it should be + then using the hash_a get() we check all the elements we expect are present + and then we iterate over the hash_a + checking we see each key once + */ + + internal_display_test_name( "Random adds, get and iterate (overwrite on existing key)" ); + + lfds700_misc_prng_init( &ps ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + baus = util_aligned_malloc( sizeof(struct lfds700_btree_au_state) * 1000, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + lfds700_hash_a_init_valid_on_current_logical_core( &has, baus, 1000, key_compare_function, key_hash_function, LFDS700_HASH_A_EXISTING_KEY_OVERWRITE, NULL ); + + // TRD : we divide by 2 beccause we have to allocate a second array of this size later + number_elements_per_thread = ( memory_in_megabytes * ONE_MEGABYTE_IN_BYTES ) / ( sizeof(struct test_element) * number_logical_processors ) / 2; + number_elements_total = number_elements_per_thread * number_logical_processors; + + // TRD : created an ordered list of unique numbers + element_array = util_aligned_malloc( sizeof(struct test_element) * number_elements_total, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + for( loop = 0 ; loop < number_elements_total ; loop++ ) + { + random_value = LFDS700_MISC_PRNG_GENERATE( &ps ); + (element_array+loop)->key = (lfds700_pal_uint_t) floor( (number_elements_total/2) * ((double) random_value / (double) LFDS700_MISC_PRNG_MAX) ); + } + + ts = util_malloc_wrapper( sizeof(struct test_state) * number_logical_processors ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + { + (ts+loop)->has = &has; + (ts+loop)->element_array = element_array + number_elements_per_thread*loop; + (ts+loop)->overwrite_count = 0; + (ts+loop)->number_elements_per_thread = number_elements_per_thread; + } + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors ); + + util_thread_starter_new( &tts, number_logical_processors ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, thread_adding, ts+loop ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + free( thread_handles ); + + LFDS700_MISC_BARRIER_LOAD; + + // TRD : now for validation + key_count_array = util_malloc_wrapper( sizeof(lfds700_pal_uint_t) * number_elements_total ); + for( loop = 0 ; loop < number_elements_total ; loop++ ) + *(key_count_array+loop) = 0; + + for( loop = 0 ; loop < number_elements_total ; loop++ ) + ( *(key_count_array + (element_array+loop)->key) )++; + + vi.min_elements = number_elements_total; + + for( loop = 0 ; loop < number_elements_total ; loop++ ) + if( *(key_count_array+loop) == 0 ) + vi.min_elements--; + + vi.max_elements = vi.min_elements; + + lfds700_hash_a_query( &has, LFDS700_HASH_A_QUERY_SINGLETHREADED_VALIDATE, (void *) &vi, (void *) &dvs ); + + expected_sum_overwrite_existing_count = 0; + + for( loop = 0 ; loop < number_elements_total ; loop++ ) + if( *(key_count_array+loop) != 0 ) + expected_sum_overwrite_existing_count += *(key_count_array+loop) - 1; + + actual_sum_overwrite_existing_count = 0; + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + actual_sum_overwrite_existing_count += (ts+loop)->overwrite_count; + + if( expected_sum_overwrite_existing_count != actual_sum_overwrite_existing_count ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + // TRD : now loop over the expected array and check we can get() every element + for( loop = 0 ; loop < number_elements_total ; loop++ ) + if( *(key_count_array+loop) > 0 ) + { + rv = lfds700_hash_a_get_by_key( &has, (void *) loop, &hae ); + + if( rv != 1 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + } + + /* TRD : now iterate, checking we find every element and no others + to do this in a timely manner, we need to qsort() the key values + and use bsearch() to check for items in the array + */ + + for( loop = 0 ; loop < number_elements_total ; loop++ ) + if( *(key_count_array+loop) != 0 ) + *(key_count_array+loop) = loop; + else + *(key_count_array+loop) = 0; + + qsort( key_count_array, number_elements_total, sizeof(lfds700_pal_uint_t), qsort_and_bsearch_key_compare_function ); + + lfds700_hash_a_iterate_init( &has, &hai ); + + while( dvs == LFDS700_MISC_VALIDITY_VALID and lfds700_hash_a_iterate(&hai, &hae) ) + { + key = LFDS700_HASH_A_GET_KEY_FROM_ELEMENT( *hae ); + + key_pointer = bsearch( &key, key_count_array, number_elements_total, sizeof(lfds700_pal_uint_t), qsort_and_bsearch_key_compare_function ); + + if( key_pointer == NULL ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + } + + // TRD : cleanup + lfds700_hash_a_cleanup( &has, NULL ); + + util_aligned_free( baus ); + + free( ts ); + + util_aligned_free( element_array ); + + free( key_count_array ); + + // TRD : print the test result + internal_display_test_result( 1, "hash_a", dvs ); + + return; +} + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_adding( void *util_thread_starter_thread_state ) +{ + enum lfds700_hash_a_insert_result + apr; + + lfds700_pal_uint_t + index = 0; + + struct test_state + *ts; + + struct lfds700_misc_prng_state + ps; + + struct util_thread_starter_thread_state + *tsts; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + lfds700_misc_prng_init( &ps ); + + util_thread_starter_ready_and_wait( tsts ); + + while( index < ts->number_elements_per_thread ) + { + LFDS700_HASH_A_SET_KEY_IN_ELEMENT( (ts->element_array+index)->hae, (ts->element_array+index)->key ); + LFDS700_HASH_A_SET_VALUE_IN_ELEMENT( (ts->element_array+index)->hae, 0 ); + apr = lfds700_hash_a_insert( ts->has, &(ts->element_array+index)->hae, NULL, &ps ); + + if( apr == LFDS700_HASH_A_PUT_RESULT_SUCCESS_OVERWRITE ) + ts->overwrite_count++; + + index++; + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + + + + + +/****************************************************************************/ +#pragma warning( disable : 4100 ) + +static int key_compare_function( void const *new_key, void const *existing_key ) +{ + int + cr = 0; + + // TRD : new_key can be NULL (i.e. 0) + // TRD : existing_key can be NULL (i.e. 0) + + if( (lfds700_pal_uint_t) new_key < (lfds700_pal_uint_t) existing_key ) + cr = -1; + + if( (lfds700_pal_uint_t) new_key > (lfds700_pal_uint_t) existing_key ) + cr = 1; + + return( cr ); +} + +#pragma warning( default : 4100 ) + + + + + +/****************************************************************************/ +#pragma warning( disable : 4100 ) + +static void key_hash_function( void const *key, lfds700_pal_uint_t *hash ) +{ + // TRD : key can be NULL + assert( hash != NULL ); + + *hash = 0; + + /* TRD : this function iterates over the user data + and we are using the void pointer *as* key data + so here we need to pass in the addy of key + */ + + LFDS700_HASH_A_32BIT_HASH_FUNCTION( (void *) &key, sizeof(lfds700_pal_uint_t), *hash ); + + return; +} + +#pragma warning( default : 4100 ) + + + + + +/****************************************************************************/ +static int qsort_and_bsearch_key_compare_function( void const *e1, void const *e2 ) +{ + int + cr = 0; + + lfds700_pal_uint_t + s1, + s2; + + s1 = *(lfds700_pal_uint_t *) e1; + s2 = *(lfds700_pal_uint_t *) e2; + + if( s1 > s2 ) + cr = 1; + + if( s1 < s2 ) + cr = -1; + + return( cr ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_list_addonly_ordered_singlylinked.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_list_addonly_ordered_singlylinked.c new file mode 100644 index 0000000000000000000000000000000000000000..5720aa24282ed9fdf87a85d7f3487d4907f1fbaa --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_list_addonly_ordered_singlylinked.c @@ -0,0 +1,31 @@ +/***** includes *****/ +#include "internal.h" + + + + + +/****************************************************************************/ +#pragma warning( disable : 4127 ) // TRD : disables MSVC warning for condition expressions being const + +void test_lfds700_list_aos( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + if( LFDS700_MISC_ATOMIC_SUPPORT_CAS ) + { + printf( "\n" + "List (add-only, ordered, singly-linked) Tests\n" + "=============================================\n" ); + + test_lfds700_list_aos_alignment(); + test_lfds700_list_aos_new_ordered( list_of_logical_processors, memory_in_megabytes ); + test_lfds700_list_aos_new_ordered_with_cursor( list_of_logical_processors, memory_in_megabytes ); + } + + return; +} + +#pragma warning( default : 4127 ) + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_list_addonly_ordered_singlylinked_alignment.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_list_addonly_ordered_singlylinked_alignment.c new file mode 100644 index 0000000000000000000000000000000000000000..77263463667e5ac03643fc6fe74faf63f106f1f5 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_list_addonly_ordered_singlylinked_alignment.c @@ -0,0 +1,58 @@ +/***** includes *****/ +#include "internal.h" + + + + + +/****************************************************************************/ +#pragma warning( disable : 4127 ) // TRD : disables MSVC warning for condition expressions being const + +void test_lfds700_list_aos_alignment() +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + /* TRD : these are compile time checks + but we do them here because this is a test programme + and it should indicate issues to users when it is *run*, + not when it is compiled, because a compile error normally + indicates a problem with the code itself and so is misleading + */ + + internal_display_test_name( "Alignment" ); + + + + // TRD : struct lfds700_list_aos_element + if( offsetof(struct lfds700_list_aos_element,next) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + if( offsetof(struct lfds700_list_aos_element,value) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + if( offsetof(struct lfds700_list_aos_element,key) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + + + // TRD : struct lfds700_list_asu_state + if( offsetof(struct lfds700_list_aos_state,start) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + if( offsetof(struct lfds700_list_aos_state,dummy_element) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + if( offsetof(struct lfds700_list_aos_state,key_compare_function) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + + + // TRD : print the test result + internal_display_test_result( 1, "list_aos", dvs ); + + return; +} + +#pragma warning( default : 4127 ) + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_list_addonly_ordered_singlylinked_new_ordered.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_list_addonly_ordered_singlylinked_new_ordered.c new file mode 100644 index 0000000000000000000000000000000000000000..3a392b33bd4de7fbba7a048f556ca4d7e8d8dffd --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_list_addonly_ordered_singlylinked_new_ordered.c @@ -0,0 +1,278 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_element +{ + struct lfds700_list_aos_element + laose; + + lfds700_pal_uint_t + element_number, + thread_number; +}; + +struct test_state +{ + lfds700_pal_uint_t + number_elements_per_thread; + + struct lfds700_list_aos_state + *laoss; + + struct test_element + *element_array; +}; + +/***** private prototypes *****/ +static int new_ordered_compare_function( void const *value_new, void const *value_in_list ); +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION new_ordered_thread( void *util_thread_starter_thread_state ); + + + + + +/****************************************************************************/ +void test_lfds700_list_aos_new_ordered( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + lfds700_pal_uint_t + loop, + expected_element_number, + number_elements_per_thread, + number_elements_total, + number_logical_processors, + offset, + temp; + + struct lfds700_list_aos_element + *laose = NULL; + + struct lfds700_list_asu_element + *lasue = NULL; + + struct lfds700_list_aos_state + laoss; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_misc_validation_info + vi; + + struct test_pal_logical_processor + *lp; + + struct test_element + *element_array, + *element; + + struct test_state + *ts; + + struct util_thread_starter_state + *tts; + + test_pal_thread_state_t + *thread_handles; + + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + /* TRD : run one thread per logical processor + we have a single array of 10k elements per thread + this is set to be randomly ordered (but with contigious numbers from 0 to n) + we give 10k to each thread (a pointer into the array at the correct point) + which then loops through that array + calling lfds700_list_aos_insert_element_by_position( LFDS700_LIST_AOS_POSITION_ORDERED ) + verification should show list is sorted + */ + + internal_display_test_name( "New ordered" ); + + lfds700_misc_prng_init( &ps ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + lfds700_list_aos_init_valid_on_current_logical_core( &laoss, new_ordered_compare_function, LFDS700_LIST_AOS_INSERT_RESULT_FAILURE_EXISTING_KEY, NULL ); + + /* TRD : create randomly ordered number array with unique elements + + unique isn't necessary - the list will sort anyway - but + it permits slightly better validation + */ + + number_elements_per_thread = ( memory_in_megabytes * ONE_MEGABYTE_IN_BYTES ) / ( sizeof(struct test_element) * number_logical_processors ); + + // TRD : or the test takes a looooooong time... + if( number_elements_per_thread > 10000 ) + number_elements_per_thread = 10000; + + number_elements_total = number_elements_per_thread * number_logical_processors; + + element_array = util_aligned_malloc( sizeof(struct test_element) * number_elements_total, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + for( loop = 0 ; loop < number_elements_total ; loop++ ) + (element_array+loop)->element_number = loop; + + for( loop = 0 ; loop < number_elements_total ; loop++ ) + { + offset = LFDS700_MISC_PRNG_GENERATE( &ps ); + offset %= number_elements_total; + temp = (element_array + offset)->element_number; + (element_array + offset)->element_number = (element_array + loop)->element_number; + (element_array + loop)->element_number = temp; + } + + ts = util_malloc_wrapper( sizeof(struct test_state) * number_logical_processors ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + { + (ts+loop)->laoss = &laoss; + (ts+loop)->element_array = element_array + (loop*number_elements_per_thread); + (ts+loop)->number_elements_per_thread = number_elements_per_thread; + } + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors ); + + util_thread_starter_new( &tts, number_logical_processors ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, new_ordered_thread, ts+loop ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + free( thread_handles ); + + free( ts ); + + /* TRD : validate the resultant list + iterate over the list + we expect to find the list is sorted, + which means that element_number will + increment from zero + */ + + LFDS700_MISC_BARRIER_LOAD; + + vi.min_elements = vi.max_elements = number_elements_total; + + lfds700_list_aos_query( &laoss, LFDS700_LIST_AOS_QUERY_SINGLETHREADED_VALIDATE, &vi, &dvs ); + + if( dvs == LFDS700_MISC_VALIDITY_VALID ) + { + expected_element_number = 0; + + // TRD : traverse the list and check combined_data_array matches + while( dvs == LFDS700_MISC_VALIDITY_VALID and LFDS700_LIST_AOS_GET_START_AND_THEN_NEXT(laoss, laose) ) + { + element = LFDS700_LIST_AOS_GET_VALUE_FROM_ELEMENT( *laose ); + + if( element->element_number != expected_element_number++ ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + } + } + + lfds700_list_aos_cleanup( &laoss, NULL ); + + util_aligned_free( element_array ); + + internal_display_test_result( 1, "list_aos", dvs ); + + return; +} + + + + + +/****************************************************************************/ +#pragma warning( disable : 4100 ) + +static int new_ordered_compare_function( void const *value_new, void const *value_in_list ) +{ + int + cr = 0; + + struct test_element + *e1, + *e2; + + // TRD : value_new can be any value in its range + // TRD : value_in_list can be any value in its range + + e1 = (struct test_element *) value_new; + e2 = (struct test_element *) value_in_list; + + if( e1->element_number < e2->element_number ) + cr = -1; + + if( e1->element_number > e2->element_number ) + cr = 1; + + return( cr ); +} + +#pragma warning( default : 4100 ) + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION new_ordered_thread( void *util_thread_starter_thread_state ) +{ + lfds700_pal_uint_t + loop; + + struct lfds700_misc_prng_state + ps; + + struct test_state + *ts; + + struct util_thread_starter_thread_state + *tsts; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + lfds700_misc_prng_init( &ps ); + + util_thread_starter_ready_and_wait( tsts ); + + for( loop = 0 ; loop < ts->number_elements_per_thread ; loop++ ) + { + LFDS700_LIST_AOS_SET_KEY_IN_ELEMENT( (ts->element_array+loop)->laose, ts->element_array+loop ); + LFDS700_LIST_AOS_SET_VALUE_IN_ELEMENT( (ts->element_array+loop)->laose, ts->element_array+loop ); + lfds700_list_aos_insert( ts->laoss, &(ts->element_array+loop)->laose, NULL, &ps ); + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_list_addonly_ordered_singlylinked_new_ordered_with_cursor.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_list_addonly_ordered_singlylinked_new_ordered_with_cursor.c new file mode 100644 index 0000000000000000000000000000000000000000..42e0ebc7a5f1e9461e0279217253587d5840978f --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_list_addonly_ordered_singlylinked_new_ordered_with_cursor.c @@ -0,0 +1,366 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_element +{ + struct lfds700_list_aos_element + laose; + + lfds700_pal_uint_t + element_number, + thread_number; +}; + +struct test_state +{ + enum flag + error_flag; + + lfds700_pal_uint_t + number_elements_per_thread; + + struct lfds700_list_aos_state + *laoss; + + struct test_element + *element_array; +}; + +/***** private prototypes *****/ +static int new_ordered_with_cursor_compare_function( void const *value_new, void const *value_in_list ); +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION new_ordered_with_cursor_insert_thread( void *util_thread_starter_thread_state ); +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION new_ordered_with_cursor_cursor_thread( void *util_thread_starter_thread_state ); + + + + + +/****************************************************************************/ +void test_lfds700_list_aos_new_ordered_with_cursor( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + lfds700_pal_uint_t + loop, + number_elements_per_thread, + number_elements_total, + number_logical_processors, + offset, + temp; + + struct lfds700_list_aos_state + laoss; + + struct lfds700_list_asu_element + *lasue = NULL; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_misc_validation_info + vi; + + struct test_pal_logical_processor + *lp; + + struct util_thread_starter_state + *tts; + + struct test_element + *element_array; + + struct test_state + *ts; + + test_pal_thread_state_t + *thread_handles; + + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + /* TRD : run two threads per logical processor + + the test runs for 10 seconds + + the first thread loops over a pre-set list of random numbers + continually adding them using ordered insert + + the second thread keeps iterating over the list, checking that + each element is larger than its predecessor + */ + + internal_display_test_name( "New ordered with cursor (%d seconds)", TEST_DURATION_IN_SECONDS ); + + lfds700_misc_prng_init( &ps ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + lfds700_list_aos_init_valid_on_current_logical_core( &laoss, new_ordered_with_cursor_compare_function, LFDS700_LIST_AOS_INSERT_RESULT_FAILURE_EXISTING_KEY, NULL ); + + /* TRD : create randomly ordered number array with unique elements + + unique isn't necessary - the list will sort anyway - but + it permits slightly better validation + */ + + number_elements_per_thread = ( memory_in_megabytes * ONE_MEGABYTE_IN_BYTES ) / ( sizeof(struct test_element) * number_logical_processors ); + + // TRD : or the test takes a looooooong time... + if( number_elements_per_thread > 1000 ) + number_elements_per_thread = 1000; + + number_elements_total = number_elements_per_thread * number_logical_processors; + + element_array = util_aligned_malloc( sizeof(struct test_element) * number_elements_total, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + for( loop = 0 ; loop < number_elements_total ; loop++ ) + (element_array+loop)->element_number = loop; + + for( loop = 0 ; loop < number_elements_total ; loop++ ) + { + offset = LFDS700_MISC_PRNG_GENERATE( &ps ); + offset %= number_elements_total; + temp = (element_array + offset)->element_number; + (element_array + offset)->element_number = (element_array + loop)->element_number; + (element_array + loop)->element_number = temp; + } + + ts = util_malloc_wrapper( sizeof(struct test_state) * number_logical_processors * 2 ); + + // TRD : the insert threads + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + { + (ts+loop)->laoss = &laoss; + (ts+loop)->element_array = element_array + number_elements_per_thread*loop; + (ts+loop)->error_flag = LOWERED; + (ts+loop)->number_elements_per_thread = number_elements_per_thread; + } + + // TRD : the cursor threads + for( loop = number_logical_processors ; loop < number_logical_processors * 2 ; loop++ ) + { + (ts+loop)->laoss = &laoss; + (ts+loop)->element_array = NULL; + (ts+loop)->error_flag = LOWERED; + } + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors * 2 ); + + util_thread_starter_new( &tts, number_logical_processors * 2 ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, new_ordered_with_cursor_insert_thread, ts+loop ); + util_thread_starter_start( tts, &thread_handles[loop+number_logical_processors], loop+number_logical_processors, lp, new_ordered_with_cursor_cursor_thread, ts+loop+number_logical_processors ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors * 2 ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + free( thread_handles ); + + /* TRD : validate the resultant list + + the cursor threads were checking for orderedness + if that failed, they raise their error_flag + so validate the list, then check error_flags + */ + + LFDS700_MISC_BARRIER_LOAD; + + vi.min_elements = vi.max_elements = number_elements_total; + + lfds700_list_aos_query( &laoss, LFDS700_LIST_AOS_QUERY_SINGLETHREADED_VALIDATE, &vi, &dvs ); + + if( dvs == LFDS700_MISC_VALIDITY_VALID ) + for( loop = number_logical_processors ; loop < number_logical_processors * 2 ; loop++ ) + if( (ts+loop)->error_flag == RAISED ) + dvs = LFDS700_MISC_VALIDITY_INVALID_ORDER; + + lfds700_list_aos_cleanup( &laoss, NULL ); + + util_aligned_free( element_array ); + + free( ts ); + + internal_display_test_result( 1, "list_aos", dvs ); + + return; +} + + + + + +/****************************************************************************/ +#pragma warning( disable : 4100 ) + +static int new_ordered_with_cursor_compare_function( void const *value_new, void const *value_in_list ) +{ + int + cr = 0; + + struct test_element + *e1, + *e2; + + // TRD : value_new can be any value in its range + // TRD : value_in_list can be any value in its range + + e1 = (struct test_element *) value_new; + e2 = (struct test_element *) value_in_list; + + if( e1->element_number < e2->element_number ) + cr = -1; + + if( e1->element_number > e2->element_number ) + cr = 1; + + return( cr ); +} + +#pragma warning( default : 4100 ) + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION new_ordered_with_cursor_insert_thread( void *util_thread_starter_thread_state ) +{ + lfds700_pal_uint_t + loop; + + struct lfds700_misc_prng_state + ps; + + struct test_state + *ts; + + struct util_thread_starter_thread_state + *tsts; + + LFDS700_MISC_BARRIER_LOAD; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + lfds700_misc_prng_init( &ps ); + + util_thread_starter_ready_and_wait( tsts ); + + for( loop = 0 ; loop < ts->number_elements_per_thread ; loop++ ) + { + LFDS700_LIST_AOS_SET_KEY_IN_ELEMENT( (ts->element_array+loop)->laose, ts->element_array+loop ); + LFDS700_LIST_AOS_SET_VALUE_IN_ELEMENT( (ts->element_array+loop)->laose, ts->element_array+loop ); + lfds700_list_aos_insert( ts->laoss, &(ts->element_array+loop)->laose, NULL, &ps ); + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION new_ordered_with_cursor_cursor_thread( void *util_thread_starter_thread_state ) +{ + lfds700_pal_uint_t + prev_element_number; + + lfds700_pal_uint_t + time_loop = 0; + + struct lfds700_list_aos_element + *laose; + + struct test_element + *element; + + struct test_state + *ts; + + struct util_thread_starter_thread_state + *tsts; + + time_t + current_time, + start_time; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + util_thread_starter_ready_and_wait( tsts ); + + current_time = start_time = time( NULL ); + + while( current_time < start_time + TEST_DURATION_IN_SECONDS ) + { + prev_element_number = 0; + + laose = LFDS700_LIST_AOS_GET_START( *ts->laoss ); + + // TRD : we may get start before any element has been added to the list + if( laose == NULL ) + continue; + + element = LFDS700_LIST_AOS_GET_VALUE_FROM_ELEMENT( *laose ); + + if( element->element_number < prev_element_number ) + ts->error_flag = RAISED; + + prev_element_number = element->element_number; + + laose = LFDS700_LIST_AOS_GET_NEXT( *laose ); + + while( laose != NULL ) + { + element = LFDS700_LIST_AOS_GET_VALUE_FROM_ELEMENT( *laose ); + + if( element->element_number <= prev_element_number ) + ts->error_flag = RAISED; + + prev_element_number = element->element_number; + + laose = LFDS700_LIST_AOS_GET_NEXT( *laose ); + } + + if( time_loop++ == REDUCED_TIME_LOOP_COUNT ) + { + time_loop = 0; + time( ¤t_time ); + } + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_list_addonly_singlylinked_unordered.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_list_addonly_singlylinked_unordered.c new file mode 100644 index 0000000000000000000000000000000000000000..37c37f252990e281f70ed4d48d746a94d24d5d62 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_list_addonly_singlylinked_unordered.c @@ -0,0 +1,32 @@ +/***** includes *****/ +#include "internal.h" + + + + + +/****************************************************************************/ +#pragma warning( disable : 4127 ) // TRD : disables MSVC warning for condition expressions being const + +void test_lfds700_list_asu( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + if( LFDS700_MISC_ATOMIC_SUPPORT_CAS ) + { + printf( "\n" + "List (add-only, singly-linked, unordered) Tests\n" + "===============================================\n" ); + + test_lfds700_list_asu_alignment(); + test_lfds700_list_asu_new_start( list_of_logical_processors, memory_in_megabytes ); + test_lfds700_list_asu_new_end( list_of_logical_processors, memory_in_megabytes ); + test_lfds700_list_asu_new_after( list_of_logical_processors, memory_in_megabytes ); + } + + return; +} + +#pragma warning( default : 4127 ) + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_list_addonly_singlylinked_unordered_alignment.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_list_addonly_singlylinked_unordered_alignment.c new file mode 100644 index 0000000000000000000000000000000000000000..43f451d4bf58887005736872ca74ce22ef3561d0 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_list_addonly_singlylinked_unordered_alignment.c @@ -0,0 +1,61 @@ +/***** includes *****/ +#include "internal.h" + + + + + +/****************************************************************************/ +#pragma warning( disable : 4127 ) // TRD : disables MSVC warning for condition expressions being const + +void test_lfds700_list_asu_alignment() +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + /* TRD : these are compile time checks + but we do them here because this is a test programme + and it should indicate issues to users when it is *run*, + not when it is compiled, because a compile error normally + indicates a problem with the code itself and so is misleading + */ + + internal_display_test_name( "Alignment" ); + + + + // TRD : struct lfds700_list_asu_element + if( offsetof(struct lfds700_list_asu_element,next) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + if( offsetof(struct lfds700_list_asu_element,value) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + if( offsetof(struct lfds700_list_asu_element,key) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + + + // TRD : struct lfds700_list_asu_state + if( offsetof(struct lfds700_list_asu_state,end) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + if( offsetof(struct lfds700_list_asu_state,start) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + if( offsetof(struct lfds700_list_asu_state,dummy_element) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + if( offsetof(struct lfds700_list_asu_state,key_compare_function) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + + + // TRD : print the test result + internal_display_test_result( 1, "list_asu", dvs ); + + return; +} + +#pragma warning( default : 4127 ) + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_list_addonly_singlylinked_unordered_new_after.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_list_addonly_singlylinked_unordered_new_after.c new file mode 100644 index 0000000000000000000000000000000000000000..5dcd6954aac4d65708e0d35bf4d5080fef6cb3ac --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_list_addonly_singlylinked_unordered_new_after.c @@ -0,0 +1,254 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_element +{ + struct lfds700_list_asu_element + lasue; + + lfds700_pal_uint_t + element_number, + thread_number; +}; + +struct test_state +{ + lfds700_pal_uint_t + number_elements; + + struct lfds700_list_asu_state + *lasus; + + struct test_element + *element_array; + + struct lfds700_list_asu_element + *first_element; +}; + +/***** private prototypes *****/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION new_after_thread( void *util_thread_starter_thread_state ); + + + + + +/****************************************************************************/ +void test_lfds700_list_asu_new_after( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + lfds700_pal_uint_t + loop, + number_elements, + number_logical_processors, + *per_thread_counters, + subloop; + + struct lfds700_list_asu_element + *lasue, + first_element; + + struct lfds700_list_asu_state + lasus; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_misc_validation_info + vi; + + struct test_pal_logical_processor + *lp; + + struct util_thread_starter_state + *tts; + + struct test_element + *element_array, + *element; + + struct test_state + *ts; + + test_pal_thread_state_t + *thread_handles; + + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + /* TRD : run one thread per logical processor + run for 250k elements + we put a single first element into the list and + each thread loops, calling lfds700_list_asu_new_element_by_position( LFDS700_LIST_ASU_POSITION_AFTER ), + inserting after the single first element + data element contain s thread_number and element_number + verification should show element_number decreasing on a per thread basis + */ + + internal_display_test_name( "New after" ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + lfds700_misc_prng_init( &ps ); + + lfds700_list_asu_init_valid_on_current_logical_core( &lasus, NULL, NULL ); + + LFDS700_LIST_ASU_SET_KEY_IN_ELEMENT( first_element, NULL ); + LFDS700_LIST_ASU_SET_VALUE_IN_ELEMENT( first_element, NULL ); + lfds700_list_asu_insert_at_position( &lasus, &first_element, NULL, LFDS700_LIST_ASU_POSITION_START, &ps ); + + number_elements = ( memory_in_megabytes * ONE_MEGABYTE_IN_BYTES ) / ( sizeof(struct test_element) * number_logical_processors ); + + element_array = util_aligned_malloc( sizeof(struct test_element) * number_logical_processors * number_elements, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + for( subloop = 0 ; subloop < number_elements ; subloop++ ) + { + (element_array+(loop*number_elements)+subloop)->thread_number = loop; + (element_array+(loop*number_elements)+subloop)->element_number = subloop; + } + + ts = util_malloc_wrapper( sizeof(struct test_state) * number_logical_processors ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + {\ + (ts+loop)->lasus = &lasus; + (ts+loop)->element_array = element_array + (loop*number_elements); + (ts+loop)->first_element = &first_element; + (ts+loop)->number_elements = number_elements; + } + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors ); + + util_thread_starter_new( &tts, number_logical_processors ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + lasue = NULL; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, new_after_thread, ts+loop ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + free( thread_handles ); + + free( ts ); + + /* TRD : validate the resultant list + iterate over each element + we expect to find element numbers increment on a per thread basis + */ + + LFDS700_MISC_BARRIER_LOAD; + + vi.min_elements = vi.max_elements = number_elements * number_logical_processors + 1; + + lfds700_list_asu_query( &lasus, LFDS700_LIST_ASU_QUERY_SINGLETHREADED_VALIDATE, &vi, &dvs ); + + per_thread_counters = util_malloc_wrapper( sizeof(lfds700_pal_uint_t) * number_logical_processors ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + *(per_thread_counters+loop) = number_elements - 1; + + /* TRD : we have a leading element, after which all inserts occurred + we need to get past that element for validation + this is why we're not using lfds700_list_asu_get_start_and_then_next() + */ + + lasue = LFDS700_LIST_ASU_GET_START( lasus ); + + lasue = LFDS700_LIST_ASU_GET_NEXT( *lasue ); + + while( dvs == LFDS700_MISC_VALIDITY_VALID and lasue != NULL ) + { + element = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + + if( element->thread_number >= number_logical_processors ) + { + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + break; + } + + if( element->element_number < per_thread_counters[element->thread_number] ) + dvs = LFDS700_MISC_VALIDITY_INVALID_MISSING_ELEMENTS; + + if( element->element_number > per_thread_counters[element->thread_number] ) + dvs = LFDS700_MISC_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; + + if( element->element_number == per_thread_counters[element->thread_number] ) + per_thread_counters[element->thread_number]--; + + lasue = LFDS700_LIST_ASU_GET_NEXT( *lasue ); + } + + free( per_thread_counters ); + + lfds700_list_asu_cleanup( &lasus, NULL ); + + util_aligned_free( element_array ); + + internal_display_test_result( 1, "list_asu", dvs ); + + return; +} + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION new_after_thread( void *util_thread_starter_thread_state ) +{ + lfds700_pal_uint_t + loop; + + struct lfds700_misc_prng_state + ps; + + struct test_state + *ts; + + struct util_thread_starter_thread_state + *tsts; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + lfds700_misc_prng_init( &ps ); + + util_thread_starter_ready_and_wait( tsts ); + + for( loop = 0 ; loop < ts->number_elements ; loop++ ) + { + LFDS700_LIST_ASU_SET_KEY_IN_ELEMENT( (ts->element_array+loop)->lasue, ts->element_array+loop ); + LFDS700_LIST_ASU_SET_VALUE_IN_ELEMENT( (ts->element_array+loop)->lasue, ts->element_array+loop ); + lfds700_list_asu_insert_at_position( ts->lasus, &(ts->element_array+loop)->lasue, ts->first_element, LFDS700_LIST_ASU_POSITION_AFTER, &ps ); + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_list_addonly_singlylinked_unordered_new_end.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_list_addonly_singlylinked_unordered_new_end.c new file mode 100644 index 0000000000000000000000000000000000000000..c6c66d007c516a4f61890946965d3ebefcf239d9 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_list_addonly_singlylinked_unordered_new_end.c @@ -0,0 +1,229 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_element +{ + struct lfds700_list_asu_element + lasue; + + lfds700_pal_uint_t + element_number, + thread_number; +}; + +struct test_state +{ + lfds700_pal_uint_t + number_elements; + + struct lfds700_list_asu_state + *lasus; + + struct test_element + *element_array; +}; + +/***** private prototypes *****/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION new_end_thread( void *util_thread_starter_thread_state ); + + + + + +/****************************************************************************/ +void test_lfds700_list_asu_new_end( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + lfds700_pal_uint_t + loop, + number_elements, + number_logical_processors, + *per_thread_counters, + subloop; + + struct lfds700_list_asu_element + *lasue = NULL; + + struct lfds700_list_asu_state + lasus; + + struct lfds700_misc_validation_info + vi; + + struct test_pal_logical_processor + *lp; + + struct util_thread_starter_state + *tts; + + struct test_element + *element_array, + *element; + + struct test_state + *ts; + + test_pal_thread_state_t + *thread_handles; + + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + /* TRD : run one thread per logical processor + run for 250k elements + each thread loops, calling lfds700_list_asu_new_element_by_position( LFDS700_LIST_ASU_POSITION_END ) + data element contain a thread_number and element_number + verification should show element_number increasing on a per thread basis + */ + + internal_display_test_name( "New end" ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + lfds700_list_asu_init_valid_on_current_logical_core( &lasus, NULL, NULL ); + + number_elements = ( memory_in_megabytes * ONE_MEGABYTE_IN_BYTES ) / ( sizeof(struct test_element) * number_logical_processors ); + + element_array = util_aligned_malloc( sizeof(struct test_element) * number_logical_processors * number_elements, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + for( subloop = 0 ; subloop < number_elements ; subloop++ ) + { + (element_array+(loop*number_elements)+subloop)->thread_number = loop; + (element_array+(loop*number_elements)+subloop)->element_number = subloop; + } + + ts = util_malloc_wrapper( sizeof(struct test_state) * number_logical_processors ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + { + (ts+loop)->lasus = &lasus; + (ts+loop)->element_array = element_array + (loop*number_elements); + (ts+loop)->number_elements = number_elements; + } + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors ); + + util_thread_starter_new( &tts, number_logical_processors ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + lasue = NULL; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, new_end_thread, ts+loop ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + free( thread_handles ); + + free( ts ); + + /* TRD : validate the resultant list + iterate over each element + we expect to find element numbers increment on a per thread basis + */ + + LFDS700_MISC_BARRIER_LOAD; + + vi.min_elements = vi.max_elements = number_elements * number_logical_processors; + + lfds700_list_asu_query( &lasus, LFDS700_LIST_ASU_QUERY_SINGLETHREADED_VALIDATE, &vi, &dvs ); + + per_thread_counters = util_malloc_wrapper( sizeof(lfds700_pal_uint_t) * number_logical_processors ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + *(per_thread_counters+loop) = 0; + + lasue = NULL; + + while( dvs == LFDS700_MISC_VALIDITY_VALID and LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(lasus, lasue) ) + { + element = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + + if( element->thread_number >= number_logical_processors ) + { + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + break; + } + + if( element->element_number > per_thread_counters[element->thread_number] ) + dvs = LFDS700_MISC_VALIDITY_INVALID_MISSING_ELEMENTS; + + if( element->element_number < per_thread_counters[element->thread_number] ) + dvs = LFDS700_MISC_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; + + if( element->element_number == per_thread_counters[element->thread_number] ) + per_thread_counters[element->thread_number]++; + } + + free( per_thread_counters ); + + lfds700_list_asu_cleanup( &lasus, NULL ); + + util_aligned_free( element_array ); + + internal_display_test_result( 1, "list_asu", dvs ); + + return; +} + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION new_end_thread( void *util_thread_starter_thread_state ) +{ + lfds700_pal_uint_t + loop; + + struct lfds700_misc_prng_state + ps; + + struct test_state + *ts; + + struct util_thread_starter_thread_state + *tsts; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + lfds700_misc_prng_init( &ps ); + + util_thread_starter_ready_and_wait( tsts ); + + for( loop = 0 ; loop < ts->number_elements ; loop++ ) + { + LFDS700_LIST_ASU_SET_KEY_IN_ELEMENT( (ts->element_array+loop)->lasue, ts->element_array+loop ); + LFDS700_LIST_ASU_SET_VALUE_IN_ELEMENT( (ts->element_array+loop)->lasue, ts->element_array+loop ); + lfds700_list_asu_insert_at_position( ts->lasus, &(ts->element_array+loop)->lasue, NULL, LFDS700_LIST_ASU_POSITION_END, &ps ); + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_list_addonly_singlylinked_unordered_new_start.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_list_addonly_singlylinked_unordered_new_start.c new file mode 100644 index 0000000000000000000000000000000000000000..f4244e2a120e42cb80a22bcdbbd05fb009f5aebf --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_list_addonly_singlylinked_unordered_new_start.c @@ -0,0 +1,229 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_element +{ + struct lfds700_list_asu_element + lasue; + + lfds700_pal_uint_t + element_number, + thread_number; +}; + +struct test_state +{ + lfds700_pal_uint_t + number_elements; + + struct lfds700_list_asu_state + *lasus; + + struct test_element + *element_array; +}; + +/***** private prototypes *****/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION new_start_thread( void *util_thread_starter_thread_state ); + + + + + +/****************************************************************************/ +void test_lfds700_list_asu_new_start( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + lfds700_pal_uint_t + loop, + number_elements, + number_logical_processors, + *per_thread_counters, + subloop; + + struct lfds700_list_asu_element + *lasue = NULL; + + struct lfds700_list_asu_state + lasus; + + struct lfds700_misc_validation_info + vi; + + struct test_element + *element_array, + *element; + + struct test_state + *ts; + + struct test_pal_logical_processor + *lp; + + struct util_thread_starter_state + *tts; + + test_pal_thread_state_t + *thread_handles; + + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + /* TRD : run one thread per logical processor + run for 250k elements + each thread loops, calling lfds700_list_asu_new_element_by_position( LFDS700_LIST_ASU_POSITION_START ) + data element contain s thread_number and element_number + verification should show element_number decreasing on a per thread basis + */ + + internal_display_test_name( "New start" ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + lfds700_list_asu_init_valid_on_current_logical_core( &lasus, NULL, NULL ); + + number_elements = ( memory_in_megabytes * ONE_MEGABYTE_IN_BYTES ) / ( sizeof(struct test_element) * number_logical_processors ); + + element_array = util_aligned_malloc( sizeof(struct test_element) * number_logical_processors * number_elements, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + for( subloop = 0 ; subloop < number_elements ; subloop++ ) + { + (element_array+(loop*number_elements)+subloop)->thread_number = loop; + (element_array+(loop*number_elements)+subloop)->element_number = subloop; + } + + ts = util_malloc_wrapper( sizeof(struct test_state) * number_logical_processors ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + { + (ts+loop)->lasus = &lasus; + (ts+loop)->element_array = element_array + (loop*number_elements); + (ts+loop)->number_elements = number_elements; + } + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors ); + + util_thread_starter_new( &tts, number_logical_processors ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + lasue = NULL; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, new_start_thread, ts+loop ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + free( thread_handles ); + + free( ts ); + + LFDS700_MISC_BARRIER_LOAD; + + /* TRD : validate the resultant list + iterate over each element + we expect to find element numbers increment on a per thread basis + */ + + vi.min_elements = vi.max_elements = number_elements * number_logical_processors; + + lfds700_list_asu_query( &lasus, LFDS700_LIST_ASU_QUERY_SINGLETHREADED_VALIDATE, &vi, &dvs ); + + per_thread_counters = util_malloc_wrapper( sizeof(lfds700_pal_uint_t) * number_logical_processors ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + *(per_thread_counters+loop) = number_elements - 1; + + lasue = NULL; + + while( dvs == LFDS700_MISC_VALIDITY_VALID and LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(lasus, lasue) ) + { + element = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + + if( element->thread_number >= number_logical_processors ) + { + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + break; + } + + if( element->element_number < per_thread_counters[element->thread_number] ) + dvs = LFDS700_MISC_VALIDITY_INVALID_MISSING_ELEMENTS; + + if( element->element_number > per_thread_counters[element->thread_number] ) + dvs = LFDS700_MISC_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; + + if( element->element_number == per_thread_counters[element->thread_number] ) + per_thread_counters[element->thread_number]--; + } + + free( per_thread_counters ); + + lfds700_list_asu_cleanup( &lasus, NULL ); + + util_aligned_free( element_array ); + + internal_display_test_result( 1, "list_asu", dvs ); + + return; +} + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION new_start_thread( void *util_thread_starter_thread_state ) +{ + lfds700_pal_uint_t + loop; + + struct lfds700_misc_prng_state + ps; + + struct test_state + *ts; + + struct util_thread_starter_thread_state + *tsts; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + lfds700_misc_prng_init( &ps ); + + util_thread_starter_ready_and_wait( tsts ); + + for( loop = 0 ; loop < ts->number_elements ; loop++ ) + { + LFDS700_LIST_ASU_SET_KEY_IN_ELEMENT( (ts->element_array+loop)->lasue, ts->element_array+loop ); + LFDS700_LIST_ASU_SET_VALUE_IN_ELEMENT( (ts->element_array+loop)->lasue, ts->element_array+loop ); + lfds700_list_asu_insert_at_position( ts->lasus, &(ts->element_array+loop)->lasue, NULL, LFDS700_LIST_ASU_POSITION_START, &ps ); + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_porting_abstraction_layer_atomic.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_porting_abstraction_layer_atomic.c new file mode 100644 index 0000000000000000000000000000000000000000..2f733909a74f0b4b281ee8e77dd37f9ea989d082 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_porting_abstraction_layer_atomic.c @@ -0,0 +1,33 @@ +/***** includes *****/ +#include "internal.h" + + + + + +/****************************************************************************/ +#pragma warning( disable : 4127 ) // TRD : disables MSVC warning for condition expressions being const + +void test_lfds700_pal_atomic( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + printf( "\n" + "Abstraction Atomic Tests\n" + "========================\n" ); + + if( LFDS700_MISC_ATOMIC_SUPPORT_CAS ) + test_lfds700_pal_atomic_cas( list_of_logical_processors ); + + if( LFDS700_MISC_ATOMIC_SUPPORT_DWCAS ) + test_lfds700_pal_atomic_dwcas( list_of_logical_processors ); + + if( LFDS700_MISC_ATOMIC_SUPPORT_EXCHANGE ) + test_lfds700_pal_atomic_exchange( list_of_logical_processors, memory_in_megabytes ); + + return; +} + +#pragma warning( default : 4127 ) + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_porting_abstraction_layer_atomic_cas.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_porting_abstraction_layer_atomic_cas.c new file mode 100644 index 0000000000000000000000000000000000000000..543528d99c7eac5ea9e2d938a5ce9b6419f8bb49 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_porting_abstraction_layer_atomic_cas.c @@ -0,0 +1,176 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_lfds700_pal_atomic_cas_state +{ + lfds700_pal_uint_t + local_counter; + + lfds700_pal_atom_t volatile + *shared_counter; +}; + +/***** private prototyps *****/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_cas( void *util_thread_starter_thread_state ); + + + + + +/****************************************************************************/ +void test_lfds700_pal_atomic_cas( struct lfds700_list_asu_state *list_of_logical_processors ) +{ + lfds700_pal_atom_t volatile LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + shared_counter; + + lfds700_pal_uint_t + local_total = 0; + + lfds700_pal_uint_t + loop, + number_logical_processors; + + struct lfds700_list_asu_element + *lasue; + + struct test_pal_logical_processor + *lp; + + struct util_thread_starter_state + *tts; + + struct test_lfds700_pal_atomic_cas_state + *atcs; + + test_pal_thread_state_t + *thread_handles; + + assert( list_of_logical_processors != NULL ); + + /* TRD : here we test pal_cas + + we run one thread per CPU + we use pal_cas() to increment a shared counter + every time a thread successfully increments the counter, + it increments a thread local counter + the threads run for ten seconds + after the threads finish, we total the local counters + they should equal the shared counter + */ + + internal_display_test_name( "Atomic CAS" ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + shared_counter = 0; + + atcs = util_malloc_wrapper( sizeof(struct test_lfds700_pal_atomic_cas_state) * number_logical_processors ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + { + (atcs+loop)->shared_counter = &shared_counter; + (atcs+loop)->local_counter = 0; + } + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors ); + + util_thread_starter_new( &tts, number_logical_processors ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + lasue = NULL; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, thread_cas, atcs+loop ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + free( thread_handles ); + + // TRD : results + LFDS700_MISC_BARRIER_LOAD; + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + local_total += (atcs+loop)->local_counter; + + if( local_total == shared_counter ) + puts( "passed" ); + + if( local_total != shared_counter ) + { + puts( "failed" ); + exit( EXIT_FAILURE ); + } + + // TRD : cleanup + free( atcs ); + + return; +} + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_cas( void *util_thread_starter_thread_state ) +{ + char unsigned + result; + + lfds700_pal_uint_t + loop = 0; + + lfds700_pal_atom_t LFDS700_PAL_ALIGN(LFDS700_PAL_ALIGN_SINGLE_POINTER) + exchange, + compare; + + struct test_lfds700_pal_atomic_cas_state + *atcs; + + struct util_thread_starter_thread_state + *tsts; + + LFDS700_MISC_BARRIER_LOAD; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + atcs = (struct test_lfds700_pal_atomic_cas_state *) tsts->thread_user_state; + + util_thread_starter_ready_and_wait( tsts ); + + while( loop++ < 10000000 ) + { + compare = *atcs->shared_counter; + + do + { + exchange = compare + 1; + LFDS700_PAL_ATOMIC_CAS( atcs->shared_counter, &compare, exchange, LFDS700_MISC_CAS_STRENGTH_WEAK, result ); + } + while( result == 0 ); + + atcs->local_counter++; + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_porting_abstraction_layer_atomic_dcas.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_porting_abstraction_layer_atomic_dcas.c new file mode 100644 index 0000000000000000000000000000000000000000..4973e73770b1d52b10f5aaa74a6e51ddfe3d454a --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_porting_abstraction_layer_atomic_dcas.c @@ -0,0 +1,177 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_lfds700_pal_atomic_dwcas_state +{ + lfds700_pal_uint_t + local_counter; + + lfds700_pal_atom_t volatile + (*shared_counter)[2]; +}; + +/***** private prototyps *****/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_dwcas( void *util_thread_starter_thread_state ); + + + + + +/****************************************************************************/ +void test_lfds700_pal_atomic_dwcas( struct lfds700_list_asu_state *list_of_logical_processors ) +{ + lfds700_pal_uint_t + local_total = 0, + loop, + number_logical_processors; + + lfds700_pal_atom_t volatile LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + shared_counter[2] = { 0, 0 }; + + struct lfds700_list_asu_element + *lasue; + + struct test_pal_logical_processor + *lp; + + struct util_thread_starter_state + *tts; + + struct test_lfds700_pal_atomic_dwcas_state + *atds; + + test_pal_thread_state_t + *thread_handles; + + assert( list_of_logical_processors != NULL ); + + /* TRD : here we test pal_dwcas + + we run one thread per CPU + we use pal_dwcas() to increment a shared counter + every time a thread successfully increments the counter, + it increments a thread local counter + the threads run for ten seconds + after the threads finish, we total the local counters + they should equal the shared counter + */ + + internal_display_test_name( "Atomic DWCAS" ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + atds = util_malloc_wrapper( sizeof(struct test_lfds700_pal_atomic_dwcas_state) * number_logical_processors ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + { + (atds+loop)->shared_counter = &shared_counter; + (atds+loop)->local_counter = 0; + } + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors ); + + util_thread_starter_new( &tts, number_logical_processors ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + lasue = NULL; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, thread_dwcas, atds+loop ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + free( thread_handles ); + + // TRD : results + LFDS700_MISC_BARRIER_LOAD; + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + local_total += (atds+loop)->local_counter; + + if( local_total == shared_counter[0] ) + puts( "passed" ); + + if( local_total != shared_counter[0] ) + { + printf( "%llu != %llu\n", (int long long unsigned) local_total, (int long long unsigned) shared_counter[0] ); + puts( "failed" ); + exit( EXIT_FAILURE ); + } + + // TRD : cleanup + free( atds ); + + return; +} + +#pragma warning( disable : 4702 ) + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_dwcas( void *util_thread_starter_thread_state ) +{ + char unsigned + result; + + lfds700_pal_uint_t + loop = 0; + + lfds700_pal_atom_t LFDS700_PAL_ALIGN(LFDS700_PAL_ALIGN_DOUBLE_POINTER) + exchange[2], + compare[2]; + + struct test_lfds700_pal_atomic_dwcas_state + *atds; + + struct util_thread_starter_thread_state + *tsts; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + atds = (struct test_lfds700_pal_atomic_dwcas_state *) tsts->thread_user_state; + + LFDS700_MISC_BARRIER_LOAD; + + util_thread_starter_ready_and_wait( tsts ); + + while( loop++ < 10000000 ) + { + compare[0] = (*atds->shared_counter)[0]; + compare[1] = (*atds->shared_counter)[1]; + + do + { + exchange[0] = compare[0] + 1; + exchange[1] = compare[1]; + LFDS700_PAL_ATOMIC_DWCAS( atds->shared_counter, compare, exchange, LFDS700_MISC_CAS_STRENGTH_WEAK, result ); + } + while( result == 0 ); + + atds->local_counter++; + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_porting_abstraction_layer_atomic_exchange.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_porting_abstraction_layer_atomic_exchange.c new file mode 100644 index 0000000000000000000000000000000000000000..ba6366e524f2e3a6cefd1e2a0af8b2e256b0dc9b --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_porting_abstraction_layer_atomic_exchange.c @@ -0,0 +1,333 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_state +{ + lfds700_pal_uint_t + counter, + *counter_array, + number_elements, + number_logical_processors; + + lfds700_pal_uint_t volatile + *shared_exchange; +}; + +/***** private prototyps *****/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_exchange( void *util_thread_starter_thread_state ); +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_atomic_exchange( void *util_thread_starter_thread_state ); + + + + + +/****************************************************************************/ +void test_lfds700_pal_atomic_exchange( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + enum flag + atomic_exchange_success_flag = RAISED, + exchange_success_flag = RAISED; + + lfds700_pal_uint_t + loop, + *merged_counter_arrays, + number_elements, + number_logical_processors, + subloop; + + lfds700_pal_uint_t volatile LFDS700_PAL_ALIGN(LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES) + exchange; + + struct lfds700_list_asu_element + *lasue; + + struct test_state + *ts; + + struct test_pal_logical_processor + *lp; + + struct util_thread_starter_state + *tts; + + test_pal_thread_state_t + *thread_handles; + + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + /* TRD : here we test pal_atomic_exchange + + we have one thread per logical core + there is one variable which every thread will exchange to/from + we know the number of logical cores + the threads have a counter each, which begins with their logical core number plus one + (plus one because the exchange counter begins with 0 already in place) + (e.g. thread 0 begins with its counter at 1, thread 1 begins with its counter at 2, etc) + + there is an array per thread of 1 million elements, each a counter, set to 0 + + when running, each thread increments its counter by the number of threads + the threads busy loop, exchanging + every time aa thread pulls a number off the central, shared exchange variable, + it increments the counter for that variable in its thread-local counter array + + (we're not using a global array, because we'd have to be atomic in our increments, + which is a slow-down we don't want) + + at the end, we merge all the counter arrays and if the frequency for a counter is a value + other than 1, the exchange was not atomic + + we perform the test twice, once with pal_atomic_exchange, once with a non-atomic exchange + + we expect the atomic to pass and the non-atomic to fail + */ + + internal_display_test_name( "Atomic exchange" ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + number_elements = ( memory_in_megabytes * ONE_MEGABYTE_IN_BYTES ) / ( sizeof(lfds700_pal_uint_t) * (number_logical_processors + 1) ); + + merged_counter_arrays = util_malloc_wrapper( sizeof(lfds700_pal_uint_t) * number_elements ); + + for( loop = 0 ; loop < number_elements ; loop++ ) + *(merged_counter_arrays+loop) = 0; + + ts = util_malloc_wrapper( sizeof(struct test_state) * number_logical_processors ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + { + (ts+loop)->counter = loop + 1; + (ts+loop)->counter_array = util_malloc_wrapper( sizeof(lfds700_pal_uint_t) * number_elements ); + for( subloop = 0 ; subloop < number_elements ; subloop++ ) + *((ts+loop)->counter_array+subloop) = 0; + (ts+loop)->number_logical_processors = number_logical_processors; + (ts+loop)->shared_exchange = &exchange; + (ts+loop)->number_elements = number_elements; + } + + exchange = 0; + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors ); + + // TRD : non-atomic + util_thread_starter_new( &tts, number_logical_processors ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + lasue = NULL; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, thread_exchange, ts+loop ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + LFDS700_MISC_BARRIER_LOAD; + + for( loop = 0 ; loop < number_elements ; loop++ ) + for( subloop = 0 ; subloop < number_logical_processors ; subloop++ ) + *(merged_counter_arrays+loop) += *( (ts+subloop)->counter_array+loop ); + + /* TRD : the worker threads exit when their per-thread counter exceeds 1,000,000 + as such the final number_logical_processors numbers are not read + we could change the threads to exit when the number they read exceeds 1,000,000 + but then we'd need an if() in their work-loop, + and we need to go as fast as possible + */ + + for( loop = 0 ; loop < number_elements - number_logical_processors ; loop++ ) + if( *(merged_counter_arrays+loop) != 1 ) + exchange_success_flag = LOWERED; + + // TRD : now for atomic exchange - we need to re-init the data structures + + for( loop = 0 ; loop < number_elements ; loop++ ) + *(merged_counter_arrays+loop) = 0; + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + for( subloop = 0 ; subloop < number_elements ; subloop++ ) + *((ts+loop)->counter_array+subloop) = 0; + + exchange = 0; + + util_thread_starter_new( &tts, number_logical_processors ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + lasue = NULL; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, thread_atomic_exchange, ts+loop ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + for( loop = 0 ; loop < number_elements ; loop++ ) + for( subloop = 0 ; subloop < number_logical_processors ; subloop++ ) + *(merged_counter_arrays+loop) += *( (ts+subloop)->counter_array+loop ); + + for( loop = 0 ; loop < number_elements - number_logical_processors ; loop++ ) + if( *(merged_counter_arrays+loop) != 1 ) + atomic_exchange_success_flag = LOWERED; + + // TRD : cleanup + free( merged_counter_arrays ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + free( (ts+loop)->counter_array ); + + util_thread_starter_delete( tts ); + free( thread_handles ); + free( ts ); + + /* TRD : results + + on a single core, atomic and non-atomic exchange should both work + + if we find our non-atomic test passes, then we can't really say anything + about whether or not the atomic test is really working + */ + + LFDS700_MISC_BARRIER_LOAD; + + if( number_logical_processors == 1 ) + { + if( exchange_success_flag == RAISED and atomic_exchange_success_flag == RAISED ) + puts( "passed" ); + + if( exchange_success_flag != RAISED or atomic_exchange_success_flag != RAISED ) + puts( "failed (atomic and non-atomic both failed)" ); + } + + if( number_logical_processors >= 2 ) + { + if( atomic_exchange_success_flag == RAISED and exchange_success_flag == LOWERED ) + puts( "passed" ); + + if( atomic_exchange_success_flag == RAISED and exchange_success_flag == RAISED ) + puts( "indeterminate (atomic and non-atomic both passed)" ); + + if( atomic_exchange_success_flag == LOWERED ) + { + puts( "failed (atomic failed)" ); + exit( EXIT_FAILURE ); + } + } + + return; +} + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_exchange( void *util_thread_starter_thread_state ) +{ + lfds700_pal_uint_t + local_counter, + exchange; + + struct test_state + *ts; + + struct util_thread_starter_thread_state + *tsts; + + LFDS700_MISC_BARRIER_LOAD; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + util_thread_starter_ready_and_wait( tsts ); + + local_counter = ts->counter; + + while( local_counter < ts->number_elements ) + { + exchange = *ts->shared_exchange; + *ts->shared_exchange = local_counter; + + ( *(ts->counter_array + exchange) )++; + + local_counter += ts->number_logical_processors; + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_atomic_exchange( void *util_thread_starter_thread_state ) +{ + lfds700_pal_uint_t + local_counter, + exchange; + + struct test_state + *ts; + + struct util_thread_starter_thread_state + *tsts; + + LFDS700_MISC_BARRIER_LOAD; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + util_thread_starter_ready_and_wait( tsts ); + + local_counter = ts->counter; + + while( local_counter < ts->number_elements ) + { + exchange = local_counter; + + LFDS700_PAL_ATOMIC_EXCHANGE( ts->shared_exchange, &exchange ); + + ( *(ts->counter_array + exchange) )++; + + local_counter += ts->number_logical_processors; + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue.c new file mode 100644 index 0000000000000000000000000000000000000000..8e41b01b5dc360a2c2ffcb417fcec2d371bcf4d0 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue.c @@ -0,0 +1,35 @@ +/***** includes *****/ +#include "internal.h" + + + + + +/****************************************************************************/ +#pragma warning( disable : 4127 ) // TRD : disables MSVC warning for condition expressions being const + +void test_lfds700_queue( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + if( LFDS700_MISC_ATOMIC_SUPPORT_DWCAS ) + { + printf( "\n" + "Queue Tests\n" + "===========\n" ); + + test_lfds700_queue_alignment(); + test_lfds700_queue_enqueuing( list_of_logical_processors, memory_in_megabytes ); + test_lfds700_queue_dequeuing( list_of_logical_processors, memory_in_megabytes ); + test_lfds700_queue_enqueuing_and_dequeuing( list_of_logical_processors ); + test_lfds700_queue_rapid_enqueuing_and_dequeuing( list_of_logical_processors, memory_in_megabytes ); + test_lfds700_queue_enqueuing_and_dequeuing_with_free( list_of_logical_processors, memory_in_megabytes ); + test_lfds700_queue_enqueuing_with_malloc_and_dequeuing_with_free( list_of_logical_processors ); + } + + return; +} + +#pragma warning( default : 4127 ) + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_alignment.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_alignment.c new file mode 100644 index 0000000000000000000000000000000000000000..6f723825eae65ab32e618861c8447e259aaf5443 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_alignment.c @@ -0,0 +1,55 @@ +/***** includes *****/ +#include "internal.h" + + + + + +/****************************************************************************/ +#pragma warning( disable : 4127 ) // TRD : disables MSVC warning for condition expressions being const + +void test_lfds700_queue_alignment() +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + /* TRD : these are compile time checks + but we do them here because this is a test programme + and it should indicate issues to users when it is *run*, + not when it is compiled, because a compile error normally + indicates a problem with the code itself and so is misleading + */ + + internal_display_test_name( "Alignment" ); + + + + // TRD : struct lfds700_queue_element + if( offsetof(struct lfds700_queue_element,next) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + if( offsetof(struct lfds700_queue_element,key) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + + + // TRD : struct lfds700_queue_state + if( offsetof(struct lfds700_queue_state,enqueue) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + if( offsetof(struct lfds700_queue_state,dequeue) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + if( offsetof(struct lfds700_queue_state,user_state) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + + + // TRD : print the test result + internal_display_test_result( 1, "queue", dvs ); + + return; +} + +#pragma warning( default : 4127 ) + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_bounded_singleconsumer_singleproducer.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_bounded_singleconsumer_singleproducer.c new file mode 100644 index 0000000000000000000000000000000000000000..4c660ab3e1c2d3cac25d8103ac87018f92aeedd5 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_bounded_singleconsumer_singleproducer.c @@ -0,0 +1,25 @@ +/***** includes *****/ +#include "internal.h" + + + + + +/****************************************************************************/ +void test_lfds700_queue_bss( struct lfds700_list_asu_state *list_of_logical_processors ) +{ + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + printf( "\n" + "Queue (bounded, single consumer, single producer) Tests\n" + "=======================================================\n" ); + + // TRD : no alignment checks are required for queue_bss + test_lfds700_queue_bss_enqueuing(); + test_lfds700_queue_bss_dequeuing(); + test_lfds700_queue_bss_enqueuing_and_dequeuing( list_of_logical_processors ); + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_bounded_singleconsumer_singleproducer_dequeuing.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_bounded_singleconsumer_singleproducer_dequeuing.c new file mode 100644 index 0000000000000000000000000000000000000000..971555c4436934cb9f36a84554f21f5636076136 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_bounded_singleconsumer_singleproducer_dequeuing.c @@ -0,0 +1,61 @@ +/***** includes *****/ +#include "internal.h" + + + + + +/****************************************************************************/ +void test_lfds700_queue_bss_dequeuing() +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + lfds700_pal_uint_t + loop; + + struct lfds700_queue_bss_element + element_array[128]; + + struct lfds700_queue_bss_state + qs; + + struct lfds700_misc_validation_info + vi; + + void + *value; + + /* TRD : create an empty queue + enqueue 128 elements + then dequeue the elements, in the same thread - we're API testing + it's a single producer queue, so we just do this in our current thread + since we're enqueuing and dequeuing in the same thread, + + */ + + internal_display_test_name( "Dequeuing" ); + + lfds700_queue_bss_init_valid_on_current_logical_core( &qs, element_array, 128, NULL ); + + for( loop = 0 ; loop < 127 ; loop++ ) + lfds700_queue_bss_enqueue( &qs, NULL, (void *) loop ); + + for( loop = 0 ; loop < 127 ; loop++ ) + { + lfds700_queue_bss_dequeue( &qs, NULL, &value ); + if( (lfds700_pal_uint_t) value != 127 - loop ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + } + + vi.min_elements = vi.max_elements = 0; + + lfds700_queue_bss_query( &qs, LFDS700_QUEUE_BSS_QUERY_VALIDATE, &vi, &dvs ); + + lfds700_queue_bss_cleanup( &qs, NULL ); + + internal_display_test_result( 1, "queue_bss", dvs ); + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_bounded_singleconsumer_singleproducer_enqueuing.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_bounded_singleconsumer_singleproducer_enqueuing.c new file mode 100644 index 0000000000000000000000000000000000000000..807337864aa02ce67781d954eefed05ea16a5e62 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_bounded_singleconsumer_singleproducer_enqueuing.c @@ -0,0 +1,59 @@ +/***** includes *****/ +#include "internal.h" + + + + + +/****************************************************************************/ +void test_lfds700_queue_bss_enqueuing() +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + int + rv; + + lfds700_pal_uint_t + loop; + + struct lfds700_queue_bss_element + element_array[128]; + + struct lfds700_queue_bss_state + qs; + + struct lfds700_misc_validation_info + vi; + + /* TRD : create an empty queue + enqueue 128 elements + it's a single producer queue, so we just do this in our current thread + it's an API test + */ + + internal_display_test_name( "Enqueuing" ); + + lfds700_queue_bss_init_valid_on_current_logical_core( &qs, element_array, 128, NULL ); + + for( loop = 0 ; loop < 127 ; loop++ ) + if( 1 != lfds700_queue_bss_enqueue(&qs, NULL, (void *) loop) ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + // TRD : at this point enqueuing one more should return 0 + rv = lfds700_queue_bss_enqueue( &qs, NULL, (void *) loop ); + + if( rv != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + vi.min_elements = vi.max_elements = 127; + + lfds700_queue_bss_query( &qs, LFDS700_QUEUE_BSS_QUERY_VALIDATE, &vi, &dvs ); + + lfds700_queue_bss_cleanup( &qs, NULL ); + + internal_display_test_result( 1, "queue_bss", dvs ); + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_bounded_singleconsumer_singleproducer_enqueuing_and_dequeuing.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_bounded_singleconsumer_singleproducer_enqueuing_and_dequeuing.c new file mode 100644 index 0000000000000000000000000000000000000000..ad218609fd36204681ea9002c1d39d092bee0aed --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_bounded_singleconsumer_singleproducer_enqueuing_and_dequeuing.c @@ -0,0 +1,260 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_state +{ + enum flag + error_flag; + + struct lfds700_queue_bss_state + *qs; +}; + +/***** private prototypes *****/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_enqueuer( void *util_thread_starter_thread_state ); +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_dequeuer( void *util_thread_starter_thread_state ); + + + + + +/****************************************************************************/ +void test_lfds700_queue_bss_enqueuing_and_dequeuing( struct lfds700_list_asu_state *list_of_logical_processors ) +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + lfds700_pal_uint_t + loop, + number_logical_processors, + subloop; + + struct lfds700_list_asu_element + *lasue; + + struct lfds700_queue_bss_element + element_array[4]; + + struct lfds700_queue_bss_state + qs; + + struct test_pal_logical_processor + *lp, + *lp_first; + + struct util_thread_starter_state + *tts; + + struct test_state + *ts; + + test_pal_thread_state_t + *thread_handles; + + assert( list_of_logical_processors != NULL ); + + /* TRD : so, this is the real test + problem is, because we use memory barriers only + and we only support one producer and one consumer + we need to ensure these threads are on different physical cores + if they're on the same core, the code would work even without memory barriers + + problem is, in the test application, we only know the *number* of logical cores + obtaining topology information adds a great deal of complexity to the test app + and makes porting much harder + + so, we know how many logical cores there are; my thought is to partially + permutate over them - we always run the producer on core 0, but we iterate + over the other logical cores, running the test once each time, with the + consumer being run on core 0, then core 1, then core 2, etc + + (we run on core 0 for the single-cpu case; it's redundent, since a single + logical core running both producer and consumer will work, but otherwise + we have to skip the test, which is confusing for the user) + + the test is one thread enqueuing and one thread dequeuing for two seconds + */ + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + internal_display_test_name( "Enqueuing and dequeuing (%d seconds)", number_logical_processors * 2 ); + + ts = util_malloc_wrapper( sizeof(struct test_state) * 2 ); + + for( loop = 0 ; loop < 2 ; loop++ ) + { + (ts+loop)->qs = &qs; + (ts+loop)->error_flag = LOWERED; + } + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * 2 ); + + /* TRD : producer always on core 0 + iterate over the other cores with consumer + */ + + lasue = LFDS700_LIST_ASU_GET_START( *list_of_logical_processors ); + lp_first = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + + while( lasue != NULL ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + + lfds700_queue_bss_init_valid_on_current_logical_core( &qs, element_array, 4, NULL ); + + util_thread_starter_new( &tts, 2 ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + util_thread_starter_start( tts, &thread_handles[0], 0, lp_first, thread_enqueuer, ts ); + util_thread_starter_start( tts, &thread_handles[1], 1, lp, thread_dequeuer, ts+1 ); + + util_thread_starter_run( tts ); + + for( subloop = 0 ; subloop < 2 ; subloop++ ) + test_pal_thread_wait( thread_handles[subloop] ); + + util_thread_starter_delete( tts ); + + LFDS700_MISC_BARRIER_LOAD; + + lfds700_queue_bss_cleanup( &qs, NULL ); + + lasue = LFDS700_LIST_ASU_GET_NEXT( *lasue ); + } + + if( (ts+1)->error_flag == RAISED ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + free( thread_handles ); + + free( ts ); + + internal_display_test_result( 1, "queue_bss", dvs ); + + return; +} + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_enqueuer( void *util_thread_starter_thread_state ) +{ + int + rv; + + lfds700_pal_uint_t + datum = 0, + time_loop = 0; + + struct test_state + *ts; + + struct util_thread_starter_thread_state + *tsts; + + time_t + current_time, + start_time; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + util_thread_starter_ready_and_wait( tsts ); + + current_time = start_time = time( NULL ); + + while( current_time < start_time + 2 ) + { + rv = lfds700_queue_bss_enqueue( ts->qs, NULL, (void *) datum ); + + if( rv == 1 ) + if( ++datum == 4 ) + datum = 0; + + if( time_loop++ == TIME_LOOP_COUNT ) + { + time_loop = 0; + time( ¤t_time ); + } + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_dequeuer( void *util_thread_starter_thread_state ) +{ + int + rv; + + lfds700_pal_uint_t + datum, + expected_datum = 0, + time_loop = 0; + + struct test_state + *ts; + + struct util_thread_starter_thread_state + *tsts; + + time_t + current_time, + start_time; + + LFDS700_MISC_BARRIER_LOAD; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + util_thread_starter_ready_and_wait( tsts ); + + current_time = start_time = time( NULL ); + + while( current_time < start_time + 2 ) + { + rv = lfds700_queue_bss_dequeue( ts->qs, NULL, (void *) &datum ); + + if( rv == 1 ) + { + if( datum != expected_datum ) + ts->error_flag = RAISED; + + if( ++expected_datum == 4 ) + expected_datum = 0; + } + + if( time_loop++ == TIME_LOOP_COUNT ) + { + time_loop = 0; + time( ¤t_time ); + } + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_dequeuing.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_dequeuing.c new file mode 100644 index 0000000000000000000000000000000000000000..74f271d320012044527e1f89a5d06fb3b6a289df --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_dequeuing.c @@ -0,0 +1,215 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_state +{ + enum flag + error_flag; + + struct lfds700_queue_state + *qs; +}; + +struct test_element +{ + struct lfds700_queue_element + qe; +}; + +/***** private prototypes *****/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_simple_dequeuer( void *util_thread_starter_thread_state ); + + + + + +/****************************************************************************/ +void test_lfds700_queue_dequeuing( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + lfds700_pal_uint_t + loop, + number_elements_with_dummy_element, + number_elements_without_dummy_element, + number_logical_processors; + + struct lfds700_list_asu_element + *lasue; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_queue_state + qs; + + struct lfds700_misc_validation_info + vi = { 0, 0 }; + + struct test_pal_logical_processor + *lp; + + struct util_thread_starter_state + *tts; + + struct test_element + *te_array; + + struct test_state + *ts; + + test_pal_thread_state_t + *thread_handles; + + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + /* TRD : create a queue, add 1,000,000 elements + + use a single thread to enqueue every element + each elements user data is an incrementing counter + + then run one thread per CPU + where each busy-works dequeuing + + when an element is dequeued, we check (on a per-thread basis) the + value dequeued is greater than the element previously dequeued + + note we have no variation in the test for CAS+GC vs DWCAS + this is because all we do is dequeue + what we actually want to stress test is the queue + not CAS + so it's better to let the dequeue run as fast as possible + */ + + internal_display_test_name( "Dequeuing" ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + lfds700_misc_prng_init( &ps ); + + number_elements_with_dummy_element = ( memory_in_megabytes * ONE_MEGABYTE_IN_BYTES ) / sizeof(struct test_element); + number_elements_without_dummy_element = number_elements_with_dummy_element - 1; + + te_array = util_aligned_malloc( sizeof(struct test_element) * number_elements_with_dummy_element, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + lfds700_queue_init_valid_on_current_logical_core( &qs, &(te_array + number_elements_without_dummy_element)->qe, &ps, NULL ); + + for( loop = 0 ; loop < number_elements_without_dummy_element ; loop++ ) + { + LFDS700_QUEUE_SET_VALUE_IN_ELEMENT( (te_array+loop)->qe, loop ); + lfds700_queue_enqueue( &qs, &(te_array+loop)->qe, &ps ); + } + + ts = util_malloc_wrapper( sizeof(struct test_state) * number_logical_processors ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + { + (ts+loop)->qs = &qs; + (ts+loop)->error_flag = LOWERED; + } + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors ); + + util_thread_starter_new( &tts, number_logical_processors ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + lasue = NULL; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, thread_simple_dequeuer, ts+loop ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + free( thread_handles ); + + LFDS700_MISC_BARRIER_LOAD; + + // TRD : check queue is empty + lfds700_queue_query( &qs, LFDS700_QUEUE_QUERY_SINGLETHREADED_VALIDATE, &vi, &dvs ); + + // TRD : check for raised error flags + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + if( (ts+loop)->error_flag == RAISED ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + free( ts ); + + util_aligned_free( te_array ); + + lfds700_queue_cleanup( &qs, NULL ); + + internal_display_test_result( 1, "queue", dvs ); + + return; +} + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_simple_dequeuer( void *util_thread_starter_thread_state ) +{ + lfds700_pal_uint_t + *prev_value, + *value; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_queue_element + *qe; + + struct test_state + *ts; + + struct util_thread_starter_thread_state + *tsts; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + lfds700_misc_prng_init( &ps ); + + lfds700_queue_dequeue( ts->qs, &qe, &ps ); + prev_value = LFDS700_QUEUE_GET_VALUE_FROM_ELEMENT( *qe ); + + util_thread_starter_ready_and_wait( tsts ); + + while( lfds700_queue_dequeue(ts->qs, &qe, &ps) ) + { + value = LFDS700_QUEUE_GET_VALUE_FROM_ELEMENT( *qe ); + + if( value <= prev_value ) + ts->error_flag = RAISED; + + prev_value = value; + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_enqueuing.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_enqueuing.c new file mode 100644 index 0000000000000000000000000000000000000000..89ccf30fcbd184b9fea2440e8dcb643f3cf7c32a --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_enqueuing.c @@ -0,0 +1,239 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_state +{ + lfds700_pal_uint_t + number_elements, + thread_number; + + struct lfds700_queue_state + *qs; + + struct test_element + *te_array; +}; + +struct test_element +{ + struct lfds700_queue_element + qe; + + lfds700_pal_uint_t + counter, + thread_number; +}; + +/***** private prototypes *****/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_simple_enqueuer( void *util_thread_starter_thread_state ); + + + + + +/****************************************************************************/ +void test_lfds700_queue_enqueuing( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + lfds700_pal_uint_t + *per_thread_counters, + loop, + number_elements, + number_logical_processors; + + struct lfds700_list_asu_element + *lasue; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_queue_element + dummy_qe, + *qe; + + struct lfds700_queue_state + qs; + + struct lfds700_misc_validation_info + vi; + + struct test_pal_logical_processor + *lp; + + struct util_thread_starter_state + *tts; + + struct test_element + *te; + + struct test_state + *ts; + + test_pal_thread_state_t + *thread_handles; + + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + /* TRD : create an empty queue + then run one thread per CPU + where each thread busy-works, enqueuing elements from a freelist (one local freelist per thread) + until 100000 elements are enqueued, per thread + each element's void pointer of user data is a struct containing thread number and element number + where element_number is a thread-local counter starting at 0 + + when we're done, we check that all the elements are present + and increment on a per-thread basis + */ + + internal_display_test_name( "Enqueuing" ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + lfds700_misc_prng_init( &ps ); + + number_elements = ( memory_in_megabytes * ONE_MEGABYTE_IN_BYTES ) / ( sizeof(struct test_element) * number_logical_processors ); + + lfds700_queue_init_valid_on_current_logical_core( &qs, &dummy_qe, &ps, NULL ); + + ts = util_malloc_wrapper( sizeof(struct test_state) * number_logical_processors ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + { + (ts+loop)->qs = &qs; + (ts+loop)->thread_number = loop; + (ts+loop)->number_elements = number_elements; + } + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors ); + + util_thread_starter_new( &tts, number_logical_processors ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + lasue = NULL; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, thread_simple_enqueuer, ts+loop ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + free( thread_handles ); + + LFDS700_MISC_BARRIER_LOAD; + + /* TRD : first, validate the queue + + then dequeue + we expect to find element numbers increment on a per thread basis + */ + + vi.min_elements = vi.max_elements = number_elements * number_logical_processors; + + lfds700_queue_query( &qs, LFDS700_QUEUE_QUERY_SINGLETHREADED_VALIDATE, &vi, &dvs ); + + per_thread_counters = util_malloc_wrapper( sizeof(lfds700_pal_uint_t) * number_logical_processors ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + *(per_thread_counters+loop) = 0; + + while( dvs == LFDS700_MISC_VALIDITY_VALID and lfds700_queue_dequeue(&qs, &qe, &ps) ) + { + te = LFDS700_QUEUE_GET_VALUE_FROM_ELEMENT( *qe ); + + if( te->thread_number >= number_logical_processors ) + { + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + break; + } + + if( te->counter > per_thread_counters[te->thread_number] ) + dvs = LFDS700_MISC_VALIDITY_INVALID_MISSING_ELEMENTS; + + if( te->counter < per_thread_counters[te->thread_number] ) + dvs = LFDS700_MISC_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; + + if( te->counter == per_thread_counters[te->thread_number] ) + per_thread_counters[te->thread_number]++; + } + + free( per_thread_counters ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + util_aligned_free( (ts+loop)->te_array ); + + free( ts ); + + lfds700_queue_cleanup( &qs, NULL ); + + internal_display_test_result( 1, "queue", dvs ); + + return; +} + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_simple_enqueuer( void *util_thread_starter_thread_state ) +{ + lfds700_pal_uint_t + loop; + + struct lfds700_misc_prng_state + ps; + + struct test_state + *ts; + + struct util_thread_starter_thread_state + *tsts; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + lfds700_misc_prng_init( &ps ); + + ts->te_array = util_aligned_malloc( sizeof(struct test_element) * ts->number_elements, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + for( loop = 0 ; loop < ts->number_elements ; loop++ ) + { + (ts->te_array+loop)->thread_number = ts->thread_number; + (ts->te_array+loop)->counter = loop; + } + + util_thread_starter_ready_and_wait( tsts ); + + for( loop = 0 ; loop < ts->number_elements ; loop++ ) + { + LFDS700_QUEUE_SET_VALUE_IN_ELEMENT( (ts->te_array+loop)->qe, ts->te_array+loop ); + lfds700_queue_enqueue( ts->qs, &(ts->te_array+loop)->qe, &ps ); + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_enqueuing_and_dequeuing.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_enqueuing_and_dequeuing.c new file mode 100644 index 0000000000000000000000000000000000000000..1469635fd4592b39107b1a17b9d1511a10c077b2 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_enqueuing_and_dequeuing.c @@ -0,0 +1,250 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_state +{ + enum flag + error_flag; + + lfds700_pal_uint_t + counter, + number_logical_processors, + *per_thread_counters, + thread_number; + + struct lfds700_queue_state + *qs; +}; + +struct test_element +{ + struct lfds700_queue_element + qe, + *qe_use; + + lfds700_pal_uint_t + counter, + thread_number; +}; + +/***** private prototypes *****/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_enqueuer_and_dequeuer( void *util_thread_starter_thread_state ); + + + + + +/****************************************************************************/ +void test_lfds700_queue_enqueuing_and_dequeuing( struct lfds700_list_asu_state *list_of_logical_processors ) +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + lfds700_pal_uint_t + loop, + number_logical_processors, + subloop; + + struct lfds700_list_asu_element + *lasue; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_queue_state + qs; + + struct lfds700_misc_validation_info + vi; + + struct test_pal_logical_processor + *lp; + + struct util_thread_starter_state + *tts; + + struct test_element + *te_array; + + struct test_state + *ts; + + test_pal_thread_state_t + *thread_handles; + + assert( list_of_logical_processors != NULL ); + // TRD : qt can be any value in its range + + /* TRD : create a queue with one element per thread + each thread constly dequeues and enqueues from that one queue + where when enqueuing sets in the element + its thread number and counter + and when dequeuing, checks the thread number and counter + against previously seen counter for that thread + where it should always see a higher number + */ + + internal_display_test_name( "Enqueuing and dequeuing (%d seconds)", TEST_DURATION_IN_SECONDS ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + lfds700_misc_prng_init( &ps ); + + te_array = util_aligned_malloc( sizeof(struct test_element) * (number_logical_processors+1), LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + lfds700_queue_init_valid_on_current_logical_core( &qs, &(te_array+number_logical_processors)->qe, &ps, NULL ); + + // TRD : we assume the test will iterate at least once (or we'll have a false negative) + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + { + (te_array+loop)->thread_number = loop; + (te_array+loop)->counter = 0; + LFDS700_QUEUE_SET_VALUE_IN_ELEMENT( (te_array+loop)->qe, te_array+loop ); + lfds700_queue_enqueue( &qs, &(te_array+loop)->qe, &ps ); + } + + ts = util_malloc_wrapper( sizeof(struct test_state) * number_logical_processors ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + { + (ts+loop)->qs = &qs; + (ts+loop)->thread_number = loop; + (ts+loop)->counter = 0; + (ts+loop)->error_flag = LOWERED; + (ts+loop)->per_thread_counters = util_malloc_wrapper( sizeof(lfds700_pal_uint_t) * number_logical_processors ); + (ts+loop)->number_logical_processors = number_logical_processors; + + for( subloop = 0 ; subloop < number_logical_processors ; subloop++ ) + *((ts+loop)->per_thread_counters+subloop) = 0; + } + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors ); + + util_thread_starter_new( &tts, number_logical_processors ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + lasue = NULL; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, thread_enqueuer_and_dequeuer, ts+loop ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + free( thread_handles ); + + LFDS700_MISC_BARRIER_LOAD; + + vi.min_elements = vi.max_elements = number_logical_processors; + + lfds700_queue_query( &qs, LFDS700_QUEUE_QUERY_SINGLETHREADED_VALIDATE, &vi, &dvs ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + if( (ts+loop)->error_flag == RAISED ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + free( (ts+loop)->per_thread_counters ); + + util_aligned_free( te_array ); + + free( ts ); + + lfds700_queue_cleanup( &qs, NULL ); + + internal_display_test_result( 1, "queue", dvs ); + + return; +} + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_enqueuer_and_dequeuer( void *util_thread_starter_thread_state ) +{ + lfds700_pal_uint_t + time_loop = 0; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_queue_element + *qe; + + struct test_element + *te; + + struct test_state + *ts; + + struct util_thread_starter_thread_state + *tsts; + + time_t + current_time, + start_time; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + lfds700_misc_prng_init( &ps ); + + util_thread_starter_ready_and_wait( tsts ); + + current_time = start_time = time( NULL ); + + while( current_time < start_time + TEST_DURATION_IN_SECONDS ) + { + lfds700_queue_dequeue( ts->qs, &qe, &ps ); + te = LFDS700_QUEUE_GET_VALUE_FROM_ELEMENT( *qe ); + + if( te->thread_number >= ts->number_logical_processors ) + ts->error_flag = RAISED; + else + { + if( te->counter < ts->per_thread_counters[te->thread_number] ) + ts->error_flag = RAISED; + + if( te->counter >= ts->per_thread_counters[te->thread_number] ) + ts->per_thread_counters[te->thread_number] = te->counter+1; + } + + te->thread_number = ts->thread_number; + te->counter = ++ts->counter; + + LFDS700_QUEUE_SET_VALUE_IN_ELEMENT( *qe, te ); + lfds700_queue_enqueue( ts->qs, qe, &ps ); + + if( time_loop++ == TIME_LOOP_COUNT ) + { + time_loop = 0; + time( ¤t_time ); + } + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_enqueuing_and_dequeuing_with_free.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_enqueuing_and_dequeuing_with_free.c new file mode 100644 index 0000000000000000000000000000000000000000..21be07052d59ac0d30dc186ab2da83260feb32a8 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_enqueuing_and_dequeuing_with_free.c @@ -0,0 +1,241 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_state +{ + lfds700_pal_uint_t + number_of_elements_per_thread; + + struct lfds700_queue_state + *qs; +}; + +/***** private prototypes *****/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_enqueue_dequeuer_with_free( void *util_thread_starter_thread_state ); +static void queue_element_cleanup_callback( struct lfds700_queue_state *qs, struct lfds700_queue_element *qe, enum lfds700_misc_flag dummy_element_flag ); + + + + + +/****************************************************************************/ +void test_lfds700_queue_enqueuing_and_dequeuing_with_free( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + lfds700_pal_uint_t + loop, + number_elements, + number_logical_processors, + number_of_elements_per_thread; + + struct lfds700_list_asu_element + *lasue; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_queue_element + *qe; + + struct lfds700_queue_state + qs; + + struct lfds700_misc_validation_info + vi; + + struct test_pal_logical_processor + *lp; + + struct test_state + *ts; + + struct util_thread_starter_state + *tts; + + test_pal_thread_state_t + *thread_handles; + + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + /* TRD : the M&Q queue supports free()ing queue elements after they've been dequeued + we need to test this + we spawn one thread per logical core + there's one master queue which all threads work on + we create one freelist per thread + and allocate as many queue elements as we can (no payload) + - but note each allocate is its own malloc() + each freelist receives an equal share (i.e. we get the mallocs out of the way) + each thread enqueues as rapidly as possible + and dequeues as rapidly as possible + (i.e. each thread loops, doing an enqueue and a dequeue) + when the dequeue is done, the element is free()ed + */ + + internal_display_test_name( "Enqueuing and dequeuing with free" ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + lfds700_misc_prng_init( &ps ); + + number_elements = ( memory_in_megabytes * ONE_MEGABYTE_IN_BYTES ) / ( sizeof(struct lfds700_freelist_element) + sizeof(struct lfds700_queue_element) ); + number_of_elements_per_thread = number_elements / number_logical_processors; + qe = util_aligned_malloc( sizeof(struct lfds700_queue_element), (lfds700_pal_uint_t) LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + lfds700_queue_init_valid_on_current_logical_core( &qs, qe, &ps, NULL ); + + ts = util_malloc_wrapper( sizeof(struct test_state) * number_logical_processors ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + { + (ts+loop)->qs = &qs; + (ts+loop)->number_of_elements_per_thread = number_of_elements_per_thread; + } + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors ); + + util_thread_starter_new( &tts, number_logical_processors ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + lasue = NULL; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, thread_enqueue_dequeuer_with_free, ts+loop ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + free( thread_handles ); + + LFDS700_MISC_BARRIER_LOAD; + + vi.min_elements = 0; + vi.max_elements = 0; + + lfds700_queue_query( &qs, LFDS700_QUEUE_QUERY_SINGLETHREADED_VALIDATE, &vi, &dvs ); + + lfds700_queue_cleanup( &qs, queue_element_cleanup_callback ); + + free( ts ); + + internal_display_test_result( 1, "queue", dvs ); + + return; +} + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_enqueue_dequeuer_with_free( void *util_thread_starter_thread_state ) +{ + enum flag + finished_flag = LOWERED; + + lfds700_pal_uint_t + loop; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_freelist_element + *fe, + *fe_array; + + struct lfds700_freelist_state + fs; + + struct lfds700_queue_element + *qe; + + struct test_state + *ts; + + struct util_thread_starter_thread_state + *tsts; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + lfds700_misc_prng_init( &ps ); + + lfds700_freelist_init_valid_on_current_logical_core( &fs, NULL ); + + fe_array = util_malloc_wrapper( sizeof(struct lfds700_freelist_element) * ts->number_of_elements_per_thread ); + + for( loop = 0 ; loop < ts->number_of_elements_per_thread ; loop++ ) + { + qe = util_aligned_malloc( sizeof(struct lfds700_queue_element), LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + LFDS700_FREELIST_SET_VALUE_IN_ELEMENT( fe_array[loop], qe ); + lfds700_freelist_push( &fs, &fe_array[loop], &ps ); + } + + util_thread_starter_ready_and_wait( tsts ); + + while( finished_flag == LOWERED ) + { + loop = 0; + while( loop++ < 1000 and lfds700_freelist_pop(&fs, &fe, &ps) ) + { + qe = LFDS700_FREELIST_GET_VALUE_FROM_ELEMENT( *fe ); + lfds700_queue_enqueue( ts->qs, qe, &ps ); + } + + if( loop < 1000 ) + finished_flag = RAISED; + + loop = 0; + while( loop++ < 1000 and lfds700_queue_dequeue(ts->qs, &qe, &ps) ) + util_aligned_free( qe ); + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + lfds700_freelist_cleanup( &fs, NULL ); + + free( fe_array ); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + + + + + +/****************************************************************************/ +#pragma warning( disable : 4100 ) + +static void queue_element_cleanup_callback( struct lfds700_queue_state *qs, struct lfds700_queue_element *qe, enum lfds700_misc_flag dummy_element_flag ) +{ + assert( qs != NULL ); + assert( qe != NULL ); + // TRD : dummy_element_flag can be any value in its range + + util_aligned_free( qe ); + + return; +} + +#pragma warning( default : 4100 ) + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_enqueuing_with_malloc_and_dequeuing_with_free.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_enqueuing_with_malloc_and_dequeuing_with_free.c new file mode 100644 index 0000000000000000000000000000000000000000..0f0fa7f08104f48c5a820fe9fdc30faacb1dc103 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_enqueuing_with_malloc_and_dequeuing_with_free.c @@ -0,0 +1,208 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_state +{ + struct lfds700_queue_state + *qs; +}; + +/***** private prototypes *****/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_enqueuer_with_malloc_and_dequeuer_with_free( void *util_thread_starter_thread_state ); +static void queue_element_cleanup_callback( struct lfds700_queue_state *qs, struct lfds700_queue_element *qe, enum lfds700_misc_flag dummy_element_flag ); + + + + + +/****************************************************************************/ +void test_lfds700_queue_enqueuing_with_malloc_and_dequeuing_with_free( struct lfds700_list_asu_state *list_of_logical_processors ) +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + lfds700_pal_uint_t + loop, + number_logical_processors; + + struct lfds700_list_asu_element + *lasue; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_queue_element + *qe; + + struct lfds700_queue_state + qs; + + struct lfds700_misc_validation_info + vi; + + struct test_pal_logical_processor + *lp; + + struct util_thread_starter_state + *tts; + + struct test_state + *ts; + + test_pal_thread_state_t + *thread_handles; + + assert( list_of_logical_processors != NULL ); + // TRD : qt can be any value in its range + + /* TRD : one thread per logical core + each thread loops for ten seconds + mallocs and enqueues 1k elements, then dequeues and frees 1k elements + */ + + internal_display_test_name( "Enqueuing with malloc dequeuing with free (%d seconds)", TEST_DURATION_IN_SECONDS ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + lfds700_misc_prng_init( &ps ); + + qe = util_aligned_malloc( sizeof(struct lfds700_queue_element), LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + lfds700_queue_init_valid_on_current_logical_core( &qs, qe, &ps, NULL ); + + ts = util_malloc_wrapper( sizeof(struct test_state) * number_logical_processors ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + (ts+loop)->qs = &qs; + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors ); + + util_thread_starter_new( &tts, number_logical_processors ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + lasue = NULL; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, thread_enqueuer_with_malloc_and_dequeuer_with_free, ts+loop ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + free( thread_handles ); + + LFDS700_MISC_BARRIER_LOAD; + + vi.min_elements = vi.max_elements = 0; + + lfds700_queue_query( &qs, LFDS700_QUEUE_QUERY_SINGLETHREADED_VALIDATE, &vi, &dvs ); + + free( ts ); + + lfds700_queue_cleanup( &qs, queue_element_cleanup_callback ); + + internal_display_test_result( 1, "queue", dvs ); + + return; +} + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_enqueuer_with_malloc_and_dequeuer_with_free( void *util_thread_starter_thread_state ) +{ + lfds700_pal_uint_t + loop, + time_loop = 0; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_queue_element + *qe; + + struct test_state + *ts; + + struct util_thread_starter_thread_state + *tsts; + + time_t + current_time, + start_time; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + lfds700_misc_prng_init( &ps ); + + util_thread_starter_ready_and_wait( tsts ); + + current_time = start_time = time( NULL ); + + while( current_time < start_time + TEST_DURATION_IN_SECONDS ) + { + for( loop = 0 ; loop < 1000 ; loop++ ) + { + qe = util_aligned_malloc( sizeof(struct lfds700_queue_element), LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + lfds700_queue_enqueue( ts->qs, qe, &ps ); + } + + for( loop = 0 ; loop < 1000 ; loop++ ) + { + lfds700_queue_dequeue( ts->qs, &qe, &ps ); + util_aligned_free( qe ); + } + + if( time_loop++ == REDUCED_TIME_LOOP_COUNT ) + { + time_loop = 0; + time( ¤t_time ); + } + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + + + + + +/****************************************************************************/ +#pragma warning( disable : 4100 ) + +static void queue_element_cleanup_callback( struct lfds700_queue_state *qs, struct lfds700_queue_element *qe, enum lfds700_misc_flag dummy_element_flag ) +{ + assert( qs != NULL ); + assert( qe != NULL ); + // TRD : dummy_element_flag can be any value in its range + + util_aligned_free( qe ); + + return; +} + +#pragma warning( default : 4100 ) + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_rapid_enqueuing_and_dequeuing.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_rapid_enqueuing_and_dequeuing.c new file mode 100644 index 0000000000000000000000000000000000000000..ec3963a336b7d94c8b60e928e34f827628a1ea12 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_queue_rapid_enqueuing_and_dequeuing.c @@ -0,0 +1,264 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_state +{ + lfds700_pal_uint_t + counter, + thread_number; + + struct lfds700_queue_state + *qs; +}; + +struct test_element +{ + struct lfds700_queue_element + qe, + *qe_use; + + lfds700_pal_uint_t + counter, + thread_number; +}; + +/***** private prototypes *****/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_rapid_enqueuer_and_dequeuer( void *util_thread_starter_thread_state ); + + + + + +/****************************************************************************/ +void test_lfds700_queue_rapid_enqueuing_and_dequeuing( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + lfds700_pal_uint_t + loop, + number_elements_with_dummy_element, + number_elements_without_dummy_element, + number_logical_processors, + *per_thread_counters; + + struct lfds700_list_asu_element + *lasue; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_queue_element + *qe; + + struct lfds700_misc_validation_info + vi; + + struct lfds700_queue_state + qs; + + struct test_pal_logical_processor + *lp; + + struct util_thread_starter_state + *tts; + + struct test_element + *te_array, + *te; + + struct test_state + *ts; + + test_pal_thread_state_t + *thread_handles; + + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + /* TRD : we create a single queue with 50,000 elements + we don't want too many elements, so we ensure plenty of element re-use + each thread simply loops dequeuing and enqueuing + where the user data indicates thread number and an increment counter + vertification is that the counter increments on a per-thread basis + */ + + internal_display_test_name( "Rapid enqueuing and dequeuing (%d seconds)", TEST_DURATION_IN_SECONDS ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + lfds700_misc_prng_init( &ps ); + + number_elements_with_dummy_element = ( memory_in_megabytes * ONE_MEGABYTE_IN_BYTES ) / sizeof(struct test_element); + + if( number_elements_with_dummy_element > (10000 * number_logical_processors) + 1 ) + number_elements_with_dummy_element = (10000 * number_logical_processors) + 1; + + number_elements_without_dummy_element = number_elements_with_dummy_element - 1; + + vi.min_elements = number_elements_without_dummy_element; + vi.max_elements = number_elements_without_dummy_element; + + te_array = util_aligned_malloc( sizeof(struct test_element) * number_elements_with_dummy_element, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + lfds700_queue_init_valid_on_current_logical_core( &qs, &(te_array+number_elements_without_dummy_element)->qe, &ps, NULL ); + + // TRD : we assume the test will iterate at least once (or we'll have a false negative) + for( loop = 0 ; loop < number_elements_without_dummy_element ; loop++ ) + { + (te_array+loop)->thread_number = loop; + (te_array+loop)->counter = 0; + LFDS700_QUEUE_SET_VALUE_IN_ELEMENT( (te_array+loop)->qe, te_array+loop ); + lfds700_queue_enqueue( &qs, &(te_array+loop)->qe, &ps ); + } + + ts = util_malloc_wrapper( sizeof(struct test_state) * number_logical_processors ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + { + (ts+loop)->qs = &qs; + (ts+loop)->thread_number = loop; + (ts+loop)->counter = 0; + } + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors ); + + util_thread_starter_new( &tts, number_logical_processors ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + lasue = NULL; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, thread_rapid_enqueuer_and_dequeuer, ts+loop ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + free( thread_handles ); + + LFDS700_MISC_BARRIER_LOAD; + + lfds700_queue_query( &qs, LFDS700_QUEUE_QUERY_SINGLETHREADED_VALIDATE, &vi, &dvs ); + + // TRD : now check results + per_thread_counters = util_malloc_wrapper( sizeof(lfds700_pal_uint_t) * number_logical_processors ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + *(per_thread_counters+loop) = 0; + + while( dvs == LFDS700_MISC_VALIDITY_VALID and lfds700_queue_dequeue(&qs, &qe, &ps) ) + { + te = LFDS700_QUEUE_GET_VALUE_FROM_ELEMENT( *qe ); + + if( te->thread_number >= number_logical_processors ) + { + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + break; + } + + if( per_thread_counters[te->thread_number] == 0 ) + per_thread_counters[te->thread_number] = te->counter; + + if( te->counter > per_thread_counters[te->thread_number] ) + dvs = LFDS700_MISC_VALIDITY_INVALID_MISSING_ELEMENTS; + + if( te->counter < per_thread_counters[te->thread_number] ) + dvs = LFDS700_MISC_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; + + if( te->counter == per_thread_counters[te->thread_number] ) + per_thread_counters[te->thread_number]++; + } + + free( per_thread_counters ); + + lfds700_queue_cleanup( &qs, NULL ); + + util_aligned_free( te_array ); + + free( ts ); + + internal_display_test_result( 1, "queue", dvs ); + + return; +} + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_rapid_enqueuer_and_dequeuer( void *util_thread_starter_thread_state ) +{ + lfds700_pal_uint_t + time_loop = 0; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_queue_element + *qe; + + struct test_element + *te; + + struct test_state + *ts; + + struct util_thread_starter_thread_state + *tsts; + + time_t + current_time, + start_time; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + lfds700_misc_prng_init( &ps ); + + util_thread_starter_ready_and_wait( tsts ); + + current_time = start_time = time( NULL ); + + while( current_time < start_time + TEST_DURATION_IN_SECONDS ) + { + lfds700_queue_dequeue( ts->qs, &qe, &ps ); + te = LFDS700_QUEUE_GET_VALUE_FROM_ELEMENT( *qe ); + + te->thread_number = ts->thread_number; + te->counter = ts->counter++; + + LFDS700_QUEUE_SET_VALUE_IN_ELEMENT( *qe, te ); + lfds700_queue_enqueue( ts->qs, qe, &ps ); + + if( time_loop++ == TIME_LOOP_COUNT ) + { + time_loop = 0; + time( ¤t_time ); + } + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_ringbuffer.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_ringbuffer.c new file mode 100644 index 0000000000000000000000000000000000000000..0a7de0761be4662d46145a85442350b325cdd95b --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_ringbuffer.c @@ -0,0 +1,31 @@ +/***** includes *****/ +#include "internal.h" + + + + + +/****************************************************************************/ +#pragma warning( disable : 4127 ) // TRD : disables MSVC warning for condition expressions being const + +void test_lfds700_ringbuffer( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + if( LFDS700_MISC_ATOMIC_SUPPORT_DWCAS ) + { + printf( "\n" + "Ringbuffer Tests\n" + "================\n" ); + + test_lfds700_ringbuffer_reading( list_of_logical_processors, memory_in_megabytes ); + test_lfds700_ringbuffer_reading_and_writing( list_of_logical_processors, memory_in_megabytes ); + test_lfds700_ringbuffer_writing( list_of_logical_processors, memory_in_megabytes ); + } + + return; +} + +#pragma warning( default : 4127 ) + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_ringbuffer_reading.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_ringbuffer_reading.c new file mode 100644 index 0000000000000000000000000000000000000000..00d378992e1aa3fd8fdfd5e0c3a1050a52be8c41 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_ringbuffer_reading.c @@ -0,0 +1,217 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_state +{ + enum flag + error_flag; + + lfds700_pal_uint_t + read_count; + + struct lfds700_ringbuffer_state + *rs; +}; + +/***** private prototypes *****/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_simple_reader( void *util_thread_starter_thread_state ); + + + + + +/****************************************************************************/ +void test_lfds700_ringbuffer_reading( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + enum lfds700_misc_validity + dvs[2] = { LFDS700_MISC_VALIDITY_VALID, LFDS700_MISC_VALIDITY_VALID }; + + lfds700_pal_uint_t + loop, + number_elements_with_dummy_element, + number_elements_without_dummy_element, + number_logical_processors, + total_read = 0; + + struct lfds700_list_asu_element + *lasue; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_ringbuffer_element + *re_array; + + struct lfds700_ringbuffer_state + rs; + + struct lfds700_misc_validation_info + vi; + + struct test_pal_logical_processor + *lp; + + struct util_thread_starter_state + *tts; + + struct test_state + *ts; + + test_pal_thread_state_t + *thread_handles; + + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + /* TRD : we create a single ringbuffer + with 1,000,000 elements + we populate the ringbuffer, where the + user data is an incrementing counter + + we create one thread per CPU + where each thread busy-works, + reading until the ringbuffer is empty + + each thread keep track of the number of reads it manages + and that each user data it reads is greater than the + previous user data that was read + */ + + internal_display_test_name( "Reading" ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + lfds700_misc_prng_init( &ps ); + + number_elements_with_dummy_element = ( memory_in_megabytes * ONE_MEGABYTE_IN_BYTES ) / sizeof(struct lfds700_ringbuffer_element); + number_elements_without_dummy_element = number_elements_with_dummy_element - 1; + + vi.min_elements = 0; + vi.max_elements = number_elements_without_dummy_element; + + re_array = util_aligned_malloc( sizeof(struct lfds700_ringbuffer_element) * number_elements_with_dummy_element, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + lfds700_ringbuffer_init_valid_on_current_logical_core( &rs, re_array, number_elements_with_dummy_element, &ps, NULL ); + + // TRD : init the ringbuffer contents for the test + for( loop = 0 ; loop < number_elements_without_dummy_element ; loop++ ) + lfds700_ringbuffer_write( &rs, NULL, (void *) (size_t) loop, NULL, NULL, NULL, &ps ); + + ts = util_malloc_wrapper( sizeof(struct test_state) * number_logical_processors ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + { + (ts+loop)->rs = &rs; + (ts+loop)->read_count = 0; + (ts+loop)->error_flag = LOWERED; + } + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors ); + + util_thread_starter_new( &tts, number_logical_processors ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + lasue = NULL; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, thread_simple_reader, ts+loop ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + free( thread_handles ); + + LFDS700_MISC_BARRIER_LOAD; + + lfds700_ringbuffer_query( &rs, LFDS700_RINGBUFFER_QUERY_SINGLETHREADED_VALIDATE, (void *) &vi, (void *) dvs ); + + // TRD : check for raised error flags + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + if( (ts+loop)->error_flag == RAISED ) + dvs[0] = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + // TRD : check thread reads total to 1,000,000 + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + total_read += (ts+loop)->read_count; + + if( total_read < number_elements_without_dummy_element ) + dvs[0] = LFDS700_MISC_VALIDITY_INVALID_MISSING_ELEMENTS; + + if( total_read > number_elements_without_dummy_element ) + dvs[0] = LFDS700_MISC_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; + + free( ts ); + + lfds700_ringbuffer_cleanup( &rs, NULL ); + + util_aligned_free( re_array ); + + internal_display_test_result( 2, "queue", dvs[0], "freelist", dvs[1] ); + + return; +} + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_simple_reader( void *util_thread_starter_thread_state ) +{ + lfds700_pal_uint_t + *prev_value, + *value; + + struct lfds700_misc_prng_state + ps; + + struct test_state + *ts; + + struct util_thread_starter_thread_state + *tsts; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + lfds700_misc_prng_init( &ps ); + + lfds700_ringbuffer_read( ts->rs, NULL, (void **) &prev_value, &ps ); + ts->read_count++; + + util_thread_starter_ready_and_wait( tsts ); + + while( lfds700_ringbuffer_read(ts->rs, NULL, (void **) &value, &ps) ) + { + if( value <= prev_value ) + ts->error_flag = RAISED; + + prev_value = value; + + ts->read_count++; + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_ringbuffer_reading_and_writing.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_ringbuffer_reading_and_writing.c new file mode 100644 index 0000000000000000000000000000000000000000..152c3318923c40b47a2d9699c7e6f10478d357b7 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_ringbuffer_reading_and_writing.c @@ -0,0 +1,261 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_state +{ + enum flag + error_flag; + + lfds700_pal_uint_t + counter, + number_logical_processors, + *per_thread_counters, + thread_number; + + struct lfds700_ringbuffer_state + *rs; +}; + +struct test_element +{ + lfds700_pal_uint_t + datum, + thread_number; +}; + +/***** private prototypes *****/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_reader_writer( void *util_thread_starter_thread_state ); + + + + + +/****************************************************************************/ +void test_lfds700_ringbuffer_reading_and_writing( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + enum lfds700_misc_validity + dvs[2] = { LFDS700_MISC_VALIDITY_VALID, LFDS700_MISC_VALIDITY_VALID }; + + lfds700_pal_uint_t + loop, + number_elements_with_dummy_element, + number_elements_without_dummy_element, + number_logical_processors, + subloop; + + test_pal_thread_state_t + *thread_handles; + + struct lfds700_list_asu_element + *lasue; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_ringbuffer_element + *re_array; + + struct lfds700_ringbuffer_state + rs; + + struct lfds700_misc_validation_info + vi; + + struct test_pal_logical_processor + *lp; + + struct util_thread_starter_state + *tts; + + struct test_element + *te_array; + + struct test_state + *ts; + + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + /* TRD : we create a single ringbuffer + with 100,000 elements + the ringbuffers starts empty + + we create one thread per CPU + where each thread busy-works writing + and then immediately reading + for ten seconds + + the user data in each written element is a combination + of the thread number and the counter + + while a thread runs, it keeps track of the + counters for the other threads and throws an error + if it sees the number stay the same or decrease + */ + + internal_display_test_name( "Reading and writing (%d seconds)", TEST_DURATION_IN_SECONDS ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + lfds700_misc_prng_init( &ps ); + + number_elements_with_dummy_element = ( memory_in_megabytes * ONE_MEGABYTE_IN_BYTES ) / ( sizeof(struct test_element) + sizeof(struct lfds700_ringbuffer_element) ); + number_elements_without_dummy_element = number_elements_with_dummy_element - 1; + + vi.min_elements = 0; + vi.max_elements = number_elements_without_dummy_element; + + re_array = util_aligned_malloc( sizeof(struct lfds700_ringbuffer_element) * number_elements_with_dummy_element, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + lfds700_ringbuffer_init_valid_on_current_logical_core( &rs, re_array, number_elements_with_dummy_element, &ps, NULL ); + + te_array = util_malloc_wrapper( sizeof(struct test_element) * number_elements_without_dummy_element ); + + // TRD : populate the ringbuffer + for( loop = 0 ; loop < number_elements_without_dummy_element ; loop++ ) + { + te_array[loop].thread_number = 0; + te_array[loop].datum = (lfds700_pal_uint_t) -1 ; + lfds700_ringbuffer_write( &rs, NULL, &te_array[loop], NULL, NULL, NULL, &ps ); + } + + ts = util_malloc_wrapper( sizeof(struct test_state) * number_logical_processors ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + { + (ts+loop)->rs = &rs; + (ts+loop)->thread_number = loop; + (ts+loop)->counter = 0; + (ts+loop)->number_logical_processors = number_logical_processors; + (ts+loop)->error_flag = LOWERED; + (ts+loop)->per_thread_counters = util_malloc_wrapper( sizeof(lfds700_pal_uint_t) * number_logical_processors ); + + for( subloop = 0 ; subloop < number_logical_processors ; subloop++ ) + *((ts+loop)->per_thread_counters+subloop) = 0; + } + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors ); + + util_thread_starter_new( &tts, number_logical_processors ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + lasue = NULL; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, thread_reader_writer, ts+loop ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + free( thread_handles ); + + LFDS700_MISC_BARRIER_LOAD; + + lfds700_ringbuffer_query( &rs, LFDS700_RINGBUFFER_QUERY_SINGLETHREADED_VALIDATE, (void *) &vi, (void *) dvs ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + if( (ts+loop)->error_flag == RAISED ) + dvs[0] = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + free( (ts+loop)->per_thread_counters ); + + free( ts ); + + lfds700_ringbuffer_cleanup( &rs, NULL ); + + util_aligned_free( re_array ); + + free( te_array ); + + internal_display_test_result( 2, "queue", dvs[0], "freelist", dvs[1] ); + + return; +} + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_reader_writer( void *util_thread_starter_thread_state ) +{ + lfds700_pal_uint_t + time_loop = 0; + + struct lfds700_misc_prng_state + ps; + + struct test_element + *te; + + struct test_state + *ts; + + struct util_thread_starter_thread_state + *tsts; + + time_t + current_time, + start_time; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + lfds700_misc_prng_init( &ps ); + + util_thread_starter_ready_and_wait( tsts ); + + current_time = start_time = time( NULL ); + + while( current_time < start_time + TEST_DURATION_IN_SECONDS ) + { + lfds700_ringbuffer_read( ts->rs, NULL, (void **) &te, &ps ); + + if( te->thread_number >= ts->number_logical_processors ) + ts->error_flag = RAISED; + else + { + if( te->datum < ts->per_thread_counters[te->thread_number] ) + ts->error_flag = RAISED; + + if( te->datum >= ts->per_thread_counters[te->thread_number] ) + ts->per_thread_counters[te->thread_number] = te->datum+1; + } + + te->thread_number = ts->thread_number; + te->datum = ts->counter++; + + lfds700_ringbuffer_write( ts->rs, NULL, te, NULL, NULL, NULL, &ps ); + + if( time_loop++ == TIME_LOOP_COUNT ) + { + time_loop = 0; + time( ¤t_time ); + } + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_ringbuffer_writing.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_ringbuffer_writing.c new file mode 100644 index 0000000000000000000000000000000000000000..702aabc58d4209718f75152c00fa54653fe5befd --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_ringbuffer_writing.c @@ -0,0 +1,272 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_element +{ + lfds700_pal_uint_t + thread_number, + datum; +}; + +struct test_state +{ + lfds700_pal_uint_t + thread_number, + write_count; + + struct test_element + te; + + struct lfds700_ringbuffer_state + *rs; +}; + +/***** private prototypes *****/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_simple_writer( void *util_thread_starter_thread_state ); + + + + + +/****************************************************************************/ +void test_lfds700_ringbuffer_writing( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + enum lfds700_misc_validity + dvs[2] = { LFDS700_MISC_VALIDITY_VALID, LFDS700_MISC_VALIDITY_VALID }; + + lfds700_pal_uint_t + loop, + number_elements_with_dummy_element, + number_elements_without_dummy_element, + number_logical_processors, + *per_thread_counters; + + test_pal_thread_state_t + *thread_handles; + + struct lfds700_list_asu_element + *lasue; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_ringbuffer_element + *re_array; + + struct lfds700_ringbuffer_state + rs; + + struct lfds700_misc_validation_info + vi; + + struct test_pal_logical_processor + *lp; + + struct util_thread_starter_state + *tts; + + struct test_element + *te, + *te_array; + + struct test_state + *ts; + + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + /* TRD : we create a single ringbuffer + with n elements + we create n test elements + which are thread_number/counter pairs + init them to safe values + and fully populate the ringbuffer + + we create one thread per CPU + where each thread busy-works writing + for ten seconds; each thread has one extra element + which it uses for the first write and after that + it uses the element it picks up from overwriting + + the user data in each written element is a combination + of the thread number and the counter + + after the threads are complete, we validate by + checking the user data counters increment on a per thread + basis + */ + + internal_display_test_name( "Writing (%d seconds)", TEST_DURATION_IN_SECONDS ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + lfds700_misc_prng_init( &ps ); + + number_elements_with_dummy_element = ( memory_in_megabytes * ONE_MEGABYTE_IN_BYTES ) / ( sizeof(struct test_element) + sizeof(struct lfds700_ringbuffer_element) ); + number_elements_without_dummy_element = number_elements_with_dummy_element - 1; + + vi.min_elements = number_elements_without_dummy_element; + vi.max_elements = number_elements_without_dummy_element; + + re_array = util_aligned_malloc( sizeof(struct lfds700_ringbuffer_element) * number_elements_with_dummy_element, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + lfds700_ringbuffer_init_valid_on_current_logical_core( &rs, re_array, number_elements_with_dummy_element, &ps, NULL ); + + te_array = util_malloc_wrapper( sizeof(struct lfds700_ringbuffer_element) * number_elements_without_dummy_element ); + + // TRD : init the test elements and write them into the ringbuffer + for( loop = 0 ; loop < number_elements_without_dummy_element ; loop++ ) + { + te_array[loop].thread_number = 0; + te_array[loop].datum = 0; + lfds700_ringbuffer_write( &rs, NULL, &te_array[loop], NULL, NULL, NULL, &ps ); + } + + ts = util_malloc_wrapper( sizeof(struct test_state) * number_logical_processors ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + { + (ts+loop)->rs = &rs; + (ts+loop)->thread_number = loop; + (ts+loop)->write_count = 0; + } + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors ); + + util_thread_starter_new( &tts, number_logical_processors ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + lasue = NULL; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, thread_simple_writer, ts+loop ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + free( thread_handles ); + + LFDS700_MISC_BARRIER_LOAD; + + // TRD : now check results + per_thread_counters = util_malloc_wrapper( sizeof(lfds700_pal_uint_t) * number_logical_processors ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + *(per_thread_counters+loop) = 0; + + lfds700_ringbuffer_query( &rs, LFDS700_RINGBUFFER_QUERY_SINGLETHREADED_VALIDATE, &vi, dvs ); + + while( dvs[0] == LFDS700_MISC_VALIDITY_VALID and dvs[1] == LFDS700_MISC_VALIDITY_VALID and lfds700_ringbuffer_read(&rs, NULL, (void **) &te, &ps) ) + { + if( te->thread_number >= number_logical_processors ) + { + dvs[0] = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + break; + } + + if( per_thread_counters[te->thread_number] == 0 ) + per_thread_counters[te->thread_number] = te->datum; + + if( te->datum < per_thread_counters[te->thread_number] ) + dvs[0] = LFDS700_MISC_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; + + if( te->datum >= per_thread_counters[te->thread_number] ) + per_thread_counters[te->thread_number] = te->datum+1; + } + + free( per_thread_counters ); + + lfds700_ringbuffer_cleanup( &rs, NULL ); + + free( ts ); + + util_aligned_free( re_array ); + + free( te_array ); + + internal_display_test_result( 2, "queue", dvs[0], "freelist", dvs[1] ); + + return; +} + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_simple_writer( void *util_thread_starter_thread_state ) +{ + enum lfds700_misc_flag + overwrite_occurred_flag; + + lfds700_pal_uint_t + time_loop = 0; + + struct lfds700_misc_prng_state + ps; + + struct test_element + *te; + + struct test_state + *ts; + + struct util_thread_starter_thread_state + *tsts; + + time_t + current_time, + start_time; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + lfds700_misc_prng_init( &ps ); + + ts->te.thread_number = 0; + ts->te.datum = 0; + + lfds700_ringbuffer_write( ts->rs, NULL, &ts->te, &overwrite_occurred_flag, NULL, (void **) &te, &ps ); + + util_thread_starter_ready_and_wait( tsts ); + + current_time = start_time = time( NULL ); + + while( current_time < start_time + TEST_DURATION_IN_SECONDS ) + { + te->thread_number = ts->thread_number; + te->datum = ts->write_count++; + + lfds700_ringbuffer_write( ts->rs, NULL, te, &overwrite_occurred_flag, NULL, (void **) &te, &ps ); + + if( time_loop++ == TIME_LOOP_COUNT ) + { + time_loop = 0; + time( ¤t_time ); + } + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_stack.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_stack.c new file mode 100644 index 0000000000000000000000000000000000000000..af3a37512a09b49ed37384bc2d59e9bb6aa04063 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_stack.c @@ -0,0 +1,33 @@ +/***** includes *****/ +#include "internal.h" + + + + + +/****************************************************************************/ +#pragma warning( disable : 4127 ) // TRD : disables MSVC warning for condition expressions being const + +void test_lfds700_stack( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + if( LFDS700_MISC_ATOMIC_SUPPORT_DWCAS ) + { + printf( "\n" + "Stack Tests\n" + "===========\n" ); + + test_lfds700_stack_alignment(); + test_lfds700_stack_popping( list_of_logical_processors, memory_in_megabytes ); + test_lfds700_stack_pushing( list_of_logical_processors, memory_in_megabytes ); + test_lfds700_stack_popping_and_pushing( list_of_logical_processors, memory_in_megabytes ); + test_lfds700_stack_rapid_popping_and_pushing( list_of_logical_processors ); + } + + return; +} + +#pragma warning( default : 4127 ) + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_stack_alignment.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_stack_alignment.c new file mode 100644 index 0000000000000000000000000000000000000000..7add41bd480b7e95979228dcc4455ff9831f7ce6 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_stack_alignment.c @@ -0,0 +1,43 @@ +/***** includes *****/ +#include "internal.h" + + + + + +/****************************************************************************/ +#pragma warning( disable : 4127 ) // TRD : disables MSVC warning for condition expressions being const + +void test_lfds700_stack_alignment() +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + /* TRD : these are compile time checks + but we do them here because this is a test programme + and it should indicate issues to users when it is *run*, + not when it is compiled, because a compile error normally + indicates a problem with the code itself and so is misleading + */ + + internal_display_test_name( "Alignment" ); + + + + // TRD : struct lfds700_stack_state + if( offsetof(struct lfds700_stack_state,top) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + if( offsetof(struct lfds700_stack_state,user_state) % LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + + + // TRD : print the test result + internal_display_test_result( 1, "stack", dvs ); + + return; +} + +#pragma warning( default : 4127 ) + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_stack_popping.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_stack_popping.c new file mode 100644 index 0000000000000000000000000000000000000000..461730604c5dbe7726667087183943aadf05394b --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_stack_popping.c @@ -0,0 +1,202 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_state +{ + struct lfds700_stack_state + *ss; +}; + +struct test_element +{ + struct lfds700_stack_element + se; + + enum flag + popped_flag; +}; + +/***** private prototypes *****/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_popping( void *util_thread_starter_thread_state ); + + + + + +/****************************************************************************/ +void test_lfds700_stack_popping( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + lfds700_pal_uint_t + loop, + number_elements, + number_logical_processors; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_list_asu_element + *lasue; + + struct lfds700_stack_state + ss; + + struct lfds700_misc_validation_info + vi = { 0, 0 }; + + struct test_pal_logical_processor + *lp; + + struct util_thread_starter_state + *tts; + + struct test_element + *te_array; + + struct test_state + *ts; + + test_pal_thread_state_t + *thread_handles; + + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + /* TRD : we create a stack + + we then populate the stack with 1,000,000 elements + each void pointer of data points to the containing test element + + we then run one thread per CPU + where each thread loops, popping as quickly as possible + upon popping, a flag is set in the containing test element + + the threads run till the source stack is empty + + we then check the poppged flag, all should be raised + + then tidy up + + no CAS+GC code, as we only pop + */ + + internal_display_test_name( "Popping" ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + lfds700_misc_prng_init( &ps ); + + lfds700_stack_init_valid_on_current_logical_core( &ss, NULL ); + + number_elements = ( memory_in_megabytes * ONE_MEGABYTE_IN_BYTES ) / sizeof(struct test_element) ; + + te_array = util_aligned_malloc( sizeof(struct test_element) * number_elements, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + for( loop = 0 ; loop < number_elements ; loop++ ) + { + (te_array+loop)->popped_flag = LOWERED; + LFDS700_STACK_SET_VALUE_IN_ELEMENT( (te_array+loop)->se, te_array+loop ); + lfds700_stack_push( &ss, &(te_array+loop)->se, &ps ); + } + + ts = util_aligned_malloc( sizeof(struct test_state) * number_logical_processors, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + (ts+loop)->ss = &ss; + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors ); + + util_thread_starter_new( &tts, number_logical_processors ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + lasue = NULL; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, thread_popping, ts+loop ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + free( thread_handles ); + + LFDS700_MISC_BARRIER_LOAD; + + lfds700_stack_query( &ss, LFDS700_STACK_QUERY_SINGLETHREADED_VALIDATE, &vi, (void *) &dvs ); + + // TRD : now we check each element has popped_flag set to RAISED + for( loop = 0 ; loop < number_elements ; loop++ ) + if( (te_array+loop)->popped_flag == LOWERED ) + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + + // TRD : cleanup + lfds700_stack_cleanup( &ss, NULL ); + util_aligned_free( te_array ); + util_aligned_free( ts ); + + // TRD : print the test result + internal_display_test_result( 1, "stack", dvs ); + + return; +} + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_popping( void *util_thread_starter_thread_state ) +{ + struct lfds700_misc_prng_state + ps; + + struct lfds700_stack_element + *se; + + struct test_element + *te; + + struct test_state + *ts; + + struct util_thread_starter_thread_state + *tsts; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + lfds700_misc_prng_init( &ps ); + + util_thread_starter_ready_and_wait( tsts ); + + while( lfds700_stack_pop(ts->ss, &se, &ps) ) + { + te = LFDS700_STACK_GET_VALUE_FROM_ELEMENT( *se ); + te->popped_flag = RAISED; + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_stack_popping_and_pushing.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_stack_popping_and_pushing.c new file mode 100644 index 0000000000000000000000000000000000000000..03c3254c77181014199e22a6ee3bde2623ecc368 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_stack_popping_and_pushing.c @@ -0,0 +1,316 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_element; + +struct test_state +{ + lfds700_pal_uint_t + number_elements; + + struct lfds700_stack_state + *ss, + ss_thread_local; + + struct test_element + *ss_thread_local_te_array; +}; + +struct test_element +{ + struct lfds700_stack_element + se, + thread_local_se; + + lfds700_pal_uint_t + datum; +}; + +/***** private prototypes *****/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_popping_and_pushing_start_popping( void *util_thread_starter_thread_state ); +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_popping_and_pushing_start_pushing( void *util_thread_starter_thread_state ); + + + + + +/****************************************************************************/ +void test_lfds700_stack_popping_and_pushing( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + lfds700_pal_uint_t + loop, + number_elements, + number_logical_processors, + subloop; + + struct lfds700_list_asu_element + *lasue; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_stack_state + ss; + + struct lfds700_misc_validation_info + vi; + + struct test_pal_logical_processor + *lp; + + struct util_thread_starter_state + *tts; + + struct test_element + *te_array; + + struct test_state + *ts; + + test_pal_thread_state_t + *thread_handles; + + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + /* TRD : we have two threads per CPU + the threads loop for ten seconds + the first thread pushes 10000 elements then pops 10000 elements + the second thread pops 10000 elements then pushes 10000 elements + all pushes and pops go onto the single main stack + + after time is up, all threads push what they have remaining onto + the main stack + + we then validate the main stack + */ + + internal_display_test_name( "Popping and pushing (%d seconds)", TEST_DURATION_IN_SECONDS ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + lfds700_misc_prng_init( &ps ); + + number_elements = ( memory_in_megabytes * ONE_MEGABYTE_IN_BYTES ) / ( sizeof(struct test_element) * number_logical_processors * 2 ); + + lfds700_stack_init_valid_on_current_logical_core( &ss, NULL ); + + te_array = util_aligned_malloc( sizeof(struct test_element) * number_elements * number_logical_processors, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + // TRD : some initial elements so the pushing threads can start immediately + for( loop = 0 ; loop < number_elements * number_logical_processors ; loop++ ) + { + (te_array+loop)->datum = loop; + LFDS700_STACK_SET_VALUE_IN_ELEMENT( (te_array+loop)->se, te_array+loop ); + lfds700_stack_push( &ss, &(te_array+loop)->se, &ps ); + } + + ts = util_aligned_malloc( sizeof(struct test_state) * number_logical_processors * 2, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + { + // TRD : first set of threads + (ts+loop)->ss = &ss; + (ts+loop)->number_elements = number_elements; + lfds700_stack_init_valid_on_current_logical_core( &(ts+loop)->ss_thread_local, NULL ); + + // TRD : second set of threads + (ts+loop+number_logical_processors)->ss = &ss; + (ts+loop+number_logical_processors)->number_elements = number_elements; + lfds700_stack_init_valid_on_current_logical_core( &(ts+loop+number_logical_processors)->ss_thread_local, NULL ); + + // TRD : fill the pushing thread stacks + (ts+loop+number_logical_processors)->ss_thread_local_te_array = util_aligned_malloc( sizeof(struct test_element) * number_elements, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + for( subloop = 0 ; subloop < number_elements ; subloop++ ) + { + ((ts+loop+number_logical_processors)->ss_thread_local_te_array+subloop)->datum = loop; + LFDS700_STACK_SET_VALUE_IN_ELEMENT( ((ts+loop+number_logical_processors)->ss_thread_local_te_array+subloop)->thread_local_se, (ts+loop+number_logical_processors)->ss_thread_local_te_array+subloop ); + lfds700_stack_push( &(ts+loop+number_logical_processors)->ss_thread_local, &((ts+loop+number_logical_processors)->ss_thread_local_te_array+subloop)->thread_local_se, &ps ); + } + } + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors * 2 ); + + util_thread_starter_new( &tts, number_logical_processors * 2 ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + lasue = NULL; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, thread_popping_and_pushing_start_popping, ts+loop ); + util_thread_starter_start( tts, &thread_handles[loop+number_logical_processors], loop+number_logical_processors, lp, thread_popping_and_pushing_start_pushing, ts+loop+number_logical_processors ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors * 2 ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + free( thread_handles ); + + LFDS700_MISC_BARRIER_LOAD; + + vi.min_elements = vi.max_elements = number_elements * number_logical_processors * 2; + + lfds700_stack_query( &ss, LFDS700_STACK_QUERY_SINGLETHREADED_VALIDATE, &vi, &dvs ); + + lfds700_stack_cleanup( &ss, NULL ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + { + lfds700_stack_cleanup( &(ts+loop)->ss_thread_local, NULL ); + lfds700_stack_cleanup( &(ts+loop+number_logical_processors)->ss_thread_local, NULL ); + util_aligned_free( (ts+loop+number_logical_processors)->ss_thread_local_te_array ); + } + + util_aligned_free( ts ); + + util_aligned_free( te_array ); + + // TRD : print the test result + internal_display_test_result( 1, "stack", dvs ); + + return; +} + + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_popping_and_pushing_start_popping( void *util_thread_starter_thread_state ) +{ + lfds700_pal_uint_t + count; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_stack_element + *se; + + struct test_state + *ts; + + struct util_thread_starter_thread_state + *tsts; + + time_t + start_time; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + lfds700_misc_prng_init( &ps ); + + util_thread_starter_ready_and_wait( tsts ); + + start_time = time( NULL ); + + while( time(NULL) < start_time + TEST_DURATION_IN_SECONDS ) + { + count = 0; + + while( count < ts->number_elements ) + if( lfds700_stack_pop(ts->ss, &se, &ps) ) + { + lfds700_stack_push( &ts->ss_thread_local, se, &ps ); + count++; + } + + // TRD : return our local stack to the main stack + while( lfds700_stack_pop(&ts->ss_thread_local, &se, &ps) ) + lfds700_stack_push( ts->ss, se, &ps ); + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_popping_and_pushing_start_pushing( void *util_thread_starter_thread_state ) +{ + lfds700_pal_uint_t + count; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_stack_element + *se; + + struct test_state + *ts; + + struct util_thread_starter_thread_state + *tsts; + + time_t + start_time; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + lfds700_misc_prng_init( &ps ); + + util_thread_starter_ready_and_wait( tsts ); + + start_time = time( NULL ); + + while( time(NULL) < start_time + TEST_DURATION_IN_SECONDS ) + { + // TRD : return our local stack to the main stack + while( lfds700_stack_pop(&ts->ss_thread_local, &se, &ps) ) + lfds700_stack_push( ts->ss, se, &ps ); + + count = 0; + + while( count < ts->number_elements ) + if( lfds700_stack_pop(ts->ss, &se, &ps) ) + { + lfds700_stack_push( &ts->ss_thread_local, se, &ps ); + count++; + } + } + + // TRD : now push whatever we have in our local stack + while( lfds700_stack_pop(&ts->ss_thread_local, &se, &ps) ) + lfds700_stack_push( ts->ss, se, &ps ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_stack_pushing.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_stack_pushing.c new file mode 100644 index 0000000000000000000000000000000000000000..bdf2b9b64020909f1aa63b1d1f51362346fb82b8 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_stack_pushing.c @@ -0,0 +1,251 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_state +{ + lfds700_pal_uint_t + number_elements, + thread_number; + + struct lfds700_stack_state + *ss; + + struct test_element + *te_array; +}; + +struct test_element +{ + struct lfds700_stack_element + se; + + lfds700_pal_uint_t + datum, + thread_number; +}; + +/***** private prototypes *****/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_pushing( void *util_thread_starter_thread_state ); + + + + + +/****************************************************************************/ +void test_lfds700_stack_pushing( struct lfds700_list_asu_state *list_of_logical_processors, lfds700_pal_uint_t memory_in_megabytes ) +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + lfds700_pal_uint_t + loop, + number_elements, + number_logical_processors, + *per_thread_counters; + + struct lfds700_list_asu_element + *lasue; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_stack_element + *se; + + struct lfds700_stack_state + ss; + + struct lfds700_misc_validation_info + vi; + + struct test_pal_logical_processor + *lp; + + struct util_thread_starter_state + *tts; + + struct test_element + *te, + *first_te = NULL; + + struct test_state + *ts; + + test_pal_thread_state_t + *thread_handles; + + assert( list_of_logical_processors != NULL ); + // TRD : memory_in_megabytes can be any value in its range + + /* TRD : we create an empty stack + + we then create one thread per CPU, where each thread + pushes 100,000 elements each as quickly as possible to the stack + (the threads themselves alloc these elements, to obtain NUMA closeness) + + the data pushed is a counter and a thread ID + + the threads exit when the stack is full + + we then validate the stack; + + checking that the counts increment on a per unique ID basis + and that the number of elements we pop equals 100,000 per thread + (since each element has an incrementing counter which is + unique on a per unique ID basis, we can know we didn't lose + any elements) + + there's no CAS+GC code, as we only push + */ + + internal_display_test_name( "Pushing" ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + lfds700_misc_prng_init( &ps ); + + number_elements = ( memory_in_megabytes * ONE_MEGABYTE_IN_BYTES ) / ( sizeof(struct test_element) * number_logical_processors ); + + ts = util_malloc_wrapper( sizeof(struct test_state) * number_logical_processors ); + + // TRD : the main stack + lfds700_stack_init_valid_on_current_logical_core( &ss, NULL ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + { + (ts+loop)->ss = &ss; + (ts+loop)->thread_number = loop; + (ts+loop)->number_elements = number_elements; + } + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors ); + + util_thread_starter_new( &tts, number_logical_processors ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + lasue = NULL; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, thread_pushing, ts+loop ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + free( thread_handles ); + + LFDS700_MISC_BARRIER_LOAD; + + // TRD : the stack is now fully pushed; time to verify + per_thread_counters = util_malloc_wrapper( sizeof(lfds700_pal_uint_t) * number_logical_processors ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + *(per_thread_counters+loop) = number_elements - 1; + + vi.min_elements = vi.max_elements = number_elements * number_logical_processors; + + lfds700_stack_query( &ss, LFDS700_STACK_QUERY_SINGLETHREADED_VALIDATE, &vi, &dvs ); + + while( dvs == LFDS700_MISC_VALIDITY_VALID and lfds700_stack_pop(&ss, &se, &ps) ) + { + te = LFDS700_STACK_GET_VALUE_FROM_ELEMENT( *se ); + + if( first_te == NULL ) + first_te = te; + + if( te->thread_number >= number_logical_processors ) + { + dvs = LFDS700_MISC_VALIDITY_INVALID_TEST_DATA; + break; + } + + if( te->datum > per_thread_counters[te->thread_number] ) + dvs = LFDS700_MISC_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; + + if( te->datum < per_thread_counters[te->thread_number] ) + dvs = LFDS700_MISC_VALIDITY_INVALID_MISSING_ELEMENTS; + + if( te->datum == per_thread_counters[te->thread_number] ) + per_thread_counters[te->thread_number]--; + } + + // TRD : clean up + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + util_aligned_free( (ts+loop)->te_array ); + + free( per_thread_counters ); + + free( ts ); + + lfds700_stack_cleanup( &ss, NULL ); + + // TRD : print the test result + internal_display_test_result( 1, "stack", dvs ); + + return; +} + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_pushing( void *util_thread_starter_thread_state ) +{ + lfds700_pal_uint_t + loop; + + struct lfds700_misc_prng_state + ps; + + struct test_state + *ts; + + struct util_thread_starter_thread_state + *tsts; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + lfds700_misc_prng_init( &ps ); + + // TRD : alloc local 100,000 elements + ts->te_array = util_aligned_malloc( sizeof(struct test_element) * ts->number_elements, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + for( loop = 0 ; loop < ts->number_elements ; loop++ ) + { + (ts->te_array+loop)->thread_number = ts->thread_number; + (ts->te_array+loop)->datum = loop; + } + + util_thread_starter_ready_and_wait( tsts ); + + for( loop = 0 ; loop < ts->number_elements ; loop++ ) + { + LFDS700_STACK_SET_VALUE_IN_ELEMENT( (ts->te_array+loop)->se, ts->te_array+loop ); + lfds700_stack_push( ts->ss, &(ts->te_array+loop)->se, &ps ); + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_stack_rapid_popping_and_pushing.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_stack_rapid_popping_and_pushing.c new file mode 100644 index 0000000000000000000000000000000000000000..d771457c86d58986f7c8ed377896125d059f4555 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_lfds700_stack_rapid_popping_and_pushing.c @@ -0,0 +1,217 @@ +/***** includes *****/ +#include "internal.h" + +/***** structs *****/ +struct test_state +{ + struct lfds700_stack_state + *ss; +}; + +struct test_element +{ + struct lfds700_stack_element + se; + + lfds700_pal_uint_t + datum; +}; + +/***** private prototypes *****/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_rapid_popping_and_pushing( void *util_thread_starter_thread_state ); + + + + + +/****************************************************************************/ +void test_lfds700_stack_rapid_popping_and_pushing( struct lfds700_list_asu_state *list_of_logical_processors ) +{ + enum lfds700_misc_validity + dvs = LFDS700_MISC_VALIDITY_VALID; + + lfds700_pal_uint_t + loop, + number_logical_processors; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_list_asu_element + *lasue; + + struct lfds700_stack_state + ss; + + struct lfds700_misc_validation_info + vi = { 0, 0 }; + + struct test_pal_logical_processor + *lp; + + struct util_thread_starter_state + *tts; + + struct test_element + *te_array; + + struct test_state + *ts; + + test_pal_thread_state_t + *thread_handles; + + assert( list_of_logical_processors != NULL ); + // TRD : st can be any value in its range + + /* TRD : in these tests there is a fundamental antagonism between + how much checking/memory clean up that we do and the + likelyhood of collisions between threads in their lock-free + operations + + the lock-free operations are very quick; if we do anything + much at all between operations, we greatly reduce the chance + of threads colliding + + so we have some tests which do enough checking/clean up that + they can tell the stack is valid and don't leak memory + and here, this test now is one of those which does minimal + checking - in fact, the nature of the test is that you can't + do any real checking - but goes very quickly + + what we do is create a small stack and then run one thread + per CPU, where each thread simply pushes and then immediately + pops + + the test runs for ten seconds + + after the test is done, the only check we do is to traverse + the stack, checking for loops and ensuring the number of + elements is correct + */ + + internal_display_test_name( "Rapid popping and pushing (%d seconds)", TEST_DURATION_IN_SECONDS ); + + lfds700_list_asu_query( list_of_logical_processors, LFDS700_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void **) &number_logical_processors ); + + lfds700_misc_prng_init( &ps ); + + ts = util_malloc_wrapper( sizeof(struct test_state) * number_logical_processors ); + + lfds700_stack_init_valid_on_current_logical_core( &ss, NULL ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + (ts+loop)->ss = &ss; + + thread_handles = util_malloc_wrapper( sizeof(test_pal_thread_state_t) * number_logical_processors ); + + // TRD : we need one element per thread + te_array = util_aligned_malloc( sizeof(struct test_element) * number_logical_processors, LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + { + LFDS700_STACK_SET_VALUE_IN_ELEMENT( (te_array+loop)->se, te_array+loop ); + lfds700_stack_push( &ss, &(te_array+loop)->se, &ps ); + } + + util_thread_starter_new( &tts, number_logical_processors ); + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + loop = 0; + lasue = NULL; + + while( LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*list_of_logical_processors, lasue) ) + { + lp = LFDS700_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue ); + util_thread_starter_start( tts, &thread_handles[loop], loop, lp, thread_rapid_popping_and_pushing, ts+loop ); + loop++; + } + + util_thread_starter_run( tts ); + + for( loop = 0 ; loop < number_logical_processors ; loop++ ) + test_pal_thread_wait( thread_handles[loop] ); + + util_thread_starter_delete( tts ); + + free( thread_handles ); + + LFDS700_MISC_BARRIER_LOAD; + + vi.min_elements = vi.max_elements = number_logical_processors; + + lfds700_stack_query( &ss, LFDS700_STACK_QUERY_SINGLETHREADED_VALIDATE, &vi, &dvs ); + + lfds700_stack_cleanup( &ss, NULL ); + + util_aligned_free( te_array ); + + free( ts ); + + // TRD : print the test result + internal_display_test_result( 1, "stack", dvs ); + + return; +} + + + + + +/****************************************************************************/ +static test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION thread_rapid_popping_and_pushing( void *util_thread_starter_thread_state ) +{ + lfds700_pal_uint_t + time_loop = 0; + + struct lfds700_misc_prng_state + ps; + + struct lfds700_stack_element + *se; + + struct test_state + *ts; + + struct util_thread_starter_thread_state + *tsts; + + time_t + current_time, + start_time; + + LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE; + + assert( util_thread_starter_thread_state != NULL ); + + tsts = (struct util_thread_starter_thread_state *) util_thread_starter_thread_state; + ts = (struct test_state *) tsts->thread_user_state; + + lfds700_misc_prng_init( &ps ); + + util_thread_starter_ready_and_wait( tsts ); + + current_time = start_time = time( NULL ); + + while( current_time < start_time + TEST_DURATION_IN_SECONDS ) + { + lfds700_stack_pop( ts->ss, &se, &ps ); + lfds700_stack_push( ts->ss, se, &ps ); + + if( time_loop++ == TIME_LOOP_COUNT ) + { + time_loop = 0; + time( ¤t_time ); + } + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return( (test_pal_thread_return_t) EXIT_SUCCESS ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_porting_abstraction_layer_get_logical_core_ids.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_porting_abstraction_layer_get_logical_core_ids.c new file mode 100644 index 0000000000000000000000000000000000000000..eb62c5b4ccc55fb66724f8bb2068e049330f2d59 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_porting_abstraction_layer_get_logical_core_ids.c @@ -0,0 +1,245 @@ +/***** includes *****/ +#include "internal.h" + + + + + +/****************************************************************************/ +#if( defined _WIN32 && !defined _KERNEL_MODE && NTDDI_VERSION >= NTDDI_WIN7 ) + + /* TRD : _WIN32 indicates 64-bit or 32-bit Windows + !_KERNEL_MODE indicates Windows user-mode + NTDDI_VERSION indicates Windows version + - GetLogicalProcessorInformationEx requires Windows 7 + */ + + #ifdef TEST_PAL_GET_LOGICAL_CORE_IDS + #error More than one porting abstraction layer matches current platform in test_porting_abstraction_layer_get_logical_core_ids.c + #endif + + #define TEST_PAL_GET_LOGICAL_CORE_IDS + + void test_pal_get_logical_core_ids( struct lfds700_list_asu_state *lasus ) + { + BOOL + rv; + + DWORD + loop, + number_slpie, + slpie_length = 0; + + lfds700_pal_uint_t + bitmask, + logical_processor_number, + windows_logical_processor_group_number; + + struct lfds700_misc_prng_state + ps; + + struct test_pal_logical_processor + *lp; + + SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX + *slpie = NULL; + + assert( lasus != NULL ); + + lfds700_misc_prng_init( &ps ); + + lfds700_list_asu_init_valid_on_current_logical_core( lasus, NULL, NULL ); + + rv = GetLogicalProcessorInformationEx( RelationGroup, slpie, &slpie_length ); + slpie = malloc( slpie_length ); + rv = GetLogicalProcessorInformationEx( RelationGroup, slpie, &slpie_length ); + number_slpie = slpie_length / sizeof(SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX); + + for( loop = 0 ; loop < number_slpie ; loop++ ) + if( (slpie+loop)->Relationship == RelationGroup ) + for( windows_logical_processor_group_number = 0 ; windows_logical_processor_group_number < (slpie+loop)->Group.ActiveGroupCount ; windows_logical_processor_group_number++ ) + for( logical_processor_number = 0 ; logical_processor_number < sizeof(KAFFINITY) * BITS_PER_BYTE ; logical_processor_number++ ) + { + bitmask = (lfds700_pal_uint_t) 1 << logical_processor_number; + + // TRD : if we've found a processor for this group, add it to the list + if( (slpie+loop)->Group.GroupInfo[windows_logical_processor_group_number].ActiveProcessorMask & bitmask ) + { + lp = util_aligned_malloc( sizeof(struct test_pal_logical_processor), LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + lp->logical_processor_number = logical_processor_number; + lp->windows_logical_processor_group_number = windows_logical_processor_group_number; + + LFDS700_LIST_ASU_SET_VALUE_IN_ELEMENT( lp->lasue, lp ); + lfds700_list_asu_insert_at_start( lasus, &lp->lasue, &ps ); + } + } + + free( slpie ); + + return; + } + +#endif + + + + + +/****************************************************************************/ +#if( defined _WIN32 && !defined _KERNEL_MODE && NTDDI_VERSION >= NTDDI_WINXP && NTDDI_VERSION < NTDDI_WIN7 ) + + /* TRD : _WIN32 indicates 64-bit or 32-bit Windows + !_KERNEL_MODE indicates Windows user-mode + NTDDI_VERSION indicates Windows version + - GetLogicalProcessorInformation requires XP SP3 + */ + + #ifdef TEST_PAL_GET_LOGICAL_CORE_IDS + #error More than one porting abstraction layer matches current platform in test_porting_abstraction_layer_get_logical_core_ids.c + #endif + + #define TEST_PAL_GET_LOGICAL_CORE_IDS + + void test_pal_get_logical_core_ids( struct lfds700_list_asu_state *lasus ) + { + DWORD + slpi_length = 0; + + lfds700_pal_uint_t + number_slpi, + loop; + + struct lfds700_misc_prng_state + ps; + + struct test_pal_logical_processor + *lp; + + SYSTEM_LOGICAL_PROCESSOR_INFORMATION + *slpi = NULL; + + ULONG_PTR + mask; + + assert( lasus != NULL ); + + lfds700_misc_prng_init( &ps ); + + lfds700_list_asu_init_valid_on_current_logical_core( lasus, NULL, NULL ); + + *number_logical_processors = 0; + + GetLogicalProcessorInformation( slpi, &slpi_length ); + slpi = malloc( slpi_length ); + GetLogicalProcessorInformation( slpi, &slpi_length ); + number_slpi = slpi_length / sizeof(SYSTEM_LOGICAL_PROCESSOR_INFORMATION); + + for( loop = 0 ; loop < number_slpi ; loop++ ) + if( (slpi+loop)->Relationship == RelationProcessorCore ) + for( logical_processor_number = 0 ; logical_processor_number < sizeof(ULONG_PTR) * BITS_PER_BYTE ; logical_processor_number++ ) + { + bitmask = 1 << logical_processor_number; + + if( (slpi+loop)->ProcessorMask & bitmask ) + { + lp = util_aligned_malloc( sizeof(struct test_pal_logical_processor), LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + lp->logical_processor_number = logical_processor_number; + lp->windows_logical_processor_group_number = 0; + + LFDS700_LIST_ASU_SET_VALUE_IN_ELEMENT( lp->lasue, lp ); + lfds700_list_asu_insert_at_start( lasus, &lp->lasue, &ps ); + } + + free( slpi ); + + return; + } + +#endif + + + + + +/****************************************************************************/ +#if( defined __linux__ ) + + /* TRD : __linux__ indicates Linux + __STDC__ indicates Standard Library + __STDC_HOSTED__ indicates Standard Library hosted implementation + - fopen requires a Standard Library hosted environment + - setbuf requires a Standard Library hosted environment + - fgets requires a Standard Library hosted environment + - sscanf requires a Standard Library hosted environment + - fclose requires a Standard Library hosted environment + */ + + #ifdef TEST_PAL_GET_LOGICAL_CORE_IDS + #error More than one porting abstraction layer matches current platform in test_porting_abstraction_layer_get_logical_core_ids.c + #endif + + #define TEST_PAL_GET_LOGICAL_CORE_IDS + + void test_pal_get_logical_core_ids( struct lfds700_list_asu_state *lasus ) + { + char + diskbuffer[BUFSIZ], + string[1024]; + + FILE + *diskfile; + + int long long unsigned + logical_processor_number; + + struct lfds700_misc_prng_state + ps; + + struct test_pal_logical_processor + *lp; + + assert( lasus != NULL ); + + lfds700_misc_prng_init( &ps ); + + lfds700_list_asu_init_valid_on_current_logical_core( lasus, NULL, NULL ); + + diskfile = fopen( "/proc/cpuinfo", "r" ); + + if( diskfile != NULL ) + { + setbuf( diskfile, diskbuffer ); + + while( NULL != fgets(string, 1024, diskfile) ) + if( 1 == sscanf(string, "processor : %llu", &logical_processor_number) ) + { + lp = util_aligned_malloc( sizeof(struct test_pal_logical_processor), LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES ); + + lp->logical_processor_number = (lfds700_pal_uint_t) logical_processor_number; + lp->windows_logical_processor_group_number = 0; + + LFDS700_LIST_ASU_SET_VALUE_IN_ELEMENT( lp->lasue, lp ); + lfds700_list_asu_insert_at_start( lasus, &lp->lasue, &ps ); + } + + fclose( diskfile ); + } + + return; + } + +#endif + + + + + +/****************************************************************************/ +#if( !defined TEST_PAL_GET_LOGICAL_CORE_IDS ) + + #error test_pal_get_logical_core_ids() not implemented for this platform. + +#endif + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_porting_abstraction_layer_operating_system.h b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_porting_abstraction_layer_operating_system.h new file mode 100644 index 0000000000000000000000000000000000000000..1c0ab03eee7677003f6a51094e55629a3dbfab33 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_porting_abstraction_layer_operating_system.h @@ -0,0 +1,82 @@ +/****************************************************************************/ +#if( defined _MSC_VER ) + /* TRD : MSVC compiler + + an unfortunately necessary hack for MSVC + MSVC only defines __STDC__ if /Za is given, where /Za turns off MSVC C extensions - + which prevents Windows header files from compiling. + */ + + #define __STDC__ 1 + #define __STDC_HOSTED__ 1 +#endif + +#if( defined __linux__ ) + #define _GNU_SOURCE + #include <unistd.h> +#endif + + + + + +/****************************************************************************/ +#if( defined _MSC_VER && _MSC_VER >= 1310 && NTDDI_VERSION >= NTDDI_WINXP && defined _WIN32 ) + + #ifdef TEST_PAL_PORTING_ABSTRACTION_LAYER + #error More than one porting abstraction layer matches current platform. + #endif + + #define TEST_PAL_PORTING_ABSTRACTION_LAYER + + #define TEST_PAL_OS_STRING "Windows" + + #include <windows.h> + + typedef HANDLE test_pal_thread_state_t; + typedef DWORD test_pal_thread_return_t; + + #define TEST_PAL_CALLING_CONVENTION WINAPI + +#endif + + + + + +/****************************************************************************/ +#if( defined __GNUC__ && defined __linux__ && _POSIX_THREADS > 0 ) + + #ifdef TEST_PAL_PORTING_ABSTRACTION_LAYER + #error More than one porting abstraction layer matches current platform. + #endif + + #define TEST_PAL_PORTING_ABSTRACTION_LAYER + + #define TEST_PAL_OS_STRING "Linux" + + #define _GNU_SOURCE + + #include <pthread.h> + #include <sched.h> + #include <sys/syscall.h> + #include <sys/types.h> + + typedef pthread_t test_pal_thread_state_t; + typedef void * test_pal_thread_return_t; + + #define TEST_PAL_CALLING_CONVENTION + +#endif + + + + + +/****************************************************************************/ +#if( !defined TEST_PAL_PORTING_ABSTRACTION_LAYER ) + + #error No matching porting abstraction layer in test_porting_abstraction_layer_operating_system.h + +#endif + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_porting_abstraction_layer_thread_start.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_porting_abstraction_layer_thread_start.c new file mode 100644 index 0000000000000000000000000000000000000000..83a09814aa17bd1c1b8af24fd18d6ebbba7d6b22 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_porting_abstraction_layer_thread_start.c @@ -0,0 +1,336 @@ +/***** includes *****/ +#include "internal.h" + + + + + +/****************************************************************************/ +#if( defined _WIN32 && !defined _KERNEL_MODE && NTDDI_VERSION >= NTDDI_WIN7 ) + + /* TRD : _WIN32 indicates 32-bit or 64-bit Windows + !_KERNEL_MODE indicates Windows user-mode + NTDDI_VERSION indicates Windows version + - GetCurrentProcess requires XP + - InitializeProcThreadAttributeList requires Windows 7 + - CreateRemoteThreadEx requires Windows 7 + */ + + #ifdef TEST_PAL_THREAD_START + #error More than one porting abstraction layer matches the current platform in test_porting_abstraction_layer_thread_start.c + #endif + + #define TEST_PAL_THREAD_START + + int test_pal_thread_start( test_pal_thread_state_t *thread_state, + struct test_pal_logical_processor *lp, + test_pal_thread_return_t (TEST_PAL_CALLING_CONVENTION *thread_function)(void *thread_user_state), + void *thread_user_state ) + { + BOOL + brv; + + DWORD + thread_id; + + GROUP_AFFINITY + ga; + + int + rv = 0; + + LPPROC_THREAD_ATTRIBUTE_LIST + attribute_list; + + SIZE_T + attribute_list_length; + + assert( thread_state != NULL ); + assert( lp != NULL ); + assert( thread_function != NULL ); + // TRD : thread_user_state can be NULL + + /* TRD : here we're using CreateRemoteThreadEx() to start a thread in our own process + we do this because as a function, it allows us to specify processor and processor group affinity in the create call + */ + + brv = InitializeProcThreadAttributeList( NULL, 1, 0, &attribute_list_length ); + attribute_list = malloc( attribute_list_length ); + brv = InitializeProcThreadAttributeList( attribute_list, 1, 0, &attribute_list_length ); + + ga.Mask = ( (KAFFINITY) 1 << lp->logical_processor_number ); + ga.Group = (WORD) lp->windows_logical_processor_group_number; + memset( ga.Reserved, 0, sizeof(WORD) * 3 ); + + brv = UpdateProcThreadAttribute( attribute_list, 0, PROC_THREAD_ATTRIBUTE_GROUP_AFFINITY, &ga, sizeof(GROUP_AFFINITY), NULL, NULL ); + *thread_state = CreateRemoteThreadEx( GetCurrentProcess(), NULL, 0, thread_function, thread_user_state, NO_FLAGS, attribute_list, &thread_id ); + + DeleteProcThreadAttributeList( attribute_list ); + free( attribute_list ); + + if( *thread_state != NULL ) + rv = 1; + + return( rv ); + } + +#endif + + + + + +/****************************************************************************/ +#if( defined _WIN32 && !defined _KERNEL_MODE && NTDDI_VERSION >= NTDDI_WINXP && NTDDI_VERSION < NTDDI_WIN7 ) + + /* TRD : _WIN32 indicates 64-bit or 32-bit Windows + NTDDI_VERSION indicates Windows version + - CreateThread requires XP + - SetThreadAffinityMask requires XP + - ResumeThread requires XP + */ + + #ifdef TEST_PAL_THREAD_START + #error More than one porting abstraction layer matches the current platform in test_porting_abstraction_layer_thread_start.c + #endif + + #define TEST_PAL_THREAD_START + + int test_pal_thread_start( test_pal_thread_state_t *thread_state, + struct test_pal_logical_processor *lp, + test_pal_thread_return_t (TEST_PAL_CALLING_CONVENTION *thread_function)(void *thread_user_state), + void *thread_user_state ) + { + int + rv = 0; + + DWORD + thread_id; + + DWORD_PTR + affinity_mask, + result; + + assert( thread_state != NULL ); + assert( lp != NULL ); + assert( thread_function != NULL ); + // TRD : thread_user_state can be NULL + + /* TRD : Vista and earlier do not support processor groups + as such, there is a single implicit processor group + also, there's no support for actually starting a thread in its correct NUMA node / logical processor + so we make the best of it; we start suspended, set the affinity, and then resume + the thread itself internally is expected to be making allocs from the correct NUMA node + */ + + *thread_state = CreateThread( NULL, 0, thread_function, thread_user_state, CREATE_SUSPENDED, &thread_id ); + + affinity_mask = (DWORD_PTR) (1 << lp->logical_processor_number); + + SetThreadAffinityMask( *thread_state, affinity_mask ); + + ResumeThread( *thread_state ); + + if( *thread_state != NULL ) + rv = 1; + + return( rv ); + } + +#endif + + + + + +/****************************************************************************/ +#if( defined __linux__ && _POSIX_THREADS > 0 ) + + /* TRD : __linux__ indicates Linux + - gettid requires Linux + - sched_setaffinity requires Linux + _POSIX_THREADS indicates POSIX threads + - pthread_create requires POSIX + */ + + #ifdef TEST_PAL_THREAD_START + #error More than one porting abstraction layer matches the current platform in test_porting_abstraction_layer_thread_start.c + #endif + + #define TEST_PAL_THREAD_START + + /***** structs *****/ + struct test_pal_internal_thread_state + { + struct test_pal_logical_processor + lp; + + test_pal_thread_return_t + (TEST_PAL_CALLING_CONVENTION *thread_function)( void *thread_user_state ); + + void + *thread_user_state; + }; + + /***** prototypes *****/ + test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION test_pal_internal_thread_function( void *thread_user_state ); + + /****************************************************************************/ + int test_pal_thread_start( test_pal_thread_state_t *thread_state, + struct test_pal_logical_processor *lp, + test_pal_thread_return_t (TEST_PAL_CALLING_CONVENTION *thread_function)(void *thread_user_state), + void *thread_user_state ) + { + int + rv; + + struct test_pal_internal_thread_state + *its; + + /* TRD : this implementation works on Linux only as it uses sched_setaffinity(), which is Linux specific + although I cannot currently test, I believe this function also works on Android + + this implementation exists because the pthreads function for setting thread affinity, + pthread_attr_setaffinity_np(), works on Linux, but not Android + */ + + assert( thread_state != NULL ); + assert( lp != NULL ); + assert( thread_function != NULL ); + // TRD : thread_user_state can be NULL + + its = malloc( sizeof(struct test_pal_internal_thread_state) ); + + its->lp = *lp; + its->thread_function = thread_function; + its->thread_user_state = thread_user_state; + + rv = pthread_create( thread_state, NULL, test_pal_internal_thread_function, its ); + + if( rv == 0 ) + rv = 1; + + return( rv ); + } + + /****************************************************************************/ + test_pal_thread_return_t TEST_PAL_CALLING_CONVENTION test_pal_internal_thread_function( void *thread_user_state ) + { + cpu_set_t + cpuset; + + pid_t + tid; + + struct test_pal_internal_thread_state + *its; + + test_pal_thread_return_t + rv; + + assert( thread_user_state != NULL ); + + /* TRD : the APIs under Linux/POSIX for setting thread affinity are in a mess + pthreads offers pthread_attr_setaffinity_np(), which glibc supports, + but which is not supported by Android + Linux offers sched_setaffinity(), but this needs a *thread pid*, + and the only API to get a thread pid is gettid(), which works for + and only for *the calling thread* + + so we come to this - a wrapper thread function, which is the function used + when starting a thread; this calls gettid() and then sched_setaffinity(), + and then calls into the actual thread function + + generally shaking my head in disbelief at this point + */ + + assert( thread_user_state != NULL ); + + its = (struct test_pal_internal_thread_state *) thread_user_state; + + CPU_ZERO( &cpuset ); + CPU_SET( its->lp.logical_processor_number, &cpuset ); + + tid = syscall( SYS_gettid ); + + sched_setaffinity( tid, sizeof(cpu_set_t), &cpuset ); + + rv = its->thread_function( its->thread_user_state ); + + free( its ); + + return( rv ); + } + +#endif + + + + + +/****************************************************************************/ +#if( !defined __linux__ && _POSIX_THREADS > 0 ) + + /* TRD : !__linux__ indicates not Linux + _POSIX_THREADS indicates POSIX threads + - pthread_attr_init requires POSIX + - pthread_attr_setaffinity_np requires POSIX + - pthread_create requires POSIX + - pthread_attr_destroy requires POSIX + */ + + #ifdef TEST_PAL_THREAD_START + #error More than one porting abstraction layer matches the current platform in test_porting_abstraction_layer_thread_start.c + #endif + + #define TEST_PAL_THREAD_START + + int test_pal_thread_start( test_pal_thread_state_t *thread_state, + struct test_pal_logical_processor *lp, + test_pal_thread_return_t (TEST_PAL_CALLING_CONVENTION *thread_function)(void *thread_user_state), + void *thread_user_state ) + { + int + rv = 0, + rv_create; + + cpu_set_t + cpuset; + + pthread_attr_t + attr; + + assert( thread_state != NULL ); + assert( lp != NULL ); + assert( thread_function != NULL ); + // TRD : thread_user_state can be NULL + + pthread_attr_init( &attr ); + + CPU_ZERO( &cpuset ); + CPU_SET( lp->logical_processor_number, &cpuset ); + pthread_attr_setaffinity_np( &attr, sizeof(cpuset), &cpuset ); + + rv_create = pthread_create( thread_state, &attr, thread_function, thread_user_state ); + + if( rv_create == 0 ) + rv = 1; + + pthread_attr_destroy( &attr ); + + return( rv ); + } + +#endif + + + + + +/****************************************************************************/ +#if( !defined TEST_PAL_THREAD_START ) + + #error test_pal_thread_start() not implemented for this platform. + +#endif + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_porting_abstraction_layer_thread_wait.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_porting_abstraction_layer_thread_wait.c new file mode 100644 index 0000000000000000000000000000000000000000..bd4a8c01f70de182433809c14049e8764a381e09 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/test_porting_abstraction_layer_thread_wait.c @@ -0,0 +1,69 @@ +/***** includes *****/ +#include "internal.h" + + + + + +/****************************************************************************/ +#if( defined _WIN32 && NTDDI_VERSION >= NTDDI_WINXP ) + + /* TRD : _WIN32 indicates 32-bit or 64-bit Windows + NTDDI_VERSION indicates Windows version + - WaitForSingleObject requires XP + */ + + #ifdef TEST_PAL_THREAD_WAIT + #error More than one porting abstraction layer matches current platform in test_porting_abstraction_layer_thread_wait.c + #endif + + #define TEST_PAL_THREAD_WAIT + + void test_pal_thread_wait( test_pal_thread_state_t thread_state ) + { + WaitForSingleObject( thread_state, INFINITE ); + + return; + } + +#endif + + + + + +/****************************************************************************/ +#if( _POSIX_THREADS > 0 ) + + /* TRD : POSIX threads + + _POSIX_THREADS indicates POSIX threads + - pthread_join requires POSIX + */ + + #ifdef TEST_PAL_THREAD_WAIT + #error More than one porting abstraction layer matches current platform in test_porting_abstraction_layer_thread_wait.c + #endif + + #define TEST_PAL_THREAD_WAIT + + void test_pal_thread_wait( test_pal_thread_state_t thread_state ) + { + pthread_join( thread_state, NULL ); + + return; + } + +#endif + + + + + +/****************************************************************************/ +#if( !defined TEST_PAL_THREAD_WAIT ) + + #error test_pal_thread_wait() not implemented for this platform. + +#endif + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/util_cmdline.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/util_cmdline.c new file mode 100644 index 0000000000000000000000000000000000000000..9173d607c96c5a3ceb8037a9b17e30bf58759d17 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/util_cmdline.c @@ -0,0 +1,184 @@ +/***** includes *****/ +#include "internal.h" + + + + + +/****************************************************************************/ +void util_cmdline_init( struct util_cmdline_state *cs ) +{ + lfds700_pal_uint_t + loop; + + assert( cs != NULL ); + + for( loop = 0 ; loop < NUMBER_OF_LOWERCASE_LETTERS_IN_LATIN_ALPHABET ; loop++ ) + { + cs->args[loop].arg_type = LIBCOMMON_CMDLINE_ARG_TYPE_UNSET; + cs->args[loop].processed_flag = LOWERED; + } + + return; +} + + + + + +/****************************************************************************/ +#pragma warning( disable : 4100 ) + +void util_cmdline_cleanup( struct util_cmdline_state *cs ) +{ + assert( cs != NULL ); + + return; +} + +#pragma warning( default : 4100 ) + + + + + +/****************************************************************************/ +void util_cmdline_add_arg( struct util_cmdline_state *cs, char arg_letter, enum util_cmdline_arg_type arg_type ) +{ + lfds700_pal_uint_t + index; + + assert( cs != NULL ); + assert( arg_letter >= 'a' and arg_letter <= 'z' ); + // TRD : arg_type can be any value in its range + + index = arg_letter - 'a'; + + cs->args[index].arg_type = arg_type; + + if( arg_type == LIBCOMMON_CMDLINE_ARG_TYPE_FLAG ) + cs->args[index].arg_data.flag.flag = LOWERED; + + return; +} + + + + + +/****************************************************************************/ +int util_cmdline_process_args( struct util_cmdline_state *cs, int argc, char **argv ) +{ + char + *arg; + + int + arg_letter, + cc, + loop, + rv = 1; + + lfds700_pal_uint_t + index; + + assert( cs != NULL ); + assert( argc >= 1 ); + assert( argv != NULL ); + + for( loop = 1 ; loop < argc ; loop++ ) + { + arg = *(argv+loop); + + switch( *arg ) + { + case '-': + arg_letter = tolower( *(arg+1) ); + + if( arg_letter >= 'a' and arg_letter <= 'z' ) + { + index = arg_letter - 'a'; + + switch( cs->args[index].arg_type ) + { + case LIBCOMMON_CMDLINE_ARG_TYPE_INTEGER_RANGE: + if( loop+1 >= argc ) + rv = 0; + + if( loop+1 < argc ) + { + cc = sscanf( *(argv+loop+1), "%llu-%llu", &cs->args[index].arg_data.integer_range.integer_start, &cs->args[index].arg_data.integer_range.integer_end ); + + if( cc != 2 ) + rv = 0; + + if( cc == 2 ) + { + cs->args[index].processed_flag = RAISED; + loop++; + } + } + break; + + case LIBCOMMON_CMDLINE_ARG_TYPE_INTEGER: + if( loop+1 >= argc ) + rv = 0; + + if( loop+1 < argc ) + { + cc = sscanf( *(argv+loop+1), "%llu", &cs->args[index].arg_data.integer.integer ); + + if( cc != 1 ) + rv = 0; + + if( cc == 1 ) + { + cs->args[index].processed_flag = RAISED; + loop++; + } + } + break; + + case LIBCOMMON_CMDLINE_ARG_TYPE_FLAG: + cs->args[index].arg_data.flag.flag = RAISED; + cs->args[index].processed_flag = RAISED; + break; + + case LIBCOMMON_CMDLINE_ARG_TYPE_UNSET: + break; + } + } + break; + + default: + rv = 0; + break; + } + } + + return( rv ); +} + + + + + +/****************************************************************************/ +void util_cmdline_get_arg_data( struct util_cmdline_state *cs, char arg_letter, union util_cmdline_arg_data **arg_data ) +{ + lfds700_pal_uint_t + index; + + assert( cs != NULL ); + assert( arg_letter >= 'a' and arg_letter <= 'z' ); + assert( arg_data != NULL ); + + index = arg_letter - 'a'; + + if( cs->args[index].processed_flag == RAISED ) + *arg_data = &cs->args[index].arg_data; + else + *arg_data = NULL; + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/util_cmdline.h b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/util_cmdline.h new file mode 100644 index 0000000000000000000000000000000000000000..a19b073499e3e3a4d92ce0fd656581ba5412f4a2 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/util_cmdline.h @@ -0,0 +1,69 @@ +/***** defines *****/ +#define NUMBER_OF_LOWERCASE_LETTERS_IN_LATIN_ALPHABET 26 + +/***** enums *****/ +enum util_cmdline_arg_type +{ + LIBCOMMON_CMDLINE_ARG_TYPE_INTEGER_RANGE, + LIBCOMMON_CMDLINE_ARG_TYPE_INTEGER, + LIBCOMMON_CMDLINE_ARG_TYPE_FLAG, + LIBCOMMON_CMDLINE_ARG_TYPE_UNSET +}; + +/***** structs *****/ +struct util_cmdline_arg_integer_range +{ + int long long unsigned + integer_start, + integer_end; +}; + +struct util_cmdline_arg_integer +{ + int long long unsigned + integer; +}; + +struct util_cmdline_arg_flag +{ + enum flag + flag; +}; + +union util_cmdline_arg_data +{ + struct util_cmdline_arg_integer_range + integer_range; + + struct util_cmdline_arg_integer + integer; + + struct util_cmdline_arg_flag + flag; +}; + +struct util_cmdline_arg_letter_and_data +{ + enum util_cmdline_arg_type + arg_type; + + enum flag + processed_flag; + + union util_cmdline_arg_data + arg_data; +}; + +struct util_cmdline_state +{ + struct util_cmdline_arg_letter_and_data + args[NUMBER_OF_LOWERCASE_LETTERS_IN_LATIN_ALPHABET]; +}; + +/***** public protoypes *****/ +void util_cmdline_init( struct util_cmdline_state *cs ); +void util_cmdline_cleanup( struct util_cmdline_state *cs ); +void util_cmdline_add_arg( struct util_cmdline_state *cs, char arg_letter, enum util_cmdline_arg_type arg_type ); +int util_cmdline_process_args( struct util_cmdline_state *cs, int argc, char **argv ); +void util_cmdline_get_arg_data( struct util_cmdline_state *cs, char arg_letter, union util_cmdline_arg_data **arg_data ); + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/util_memory_helpers.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/util_memory_helpers.c new file mode 100644 index 0000000000000000000000000000000000000000..3d4c0e79f40a96a7df2ef3a761276e4f893199c3 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/util_memory_helpers.c @@ -0,0 +1,75 @@ +/***** includes *****/ +#include "internal.h" + + + + + +/****************************************************************************/ +void *util_aligned_malloc( lfds700_pal_uint_t size, lfds700_pal_uint_t align_in_bytes ) +{ + lfds700_pal_uint_t + offset; + + void + *memory, + *original_memory; + + // TRD : size can be any value in its range + // TRD : align_in_bytes can be any value in its range + + /* TRD : helper function to provide aligned allocations + no porting required + */ + + original_memory = memory = util_malloc_wrapper( size + sizeof(void *) + align_in_bytes ); + + if( memory != NULL ) + { + memory = (void **) memory + 1; + offset = align_in_bytes - (lfds700_pal_uint_t) memory % align_in_bytes; + memory = (char unsigned *) memory + offset; + *( (void **) memory - 1 ) = original_memory; + } + + return( memory ); +} + + + + + +/****************************************************************************/ +void util_aligned_free( void *memory ) +{ + assert( memory != NULL ); + + // TRD : the "void *" stored above memory points to the root of the allocation + free( *( (void **) memory - 1 ) ); + + return; +} + + + + + +/****************************************************************************/ +void *util_malloc_wrapper( lfds700_pal_uint_t size ) +{ + void + *memory; + + // TRD : size can be any value in its range + + memory = malloc( size ); + + if( memory == NULL ) + { + puts( "malloc() failed, exiting." ); + exit( EXIT_FAILURE ); + } + + return( memory ); +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/util_memory_helpers.h b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/util_memory_helpers.h new file mode 100644 index 0000000000000000000000000000000000000000..8341a1f2e3b95870b38b47126dd5e96f7d6bc851 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/util_memory_helpers.h @@ -0,0 +1,5 @@ +/***** public prototypes *****/ +void *util_aligned_malloc( lfds700_pal_uint_t size, lfds700_pal_uint_t align_in_bytes ); +void util_aligned_free( void *memory ); +void *util_malloc_wrapper( lfds700_pal_uint_t size ); + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/util_thread_starter.c b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/util_thread_starter.c new file mode 100644 index 0000000000000000000000000000000000000000..c008fa2c5d60c227c18c5dfc73e3526483c2c325 --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/util_thread_starter.c @@ -0,0 +1,151 @@ +/***** includes *****/ +#include "internal.h" + + + + + +/****************************************************************************/ +void util_thread_starter_new( struct util_thread_starter_state **tts, lfds700_pal_uint_t number_threads ) +{ + lfds700_pal_uint_t + loop; + + assert( tts != NULL ); + // TRD : number_threads cam be any value in its range + + *tts = util_malloc_wrapper( sizeof(struct util_thread_starter_state) ); + + (*tts)->tsts = util_malloc_wrapper( sizeof(struct util_thread_starter_thread_state) * number_threads ); + (*tts)->thread_start_flag = LOWERED; + (*tts)->number_thread_states = number_threads; + + for( loop = 0 ; loop < number_threads ; loop++ ) + { + ((*tts)->tsts+loop)->thread_ready_flag = LOWERED; + ((*tts)->tsts+loop)->thread_start_flag = &(*tts)->thread_start_flag; + } + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return; +} + + + + + +/****************************************************************************/ +void util_thread_starter_start( struct util_thread_starter_state *tts, + test_pal_thread_state_t *thread_state, + lfds700_pal_uint_t thread_number, + struct test_pal_logical_processor *lp, + test_pal_thread_return_t (TEST_PAL_CALLING_CONVENTION *thread_function)( void *thread_user_state ), + void *thread_user_state ) +{ + assert( tts != NULL ); + assert( thread_state != NULL ); + assert( lp != NULL ); + assert( thread_function != NULL ); + // TRD : thread_user_state can be NULL + + (tts->tsts+thread_number)->thread_user_state = thread_user_state; + + util_thread_start_wrapper( thread_state, lp, thread_function, tts->tsts+thread_number ); + + // TRD : wait for the thread to indicate it is ready and waiting + while( (tts->tsts+thread_number)->thread_ready_flag == LOWERED ); + + return; +} + + + + + +/****************************************************************************/ +void util_thread_starter_ready_and_wait( struct util_thread_starter_thread_state *tsts ) +{ + assert( tsts != NULL ); + + tsts->thread_ready_flag = RAISED; + + LFDS700_MISC_BARRIER_FULL; + + // TRD : threads here are all looping, so we don't need to force a store + + while( *tsts->thread_start_flag == LOWERED ) + LFDS700_MISC_BARRIER_LOAD; + + return; +} + + + + + +/****************************************************************************/ +void util_thread_starter_run( struct util_thread_starter_state *tts ) +{ + assert( tts != NULL ); + + /* TRD : all threads at this point are ready to go + as we wait for their ready flag immediately after their spawn + */ + + tts->thread_start_flag = RAISED; + + LFDS700_MISC_BARRIER_STORE; + + lfds700_misc_force_store(); + + return; +} + + + + + +/****************************************************************************/ +void util_thread_starter_delete( struct util_thread_starter_state *tts ) +{ + assert( tts != NULL ); + + free( tts->tsts ); + + free( tts ); + + return; +} + + + + + +/****************************************************************************/ +void util_thread_start_wrapper( test_pal_thread_state_t *thread_state, + struct test_pal_logical_processor *lp, + test_pal_thread_return_t (TEST_PAL_CALLING_CONVENTION *thread_function)(void *thread_user_state), + void *thread_user_state ) +{ + int + rv; + + assert( thread_state != NULL ); + assert( lp != NULL ); + assert( thread_function != NULL ); + // TRD : thread_user_state can be NULL + + rv = test_pal_thread_start( thread_state, lp, thread_function, thread_user_state ); + + if( rv == 0 ) + { + puts( "test_pal_thread_start() failed." ); + exit( EXIT_FAILURE ); + } + + return; +} + diff --git a/openair2/UTIL/LFDS/liblfds7.0.0/test/src/util_thread_starter.h b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/util_thread_starter.h new file mode 100644 index 0000000000000000000000000000000000000000..5587edf1c071ad90ccead36d018abbcc7c6b735d --- /dev/null +++ b/openair2/UTIL/LFDS/liblfds7.0.0/test/src/util_thread_starter.h @@ -0,0 +1,41 @@ +/***** structs *****/ +struct util_thread_starter_thread_state +{ + // TRD : must be volatile or the compiler optimizes it away into a single load + enum flag volatile + thread_ready_flag, + *thread_start_flag; + + void + *thread_user_state; +}; + +struct util_thread_starter_state +{ + enum flag volatile + thread_start_flag; + + lfds700_pal_uint_t + number_thread_states; + + struct util_thread_starter_thread_state + *tsts; +}; + +/***** prototypes *****/ +void util_thread_starter_new( struct util_thread_starter_state **tts, lfds700_pal_uint_t number_threads ); +void util_thread_starter_start( struct util_thread_starter_state *tts, + test_pal_thread_state_t *thread_state, + lfds700_pal_uint_t thread_number, + struct test_pal_logical_processor *lp, + test_pal_thread_return_t (TEST_PAL_CALLING_CONVENTION *thread_function)( void *thread_user_state ), + void *thread_user_state ); +void util_thread_starter_ready_and_wait( struct util_thread_starter_thread_state *tsts ); +void util_thread_starter_run( struct util_thread_starter_state *tts ); +void util_thread_starter_delete( struct util_thread_starter_state *tts ); + +void util_thread_start_wrapper( test_pal_thread_state_t *thread_state, + struct test_pal_logical_processor *lp, + test_pal_thread_return_t (TEST_PAL_CALLING_CONVENTION *thread_function)(void *thread_user_state), + void *thread_user_state ); + diff --git a/openair2/UTIL/LOG/log.c b/openair2/UTIL/LOG/log.c index 2626d18c19d8ef4ac11259d5f6d11656d655b358..49f00325f8c70d528bf6c1f3cc700928d0cbc601 100644 --- a/openair2/UTIL/LOG/log.c +++ b/openair2/UTIL/LOG/log.c @@ -325,6 +325,14 @@ int logInit (void) g_log->log_component[ENB_APP].filelog = 0; g_log->log_component[ENB_APP].filelog_name = ""; + g_log->log_component[FLEXRAN_AGENT].name = "FLEXRAN_AGENT"; + g_log->log_component[FLEXRAN_AGENT].level = LOG_DEBUG; + g_log->log_component[FLEXRAN_AGENT].flag = LOG_MED; + g_log->log_component[FLEXRAN_AGENT].interval = 1; + g_log->log_component[FLEXRAN_AGENT].fd = 0; + g_log->log_component[FLEXRAN_AGENT].filelog = 0; + g_log->log_component[FLEXRAN_AGENT].filelog_name = ""; + g_log->log_component[TMR].name = "TMR"; g_log->log_component[TMR].level = LOG_EMERG; g_log->log_component[TMR].flag = LOG_MED; diff --git a/openair2/UTIL/LOG/log.h b/openair2/UTIL/LOG/log.h index d5ab549aef25e18d727730436fc6734e7d1fd951..6a6569c1a585499bb314574cb70a0d26a35d4e36 100644 --- a/openair2/UTIL/LOG/log.h +++ b/openair2/UTIL/LOG/log.h @@ -270,6 +270,7 @@ typedef enum { RAL_ENB, RAL_UE, ENB_APP, + FLEXRAN_AGENT, TMR, USIM, LOCALIZE, diff --git a/openair2/UTIL/OTG/otg_tx.c b/openair2/UTIL/OTG/otg_tx.c index 5a2718c02b06252c1dac08b2452d9edbc3d6c70a..bdf8137cfa42c07159e0a156c9983d9324504ff5 100644 --- a/openair2/UTIL/OTG/otg_tx.c +++ b/openair2/UTIL/OTG/otg_tx.c @@ -262,13 +262,14 @@ unsigned char *packet_gen( char *header=NULL; int header_size = 0; - + //LOG_I(OTG,"Src: %d - Dest: %d - before exit\n",src_instance,dst_instance); // check if the app is configured if (app >= g_otg->application_idx[src_instance][dst_instance]) { + //LOG_I(OTG,"Src: %d - Dest: %d - no packet to generate - no application\n",src_instance,dst_instance); return NULL; } - LOG_T(OTG,"[src %d] [dst %d ][APP %d] current time %d\n",src_instance, dst_instance, app, ctime); + //LOG_I(OTG,"[src %d] [dst %d ][APP %d] current time %d\n",src_instance, dst_instance, app, ctime); *pkt_size=0; init_packet_gen(src_instance, dst_instance,ctime); diff --git a/openair3/NAS/COMMON/EMM/MSG/AttachAccept.c b/openair3/NAS/COMMON/EMM/MSG/AttachAccept.c index cec2d169774edc2edc704e25a9454ae772f700f3..248540dff3fb8b7481136a3c1b9ba5ca47a81747 100644 --- a/openair3/NAS/COMMON/EMM/MSG/AttachAccept.c +++ b/openair3/NAS/COMMON/EMM/MSG/AttachAccept.c @@ -188,10 +188,11 @@ int decode_attach_accept(attach_accept_msg *attach_accept, uint8_t *buffer, uint default: errorCodeDecoder = TLV_DECODE_UNEXPECTED_IEI; + LOG_TRACE(WARNING, "DECODE_UNEXPECTED_IEI %x (4 bits)", ieiDecoded); return TLV_DECODE_UNEXPECTED_IEI; } } - + LOG_TRACE(WARNING, "DECODED %d\n", decoded); return decoded; } diff --git a/openair3/NAS/COMMON/EMM/MSG/AuthenticationRequest.c b/openair3/NAS/COMMON/EMM/MSG/AuthenticationRequest.c index fac93c5df3eb878a5a7c7afc40ba459db6c44e2d..3e0bffde2d1afd718288a1bcee40058096549220 100644 --- a/openair3/NAS/COMMON/EMM/MSG/AuthenticationRequest.c +++ b/openair3/NAS/COMMON/EMM/MSG/AuthenticationRequest.c @@ -38,7 +38,7 @@ int decode_authentication_request(authentication_request_msg *authentication_req CHECK_PDU_POINTER_AND_LENGTH_DECODER(buffer, AUTHENTICATION_REQUEST_MINIMUM_LENGTH, len); /* Decoding mandatory fields */ - if ((decoded_result = decode_u8_nas_key_set_identifier(&authentication_request->naskeysetidentifierasme, 0, *(buffer + decoded) >> 4, len - decoded)) < 0) + if ((decoded_result = decode_u8_nas_key_set_identifier(&authentication_request->naskeysetidentifierasme, 0, *(buffer + decoded), len - decoded)) < 0) return decoded_result; decoded++; diff --git a/openair3/NAS/COMMON/EMM/MSG/SecurityModeCommand.c b/openair3/NAS/COMMON/EMM/MSG/SecurityModeCommand.c index aeec3d4024e6e6c81e8452c4820a07a813ead52e..a1a34f94954ccfed88d36be7b5007e2eff9f972d 100644 --- a/openair3/NAS/COMMON/EMM/MSG/SecurityModeCommand.c +++ b/openair3/NAS/COMMON/EMM/MSG/SecurityModeCommand.c @@ -72,6 +72,8 @@ int decode_security_mode_command(security_mode_command_msg *security_mode_comman decoded += decoded_result; /* Set corresponding mask to 1 in presencemask */ security_mode_command->presencemask |= SECURITY_MODE_COMMAND_IMEISV_REQUEST_PRESENT; + LOG_TRACE(INFO," SECURITY MODE COMMAND: IMEISV_REQUEST: %d \n",security_mode_command->imeisvrequest); + break; case SECURITY_MODE_COMMAND_REPLAYED_NONCEUE_IEI: diff --git a/openair3/NAS/COMMON/EMM/MSG/SecurityModeComplete.c b/openair3/NAS/COMMON/EMM/MSG/SecurityModeComplete.c index f10401d09a9d75d5373eca7a359ab6a8b0226dd7..3258134febff5c6ae8cefb871fa0eb4b9cc88218 100644 --- a/openair3/NAS/COMMON/EMM/MSG/SecurityModeComplete.c +++ b/openair3/NAS/COMMON/EMM/MSG/SecurityModeComplete.c @@ -76,8 +76,11 @@ int encode_security_mode_complete(security_mode_complete_msg *security_mode_comp /* Checking IEI and pointer */ CHECK_PDU_POINTER_AND_LENGTH_ENCODER(buffer, SECURITY_MODE_COMPLETE_MINIMUM_LENGTH, len); + LOG_TRACE(INFO,"SECURITY MODE COMMAND COMPLETE: presencemask: %d \n",security_mode_complete->presencemask); + if ((security_mode_complete->presencemask & SECURITY_MODE_COMPLETE_IMEISV_PRESENT) == SECURITY_MODE_COMPLETE_IMEISV_PRESENT) { + LOG_TRACE(INFO,"SECURITY MODE COMMAND COMPLETE: encode imeisv \n"); if ((encode_result = encode_mobile_identity(&security_mode_complete->imeisv, SECURITY_MODE_COMPLETE_IMEISV_IEI, buffer + encoded, len - @@ -87,7 +90,7 @@ int encode_security_mode_complete(security_mode_complete_msg *security_mode_comp else encoded += encode_result; } - + LOG_TRACE(INFO,"SECURITY MODE COMMAND COMPLETE done !!! \n"); return encoded; } diff --git a/openair3/NAS/COMMON/IES/EmergencyNumberList.c b/openair3/NAS/COMMON/IES/EmergencyNumberList.c index 39b59ef0ca79647e478be37207c564d8a6b417a4..9330fdc312ef0107e29298554021bd03d1ae19db 100644 --- a/openair3/NAS/COMMON/IES/EmergencyNumberList.c +++ b/openair3/NAS/COMMON/IES/EmergencyNumberList.c @@ -41,10 +41,24 @@ int decode_emergency_number_list(EmergencyNumberList *emergencynumberlist, uint8 ielen = *(buffer + decoded); decoded++; CHECK_LENGTH_DECODER(len - decoded, ielen); - emergencynumberlist->lengthofemergency = *(buffer + decoded); - decoded++; - emergencynumberlist->emergencyservicecategoryvalue = *(buffer + decoded) & 0x1f; - decoded++; + int information_element_index = 0; + while ((decoded < ielen) && (information_element_index < EMERGENCY_NUMBER_LIST_MAX_NUMBER_INFORMATION)) { + emergencynumberlist->emergency_number_information[information_element_index].lengthofemergency = *(buffer + decoded); + decoded++; + emergencynumberlist->emergency_number_information[information_element_index].emergencyservicecategoryvalue = *(buffer + decoded) & 0x1f; + decoded++; + int remaining_len = emergencynumberlist->emergency_number_information[information_element_index].lengthofemergency - 1; + int digit_index = 0; + while (remaining_len > 0) { + emergencynumberlist->emergency_number_information[information_element_index].bcd_digits[digit_index++] = *(buffer + decoded); + decoded++; + remaining_len --; + } + while (digit_index < EMERGENCY_NUMBER_LIST_MAX_2DIGITS) { + emergencynumberlist->emergency_number_information[information_element_index].bcd_digits[digit_index++] = 0xFF; + } + information_element_index++; + } #if defined (NAS_DEBUG) dump_emergency_number_list_xml(emergencynumberlist, iei); #endif @@ -67,11 +81,16 @@ int encode_emergency_number_list(EmergencyNumberList *emergencynumberlist, uint8 lenPtr = (buffer + encoded); encoded ++; - *(buffer + encoded) = emergencynumberlist->lengthofemergency; - encoded++; - *(buffer + encoded) = 0x00 | - (emergencynumberlist->emergencyservicecategoryvalue & 0x1f); - encoded++; + for ( int ie_index = 0; ie_index < emergencynumberlist->num_emergency_elements; ie_index++) { + *(buffer + encoded) = emergencynumberlist->emergency_number_information[ie_index].lengthofemergency; + encoded++; + *(buffer + encoded) = 0x00 | + (emergencynumberlist->emergency_number_information[ie_index].emergencyservicecategoryvalue & 0x1f); + encoded++; + for (int bcd2_index = 0; bcd2_index < (emergencynumberlist->emergency_number_information[ie_index].lengthofemergency - 1); bcd2_index++) { + *(buffer + encoded) = emergencynumberlist->emergency_number_information[ie_index].bcd_digits[bcd2_index]; + } + } *lenPtr = encoded - 1 - ((iei > 0) ? 1 : 0); return encoded; } @@ -83,9 +102,20 @@ void dump_emergency_number_list_xml(EmergencyNumberList *emergencynumberlist, ui if (iei > 0) /* Don't display IEI if = 0 */ printf(" <IEI>0x%X</IEI>\n", iei); - - printf(" <Length of emergency>%u</Length of emergency>\n", emergencynumberlist->lengthofemergency); - printf(" <Emergency service category value>%u</Emergency service category value>\n", emergencynumberlist->emergencyservicecategoryvalue); + for ( int ie_index = 0; ie_index < emergencynumberlist->num_emergency_elements; ie_index++) { + printf(" <Length of emergency>%u</Length of emergency>\n", emergencynumberlist->emergency_number_information[ie_index].lengthofemergency); + printf(" <Emergency service category value>%u</Emergency service category value>\n", emergencynumberlist->emergency_number_information[ie_index].emergencyservicecategoryvalue); + for (int bcd2_index = 0; bcd2_index < (emergencynumberlist->emergency_number_information[ie_index].lengthofemergency - 1); bcd2_index++) { + uint8_t bcd1 = emergencynumberlist->emergency_number_information[ie_index].bcd_digits[bcd2_index] & 0x0f; + uint8_t bcd2 = (emergencynumberlist->emergency_number_information[ie_index].bcd_digits[bcd2_index] & 0xf0) >> 4; + if (bcd1 < 10) { + printf(" <BCD Digit%u>%u</BCD Digit%u>\n", (bcd2_index*2)+1, bcd1, (bcd2_index*2)+1); + if (bcd2 < 10) { + printf(" <BCD Digit%u>%u</BCD Digit%u>\n", (bcd2_index*2)+2, bcd2, (bcd2_index*2)+2); + } + } + } + } printf("</Emergency Number List>\n"); } diff --git a/openair3/NAS/COMMON/IES/EmergencyNumberList.h b/openair3/NAS/COMMON/IES/EmergencyNumberList.h index d2fd149dc098c9c43b5c6a15df870074f9b8b742..ab47c1ff06766208d0ff18153a05dc7fa6efb599 100644 --- a/openair3/NAS/COMMON/IES/EmergencyNumberList.h +++ b/openair3/NAS/COMMON/IES/EmergencyNumberList.h @@ -32,8 +32,14 @@ #define EMERGENCY_NUMBER_LIST_MAXIMUM_LENGTH 50 typedef struct EmergencyNumberList_tag { - uint8_t lengthofemergency; - uint8_t emergencyservicecategoryvalue:5; + uint8_t num_emergency_elements; + struct { + uint8_t lengthofemergency; + uint8_t emergencyservicecategoryvalue:5; +#define EMERGENCY_NUMBER_LIST_MAX_2DIGITS 6 + uint8_t bcd_digits[EMERGENCY_NUMBER_LIST_MAX_2DIGITS]; // length to be fixed +#define EMERGENCY_NUMBER_LIST_MAX_NUMBER_INFORMATION 2 + } emergency_number_information[EMERGENCY_NUMBER_LIST_MAX_NUMBER_INFORMATION]; } EmergencyNumberList; int encode_emergency_number_list(EmergencyNumberList *emergencynumberlist, uint8_t iei, uint8_t *buffer, uint32_t len); diff --git a/openair3/NAS/COMMON/IES/MobileIdentity.c b/openair3/NAS/COMMON/IES/MobileIdentity.c index 7ab30011ce93e42504ae91b752dccc96c97950bf..4651fa0047dffd5b757a1b16d9d50aef3c067403 100644 --- a/openair3/NAS/COMMON/IES/MobileIdentity.c +++ b/openair3/NAS/COMMON/IES/MobileIdentity.c @@ -575,6 +575,8 @@ static int encode_imei_mobile_identity(ImeiMobileIdentity_t *imei, uint8_t *buff static int encode_imeisv_mobile_identity(ImeisvMobileIdentity_t *imeisv, uint8_t *buffer) { uint32_t encoded = 0; + LOG_TRACE(INFO,"SECURITY MODE COMMAND COMPLETE: encode_imeisv_mobile_identity \n"); + *(buffer + encoded) = 0x00 | (imeisv->digit1 << 4) | (imeisv->oddeven << 3) | (imeisv->typeofidentity); encoded++; @@ -590,12 +592,15 @@ static int encode_imeisv_mobile_identity(ImeisvMobileIdentity_t *imeisv, uint8_t encoded++; *(buffer + encoded) = 0x00 | (imeisv->digit13 << 4) | imeisv->digit12; encoded++; + *(buffer + encoded) = 0x00 | (imeisv->digit15 << 4) | imeisv->digit14; + encoded++; + *(buffer + encoded) = 0x00 | (imeisv->parity << 4) | imeisv->digit16; - if (imeisv->oddeven != MOBILE_IDENTITY_EVEN) { - *(buffer + encoded) = 0x00 | (imeisv->digit15 << 4) | imeisv->digit14; - } else { - *(buffer + encoded) = 0xf0 | imeisv->digit14; - } + //if (imeisv->oddeven != MOBILE_IDENTITY_EVEN) { + // *(buffer + encoded) = 0x00 | (imeisv->digit15 << 4) | imeisv->digit14; + //} else { + // *(buffer + encoded) = 0xf0 | imeisv->digit14; + //} encoded++; return encoded; diff --git a/openair3/NAS/COMMON/IES/MobileIdentity.h b/openair3/NAS/COMMON/IES/MobileIdentity.h index 8d1c5cdbe5b1a1f31399ff1687edb630dcab6c78..72abcb9ed47774178e509301717ffde8d5680a2f 100644 --- a/openair3/NAS/COMMON/IES/MobileIdentity.h +++ b/openair3/NAS/COMMON/IES/MobileIdentity.h @@ -73,8 +73,63 @@ typedef struct { uint8_t mbmssessionid; } TmgiMobileIdentity_t; +typedef struct imeisv_s{ + uint8_t digit1:4; + uint8_t oddeven:1; + uint8_t typeofidentity:3; + uint8_t digit2:4; + uint8_t digit3:4; + uint8_t digit4:4; + uint8_t digit5:4; + uint8_t digit6:4; + uint8_t digit7:4; + uint8_t digit8:4; + uint8_t digit9:4; + uint8_t digit10:4; + uint8_t digit11:4; + uint8_t digit12:4; + uint8_t digit13:4; + uint8_t digit14:4; + uint8_t digit15:4; + uint8_t digit16:4; +#define EVEN_PARITY 0 +#define IMEI_ODD_PARITY 0xf + uint8_t parity:4; +} imeisv_t; + +#if 0 +typedef struct imeisv_s { + uint8_t length; + union { + struct { + uint8_t tac2:4; + uint8_t tac1:4; + uint8_t tac4:4; + uint8_t tac3:4; + uint8_t tac6:4; + uint8_t tac5:4; + uint8_t tac8:4; + uint8_t tac7:4; + uint8_t snr2:4; + uint8_t snr1:4; + uint8_t snr4:4; + uint8_t snr3:4; + uint8_t snr6:4; + uint8_t snr5:4; + uint8_t svn2:4; + uint8_t svn1:4; +#define EVEN_PARITY 0 +#define IMEI_ODD_PARITY 0xf + uint8_t parity:4; + } num; +#define IMEISV_BCD8_SIZE 9 + uint8_t value[IMEISV_BCD8_SIZE]; + } u; +} imeisv_t; +#endif + typedef ImsiMobileIdentity_t ImeiMobileIdentity_t; -typedef ImsiMobileIdentity_t ImeisvMobileIdentity_t; +typedef imeisv_t ImeisvMobileIdentity_t; typedef ImsiMobileIdentity_t TmsiMobileIdentity_t; typedef ImsiMobileIdentity_t NoMobileIdentity_t; diff --git a/openair3/NAS/UE/EMM/SAP/emm_asDef.h b/openair3/NAS/UE/EMM/SAP/emm_asDef.h index bf0e6f6c3765525dbd6ed6f3e77818d6785b7866..69ea979b6361328530af8557330a47ad33d55e67 100644 --- a/openair3/NAS/UE/EMM/SAP/emm_asDef.h +++ b/openair3/NAS/UE/EMM/SAP/emm_asDef.h @@ -120,6 +120,7 @@ typedef struct emm_as_security_s { uint8_t ucs2; uint8_t uia; /* Replayed UMTS integrity algorithms */ uint8_t gea; /* Replayed GPRS encryption algorithms */ + uint8_t imeisv_request; uint8_t umts_present; uint8_t gprs_present; diff --git a/openair3/NAS/UE/EMM/SAP/emm_recv.c b/openair3/NAS/UE/EMM/SAP/emm_recv.c index a79a14d9c1057d41fa34c93e5f64244832db88b1..0ad41b09d878862b677cc35da535f103baf1cadf 100644 --- a/openair3/NAS/UE/EMM/SAP/emm_recv.c +++ b/openair3/NAS/UE/EMM/SAP/emm_recv.c @@ -140,7 +140,7 @@ int emm_recv_attach_accept(attach_accept_msg *msg, int *emm_cause) // supported cases: // typeoflist = 1 Or // typeoflist = 0 and numberofelements = 1 (ie numberofelements equal to zero see 3gpp 24.301 9.9.3.33.1) - LOG_D(NAS,"attach accept type of list: %d, number of element: %d\n",msg->tailist.typeoflist, msg->tailist.numberofelements); + LOG_TRACE(DEBUG,"attach accept type of list: %d, number of element: %d\n",msg->tailist.typeoflist, msg->tailist.numberofelements); if (!( (msg->tailist.typeoflist == TRACKING_AREA_IDENTITY_LIST_ONE_PLMN_CONSECUTIVE_TACS) || ((msg->tailist.typeoflist == 0) && ( msg->tailist.numberofelements == 0)) ) @@ -472,13 +472,15 @@ int emm_recv_security_mode_command(security_mode_command_msg *msg, * Message processing */ /* Execute the security mode control procedure initiated by the network */ + LOG_TRACE(INFO,"Execute the security mode control procedure initiated by the network: imeisvrequest %d\n",msg->imeisvrequest); rc = emm_proc_security_mode_command( msg->naskeysetidentifier.tsc != NAS_KEY_SET_IDENTIFIER_MAPPED, msg->naskeysetidentifier.naskeysetidentifier, msg->selectednassecurityalgorithms.typeofcipheringalgorithm, msg->selectednassecurityalgorithms.typeofintegrityalgorithm, msg->replayeduesecuritycapabilities.eea, - msg->replayeduesecuritycapabilities.eia); + msg->replayeduesecuritycapabilities.eia, + msg->imeisvrequest & 0x7); LOG_FUNC_RETURN (rc); } diff --git a/openair3/NAS/UE/EMM/SAP/emm_send.c b/openair3/NAS/UE/EMM/SAP/emm_send.c index 7e13d03c7b101ac40108622a667a4decd676c271..e3fc4fa7f990622aa6a78f922d863e6ca2074669 100644 --- a/openair3/NAS/UE/EMM/SAP/emm_send.c +++ b/openair3/NAS/UE/EMM/SAP/emm_send.c @@ -855,6 +855,34 @@ int emm_send_security_mode_complete(const emm_as_security_t *msg, /* Mandatory - Message type */ emm_msg->messagetype = SECURITY_MODE_COMPLETE; + if(msg->imeisv_request) + { + // configure imeisv param + emm_msg->presencemask |= SECURITY_MODE_COMPLETE_IMEISV_PRESENT; + + // 33 85 76 02 05 26 84 01 F1 + emm_msg->imeisv.imeisv.digit1 = 0x3; + emm_msg->imeisv.imeisv.oddeven = 0x0; + emm_msg->imeisv.imeisv.typeofidentity = 0x3; + emm_msg->imeisv.imeisv.digit2 = 0x5; + emm_msg->imeisv.imeisv.digit3 = 0x7; + emm_msg->imeisv.imeisv.digit4 = 0x4; + emm_msg->imeisv.imeisv.digit5 = 0x7; + emm_msg->imeisv.imeisv.digit6 = 0x3; + emm_msg->imeisv.imeisv.digit7 = 0x0; + emm_msg->imeisv.imeisv.digit8 = 0x4; + emm_msg->imeisv.imeisv.digit9 = 0x0; + emm_msg->imeisv.imeisv.digit10 = 0x0; + emm_msg->imeisv.imeisv.digit11 = 0x7; + emm_msg->imeisv.imeisv.digit12 = 0x0; + emm_msg->imeisv.imeisv.digit13 = 0x5; + emm_msg->imeisv.imeisv.digit14 = 0x3; + emm_msg->imeisv.imeisv.digit15 = 0x0; + emm_msg->imeisv.imeisv.digit16 = 0x0; + emm_msg->imeisv.imeisv.parity = IMEI_ODD_PARITY; + + size += SECURITY_MODE_COMPLETE_MAXIMUM_LENGTH; + } LOG_FUNC_RETURN (size); } diff --git a/openair3/NAS/UE/EMM/SecurityModeControl.c b/openair3/NAS/UE/EMM/SecurityModeControl.c index 7d198084817521ec1d952f589a86a0d8f10af11e..f27eb7b4afa87a25a76e08beb95f4a2aa6607b9c 100644 --- a/openair3/NAS/UE/EMM/SecurityModeControl.c +++ b/openair3/NAS/UE/EMM/SecurityModeControl.c @@ -146,7 +146,7 @@ static void _security_release(emm_security_context_t *ctx); ** ** ***************************************************************************/ int emm_proc_security_mode_command(int native_ksi, int ksi, - int seea, int seia, int reea, int reia) + int seea, int seia, int reea, int reia, int imeisv_request) { LOG_FUNC_IN; @@ -329,6 +329,7 @@ int emm_proc_security_mode_command(int native_ksi, int ksi, emm_sap.u.emm_as.u.security.guti = _emm_data.guti; emm_sap.u.emm_as.u.security.ueid = 0; emm_sap.u.emm_as.u.security.msgType = EMM_AS_MSG_TYPE_SMC; + emm_sap.u.emm_as.u.security.imeisv_request = imeisv_request; emm_sap.u.emm_as.u.security.emm_cause = emm_cause; /* Setup EPS NAS security data */ emm_as_set_security_data(&emm_sap.u.emm_as.u.security.sctx, diff --git a/openair3/NAS/UE/EMM/emm_main.c b/openair3/NAS/UE/EMM/emm_main.c index 82946a634e603ae118d76880139967065c04c2f4..2eb4d8fa24d6b18c1d7e8f88d01bbfc00961c2ca 100644 --- a/openair3/NAS/UE/EMM/emm_main.c +++ b/openair3/NAS/UE/EMM/emm_main.c @@ -40,6 +40,7 @@ Description Defines the EPS Mobility Management procedure call manager, #include "emm_main.h" #include "nas_log.h" #include "emmData.h" +#include "MobileIdentity.h" #include "memory.h" #include "usim_api.h" @@ -919,7 +920,7 @@ static int _emm_main_get_imei(imei_t *imei, const char *imei_str) int len = strlen(imei_str); if (len % 2) { - imei->u.num.parity = ODD_PARITY; + imei->u.num.parity = IMEI_ODD_PARITY; } else { imei->u.num.parity = EVEN_PARITY; } diff --git a/openair3/NAS/UE/EMM/emm_proc.h b/openair3/NAS/UE/EMM/emm_proc.h index e6a3ae0cdd0d85ac093887f9e784bf1ea7590c84..60f71f11c200ebd67ef02b90b5088cfa92dbaead 100644 --- a/openair3/NAS/UE/EMM/emm_proc.h +++ b/openair3/NAS/UE/EMM/emm_proc.h @@ -174,7 +174,7 @@ int emm_proc_authentication_delete(void); * -------------------------------------------------------------------------- */ int emm_proc_security_mode_command(int native_ksi, int ksi, int seea, int seia, - int reea, int reia); + int reea, int reia,int imeisv_request); /* *--------------------------------------------------------------------------- diff --git a/openair3/NAS/UE/UEprocess.c b/openair3/NAS/UE/UEprocess.c index 248633c3a192abfa68bbd0103e95492fcc6d732e..20af58dac67563576cb9c9f425a7bd63987033ec 100644 --- a/openair3/NAS/UE/UEprocess.c +++ b/openair3/NAS/UE/UEprocess.c @@ -71,6 +71,8 @@ static void _nas_signal_handler(int signal); static void _nas_clean(int usr_fd, int net_fd); +uint8_t usim_test = 0; + /****************************************************************************/ /****************** E X P O R T E D F U N C T I O N S ******************/ /****************************************************************************/ diff --git a/targets/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c b/targets/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c index f25c09acb147aab4ef94931cd92374779cd68adf..75aa4d26227b3294a285f1d33605f5029c8c138e 100644 --- a/targets/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c +++ b/targets/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c @@ -876,11 +876,8 @@ int openair0_config(openair0_config_t *openair0_cfg, int UE_flag) if (openair0_cfg[card].rx_freq[ant]>0) { p_exmimo_config->rf.rf_mode[ant] += (RXEN + DMAMODE_RX + RXLPFNORM + RXLPFEN + rx_filter); - p_exmimo_config->rf.rf_freq_rx[ant] = (unsigned int)openair0_cfg[card].rx_freq[ant]; - printf("openair0 : programming card %d RX antenna %d (freq %u, gain %d)\n",card,ant,p_exmimo_config->rf.rf_freq_rx[ant],p_exmimo_config->rf.rx_gain[ant][0]); - switch (openair0_cfg[card].rxg_mode[ant]) { default: case max_gain: @@ -916,6 +913,8 @@ int openair0_config(openair0_config_t *openair0_cfg, int UE_flag) } break; } + printf("openair0 : programming card %d RX antenna %d (freq %u, gain %d)\n",card,ant,p_exmimo_config->rf.rf_freq_rx[ant],p_exmimo_config->rf.rx_gain[ant][0]); + } else { p_exmimo_config->rf.rf_mode[ant] = 0; p_exmimo_config->rf.do_autocal[ant] = 0; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.exmimo2.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.exmimo2.conf index 3c608776d6936149f5e9c35cc5a5bcf86eee4003..8bf870f0a5f8b3c6d37b92e81c86a9e78d56102f 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.exmimo2.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.exmimo2.conf @@ -38,8 +38,9 @@ eNBs = Nid_cell_mbsfn = 0; nb_antennas_tx = 1; nb_antennas_rx = 1; - tx_gain = 10;//25; - rx_gain = 120; + nb_antenna_ports = 1; + tx_gain = 10; //25; + rx_gain = 10; //20; prach_root = 0; prach_config_index = 0; prach_high_speed = "DISABLE"; @@ -100,6 +101,8 @@ eNBs = ue_TimersAndConstants_t311 = 10000; ue_TimersAndConstants_n310 = 20; ue_TimersAndConstants_n311 = 1; + + ue_TransmissionMode = 1; } ); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band5.flexran.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band5.flexran.50PRB.usrpb210.conf new file mode 100644 index 0000000000000000000000000000000000000000..2e39b934e43841c3ba0f922d791921cb0602eaf1 --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band5.flexran.50PRB.usrpb210.conf @@ -0,0 +1,182 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "95"; + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "eNodeB_3GPP"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 5; + downlink_frequency = 879000000L; + uplink_frequency_offset = -45000000; + Nid_cell = 0; + N_RB_DL = 50; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 115; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -26; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -90; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -108; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -108; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + ue_TransmissionMode = 1; + } + ); + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "192.168.100.101"; + ipv6 = "192:168:100::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.100.106/24"; + + ENB_INTERFACE_NAME_FOR_S1U = "eth0"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.100.106/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + NETWORK_CONTROLLER : + { + FLEXRAN_AGENT_INTERFACE_NAME = "eth1"; + FLEXRAN_AGENT_IPV4_ADDRESS = "10.0.2.5/30"; + FLEXRAN_AGENT_PORT = 2210; + FLEXRAN_AGENT_CACHE = "/mnt/oai_agent_cache"; + }; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band5.flexran.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band5.flexran.usrpb210.conf new file mode 100644 index 0000000000000000000000000000000000000000..66e7ef433d4932e8b5be2a3b0166cba4514912e2 --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band5.flexran.usrpb210.conf @@ -0,0 +1,182 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "95"; + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "eNodeB_3GPP"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 5; + downlink_frequency = 879000000L; + uplink_frequency_offset = -45000000; + Nid_cell = 0; + N_RB_DL = 25; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 115; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -26; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -90; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -108; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -108; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + ue_TransmissionMode = 1; + } + ); + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "192.168.100.101"; + ipv6 = "192:168:100::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.100.106/24"; + + ENB_INTERFACE_NAME_FOR_S1U = "eth0"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.100.106/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + NETWORK_CONTROLLER : + { + FLEXRAN_AGENT_INTERFACE_NAME = "eth1"; + FLEXRAN_AGENT_IPV4_ADDRESS = "10.0.2.5/30"; + FLEXRAN_AGENT_PORT = 2210; + FLEXRAN_AGENT_CACHE = "/mnt/oai_agent_cache"; + }; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.50PRB.usrpb210.conf new file mode 100644 index 0000000000000000000000000000000000000000..7e68b5d84b73ec285c87ea405e14c78926d99a0b --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.50PRB.usrpb210.conf @@ -0,0 +1,182 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "95"; + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "eNodeB_3GPP"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 2660000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 50; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 125; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -27; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -96; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -100; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -104; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + ue_TransmissionMode = 1; + } + ); + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "192.168.100.101"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.100.106/24"; + + ENB_INTERFACE_NAME_FOR_S1U = "eth0"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.100.106/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + NETWORK_CONTROLLER : + { + FLEXRAN_AGENT_INTERFACE_NAME = "eth1"; + FLEXRAN_AGENT_IPV4_ADDRESS = "10.0.2.5/30"; + FLEXRAN_AGENT_PORT = 2210; + FLEXRAN_AGENT_CACHE = "/mnt/oai_agent_cache"; + }; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.oaisim.local_no_mme.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.oaisim.local_no_mme.conf new file mode 100644 index 0000000000000000000000000000000000000000..ca36fab45578ff31fd382ad0f30fdb29503220ad --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.oaisim.local_no_mme.conf @@ -0,0 +1,160 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "10"; + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "eNodeB_3GPP"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 2680000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 25; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 2; + nb_antennas_tx = 2; + nb_antennas_rx = 2; + tx_gain = 25; + rx_gain = 20; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = 0; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 0; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -108; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -108; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 2; + rach_preambleInitialReceivedTargetPower = -100; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + ue_TransmissionMode = 2; + } + ); + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "0.0.0.0"; + ipv6 = "0::0"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "none"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "0.0.0.0/24"; + + ENB_INTERFACE_NAME_FOR_S1U = "none"; + ENB_IPV4_ADDRESS_FOR_S1U = "0.0.0.0/24"; + ENB_PORT_FOR_S1U = 2153; # Spec 2152 + }; + + NETWORK_CONTROLLER : + { + ENB_AGENT_INTERFACE_NAME = "eth1"; + ENB_AGENT_IPV4_ADDRESS = "10.0.2.5/30"; + ENB_AGENT_PORT = 2210; + ENB_AGENT_CACHE = "/mnt/oai_agent_cache"; + }; + + log_config : + { + global_log_level ="trace"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="trace"; + phy_log_verbosity ="medium"; + mac_log_level ="trace"; + mac_log_verbosity ="medium"; + rlc_log_level ="trace"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="trace"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="trace"; + rrc_log_verbosity ="medium"; + gtpu_log_level ="debug"; + gtpu_log_verbosity ="medium"; + udp_log_level ="debug"; + udp_log_verbosity ="medium"; + osa_log_level ="debug"; + osa_log_verbosity ="low"; + }; + + } +); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.usrpb210.conf new file mode 100644 index 0000000000000000000000000000000000000000..4ee429f45e907b8db78414c1bf5e0cadca5b3a4c --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.usrpb210.conf @@ -0,0 +1,182 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "95"; + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "eNodeB_3GPP"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 2660000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 25; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 125; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -24; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -96; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -103; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -104; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + ue_TransmissionMode = 1; + } + ); + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "192.168.100.101"; + ipv6 = "192:168:100::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.100.106/24"; + + ENB_INTERFACE_NAME_FOR_S1U = "eth0"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.100.106/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + NETWORK_CONTROLLER : + { + FLEXRAN_AGENT_INTERFACE_NAME = "eth1"; + FLEXRAN_AGENT_IPV4_ADDRESS = "10.0.2.5/30"; + FLEXRAN_AGENT_PORT = 2210; + FLEXRAN_AGENT_CACHE = "/mnt/oai_agent_cache"; + }; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index 0741d88c42517e80a343295520ac0cd22624c3a5..bdc281c8ea6cd5253a24676df8974220b785d60e 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -134,8 +134,8 @@ time_stats_t softmodem_stats_mt; // main thread time_stats_t softmodem_stats_hw; // hw acquisition time_stats_t softmodem_stats_rxtx_sf; // total tx time time_stats_t softmodem_stats_rx_sf; // total rx time -int32_t **rxdata; -int32_t **txdata; +//int32_t **rxdata; +//int32_t **txdata; uint8_t seqno; //sequence number @@ -302,12 +302,13 @@ void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB) { 6, phy_vars_eNB->frame_parms.nb_prefix_samples, CYCLIC_PREFIX); - PHY_ofdm_mod(&phy_vars_eNB->common_vars.txdataF[0][aa][slot_offset_F+slot_sizeF], - dummy_tx_b+(phy_vars_eNB->frame_parms.samples_per_tti>>1), - phy_vars_eNB->frame_parms.ofdm_symbol_size, - 6, - phy_vars_eNB->frame_parms.nb_prefix_samples, - CYCLIC_PREFIX); + if (subframe_select(&phy_vars_eNB->frame_parms,subframe) == SF_DL) + PHY_ofdm_mod(&phy_vars_eNB->common_vars.txdataF[0][aa][slot_offset_F+slot_sizeF], + dummy_tx_b+(phy_vars_eNB->frame_parms.samples_per_tti>>1), + phy_vars_eNB->frame_parms.ofdm_symbol_size, + 6, + phy_vars_eNB->frame_parms.nb_prefix_samples, + CYCLIC_PREFIX); } else { normal_prefix_mod(&phy_vars_eNB->common_vars.txdataF[0][aa][slot_offset_F], dummy_tx_b, @@ -385,7 +386,7 @@ void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB) { // turn on tx switch N_TA_offset before //LOG_D(HW,"subframe %d, time to switch to tx (N_TA_offset %d, slot_offset %d) \n",subframe,phy_vars_eNB->N_TA_offset,slot_offset); for (i=0; i<phy_vars_eNB->N_TA_offset; i++) { - tx_offset = (int)slot_offset+time_offset[aa]+i-phy_vars_eNB->N_TA_offset/2; + tx_offset = (int)slot_offset+time_offset[aa]+i-phy_vars_eNB->N_TA_offset; if (tx_offset<0) tx_offset += LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*phy_vars_eNB->frame_parms.samples_per_tti; @@ -468,8 +469,16 @@ void proc_tx_full(PHY_VARS_eNB *eNB, // if TX fronthaul go ahead if (eNB->tx_fh) eNB->tx_fh(eNB,proc); - - + /* + if (proc->frame_tx>1000) { + write_output("/tmp/txsig0.m","txs0", &eNB->common_vars.txdata[eNB->Mod_id][0][0], eNB->frame_parms.samples_per_tti*10,1,1); + write_output("/tmp/txsigF0.m","txsF0", &eNB->common_vars.txdataF[eNB->Mod_id][0][0],eNB->frame_parms.symbols_per_tti*eNB->frame_parms.ofdm_symbol_size*10,1,1); + write_output("/tmp/txsig1.m","txs1", &eNB->common_vars.txdata[eNB->Mod_id][1][0], eNB->frame_parms.samples_per_tti*10,1,1); + write_output("/tmp/txsigF1.m","txsF1", &eNB->common_vars.txdataF[eNB->Mod_id][1][0],eNB->frame_parms.symbols_per_tti*eNB->frame_parms.ofdm_symbol_size*10,1,1); + //if (transmission_mode == 7) write_output("/tmp/txsigF5.m","txsF5", &eNB->common_vars.txdataF[eNB->Mod_id][5][0],eNB->frame_parms.symbols_per_tti*eNB->frame_parms.ofdm_symbol_size*10,1,1); + exit_fun(""); + } + */ } void proc_tx_rru_if4p5(PHY_VARS_eNB *eNB, @@ -539,7 +548,8 @@ int wait_CCs(eNB_rxtx_proc_t *proc) { static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_name) { start_meas(&softmodem_stats_rxtx_sf); - // **************************************** + +// **************************************** // Common RX procedures subframe n phy_procedures_eNB_common_RX(eNB); @@ -1477,7 +1487,7 @@ int setup_eNB_buffers(PHY_VARS_eNB **phy_vars_eNB, openair0_config_t *openair0_c int i, CC_id; int j; - uint16_t N_TA_offset = 0; + //uint16_t N_TA_offset = 0; LTE_DL_FRAME_PARMS *frame_parms; @@ -1490,6 +1500,7 @@ int setup_eNB_buffers(PHY_VARS_eNB **phy_vars_eNB, openair0_config_t *openair0_c return(-1); } + /* if (frame_parms->frame_type == TDD) { if (frame_parms->N_RB_DL == 100) N_TA_offset = 624; @@ -1498,7 +1509,7 @@ int setup_eNB_buffers(PHY_VARS_eNB **phy_vars_eNB, openair0_config_t *openair0_c else if (frame_parms->N_RB_DL == 25) N_TA_offset = 624/4; } - + */ if (openair0_cfg[CC_id].mmapped_dma == 1) { @@ -1508,11 +1519,8 @@ int setup_eNB_buffers(PHY_VARS_eNB **phy_vars_eNB, openair0_config_t *openair0_c printf("Mapping eNB CC_id %d, rx_ant %d\n",CC_id,i); free(phy_vars_eNB[CC_id]->common_vars.rxdata[0][i]); phy_vars_eNB[CC_id]->common_vars.rxdata[0][i] = openair0_cfg[CC_id].rxbase[i]; - - - + printf("rxdata[%d] @ %p\n",i,phy_vars_eNB[CC_id]->common_vars.rxdata[0][i]); - for (j=0; j<16; j++) { printf("rxbuffer %d: %x\n",j,phy_vars_eNB[CC_id]->common_vars.rxdata[0][i][j]); phy_vars_eNB[CC_id]->common_vars.rxdata[0][i][j] = 16-j; @@ -1533,15 +1541,15 @@ int setup_eNB_buffers(PHY_VARS_eNB **phy_vars_eNB, openair0_config_t *openair0_c } } else { // not memory-mapped DMA - - + //nothing to do, everything already allocated in lte_init + /* rxdata = (int32_t**)malloc16(frame_parms->nb_antennas_rx*sizeof(int32_t*)); txdata = (int32_t**)malloc16(frame_parms->nb_antennas_tx*sizeof(int32_t*)); for (i=0; i<frame_parms->nb_antennas_rx; i++) { free(phy_vars_eNB[CC_id]->common_vars.rxdata[0][i]); rxdata[i] = (int32_t*)(32 + malloc16(32+frame_parms->samples_per_tti*10*sizeof(int32_t))); // FIXME broken memory allocation - phy_vars_eNB[CC_id]->common_vars.rxdata[0][i] = rxdata[i]-N_TA_offset; // N_TA offset for TDD FIXME! N_TA_offset > 16 => access of unallocated memory + phy_vars_eNB[CC_id]->common_vars.rxdata[0][i] = rxdata[i]; //-N_TA_offset; // N_TA offset for TDD FIXME! N_TA_offset > 16 => access of unallocated memory memset(rxdata[i], 0, frame_parms->samples_per_tti*10*sizeof(int32_t)); printf("rxdata[%d] @ %p (%p) (N_TA_OFFSET %d)\n", i, phy_vars_eNB[CC_id]->common_vars.rxdata[0][i],rxdata[i],N_TA_offset); } @@ -1553,6 +1561,7 @@ int setup_eNB_buffers(PHY_VARS_eNB **phy_vars_eNB, openair0_config_t *openair0_c memset(txdata[i],0, frame_parms->samples_per_tti*10*sizeof(int32_t)); printf("txdata[%d] @ %p\n", i, phy_vars_eNB[CC_id]->common_vars.txdata[0][i]); } + */ } } @@ -1775,7 +1784,7 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst } } - if (setup_eNB_buffers(PHY_vars_eNB_g[inst],&openair0_cfg[CC_id])!=0) { + if (setup_eNB_buffers(PHY_vars_eNB_g[inst],&openair0_cfg[0])!=0) { printf("Exiting, cannot initialize eNodeB Buffers\n"); exit(-1); } diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index e28f70a8c94dfba6b8e840ad6f65b3934274fa42..5e0acdc80b70627ab45340bb937d4e2ab0914805 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -1346,12 +1346,6 @@ void init_openair0() { else openair0_cfg[card].rx_freq[i]=0.0; - printf("Card %d, channel %d, Setting tx_gain %f, rx_gain %f, tx_freq %f, rx_freq %f\n", - card,i, openair0_cfg[card].tx_gain[i], - openair0_cfg[card].rx_gain[i], - openair0_cfg[card].tx_freq[i], - openair0_cfg[card].rx_freq[i]); - openair0_cfg[card].autocal[i] = 1; openair0_cfg[card].tx_gain[i] = tx_gain[0][i]; if (UE_flag == 0) { @@ -1361,10 +1355,12 @@ void init_openair0() { openair0_cfg[card].rx_gain[i] = PHY_vars_UE_g[0][0]->rx_total_gain_dB - rx_gain_off; } - + printf("Card %d, channel %d, Setting tx_gain %f, rx_gain %f, tx_freq %f, rx_freq %f\n", + card,i, openair0_cfg[card].tx_gain[i], + openair0_cfg[card].rx_gain[i], + openair0_cfg[card].tx_freq[i], + openair0_cfg[card].rx_freq[i]); } - - } } @@ -1594,16 +1590,19 @@ int main( int argc, char **argv ) UE[CC_id]->rx_total_gain_dB = (int)rx_gain[CC_id][0] + rx_gain_off; UE[CC_id]->tx_power_max_dBm = tx_max_power[CC_id]; - if (UE[CC_id]->frame_parms.frame_type == TDD) { - if (UE[CC_id]->frame_parms.N_RB_DL == 100) - UE[CC_id]->N_TA_offset = 624; - else if (UE[CC_id]->frame_parms.N_RB_DL == 50) - UE[CC_id]->N_TA_offset = 624/2; - else if (UE[CC_id]->frame_parms.N_RB_DL == 25) - UE[CC_id]->N_TA_offset = 624/4; - } else { - UE[CC_id]->N_TA_offset = 0; + + if (frame_parms[CC_id]->frame_type==FDD) { + UE[CC_id]->N_TA_offset = 0; + } + else { + if (frame_parms[CC_id]->N_RB_DL == 100) + UE[CC_id]->N_TA_offset = 624; + else if (frame_parms[CC_id]->N_RB_DL == 50) + UE[CC_id]->N_TA_offset = 624/2; + else if (frame_parms[CC_id]->N_RB_DL == 25) + UE[CC_id]->N_TA_offset = 624/4; } + } // printf("tx_max_power = %d -> amp %d\n",tx_max_power,get_tx_amp(tx_max_poHwer,tx_max_power)); diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 8e11a826385ecfd1b5691cb951c28a6205aaa7b5..a0c7c75f54638de0def84c53d50edb268a5d965f 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -98,8 +98,8 @@ extern uint32_t downlink_frequency[MAX_NUM_CCs][4]; extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; extern int oai_exit; -extern int32_t **rxdata; -extern int32_t **txdata; +int32_t **rxdata; +int32_t **txdata; //extern unsigned int tx_forward_nsamps; //extern int tx_delay; @@ -1633,14 +1633,14 @@ int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, openair0_config_t *openair0_cfg) } /* - if (frame_parms->frame_type == TDD) { + if (frame_parms->frame_type == TDD) { if (frame_parms->N_RB_DL == 100) - N_TA_offset = 624; - else if (frame_parms->N_RB_DL == 50) - N_TA_offset = 624/2; - else if (frame_parms->N_RB_DL == 25) - N_TA_offset = 624/4; - } + N_TA_offset = 624; + else if (frame_parms->N_RB_DL == 50) + N_TA_offset = 624/2; + else if (frame_parms->N_RB_DL == 25) + N_TA_offset = 624/4; + } */ // replace RX signal buffers with mmaped HW versions @@ -1650,9 +1650,9 @@ int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, openair0_config_t *openair0_cfg) for (i=0; i<frame_parms->nb_antennas_rx; i++) { printf( "Mapping UE CC_id %d, rx_ant %d, freq %u on card %d, chain %d\n", CC_id, i, downlink_frequency[CC_id][i], rf_map->card, rf_map->chain+i ); free( phy_vars_ue[CC_id]->common_vars.rxdata[i] ); - rxdata[i] = (int32_t*)malloc16_clear( 307200*sizeof(int32_t) ); - phy_vars_ue[CC_id]->common_vars.rxdata[i] = rxdata[i]; // what about the "-N_TA_offset" ? // N_TA offset for TDD - printf("rxdata[%d] : %p\n",i,rxdata[i]); + rxdata[i] = (int32_t*)malloc16_clear( 307200*sizeof(int32_t) ); + phy_vars_ue[CC_id]->common_vars.rxdata[i] = rxdata[i]; // what about the "-N_TA_offset" ? // N_TA offset for TDD + printf("rxdata[%d] : %p\n",i,rxdata[i]); } for (i=0; i<frame_parms->nb_antennas_tx; i++) { diff --git a/targets/SIMU/USER/oaisim.c b/targets/SIMU/USER/oaisim.c index 79cd2fcc38212dacd6e4688313273626a0c6745d..3a06a627803f3bd3d1d92fdbbb259ca6b5960f55 100644 --- a/targets/SIMU/USER/oaisim.c +++ b/targets/SIMU/USER/oaisim.c @@ -75,6 +75,11 @@ uint8_t config_smbv = 0; char smbv_ip[16]; #endif +#if defined(FLEXRAN_AGENT_SB_IF) +# include "flexran_agent.h" +#endif + + #include "oaisim_functions.h" #include "oaisim.h" @@ -122,6 +127,8 @@ char smbv_ip[16]; //#define K 2 /* averaging coefficient */ //#define TARGET_SF_TIME_NS 1000000 /* 1ms = 1000000 ns */ +uint8_t usim_test = 0; + frame_t frame = 0; char stats_buffer[16384]; channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][MAX_NUM_CCs]; @@ -495,7 +502,6 @@ l2l1_task (void *args_p) xargv[0] = xname; fl_initialize (&xargc, xargv, NULL, 0, 0); eNB_inst = 0; - for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++) { for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) { // DL scope at UEs @@ -875,6 +881,7 @@ l2l1_task (void *args_p) update_otg_UE (UE_inst, oai_emulation.info.time_ms); //Access layer + // PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, UE_inst, ENB_FLAG_NO, NOT_A_RNTI, frame, next_slot>>1, 0); PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, UE_inst, 0, ENB_FLAG_NO, NOT_A_RNTI, frame % MAX_FRAME_NUMBER, next_slot); pdcp_run (&ctxt); #endif @@ -883,7 +890,7 @@ l2l1_task (void *args_p) CC_id++) { phy_procedures_UE_lte ( PHY_vars_UE_g[UE_inst][CC_id], - 0, abstraction_flag, + 0, abstraction_flag, normal_txrx, no_relay, NULL); } @@ -1296,6 +1303,10 @@ main (int argc, char **argv) smbv_write_config_from_frame_parms(smbv_fname, &PHY_vars_eNB_g[0][0]->frame_parms); #endif + /* #if defined (FLEXRAN_AGENT_SB_IF) + flexran_agent_start(); + #endif */ + // add events to future event list: Currently not used //oai_emulation.info.oeh_enabled = 1; if (oai_emulation.info.oeh_enabled == 1) diff --git a/targets/SIMU/USER/oaisim_functions.c b/targets/SIMU/USER/oaisim_functions.c index 0bd8e56c96a09141888e086b4958ddc8ad51725f..3592e72361340ec1cda70ecd960e98ce6cd142ca 100644 --- a/targets/SIMU/USER/oaisim_functions.c +++ b/targets/SIMU/USER/oaisim_functions.c @@ -1577,13 +1577,11 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime) // generate traffic if the ue is rrc reconfigured state //if ((rrc_state=mac_eNB_get_rrc_status(enb_module_idP, dst_id)) > 2 /*RRC_CONNECTED*/ ) { if (mac_eNB_get_rrc_status(enb_module_idP, oai_emulation.info.eNB_ue_module_id_to_rnti[enb_module_idP][dst_id]) > 2 ){ - if_times += 1; for (app_id=0; app_id<MAX_NUM_APPLICATION; app_id++) { otg_pkt = malloc (sizeof(Packet_otg_elt_t)); - (otg_pkt->otg_pkt).sdu_buffer = (uint8_t*) packet_gen(enb_module_idP, dst_id + NB_eNB_INST, app_id, ctime, &((otg_pkt->otg_pkt).sdu_buffer_size)); if ((otg_pkt->otg_pkt).sdu_buffer != NULL) { @@ -1710,6 +1708,7 @@ void update_otg_UE(module_id_t ue_mod_idP, unsigned int ctime) { #if defined(USER_MODE) && defined(OAI_EMU) + int app_id; if (oai_emulation.info.otg_enabled ==1 ) { module_id_t dst_id, src_id; //dst_id = eNB_index module_id_t module_id = ue_mod_idP+NB_eNB_INST; @@ -1719,31 +1718,33 @@ void update_otg_UE(module_id_t ue_mod_idP, unsigned int ctime) for (dst_id=0; dst_id<NB_SIG_CNX_UE; dst_id++) { // only consider the first attached eNB if (mac_UE_get_rrc_status(ue_mod_idP, dst_id ) > 2 /*RRC_CONNECTED*/) { - Packet_otg_elt_t *otg_pkt = malloc (sizeof(Packet_otg_elt_t)); - - if (otg_pkt!=NULL) - memset(otg_pkt,0,sizeof(Packet_otg_elt_t)); - else { - LOG_E(OTG,"not enough memory\n"); - exit(-1); - }// Manage to add this packet to the tail of your list - - (otg_pkt->otg_pkt).sdu_buffer = (uint8_t*) packet_gen(src_id, dst_id, 0, ctime, &((otg_pkt->otg_pkt).sdu_buffer_size)); - - if ((otg_pkt->otg_pkt).sdu_buffer != NULL) { - (otg_pkt->otg_pkt).rb_id = DTCH-2; - (otg_pkt->otg_pkt).module_id = module_id; - (otg_pkt->otg_pkt).dst_id = dst_id; - (otg_pkt->otg_pkt).is_ue = 1; - //Adding the packet to the OTG-PDCP buffer - (otg_pkt->otg_pkt).mode = PDCP_TRANSMISSION_MODE_DATA; - pkt_list_add_tail_eurecom(otg_pkt, &(otg_pdcp_buffer[module_id])); - LOG_I(EMU, "[UE %d] ADD pkt to OTG buffer with size %d for dst %d on rb_id %d \n", - (otg_pkt->otg_pkt).module_id, otg_pkt->otg_pkt.sdu_buffer_size, (otg_pkt->otg_pkt).dst_id,(otg_pkt->otg_pkt).rb_id); - } else { - free(otg_pkt); - otg_pkt=NULL; - } + for (app_id=0; app_id<MAX_NUM_APPLICATION; app_id++) { + Packet_otg_elt_t *otg_pkt = malloc (sizeof(Packet_otg_elt_t)); + + if (otg_pkt!=NULL) + memset(otg_pkt,0,sizeof(Packet_otg_elt_t)); + else { + LOG_E(OTG,"not enough memory\n"); + exit(-1); + }// Manage to add this packet to the tail of your list + + (otg_pkt->otg_pkt).sdu_buffer = (uint8_t*) packet_gen(src_id, dst_id, app_id, ctime, &((otg_pkt->otg_pkt).sdu_buffer_size)); + + if ((otg_pkt->otg_pkt).sdu_buffer != NULL) { + (otg_pkt->otg_pkt).rb_id = DTCH-2; + (otg_pkt->otg_pkt).module_id = module_id; + (otg_pkt->otg_pkt).dst_id = dst_id; + (otg_pkt->otg_pkt).is_ue = 1; + //Adding the packet to the OTG-PDCP buffer + (otg_pkt->otg_pkt).mode = PDCP_TRANSMISSION_MODE_DATA; + pkt_list_add_tail_eurecom(otg_pkt, &(otg_pdcp_buffer[module_id])); + LOG_I(EMU, "[UE %d] ADD pkt to OTG buffer with size %d for dst %d on rb_id %d \n", + (otg_pkt->otg_pkt).module_id, otg_pkt->otg_pkt.sdu_buffer_size, (otg_pkt->otg_pkt).dst_id,(otg_pkt->otg_pkt).rb_id); + } else { + free(otg_pkt); + otg_pkt=NULL; + } + } } } } diff --git a/targets/TEST/PDCP/with_rlc/test_pdcp_rlc.c b/targets/TEST/PDCP/with_rlc/test_pdcp_rlc.c index 0c1500fd5e3aa2ca4bad398ca97f566ba293f0c5..dc395281dce2d69febc4e5f7e86f6fbcb538a2d0 100644 --- a/targets/TEST/PDCP/with_rlc/test_pdcp_rlc.c +++ b/targets/TEST/PDCP/with_rlc/test_pdcp_rlc.c @@ -188,9 +188,9 @@ void pdcp_rlc_test_exchange_pdus(rlc_um_entity_t *um_txP, memset(&mac_rlc_status_resp_tx, 0, sizeof(struct mac_status_resp)); memset(&mac_rlc_status_resp_rx, 0, sizeof(struct mac_status_resp)); - mac_rlc_status_resp_tx = rlc_um_mac_status_indication(um_txP, bytes_txP, tx_status); + mac_rlc_status_resp_tx = rlc_um_mac_status_indication(um_txP, bytes_txP, tx_status, ENB_FLAG_YES); data_request_tx = rlc_um_mac_data_request(um_txP); - mac_rlc_status_resp_rx = rlc_um_mac_status_indication(um_rxP, bytes_rxP, tx_status); + mac_rlc_status_resp_rx = rlc_um_mac_status_indication(um_rxP, bytes_rxP, tx_status, ENB_FLAG_YES); data_request_rx = rlc_um_mac_data_request(um_rxP);