From 84cf5c30ec7f7f1871d831ffacde06a310f4caa0 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Tue, 17 May 2022 10:32:27 +0100 Subject: [PATCH 01/11] lib,pdcp_nr: rm ifdef to select PDCP NR. PDCP NR is always selected now --- lib/src/pdcp/pdcp.cc | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/src/pdcp/pdcp.cc b/lib/src/pdcp/pdcp.cc index b423aa286..0328520b0 100644 --- a/lib/src/pdcp/pdcp.cc +++ b/lib/src/pdcp/pdcp.cc @@ -111,12 +111,7 @@ int pdcp::add_bearer(uint32_t lcid, const pdcp_config_t& cfg) if (cfg.rat == srsran::srsran_rat_t::lte) { entity.reset(new pdcp_entity_lte{rlc, rrc, gw, task_sched, logger, lcid}); } else if (cfg.rat == srsran::srsran_rat_t::nr) { -#ifdef USE_PDCP_NR -#pragma message "Compiling with PDCP NR entity" entity.reset(new pdcp_entity_nr{rlc, rrc, gw, task_sched, logger, lcid}); -#else - entity.reset(new pdcp_entity_lte{rlc, rrc, gw, task_sched, logger, lcid}); -#endif } if (not entity->configure(cfg)) { From cc93b5b6b053b18b0cfbaf00161163752512fef6 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Wed, 18 May 2022 15:01:38 +0100 Subject: [PATCH 02/11] ue,gnb,rrc_nr: make sure that RLC is setup before PDCP, so the PDCP can know wether the RLC is UM or AM --- srsgnb/src/stack/rrc/rrc_nr_ue.cc | 18 ++++++++++++------ srsue/src/stack/rrc_nr/rrc_nr_procedures.cc | 8 ++++---- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/srsgnb/src/stack/rrc/rrc_nr_ue.cc b/srsgnb/src/stack/rrc/rrc_nr_ue.cc index 54f9e819f..09eec7bca 100644 --- a/srsgnb/src/stack/rrc/rrc_nr_ue.cc +++ b/srsgnb/src/stack/rrc/rrc_nr_ue.cc @@ -939,12 +939,14 @@ void rrc_nr::ue::send_connection_reest(uint8_t ncc) // set NCC reest.next_hop_chaining_count = ncc; - // add PDCP bearers - update_pdcp_bearers(next_radio_bearer_cfg, next_cell_group_cfg); - // add RLC bearers update_rlc_bearers(next_cell_group_cfg); + // add PDCP bearers + // this is done after updating the RLC bearers, + // so the PDCP can query the RLC mode + update_pdcp_bearers(next_radio_bearer_cfg, next_cell_group_cfg); + // add MAC bearers update_mac(next_cell_group_cfg, false); @@ -1010,12 +1012,14 @@ void rrc_nr::ue::send_rrc_setup() logger.debug("Containerized MasterCellGroup: %s", js.to_string().c_str()); } - // add PDCP bearers - update_pdcp_bearers(setup_ies.radio_bearer_cfg, next_cell_group_cfg); - // add RLC bearers update_rlc_bearers(next_cell_group_cfg); + // add PDCP bearers + // this is done after updating the RLC bearers, + // so the PDCP can query the RLC mode + update_pdcp_bearers(next_radio_bearer_cfg, next_cell_group_cfg); + // add MAC bearers update_mac(next_cell_group_cfg, false); @@ -1162,6 +1166,8 @@ void rrc_nr::ue::send_rrc_reconfiguration() update_rlc_bearers(master_cell_group); // add PDCP bearers + // this is done after updating the RLC bearers, + // so the PDCP can query the RLC mode update_pdcp_bearers(ies.radio_bearer_cfg, master_cell_group); } diff --git a/srsue/src/stack/rrc_nr/rrc_nr_procedures.cc b/srsue/src/stack/rrc_nr/rrc_nr_procedures.cc index 5bd11d332..006baf770 100644 --- a/srsue/src/stack/rrc_nr/rrc_nr_procedures.cc +++ b/srsue/src/stack/rrc_nr/rrc_nr_procedures.cc @@ -324,13 +324,13 @@ srsran::proc_outcome_t rrc_nr::connection_setup_proc::init(const asn1::rrc_nr::r // Stop T300 rrc_handle.t300.stop(); - // Apply the Radio Bearer configuration - if (!rrc_handle.apply_radio_bearer_cfg(radio_bearer_cfg_)) { + // Apply the Cell Group configuration + if (!rrc_handle.update_cell_group_cfg(cell_group_)) { return proc_outcome_t::error; } - // Apply the Cell Group configuration - if (!rrc_handle.update_cell_group_cfg(cell_group_)) { + // Apply the Radio Bearer configuration + if (!rrc_handle.apply_radio_bearer_cfg(radio_bearer_cfg_)) { return proc_outcome_t::error; } From e891d72ab87a7c99d386e12bd4d5041bcf8f3b64 Mon Sep 17 00:00:00 2001 From: Robert Falkenberg Date: Mon, 23 May 2022 10:09:03 +0200 Subject: [PATCH 03/11] lib,rlc_am_nr: fix out-of-bounds access when unpacking malformed status PDUs --- lib/src/rlc/rlc_am_nr_packing.cc | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/src/rlc/rlc_am_nr_packing.cc b/lib/src/rlc/rlc_am_nr_packing.cc index b7ba0a867..ea8617fa7 100644 --- a/lib/src/rlc/rlc_am_nr_packing.cc +++ b/lib/src/rlc/rlc_am_nr_packing.cc @@ -342,6 +342,12 @@ rlc_am_nr_read_status_pdu_12bit_sn(const uint8_t* payload, const uint32_t nof_by ptr++; while (e1 != 0) { + // check buffer headroom + if (uint32_t(ptr - payload) >= nof_bytes) { + fprintf(stderr, "Malformed PDU, trying to read more bytes than it is available\n"); + return 0; + } + // E1 flag set, read a NACK_SN rlc_status_nack_t nack = {}; nack.nack_sn = (*ptr & 0xff) << 4; @@ -376,10 +382,6 @@ rlc_am_nr_read_status_pdu_12bit_sn(const uint8_t* payload, const uint32_t nof_by ptr++; } status->push_nack(nack); - if (uint32_t(ptr - payload) > nof_bytes) { - fprintf(stderr, "Malformed PDU, trying to read more bytes than it is available\n"); - return 0; - } } return SRSRAN_SUCCESS; @@ -421,6 +423,12 @@ rlc_am_nr_read_status_pdu_18bit_sn(const uint8_t* payload, const uint32_t nof_by ptr++; while (e1 != 0) { + // check buffer headroom + if (uint32_t(ptr - payload) >= nof_bytes) { + fprintf(stderr, "Malformed PDU, trying to read more bytes than it is available\n"); + return 0; + } + // E1 flag set, read a NACK_SN rlc_status_nack_t nack = {}; @@ -458,10 +466,6 @@ rlc_am_nr_read_status_pdu_18bit_sn(const uint8_t* payload, const uint32_t nof_by ptr++; } status->push_nack(nack); - if (uint32_t(ptr - payload) > nof_bytes) { - fprintf(stderr, "Malformed PDU, trying to read more bytes than it is available\n"); - return 0; - } } return SRSRAN_SUCCESS; From 35c8c712e4515c01e2144f65d95f258a6ad3b581 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 13 May 2022 16:55:49 +0200 Subject: [PATCH 04/11] cmake: fix typo --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 694b6373a..88758dcee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,7 +71,7 @@ option(ENABLE_ZMQ_TEST "Enable ZMQ based E2E tests" OFF) option(BUILD_STATIC "Attempt to statically link external deps" OFF) option(RPATH "Enable RPATH" OFF) option(ENABLE_ASAN "Enable gcc/clang address sanitizer" OFF) -option(ENABLE_GCOV "Enable gcc/clang address sanitizer" OFF) +option(ENABLE_GCOV "Enable gcov" OFF) option(ENABLE_MSAN "Enable clang memory sanitizer" OFF) option(ENABLE_TSAN "Enable clang thread sanitizer" OFF) option(ENABLE_TIDY "Enable clang tidy" OFF) From d3a049bd7b8cb6dae3fc0444342b611f11a28c17 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 13 May 2022 16:57:00 +0200 Subject: [PATCH 05/11] readme: add github actions badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7d4070090..ed6633c16 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ srsRAN ====== +[![Build Status](https://github.com/srsran/srsRAN/actions/workflows/ccpp.yml/badge.svg?branch=master)](https://github.com/srsran/srsRAN/actions) [![Build Status](https://app.travis-ci.com/srsran/srsRAN.svg?branch=master)](https://app.travis-ci.com/github/srsran/srsRAN) [![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/srsran/srsRAN.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/srsran/srsRAN/context:cpp) [![Coverity](https://scan.coverity.com/projects/23045/badge.svg)](https://scan.coverity.com/projects/srsran) From bbd84f087ec676565c2580cd5be44f89471f01ff Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 13 May 2022 17:01:10 +0200 Subject: [PATCH 06/11] gnb,rrc: add error checking/handling when creating cellgroup cfg --- srsgnb/hdr/stack/rrc/cell_asn1_config.h | 10 ++++---- srsgnb/src/stack/rrc/cell_asn1_config.cc | 18 ++++++++----- srsgnb/src/stack/rrc/rrc_nr_ue.cc | 32 +++++++++++++++++++----- 3 files changed, 43 insertions(+), 17 deletions(-) diff --git a/srsgnb/hdr/stack/rrc/cell_asn1_config.h b/srsgnb/hdr/stack/rrc/cell_asn1_config.h index 2898acd20..4f7daf59b 100644 --- a/srsgnb/hdr/stack/rrc/cell_asn1_config.h +++ b/srsgnb/hdr/stack/rrc/cell_asn1_config.h @@ -44,11 +44,11 @@ bool compute_diff_radio_bearer_cfg(const rrc_nr_cfg_t& cfg, asn1::rrc_nr::radio_bearer_cfg_s& diff); /// Apply radioBearerConfig updates to CellGroupConfig -void fill_cellgroup_with_radio_bearer_cfg(const rrc_nr_cfg_t& cfg, - uint32_t rnti, - const enb_bearer_manager& bearer_mapper, - const asn1::rrc_nr::radio_bearer_cfg_s& bearers, - asn1::rrc_nr::cell_group_cfg_s& out); +int fill_cellgroup_with_radio_bearer_cfg(const rrc_nr_cfg_t& cfg, + uint32_t rnti, + const enb_bearer_manager& bearer_mapper, + const asn1::rrc_nr::radio_bearer_cfg_s& bearers, + asn1::rrc_nr::cell_group_cfg_s& out); } // namespace srsenb diff --git a/srsgnb/src/stack/rrc/cell_asn1_config.cc b/srsgnb/src/stack/rrc/cell_asn1_config.cc index 8ffce3f27..2a1a9d2fc 100644 --- a/srsgnb/src/stack/rrc/cell_asn1_config.cc +++ b/srsgnb/src/stack/rrc/cell_asn1_config.cc @@ -1331,11 +1331,11 @@ bool compute_diff_radio_bearer_cfg(const rrc_nr_cfg_t& cfg, diff.drb_to_add_mod_list.size() > 0; } -void fill_cellgroup_with_radio_bearer_cfg(const rrc_nr_cfg_t& cfg, - const uint32_t rnti, - const enb_bearer_manager& bearer_mapper, - const asn1::rrc_nr::radio_bearer_cfg_s& bearers, - asn1::rrc_nr::cell_group_cfg_s& out) +int fill_cellgroup_with_radio_bearer_cfg(const rrc_nr_cfg_t& cfg, + const uint32_t rnti, + const enb_bearer_manager& bearer_mapper, + const asn1::rrc_nr::radio_bearer_cfg_s& bearers, + asn1::rrc_nr::cell_group_cfg_s& out) { out.rlc_bearer_to_add_mod_list.clear(); out.rlc_bearer_to_release_list.clear(); @@ -1350,13 +1350,19 @@ void fill_cellgroup_with_radio_bearer_cfg(const rrc_nr_cfg_t& out.rlc_bearer_to_add_mod_list.push_back({}); uint32_t lcid = drb.drb_id + (int)srsran::nr_srb::count - 1; enb_bearer_manager::radio_bearer_t rb = bearer_mapper.get_lcid_bearer(rnti, lcid); - fill_drb(cfg, rb, (srsran::nr_drb)drb.drb_id, out.rlc_bearer_to_add_mod_list.back()); + if (rb.is_valid() and cfg.five_qi_cfg.find(rb.five_qi) != cfg.five_qi_cfg.end()) { + fill_drb(cfg, rb, (srsran::nr_drb)drb.drb_id, out.rlc_bearer_to_add_mod_list.back()); + } else { + return SRSRAN_ERROR; + } } // Release DRBs for (uint8_t drb_id : bearers.drb_to_release_list) { out.rlc_bearer_to_release_list.push_back(drb_id); } + + return SRSRAN_SUCCESS; } } // namespace srsenb diff --git a/srsgnb/src/stack/rrc/rrc_nr_ue.cc b/srsgnb/src/stack/rrc/rrc_nr_ue.cc index 09eec7bca..90aca8a02 100644 --- a/srsgnb/src/stack/rrc/rrc_nr_ue.cc +++ b/srsgnb/src/stack/rrc/rrc_nr_ue.cc @@ -900,8 +900,13 @@ void rrc_nr::ue::handle_rrc_reestablishment_request(const asn1::rrc_nr::rrc_rees // compute config and create SRB1 for new user asn1::rrc_nr::radio_bearer_cfg_s dummy_radio_bearer_cfg; // just to compute difference, it's never sent to UE compute_diff_radio_bearer_cfg(parent->cfg, radio_bearer_cfg, next_radio_bearer_cfg, dummy_radio_bearer_cfg); - fill_cellgroup_with_radio_bearer_cfg( - parent->cfg, old_rnti, *parent->bearer_mapper, dummy_radio_bearer_cfg, next_cell_group_cfg); + if (fill_cellgroup_with_radio_bearer_cfg( + parent->cfg, old_rnti, *parent->bearer_mapper, dummy_radio_bearer_cfg, next_cell_group_cfg) != + SRSRAN_SUCCESS) { + logger.error("Couldn't fill cellGroupCfg during RRC Reestablishment"); + send_rrc_reject(max_wait_time_secs); + return; + } // send RRC Reestablishment message and restore bearer configuration send_connection_reest(old_ue->sec_ctx.get_ncc()); @@ -996,8 +1001,14 @@ void rrc_nr::ue::send_rrc_setup() // - Setup masterCellGroup // - Derive master cell group config bearers - fill_cellgroup_with_radio_bearer_cfg( - parent->cfg, rnti, *parent->bearer_mapper, setup_ies.radio_bearer_cfg, next_cell_group_cfg); + if (fill_cellgroup_with_radio_bearer_cfg( + parent->cfg, rnti, *parent->bearer_mapper, setup_ies.radio_bearer_cfg, next_cell_group_cfg) != + SRSRAN_SUCCESS) { + logger.error("Couldn't fill cellGroupCfg during RRC Setup"); + send_rrc_reject(max_wait_time_secs); + return; + } + // - Pack masterCellGroup into container srsran::unique_byte_buffer_t pdu = parent->pack_into_pdu(next_cell_group_cfg, __FUNCTION__); if (pdu == nullptr) { @@ -1141,8 +1152,12 @@ void rrc_nr::ue::send_rrc_reconfiguration() // Fill masterCellGroup cell_group_cfg_s master_cell_group; master_cell_group.cell_group_id = 0; - fill_cellgroup_with_radio_bearer_cfg( - parent->cfg, rnti, *parent->bearer_mapper, ies.radio_bearer_cfg, master_cell_group); + if (fill_cellgroup_with_radio_bearer_cfg( + parent->cfg, rnti, *parent->bearer_mapper, ies.radio_bearer_cfg, master_cell_group) != SRSRAN_SUCCESS) { + logger.error("Couldn't fill cellGroupCfg during RRC Reconfiguration"); + parent->ngap->user_release_request(rnti, asn1::ngap::cause_radio_network_opts::radio_res_not_available); + return; + } // Pack masterCellGroup into container srsran::unique_byte_buffer_t pdu = parent->pack_into_pdu(master_cell_group, __FUNCTION__); @@ -1307,6 +1322,11 @@ void rrc_nr::ue::establish_eps_bearer(uint32_t pdu_session_id, uint32_t lcid, uint32_t five_qi) { + if (parent->cfg.five_qi_cfg.find(five_qi) == parent->cfg.five_qi_cfg.end()) { + parent->logger.error("No bearer config for 5QI %d present. Aborting DRB addition.", five_qi); + return; + } + // Enqueue NAS PDU srsran::unique_byte_buffer_t pdu = srsran::make_byte_buffer(); if (pdu == nullptr) { From bed35c747c3aedaa8643259ed43d3ce31deb3be0 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 13 May 2022 17:02:13 +0200 Subject: [PATCH 07/11] gnb,rrc: fix handling of DRB for reconfig/reestablishment the five_qi value received from the 5GC was not stored/passed when the UE object was moved from one RNTI to another during e.g. reestablishment. this makes sure the selected 5qi is passed over during that process. --- srsgnb/hdr/stack/rrc/rrc_nr_ue.h | 1 + srsgnb/src/stack/rrc/rrc_nr_ue.cc | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/srsgnb/hdr/stack/rrc/rrc_nr_ue.h b/srsgnb/hdr/stack/rrc/rrc_nr_ue.h index 87bf9a8da..84b4566c1 100644 --- a/srsgnb/hdr/stack/rrc/rrc_nr_ue.h +++ b/srsgnb/hdr/stack/rrc/rrc_nr_ue.h @@ -187,6 +187,7 @@ private: sched_nr_interface::ue_cfg_t uecfg{}; const uint32_t drb1_lcid = 4; + uint32_t drb1_five_qi = 0; /// selected by 5GC // Security helper srsgnb::nr_security_context sec_ctx; diff --git a/srsgnb/src/stack/rrc/rrc_nr_ue.cc b/srsgnb/src/stack/rrc/rrc_nr_ue.cc index 90aca8a02..b7fb7ee6b 100644 --- a/srsgnb/src/stack/rrc/rrc_nr_ue.cc +++ b/srsgnb/src/stack/rrc/rrc_nr_ue.cc @@ -925,6 +925,7 @@ void rrc_nr::ue::handle_rrc_reestablishment_request(const asn1::rrc_nr::rrc_rees // Reestablish E-RABs of old rnti later, during ConnectionReconfiguration // bearer_list.reestablish_bearers(std::move(old_ue->bearer_list)); + drb1_five_qi = old_ue->drb1_five_qi; // remove old RNTI old_ue->deactivate_bearers(); @@ -1270,6 +1271,7 @@ void rrc_nr::ue::handle_rrc_reestablishment_complete(const asn1::rrc_nr::rrc_ree for (const auto& drb : next_radio_bearer_cfg.drb_to_add_mod_list) { uint16_t lcid = drb1_lcid; parent->bearer_mapper->add_eps_bearer(rnti, lcid - 3, srsran::srsran_rat_t::nr, lcid); + parent->bearer_mapper->set_five_qi(rnti, lcid - 3, drb1_five_qi); logger.info("Established EPS bearer for LCID %u and RNTI 0x%x", lcid, rnti); } @@ -1362,6 +1364,9 @@ void rrc_nr::ue::establish_eps_bearer(uint32_t pdu_session_id, rnti, lcid - 3, srsran::srsran_rat_t::nr, lcid); // TODO: configurable bearer id <-> lcid mapping parent->bearer_mapper->set_five_qi(rnti, lcid - 3, five_qi); + // store 5QI for possible reestablishment of DRB + drb1_five_qi = five_qi; + logger.info("Established EPS bearer for LCID %u and RNTI 0x%x", lcid, rnti); } From f3ee8b2078f82a453ea01e5611ed95c9a4c3caa1 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 13 May 2022 17:03:51 +0200 Subject: [PATCH 08/11] ngap: fix invalid access of amf ID when context wasn't created yet --- srsgnb/src/stack/ngap/ngap_ue.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/srsgnb/src/stack/ngap/ngap_ue.cc b/srsgnb/src/stack/ngap/ngap_ue.cc index 714aa8a78..2ec6e4355 100644 --- a/srsgnb/src/stack/ngap/ngap_ue.cc +++ b/srsgnb/src/stack/ngap/ngap_ue.cc @@ -251,6 +251,11 @@ bool ngap::ue::send_ue_context_release_request(asn1::ngap::cause_c cause) return false; } + if (not ctxt.amf_ue_ngap_id.has_value()) { + logger.warning("Can't send release request. User 0x%x has no AMF UE Id.", ctxt.rnti); + return false; + } + if (was_ue_context_release_requested()) { // let timeout auto-remove user. return false; From 573dc34b738174ae2bfa01b77f33565db69cc5be Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Mon, 23 May 2022 15:57:57 +0200 Subject: [PATCH 09/11] gnb,rrc_nr_test: fix uninit memory --- srsgnb/src/stack/rrc/test/rrc_nr_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srsgnb/src/stack/rrc/test/rrc_nr_test.cc b/srsgnb/src/stack/rrc/test/rrc_nr_test.cc index 3f3908c90..f54e68ad7 100644 --- a/srsgnb/src/stack/rrc/test/rrc_nr_test.cc +++ b/srsgnb/src/stack/rrc/test/rrc_nr_test.cc @@ -106,7 +106,7 @@ int test_rrc_setup() rrc_nr rrc_obj(&task_sched); // set cfg - rrc_nr_cfg_t rrc_cfg_nr; + rrc_nr_cfg_t rrc_cfg_nr = {}; rrc_cfg_nr.cell_list.emplace_back(); generate_default_nr_cell(rrc_cfg_nr.cell_list[0]); rrc_cfg_nr.cell_list[0].phy_cell.carrier.pci = 500; From 8d65b40734d31ffafb6f01451b1e0483a791b64b Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Mon, 23 May 2022 14:24:49 +0100 Subject: [PATCH 10/11] lib,pdcp_nr: allow for t-reordering of inifinity --- lib/src/pdcp/pdcp_entity_nr.cc | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/src/pdcp/pdcp_entity_nr.cc b/lib/src/pdcp/pdcp_entity_nr.cc index b2d42e6fe..88ed5c0bf 100644 --- a/lib/src/pdcp/pdcp_entity_nr.cc +++ b/lib/src/pdcp/pdcp_entity_nr.cc @@ -49,13 +49,14 @@ bool pdcp_entity_nr::configure(const pdcp_config_t& cnfg_) rlc_mode = rlc->rb_is_um(lcid) ? rlc_mode_t::UM : rlc_mode_t::AM; - // Timers - reordering_timer = task_sched.get_unique_timer(); - - // configure timer - if (static_cast(cfg.t_reordering) > 0) { - reordering_timer.set(static_cast(cfg.t_reordering), *reordering_fnc); + // t-Reordering timer + if (cfg.t_reordering != pdcp_t_reordering_t::infinity) { + reordering_timer = task_sched.get_unique_timer(); + if (static_cast(cfg.t_reordering) > 0) { + reordering_timer.set(static_cast(cfg.t_reordering), *reordering_fnc); + } } + active = true; logger.info("%s PDCP-NR entity configured. SN_LEN=%d, Discard timer %d, Re-ordering timer %d, RLC=%s, RAT=%s", rb_name, @@ -267,10 +268,13 @@ void pdcp_entity_nr::write_pdu(unique_byte_buffer_t pdu) reordering_timer.stop(); } - if (not reordering_timer.is_running() and rx_deliv < rx_next) { - rx_reord = rx_next; - reordering_timer.run(); + if (cfg.t_reordering != pdcp_t_reordering_t::infinity) { + if (not reordering_timer.is_running() and rx_deliv < rx_next) { + rx_reord = rx_next; + reordering_timer.run(); + } } + logger.debug("Rx PDCP state - RX_NEXT=%u, RX_DELIV=%u, RX_REORD=%u", rx_next, rx_deliv, rx_reord); } From 57772ffa35e9dc783de1441587f59f59c1589bf9 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Mon, 23 May 2022 14:40:09 +0100 Subject: [PATCH 11/11] lib,pdcp_nr: added warning for trying to use t-Reordering of infinity on RLC UM bearers --- lib/src/pdcp/pdcp_entity_nr.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/src/pdcp/pdcp_entity_nr.cc b/lib/src/pdcp/pdcp_entity_nr.cc index 88ed5c0bf..fa253b13d 100644 --- a/lib/src/pdcp/pdcp_entity_nr.cc +++ b/lib/src/pdcp/pdcp_entity_nr.cc @@ -55,6 +55,9 @@ bool pdcp_entity_nr::configure(const pdcp_config_t& cnfg_) if (static_cast(cfg.t_reordering) > 0) { reordering_timer.set(static_cast(cfg.t_reordering), *reordering_fnc); } + } else if (rlc_mode == rlc_mode_t::UM) { + logger.warning("%s possible PDCP-NR misconfiguration: using infinite re-ordering timer with RLC UM bearer.", + rb_name); } active = true;