From 597729ac53f27ed70cfb6f2bd1259954b55b814e Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Mon, 26 Apr 2021 10:21:10 +0200 Subject: [PATCH] rlc: always remove PDCP SNs from undelivered queue if RLC PDUs with certain PDCP SNs were already in flight when their discard timer at PDCP expires, they weren't remove from the undelivered_sdu_info_queue causing indesired log entries like: 08:08:52.455280 [RLC ] [W] PDCP_SN=2103 already marked as undelivered when the SN was sent again (after wrap around). The patch makes sure to always try to delete the PDCP SN from the queue. It should fix (at least partly) #2560 --- lib/src/upper/rlc_am_lte.cc | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/src/upper/rlc_am_lte.cc b/lib/src/upper/rlc_am_lte.cc index e0ee95767..edb6e5f1c 100644 --- a/lib/src/upper/rlc_am_lte.cc +++ b/lib/src/upper/rlc_am_lte.cc @@ -530,16 +530,13 @@ void rlc_am_lte::rlc_am_lte_tx::discard_sdu(uint32_t discard_sn) return false; }); - if (discarded) { - // remove also from undelivered SDUs queue - logger.info("Discarding SDU with PDCP_SN=%d", discard_sn); - if (not undelivered_sdu_info_queue.has_pdcp_sn(discard_sn)) { - logger.info("PDCP SDU info does not exists for discarded SDU. PDCP_SN=%d", discard_sn); - } else { - undelivered_sdu_info_queue.clear_pdcp_sdu(discard_sn); - } + logger.info("%s PDU with PDCP_SN=%d", discarded ? "Discarding" : "Couldn't discard", discard_sn); + + // always try remove from undelivered SDUs queue + if (not undelivered_sdu_info_queue.has_pdcp_sn(discard_sn)) { + logger.info("PDCP SDU info does not exists for discarded SDU. PDCP_SN=%d", discard_sn); } else { - logger.info("Could not find SDU to discard. PDCP_SN=%d", discard_sn); + undelivered_sdu_info_queue.clear_pdcp_sdu(discard_sn); } }