From 171d5727bef97461dcac08883fd9f70bf2d831a8 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Fri, 25 Jun 2021 14:24:56 +0100 Subject: [PATCH] Moved lib RLC into it's own folder --- .../srsran/interfaces/enb_metrics_interface.h | 2 +- .../srsran/{upper => rlc}/bearer_mem_pool.h | 0 lib/include/srsran/{upper => rlc}/rlc.h | 6 +- .../srsran/{upper => rlc}/rlc_am_base.h | 2 +- .../srsran/{upper => rlc}/rlc_am_lte.h | 10 +-- lib/include/srsran/{upper => rlc}/rlc_am_nr.h | 2 +- .../srsran/{upper => rlc}/rlc_common.h | 4 +- .../srsran/{upper => rlc}/rlc_metrics.h | 0 lib/include/srsran/{upper => rlc}/rlc_tm.h | 2 +- .../srsran/{upper => rlc}/rlc_um_base.h | 2 +- .../srsran/{upper => rlc}/rlc_um_lte.h | 2 +- lib/include/srsran/{upper => rlc}/rlc_um_nr.h | 2 +- lib/src/CMakeLists.txt | 1 + lib/src/rlc/CMakeLists.txt | 21 ++++++ lib/src/{upper => rlc}/bearer_mem_pool.cc | 8 +-- lib/src/{upper => rlc}/rlc.cc | 12 ++-- lib/src/{upper => rlc}/rlc_am_base.cc | 2 +- lib/src/{upper => rlc}/rlc_am_lte.cc | 2 +- lib/src/{upper => rlc}/rlc_am_nr.cc | 2 +- lib/src/{upper => rlc}/rlc_tm.cc | 2 +- lib/src/{upper => rlc}/rlc_um_base.cc | 2 +- lib/src/{upper => rlc}/rlc_um_lte.cc | 2 +- lib/src/{upper => rlc}/rlc_um_nr.cc | 2 +- lib/src/upper/CMakeLists.txt | 11 +--- lib/test/rlc/CMakeLists.txt | 64 +++++++++++++++++++ .../{upper => rlc}/rlc_am_control_test.cc | 0 lib/test/{upper => rlc}/rlc_am_data_test.cc | 0 lib/test/{upper => rlc}/rlc_am_nr_pdu_test.cc | 0 lib/test/{upper => rlc}/rlc_am_test.cc | 0 lib/test/{upper => rlc}/rlc_common_test.cc | 0 lib/test/{upper => rlc}/rlc_stress_test.cc | 0 lib/test/{upper => rlc}/rlc_test_common.h | 0 lib/test/{upper => rlc}/rlc_um_data_test.cc | 0 lib/test/{upper => rlc}/rlc_um_nr_pdu_test.cc | 0 lib/test/{upper => rlc}/rlc_um_nr_test.cc | 0 lib/test/{upper => rlc}/rlc_um_test.cc | 0 lib/test/upper/CMakeLists.txt | 45 ------------- srsenb/hdr/stack/upper/rlc.h | 2 +- srsenb/hdr/stack/upper/rlc_nr.h | 2 +- srsenb/src/CMakeLists.txt | 2 +- srsenb/src/common/rnti_pool.cc | 2 +- srsenb/src/stack/enb_stack_lte.cc | 2 +- srsue/hdr/stack/ue_stack_lte.h | 2 +- srsue/hdr/stack/ue_stack_nr.h | 2 +- srsue/hdr/ue_metrics_interface.h | 2 +- srsue/src/CMakeLists.txt | 2 +- srsue/src/test/ttcn3/hdr/ttcn3_syssim.h | 2 +- srsue/src/test/ttcn3/src/CMakeLists.txt | 1 + srsue/src/test/ttcn3/src/ttcn3_syssim.cc | 2 +- 49 files changed, 133 insertions(+), 100 deletions(-) rename lib/include/srsran/{upper => rlc}/bearer_mem_pool.h (100%) rename lib/include/srsran/{upper => rlc}/rlc.h (97%) rename lib/include/srsran/{upper => rlc}/rlc_am_base.h (95%) rename lib/include/srsran/{upper => rlc}/rlc_am_lte.h (98%) rename lib/include/srsran/{upper => rlc}/rlc_am_nr.h (98%) rename lib/include/srsran/{upper => rlc}/rlc_common.h (99%) rename lib/include/srsran/{upper => rlc}/rlc_metrics.h (100%) rename lib/include/srsran/{upper => rlc}/rlc_tm.h (98%) rename lib/include/srsran/{upper => rlc}/rlc_um_base.h (99%) rename lib/include/srsran/{upper => rlc}/rlc_um_lte.h (99%) rename lib/include/srsran/{upper => rlc}/rlc_um_nr.h (99%) create mode 100644 lib/src/rlc/CMakeLists.txt rename lib/src/{upper => rlc}/bearer_mem_pool.cc (85%) rename lib/src/{upper => rlc}/rlc.cc (98%) rename lib/src/{upper => rlc}/rlc_am_base.cc (93%) rename lib/src/{upper => rlc}/rlc_am_lte.cc (99%) rename lib/src/{upper => rlc}/rlc_am_nr.cc (99%) rename lib/src/{upper => rlc}/rlc_tm.cc (99%) rename lib/src/{upper => rlc}/rlc_um_base.cc (99%) rename lib/src/{upper => rlc}/rlc_um_lte.cc (99%) rename lib/src/{upper => rlc}/rlc_um_nr.cc (99%) create mode 100644 lib/test/rlc/CMakeLists.txt rename lib/test/{upper => rlc}/rlc_am_control_test.cc (100%) rename lib/test/{upper => rlc}/rlc_am_data_test.cc (100%) rename lib/test/{upper => rlc}/rlc_am_nr_pdu_test.cc (100%) rename lib/test/{upper => rlc}/rlc_am_test.cc (100%) rename lib/test/{upper => rlc}/rlc_common_test.cc (100%) rename lib/test/{upper => rlc}/rlc_stress_test.cc (100%) rename lib/test/{upper => rlc}/rlc_test_common.h (100%) rename lib/test/{upper => rlc}/rlc_um_data_test.cc (100%) rename lib/test/{upper => rlc}/rlc_um_nr_pdu_test.cc (100%) rename lib/test/{upper => rlc}/rlc_um_nr_test.cc (100%) rename lib/test/{upper => rlc}/rlc_um_test.cc (100%) diff --git a/lib/include/srsran/interfaces/enb_metrics_interface.h b/lib/include/srsran/interfaces/enb_metrics_interface.h index 9a89c0293..cdd9dc913 100644 --- a/lib/include/srsran/interfaces/enb_metrics_interface.h +++ b/lib/include/srsran/interfaces/enb_metrics_interface.h @@ -22,9 +22,9 @@ #include "srsenb/hdr/stack/s1ap/s1ap_metrics.h" #include "srsran/common/metrics_hub.h" #include "srsran/radio/radio_metrics.h" +#include "srsran/rlc/rlc_metrics.h" #include "srsran/system/sys_metrics.h" #include "srsran/upper/pdcp_metrics.h" -#include "srsran/upper/rlc_metrics.h" #include "srsue/hdr/stack/upper/gw_metrics.h" namespace srsenb { diff --git a/lib/include/srsran/upper/bearer_mem_pool.h b/lib/include/srsran/rlc/bearer_mem_pool.h similarity index 100% rename from lib/include/srsran/upper/bearer_mem_pool.h rename to lib/include/srsran/rlc/bearer_mem_pool.h diff --git a/lib/include/srsran/upper/rlc.h b/lib/include/srsran/rlc/rlc.h similarity index 97% rename from lib/include/srsran/upper/rlc.h rename to lib/include/srsran/rlc/rlc.h index 6a93ef55e..ef62f3bbe 100644 --- a/lib/include/srsran/upper/rlc.h +++ b/lib/include/srsran/rlc/rlc.h @@ -19,8 +19,8 @@ #include "srsran/interfaces/ue_pdcp_interfaces.h" #include "srsran/interfaces/ue_rlc_interfaces.h" #include "srsran/interfaces/ue_rrc_interfaces.h" -#include "srsran/upper/rlc_common.h" -#include "srsran/upper/rlc_metrics.h" +#include "srsran/rlc/rlc_common.h" +#include "srsran/rlc/rlc_metrics.h" namespace srsran { @@ -39,7 +39,7 @@ public: srsue::rrc_interface_rlc* rrc_, srsran::timer_handler* timers_, uint32_t lcid_); - + void init(srsue::pdcp_interface_rlc* pdcp_, srsue::rrc_interface_rlc* rrc_, srsran::timer_handler* timers_, diff --git a/lib/include/srsran/upper/rlc_am_base.h b/lib/include/srsran/rlc/rlc_am_base.h similarity index 95% rename from lib/include/srsran/upper/rlc_am_base.h rename to lib/include/srsran/rlc/rlc_am_base.h index 9aa7020c8..6743ae4db 100644 --- a/lib/include/srsran/upper/rlc_am_base.h +++ b/lib/include/srsran/rlc/rlc_am_base.h @@ -15,8 +15,8 @@ #include "srsran/common/buffer_pool.h" #include "srsran/common/common.h" +#include "srsran/rlc/rlc_common.h" #include "srsran/upper/byte_buffer_queue.h" -#include "srsran/upper/rlc_common.h" #include #include #include diff --git a/lib/include/srsran/upper/rlc_am_lte.h b/lib/include/srsran/rlc/rlc_am_lte.h similarity index 98% rename from lib/include/srsran/upper/rlc_am_lte.h rename to lib/include/srsran/rlc/rlc_am_lte.h index 9d1f88d36..6574e8297 100644 --- a/lib/include/srsran/upper/rlc_am_lte.h +++ b/lib/include/srsran/rlc/rlc_am_lte.h @@ -23,9 +23,9 @@ #include "srsran/common/task_scheduler.h" #include "srsran/common/timeout.h" #include "srsran/interfaces/pdcp_interface_types.h" +#include "srsran/rlc/rlc_am_base.h" +#include "srsran/rlc/rlc_common.h" #include "srsran/upper/byte_buffer_queue.h" -#include "srsran/upper/rlc_am_base.h" -#include "srsran/upper/rlc_common.h" #include #include #include @@ -367,10 +367,10 @@ private: void reestablish(); void stop(); - int write_sdu(unique_byte_buffer_t sdu); + int write_sdu(unique_byte_buffer_t sdu); uint32_t read_pdu(uint8_t* payload, uint32_t nof_bytes); - void discard_sdu(uint32_t discard_sn); - bool sdu_queue_is_full(); + void discard_sdu(uint32_t discard_sn); + bool sdu_queue_is_full(); bool has_data(); uint32_t get_buffer_state(); diff --git a/lib/include/srsran/upper/rlc_am_nr.h b/lib/include/srsran/rlc/rlc_am_nr.h similarity index 98% rename from lib/include/srsran/upper/rlc_am_nr.h rename to lib/include/srsran/rlc/rlc_am_nr.h index a825938a2..c1ac15bf1 100644 --- a/lib/include/srsran/upper/rlc_am_nr.h +++ b/lib/include/srsran/rlc/rlc_am_nr.h @@ -15,8 +15,8 @@ #include "srsran/common/buffer_pool.h" #include "srsran/common/common.h" +#include "srsran/rlc/rlc_am_base.h" #include "srsran/upper/byte_buffer_queue.h" -#include "srsran/upper/rlc_am_base.h" #include #include #include diff --git a/lib/include/srsran/upper/rlc_common.h b/lib/include/srsran/rlc/rlc_common.h similarity index 99% rename from lib/include/srsran/upper/rlc_common.h rename to lib/include/srsran/rlc/rlc_common.h index fcbbf33e1..922952b7d 100644 --- a/lib/include/srsran/upper/rlc_common.h +++ b/lib/include/srsran/rlc/rlc_common.h @@ -15,8 +15,8 @@ #include "srsran/adt/circular_buffer.h" #include "srsran/interfaces/rlc_interface_types.h" -#include "srsran/upper/bearer_mem_pool.h" -#include "srsran/upper/rlc_metrics.h" +#include "srsran/rlc/bearer_mem_pool.h" +#include "srsran/rlc/rlc_metrics.h" #include namespace srsran { diff --git a/lib/include/srsran/upper/rlc_metrics.h b/lib/include/srsran/rlc/rlc_metrics.h similarity index 100% rename from lib/include/srsran/upper/rlc_metrics.h rename to lib/include/srsran/rlc/rlc_metrics.h diff --git a/lib/include/srsran/upper/rlc_tm.h b/lib/include/srsran/rlc/rlc_tm.h similarity index 98% rename from lib/include/srsran/upper/rlc_tm.h rename to lib/include/srsran/rlc/rlc_tm.h index 858f9ff3b..9c21720ee 100644 --- a/lib/include/srsran/upper/rlc_tm.h +++ b/lib/include/srsran/rlc/rlc_tm.h @@ -15,8 +15,8 @@ #include "srsran/common/buffer_pool.h" #include "srsran/common/common.h" +#include "srsran/rlc/rlc_common.h" #include "srsran/upper/byte_buffer_queue.h" -#include "srsran/upper/rlc_common.h" namespace srsue { diff --git a/lib/include/srsran/upper/rlc_um_base.h b/lib/include/srsran/rlc/rlc_um_base.h similarity index 99% rename from lib/include/srsran/upper/rlc_um_base.h rename to lib/include/srsran/rlc/rlc_um_base.h index b17357a38..05d0a0179 100644 --- a/lib/include/srsran/upper/rlc_um_base.h +++ b/lib/include/srsran/rlc/rlc_um_base.h @@ -17,8 +17,8 @@ #include "srsran/common/buffer_pool.h" #include "srsran/common/common.h" #include "srsran/common/task_scheduler.h" +#include "srsran/rlc/rlc_common.h" #include "srsran/upper/byte_buffer_queue.h" -#include "srsran/upper/rlc_common.h" #include #include #include diff --git a/lib/include/srsran/upper/rlc_um_lte.h b/lib/include/srsran/rlc/rlc_um_lte.h similarity index 99% rename from lib/include/srsran/upper/rlc_um_lte.h rename to lib/include/srsran/rlc/rlc_um_lte.h index 17bf8ccb9..8da49c646 100644 --- a/lib/include/srsran/upper/rlc_um_lte.h +++ b/lib/include/srsran/rlc/rlc_um_lte.h @@ -15,8 +15,8 @@ #include "srsran/common/buffer_pool.h" #include "srsran/common/common.h" +#include "srsran/rlc/rlc_um_base.h" #include "srsran/upper/byte_buffer_queue.h" -#include "srsran/upper/rlc_um_base.h" #include #include #include diff --git a/lib/include/srsran/upper/rlc_um_nr.h b/lib/include/srsran/rlc/rlc_um_nr.h similarity index 99% rename from lib/include/srsran/upper/rlc_um_nr.h rename to lib/include/srsran/rlc/rlc_um_nr.h index 11c6bd55c..8a057871a 100644 --- a/lib/include/srsran/upper/rlc_um_nr.h +++ b/lib/include/srsran/rlc/rlc_um_nr.h @@ -16,8 +16,8 @@ #include "srsran/common/buffer_pool.h" #include "srsran/common/common.h" #include "srsran/interfaces/ue_interfaces.h" +#include "srsran/rlc/rlc_um_base.h" #include "srsran/upper/byte_buffer_queue.h" -#include "srsran/upper/rlc_um_base.h" #include #include #include diff --git a/lib/src/CMakeLists.txt b/lib/src/CMakeLists.txt index 1d0da18d6..cf7b4f922 100644 --- a/lib/src/CMakeLists.txt +++ b/lib/src/CMakeLists.txt @@ -11,6 +11,7 @@ add_subdirectory(common) add_subdirectory(mac) add_subdirectory(phy) add_subdirectory(radio) +add_subdirectory(rlc) add_subdirectory(srslog) add_subdirectory(system) add_subdirectory(upper) diff --git a/lib/src/rlc/CMakeLists.txt b/lib/src/rlc/CMakeLists.txt new file mode 100644 index 000000000..ed6e085fe --- /dev/null +++ b/lib/src/rlc/CMakeLists.txt @@ -0,0 +1,21 @@ +# +# Copyright 2013-2021 Software Radio Systems Limited +# +# By using this file, you agree to the terms and conditions set +# forth in the LICENSE file which can be found at the top level of +# the distribution. +# + +set(SOURCES rlc.cc + rlc_tm.cc + rlc_um_base.cc + rlc_um_lte.cc + rlc_am_base.cc + rlc_am_lte.cc + rlc_um_nr.cc + rlc_am_nr.cc + bearer_mem_pool.cc) + +add_library(srsran_rlc STATIC ${SOURCES}) +target_link_libraries(srsran_rlc srsran_common ${ATOMIC_LIBS}) +INSTALL(TARGETS srsran_rlc DESTINATION ${LIBRARY_DIR}) diff --git a/lib/src/upper/bearer_mem_pool.cc b/lib/src/rlc/bearer_mem_pool.cc similarity index 85% rename from lib/src/upper/bearer_mem_pool.cc rename to lib/src/rlc/bearer_mem_pool.cc index 764d8d122..c89fcb945 100644 --- a/lib/src/upper/bearer_mem_pool.cc +++ b/lib/src/rlc/bearer_mem_pool.cc @@ -10,11 +10,11 @@ * */ -#include "srsran/upper/bearer_mem_pool.h" +#include "srsran/rlc/bearer_mem_pool.h" #include "srsran/adt/pool/batch_mem_pool.h" -#include "srsran/upper/rlc_am_lte.h" -#include "srsran/upper/rlc_um_lte.h" -#include "srsran/upper/rlc_um_nr.h" +#include "srsran/rlc/rlc_am_lte.h" +#include "srsran/rlc/rlc_um_lte.h" +#include "srsran/rlc/rlc_um_nr.h" namespace srsran { diff --git a/lib/src/upper/rlc.cc b/lib/src/rlc/rlc.cc similarity index 98% rename from lib/src/upper/rlc.cc rename to lib/src/rlc/rlc.cc index 16559bf5c..e46fcc0a6 100644 --- a/lib/src/upper/rlc.cc +++ b/lib/src/rlc/rlc.cc @@ -10,12 +10,12 @@ * */ -#include "srsran/upper/rlc.h" +#include "srsran/rlc/rlc.h" #include "srsran/common/rwlock_guard.h" -#include "srsran/upper/rlc_am_lte.h" -#include "srsran/upper/rlc_tm.h" -#include "srsran/upper/rlc_um_lte.h" -#include "srsran/upper/rlc_um_nr.h" +#include "srsran/rlc/rlc_am_lte.h" +#include "srsran/rlc/rlc_tm.h" +#include "srsran/rlc/rlc_um_lte.h" +#include "srsran/rlc/rlc_um_nr.h" namespace srsran { @@ -503,7 +503,7 @@ void rlc::change_lcid(uint32_t old_lcid, uint32_t new_lcid) // make sure old LCID exists and new LCID is still free if (valid_lcid(old_lcid) && not valid_lcid(new_lcid)) { // insert old rlc entity into new LCID - rlc_map_t::iterator it = rlc_array.find(old_lcid); + rlc_map_t::iterator it = rlc_array.find(old_lcid); std::unique_ptr rlc_entity = std::move(it->second); if (not rlc_array.insert(rlc_map_pair_t(new_lcid, std::move(rlc_entity))).second) { logger.error("Error inserting RLC entity into array."); diff --git a/lib/src/upper/rlc_am_base.cc b/lib/src/rlc/rlc_am_base.cc similarity index 93% rename from lib/src/upper/rlc_am_base.cc rename to lib/src/rlc/rlc_am_base.cc index b8bff63ea..9de01ac07 100644 --- a/lib/src/upper/rlc_am_base.cc +++ b/lib/src/rlc/rlc_am_base.cc @@ -10,7 +10,7 @@ * */ -#include "srsran/upper/rlc_am_base.h" +#include "srsran/rlc/rlc_am_base.h" #include namespace srsran { diff --git a/lib/src/upper/rlc_am_lte.cc b/lib/src/rlc/rlc_am_lte.cc similarity index 99% rename from lib/src/upper/rlc_am_lte.cc rename to lib/src/rlc/rlc_am_lte.cc index 026355535..4704e3cc2 100644 --- a/lib/src/upper/rlc_am_lte.cc +++ b/lib/src/rlc/rlc_am_lte.cc @@ -10,7 +10,7 @@ * */ -#include "srsran/upper/rlc_am_lte.h" +#include "srsran/rlc/rlc_am_lte.h" #include "srsran/common/string_helpers.h" #include "srsran/interfaces/ue_pdcp_interfaces.h" #include "srsran/interfaces/ue_rrc_interfaces.h" diff --git a/lib/src/upper/rlc_am_nr.cc b/lib/src/rlc/rlc_am_nr.cc similarity index 99% rename from lib/src/upper/rlc_am_nr.cc rename to lib/src/rlc/rlc_am_nr.cc index cb94d7bb4..1dedca3c8 100644 --- a/lib/src/upper/rlc_am_nr.cc +++ b/lib/src/rlc/rlc_am_nr.cc @@ -10,7 +10,7 @@ * */ -#include "srsran/upper/rlc_am_nr.h" +#include "srsran/rlc/rlc_am_nr.h" #include namespace srsran { diff --git a/lib/src/upper/rlc_tm.cc b/lib/src/rlc/rlc_tm.cc similarity index 99% rename from lib/src/upper/rlc_tm.cc rename to lib/src/rlc/rlc_tm.cc index 776d2b3cf..3a413def3 100644 --- a/lib/src/upper/rlc_tm.cc +++ b/lib/src/rlc/rlc_tm.cc @@ -10,7 +10,7 @@ * */ -#include "srsran/upper/rlc_tm.h" +#include "srsran/rlc/rlc_tm.h" #include "srsran/common/common_lte.h" #include "srsran/interfaces/ue_pdcp_interfaces.h" #include "srsran/interfaces/ue_rrc_interfaces.h" diff --git a/lib/src/upper/rlc_um_base.cc b/lib/src/rlc/rlc_um_base.cc similarity index 99% rename from lib/src/upper/rlc_um_base.cc rename to lib/src/rlc/rlc_um_base.cc index 1ac0d183b..26ce85370 100644 --- a/lib/src/upper/rlc_um_base.cc +++ b/lib/src/rlc/rlc_um_base.cc @@ -10,7 +10,7 @@ * */ -#include "srsran/upper/rlc_um_base.h" +#include "srsran/rlc/rlc_um_base.h" #include "srsran/interfaces/ue_rrc_interfaces.h" #include diff --git a/lib/src/upper/rlc_um_lte.cc b/lib/src/rlc/rlc_um_lte.cc similarity index 99% rename from lib/src/upper/rlc_um_lte.cc rename to lib/src/rlc/rlc_um_lte.cc index 57d309daa..545b907ad 100644 --- a/lib/src/upper/rlc_um_lte.cc +++ b/lib/src/rlc/rlc_um_lte.cc @@ -10,7 +10,7 @@ * */ -#include "srsran/upper/rlc_um_lte.h" +#include "srsran/rlc/rlc_um_lte.h" #include "srsran/interfaces/ue_pdcp_interfaces.h" #include diff --git a/lib/src/upper/rlc_um_nr.cc b/lib/src/rlc/rlc_um_nr.cc similarity index 99% rename from lib/src/upper/rlc_um_nr.cc rename to lib/src/rlc/rlc_um_nr.cc index 32fc1948d..9ec8032ea 100644 --- a/lib/src/upper/rlc_um_nr.cc +++ b/lib/src/rlc/rlc_um_nr.cc @@ -10,7 +10,7 @@ * */ -#include "srsran/upper/rlc_um_nr.h" +#include "srsran/rlc/rlc_um_nr.h" #include "srsran/interfaces/ue_pdcp_interfaces.h" #include diff --git a/lib/src/upper/CMakeLists.txt b/lib/src/upper/CMakeLists.txt index c6b65ba10..d09f74c8f 100644 --- a/lib/src/upper/CMakeLists.txt +++ b/lib/src/upper/CMakeLists.txt @@ -10,16 +10,7 @@ set(SOURCES gtpu.cc pdcp.cc pdcp_entity_base.cc pdcp_entity_lte.cc - rlc.cc - rlc_tm.cc - rlc_um_base.cc - rlc_um_lte.cc - rlc_am_base.cc - rlc_am_lte.cc - pdcp_entity_nr.cc - rlc_um_nr.cc - rlc_am_nr.cc - bearer_mem_pool.cc) + pdcp_entity_nr.cc) add_library(srsran_upper STATIC ${SOURCES}) target_link_libraries(srsran_upper srsran_common srsran_asn1 ${ATOMIC_LIBS}) diff --git a/lib/test/rlc/CMakeLists.txt b/lib/test/rlc/CMakeLists.txt new file mode 100644 index 000000000..135a8f19b --- /dev/null +++ b/lib/test/rlc/CMakeLists.txt @@ -0,0 +1,64 @@ +# +# Copyright 2013-2021 Software Radio Systems Limited +# +# By using this file, you agree to the terms and conditions set +# forth in the LICENSE file which can be found at the top level of +# the distribution. +# + +set(CTEST_LABELS "lib;rlc") + +add_executable(rlc_am_data_test rlc_am_data_test.cc) +target_link_libraries(rlc_am_data_test srsran_upper srsran_phy srsran_common) +add_lte_test(rlc_am_data_test rlc_am_data_test) + +add_executable(rlc_am_control_test rlc_am_control_test.cc) +target_link_libraries(rlc_am_control_test srsran_upper srsran_phy) +add_lte_test(rlc_am_control_test rlc_am_control_test) + +add_executable(rlc_am_test rlc_am_test.cc) +target_link_libraries(rlc_am_test srsran_upper srsran_phy srsran_common) +add_lte_test(rlc_am_test rlc_am_test) + +add_executable(rlc_am_nr_pdu_test rlc_am_nr_pdu_test.cc) +target_link_libraries(rlc_am_nr_pdu_test srsran_upper srsran_phy) +add_nr_test(rlc_am_nr_pdu_test rlc_am_nr_pdu_test) + +add_executable(rlc_stress_test rlc_stress_test.cc) +target_link_libraries(rlc_stress_test srsran_upper srsran_mac srsran_phy srsran_common ${Boost_LIBRARIES} ${ATOMIC_LIBS}) +add_lte_test(rlc_am_stress_test rlc_stress_test --mode=AM --loglevel 1 --sdu_gen_delay 250) +add_lte_test(rlc_um_stress_test rlc_stress_test --mode=UM --loglevel 1) +add_lte_test(rlc_tm_stress_test rlc_stress_test --mode=TM --loglevel 1 --random_opp=false) + +add_nr_test(rlc_um6_nr_stress_test rlc_stress_test --rat NR --mode=UM6 --loglevel 1) +add_nr_test(rlc_um12_nr_stress_test rlc_stress_test --rat NR --mode=UM12 --loglevel 1) + +add_executable(rlc_um_data_test rlc_um_data_test.cc) +target_link_libraries(rlc_um_data_test srsran_upper srsran_phy srsran_common) +add_test(rlc_um_data_test rlc_um_data_test) + +add_executable(rlc_um_test rlc_um_test.cc) +target_link_libraries(rlc_um_test srsran_upper srsran_phy) +add_test(rlc_um_test rlc_um_test) + +add_executable(rlc_common_test rlc_common_test.cc) +target_link_libraries(rlc_common_test srsran_upper srsran_phy) +add_test(rlc_common_test rlc_common_test) + +add_executable(rlc_um_nr_pdu_test rlc_um_nr_pdu_test.cc) +target_link_libraries(rlc_um_nr_pdu_test srsran_upper srsran_mac srsran_phy) +add_nr_test(rlc_um_nr_pdu_test rlc_um_nr_pdu_test) + +add_executable(rlc_um_nr_test rlc_um_nr_test.cc) +target_link_libraries(rlc_um_nr_test srsran_upper srsran_phy) +add_nr_test(rlc_um_nr_test rlc_um_nr_test) + +######################################################################## +# Option to run command after build (useful for remote builds) +######################################################################## +if (NOT ${BUILD_CMD} STREQUAL "") + message(STATUS "Added custom post-build command: ${BUILD_CMD}") + add_custom_command(TARGET ip_test POST_BUILD COMMAND ${BUILD_CMD}) +else(NOT ${BUILD_CMD} STREQUAL "") + message(STATUS "No post-build command defined") +endif (NOT ${BUILD_CMD} STREQUAL "") diff --git a/lib/test/upper/rlc_am_control_test.cc b/lib/test/rlc/rlc_am_control_test.cc similarity index 100% rename from lib/test/upper/rlc_am_control_test.cc rename to lib/test/rlc/rlc_am_control_test.cc diff --git a/lib/test/upper/rlc_am_data_test.cc b/lib/test/rlc/rlc_am_data_test.cc similarity index 100% rename from lib/test/upper/rlc_am_data_test.cc rename to lib/test/rlc/rlc_am_data_test.cc diff --git a/lib/test/upper/rlc_am_nr_pdu_test.cc b/lib/test/rlc/rlc_am_nr_pdu_test.cc similarity index 100% rename from lib/test/upper/rlc_am_nr_pdu_test.cc rename to lib/test/rlc/rlc_am_nr_pdu_test.cc diff --git a/lib/test/upper/rlc_am_test.cc b/lib/test/rlc/rlc_am_test.cc similarity index 100% rename from lib/test/upper/rlc_am_test.cc rename to lib/test/rlc/rlc_am_test.cc diff --git a/lib/test/upper/rlc_common_test.cc b/lib/test/rlc/rlc_common_test.cc similarity index 100% rename from lib/test/upper/rlc_common_test.cc rename to lib/test/rlc/rlc_common_test.cc diff --git a/lib/test/upper/rlc_stress_test.cc b/lib/test/rlc/rlc_stress_test.cc similarity index 100% rename from lib/test/upper/rlc_stress_test.cc rename to lib/test/rlc/rlc_stress_test.cc diff --git a/lib/test/upper/rlc_test_common.h b/lib/test/rlc/rlc_test_common.h similarity index 100% rename from lib/test/upper/rlc_test_common.h rename to lib/test/rlc/rlc_test_common.h diff --git a/lib/test/upper/rlc_um_data_test.cc b/lib/test/rlc/rlc_um_data_test.cc similarity index 100% rename from lib/test/upper/rlc_um_data_test.cc rename to lib/test/rlc/rlc_um_data_test.cc diff --git a/lib/test/upper/rlc_um_nr_pdu_test.cc b/lib/test/rlc/rlc_um_nr_pdu_test.cc similarity index 100% rename from lib/test/upper/rlc_um_nr_pdu_test.cc rename to lib/test/rlc/rlc_um_nr_pdu_test.cc diff --git a/lib/test/upper/rlc_um_nr_test.cc b/lib/test/rlc/rlc_um_nr_test.cc similarity index 100% rename from lib/test/upper/rlc_um_nr_test.cc rename to lib/test/rlc/rlc_um_nr_test.cc diff --git a/lib/test/upper/rlc_um_test.cc b/lib/test/rlc/rlc_um_test.cc similarity index 100% rename from lib/test/upper/rlc_um_test.cc rename to lib/test/rlc/rlc_um_test.cc diff --git a/lib/test/upper/CMakeLists.txt b/lib/test/upper/CMakeLists.txt index b17495db8..f0cb9272a 100644 --- a/lib/test/upper/CMakeLists.txt +++ b/lib/test/upper/CMakeLists.txt @@ -8,51 +8,6 @@ set(CTEST_LABELS "lib;upper") -add_executable(rlc_am_data_test rlc_am_data_test.cc) -target_link_libraries(rlc_am_data_test srsran_upper srsran_phy srsran_common) -add_lte_test(rlc_am_data_test rlc_am_data_test) - -add_executable(rlc_am_control_test rlc_am_control_test.cc) -target_link_libraries(rlc_am_control_test srsran_upper srsran_phy) -add_lte_test(rlc_am_control_test rlc_am_control_test) - -add_executable(rlc_am_test rlc_am_test.cc) -target_link_libraries(rlc_am_test srsran_upper srsran_phy srsran_common) -add_lte_test(rlc_am_test rlc_am_test) - -add_executable(rlc_am_nr_pdu_test rlc_am_nr_pdu_test.cc) -target_link_libraries(rlc_am_nr_pdu_test srsran_upper srsran_phy) -add_nr_test(rlc_am_nr_pdu_test rlc_am_nr_pdu_test) - -add_executable(rlc_stress_test rlc_stress_test.cc) -target_link_libraries(rlc_stress_test srsran_upper srsran_mac srsran_phy srsran_common ${Boost_LIBRARIES} ${ATOMIC_LIBS}) -add_lte_test(rlc_am_stress_test rlc_stress_test --mode=AM --loglevel 1 --sdu_gen_delay 250) -add_lte_test(rlc_um_stress_test rlc_stress_test --mode=UM --loglevel 1) -add_lte_test(rlc_tm_stress_test rlc_stress_test --mode=TM --loglevel 1 --random_opp=false) - -add_nr_test(rlc_um6_nr_stress_test rlc_stress_test --rat NR --mode=UM6 --loglevel 1) -add_nr_test(rlc_um12_nr_stress_test rlc_stress_test --rat NR --mode=UM12 --loglevel 1) - -add_executable(rlc_um_data_test rlc_um_data_test.cc) -target_link_libraries(rlc_um_data_test srsran_upper srsran_phy srsran_common) -add_test(rlc_um_data_test rlc_um_data_test) - -add_executable(rlc_um_test rlc_um_test.cc) -target_link_libraries(rlc_um_test srsran_upper srsran_phy) -add_test(rlc_um_test rlc_um_test) - -add_executable(rlc_common_test rlc_common_test.cc) -target_link_libraries(rlc_common_test srsran_upper srsran_phy) -add_test(rlc_common_test rlc_common_test) - -add_executable(rlc_um_nr_pdu_test rlc_um_nr_pdu_test.cc) -target_link_libraries(rlc_um_nr_pdu_test srsran_upper srsran_mac srsran_phy) -add_nr_test(rlc_um_nr_pdu_test rlc_um_nr_pdu_test) - -add_executable(rlc_um_nr_test rlc_um_nr_test.cc) -target_link_libraries(rlc_um_nr_test srsran_upper srsran_phy) -add_nr_test(rlc_um_nr_test rlc_um_nr_test) - add_executable(pdcp_nr_test_tx pdcp_nr_test_tx.cc) target_link_libraries(pdcp_nr_test_tx srsran_upper srsran_common) add_nr_test(pdcp_nr_test_tx pdcp_nr_test_tx) diff --git a/srsenb/hdr/stack/upper/rlc.h b/srsenb/hdr/stack/upper/rlc.h index 30fdc2875..a635de684 100644 --- a/srsenb/hdr/stack/upper/rlc.h +++ b/srsenb/hdr/stack/upper/rlc.h @@ -14,8 +14,8 @@ #include "srsran/interfaces/enb_metrics_interface.h" #include "srsran/interfaces/enb_rlc_interfaces.h" #include "srsran/interfaces/ue_interfaces.h" +#include "srsran/rlc/rlc.h" #include "srsran/srslog/srslog.h" -#include "srsran/upper/rlc.h" #include #ifndef SRSENB_RLC_H diff --git a/srsenb/hdr/stack/upper/rlc_nr.h b/srsenb/hdr/stack/upper/rlc_nr.h index 5e72e6382..4a1fa424a 100644 --- a/srsenb/hdr/stack/upper/rlc_nr.h +++ b/srsenb/hdr/stack/upper/rlc_nr.h @@ -14,7 +14,7 @@ #define SRSENB_RLC_NR_H #include "srsran/interfaces/gnb_interfaces.h" -#include "srsran/upper/rlc.h" +#include "srsran/rlc/rlc.h" #include namespace srsenb { diff --git a/srsenb/src/CMakeLists.txt b/srsenb/src/CMakeLists.txt index 98776f739..7f8a9895d 100644 --- a/srsenb/src/CMakeLists.txt +++ b/srsenb/src/CMakeLists.txt @@ -27,7 +27,7 @@ target_link_libraries(enb_cfg_parser ${LIBCONFIGPP_LIBRARIES}) add_executable(srsenb main.cc enb.cc metrics_stdout.cc metrics_csv.cc metrics_json.cc) set(SRSENB_SOURCES srsenb_phy srsenb_stack srsenb_common srsenb_s1ap srsenb_upper srsenb_mac srsenb_rrc srslog system) -set(SRSRAN_SOURCES srsran_common srsran_mac srsran_phy srsran_upper srsran_radio rrc_asn1 s1ap_asn1 enb_cfg_parser srslog system) +set(SRSRAN_SOURCES srsran_common srsran_mac srsran_phy srsran_upper srsran_rlc srsran_radio rrc_asn1 s1ap_asn1 enb_cfg_parser srslog system) set(SRSENB_SOURCES ${SRSENB_SOURCES} srsgnb_phy srsgnb_stack srsgnb_ngap srsgnb_upper srsgnb_mac srsgnb_rrc) set(SRSRAN_SOURCES ${SRSRAN_SOURCES} rrc_nr_asn1 ngap_nr_asn1) diff --git a/srsenb/src/common/rnti_pool.cc b/srsenb/src/common/rnti_pool.cc index 4c62932a9..6b2804876 100644 --- a/srsenb/src/common/rnti_pool.cc +++ b/srsenb/src/common/rnti_pool.cc @@ -16,8 +16,8 @@ #include "srsenb/hdr/stack/rrc/rrc_mobility.h" #include "srsenb/hdr/stack/rrc/rrc_ue.h" #include "srsran/adt/pool/circular_stack_pool.h" +#include "srsran/rlc/rlc.h" #include "srsran/upper/pdcp.h" -#include "srsran/upper/rlc.h" namespace srsenb { diff --git a/srsenb/src/stack/enb_stack_lte.cc b/srsenb/src/stack/enb_stack_lte.cc index 84cb4997b..e8918fb77 100644 --- a/srsenb/src/stack/enb_stack_lte.cc +++ b/srsenb/src/stack/enb_stack_lte.cc @@ -14,8 +14,8 @@ #include "srsenb/hdr/common/rnti_pool.h" #include "srsenb/hdr/enb.h" #include "srsran/interfaces/enb_metrics_interface.h" +#include "srsran/rlc/bearer_mem_pool.h" #include "srsran/srslog/event_trace.h" -#include "srsran/upper/bearer_mem_pool.h" using namespace srsran; diff --git a/srsue/hdr/stack/ue_stack_lte.h b/srsue/hdr/stack/ue_stack_lte.h index 4f9d5f1b2..b3916b913 100644 --- a/srsue/hdr/stack/ue_stack_lte.h +++ b/srsue/hdr/stack/ue_stack_lte.h @@ -26,8 +26,8 @@ #include "mac_nr/mac_nr.h" #include "rrc/rrc.h" #include "srsran/radio/radio.h" +#include "srsran/rlc/rlc.h" #include "srsran/upper/pdcp.h" -#include "srsran/upper/rlc.h" #include "upper/nas.h" #include "upper/usim.h" diff --git a/srsue/hdr/stack/ue_stack_nr.h b/srsue/hdr/stack/ue_stack_nr.h index 6e5189c81..c3704c7c3 100644 --- a/srsue/hdr/stack/ue_stack_nr.h +++ b/srsue/hdr/stack/ue_stack_nr.h @@ -21,8 +21,8 @@ #include "mac_nr/mac_nr.h" #include "rrc/rrc_nr.h" #include "srsran/radio/radio.h" +#include "srsran/rlc/rlc.h" #include "srsran/upper/pdcp.h" -#include "srsran/upper/rlc.h" #include "upper/nas.h" #include "upper/usim.h" diff --git a/srsue/hdr/ue_metrics_interface.h b/srsue/hdr/ue_metrics_interface.h index 43bca5f5f..7a42cc3f1 100644 --- a/srsue/hdr/ue_metrics_interface.h +++ b/srsue/hdr/ue_metrics_interface.h @@ -18,8 +18,8 @@ #include "phy/phy_metrics.h" #include "srsran/common/metrics_hub.h" #include "srsran/radio/radio_metrics.h" +#include "srsran/rlc/rlc_metrics.h" #include "srsran/system/sys_metrics.h" -#include "srsran/upper/rlc_metrics.h" #include "stack/mac/mac_metrics.h" #include "stack/rrc/rrc_metrics.h" #include "stack/upper/gw_metrics.h" diff --git a/srsue/src/CMakeLists.txt b/srsue/src/CMakeLists.txt index 1bd3e1725..83eec18c8 100644 --- a/srsue/src/CMakeLists.txt +++ b/srsue/src/CMakeLists.txt @@ -22,7 +22,7 @@ endif (RPATH) add_executable(srsue main.cc ue.cc metrics_stdout.cc metrics_csv.cc metrics_json.cc) set(SRSUE_SOURCES srsue_phy srsue_stack srsue_upper srsue_mac srsue_rrc srslog system) -set(SRSRAN_SOURCES srsran_common srsran_mac srsran_phy srsran_radio srsran_upper rrc_asn1 srslog system) +set(SRSRAN_SOURCES srsran_common srsran_mac srsran_phy srsran_radio srsran_upper srsran_rlc rrc_asn1 srslog system) set(SRSUE_SOURCES ${SRSUE_SOURCES} srsue_nr_stack srsue_rrc_nr srsue_mac_nr) set(SRSRAN_SOURCES ${SRSRAN_SOURCES} rrc_nr_asn1 ngap_nr_asn1) diff --git a/srsue/src/test/ttcn3/hdr/ttcn3_syssim.h b/srsue/src/test/ttcn3/hdr/ttcn3_syssim.h index 7de69a831..029f41dd9 100644 --- a/srsue/src/test/ttcn3/hdr/ttcn3_syssim.h +++ b/srsue/src/test/ttcn3/hdr/ttcn3_syssim.h @@ -14,9 +14,9 @@ #define SRSUE_TTCN3_SYSSIM_H #include "srsran/mac/pdu_queue.h" +#include "srsran/rlc/rlc.h" #include "srsran/test/ue_test_interfaces.h" #include "srsran/upper/pdcp.h" -#include "srsran/upper/rlc.h" #include "ttcn3_common.h" #include "ttcn3_drb_interface.h" #include "ttcn3_ip_ctrl_interface.h" diff --git a/srsue/src/test/ttcn3/src/CMakeLists.txt b/srsue/src/test/ttcn3/src/CMakeLists.txt index 6fc2619c6..9a53ad440 100644 --- a/srsue/src/test/ttcn3/src/CMakeLists.txt +++ b/srsue/src/test/ttcn3/src/CMakeLists.txt @@ -14,6 +14,7 @@ set(LINK_LIBRARIES srsue_stack srsue_rrc srsue_rrc_nr srsran_upper + srsran_rlc srsran_common srsran_mac srsran_phy diff --git a/srsue/src/test/ttcn3/src/ttcn3_syssim.cc b/srsue/src/test/ttcn3/src/ttcn3_syssim.cc index ab6c51fe3..698411149 100644 --- a/srsue/src/test/ttcn3/src/ttcn3_syssim.cc +++ b/srsue/src/test/ttcn3/src/ttcn3_syssim.cc @@ -13,10 +13,10 @@ #include "ttcn3_syssim.h" #include "dut_utils.h" #include "srsran/mac/pdu_queue.h" +#include "srsran/rlc/rlc.h" #include "srsran/srslog/srslog.h" #include "srsran/test/ue_test_interfaces.h" #include "srsran/upper/pdcp.h" -#include "srsran/upper/rlc.h" #include "swappable_sink.h" #include "ttcn3_common.h" #include "ttcn3_drb_interface.h"