From 26086252ba38e7fa4c24b7402eb76958d8b02334 Mon Sep 17 00:00:00 2001 From: Francisco Date: Mon, 25 Jan 2021 14:05:54 +0000 Subject: [PATCH] fix resetting of harqs in the scheduler during intra-enb handover --- srsenb/hdr/stack/mac/sched_ue.h | 1 - .../stack/mac/sched_ue_ctrl/sched_ue_cell.h | 2 +- srsenb/src/stack/mac/sched_ue.cc | 21 +----------- .../stack/mac/sched_ue_ctrl/sched_ue_cell.cc | 34 ++++++++----------- 4 files changed, 17 insertions(+), 41 deletions(-) diff --git a/srsenb/hdr/stack/mac/sched_ue.h b/srsenb/hdr/stack/mac/sched_ue.h index cbdbf13f5..aefeb8e46 100644 --- a/srsenb/hdr/stack/mac/sched_ue.h +++ b/srsenb/hdr/stack/mac/sched_ue.h @@ -38,7 +38,6 @@ class sched_ue public: sched_ue(); - void reset(); void init(uint16_t rnti, const std::vector& cell_list_params_); void new_subframe(tti_point tti_rx, uint32_t enb_cc_idx); diff --git a/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h b/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h index 54cffffe6..2d603a6e1 100644 --- a/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h +++ b/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h @@ -33,7 +33,7 @@ struct sched_ue_cell { sched_ue_cell(uint16_t rnti_, const sched_cell_params_t& cell_cfg_, tti_point current_tti); void set_ue_cfg(const sched_interface::ue_cfg_t& ue_cfg_); void new_tti(tti_point tti_rx); - void reset(); + void clear_feedback(); void finish_tti(tti_point tti_rx); void set_dl_cqi(tti_point tti_rx, uint32_t dl_cqi_); diff --git a/srsenb/src/stack/mac/sched_ue.cc b/srsenb/src/stack/mac/sched_ue.cc index 1a203a3cc..a50409a08 100644 --- a/srsenb/src/stack/mac/sched_ue.cc +++ b/srsenb/src/stack/mac/sched_ue.cc @@ -35,10 +35,7 @@ namespace srsenb { * *******************************************************/ -sched_ue::sched_ue() : log_h(srslte::logmap::get("MAC")) -{ - reset(); -} +sched_ue::sched_ue() : log_h(srslte::logmap::get("MAC")) {} void sched_ue::init(uint16_t rnti_, const std::vector& cell_list_params_) { @@ -91,22 +88,6 @@ void sched_ue::set_cfg(const ue_cfg_t& cfg_) check_ue_cfg_correctness(cfg); } -void sched_ue::reset() -{ - cfg = {}; - sr = false; - phy_config_dedicated_enabled = false; - cqi_request_tti = 0; - for (auto& cc : cells) { - cc.reset(); - } - - // erase all bearers - for (uint32_t i = 0; i < cfg.ue_bearers.size(); ++i) { - lch_handler.config_lcid(i, {}); - } -} - void sched_ue::new_subframe(tti_point tti_rx, uint32_t enb_cc_idx) { if (current_tti != tti_rx) { diff --git a/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc b/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc index 1ac33a2f8..57b8d62e7 100644 --- a/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc +++ b/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc @@ -31,6 +31,7 @@ sched_ue_cell::sched_ue_cell(uint16_t rnti_, const sched_cell_params_t& cell_cfg current_tti(current_tti_) { max_aggr_level = cell_cfg->sched_cfg->max_aggr_level >= 0 ? cell_cfg->sched_cfg->max_aggr_level : 3; + clear_feedback(); } void sched_ue_cell::set_ue_cfg(const sched_interface::ue_cfg_t& ue_cfg_) @@ -59,16 +60,16 @@ void sched_ue_cell::set_ue_cfg(const sched_interface::ue_cfg_t& ue_cfg_) max_mcs_dl = std::min(max_mcs_dl, 27u); } + // If new cell configuration, clear Cell HARQs + if (ue_cc_idx != prev_ue_cc_idx) { + clear_feedback(); + harq_ent.reset(); + } + // Update carrier state if (ue_cc_idx == 0) { - if (cc_state() != cc_st::active) { - reset(); - // PCell is always active - cc_state_ = cc_st::active; - - // set initial DL CQI - dl_cqi = cell_cfg->cfg.initial_dl_cqi; - } + // PCell is always active + cc_state_ = cc_st::active; } else { // SCell case switch (cc_state()) { @@ -82,7 +83,6 @@ void sched_ue_cell::set_ue_cfg(const sched_interface::ue_cfg_t& ue_cfg_) case cc_st::deactivating: case cc_st::idle: if (ue_cc_idx > 0 and ue_cfg->supported_cc_list[ue_cc_idx].active) { - reset(); cc_state_ = cc_st::activating; dl_cqi = 0; log_h->info("SCHED: Activating rnti=0x%x, SCellIndex=%d...\n", rnti, ue_cc_idx); @@ -102,18 +102,20 @@ void sched_ue_cell::new_tti(tti_point tti_rx) if (ue_cc_idx > 0 and cc_state_ == cc_st::deactivating) { // wait for all ACKs to be received before completely deactivating SCell if (current_tti > to_tx_dl_ack(cfg_tti)) { - enter_idle_st(); + cc_state_ = cc_st::idle; + clear_feedback(); + harq_ent.reset(); } } } -void sched_ue_cell::reset() +void sched_ue_cell::clear_feedback() { dl_ri = 0; dl_ri_tti_rx = tti_point{}; dl_pmi = 0; dl_pmi_tti_rx = tti_point{}; - dl_cqi = 1; + dl_cqi = ue_cc_idx == 0 ? cell_cfg->cfg.initial_dl_cqi : 1; dl_cqi_tti_rx = tti_point{}; dl_cqi_rx = false; ul_cqi = 1; @@ -122,7 +124,7 @@ void sched_ue_cell::reset() void sched_ue_cell::finish_tti(tti_point tti_rx) { - // reset PIDs with pending data or blocked + // clear_feedback PIDs with pending data or blocked harq_ent.reset_pending_data(tti_rx); } @@ -138,12 +140,6 @@ void sched_ue_cell::set_dl_cqi(tti_point tti_rx, uint32_t dl_cqi_) } } -void sched_ue_cell::enter_idle_st() -{ - cc_state_ = cc_st::idle; - harq_ent.reset(); -} - /************************************************************* * TBS/MCS derivation ************************************************************/