lib,rlc_am_nr: fix incorrectly stopping the t-StatusProhibit

This commit is contained in:
Pedro Alvarez 2022-04-22 15:58:35 +01:00
parent 63877ba209
commit 8a27cdf45a
2 changed files with 37 additions and 11 deletions

View File

@ -1207,7 +1207,6 @@ void rlc_am_nr_rx::handle_data_pdu(uint8_t* payload, uint32_t nof_bytes)
if (header.p) {
RlcInfo("status packet requested through polling bit");
do_status = true;
status_prohibit_timer.stop();
}
debug_state();

View File

@ -410,10 +410,18 @@ int lost_pdu_test(rlc_am_nr_sn_size_t sn_size)
retx_buf.N_bytes = len;
TESTASSERT_EQ(data_pdu_size, len);
// Polling bit on the RETX should be required, as the buffers are not empty.
rlc2.write_pdu(retx_buf.msg, retx_buf.N_bytes);
TESTASSERT_EQ(3, rlc2.get_buffer_state()); // Status report shoud be required, as the TX buffers are now empty.
TESTASSERT_EQ(0, rlc2.get_buffer_state()); // t-StatusProhibit is still running
}
// Step timers until t-StatusProhibit expires
for (int cnt = 0; cnt < 8; cnt++) {
timers.step_all();
}
TESTASSERT_EQ(3, rlc2.get_buffer_state()); // t-StatusProhibit no longer running
{
// Double check status report
byte_buffer_t status_buf;
@ -588,8 +596,15 @@ int lost_pdu_duplicated_nack_test(rlc_am_nr_sn_size_t sn_size)
rlc2.write_pdu(retx_buf.msg, retx_buf.N_bytes);
TESTASSERT_EQ(3, rlc2.get_buffer_state()); // Status report shoud be required, as the TX buffers are now empty.
TESTASSERT_EQ(0, rlc2.get_buffer_state()); // Status report shoud be required, as the TX buffers are now empty.
}
// Step timers until t-StatusProhibit expires
for (int cnt = 0; cnt < 8; cnt++) {
timers.step_all();
}
TESTASSERT_EQ(3, rlc2.get_buffer_state()); // t-StatusProhibit no longer running
{
// Double check status report
byte_buffer_t status_buf;
@ -765,8 +780,15 @@ int lost_pdus_trimmed_nack_test(rlc_am_nr_sn_size_t sn_size)
rlc2.write_pdu(retx_buf.msg, retx_buf.N_bytes);
expected_size = status_pdu_ack_size + 1 * status_pdu_nack_size;
TESTASSERT_EQ(expected_size, rlc2.get_buffer_state()); // Status report should now include the chopped NACK
TESTASSERT_EQ(0, rlc2.get_buffer_state()); // Status report should now include the chopped NACK
}
// Step timers until t-StatusProhibit expires
for (int cnt = 0; cnt < 8; cnt++) {
timers.step_all();
}
TESTASSERT_EQ(expected_size, rlc2.get_buffer_state()); // t-StatusProhibit no longer running
{
// Double check status report
byte_buffer_t status_buf;
@ -801,8 +823,13 @@ int lost_pdus_trimmed_nack_test(rlc_am_nr_sn_size_t sn_size)
rlc2.write_pdu(retx_buf.msg, retx_buf.N_bytes);
expected_size = status_pdu_ack_size;
TESTASSERT_EQ(expected_size, rlc2.get_buffer_state()); // Status report should have no NACKs
TESTASSERT_EQ(0, rlc2.get_buffer_state()); // Status report should have no NACKs
}
// Step timers until t-StatusProhibit expires
for (int cnt = 0; cnt < 8; cnt++) {
timers.step_all();
}
TESTASSERT_EQ(expected_size, rlc2.get_buffer_state()); // t-StatusProhibit no longer running
{
// Double check status report
byte_buffer_t status_buf;