lib,rlc_am_nr: reset do_status flag after sending status PDU

and extend unit test to fail when redundant status PDUs exist.
master
Robert Falkenberg 3 years ago
parent 12f440145d
commit 329f3e519b

@ -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;
}

@ -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();

Loading…
Cancel
Save