From 94f62b54ad0fa2110dbe06c8e1a4e7b0660aecda Mon Sep 17 00:00:00 2001 From: yagoda Date: Thu, 30 Apr 2020 17:54:19 +0200 Subject: [PATCH] fixing some bugs in embms with new stack and cc scheduler in enodeb --- srsenb/src/stack/mac/mac.cc | 2 +- srsenb/src/stack/rrc/rrc.cc | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/srsenb/src/stack/mac/mac.cc b/srsenb/src/stack/mac/mac.cc index afcbcce55..e37cc4907 100644 --- a/srsenb/src/stack/mac/mac.cc +++ b/srsenb/src/stack/mac/mac.cc @@ -212,7 +212,7 @@ int mac::ue_cfg(uint16_t rnti, sched_interface::ue_cfg_t* cfg) if (not ue_ptr->is_phy_added) { Info("Registering RNTI=0x%X to PHY...\n", rnti); // Register new user in PHY with first CC index - if (phy_h->add_rnti(rnti, cfg->supported_cc_list.front().enb_cc_idx, false) == SRSLTE_ERROR) { + if (phy_h->add_rnti(rnti, (SRSLTE_MRNTI) ? 0 : cfg->supported_cc_list.front().enb_cc_idx, false) == SRSLTE_ERROR) { Error("Registering new UE RNTI=0x%X to PHY\n", rnti); } Info("Done registering RNTI=0x%X to PHY...\n", rnti); diff --git a/srsenb/src/stack/rrc/rrc.cc b/srsenb/src/stack/rrc/rrc.cc index 4b1dbd4ce..9dfd46be5 100644 --- a/srsenb/src/stack/rrc/rrc.cc +++ b/srsenb/src/stack/rrc/rrc.cc @@ -173,14 +173,19 @@ void rrc::add_user(uint16_t rnti, const sched_interface::ue_cfg_t& sched_ue_cfg) { auto user_it = users.find(rnti); if (user_it == users.end()) { - auto p = users.insert(std::make_pair(rnti, std::unique_ptr(new ue{this, rnti, sched_ue_cfg}))); - if (p.second and p.first->second->is_allocated()) { + bool rnti_added = true; + if (rnti != SRSLTE_MRNTI) { + // only non-eMBMS RNTIs are present in user map + auto p = users.insert(std::make_pair(rnti, std::unique_ptr(new ue{this, rnti, sched_ue_cfg}))); + rnti_added = p.second and p.first->second->is_allocated(); + } + if (rnti_added) { rlc->add_user(rnti); pdcp->add_user(rnti); rrc_log->info("Added new user rnti=0x%x\n", rnti); } else { mac->bearer_ue_rem(rnti, 0); - rrc_log->error("Adding user rnti=0x%x - Fail to allocate user resources\n", rnti); + rrc_log->error("Adding user rnti=0x%x - Failed to allocate user resources\n", rnti); } } else { rrc_log->error("Adding user rnti=0x%x (already exists)\n", rnti); @@ -1021,7 +1026,7 @@ rrc::ue::ue(rrc* outer_rrc, uint16_t rnti_, const sched_interface::ue_cfg_t& sch { if (current_sched_ue_cfg.supported_cc_list.empty() or not current_sched_ue_cfg.supported_cc_list[0].active) { parent->rrc_log->warning("No PCell set. Picking eNBccIdx=0 as PCell\n"); - current_sched_ue_cfg.supported_cc_list.resize(0); + current_sched_ue_cfg.supported_cc_list.resize(1); current_sched_ue_cfg.supported_cc_list[0].active = true; current_sched_ue_cfg.supported_cc_list[0].enb_cc_idx = UE_PCELL_CC_IDX; }