From 329f3e519b303c5d481ba6ed017a3272af1d58b8 Mon Sep 17 00:00:00 2001 From: Robert Falkenberg Date: Thu, 17 Mar 2022 11:06:45 +0100 Subject: [PATCH] lib,rlc_am_nr: reset do_status flag after sending status PDU and extend unit test to fail when redundant status PDUs exist. --- lib/src/rlc/rlc_am_nr.cc | 1 + lib/test/rlc/rlc_am_nr_test.cc | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/src/rlc/rlc_am_nr.cc b/lib/src/rlc/rlc_am_nr.cc index 2b48f2c6c..d920d5504 100644 --- a/lib/src/rlc/rlc_am_nr.cc +++ b/lib/src/rlc/rlc_am_nr.cc @@ -1343,6 +1343,7 @@ uint32_t rlc_am_nr_rx::get_status_pdu(rlc_am_nr_status_pdu_t* status, uint32_t m if (status_prohibit_timer.is_valid()) { status_prohibit_timer.run(); } + do_status = false; } return tmp_buf.N_bytes; } diff --git a/lib/test/rlc/rlc_am_nr_test.cc b/lib/test/rlc/rlc_am_nr_test.cc index 1ba9d8997..bf60e7925 100644 --- a/lib/test/rlc/rlc_am_nr_test.cc +++ b/lib/test/rlc/rlc_am_nr_test.cc @@ -315,6 +315,7 @@ int basic_test(rlc_am_nr_sn_size_t sn_size) * Test the loss of a single PDU. * NACK should be visible in the status report. * Retx after NACK should be present too. + * No further status reports shall be issued. */ int lost_pdu_test(rlc_am_nr_sn_size_t sn_size) { @@ -336,7 +337,8 @@ int lost_pdu_test(rlc_am_nr_sn_size_t sn_size) return -1; } - if (not rlc2.configure(rlc_config_t::default_rlc_am_nr_config(to_number(sn_size)))) { + rlc_config_t rlc2_config = rlc_config_t::default_rlc_am_nr_config(to_number(sn_size)); + if (not rlc2.configure(rlc2_config)) { return -1; } @@ -428,6 +430,15 @@ int lost_pdu_test(rlc_am_nr_sn_size_t sn_size) TESTASSERT_EQ(0, status_check.N_nack); // All PDUs are acked now } + { + // rlc2 should not issue further status PDUs as time passes (even after expiry of t_status_prohibit) + int32_t checktime = 2 * rlc2_config.am_nr.t_status_prohibit; + for (int cnt = 0; cnt < checktime; cnt++) { + timers.step_all(); + TESTASSERT_EQ(0, rlc2.get_buffer_state()); + } + } + // Check statistics rlc_bearer_metrics_t metrics1 = rlc1.get_metrics(); rlc_bearer_metrics_t metrics2 = rlc2.get_metrics();