From 329544961974ce5cd4fa4e2b7a3a742233096663 Mon Sep 17 00:00:00 2001 From: Francisco Date: Thu, 21 Oct 2021 11:49:04 +0100 Subject: [PATCH] nr,gnb,sched: fix crash in debug mode due to incorrect is_lcid_valid check --- srsenb/hdr/stack/mac/common/ue_buffer_manager.h | 2 +- srsenb/hdr/stack/mac/nr/sched_nr_interface.h | 3 ++- srsenb/src/stack/mac/common/ue_buffer_manager.cc | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/srsenb/hdr/stack/mac/common/ue_buffer_manager.h b/srsenb/hdr/stack/mac/common/ue_buffer_manager.h index 73054f15f..5fa9fc3eb 100644 --- a/srsenb/hdr/stack/mac/common/ue_buffer_manager.h +++ b/srsenb/hdr/stack/mac/common/ue_buffer_manager.h @@ -29,7 +29,7 @@ template class ue_buffer_manager { protected: - const static uint32_t MAX_LC_ID = isNR ? srsran::MAX_NR_NOF_BEARERS : srsran::MAX_LTE_LCID; + const static uint32_t MAX_LC_ID = isNR ? (srsran::MAX_NR_NOF_BEARERS - 1) : srsran::MAX_LTE_LCID; const static uint32_t MAX_LCG_ID = isNR ? 7 : 3; // Should import from sched_interface and sched_nr_interface const static uint32_t MAX_SRB_LC_ID = isNR ? srsran::MAX_NR_SRB_ID : srsran::MAX_LTE_SRB_ID; const static uint32_t MAX_NOF_LCIDS = MAX_LC_ID + 1; diff --git a/srsenb/hdr/stack/mac/nr/sched_nr_interface.h b/srsenb/hdr/stack/mac/nr/sched_nr_interface.h index 46f70270f..36d806905 100644 --- a/srsenb/hdr/stack/mac/nr/sched_nr_interface.h +++ b/srsenb/hdr/stack/mac/nr/sched_nr_interface.h @@ -17,6 +17,7 @@ #include "srsran/adt/bounded_vector.h" #include "srsran/adt/optional.h" #include "srsran/adt/span.h" +#include "srsran/common/common_nr.h" #include "srsran/common/phy_cfg_nr.h" #include "srsran/common/slot_point.h" #include "srsran/interfaces/gnb_interfaces.h" @@ -30,7 +31,7 @@ const static size_t SCHED_NR_MAX_NOF_RBGS = 18; const static size_t SCHED_NR_MAX_TB = 1; const static size_t SCHED_NR_MAX_HARQ = SRSRAN_DEFAULT_HARQ_PROC_DL_NR; const static size_t SCHED_NR_MAX_BWP_PER_CELL = 2; -const static size_t SCHED_NR_MAX_LCID = 32; +const static size_t SCHED_NR_MAX_LCID = srsran::MAX_NR_NOF_BEARERS; const static size_t SCHED_NR_MAX_LC_GROUP = 7; struct sched_nr_ue_cc_cfg_t { diff --git a/srsenb/src/stack/mac/common/ue_buffer_manager.cc b/srsenb/src/stack/mac/common/ue_buffer_manager.cc index 7a948866d..51024fe1f 100644 --- a/srsenb/src/stack/mac/common/ue_buffer_manager.cc +++ b/srsenb/src/stack/mac/common/ue_buffer_manager.cc @@ -27,8 +27,8 @@ ue_buffer_manager::ue_buffer_manager(uint16_t rnti_, srslog::basic_logger& template void ue_buffer_manager::config_lcids(srsran::const_span bearer_cfg_list) { - bool log_enabled = logger.info.enabled(); - srsran::bounded_vector changed_list; + bool log_enabled = logger.info.enabled(); + srsran::bounded_vector changed_list; for (uint32_t lcid = 0; is_lcid_valid(lcid); ++lcid) { if (config_lcid_internal(lcid, bearer_cfg_list[lcid]) and log_enabled) {