rlc am,optimization - change helper log methods to avoid mallocs

This commit is contained in:
Francisco 2021-03-08 22:54:32 +00:00 committed by Francisco Paisana
parent d77b6e1d9c
commit 1ffc4cef86
3 changed files with 82 additions and 78 deletions

View File

@ -345,8 +345,8 @@ private:
// Tx windows
rlc_ringbuffer_t<rlc_amd_tx_pdu_t> tx_window;
pdu_retx_queue retx_queue;
std::vector<uint32_t> notify_info_vec;
pdu_retx_queue retx_queue;
std::vector<uint32_t> notify_info_vec;
// Mutexes
pthread_mutex_t mutex;
@ -462,18 +462,18 @@ void rlc_am_read_status_pdu(uint8_t* payload, uint32_t nof_bytes, rlc_status_pdu
void rlc_am_write_status_pdu(rlc_status_pdu_t* status, byte_buffer_t* pdu);
int rlc_am_write_status_pdu(rlc_status_pdu_t* status, uint8_t* payload);
uint32_t rlc_am_packed_length(rlc_amd_pdu_header_t* header);
uint32_t rlc_am_packed_length(rlc_status_pdu_t* status);
uint32_t rlc_am_packed_length(rlc_amd_retx_t retx);
bool rlc_am_is_valid_status_pdu(const rlc_status_pdu_t& status);
bool rlc_am_is_pdu_segment(uint8_t* payload);
std::string rlc_am_undelivered_sdu_info_to_string(const std::map<uint32_t, pdcp_sdu_info_t>& info_queue);
std::string rlc_am_status_pdu_to_string(rlc_status_pdu_t* status);
std::string rlc_amd_pdu_header_to_string(const rlc_amd_pdu_header_t& header);
bool rlc_am_start_aligned(const uint8_t fi);
bool rlc_am_end_aligned(const uint8_t fi);
bool rlc_am_is_unaligned(const uint8_t fi);
bool rlc_am_not_start_aligned(const uint8_t fi);
uint32_t rlc_am_packed_length(rlc_amd_pdu_header_t* header);
uint32_t rlc_am_packed_length(rlc_status_pdu_t* status);
uint32_t rlc_am_packed_length(rlc_amd_retx_t retx);
bool rlc_am_is_valid_status_pdu(const rlc_status_pdu_t& status);
bool rlc_am_is_pdu_segment(uint8_t* payload);
std::string rlc_am_undelivered_sdu_info_to_string(const std::map<uint32_t, pdcp_sdu_info_t>& info_queue);
fmt::memory_buffer rlc_am_status_pdu_to_string(rlc_status_pdu_t* status);
fmt::memory_buffer rlc_amd_pdu_header_to_string(const rlc_amd_pdu_header_t& header);
bool rlc_am_start_aligned(const uint8_t fi);
bool rlc_am_end_aligned(const uint8_t fi);
bool rlc_am_is_unaligned(const uint8_t fi);
bool rlc_am_not_start_aligned(const uint8_t fi);
} // namespace srslte

View File

@ -562,9 +562,9 @@ bool rlc_am_lte::rlc_am_lte_tx::poll_required()
int rlc_am_lte::rlc_am_lte_tx::build_status_pdu(uint8_t* payload, uint32_t nof_bytes)
{
int pdu_len = parent->rx.get_status_pdu(&tx_status, nof_bytes);
logger.debug("%s", rlc_am_status_pdu_to_string(&tx_status).c_str());
logger.debug("%s", rlc_am_status_pdu_to_string(&tx_status).data());
if (pdu_len > 0 && nof_bytes >= static_cast<uint32_t>(pdu_len)) {
logger.info("%s Tx status PDU - %s", RB_NAME, rlc_am_status_pdu_to_string(&tx_status).c_str());
logger.info("%s Tx status PDU - %s", RB_NAME, rlc_am_status_pdu_to_string(&tx_status).data());
parent->rx.reset_status();
@ -652,7 +652,7 @@ int rlc_am_lte::rlc_am_lte_tx::build_retx_pdu(uint8_t* payload, uint32_t nof_byt
tx_window[retx.sn].buf->N_bytes,
tx_window[retx.sn].retx_count + 1,
cfg.max_retx_thresh);
logger.debug("%s", rlc_amd_pdu_header_to_string(new_header).c_str());
logger.debug("%s", rlc_amd_pdu_header_to_string(new_header).data());
debug_state();
return (ptr - payload) + tx_window[retx.sn].buf->N_bytes;
@ -1026,7 +1026,7 @@ int rlc_am_lte::rlc_am_lte_tx::build_data_pdu(uint8_t* payload, uint32_t nof_byt
memcpy(ptr, buffer_ptr->msg, buffer_ptr->N_bytes);
int total_len = (ptr - payload) + buffer_ptr->N_bytes;
logger.info(payload, total_len, "%s Tx PDU SN=%d (%d B)", RB_NAME, header.sn, total_len);
logger.debug("%s", rlc_amd_pdu_header_to_string(header).c_str());
logger.debug("%s", rlc_amd_pdu_header_to_string(header).data());
debug_state();
return total_len;
@ -1045,7 +1045,7 @@ void rlc_am_lte::rlc_am_lte_tx::handle_control_pdu(uint8_t* payload, uint32_t no
rlc_status_pdu_t status;
rlc_am_read_status_pdu(payload, nof_bytes, &status);
logger.info("%s Rx Status PDU: %s", RB_NAME, rlc_am_status_pdu_to_string(&status).c_str());
logger.info("%s Rx Status PDU: %s", RB_NAME, rlc_am_status_pdu_to_string(&status).data());
// Sec 5.2.2.2, stop poll reTx timer if status PDU comprises a positive _or_ negative acknowledgement
// for the RLC data PDU with sequence number poll_sn
@ -1074,10 +1074,10 @@ void rlc_am_lte::rlc_am_lte_tx::handle_control_pdu(uint8_t* payload, uint32_t no
if (!retx_queue.has_sn(i)) {
rlc_amd_retx_t& retx = retx_queue.push();
assert(tx_window[i].rlc_sn == i);
retx.sn = i;
retx.is_segment = false;
retx.so_start = 0;
retx.so_end = pdu.buf->N_bytes;
retx.sn = i;
retx.is_segment = false;
retx.so_start = 0;
retx.so_end = pdu.buf->N_bytes;
if (status.nacks[j].has_so) {
// sanity check
@ -1350,7 +1350,7 @@ void rlc_am_lte::rlc_am_lte_rx::handle_data_pdu(uint8_t* payload, uint32_t nof_b
std::map<uint32_t, rlc_amd_rx_pdu_t>::iterator it;
logger.info(payload, nof_bytes, "%s Rx data PDU SN=%d (%d B)", RB_NAME, header.sn, nof_bytes);
logger.debug("%s", rlc_amd_pdu_header_to_string(header).c_str());
logger.debug("%s", rlc_amd_pdu_header_to_string(header).data());
// sanity check for segments not exceeding PDU length
if (header.N_li > 0) {
@ -1384,7 +1384,7 @@ void rlc_am_lte::rlc_am_lte_rx::handle_data_pdu(uint8_t* payload, uint32_t nof_b
// Write to rx window
rlc_amd_rx_pdu_t& pdu = rx_window.add_pdu(header.sn);
pdu.buf = srslte::make_byte_buffer();
pdu.buf = srslte::make_byte_buffer();
if (pdu.buf == NULL) {
#ifdef RLC_AM_BUFFER_DEBUG
srslte::console("Fatal Error: Couldn't allocate PDU in handle_data_pdu().\n");
@ -1476,7 +1476,7 @@ void rlc_am_lte::rlc_am_lte_rx::handle_data_pdu_segment(uint8_t* pa
nof_bytes,
header.so,
header.N_li);
logger.debug("%s", rlc_amd_pdu_header_to_string(header).c_str());
logger.debug("%s", rlc_amd_pdu_header_to_string(header).data());
// Check inside rx window
if (!inside_rx_window(header.sn)) {
@ -1941,8 +1941,8 @@ bool rlc_am_lte::rlc_am_lte_rx::add_segment_and_check(rlc_amd_rx_pdu_segments_t*
logger.debug("Starting header reconstruction of %zd segments", pdu->segments.size());
// Reconstruct li fields
uint16_t count = 0;
uint16_t carryover = 0;
uint16_t count = 0;
uint16_t carryover = 0;
uint16_t consumed_bytes = 0; // rolling sum of all allocated LIs during segment reconstruction
for (it = pdu->segments.begin(); it != pdu->segments.end(); ++it) {
@ -1954,7 +1954,10 @@ bool rlc_am_lte::rlc_am_lte_rx::add_segment_and_check(rlc_amd_rx_pdu_segments_t*
total_pdu_offset += it->header.li[k];
}
logger.debug(" - (total_pdu_offset=%d, consumed_bytes=%d, header.li[i]=%d)",total_pdu_offset, consumed_bytes, header.li[i]);
logger.debug(" - (total_pdu_offset=%d, consumed_bytes=%d, header.li[i]=%d)",
total_pdu_offset,
consumed_bytes,
header.li[i]);
if (total_pdu_offset > header.li[i] && total_pdu_offset > consumed_bytes) {
header.li[header.N_li] = total_pdu_offset - consumed_bytes;
consumed_bytes = total_pdu_offset;
@ -2335,23 +2338,22 @@ bool rlc_am_is_pdu_segment(uint8_t* payload)
return ((*(payload) >> 6) & 0x01) == 1;
}
std::string rlc_am_status_pdu_to_string(rlc_status_pdu_t* status)
fmt::memory_buffer rlc_am_status_pdu_to_string(rlc_status_pdu_t* status)
{
std::stringstream ss;
ss << "ACK_SN = " << status->ack_sn;
ss << ", N_nack = " << status->N_nack;
fmt::memory_buffer buffer;
fmt::format_to(buffer, "ACK_SN = {}, N_nack = {}", status->ack_sn, status->N_nack);
if (status->N_nack > 0) {
ss << ", NACK_SN = ";
for (uint32_t i = 0; i < status->N_nack; i++) {
fmt::format_to(buffer, ", NACK_SN = ");
for (uint32_t i = 0; i < status->N_nack; ++i) {
if (status->nacks[i].has_so) {
ss << "[" << status->nacks[i].nack_sn << " " << status->nacks[i].so_start << ":" << status->nacks[i].so_end
<< "]";
fmt::format_to(
buffer, "[{} {}:{}]", status->nacks[i].nack_sn, status->nacks[i].so_start, status->nacks[i].so_end);
} else {
ss << "[" << status->nacks[i].nack_sn << "]";
fmt::format_to(buffer, "[{}]", status->nacks[i].nack_sn);
}
}
}
return ss.str();
return buffer;
}
std::string rlc_am_undelivered_sdu_info_to_string(const std::map<uint32_t, pdcp_sdu_info_t>& info_queue)
@ -2376,26 +2378,28 @@ std::string rlc_am_undelivered_sdu_info_to_string(const std::map<uint32_t, pdcp_
return str;
}
std::string rlc_amd_pdu_header_to_string(const rlc_amd_pdu_header_t& header)
fmt::memory_buffer rlc_amd_pdu_header_to_string(const rlc_amd_pdu_header_t& header)
{
std::stringstream ss;
ss << "[" << rlc_dc_field_text[header.dc];
ss << ", RF=" << (header.rf ? "1" : "0");
ss << ", P=" << (header.p ? "1" : "0");
ss << ", FI=" << (header.fi ? "1" : "0");
ss << ", SN=" << header.sn;
ss << ", LSF=" << (header.lsf ? "1" : "0");
ss << ", SO=" << header.so;
ss << ", N_li=" << header.N_li;
fmt::memory_buffer buffer;
fmt::format_to(buffer,
"[{}, RF={}, P={}, FI={}, SN={}, LSF={}, SO={}, N_li={}",
rlc_dc_field_text[header.dc],
(header.rf ? "1" : "0"),
(header.p ? "1" : "0"),
(header.fi ? "1" : "0"),
header.sn,
(header.lsf ? "1" : "0"),
header.so,
header.N_li);
if (header.N_li > 0) {
ss << " (";
for (uint32_t i = 0; i < header.N_li; i++) {
ss << header.li[i] << ", ";
fmt::format_to(buffer, " ({}", header.li[0]);
for (uint32_t i = 1; i < header.N_li; ++i) {
fmt::format_to(buffer, ", {}", header.li[i]);
}
ss << ")";
fmt::format_to(buffer, ")");
}
ss << "]";
return ss.str();
fmt::format_to(buffer, "]");
return buffer;
}
bool rlc_am_start_aligned(const uint8_t fi)

View File

@ -2455,7 +2455,7 @@ int header_reconstruction_test(srslte::log_sink_message_spy& spy)
/// 13:35:16.337011 [RLC_1] [I] DRB1 Tx PDU SN=277 (20 B)
/// 0000: 9d 15 80 20 0a 23 23 24 24 24 24 24 24 24 24 24
/// 0010: 24 25 25 25
/// 13:35:16.337016 [RLC_1] [D] [Data PDU, RF=0, P=0, FI=1, SN=277, LSF=0, SO=0, N_li=2 (2, 10, )]
/// 13:35:16.337016 [RLC_1] [D] [Data PDU, RF=0, P=0, FI=1, SN=277, LSF=0, SO=0, N_li=2 (2, 10)]
// 2nd retransmission with SO=9
std::array<uint8_t, 12> tv2 = {0xdd, 0x15, 0x80, 0x09, 0x00, 0x30, 0x24, 0x24, 0x24, 0x25, 0x25, 0x25};
@ -2496,7 +2496,7 @@ int header_reconstruction_test(srslte::log_sink_message_spy& spy)
rlc1.write_pdu(pdu_tv3.msg, pdu_tv3.N_bytes);
// Check RLC re-assembled message header
TESTASSERT(spy.has_message("[Data PDU, RF=0, P=0, FI=1, SN=277, LSF=0, SO=0, N_li=2 (2, 10, )]"));
TESTASSERT(spy.has_message("[Data PDU, RF=0, P=0, FI=1, SN=277, LSF=0, SO=0, N_li=2 (2, 10)]"));
#if HAVE_PCAP
pcap.close();
@ -2560,7 +2560,7 @@ int header_reconstruction_test2(srslte::log_sink_message_spy& spy)
rlc1.write_pdu(pdu_tv3.msg, pdu_tv3.N_bytes);
// Check RLC re-assembled message header
TESTASSERT(spy.has_message("[Data PDU, RF=0, P=0, FI=1, SN=199, LSF=0, SO=0, N_li=2 (3, 10, )]"));
TESTASSERT(spy.has_message("[Data PDU, RF=0, P=0, FI=1, SN=199, LSF=0, SO=0, N_li=2 (3, 10)]"));
#if HAVE_PCAP
pcap.close();
@ -2576,7 +2576,7 @@ int header_reconstruction_test3(srslte::log_sink_message_spy& spy)
// 11:13:25.994566 [RLC_1] [I] DRB1 Tx PDU SN=206 (18 B)
// 0000: 8c ce 00 a0 db db db db db db db db db db dc dc
// 0010: dc dc
// 11:13:25.994571 [RLC_1] [D] [Data PDU, RF=0, P=0, FI=1, SN=206, LSF=0, SO=0, N_li=1 (10, )]
// 11:13:25.994571 [RLC_1] [D] [Data PDU, RF=0, P=0, FI=1, SN=206, LSF=0, SO=0, N_li=1 (10)]
// 11:13:25.995744 [RLC_1] [I] DRB1 Retx PDU segment SN=206 [so=8] (12 B) (attempt 2/16)
// 0000: dc ce 80 08 00 20 db db dc dc dc dc
@ -2622,7 +2622,7 @@ int header_reconstruction_test3(srslte::log_sink_message_spy& spy)
rlc1.write_pdu(pdu_tv1.msg, pdu_tv1.N_bytes);
// Check RLC re-assembled message header
TESTASSERT(spy.has_message("[Data PDU, RF=0, P=0, FI=1, SN=206, LSF=0, SO=0, N_li=1 (10, )]"));
TESTASSERT(spy.has_message("[Data PDU, RF=0, P=0, FI=1, SN=206, LSF=0, SO=0, N_li=1 (10)]"));
#if HAVE_PCAP
pcap.close();
@ -2637,20 +2637,20 @@ int header_reconstruction_test4(srslte::log_sink_message_spy& spy)
// 15:32:20.667043 [RLC_1] [I] DRB1 Tx PDU SN=172 (22 B)
// 0000: 9c ac 80 10 0a af b0 b0 b0 b0 b0 b0 b0 b0 b0 b0
// 0010: b1 b1 b1 b1 b1 b1
// 15:32:20.667048 [RLC_1] [D] [Data PDU, RF=0, P=0, FI=1, SN=172, LSF=0, SO=0, N_li=2 (1, 10, )]
// 15:32:20.667048 [RLC_1] [D] [Data PDU, RF=0, P=0, FI=1, SN=172, LSF=0, SO=0, N_li=2 (1, 10)]
// 15:32:20.668094 [RLC_1] [I] DRB1 Retx PDU segment SN=172 [so=0] (14 B) (attempt 2/16)
// 0000: dc ac 00 00 00 10 af b0 b0 b0 b0 b0 b0 b0
// 15:32:20.668100 [RLC_2] [I] DRB1 Rx data PDU segment of SN=172 (8 B), SO=0, N_li=1
// 0000: af b0 b0 b0 b0 b0 b0 b0
// 15:32:20.668105 [RLC_2] [D] [Data PDU, RF=1, P=0, FI=1, SN=172, LSF=0, SO=0, N_li=1 (1, )]
// 15:32:20.668105 [RLC_2] [D] [Data PDU, RF=1, P=0, FI=1, SN=172, LSF=0, SO=0, N_li=1 (1)]
std::array<uint8_t, 14> tv1 = {0xdc, 0xac, 0x00, 0x00, 0x00, 0x10, 0xaf, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0};
// 15:32:20.668497 [RLC_1] [I] DRB1 Retx PDU segment SN=172 [so=0] (12 B) (attempt 3/16)
// 0000: fc ac 00 00 00 10 af b0 b0 b0 b0 b0
// 15:32:20.668502 [RLC_2] [I] DRB1 Rx data PDU segment of SN=172 (6 B), SO=0, N_li=1
// 0000: af b0 b0 b0 b0 b0
// 15:32:20.668507 [RLC_2] [D] [Data PDU, RF=1, P=1, FI=1, SN=172, LSF=0, SO=0, N_li=1 (1, )]
// 15:32:20.668507 [RLC_2] [D] [Data PDU, RF=1, P=1, FI=1, SN=172, LSF=0, SO=0, N_li=1 (1)]
std::array<uint8_t, 12> tv2 = {0xfc, 0xac, 0x00, 0x00, 0x00, 0x10, 0xaf, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0};
// 15:32:20.668575 [RLC_1] [I] DRB1 Retx PDU segment SN=172 [so=6] (7 B) (attempt 3/16)
@ -2665,7 +2665,7 @@ int header_reconstruction_test4(srslte::log_sink_message_spy& spy)
// 0000: dc ac 80 09 00 20 b0 b0 b1 b1 b1 b1 b1 b1
// 15:32:20.668671 [RLC_2] [I] DRB1 Rx data PDU segment of SN=172 (8 B), SO=9, N_li=1
// 0000: b0 b0 b1 b1 b1 b1 b1 b1
// 15:32:20.668675 [RLC_2] [D] [Data PDU, RF=1, P=0, FI=1, SN=172, LSF=1, SO=9, N_li=1 (2, )]
// 15:32:20.668675 [RLC_2] [D] [Data PDU, RF=1, P=0, FI=1, SN=172, LSF=1, SO=9, N_li=1 (2)]
std::array<uint8_t, 14> tv4 = {0xdc, 0xac, 0x80, 0x09, 0x00, 0x20, 0xb0, 0xb0, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1};
byte_buffer_t pdu_tv1;
@ -2712,7 +2712,7 @@ int header_reconstruction_test4(srslte::log_sink_message_spy& spy)
rlc1.write_pdu(pdu_tv4.msg, pdu_tv4.N_bytes);
// Check RLC re-assembled message header
TESTASSERT(spy.has_message("[Data PDU, RF=0, P=0, FI=1, SN=172, LSF=0, SO=0, N_li=2 (1, 10, )]"));
TESTASSERT(spy.has_message("[Data PDU, RF=0, P=0, FI=1, SN=172, LSF=0, SO=0, N_li=2 (1, 10)]"));
#if HAVE_PCAP
pcap.close();
@ -2727,7 +2727,7 @@ int header_reconstruction_test5(srslte::log_sink_message_spy& spy)
// 18:46:22.372858 [RLC_1] [I] DRB1 Tx PDU SN=222 (22 B)
// 0000: bc de 80 30 0a ee ee ee ef ef ef ef ef ef ef ef
// 0010: ef ef f0 f0 f0 f0
// 18:46:22.372863 [RLC_1] [D] [Data PDU, RF=0, P=1, FI=1, SN=222, LSF=0, SO=0, N_li=2 (3, 10, )]
// 18:46:22.372863 [RLC_1] [D] [Data PDU, RF=0, P=1, FI=1, SN=222, LSF=0, SO=0, N_li=2 (3, 10)]
// 18:46:22.373623 [RLC_1] [I] DRB1 Retx PDU segment SN=222 [so=0] (7 B) (attempt 2/16)
// 0000: d0 de 00 00 ee ee ee
@ -2788,7 +2788,7 @@ int header_reconstruction_test5(srslte::log_sink_message_spy& spy)
rlc1.write_pdu(pdu_tv2.msg, pdu_tv2.N_bytes);
// Check RLC re-assembled message header
TESTASSERT(spy.has_message("[Data PDU, RF=0, P=0, FI=1, SN=222, LSF=0, SO=0, N_li=2 (3, 10, )]"));
TESTASSERT(spy.has_message("[Data PDU, RF=0, P=0, FI=1, SN=222, LSF=0, SO=0, N_li=2 (3, 10)]"));
#if HAVE_PCAP
pcap.close();
@ -2803,7 +2803,7 @@ int header_reconstruction_test6(srslte::log_sink_message_spy& spy)
// 21:50:12.709646 [RLC_1] [I] DRB1 Tx PDU SN=509 (20 B)
// 0000: 9d fd 80 40 0a b1 b1 b1 b1 b2 b2 b2 b2 b2 b2 b2
// 0010: b2 b2 b2 b3
// 21:50:12.709653 [RLC_1] [D] [Data PDU, RF=0, P=0, FI=1, SN=509, LSF=0, SO=0, N_li=2 (4, 10, )]]
// 21:50:12.709653 [RLC_1] [D] [Data PDU, RF=0, P=0, FI=1, SN=509, LSF=0, SO=0, N_li=2 (4, 10)]]
// 21:50:12.711022 [RLC_1] [I] DRB1 Retx PDU segment SN=509 [so=0] (5 B) (attempt 3/16)
// 0000: d9 fd 00 00 b1
@ -2824,7 +2824,7 @@ int header_reconstruction_test6(srslte::log_sink_message_spy& spy)
// 0010: b3
// 21:50:12.711210 [RLC_2] [I] DRB1 Rx data PDU segment of SN=509 (11 B), SO=4, N_li=1
// 0000: b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b3
// 21:50:12.711216 [RLC_2] [D] [Data PDU, RF=1, P=1, FI=1, SN=509, LSF=1, SO=4, N_li=1 (10, )]
// 21:50:12.711216 [RLC_2] [D] [Data PDU, RF=1, P=1, FI=1, SN=509, LSF=1, SO=4, N_li=1 (10)]
std::array<uint8_t, 17> tv2 = {
0xed, 0xfd, 0x80, 0x04, 0x00, 0xa0, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb3};
@ -2867,7 +2867,7 @@ int header_reconstruction_test6(srslte::log_sink_message_spy& spy)
rlc1.write_pdu(pdu_tv2.msg, pdu_tv2.N_bytes);
// Check RLC re-assembled message header
TESTASSERT(spy.has_message("[Data PDU, RF=0, P=1, FI=1, SN=509, LSF=0, SO=0, N_li=2 (4, 10, )]"));
TESTASSERT(spy.has_message("[Data PDU, RF=0, P=1, FI=1, SN=509, LSF=0, SO=0, N_li=2 (4, 10)]"));
#if HAVE_PCAP
pcap.close();
@ -2882,7 +2882,7 @@ int header_reconstruction_test7(srslte::log_sink_message_spy& spy)
// 22:14:54.646530 [RLC_1] [I] DRB1 Tx PDU SN=282 (19 B)
// 0000: 9d 1a 80 10 0a 28 29 29 29 29 29 29 29 29 29 29
// 0010: 2a 2a 2a
// 22:14:54.646535 [RLC_1] [D] [Data PDU, RF=0, P=0, FI=1, SN=282, LSF=0, SO=0, N_li=2 (1, 10, )]
// 22:14:54.646535 [RLC_1] [D] [Data PDU, RF=0, P=0, FI=1, SN=282, LSF=0, SO=0, N_li=2 (1, 10)]
// 22:14:54.648484 [RLC_1] [I] DRB1 Retx PDU segment SN=282 [so=2] (6 B) (attempt 2/16)
// 0000: f9 1a 00 02 29 29
@ -2970,7 +2970,7 @@ int header_reconstruction_test7(srslte::log_sink_message_spy& spy)
rlc1.write_pdu(pdu_tv4.msg, pdu_tv4.N_bytes);
// Check RLC re-assembled message header
TESTASSERT(spy.has_message("[Data PDU, RF=0, P=0, FI=1, SN=282, LSF=0, SO=0, N_li=2 (1, 10, )]"));
TESTASSERT(spy.has_message("[Data PDU, RF=0, P=0, FI=1, SN=282, LSF=0, SO=0, N_li=2 (1, 10)]"));
#if HAVE_PCAP
pcap.close();
@ -2986,14 +2986,14 @@ int header_reconstruction_test8(srslte::log_sink_message_spy& spy)
// 0000: b5 a7 80 38 0a 00 a0 77 77 77 78 78 78 78 78 78
// 0010: 78 78 78 78 79 79 79 79 79 79 79 79 79 79 7a 7a
// 0020: 7a 7a 7a 7a 7a 7a 7a 7a
// 21:23:34.407724 [RLC_1] [D] [Data PDU, RF=0, P=1, FI=1, SN=423, LSF=0, SO=0, N_li=3 (3, 10, 10, )]
// 21:23:34.407724 [RLC_1] [D] [Data PDU, RF=0, P=1, FI=1, SN=423, LSF=0, SO=0, N_li=3 (3, 10, 10)]
// 21:23:34.408815 [RLC_1] [I] DRB1 Retx PDU segment SN=423 [so=0] (18 B) (attempt 2/8)
// 0000: fd a7 00 00 00 30 77 77 77 78 78 78 78 78 78 78
// 0010: 78 78
// 21:23:34.408822 [RLC_2] [I] DRB1 Rx data PDU segment of SN=423 (12 B), SO=0, N_li=1
// 0000: 77 77 77 78 78 78 78 78 78 78 78 78
// 21:23:34.408828 [RLC_2] [D] [Data PDU, RF=1, P=1, FI=1, SN=423, LSF=0, SO=0, N_li=1 (3, )]
// 21:23:34.408828 [RLC_2] [D] [Data PDU, RF=1, P=1, FI=1, SN=423, LSF=0, SO=0, N_li=1 (3)]
std::array<uint8_t, 18> tv0 = {
0xfd, 0xa7, 0x00, 0x00, 0x00, 0x30, 0x77, 0x77, 0x77, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78};
@ -3002,7 +3002,7 @@ int header_reconstruction_test8(srslte::log_sink_message_spy& spy)
// 0010: 79
// 21:23:34.408919 [RLC_2] [I] DRB1 Rx data PDU segment of SN=423 (11 B), SO=12, N_li=1
// 0000: 78 79 79 79 79 79 79 79 79 79 79
// 21:23:34.408925 [RLC_2] [D] [Data PDU, RF=1, P=1, FI=1, SN=423, LSF=0, SO=12, N_li=1 (1, )]
// 21:23:34.408925 [RLC_2] [D] [Data PDU, RF=1, P=1, FI=1, SN=423, LSF=0, SO=12, N_li=1 (1)]
std::array<uint8_t, 17> tv1 = {
0xf5, 0xa7, 0x00, 0x0c, 0x00, 0x10, 0x78, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79};
@ -3011,7 +3011,7 @@ int header_reconstruction_test8(srslte::log_sink_message_spy& spy)
// 0010: 78 78 78
// 21:23:34.409433 [RLC_2] [I] DRB1 Rx data PDU segment of SN=423 (13 B), SO=0, N_li=1
// 0000: 77 77 77 78 78 78 78 78 78 78 78 78 78
// 21:23:34.409440 [RLC_2] [D] [Data PDU, RF=1, P=1, FI=1, SN=423, LSF=0, SO=0, N_li=1 (3, )]
// 21:23:34.409440 [RLC_2] [D] [Data PDU, RF=1, P=1, FI=1, SN=423, LSF=0, SO=0, N_li=1 (3)]
std::array<uint8_t, 19> tv2 = {
0xf5, 0xa7, 0x00, 0x00, 0x00, 0x30, 0x77, 0x77, 0x77, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78};
@ -3021,7 +3021,7 @@ int header_reconstruction_test8(srslte::log_sink_message_spy& spy)
// 21:23:34.409531 [RLC_2] [I] DRB1 Rx data PDU segment of SN=423 (20 B), SO=13, N_li=1
// 0000: 79 79 79 79 79 79 79 79 79 79 7a 7a 7a 7a 7a 7a
// 0010: 7a 7a 7a 7a
// 21:23:34.409537 [RLC_2] [D] [Data PDU, RF=1, P=1, FI=0, SN=423, LSF=1, SO=13, N_li=1 (10, )]
// 21:23:34.409537 [RLC_2] [D] [Data PDU, RF=1, P=1, FI=0, SN=423, LSF=1, SO=13, N_li=1 (10)]
std::array<uint8_t, 26> tv3 = {0xe5, 0xa7, 0x80, 0x0d, 0x00, 0xa0, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79,
0x79, 0x79, 0x79, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a};
@ -3071,7 +3071,7 @@ int header_reconstruction_test8(srslte::log_sink_message_spy& spy)
rlc1.write_pdu(pdu_tv3.msg, pdu_tv3.N_bytes);
// Check RLC re-assembled message header
TESTASSERT(spy.has_message("[Data PDU, RF=0, P=1, FI=1, SN=423, LSF=0, SO=0, N_li=3 (3, 10, 10, )]"));
TESTASSERT(spy.has_message("[Data PDU, RF=0, P=1, FI=1, SN=423, LSF=0, SO=0, N_li=3 (3, 10, 10)]"));
return SRSLTE_SUCCESS;
}