From 2a31daca4ae6ef0e3a3f6f9778d115e29368601e Mon Sep 17 00:00:00 2001 From: Francisco Date: Tue, 1 Jun 2021 12:35:01 +0100 Subject: [PATCH] enb,configuration: allow to specify enb specific max nof RLC retxs --- lib/include/srsran/srslog/shared_types.h | 4 +-- srsenb/hdr/stack/rrc/rrc_config.h | 12 ++++++-- srsenb/rb.conf.example | 12 ++++++++ srsenb/src/enb_cfg_parser.cc | 16 +++++++++-- srsenb/src/enb_cfg_parser.h | 4 +-- srsenb/src/stack/rrc/rrc.cc | 25 +++++----------- srsenb/src/stack/rrc/rrc_ue.cc | 36 ++++++++++++++++-------- srsenb/src/stack/rrc/ue_rr_cfg.cc | 6 ++-- 8 files changed, 73 insertions(+), 42 deletions(-) diff --git a/lib/include/srsran/srslog/shared_types.h b/lib/include/srsran/srslog/shared_types.h index 90aa8c6d0..d2cca6147 100644 --- a/lib/include/srsran/srslog/shared_types.h +++ b/lib/include/srsran/srslog/shared_types.h @@ -14,6 +14,7 @@ #define SRSLOG_SHARED_TYPES_H #include +#include namespace srslog { @@ -21,8 +22,7 @@ namespace srslog { using error_handler = std::function; /// Backend priority levels. -enum class backend_priority -{ +enum class backend_priority { /// Default priority of the operating system. normal, /// Thread will be given a high priority. diff --git a/srsenb/hdr/stack/rrc/rrc_config.h b/srsenb/hdr/stack/rrc/rrc_config.h index 55a5e83c0..676bf81be 100644 --- a/srsenb/hdr/stack/rrc/rrc_config.h +++ b/srsenb/hdr/stack/rrc/rrc_config.h @@ -31,12 +31,18 @@ struct rrc_cfg_sr_t { }; struct rrc_cfg_qci_t { - bool configured = false; + bool configured = false; + int enb_dl_max_retx_thres = -1; asn1::rrc::lc_ch_cfg_s::ul_specific_params_s_ lc_cfg; asn1::rrc::pdcp_cfg_s pdcp_cfg; asn1::rrc::rlc_cfg_c rlc_cfg; }; +struct srb_cfg_t { + int enb_dl_max_retx_thres = -1; + asn1::rrc::srb_to_add_mod_s::rlc_cfg_c_ rlc_cfg; +}; + struct rrc_cfg_t { uint32_t enb_id; ///< Required to pack SIB1 // Per eNB SIBs @@ -62,8 +68,8 @@ struct rrc_cfg_t { uint32_t max_mac_dl_kos; uint32_t max_mac_ul_kos; uint32_t rlf_release_timer_ms; - asn1::rrc::srb_to_add_mod_s::rlc_cfg_c_ srb1_cfg; - asn1::rrc::srb_to_add_mod_s::rlc_cfg_c_ srb2_cfg; + srb_cfg_t srb1_cfg; + srb_cfg_t srb2_cfg; }; constexpr uint32_t UE_PCELL_CC_IDX = 0; diff --git a/srsenb/rb.conf.example b/srsenb/rb.conf.example index c1d5b813a..27d997fc3 100644 --- a/srsenb/rb.conf.example +++ b/srsenb/rb.conf.example @@ -13,6 +13,9 @@ // t_status_prohibit = 0; // }; // }; +// enb_specific = { +// dl_max_retx_thresh = 32; +// }; // } // srb2_config = { @@ -28,6 +31,9 @@ // t_status_prohibit = 0; // }; // }; +// enb_specific = { +// dl_max_retx_thresh = 32; +// }; // } qci_config = ( @@ -53,6 +59,9 @@ qci_config = ( bucket_size_duration = 100; log_chan_group = 2; }; + enb_specific = { + dl_max_retx_thresh = 32; + }; }, { qci=9; @@ -78,6 +87,9 @@ qci_config = ( bucket_size_duration = 100; log_chan_group = 3; }; + enb_specific = { + dl_max_retx_thresh = 32; + }; } ); diff --git a/srsenb/src/enb_cfg_parser.cc b/srsenb/src/enb_cfg_parser.cc index a0a0084fd..56605db4f 100644 --- a/srsenb/src/enb_cfg_parser.cc +++ b/srsenb/src/enb_cfg_parser.cc @@ -400,7 +400,7 @@ int phr_cnfg_parser::parse(libconfig::Setting& root) int field_srb::parse(libconfig::Setting& root) { // Parse RLC AM section - rlc_cfg_c* rlc_cfg = &cfg.set_explicit_value(); + rlc_cfg_c* rlc_cfg = &cfg.rlc_cfg.set_explicit_value(); if (root.exists("ul_am") && root.exists("dl_am")) { rlc_cfg->set_am(); } @@ -455,6 +455,11 @@ int field_srb::parse(libconfig::Setting& root) return SRSRAN_ERROR; } } + + if (root.exists("enb_specific")) { + cfg.enb_dl_max_retx_thres = (int)root["enb_specific"]["dl_max_retx_thresh"]; + } + return 0; } @@ -616,6 +621,11 @@ int field_qci::parse(libconfig::Setting& root) parser::field log_chan_group("log_chan_group", &lc_cfg->lc_ch_group); lc_cfg->lc_ch_group_present = not log_chan_group.parse(q["logical_channel_config"]); qcicfg.configured = true; + + if (q.exists("enb_specific")) { + qcicfg.enb_dl_max_retx_thres = (int)q["enb_specific"]["dl_max_retx_thresh"]; + } + cfg.insert(std::make_pair(qci, qcicfg)); } @@ -1752,10 +1762,10 @@ int parse_drb(all_args_t* args_, rrc_cfg_t* rrc_cfg_) int ret = p.parse(); if (not srb1_present) { - rrc_cfg_->srb1_cfg.set_default_value(); + rrc_cfg_->srb1_cfg.rlc_cfg.set_default_value(); } if (not srb2_present) { - rrc_cfg_->srb2_cfg.set_default_value(); + rrc_cfg_->srb2_cfg.rlc_cfg.set_default_value(); } return ret; diff --git a/srsenb/src/enb_cfg_parser.h b/srsenb/src/enb_cfg_parser.h index 2e1b0301c..6ea75ffa2 100644 --- a/srsenb/src/enb_cfg_parser.h +++ b/srsenb/src/enb_cfg_parser.h @@ -149,13 +149,13 @@ private: class field_srb final : public parser::field_itf { public: - explicit field_srb(asn1::rrc::srb_to_add_mod_s::rlc_cfg_c_& cfg_) : cfg(cfg_) {} + explicit field_srb(srb_cfg_t& cfg_) : cfg(cfg_) {} const char* get_name() override { return "field_srb"; } int parse(Setting& root) override; private: - asn1::rrc::srb_to_add_mod_s::rlc_cfg_c_& cfg; + srb_cfg_t& cfg; }; class field_qci final : public parser::field_itf diff --git a/srsenb/src/stack/rrc/rrc.cc b/srsenb/src/stack/rrc/rrc.cc index b0d7a69b4..d80d3f81a 100644 --- a/srsenb/src/stack/rrc/rrc.cc +++ b/srsenb/src/stack/rrc/rrc.cc @@ -103,24 +103,13 @@ int32_t rrc::init(const rrc_cfg_t& cfg_, running = true; - if (cfg.srb1_cfg.type() == srb_to_add_mod_s::rlc_cfg_c_::types::explicit_value) { - if (logger.debug.enabled()) { - asn1::json_writer js{}; - cfg.srb1_cfg.to_json(js); - logger.debug("SRB1 explicit configuration: %s", js.to_string().c_str()); - } - } else { - logger.debug("SRB1 default configuration"); - } - - if (cfg.srb2_cfg.type() == srb_to_add_mod_s::rlc_cfg_c_::types::explicit_value) { - if (logger.debug.enabled()) { - asn1::json_writer js{}; - cfg.srb2_cfg.to_json(js); - logger.debug("SRB2 configuration: %s", js.to_string().c_str()); - } - } else { - logger.debug("SRB2 default configuration"); + if (logger.debug.enabled()) { + asn1::json_writer js{}; + cfg.srb1_cfg.rlc_cfg.to_json(js); + logger.debug("SRB1 configuration: %s", js.to_string().c_str()); + js = {}; + cfg.srb2_cfg.rlc_cfg.to_json(js); + logger.debug("SRB2 configuration: %s", js.to_string().c_str()); } return SRSRAN_SUCCESS; } diff --git a/srsenb/src/stack/rrc/rrc_ue.cc b/srsenb/src/stack/rrc/rrc_ue.cc index d343d0b7a..b0c60fce6 100644 --- a/srsenb/src/stack/rrc/rrc_ue.cc +++ b/srsenb/src/stack/rrc/rrc_ue.cc @@ -1412,19 +1412,27 @@ void rrc::ue::apply_pdcp_drb_updates(const rr_cfg_ded_s& pending_rr_cfg) void rrc::ue::apply_rlc_rb_updates(const rr_cfg_ded_s& pending_rr_cfg) { for (const srb_to_add_mod_s& srb : pending_rr_cfg.srb_to_add_mod_list) { - srsran_assert(srb.srb_id == 1 || srb.srb_id == 2, "Trying to configure invalid SRB Id."); + srb_cfg_t* srb_cfg; if (srb.srb_id == 1) { - if (parent->cfg.srb1_cfg.type() == srb_to_add_mod_s::rlc_cfg_c_::types_opts::explicit_value) { - parent->rlc->add_bearer(rnti, srb.srb_id, srsran::make_rlc_config_t(parent->cfg.srb1_cfg.explicit_value())); - } else { - parent->rlc->add_bearer(rnti, srb.srb_id, srsran::rlc_config_t::srb_config(srb.srb_id)); - } + srb_cfg = &parent->cfg.srb1_cfg; } else if (srb.srb_id == 2) { - if (parent->cfg.srb2_cfg.type() == srb_to_add_mod_s::rlc_cfg_c_::types_opts::explicit_value) { - parent->rlc->add_bearer(rnti, srb.srb_id, srsran::make_rlc_config_t(parent->cfg.srb2_cfg.explicit_value())); - } else { - parent->rlc->add_bearer(rnti, srb.srb_id, srsran::rlc_config_t::srb_config(srb.srb_id)); + srb_cfg = &parent->cfg.srb2_cfg; + } else { + srsran_terminate("Invalid LTE SRB id=%d", srb.srb_id); + } + + if (srb_cfg->rlc_cfg.type() == srb_to_add_mod_s::rlc_cfg_c_::types_opts::explicit_value) { + srsran::rlc_config_t rlc_cfg = srsran::make_rlc_config_t(srb_cfg->rlc_cfg.explicit_value()); + if (rlc_cfg.rlc_mode == srsran::rlc_mode_t::am and srb_cfg->enb_dl_max_retx_thres > 0) { + rlc_cfg.am.max_retx_thresh = srb_cfg->enb_dl_max_retx_thres; + } + parent->rlc->add_bearer(rnti, srb.srb_id, rlc_cfg); + } else { + srsran::rlc_config_t rlc_cfg = srsran::rlc_config_t::srb_config(srb.srb_id); + if (rlc_cfg.rlc_mode == srsran::rlc_mode_t::am and srb_cfg->enb_dl_max_retx_thres > 0) { + rlc_cfg.am.max_retx_thresh = srb_cfg->enb_dl_max_retx_thres; } + parent->rlc->add_bearer(rnti, srb.srb_id, rlc_cfg); } } @@ -1437,7 +1445,13 @@ void rrc::ue::apply_rlc_rb_updates(const rr_cfg_ded_s& pending_rr_cfg) if (not drb.rlc_cfg_present) { parent->logger.warning("Default RLC DRB config not supported"); } - parent->rlc->add_bearer(rnti, drb.lc_ch_id, srsran::make_rlc_config_t(drb.rlc_cfg)); + srsran::rlc_config_t rlc_cfg = srsran::make_rlc_config_t(drb.rlc_cfg); + const bearer_cfg_handler::erab_t& erab = bearer_list.get_erabs().at(drb.eps_bearer_id); + if (rlc_cfg.rlc_mode == srsran::rlc_mode_t::am and + parent->cfg.qci_cfg.at(erab.qos_params.qci).enb_dl_max_retx_thres > 0) { + rlc_cfg.am.max_retx_thresh = parent->cfg.qci_cfg.at(erab.qos_params.qci).enb_dl_max_retx_thres; + } + parent->rlc->add_bearer(rnti, drb.lc_ch_id, rlc_cfg); } } diff --git a/srsenb/src/stack/rrc/ue_rr_cfg.cc b/srsenb/src/stack/rrc/ue_rr_cfg.cc index 7b7963a1c..1d56d339c 100644 --- a/srsenb/src/stack/rrc/ue_rr_cfg.cc +++ b/srsenb/src/stack/rrc/ue_rr_cfg.cc @@ -54,11 +54,11 @@ void fill_srbs_reconf(srb_to_add_mod_list_l& srbs, const srb_to_add_mod_list_l& { // NOTE: In case of Handover, the Reconf includes SRB1 if (srsran::find_rrc_obj_id(current_srbs, 1) == current_srbs.end()) { - add_srb(srbs, 1, enb_cfg.srb1_cfg); + add_srb(srbs, 1, enb_cfg.srb1_cfg.rlc_cfg); } if (srsran::find_rrc_obj_id(current_srbs, 2) == current_srbs.end()) { - add_srb(srbs, 2, enb_cfg.srb2_cfg); + add_srb(srbs, 2, enb_cfg.srb2_cfg.rlc_cfg); } } @@ -299,7 +299,7 @@ void fill_rr_cfg_ded_setup(asn1::rrc::rr_cfg_ded_s& rr_cfg, // (Re)establish SRB1 rr_cfg.srb_to_add_mod_list_present = true; - add_srb(rr_cfg.srb_to_add_mod_list, 1, enb_cfg.srb1_cfg); + add_srb(rr_cfg.srb_to_add_mod_list, 1, enb_cfg.srb1_cfg.rlc_cfg); // Setup SR/CQI configs rr_cfg.phys_cfg_ded_present = true;