lib,rlc_am_nr: cleaned up some test names and some comments.

master
Pedro Alvarez 3 years ago
parent b4814bfdc1
commit c023dba175

@ -492,7 +492,7 @@ rlc_am_nr_tx::build_retx_pdu_without_segmentation(rlc_amd_retx_nr_t& retx, uint8
retx.so_start,
retx.segment_length);
// Update & write header
// Get RETX SN, current SO and SI
uint32_t retx_sn = retx.sn;
uint32_t current_so = 0;
rlc_nr_si_field_t si = rlc_nr_si_field_t::full_sdu;
@ -506,11 +506,8 @@ rlc_am_nr_tx::build_retx_pdu_without_segmentation(rlc_amd_retx_nr_t& retx, uint8
}
current_so = retx.current_so;
}
rlc_am_nr_pdu_header_t new_header = tx_pdu.header;
new_header.si = si;
new_header.so = current_so;
// Write payload into PDU
// Get RETX PDU payload size
uint32_t retx_pdu_payload_size = 0;
if (not retx.is_segment) {
// RETX full SDU
@ -519,15 +516,24 @@ rlc_am_nr_tx::build_retx_pdu_without_segmentation(rlc_amd_retx_nr_t& retx, uint8
// RETX SDU segment
retx_pdu_payload_size = (retx.so_start + retx.segment_length - retx.current_so);
}
// Update RETX queue. This must be done before calculating
// the polling bit, to make sure the poll bit is calculated correctly
retx_queue->pop();
new_header.p = get_pdu_poll(true, 0);
uint32_t hdr_len = rlc_am_nr_write_data_pdu_header(new_header, payload);
// Write header to payload
rlc_am_nr_pdu_header_t new_header = tx_pdu.header;
new_header.si = si;
new_header.so = current_so;
new_header.p = get_pdu_poll(true, 0);
uint32_t hdr_len = rlc_am_nr_write_data_pdu_header(new_header, payload);
// Write SDU/SDU segment to payload
uint32_t pdu_bytes = hdr_len + retx_pdu_payload_size;
srsran_assert(pdu_bytes <= nof_bytes, "Error calculating hdr_len and pdu_payload_len");
memcpy(&payload[hdr_len], &tx_pdu.sdu_buf->msg[current_so], retx_pdu_payload_size);
// Update RETX queue and log
retx_queue->pop();
// Log RETX
RlcHexInfo((*tx_window)[retx.sn].sdu_buf->msg,
(*tx_window)[retx.sn].sdu_buf->N_bytes,
"Original SDU SN=%d (%d B) (attempt %d/%d)",

@ -1226,8 +1226,8 @@ int discard_test(rlc_am_nr_sn_size_t sn_size)
return SRSRAN_SUCCESS;
}
// This test checks the correct functioning of RLC TX polling bit setting
int poll_test_poll_pdu()
// Test p bit set on new TX with PollPDU
int poll_pdu()
{
rlc_am_tester tester;
timer_handler timers(8);
@ -1280,7 +1280,7 @@ int poll_test_poll_pdu()
}
// Test p bit set on new TX with PollBYTE
int poll_test_poll_byte()
int poll_byte()
{
rlc_am_tester tester;
timer_handler timers(8);
@ -1331,8 +1331,8 @@ int poll_test_poll_byte()
return SRSRAN_SUCCESS;
}
// Test p bit set on RETXes
int poll_test_poll_retx()
// Test p bit set on RETXes that cause an empty retx queue.
int poll_retx()
{
rlc_am_tester tester;
timer_handler timers(8);
@ -1476,8 +1476,8 @@ int main()
TESTASSERT(max_retx_lost_sdu_test(sns) == SRSRAN_SUCCESS); // Fixme
TESTASSERT(max_retx_lost_segments_test(sns) == SRSRAN_SUCCESS); // Fixme
TESTASSERT(discard_test(sns) == SRSRAN_SUCCESS); // Fixme
TESTASSERT(poll_test_poll_pdu() == SRSRAN_SUCCESS);
TESTASSERT(poll_test_poll_byte() == SRSRAN_SUCCESS);
TESTASSERT(poll_test_poll_retx() == SRSRAN_SUCCESS);
TESTASSERT(poll_pdu() == SRSRAN_SUCCESS);
TESTASSERT(poll_byte() == SRSRAN_SUCCESS);
TESTASSERT(poll_retx() == SRSRAN_SUCCESS);
return SRSRAN_SUCCESS;
}

Loading…
Cancel
Save