From f99e841421b07d21eb397b59081e6670cd7285fb Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Wed, 10 Nov 2021 17:31:56 +0000 Subject: [PATCH] Changed using a rlc_am_lte and rlc_am_nr entity, to a single rlc_am entity. --- lib/include/srsran/rlc/rlc_am_base.h | 19 +- lib/include/srsran/rlc/rlc_am_lte.h | 326 +++++++++++++-------------- lib/include/srsran/rlc/rlc_am_nr.h | 154 ++++++------- lib/src/rlc/bearer_mem_pool.cc | 5 +- lib/src/rlc/rlc.cc | 2 +- lib/src/rlc/rlc_am_base.cc | 20 ++ lib/src/rlc/rlc_am_lte.cc | 122 +++++----- lib/src/rlc/rlc_am_nr.cc | 47 ++-- lib/test/rlc/rlc_am_lte_test.cc | 118 +++++----- lib/test/rlc/rlc_am_nr_test.cc | 6 +- 10 files changed, 402 insertions(+), 417 deletions(-) diff --git a/lib/include/srsran/rlc/rlc_am_base.h b/lib/include/srsran/rlc/rlc_am_base.h index e76cd7523..9d11c64b0 100644 --- a/lib/include/srsran/rlc/rlc_am_base.h +++ b/lib/include/srsran/rlc/rlc_am_base.h @@ -43,20 +43,21 @@ bool rlc_am_is_control_pdu(byte_buffer_t* pdu); *******************************************************/ class rlc_am : public rlc_common { -protected: +public: class rlc_am_base_tx; class rlc_am_base_rx; -public: - rlc_am(srslog::basic_logger& logger, + friend class rlc_am_lte_tx; + friend class rlc_am_lte_rx; + friend class rlc_am_nr_tx; + friend class rlc_am_nr_rx; + + rlc_am(srsran_rat_t rat, + srslog::basic_logger& logger, uint32_t lcid_, srsue::pdcp_interface_rlc* pdcp_, srsue::rrc_interface_rlc* rrc_, - srsran::timer_handler* timers_, - rlc_am_base_tx* tx_base_, - rlc_am_base_rx* rx_base_) : - logger(logger), rrc(rrc_), pdcp(pdcp_), timers(timers_), lcid(lcid_), tx_base(tx_base_), rx_base(rx_base_) - {} + srsran::timer_handler* timers_); bool configure(const rlc_config_t& cfg_) final; @@ -122,6 +123,7 @@ protected: * This class is used for common code between the * LTE and NR TX entitites *******************************************************/ +public: class rlc_am_base_tx { public: @@ -181,6 +183,7 @@ protected: rlc_am* parent = nullptr; }; +protected: std::unique_ptr tx_base = {}; std::unique_ptr rx_base = {}; }; diff --git a/lib/include/srsran/rlc/rlc_am_lte.h b/lib/include/srsran/rlc/rlc_am_lte.h index 99fd4ca04..82c42afd7 100644 --- a/lib/include/srsran/rlc/rlc_am_lte.h +++ b/lib/include/srsran/rlc/rlc_am_lte.h @@ -85,201 +85,191 @@ private: * RLC AM LTE entity * *****************************/ -class rlc_am_lte : public rlc_am + +/****************************** + * RLC AM LTE TX entity + *****************************/ +class rlc_am_lte_tx; +class rlc_am_lte_rx; +class rlc_am_lte_tx : public rlc_am::rlc_am_base_tx, timer_callback { public: - rlc_am_lte(srslog::basic_logger& logger, - uint32_t lcid_, - srsue::pdcp_interface_rlc* pdcp_, - srsue::rrc_interface_rlc* rrc_, - srsran::timer_handler* timers_); - - class rlc_am_lte_tx; - class rlc_am_lte_rx; - - /****************************** - * RLC AM LTE TX entity - *****************************/ - class rlc_am_lte_tx : public rlc_am_base_tx, timer_callback - { - public: - explicit rlc_am_lte_tx(rlc_am_lte* parent_); - ~rlc_am_lte_tx() = default; + explicit rlc_am_lte_tx(rlc_am* parent_); + ~rlc_am_lte_tx() = default; - bool configure(const rlc_config_t& cfg_); - void empty_queue(); - void reestablish(); - void stop(); + bool configure(const rlc_config_t& cfg_); + void empty_queue(); + void reestablish(); + void stop(); - uint32_t read_pdu(uint8_t* payload, uint32_t nof_bytes); - void discard_sdu(uint32_t discard_sn); - bool sdu_queue_is_full(); + uint32_t read_pdu(uint8_t* payload, uint32_t nof_bytes); + void discard_sdu(uint32_t discard_sn); + bool sdu_queue_is_full(); - bool has_data(); - uint32_t get_buffer_state(); - void get_buffer_state(uint32_t& n_bytes_newtx, uint32_t& n_bytes_prio); + bool has_data(); + uint32_t get_buffer_state(); + void get_buffer_state(uint32_t& n_bytes_newtx, uint32_t& n_bytes_prio); - void empty_queue_nolock(); - void debug_state(); + void empty_queue_nolock(); + void debug_state(); - // Timeout callback interface - void timer_expired(uint32_t timeout_id) final; + // Timeout callback interface + void timer_expired(uint32_t timeout_id) final; - // Interface for Rx subclass - void handle_control_pdu(uint8_t* payload, uint32_t nof_bytes); + // Interface for Rx subclass + void handle_control_pdu(uint8_t* payload, uint32_t nof_bytes); - private: - void stop_nolock(); +private: + void stop_nolock(); - int build_status_pdu(uint8_t* payload, uint32_t nof_bytes); - int build_retx_pdu(uint8_t* payload, uint32_t nof_bytes); - int build_segment(uint8_t* payload, uint32_t nof_bytes, rlc_amd_retx_t retx); - int build_data_pdu(uint8_t* payload, uint32_t nof_bytes); - void update_notification_ack_info(uint32_t rlc_sn); + int build_status_pdu(uint8_t* payload, uint32_t nof_bytes); + int build_retx_pdu(uint8_t* payload, uint32_t nof_bytes); + int build_segment(uint8_t* payload, uint32_t nof_bytes, rlc_amd_retx_t retx); + int build_data_pdu(uint8_t* payload, uint32_t nof_bytes); + void update_notification_ack_info(uint32_t rlc_sn); - int required_buffer_size(const rlc_amd_retx_t& retx); - void retransmit_pdu(uint32_t sn); + int required_buffer_size(const rlc_amd_retx_t& retx); + void retransmit_pdu(uint32_t sn); - // Helpers - bool poll_required(); - bool do_status(); - void check_sn_reached_max_retx(uint32_t sn); - void get_buffer_state_nolock(uint32_t& new_tx, uint32_t& prio_tx); + // Helpers + bool poll_required(); + bool do_status(); + void check_sn_reached_max_retx(uint32_t sn); + void get_buffer_state_nolock(uint32_t& new_tx, uint32_t& prio_tx); - rlc_am_lte* parent = nullptr; - rlc_am_lte_rx* rx = nullptr; - byte_buffer_pool* pool = nullptr; - rlc_am_pdu_segment_pool segment_pool; + rlc_am* parent = nullptr; + rlc_am_lte_rx* rx = nullptr; + byte_buffer_pool* pool = nullptr; + rlc_am_pdu_segment_pool segment_pool; - /**************************************************************************** - * Configurable parameters - * Ref: 3GPP TS 36.322 v10.0.0 Section 7 - ***************************************************************************/ + /**************************************************************************** + * Configurable parameters + * Ref: 3GPP TS 36.322 v10.0.0 Section 7 + ***************************************************************************/ - rlc_am_config_t cfg = {}; + rlc_am_config_t cfg = {}; - // TX SDU buffers - unique_byte_buffer_t tx_sdu; + // TX SDU buffers + unique_byte_buffer_t tx_sdu; - /**************************************************************************** - * State variables and counters - * Ref: 3GPP TS 36.322 v10.0.0 Section 7 - ***************************************************************************/ + /**************************************************************************** + * State variables and counters + * Ref: 3GPP TS 36.322 v10.0.0 Section 7 + ***************************************************************************/ - // Tx state variables - uint32_t vt_a = 0; // ACK state. SN of next PDU in sequence to be ACKed. Low edge of tx window. - uint32_t vt_ms = RLC_AM_WINDOW_SIZE; // Max send state. High edge of tx window. vt_a + window_size. - uint32_t vt_s = 0; // Send state. SN to be assigned for next PDU. - uint32_t poll_sn = 0; // Poll send state. SN of most recent PDU txed with poll bit set. + // Tx state variables + uint32_t vt_a = 0; // ACK state. SN of next PDU in sequence to be ACKed. Low edge of tx window. + uint32_t vt_ms = RLC_AM_WINDOW_SIZE; // Max send state. High edge of tx window. vt_a + window_size. + uint32_t vt_s = 0; // Send state. SN to be assigned for next PDU. + uint32_t poll_sn = 0; // Poll send state. SN of most recent PDU txed with poll bit set. - // Tx counters - uint32_t pdu_without_poll = 0; - uint32_t byte_without_poll = 0; + // Tx counters + uint32_t pdu_without_poll = 0; + uint32_t byte_without_poll = 0; - rlc_status_pdu_t tx_status; + rlc_status_pdu_t tx_status; - /**************************************************************************** - * Timers - * Ref: 3GPP TS 36.322 v10.0.0 Section 7 - ***************************************************************************/ + /**************************************************************************** + * Timers + * Ref: 3GPP TS 36.322 v10.0.0 Section 7 + ***************************************************************************/ - srsran::timer_handler::unique_timer poll_retx_timer; - srsran::timer_handler::unique_timer status_prohibit_timer; + srsran::timer_handler::unique_timer poll_retx_timer; + srsran::timer_handler::unique_timer status_prohibit_timer; - // SDU info for PDCP notifications - buffered_pdcp_pdu_list undelivered_sdu_info_queue; + // SDU info for PDCP notifications + buffered_pdcp_pdu_list undelivered_sdu_info_queue; - // Tx windows - rlc_ringbuffer_t, RLC_AM_WINDOW_SIZE> tx_window; - pdu_retx_queue retx_queue; - pdcp_sn_vector_t notify_info_vec; + // Tx windows + rlc_ringbuffer_t, RLC_AM_WINDOW_SIZE> tx_window; + pdu_retx_queue retx_queue; + pdcp_sn_vector_t notify_info_vec; - // Mutexes - std::mutex mutex; + // Mutexes + std::mutex mutex; - // default to RLC SDU queue length - const uint32_t MAX_SDUS_PER_RLC_PDU = RLC_TX_QUEUE_LEN; - }; + // default to RLC SDU queue length + const uint32_t MAX_SDUS_PER_RLC_PDU = RLC_TX_QUEUE_LEN; +}; - /****************************** - * RLC AM LTE RX entity - *****************************/ - class rlc_am_lte_rx : public rlc_am_base_rx, public timer_callback - { - public: - rlc_am_lte_rx(rlc_am_lte* parent_); - ~rlc_am_lte_rx(); - - bool configure(const rlc_config_t& cfg_) final; - void reestablish() final; - void stop() final; - - uint32_t get_rx_buffered_bytes() final; // returns sum of PDUs in rx_window - uint32_t get_sdu_rx_latency_ms() final; - - // Timeout callback interface - void timer_expired(uint32_t timeout_id) final; - - // Functions needed by Tx subclass to query rx state - int get_status_pdu_length(); - int get_status_pdu(rlc_status_pdu_t* status, uint32_t nof_bytes); - bool get_do_status(); - - private: - void handle_data_pdu(uint8_t* payload, uint32_t nof_bytes) final; - void handle_data_pdu_full(uint8_t* payload, uint32_t nof_bytes, rlc_amd_pdu_header_t& header); - void handle_data_pdu_segment(uint8_t* payload, uint32_t nof_bytes, rlc_amd_pdu_header_t& header); - void reassemble_rx_sdus(); - bool inside_rx_window(const int16_t sn); - void debug_state(); - void print_rx_segments(); - bool add_segment_and_check(rlc_amd_rx_pdu_segments_t* pdu, rlc_amd_rx_pdu* segment); - void reset_status(); - - rlc_am_lte* parent = nullptr; - rlc_am_lte_tx* tx = nullptr; - byte_buffer_pool* pool = nullptr; - - /**************************************************************************** - * Configurable parameters - * Ref: 3GPP TS 36.322 v10.0.0 Section 7 - ***************************************************************************/ - rlc_am_config_t cfg = {}; - - // RX SDU buffers - unique_byte_buffer_t rx_sdu; - - /**************************************************************************** - * State variables and counters - * Ref: 3GPP TS 36.322 v10.0.0 Section 7 - ***************************************************************************/ - - // Rx state variables - uint32_t vr_r = 0; // Receive state. SN following last in-sequence received PDU. Low edge of rx window - uint32_t vr_mr = RLC_AM_WINDOW_SIZE; // Max acceptable receive state. High edge of rx window. vr_r + window size. - uint32_t vr_x = 0; // t_reordering state. SN following PDU which triggered t_reordering. - uint32_t vr_ms = 0; // Max status tx state. Highest possible value of SN for ACK_SN in status PDU. - uint32_t vr_h = 0; // Highest rx state. SN following PDU with highest SN among rxed PDUs. - - // Mutex to protect members - std::mutex mutex; - - // Rx windows - rlc_ringbuffer_t rx_window; - std::map rx_segments; - - bool poll_received = false; - std::atomic do_status = {false}; // light-weight access from Tx entity - - /**************************************************************************** - * Timers - * Ref: 3GPP TS 36.322 v10.0.0 Section 7 - ***************************************************************************/ - - srsran::timer_handler::unique_timer reordering_timer; - - srsran::rolling_average sdu_rx_latency_ms; - }; +/****************************** + * RLC AM LTE RX entity + *****************************/ +class rlc_am_lte_rx : public rlc_am::rlc_am_base_rx, public timer_callback +{ +public: + rlc_am_lte_rx(rlc_am* parent_); + ~rlc_am_lte_rx(); + + bool configure(const rlc_config_t& cfg_) final; + void reestablish() final; + void stop() final; + + uint32_t get_rx_buffered_bytes() final; // returns sum of PDUs in rx_window + uint32_t get_sdu_rx_latency_ms() final; + + // Timeout callback interface + void timer_expired(uint32_t timeout_id) final; + + // Functions needed by Tx subclass to query rx state + int get_status_pdu_length(); + int get_status_pdu(rlc_status_pdu_t* status, uint32_t nof_bytes); + bool get_do_status(); + +private: + void handle_data_pdu(uint8_t* payload, uint32_t nof_bytes) final; + void handle_data_pdu_full(uint8_t* payload, uint32_t nof_bytes, rlc_amd_pdu_header_t& header); + void handle_data_pdu_segment(uint8_t* payload, uint32_t nof_bytes, rlc_amd_pdu_header_t& header); + void reassemble_rx_sdus(); + bool inside_rx_window(const int16_t sn); + void debug_state(); + void print_rx_segments(); + bool add_segment_and_check(rlc_amd_rx_pdu_segments_t* pdu, rlc_amd_rx_pdu* segment); + void reset_status(); + + rlc_am* parent = nullptr; + rlc_am_lte_tx* tx = nullptr; + byte_buffer_pool* pool = nullptr; + + /**************************************************************************** + * Configurable parameters + * Ref: 3GPP TS 36.322 v10.0.0 Section 7 + ***************************************************************************/ + rlc_am_config_t cfg = {}; + + // RX SDU buffers + unique_byte_buffer_t rx_sdu; + + /**************************************************************************** + * State variables and counters + * Ref: 3GPP TS 36.322 v10.0.0 Section 7 + ***************************************************************************/ + + // Rx state variables + uint32_t vr_r = 0; // Receive state. SN following last in-sequence received PDU. Low edge of rx window + uint32_t vr_mr = RLC_AM_WINDOW_SIZE; // Max acceptable receive state. High edge of rx window. vr_r + window size. + uint32_t vr_x = 0; // t_reordering state. SN following PDU which triggered t_reordering. + uint32_t vr_ms = 0; // Max status tx state. Highest possible value of SN for ACK_SN in status PDU. + uint32_t vr_h = 0; // Highest rx state. SN following PDU with highest SN among rxed PDUs. + + // Mutex to protect members + std::mutex mutex; + + // Rx windows + rlc_ringbuffer_t rx_window; + std::map rx_segments; + + bool poll_received = false; + std::atomic do_status = {false}; // light-weight access from Tx entity + + /**************************************************************************** + * Timers + * Ref: 3GPP TS 36.322 v10.0.0 Section 7 + ***************************************************************************/ + + srsran::timer_handler::unique_timer reordering_timer; + + srsran::rolling_average sdu_rx_latency_ms; }; } // namespace srsran diff --git a/lib/include/srsran/rlc/rlc_am_nr.h b/lib/include/srsran/rlc/rlc_am_nr.h index 31316bf8e..ef1dae4fa 100644 --- a/lib/include/srsran/rlc/rlc_am_nr.h +++ b/lib/include/srsran/rlc/rlc_am_nr.h @@ -32,94 +32,80 @@ namespace srsran { * RLC AM NR entity * *****************************/ -class rlc_am_nr : public rlc_am +// Transmitter sub-class +class rlc_am_nr_tx : public rlc_am::rlc_am_base_tx { public: - rlc_am_nr(srslog::basic_logger& logger, - uint32_t lcid_, - srsue::pdcp_interface_rlc* pdcp_, - srsue::rrc_interface_rlc* rrc_, - srsran::timer_handler* timers_); - - // Transmitter sub-class - class rlc_am_nr_tx : public rlc_am_base_tx - { - public: - explicit rlc_am_nr_tx(rlc_am_nr* parent_); - ~rlc_am_nr_tx() = default; - - bool configure(const rlc_config_t& cfg_) final; - uint32_t read_pdu(uint8_t* payload, uint32_t nof_bytes) final; - void handle_control_pdu(uint8_t* payload, uint32_t nof_bytes) final; - - void discard_sdu(uint32_t discard_sn) final; - bool sdu_queue_is_full() final; - void reestablish() final; - - int write_sdu(unique_byte_buffer_t sdu); - void empty_queue() final; - bool has_data() final; - uint32_t get_buffer_state() final; - void get_buffer_state(uint32_t& tx_queue, uint32_t& prio_tx_queue); - - void stop() final; - - private: - rlc_am_nr* parent = nullptr; - - /**************************************************************************** - * Configurable parameters - * Ref: 3GPP TS 38.322 v10.0.0 Section 7.4 - ***************************************************************************/ - rlc_am_config_t cfg = {}; - - /**************************************************************************** - * Tx state variables - * Ref: 3GPP TS 38.322 v10.0.0 Section 7.1 - ***************************************************************************/ - struct rlc_nr_tx_state_t { - uint32_t tx_next_ack; - uint32_t tx_next; - uint32_t poll_sn; - uint32_t pdu_without_poll; - uint32_t byte_without_poll; - } st = {}; - - using rlc_amd_tx_pdu_nr = rlc_amd_tx_pdu; - rlc_ringbuffer_t tx_window; - }; - - // Receiver sub-class - class rlc_am_nr_rx : public rlc_am_base_rx - { - public: - explicit rlc_am_nr_rx(rlc_am_nr* parent_); - ~rlc_am_nr_rx() = default; - - bool configure(const rlc_config_t& cfg_) final; - - void handle_data_pdu(uint8_t* payload, uint32_t nof_bytes) final; - - void stop(); - void reestablish(); - - uint32_t get_sdu_rx_latency_ms(); - uint32_t get_rx_buffered_bytes(); - - private: - rlc_am_nr* parent = nullptr; - byte_buffer_pool* pool = nullptr; - - /**************************************************************************** - * Configurable parameters - * Ref: 3GPP TS 38.322 v10.0.0 Section 7.4 - ***************************************************************************/ - rlc_am_config_t cfg = {}; - }; + explicit rlc_am_nr_tx(rlc_am* parent_); + ~rlc_am_nr_tx() = default; + + bool configure(const rlc_config_t& cfg_) final; + uint32_t read_pdu(uint8_t* payload, uint32_t nof_bytes) final; + void handle_control_pdu(uint8_t* payload, uint32_t nof_bytes) final; + + void discard_sdu(uint32_t discard_sn) final; + bool sdu_queue_is_full() final; + void reestablish() final; + + int write_sdu(unique_byte_buffer_t sdu); + void empty_queue() final; + bool has_data() final; + uint32_t get_buffer_state() final; + void get_buffer_state(uint32_t& tx_queue, uint32_t& prio_tx_queue); + + void stop() final; + +private: + rlc_am* parent = nullptr; + + /**************************************************************************** + * Configurable parameters + * Ref: 3GPP TS 38.322 v10.0.0 Section 7.4 + ***************************************************************************/ + rlc_am_config_t cfg = {}; + + /**************************************************************************** + * Tx state variables + * Ref: 3GPP TS 38.322 v10.0.0 Section 7.1 + ***************************************************************************/ + struct rlc_nr_tx_state_t { + uint32_t tx_next_ack; + uint32_t tx_next; + uint32_t poll_sn; + uint32_t pdu_without_poll; + uint32_t byte_without_poll; + } st = {}; + + using rlc_amd_tx_pdu_nr = rlc_amd_tx_pdu; + rlc_ringbuffer_t tx_window; +}; + +// Receiver sub-class +class rlc_am_nr_rx : public rlc_am::rlc_am_base_rx +{ +public: + explicit rlc_am_nr_rx(rlc_am* parent_); + ~rlc_am_nr_rx() = default; + + bool configure(const rlc_config_t& cfg_) final; + + void handle_data_pdu(uint8_t* payload, uint32_t nof_bytes) final; + + void stop(); + void reestablish(); + + uint32_t get_sdu_rx_latency_ms(); + uint32_t get_rx_buffered_bytes(); private: - rlc_am_nr_tx* tx = nullptr; - rlc_am_nr_rx* rx = nullptr; + rlc_am* parent = nullptr; + byte_buffer_pool* pool = nullptr; + + /**************************************************************************** + * Configurable parameters + * Ref: 3GPP TS 38.322 v10.0.0 Section 7.4 + ***************************************************************************/ + rlc_am_config_t cfg = {}; }; } // namespace srsran diff --git a/lib/src/rlc/bearer_mem_pool.cc b/lib/src/rlc/bearer_mem_pool.cc index 1c6fc9aeb..e23feda6f 100644 --- a/lib/src/rlc/bearer_mem_pool.cc +++ b/lib/src/rlc/bearer_mem_pool.cc @@ -24,9 +24,8 @@ srsran::background_mem_pool* get_bearer_pool() { static background_mem_pool pool( 4, - std::max( - std::max(std::max(std::max(sizeof(rlc_am_lte), sizeof(rlc_am_nr)), sizeof(rlc_um_lte)), sizeof(rlc_um_nr)), - sizeof(rlc_tm)), + std::max(std::max(std::max(std::max(sizeof(rlc_am), sizeof(rlc_am)), sizeof(rlc_um_lte)), sizeof(rlc_um_nr)), + sizeof(rlc_tm)), 8, 8); return &pool; diff --git a/lib/src/rlc/rlc.cc b/lib/src/rlc/rlc.cc index f0243882e..46ce05ee8 100644 --- a/lib/src/rlc/rlc.cc +++ b/lib/src/rlc/rlc.cc @@ -396,7 +396,7 @@ int rlc::add_bearer(uint32_t lcid, const rlc_config_t& cnfg) case rlc_mode_t::am: switch (cnfg.rat) { case srsran_rat_t::lte: - rlc_entity = std::unique_ptr(new rlc_am_lte(logger, lcid, pdcp, rrc, timers)); + rlc_entity = std::unique_ptr(new rlc_am(cnfg.rat, logger, lcid, pdcp, rrc, timers)); break; default: logger.error("AM not supported for this RAT"); diff --git a/lib/src/rlc/rlc_am_base.cc b/lib/src/rlc/rlc_am_base.cc index a8f0ba8ad..da339d39e 100644 --- a/lib/src/rlc/rlc_am_base.cc +++ b/lib/src/rlc/rlc_am_base.cc @@ -11,6 +11,8 @@ */ #include "srsran/rlc/rlc_am_base.h" +#include "srsran/rlc/rlc_am_lte.h" +#include "srsran/rlc/rlc_am_nr.h" #include namespace srsran { @@ -30,6 +32,24 @@ bool rlc_am_is_control_pdu(byte_buffer_t* pdu) * This entity is common between LTE and NR * and only the TX/RX entities change between them *******************************************************/ +rlc_am::rlc_am(srsran_rat_t rat, + srslog::basic_logger& logger, + uint32_t lcid_, + srsue::pdcp_interface_rlc* pdcp_, + srsue::rrc_interface_rlc* rrc_, + srsran::timer_handler* timers_) : + logger(logger), rrc(rrc_), pdcp(pdcp_), timers(timers_), lcid(lcid_) +{ + if (rat == srsran_rat_t::lte) { + tx_base = std::unique_ptr(new rlc_am_lte_tx(this)); + rx_base = std::unique_ptr(new rlc_am_lte_rx(this)); + } else if (rat == srsran_rat_t::nr) { + tx_base = std::unique_ptr(new rlc_am_nr_tx(this)); + rx_base = std::unique_ptr(new rlc_am_nr_rx(this)); + } else { + logger.error("Invalid RAT at entity initialization"); + } +} bool rlc_am::configure(const rlc_config_t& cfg_) { // determine bearer name and configure Rx/Tx objects diff --git a/lib/src/rlc/rlc_am_lte.cc b/lib/src/rlc/rlc_am_lte.cc index bdca5d751..8565f0603 100644 --- a/lib/src/rlc/rlc_am_lte.cc +++ b/lib/src/rlc/rlc_am_lte.cc @@ -29,29 +29,20 @@ using pdcp_pdu_info_lte = pdcp_pdu_info; using rlc_amd_tx_pdu_lte = rlc_amd_tx_pdu; using rlc_am_pdu_segment = rlc_am_pdu_segment_pool::segment_resource; -/**************************************************************************** - * RLC AM LTE entity - ***************************************************************************/ -rlc_am_lte::rlc_am_lte(srslog::basic_logger& logger, - uint32_t lcid_, - srsue::pdcp_interface_rlc* pdcp_, - srsue::rrc_interface_rlc* rrc_, - srsran::timer_handler* timers_) : - rlc_am(logger, lcid_, pdcp_, rrc_, timers_, new rlc_am_lte::rlc_am_lte_tx(this), new rlc_am_lte::rlc_am_lte_rx(this)) -{} /**************************************************************************** * Tx subclass implementation ***************************************************************************/ -rlc_am_lte::rlc_am_lte_tx::rlc_am_lte_tx(rlc_am_lte* parent_) : +rlc_am_lte_tx::rlc_am_lte_tx(rlc_am* parent_) : parent(parent_), - rx(dynamic_cast(parent->rx_base.get())), pool(byte_buffer_pool::get_instance()), poll_retx_timer(parent_->timers->get_unique_timer()), status_prohibit_timer(parent_->timers->get_unique_timer()), rlc_am_base_tx(&parent_->logger) -{} +{ + rx = dynamic_cast(parent->rx_base.get()); +} -bool rlc_am_lte::rlc_am_lte_tx::configure(const rlc_config_t& cfg_) +bool rlc_am_lte_tx::configure(const rlc_config_t& cfg_) { std::lock_guard lock(mutex); if (cfg_.tx_queue_length > MAX_SDUS_PER_RLC_PDU) { @@ -89,13 +80,13 @@ bool rlc_am_lte::rlc_am_lte_tx::configure(const rlc_config_t& cfg_) return true; } -void rlc_am_lte::rlc_am_lte_tx::stop() +void rlc_am_lte_tx::stop() { std::lock_guard lock(mutex); stop_nolock(); } -void rlc_am_lte::rlc_am_lte_tx::stop_nolock() +void rlc_am_lte_tx::stop_nolock() { empty_queue_nolock(); @@ -127,13 +118,13 @@ void rlc_am_lte::rlc_am_lte_tx::stop_nolock() undelivered_sdu_info_queue.clear(); } -void rlc_am_lte::rlc_am_lte_tx::empty_queue() +void rlc_am_lte_tx::empty_queue() { std::lock_guard lock(mutex); empty_queue_nolock(); } -void rlc_am_lte::rlc_am_lte_tx::empty_queue_nolock() +void rlc_am_lte_tx::empty_queue_nolock() { // deallocate all SDUs in transmit queue while (tx_sdu_queue.size() > 0) { @@ -147,20 +138,20 @@ void rlc_am_lte::rlc_am_lte_tx::empty_queue_nolock() tx_sdu.reset(); } -void rlc_am_lte::rlc_am_lte_tx::reestablish() +void rlc_am_lte_tx::reestablish() { std::lock_guard lock(mutex); stop_nolock(); tx_enabled = true; } -bool rlc_am_lte::rlc_am_lte_tx::do_status() +bool rlc_am_lte_tx::do_status() { return rx->get_do_status(); } // Function is supposed to return as fast as possible -bool rlc_am_lte::rlc_am_lte_tx::has_data() +bool rlc_am_lte_tx::has_data() { return (((do_status() && not status_prohibit_timer.is_running())) || // if we have a status PDU to transmit (not retx_queue.empty()) || // if we have a retransmission @@ -177,7 +168,7 @@ bool rlc_am_lte::rlc_am_lte_tx::has_data() * * @param sn The SN of the PDU to check */ -void rlc_am_lte::rlc_am_lte_tx::check_sn_reached_max_retx(uint32_t sn) +void rlc_am_lte_tx::check_sn_reached_max_retx(uint32_t sn) { if (tx_window[sn].retx_count == cfg.max_retx_thresh) { logger->warning("%s Signaling max number of reTx=%d for SN=%d", RB_NAME, tx_window[sn].retx_count, sn); @@ -193,25 +184,29 @@ void rlc_am_lte::rlc_am_lte_tx::check_sn_reached_max_retx(uint32_t sn) } } -uint32_t rlc_am_lte::rlc_am_lte_tx::get_buffer_state() +uint32_t rlc_am_lte_tx::get_buffer_state() { uint32_t new_tx_queue = 0, prio_tx_queue = 0; get_buffer_state(new_tx_queue, prio_tx_queue); return new_tx_queue + prio_tx_queue; } -void rlc_am_lte::rlc_am_lte_tx::get_buffer_state(uint32_t& n_bytes_newtx, uint32_t& n_bytes_prio) +void rlc_am_lte_tx::get_buffer_state(uint32_t& n_bytes_newtx, uint32_t& n_bytes_prio) { std::lock_guard lock(mutex); get_buffer_state_nolock(n_bytes_newtx, n_bytes_prio); } -void rlc_am_lte::rlc_am_lte_tx::get_buffer_state_nolock(uint32_t& n_bytes_newtx, uint32_t& n_bytes_prio) +void rlc_am_lte_tx::get_buffer_state_nolock(uint32_t& n_bytes_newtx, uint32_t& n_bytes_prio) { n_bytes_newtx = 0; n_bytes_prio = 0; uint32_t n_sdus = 0; + if (not tx_enabled) { + return; + } + logger->debug("%s Buffer state - do_status=%s, status_prohibit_running=%s (%d/%d)", parent->rb_name, do_status() ? "yes" : "no", @@ -273,7 +268,7 @@ void rlc_am_lte::rlc_am_lte_tx::get_buffer_state_nolock(uint32_t& n_bytes_newtx, } } -void rlc_am_lte::rlc_am_lte_tx::discard_sdu(uint32_t discard_sn) +void rlc_am_lte_tx::discard_sdu(uint32_t discard_sn) { if (!tx_enabled) { return; @@ -291,12 +286,12 @@ void rlc_am_lte::rlc_am_lte_tx::discard_sdu(uint32_t discard_sn) logger->info("%s PDU with PDCP_SN=%d", discarded ? "Discarding" : "Couldn't discard", discard_sn); } -bool rlc_am_lte::rlc_am_lte_tx::sdu_queue_is_full() +bool rlc_am_lte_tx::sdu_queue_is_full() { return tx_sdu_queue.is_full(); } -uint32_t rlc_am_lte::rlc_am_lte_tx::read_pdu(uint8_t* payload, uint32_t nof_bytes) +uint32_t rlc_am_lte_tx::read_pdu(uint8_t* payload, uint32_t nof_bytes) { std::lock_guard lock(mutex); @@ -334,7 +329,7 @@ uint32_t rlc_am_lte::rlc_am_lte_tx::read_pdu(uint8_t* payload, uint32_t nof_byte return build_data_pdu(payload, nof_bytes); } -void rlc_am_lte::rlc_am_lte_tx::timer_expired(uint32_t timeout_id) +void rlc_am_lte_tx::timer_expired(uint32_t timeout_id) { std::unique_lock lock(mutex); if (poll_retx_timer.is_valid() && poll_retx_timer.id() == timeout_id) { @@ -355,7 +350,7 @@ void rlc_am_lte::rlc_am_lte_tx::timer_expired(uint32_t timeout_id) } } -void rlc_am_lte::rlc_am_lte_tx::retransmit_pdu(uint32_t sn) +void rlc_am_lte_tx::retransmit_pdu(uint32_t sn) { if (tx_window.empty()) { logger->warning("%s No PDU to retransmit", RB_NAME); @@ -395,7 +390,7 @@ void rlc_am_lte::rlc_am_lte_tx::retransmit_pdu(uint32_t sn) * * @return True if a status PDU needs to be requested, false otherwise. */ -bool rlc_am_lte::rlc_am_lte_tx::poll_required() +bool rlc_am_lte_tx::poll_required() { if (cfg.poll_pdu > 0 && pdu_without_poll > static_cast(cfg.poll_pdu)) { return true; @@ -423,14 +418,14 @@ bool rlc_am_lte::rlc_am_lte_tx::poll_required() * However, it seems more appropiate to request more often if polling * is disabled otherwise, e.g. every N PDUs. */ - if (cfg.poll_pdu == 0 && cfg.poll_byte == 0 && vt_s % rlc_am_lte::poll_periodicity == 0) { + if (cfg.poll_pdu == 0 && cfg.poll_byte == 0 && vt_s % rlc_am::poll_periodicity == 0) { return true; } return false; } -int rlc_am_lte::rlc_am_lte_tx::build_status_pdu(uint8_t* payload, uint32_t nof_bytes) +int rlc_am_lte_tx::build_status_pdu(uint8_t* payload, uint32_t nof_bytes) { logger->debug("%s Generating status PDU. Nof bytes %d", RB_NAME, nof_bytes); int pdu_len = rx->get_status_pdu(&tx_status, nof_bytes); @@ -453,7 +448,7 @@ int rlc_am_lte::rlc_am_lte_tx::build_status_pdu(uint8_t* payload, uint32_t nof_b return pdu_len; } -int rlc_am_lte::rlc_am_lte_tx::build_retx_pdu(uint8_t* payload, uint32_t nof_bytes) +int rlc_am_lte_tx::build_retx_pdu(uint8_t* payload, uint32_t nof_bytes) { // Check there is at least 1 element before calling front() if (retx_queue.empty()) { @@ -534,7 +529,7 @@ int rlc_am_lte::rlc_am_lte_tx::build_retx_pdu(uint8_t* payload, uint32_t nof_byt return (ptr - payload) + tx_window[retx.sn].buf->N_bytes; } -int rlc_am_lte::rlc_am_lte_tx::build_segment(uint8_t* payload, uint32_t nof_bytes, rlc_amd_retx_t retx) +int rlc_am_lte_tx::build_segment(uint8_t* payload, uint32_t nof_bytes, rlc_amd_retx_t retx) { if (tx_window[retx.sn].buf == NULL) { logger->error("In build_segment: retx.sn=%d has null buffer", retx.sn); @@ -709,7 +704,7 @@ int rlc_am_lte::rlc_am_lte_tx::build_segment(uint8_t* payload, uint32_t nof_byte return pdu_len; } -int rlc_am_lte::rlc_am_lte_tx::build_data_pdu(uint8_t* payload, uint32_t nof_bytes) +int rlc_am_lte_tx::build_data_pdu(uint8_t* payload, uint32_t nof_bytes) { if (tx_sdu == NULL && tx_sdu_queue.is_empty()) { logger->info("No data available to be sent"); @@ -925,7 +920,7 @@ int rlc_am_lte::rlc_am_lte_tx::build_data_pdu(uint8_t* payload, uint32_t nof_byt return total_len; } -void rlc_am_lte::rlc_am_lte_tx::handle_control_pdu(uint8_t* payload, uint32_t nof_bytes) +void rlc_am_lte_tx::handle_control_pdu(uint8_t* payload, uint32_t nof_bytes) { if (not tx_enabled) { return; @@ -1073,7 +1068,7 @@ void rlc_am_lte::rlc_am_lte_tx::handle_control_pdu(uint8_t* payload, uint32_t no * @tx_pdu: RLC PDU that was ack'ed. * @notify_info_vec: Vector which will keep track of the PDCP PDU SNs that have been fully ack'ed. */ -void rlc_am_lte::rlc_am_lte_tx::update_notification_ack_info(uint32_t rlc_sn) +void rlc_am_lte_tx::update_notification_ack_info(uint32_t rlc_sn) { logger->debug("Updating ACK info: RLC SN=%d, number of notified SDU=%ld, number of undelivered SDUs=%ld", rlc_sn, @@ -1110,12 +1105,12 @@ void rlc_am_lte::rlc_am_lte_tx::update_notification_ack_info(uint32_t rlc_sn) } } -void rlc_am_lte::rlc_am_lte_tx::debug_state() +void rlc_am_lte_tx::debug_state() { logger->debug("%s vt_a = %d, vt_ms = %d, vt_s = %d, poll_sn = %d", RB_NAME, vt_a, vt_ms, vt_s, poll_sn); } -int rlc_am_lte::rlc_am_lte_tx::required_buffer_size(const rlc_amd_retx_t& retx) +int rlc_am_lte_tx::required_buffer_size(const rlc_amd_retx_t& retx) { if (!retx.is_segment) { if (tx_window.has_sn(retx.sn)) { @@ -1191,17 +1186,18 @@ int rlc_am_lte::rlc_am_lte_tx::required_buffer_size(const rlc_amd_retx_t& retx) /**************************************************************************** * Rx subclass implementation ***************************************************************************/ - -rlc_am_lte::rlc_am_lte_rx::rlc_am_lte_rx(rlc_am_lte* parent_) : +rlc_am_lte_rx::rlc_am_lte_rx(rlc_am* parent_) : parent(parent_), pool(byte_buffer_pool::get_instance()), reordering_timer(parent_->timers->get_unique_timer()), rlc_am_base_rx(parent_, &parent_->logger) -{} +{ + tx = dynamic_cast(parent->tx_base.get()); +} -rlc_am_lte::rlc_am_lte_rx::~rlc_am_lte_rx() {} +rlc_am_lte_rx::~rlc_am_lte_rx() {} -bool rlc_am_lte::rlc_am_lte_rx::configure(const rlc_config_t& cfg_) +bool rlc_am_lte_rx::configure(const rlc_config_t& cfg_) { // TODO: add config checks cfg = cfg_.am; @@ -1220,12 +1216,12 @@ bool rlc_am_lte::rlc_am_lte_rx::configure(const rlc_config_t& cfg_) return true; } -void rlc_am_lte::rlc_am_lte_rx::reestablish() +void rlc_am_lte_rx::reestablish() { stop(); } -void rlc_am_lte::rlc_am_lte_rx::stop() +void rlc_am_lte_rx::stop() { std::lock_guard lock(mutex); @@ -1256,7 +1252,7 @@ void rlc_am_lte::rlc_am_lte_rx::stop() * @param payload Pointer to payload * @param nof_bytes Payload length */ -void rlc_am_lte::rlc_am_lte_rx::handle_data_pdu(uint8_t* payload, uint32_t nof_bytes) +void rlc_am_lte_rx::handle_data_pdu(uint8_t* payload, uint32_t nof_bytes) { std::lock_guard lock(mutex); @@ -1280,7 +1276,7 @@ void rlc_am_lte::rlc_am_lte_rx::handle_data_pdu(uint8_t* payload, uint32_t nof_b * @param nof_bytes Payload length * @param header Reference to PDU header (unpacked by caller) */ -void rlc_am_lte::rlc_am_lte_rx::handle_data_pdu_full(uint8_t* payload, uint32_t nof_bytes, rlc_amd_pdu_header_t& header) +void rlc_am_lte_rx::handle_data_pdu_full(uint8_t* payload, uint32_t nof_bytes, rlc_amd_pdu_header_t& header) { std::map::iterator it; @@ -1397,9 +1393,7 @@ void rlc_am_lte::rlc_am_lte_rx::handle_data_pdu_full(uint8_t* payload, uint32_t debug_state(); } -void rlc_am_lte::rlc_am_lte_rx::handle_data_pdu_segment(uint8_t* payload, - uint32_t nof_bytes, - rlc_amd_pdu_header_t& header) +void rlc_am_lte_rx::handle_data_pdu_segment(uint8_t* payload, uint32_t nof_bytes, rlc_amd_pdu_header_t& header) { std::map::iterator it; @@ -1487,7 +1481,7 @@ void rlc_am_lte::rlc_am_lte_rx::handle_data_pdu_segment(uint8_t* pa debug_state(); } -void rlc_am_lte::rlc_am_lte_rx::reassemble_rx_sdus() +void rlc_am_lte_rx::reassemble_rx_sdus() { uint32_t len = 0; if (rx_sdu == NULL) { @@ -1638,24 +1632,24 @@ void rlc_am_lte::rlc_am_lte_rx::reassemble_rx_sdus() } } -void rlc_am_lte::rlc_am_lte_rx::reset_status() +void rlc_am_lte_rx::reset_status() { do_status = false; poll_received = false; } -bool rlc_am_lte::rlc_am_lte_rx::get_do_status() +bool rlc_am_lte_rx::get_do_status() { return do_status.load(std::memory_order_relaxed); } -uint32_t rlc_am_lte::rlc_am_lte_rx::get_rx_buffered_bytes() +uint32_t rlc_am_lte_rx::get_rx_buffered_bytes() { std::lock_guard lock(mutex); return rx_window.get_buffered_bytes(); } -uint32_t rlc_am_lte::rlc_am_lte_rx::get_sdu_rx_latency_ms() +uint32_t rlc_am_lte_rx::get_sdu_rx_latency_ms() { std::lock_guard lock(mutex); return sdu_rx_latency_ms.value(); @@ -1666,7 +1660,7 @@ uint32_t rlc_am_lte::rlc_am_lte_rx::get_sdu_rx_latency_ms() * * @param timeout_id */ -void rlc_am_lte::rlc_am_lte_rx::timer_expired(uint32_t timeout_id) +void rlc_am_lte_rx::timer_expired(uint32_t timeout_id) { std::lock_guard lock(mutex); if (reordering_timer.is_valid() and reordering_timer.id() == timeout_id) { @@ -1693,7 +1687,7 @@ void rlc_am_lte::rlc_am_lte_rx::timer_expired(uint32_t timeout_id) // Called from Tx object to pack status PDU that doesn't exceed a given size // If lock-acquisition fails, return -1. Otherwise it returns the length of the generated PDU. -int rlc_am_lte::rlc_am_lte_rx::get_status_pdu(rlc_status_pdu_t* status, const uint32_t max_pdu_size) +int rlc_am_lte_rx::get_status_pdu(rlc_status_pdu_t* status, const uint32_t max_pdu_size) { std::unique_lock lock(mutex, std::try_to_lock); if (not lock.owns_lock()) { @@ -1747,7 +1741,7 @@ int rlc_am_lte::rlc_am_lte_rx::get_status_pdu(rlc_status_pdu_t* status, const ui } // Called from Tx object to obtain length of the full status PDU -int rlc_am_lte::rlc_am_lte_rx::get_status_pdu_length() +int rlc_am_lte_rx::get_status_pdu_length() { std::unique_lock lock(mutex, std::try_to_lock); if (not lock.owns_lock()) { @@ -1765,7 +1759,7 @@ int rlc_am_lte::rlc_am_lte_rx::get_status_pdu_length() return rlc_am_packed_length(&status); } -void rlc_am_lte::rlc_am_lte_rx::print_rx_segments() +void rlc_am_lte_rx::print_rx_segments() { std::map::iterator it; std::stringstream ss; @@ -1781,7 +1775,7 @@ void rlc_am_lte::rlc_am_lte_rx::print_rx_segments() } // NOTE: Preference would be to capture by value, and then move; but header is stack allocated -bool rlc_am_lte::rlc_am_lte_rx::add_segment_and_check(rlc_amd_rx_pdu_segments_t* pdu, rlc_amd_rx_pdu* segment) +bool rlc_am_lte_rx::add_segment_and_check(rlc_amd_rx_pdu_segments_t* pdu, rlc_amd_rx_pdu* segment) { // Find segment insertion point in the list of segments auto it1 = pdu->segments.begin(); @@ -1961,7 +1955,7 @@ bool rlc_am_lte::rlc_am_lte_rx::add_segment_and_check(rlc_amd_rx_pdu_segments_t* return true; } -bool rlc_am_lte::rlc_am_lte_rx::inside_rx_window(const int16_t sn) +bool rlc_am_lte_rx::inside_rx_window(const int16_t sn) { if (RX_MOD_BASE(sn) >= RX_MOD_BASE(static_cast(vr_r)) && RX_MOD_BASE(sn) < RX_MOD_BASE(vr_mr)) { return true; @@ -1970,7 +1964,7 @@ bool rlc_am_lte::rlc_am_lte_rx::inside_rx_window(const int16_t sn) } } -void rlc_am_lte::rlc_am_lte_rx::debug_state() +void rlc_am_lte_rx::debug_state() { logger->debug("%s vr_r = %d, vr_mr = %d, vr_x = %d, vr_ms = %d, vr_h = %d", RB_NAME, vr_r, vr_mr, vr_x, vr_ms, vr_h); } diff --git a/lib/src/rlc/rlc_am_nr.cc b/lib/src/rlc/rlc_am_nr.cc index 2d9592028..0e0481fa2 100644 --- a/lib/src/rlc/rlc_am_nr.cc +++ b/lib/src/rlc/rlc_am_nr.cc @@ -22,24 +22,17 @@ namespace srsran { /**************************************************************************** * RLC AM NR entity ***************************************************************************/ -rlc_am_nr::rlc_am_nr(srslog::basic_logger& logger, - uint32_t lcid_, - srsue::pdcp_interface_rlc* pdcp_, - srsue::rrc_interface_rlc* rrc_, - srsran::timer_handler* timers_) : - rlc_am(logger, lcid_, pdcp_, rrc_, timers_, new rlc_am_nr::rlc_am_nr_tx(this), new rlc_am_nr::rlc_am_nr_rx(this)) -{} /*************************************************************************** * Tx subclass implementation ***************************************************************************/ -rlc_am_nr::rlc_am_nr_tx::rlc_am_nr_tx(rlc_am_nr* parent_) : parent(parent_), rlc_am_base_tx(&parent_->logger) +rlc_am_nr_tx::rlc_am_nr_tx(rlc_am* parent_) : parent(parent_), rlc_am_base_tx(&parent_->logger) { parent->logger.debug("Initializing RLC AM NR TX: Tx_Next: %d", st.tx_next); // Temporarly silence unused variable warning } -bool rlc_am_nr::rlc_am_nr_tx::configure(const rlc_config_t& cfg_) +bool rlc_am_nr_tx::configure(const rlc_config_t& cfg_) { /* if (cfg_.tx_queue_length > MAX_SDUS_PER_RLC_PDU) { @@ -54,77 +47,77 @@ bool rlc_am_nr::rlc_am_nr_tx::configure(const rlc_config_t& cfg_) return true; } -bool rlc_am_nr::rlc_am_nr_tx::has_data() +bool rlc_am_nr_tx::has_data() { return true; } -uint32_t rlc_am_nr::rlc_am_nr_tx::read_pdu(uint8_t* payload, uint32_t nof_bytes) +uint32_t rlc_am_nr_tx::read_pdu(uint8_t* payload, uint32_t nof_bytes) { return 0; } -void rlc_am_nr::rlc_am_nr_tx::handle_control_pdu(uint8_t* payload, uint32_t nof_bytes) {} +void rlc_am_nr_tx::handle_control_pdu(uint8_t* payload, uint32_t nof_bytes) {} -uint32_t rlc_am_nr::rlc_am_nr_tx::get_buffer_state() +uint32_t rlc_am_nr_tx::get_buffer_state() { return 0; } -void rlc_am_nr::rlc_am_nr_tx::get_buffer_state(uint32_t& tx_queue, uint32_t& prio_tx_queue) {} +void rlc_am_nr_tx::get_buffer_state(uint32_t& tx_queue, uint32_t& prio_tx_queue) {} -int rlc_am_nr::rlc_am_nr_tx::write_sdu(unique_byte_buffer_t sdu) +int rlc_am_nr_tx::write_sdu(unique_byte_buffer_t sdu) { return 0; } -void rlc_am_nr::rlc_am_nr_tx::reestablish() +void rlc_am_nr_tx::reestablish() { stop(); } -void rlc_am_nr::rlc_am_nr_tx::discard_sdu(uint32_t discard_sn) {} +void rlc_am_nr_tx::discard_sdu(uint32_t discard_sn) {} -bool rlc_am_nr::rlc_am_nr_tx::sdu_queue_is_full() +bool rlc_am_nr_tx::sdu_queue_is_full() { return false; } -void rlc_am_nr::rlc_am_nr_tx::empty_queue() {} +void rlc_am_nr_tx::empty_queue() {} -void rlc_am_nr::rlc_am_nr_tx::stop() {} +void rlc_am_nr_tx::stop() {} /**************************************************************************** * Rx subclass implementation ***************************************************************************/ -rlc_am_nr::rlc_am_nr_rx::rlc_am_nr_rx(rlc_am_nr* parent_) : +rlc_am_nr_rx::rlc_am_nr_rx(rlc_am* parent_) : parent(parent_), pool(byte_buffer_pool::get_instance()), rlc_am_base_rx(parent_, &parent_->logger) { parent->logger.debug("Initializing RLC AM NR RX"); // Temporarly silence unused variable warning } -bool rlc_am_nr::rlc_am_nr_rx::configure(const rlc_config_t& cfg_) +bool rlc_am_nr_rx::configure(const rlc_config_t& cfg_) { cfg = cfg_.am; return true; } -void rlc_am_nr::rlc_am_nr_rx::handle_data_pdu(uint8_t* payload, uint32_t nof_bytes) {} +void rlc_am_nr_rx::handle_data_pdu(uint8_t* payload, uint32_t nof_bytes) {} -void rlc_am_nr::rlc_am_nr_rx::stop() {} +void rlc_am_nr_rx::stop() {} -void rlc_am_nr::rlc_am_nr_rx::reestablish() +void rlc_am_nr_rx::reestablish() { stop(); } -uint32_t rlc_am_nr::rlc_am_nr_rx::get_sdu_rx_latency_ms() +uint32_t rlc_am_nr_rx::get_sdu_rx_latency_ms() { return 0; } -uint32_t rlc_am_nr::rlc_am_nr_rx::get_rx_buffered_bytes() +uint32_t rlc_am_nr_rx::get_rx_buffered_bytes() { return 0; } diff --git a/lib/test/rlc/rlc_am_lte_test.cc b/lib/test/rlc/rlc_am_lte_test.cc index d7dbc71af..c2f14d3a8 100644 --- a/lib/test/rlc/rlc_am_lte_test.cc +++ b/lib/test/rlc/rlc_am_lte_test.cc @@ -29,7 +29,7 @@ using namespace srsran; class ul_writer : public thread { public: - ul_writer(rlc_am_lte* rlc_) : rlc(rlc_), thread("UL_WRITER") {} + ul_writer(rlc_am* rlc_) : rlc(rlc_), thread("UL_WRITER") {} ~ul_writer() { stop(); } void stop() { @@ -65,11 +65,11 @@ private: running = false; } - rlc_am_lte* rlc = nullptr; + rlc_am* rlc = nullptr; std::atomic running = {false}; }; -int basic_test_tx(rlc_am_lte* rlc, byte_buffer_t pdu_bufs[NBUFS]) +int basic_test_tx(rlc_am* rlc, byte_buffer_t pdu_bufs[NBUFS]) { // Push 5 SDUs into RLC1 unique_byte_buffer_t sdu_bufs[NBUFS]; @@ -100,8 +100,8 @@ int basic_test() timer_handler timers(8); byte_buffer_t pdu_bufs[NBUFS]; - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); - rlc_am_lte rlc2(srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc2(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); // before configuring entity TESTASSERT(0 == rlc1.get_buffer_state()); @@ -158,8 +158,8 @@ int concat_test() rlc_am_tester tester; srsran::timer_handler timers(8); - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); - rlc_am_lte rlc2(srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc2(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); if (not rlc1.configure(rlc_config_t::default_rlc_am_config())) { return -1; @@ -233,8 +233,8 @@ int segment_test(bool in_seq_rx) srsran::timer_handler timers(8); int len = 0; - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); - rlc_am_lte rlc2(srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc2(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); if (not rlc1.configure(rlc_config_t::default_rlc_am_config())) { return -1; @@ -328,8 +328,8 @@ int retx_test() timer_handler timers(8); int len = 0; - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); - rlc_am_lte rlc2(srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc2(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); if (not rlc1.configure(rlc_config_t::default_rlc_am_config())) { return -1; @@ -464,7 +464,7 @@ int max_retx_test() timer_handler timers(8); int len = 0; - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); const rlc_config_t rlc_cfg = rlc_config_t::default_rlc_am_config(); if (not rlc1.configure(rlc_cfg)) { @@ -527,8 +527,8 @@ int segment_retx_test() timer_handler timers(8); int len = 0; - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); - rlc_am_lte rlc2(srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc2(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); if (not rlc1.configure(rlc_config_t::default_rlc_am_config())) { return -1; @@ -652,8 +652,8 @@ int resegment_test_1() timer_handler timers(8); int len = 0; - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); - rlc_am_lte rlc2(srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc2(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); if (not rlc1.configure(rlc_config_t::default_rlc_am_config())) { return -1; @@ -809,8 +809,8 @@ int resegment_test_2() rlc_am_tester tester; timer_handler timers(8); - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); - rlc_am_lte rlc2(srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc2(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); if (not rlc1.configure(rlc_config_t::default_rlc_am_config())) { return -1; @@ -941,8 +941,8 @@ int resegment_test_3() rlc_am_tester tester; srsran::timer_handler timers(8); - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); - rlc_am_lte rlc2(srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc2(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); if (not rlc1.configure(rlc_config_t::default_rlc_am_config())) { return -1; @@ -1071,8 +1071,8 @@ int resegment_test_4() rlc_am_tester tester; srsran::timer_handler timers(8); - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); - rlc_am_lte rlc2(srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc2(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); if (not rlc1.configure(rlc_config_t::default_rlc_am_config())) { return -1; @@ -1203,8 +1203,8 @@ int resegment_test_5() rlc_am_tester tester; srsran::timer_handler timers(8); - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); - rlc_am_lte rlc2(srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc2(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); if (not rlc1.configure(rlc_config_t::default_rlc_am_config())) { return -1; @@ -1330,8 +1330,8 @@ int resegment_test_6() srsran::timer_handler timers(8); int len = 0; - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); - rlc_am_lte rlc2(srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc2(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); if (not rlc1.configure(rlc_config_t::default_rlc_am_config())) { return -1; @@ -1499,8 +1499,8 @@ int resegment_test_7() #endif srsran::timer_handler timers(8); - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); - rlc_am_lte rlc2(srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc2(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); if (not rlc1.configure(rlc_config_t::default_rlc_am_config())) { return -1; @@ -1684,8 +1684,8 @@ int resegment_test_8() #endif srsran::timer_handler timers(8); - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); - rlc_am_lte rlc2(srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc2(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); if (not rlc1.configure(rlc_config_t::default_rlc_am_config())) { return -1; @@ -1836,8 +1836,8 @@ int resegment_test_9() #endif srsran::timer_handler timers(8); - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); - rlc_am_lte rlc2(srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc2(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); if (not rlc1.configure(config)) { return SRSRAN_ERROR; @@ -1978,8 +1978,8 @@ int resegment_test_10() #endif srsran::timer_handler timers(8); - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); - rlc_am_lte rlc2(srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc2(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); if (not rlc1.configure(config)) { return SRSRAN_ERROR; @@ -2127,8 +2127,8 @@ int resegment_test_11() #endif srsran::timer_handler timers(8); - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); - rlc_am_lte rlc2(srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc2(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); if (not rlc1.configure(config)) { return SRSRAN_ERROR; @@ -2285,8 +2285,8 @@ int resegment_test_12() #endif srsran::timer_handler timers(8); - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); - rlc_am_lte rlc2(srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc2(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); if (not rlc1.configure(config)) { return SRSRAN_ERROR; @@ -2429,7 +2429,7 @@ int header_reconstruction_test(srsran::log_sink_message_spy& spy) #endif srsran::timer_handler timers(8); - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); if (not rlc1.configure(rlc_config_t::default_rlc_am_config())) { return -1; @@ -2492,7 +2492,7 @@ int header_reconstruction_test2(srsran::log_sink_message_spy& spy) #endif srsran::timer_handler timers(8); - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); if (not rlc1.configure(rlc_config_t::default_rlc_am_config())) { return -1; } @@ -2556,7 +2556,7 @@ int header_reconstruction_test3(srsran::log_sink_message_spy& spy) srsran::timer_handler timers(8); // configure RLC - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); if (not rlc1.configure(rlc_config_t::default_rlc_am_config())) { return -1; } @@ -2642,7 +2642,7 @@ int header_reconstruction_test4(srsran::log_sink_message_spy& spy) srsran::timer_handler timers(8); // configure RLC - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); if (not rlc1.configure(rlc_config_t::default_rlc_am_config())) { return -1; } @@ -2719,7 +2719,7 @@ int header_reconstruction_test5(srsran::log_sink_message_spy& spy) srsran::timer_handler timers(8); // configure RLC - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); if (not rlc1.configure(rlc_config_t::default_rlc_am_config())) { return -1; } @@ -2798,7 +2798,7 @@ int header_reconstruction_test6(srsran::log_sink_message_spy& spy) srsran::timer_handler timers(8); // configure RLC - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); if (not rlc1.configure(rlc_config_t::default_rlc_am_config())) { return -1; } @@ -2897,7 +2897,7 @@ int header_reconstruction_test7(srsran::log_sink_message_spy& spy) srsran::timer_handler timers(8); // configure RLC - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); if (not rlc1.configure(rlc_config_t::default_rlc_am_config())) { return -1; } @@ -2999,7 +2999,7 @@ int header_reconstruction_test8(srsran::log_sink_message_spy& spy) srsran::timer_handler timers(8); // configure RLC - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); if (not rlc1.configure(rlc_config_t::default_rlc_am_config())) { return -1; } @@ -3030,7 +3030,7 @@ bool reset_test() srsran::timer_handler timers(8); int len = 0; - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); if (not rlc1.configure(rlc_config_t::default_rlc_am_config())) { return -1; @@ -3072,7 +3072,7 @@ bool resume_test() srsran::timer_handler timers(8); int len = 0; - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); if (not rlc1.configure(rlc_config_t::default_rlc_am_config())) { return -1; @@ -3113,7 +3113,7 @@ bool stop_test() rlc_am_tester tester; srsran::timer_handler timers(8); - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); if (not rlc1.configure(rlc_config_t::default_rlc_am_config())) { return -1; @@ -3140,8 +3140,8 @@ bool status_pdu_test() srsran::timer_handler timers(8); int len = 0; - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); - rlc_am_lte rlc2(srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc2(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); if (not rlc1.configure(rlc_config_t::default_rlc_am_config())) { return -1; @@ -3249,8 +3249,8 @@ bool incorrect_status_pdu_test() srsran::timer_handler timers(8); int len = 0; - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); - rlc_am_lte rlc2(srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc2(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); if (not rlc1.configure(rlc_config_t::default_rlc_am_config())) { return -1; @@ -3314,8 +3314,8 @@ bool incorrect_status_pdu_test2() srsran::timer_handler timers(8); int len = 0; - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); - rlc_am_lte rlc2(srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc2(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); if (not rlc1.configure(rlc_config_t::default_rlc_am_config())) { return -1; @@ -3428,8 +3428,8 @@ bool reestablish_test() srsran::timer_handler timers(8); - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); - rlc_am_lte rlc2(srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc2(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); srslog::fetch_basic_logger("RLC_AM_1").set_hex_dump_max_size(100); srslog::fetch_basic_logger("RLC_AM_2").set_hex_dump_max_size(100); @@ -3548,8 +3548,8 @@ bool discard_test() srsran::timer_handler timers(8); - rlc_am_lte rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); - rlc_am_lte rlc2(srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc2(srsran_rat_t::lte, srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); srslog::fetch_basic_logger("RLC_AM_1").set_hex_dump_max_size(100); srslog::fetch_basic_logger("RLC_AM_2").set_hex_dump_max_size(100); diff --git a/lib/test/rlc/rlc_am_nr_test.cc b/lib/test/rlc/rlc_am_nr_test.cc index 039901cee..c9cfc6784 100644 --- a/lib/test/rlc/rlc_am_nr_test.cc +++ b/lib/test/rlc/rlc_am_nr_test.cc @@ -26,7 +26,7 @@ using namespace srsue; using namespace srsran; -int basic_test_tx(rlc_am_nr* rlc, byte_buffer_t pdu_bufs[NBUFS]) +int basic_test_tx(rlc_am* rlc, byte_buffer_t pdu_bufs[NBUFS]) { // Push 5 SDUs into RLC1 unique_byte_buffer_t sdu_bufs[NBUFS]; @@ -57,8 +57,8 @@ int basic_test() timer_handler timers(8); byte_buffer_t pdu_bufs[NBUFS]; - rlc_am_nr rlc1(srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); - rlc_am_nr rlc2(srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); + rlc_am rlc1(srsran_rat_t::nr, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc2(srsran_rat_t::nr, srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); // before configuring entity TESTASSERT(0 == rlc1.get_buffer_state());