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

master
Francisco 3 years ago committed by Francisco Paisana
parent e26be3732c
commit 3295449619

@ -29,7 +29,7 @@ template <bool isNR>
class ue_buffer_manager class ue_buffer_manager
{ {
protected: 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_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_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; const static uint32_t MAX_NOF_LCIDS = MAX_LC_ID + 1;

@ -17,6 +17,7 @@
#include "srsran/adt/bounded_vector.h" #include "srsran/adt/bounded_vector.h"
#include "srsran/adt/optional.h" #include "srsran/adt/optional.h"
#include "srsran/adt/span.h" #include "srsran/adt/span.h"
#include "srsran/common/common_nr.h"
#include "srsran/common/phy_cfg_nr.h" #include "srsran/common/phy_cfg_nr.h"
#include "srsran/common/slot_point.h" #include "srsran/common/slot_point.h"
#include "srsran/interfaces/gnb_interfaces.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_TB = 1;
const static size_t SCHED_NR_MAX_HARQ = SRSRAN_DEFAULT_HARQ_PROC_DL_NR; 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_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; const static size_t SCHED_NR_MAX_LC_GROUP = 7;
struct sched_nr_ue_cc_cfg_t { struct sched_nr_ue_cc_cfg_t {

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

Loading…
Cancel
Save