From 2f5a1ad2e3e9cb5ad0255d857277f7aca1dd226e Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Mon, 25 Oct 2021 10:56:12 +0200 Subject: [PATCH] SRSENB: MAC controller recover MAC bearer state after PDSCH KO burst (#3225) * SRSENB: MAC controller recover MAC bearer state after PDSCH KO burst * mac,lte: simplify scheduler phy config enable configuration Co-authored-by: Francisco Paisana --- srsenb/hdr/stack/rrc/mac_controller.h | 3 +-- srsenb/src/stack/rrc/mac_controller.cc | 18 +++++++++--------- srsenb/src/stack/rrc/rrc_mobility.cc | 6 +++--- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/srsenb/hdr/stack/rrc/mac_controller.h b/srsenb/hdr/stack/rrc/mac_controller.h index 2056881eb..9ed505218 100644 --- a/srsenb/hdr/stack/rrc/mac_controller.h +++ b/srsenb/hdr/stack/rrc/mac_controller.h @@ -63,8 +63,7 @@ public: void set_scell_activation(const std::bitset& scell_mask); void set_drb_activation(bool active); - enum proc_stage_t : int8_t { config_tx, config_complete, other }; - void update_mac(proc_stage_t stage); + void update_mac(); private: int apply_basic_conn_cfg(const asn1::rrc::rr_cfg_ded_s& rr_cfg); diff --git a/srsenb/src/stack/rrc/mac_controller.cc b/srsenb/src/stack/rrc/mac_controller.cc index af7a2e174..727a7e124 100644 --- a/srsenb/src/stack/rrc/mac_controller.cc +++ b/srsenb/src/stack/rrc/mac_controller.cc @@ -212,7 +212,8 @@ void mac_controller::handle_con_reconf(const asn1::rrc::rrc_conn_recfg_r8_ies_s& set_drb_activation(false); // Apply changes to MAC scheduler - update_mac(proc_stage_t::config_tx); + update_mac(); + mac->phy_config_enabled(rnti, false); } void mac_controller::handle_con_reconf_complete() @@ -223,7 +224,8 @@ void mac_controller::handle_con_reconf_complete() apply_current_bearers_cfg(); // Apply SCell+Bearer changes to MAC - update_mac(proc_stage_t::config_complete); + update_mac(); + mac->phy_config_enabled(rnti, true); } void mac_controller::apply_current_bearers_cfg() @@ -286,7 +288,8 @@ void mac_controller::handle_intraenb_ho_cmd(const asn1::rrc::rrc_conn_recfg_r8_i current_sched_ue_cfg.ue_bearers[i].direction = mac_lc_ch_cfg_t::DL; } - update_mac(mac_controller::config_tx); + update_mac(); + mac->phy_config_enabled(rnti, false); } void mac_controller::handle_ho_prep(const asn1::rrc::ho_prep_info_r8_ies_s& ho_prep) @@ -305,7 +308,8 @@ void mac_controller::set_radio_bearer_state(mac_lc_ch_cfg_t::direction_t dir) for (auto& drb : bearer_list.get_established_drbs()) { current_sched_ue_cfg.ue_bearers[drb.lc_ch_id].direction = dir; } - update_mac(config_tx); + + update_mac(); } void mac_controller::set_scell_activation(const std::bitset& scell_mask) @@ -323,14 +327,10 @@ void mac_controller::set_drb_activation(bool active) } } -void mac_controller::update_mac(proc_stage_t stage) +void mac_controller::update_mac() { // Apply changes to MAC scheduler mac->ue_cfg(rnti, ¤t_sched_ue_cfg); - if (stage != proc_stage_t::other) { - // Acknowledge Dedicated Configuration - mac->phy_config_enabled(rnti, stage == proc_stage_t::config_complete); - } } void ue_cfg_apply_phy_cfg_ded(ue_cfg_t& ue_cfg, const asn1::rrc::phys_cfg_ded_s& phy_cfg, const rrc_cfg_t& rrc_cfg) diff --git a/srsenb/src/stack/rrc/rrc_mobility.cc b/srsenb/src/stack/rrc/rrc_mobility.cc index a356db58a..cc2573517 100644 --- a/srsenb/src/stack/rrc/rrc_mobility.cc +++ b/srsenb/src/stack/rrc/rrc_mobility.cc @@ -661,7 +661,8 @@ void rrc::ue::rrc_mobility::s1_source_ho_st::enter(rrc_mobility* f, const ho_mea /** * TS 36.413, Section 8.4.2 - Handover Resource Allocation - * @brief: Send "eNBStatusTransfer" message from source eNB to MME, and setup Forwarding GTPU tunnel + * @brief: Called in SeNB when "Handover Command" is received + * Send "eNBStatusTransfer" message from source eNB to MME, and setup Forwarding GTPU tunnel * - PDCP provides the bearers' DL/UL HFN and COUNT to be put inside a transparent container * - The eNB sends eNBStatusTransfer to MME * - A GTPU forwarding tunnel is opened to forward buffered PDCP PDUs and incoming GTPU PDUs @@ -698,14 +699,13 @@ void rrc::ue::rrc_mobility::s1_source_ho_st::handle_ho_cmd(wait_ho_cmd& s, const } /* Enter Handover Execution */ - // TODO: Do anything with MeasCfg info within the Msg (e.g. update ue_var_meas)? // Disable DRBs in the MAC and PDCP, while Reconfiguration is taking place. for (const drb_to_add_mod_s& drb : rrc_ue->bearer_list.get_established_drbs()) { rrc_ue->parent->pdcp->set_enabled(rrc_ue->rnti, drb_to_lcid((lte_drb)drb.drb_id), false); } rrc_ue->mac_ctrl.set_drb_activation(false); - rrc_ue->mac_ctrl.update_mac(mac_controller::proc_stage_t::other); + rrc_ue->mac_ctrl.update_mac(); // Send HO Command to UE std::string octet_str;