From dc71048d8381d6e4735c385fa08bc5774d1aebba Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Mon, 4 Jul 2022 17:00:33 +0100 Subject: [PATCH] lib,rlc: fixed up test for full rx window --- lib/include/srsran/rlc/rlc_am_nr.h | 4 ++-- lib/src/rlc/rlc_am_nr.cc | 8 ++++---- lib/test/rlc/rlc_am_nr_test.cc | 6 ++++++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/include/srsran/rlc/rlc_am_nr.h b/lib/include/srsran/rlc/rlc_am_nr.h index 42bf858d7..427b75ffa 100644 --- a/lib/include/srsran/rlc/rlc_am_nr.h +++ b/lib/include/srsran/rlc/rlc_am_nr.h @@ -240,8 +240,8 @@ public: // Data handling methods int handle_full_data_sdu(const rlc_am_nr_pdu_header_t& header, const uint8_t* payload, uint32_t nof_bytes); int handle_segment_data_sdu(const rlc_am_nr_pdu_header_t& header, const uint8_t* payload, uint32_t nof_bytes); - bool inside_rx_window(uint32_t sn); - bool valid_ack_sn(uint32_t sn); + bool inside_rx_window(uint32_t sn) const; + bool valid_ack_sn(uint32_t sn) const; void write_to_upper_layers(uint32_t lcid, unique_byte_buffer_t sdu); void insert_received_segment(rlc_amd_rx_pdu_nr segment, rlc_amd_rx_sdu_nr_t::segment_list_t& segment_list) const; /** diff --git a/lib/src/rlc/rlc_am_nr.cc b/lib/src/rlc/rlc_am_nr.cc index 5cf175917..4607e72b8 100644 --- a/lib/src/rlc/rlc_am_nr.cc +++ b/lib/src/rlc/rlc_am_nr.cc @@ -787,7 +787,7 @@ void rlc_am_nr_tx::handle_control_pdu(uint8_t* payload, uint32_t nof_bytes) * Checking if the ACK_SN is inside the the TX_WINDOW makes sure we discard out of order status reports * Checking if ACK_SN > Tx_Next makes sure we do not receive a ACK/NACK for something we did not TX */ - if (not inside_tx_window(status.ack_sn)) { + if (not valid_ack_sn(status.ack_sn)) { RlcInfo("Received ACK with SN outside of TX_WINDOW, ignoring status report. ACK_SN=%d, TX_NEXT_ACK=%d.", status.ack_sn, st.tx_next_ack); @@ -1309,7 +1309,7 @@ bool rlc_am_nr_tx::inside_tx_window(uint32_t sn) const return tx_mod_base_nr(sn) < tx_window_size(); } -bool rlc_am_nr_tx::valid_ack_sn(uint32_t sn) +bool rlc_am_nr_tx::valid_ack_sn(uint32_t sn) const { // Tx_Next_Ack < SN <= TX_Next + AM_Window_Size return (0 < tx_mod_base_nr(sn)) && (tx_mod_base_nr(sn) <= tx_window_size()); @@ -1943,13 +1943,13 @@ uint32_t rlc_am_nr_rx::rx_window_size() const return am_window_size(cfg.rx_sn_field_length); } -bool rlc_am_nr_rx::inside_rx_window(uint32_t sn) +bool rlc_am_nr_rx::inside_rx_window(uint32_t sn) const { // RX_Next <= SN < RX_Next + AM_Window_Size return rx_mod_base_nr(sn) < rx_window_size(); } -bool rlc_am_nr_rx::valid_ack_sn(uint32_t sn) +bool rlc_am_nr_rx::valid_ack_sn(uint32_t sn) const { // RX_Next < SN <= RX_Next + AM_Window_Size return (0 < rx_mod_base_nr(sn)) && (rx_mod_base_nr(sn) <= rx_window_size()); diff --git a/lib/test/rlc/rlc_am_nr_test.cc b/lib/test/rlc/rlc_am_nr_test.cc index ef114bf8d..330ea59fb 100644 --- a/lib/test/rlc/rlc_am_nr_test.cc +++ b/lib/test/rlc/rlc_am_nr_test.cc @@ -3175,6 +3175,12 @@ int full_rx_window_t_reassembly_expiry(rlc_am_nr_sn_size_t sn_size) timers.step_all(); } + // Check Rx_Status_Highest + { + rlc_am_nr_rx_state_t st = rx2->get_rx_state(); + TESTASSERT_EQ(2048, st.rx_highest_status); + } + return SRSRAN_SUCCESS; }