From 48537f3fe7702c9dddc976c5f280f7ad25a15b1f Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Sun, 11 Apr 2021 20:43:18 +0200 Subject: [PATCH] pdcp,rlc: increase number of PDCP SDUs for notification from RLC the current value of 256 limits the number of PDCP SDUs that can be notified from RLC. The limit is quickly hit when too many SDUs are in flight. This can cause unwanted log entries and weird PDCP behaviour. the patch increases the value to 1024, which still can be too few if many smaller SDUs are traveling. The patch also set the log level to warning to quicker spot misconfigs in logs. Fixes #2616 --- lib/include/srsran/interfaces/pdcp_interface_types.h | 5 +++-- lib/include/srsran/upper/pdcp_entity_lte.h | 2 +- lib/include/srsran/upper/rlc_am_lte.h | 3 +++ lib/src/upper/pdcp_entity_lte.cc | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/include/srsran/interfaces/pdcp_interface_types.h b/lib/include/srsran/interfaces/pdcp_interface_types.h index 534bb78f9..399c3c534 100644 --- a/lib/include/srsran/interfaces/pdcp_interface_types.h +++ b/lib/include/srsran/interfaces/pdcp_interface_types.h @@ -170,8 +170,9 @@ struct pdcp_lte_state_t { }; // Custom type for interface between PDCP and RLC to convey SDU delivery status -#define MAX_SDUS_PER_RLC_PDU (256) // default to RLC SDU queue length -#define MAX_SDUS_TO_NOTIFY (MAX_SDUS_PER_RLC_PDU) // Arbitrarily chosen limit +// Arbitrarily chosen limit, optimal value depends on the RLC (pollPDU) and PDCP config, channel BLER, +// traffic characterisitcs, etc. The chosen value has been tested with 100 PRB bi-dir TCP +#define MAX_SDUS_TO_NOTIFY (1024) typedef srsran::bounded_vector pdcp_sn_vector_t; } // namespace srsran diff --git a/lib/include/srsran/upper/pdcp_entity_lte.h b/lib/include/srsran/upper/pdcp_entity_lte.h index 2e7facf83..a8b96bb03 100644 --- a/lib/include/srsran/upper/pdcp_entity_lte.h +++ b/lib/include/srsran/upper/pdcp_entity_lte.h @@ -83,7 +83,7 @@ private: uint32_t count = 0; uint32_t bytes = 0; - uint32_t fms = 0; + uint32_t fms = 0; // SN of the first missing PDCP SDU uint32_t lms = 0; srsran::circular_array sdus; }; diff --git a/lib/include/srsran/upper/rlc_am_lte.h b/lib/include/srsran/upper/rlc_am_lte.h index c20cd6724..7fe3e80f9 100644 --- a/lib/include/srsran/upper/rlc_am_lte.h +++ b/lib/include/srsran/upper/rlc_am_lte.h @@ -345,6 +345,9 @@ private: // Mutexes std::mutex mutex; + + // default to RLC SDU queue length + const uint32_t MAX_SDUS_PER_RLC_PDU = RLC_TX_QUEUE_LEN; }; // Receiver sub-class diff --git a/lib/src/upper/pdcp_entity_lte.cc b/lib/src/upper/pdcp_entity_lte.cc index d57decab3..8401e8180 100644 --- a/lib/src/upper/pdcp_entity_lte.cc +++ b/lib/src/upper/pdcp_entity_lte.cc @@ -148,7 +148,7 @@ void pdcp_entity_lte::write_sdu(unique_byte_buffer_t sdu, int upper_sn) if (!rlc->rb_is_um(lcid) and is_drb()) { if (not store_sdu(used_sn, sdu)) { // Could not store the SDU, discarding - logger.info("Could not store SDU. Discarding %d\n", used_sn); + logger.warning("Could not store SDU. Discarding SN=%d", used_sn); return; } } @@ -688,7 +688,7 @@ bool pdcp_entity_lte::store_sdu(uint32_t sn, const unique_byte_buffer_t& sdu) // Discard Timer Callback (discardTimer) void pdcp_entity_lte::discard_callback::operator()(uint32_t timer_id) { - parent->logger.debug("Discard timer expired for PDU with SN = %d", discard_sn); + parent->logger.info("Discard timer for SN=%d expired", discard_sn); // Notify the RLC of the discard. It's the RLC to actually discard, if no segment was transmitted yet. parent->rlc->discard_sdu(parent->lcid, discard_sn);