From 2cfc657fbb6ade25bbf9fa527b383bc2de822cd8 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Thu, 18 Mar 2021 13:19:33 +0100 Subject: [PATCH] rlc_am_lte: refactor logging when PDCP SDUs are enqueued the patch refactor the logging when a new PDCP SDU is enqueued for transmission at RLC. If the SN is already present, only a warning is logged. From the RLC perspective operation continues and the SDU will be transmitted. The patch also changes the order of logs. When the SN cannot be inserted inside the queue of undelivered SDUs, only one message is logged. --- lib/src/upper/rlc_am_lte.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/src/upper/rlc_am_lte.cc b/lib/src/upper/rlc_am_lte.cc index 4bf230413..98df5c952 100644 --- a/lib/src/upper/rlc_am_lte.cc +++ b/lib/src/upper/rlc_am_lte.cc @@ -439,15 +439,14 @@ int rlc_am_lte::rlc_am_lte_tx::write_sdu(unique_byte_buffer_t sdu) return SRSLTE_ERROR; } - // Store SDU info - logger.debug( - "Storing PDCP SDU info in queue. PDCP_SN=%d, Queue Size=%ld", sdu_pdcp_sn, undelivered_sdu_info_queue.nof_sdus()); - if (undelivered_sdu_info_queue.has_pdcp_sn(sdu_pdcp_sn)) { - logger.error("PDCP SDU info already exists. SN=%d", sdu_pdcp_sn); + logger.warning("PDCP_SN=%d already marked as undelivered", sdu_pdcp_sn); return SRSLTE_ERROR; } + // Store SDU info + logger.debug("Marking PDCP_SN=%d as undelivered (queue_len=%ld)", sdu_pdcp_sn, undelivered_sdu_info_queue.nof_sdus()); + undelivered_sdu_info_queue.add_pdcp_sdu(sdu_pdcp_sn); return SRSLTE_SUCCESS; }