From 791b8d24ce42264e02d1f6c6bab6f486173dc030 Mon Sep 17 00:00:00 2001 From: Francisco Date: Fri, 16 Apr 2021 10:50:44 +0100 Subject: [PATCH] fix regression in scell activation during intraenb handover --- srsenb/src/stack/mac/sched.cc | 16 ++++++++-------- srsenb/src/stack/mac/sched_ue.cc | 6 ++++-- srsenb/src/stack/rrc/mac_controller.cc | 4 +--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/srsenb/src/stack/mac/sched.cc b/srsenb/src/stack/mac/sched.cc index e7604e056..525b31f54 100644 --- a/srsenb/src/stack/mac/sched.cc +++ b/srsenb/src/stack/mac/sched.cc @@ -268,15 +268,15 @@ std::array sched::get_enb_ue_cc_map(uint16_t rnti) std::array sched::get_scell_activation_mask(uint16_t rnti) { - std::array enb_ue_cc_map = get_enb_ue_cc_map(rnti); - std::array scell_mask = {}; - for (int ue_cc : enb_ue_cc_map) { - if (ue_cc <= 0) { - // inactive or PCell - continue; + std::array scell_mask = {}; + ue_db_access_locked(rnti, [this, &scell_mask](sched_ue& ue) { + for (size_t enb_cc_idx = 0; enb_cc_idx < carrier_schedulers.size(); ++enb_cc_idx) { + const sched_ue_cell* cc_ue = ue.find_ue_carrier(enb_cc_idx); + if (cc_ue != nullptr and (cc_ue->cc_state() == cc_st::active or cc_ue->cc_state() == cc_st::activating)) { + scell_mask[cc_ue->get_ue_cc_idx()] = true; + } } - scell_mask[ue_cc] = true; - } + }); return scell_mask; } diff --git a/srsenb/src/stack/mac/sched_ue.cc b/srsenb/src/stack/mac/sched_ue.cc index b4da8e730..09e30e91b 100644 --- a/srsenb/src/stack/mac/sched_ue.cc +++ b/srsenb/src/stack/mac/sched_ue.cc @@ -77,10 +77,12 @@ void sched_ue::set_cfg(const ue_cfg_t& cfg_) scell_activation_state_changed |= c.is_scell() and (c.cc_state() == cc_st::activating or c.cc_state() == cc_st::deactivating); } - if (prev_supported_cc_list.empty() or prev_supported_cc_list[0].enb_cc_idx != cfg.supported_cc_list[0].enb_cc_idx) { + bool is_handover = not prev_supported_cc_list.empty() and + prev_supported_cc_list[0].enb_cc_idx != cfg.supported_cc_list[0].enb_cc_idx; + if (prev_supported_cc_list.empty() or is_handover) { logger.info("SCHED: rnti=0x%x PCell is now enb_cc_idx=%d", rnti, cfg.supported_cc_list[0].enb_cc_idx); } - if (scell_activation_state_changed) { + if (scell_activation_state_changed and not is_handover) { lch_handler.pending_ces.emplace_back(srsran::dl_sch_lcid::SCELL_ACTIVATION); logger.info("SCHED: Enqueueing SCell Activation CMD for rnti=0x%x", rnti); } diff --git a/srsenb/src/stack/rrc/mac_controller.cc b/srsenb/src/stack/rrc/mac_controller.cc index 1a69b3e66..ebe53fe35 100644 --- a/srsenb/src/stack/rrc/mac_controller.cc +++ b/srsenb/src/stack/rrc/mac_controller.cc @@ -127,9 +127,7 @@ int mac_controller::handle_crnti_ce(uint32_t temp_crnti) current_sched_ue_cfg = next_sched_ue_cfg; // Disable SCells, until RRCReconfComplete is received, otherwise the SCell Act MAC CE is sent too early - for (uint32_t i = 1; i < current_sched_ue_cfg.supported_cc_list.size(); ++i) { - current_sched_ue_cfg.supported_cc_list[i].active = false; - } + set_scell_activation({0}); // keep DRBs disabled until RRCReconfComplete is received set_drb_activation(false);