nr,gnb,sched: fix crash in debug mode due to incorrect is_lcid_valid check

This commit is contained in:
Francisco 2021-10-21 11:49:04 +01:00 committed by Francisco Paisana
parent e26be3732c
commit 3295449619
3 changed files with 5 additions and 4 deletions

View File

@ -29,7 +29,7 @@ template <bool isNR>
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;

View File

@ -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 {

View File

@ -27,8 +27,8 @@ ue_buffer_manager<isNR>::ue_buffer_manager(uint16_t rnti_, srslog::basic_logger&
template <bool isNR>
void ue_buffer_manager<isNR>::config_lcids(srsran::const_span<mac_lc_ch_cfg_t> bearer_cfg_list)
{
bool log_enabled = logger.info.enabled();
srsran::bounded_vector<uint32_t, MAX_LC_ID> changed_list;
bool log_enabled = logger.info.enabled();
srsran::bounded_vector<uint32_t, MAX_NOF_LCIDS> changed_list;
for (uint32_t lcid = 0; is_lcid_valid(lcid); ++lcid) {
if (config_lcid_internal(lcid, bearer_cfg_list[lcid]) and log_enabled) {