From 13d651763152b6752edb4f7440d9a1c928cce348 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Thu, 27 Oct 2022 15:53:33 +0200 Subject: [PATCH] prevent the scheduler from allocating data on SCell UL if not supported by UE --- lib/include/srsran/interfaces/enb_rrc_interface_types.h | 1 + srsenb/hdr/stack/mac/sched_interface.h | 1 + srsenb/src/enb_cfg_parser.cc | 4 ++++ srsenb/src/stack/mac/schedulers/sched_time_pf.cc | 5 ++++- srsenb/src/stack/mac/schedulers/sched_time_rr.cc | 4 ++++ srsenb/src/stack/rrc/mac_controller.cc | 7 ++++--- srsenb/src/stack/rrc/rrc_cell_cfg.cc | 6 ++++++ 7 files changed, 24 insertions(+), 4 deletions(-) diff --git a/lib/include/srsran/interfaces/enb_rrc_interface_types.h b/lib/include/srsran/interfaces/enb_rrc_interface_types.h index 091241445..7165f3453 100644 --- a/lib/include/srsran/interfaces/enb_rrc_interface_types.h +++ b/lib/include/srsran/interfaces/enb_rrc_interface_types.h @@ -66,6 +66,7 @@ struct cell_cfg_t { asn1::rrc::mob_ctrl_info_s::t304_e_ t304; std::vector scell_list; rrc_meas_cfg_t meas_cfg; + bool barred; }; typedef std::vector cell_list_t; diff --git a/srsenb/hdr/stack/mac/sched_interface.h b/srsenb/hdr/stack/mac/sched_interface.h index 3a78b6497..f0e6fef82 100644 --- a/srsenb/hdr/stack/mac/sched_interface.h +++ b/srsenb/hdr/stack/mac/sched_interface.h @@ -140,6 +140,7 @@ public: struct ue_cfg_t { struct cc_cfg_t { bool active = false; + bool ul_disabled = false; uint32_t enb_cc_idx = 0; ///< eNB CC index srsran_dl_cfg_t dl_cfg = {}; uint32_t aperiodic_cqi_period = 0; // if 0 is periodic CQI diff --git a/srsenb/src/enb_cfg_parser.cc b/srsenb/src/enb_cfg_parser.cc index 99c947d01..dea5dfc36 100644 --- a/srsenb/src/enb_cfg_parser.cc +++ b/srsenb/src/enb_cfg_parser.cc @@ -1505,6 +1505,10 @@ static int parse_cell_list(all_args_t* args, rrc_cfg_t* rrc_cfg, Setting& root) HANDLEPARSERCODE(parse_meas_report_desc(&cell_cfg.meas_cfg, cellroot)); } + if (cellroot.exists("barred") and cellroot["barred"]) { + cell_cfg.barred = true; + } + if (cellroot.exists("scell_list")) { HANDLEPARSERCODE(parse_scell_list(cell_cfg, cellroot)); } diff --git a/srsenb/src/stack/mac/schedulers/sched_time_pf.cc b/srsenb/src/stack/mac/schedulers/sched_time_pf.cc index 53de3621c..de1103f96 100644 --- a/srsenb/src/stack/mac/schedulers/sched_time_pf.cc +++ b/srsenb/src/stack/mac/schedulers/sched_time_pf.cc @@ -61,7 +61,10 @@ void sched_time_pf::new_tti(sched_ue_list& ue_db, sf_sched* tti_sched) dl_queue.push(&it->second); } if (it->second.ul_h != nullptr) { - ul_queue.push(&it->second); + // Allocate only if UL carrier is enabled + if (!u.second->get_ue_cfg().supported_cc_list[cc_cfg->enb_cc_idx].ul_disabled) { + ul_queue.push(&it->second); + } } } } diff --git a/srsenb/src/stack/mac/schedulers/sched_time_rr.cc b/srsenb/src/stack/mac/schedulers/sched_time_rr.cc index 3465c558e..6637b2630 100644 --- a/srsenb/src/stack/mac/schedulers/sched_time_rr.cc +++ b/srsenb/src/stack/mac/schedulers/sched_time_rr.cc @@ -121,6 +121,10 @@ void sched_time_rr::sched_ul_newtxs(sched_ue_list& ue_db, sf_sched* tti_sched, s iter = ue_db.begin(); // wrap around } sched_ue& user = *iter->second; + // Allocate only if UL carrier is enabled + if (user.get_ue_cfg().supported_cc_list[cc_cfg->enb_cc_idx].ul_disabled) { + continue; + } const ul_harq_proc* h = get_ul_newtx_harq(user, tti_sched); // Check if there is a empty harq if (h == nullptr) { diff --git a/srsenb/src/stack/rrc/mac_controller.cc b/srsenb/src/stack/rrc/mac_controller.cc index deb5cc6e4..503880ec0 100644 --- a/srsenb/src/stack/rrc/mac_controller.cc +++ b/srsenb/src/stack/rrc/mac_controller.cc @@ -457,9 +457,10 @@ void ue_cfg_apply_reconf_complete_updates(ue_cfg_t& ue_cfg, if (scell.scell_idx_r10 >= ue_cfg.supported_cc_list.size()) { ue_cfg.supported_cc_list.resize(scell.scell_idx_r10 + 1); } - auto& mac_scell = ue_cfg.supported_cc_list[scell.scell_idx_r10]; - mac_scell.active = true; - mac_scell.enb_cc_idx = ue_cell_list.get_ue_cc_idx(scell.scell_idx_r10)->cell_common->enb_cc_idx; + auto& mac_scell = ue_cfg.supported_cc_list[scell.scell_idx_r10]; + mac_scell.active = true; + mac_scell.ul_disabled = !scell.rr_cfg_common_scell_r10.ul_cfg_r10.ul_freq_info_r10.ul_carrier_freq_r10_present; + mac_scell.enb_cc_idx = ue_cell_list.get_ue_cc_idx(scell.scell_idx_r10)->cell_common->enb_cc_idx; if (scell.rr_cfg_ded_scell_r10_present and scell.rr_cfg_ded_scell_r10.phys_cfg_ded_scell_r10_present and scell.rr_cfg_ded_scell_r10.phys_cfg_ded_scell_r10.ul_cfg_r10_present) { diff --git a/srsenb/src/stack/rrc/rrc_cell_cfg.cc b/srsenb/src/stack/rrc/rrc_cell_cfg.cc index 00b0727b8..4f33a7f2c 100644 --- a/srsenb/src/stack/rrc/rrc_cell_cfg.cc +++ b/srsenb/src/stack/rrc/rrc_cell_cfg.cc @@ -44,6 +44,12 @@ enb_cell_common_list::enb_cell_common_list(const rrc_cfg_t& cfg_) : cfg(cfg_) // Update DL EARFCN new_cell->sib1.freq_band_ind = (uint8_t)srsran_band_get_band(new_cell->cell_cfg.dl_earfcn); + if (new_cell->cell_cfg.barred) { + cell_access->cell_barred.value = sib_type1_s::cell_access_related_info_s_::cell_barred_opts::barred; + } else { + cell_access->cell_barred.value = sib_type1_s::cell_access_related_info_s_::cell_barred_opts::not_barred; + } + // Set Cell SIB2 // update PRACH root seq index for this cell new_cell->sib2 = cfg.sibs[1].sib2();