From e1a4e63ec823e7fb2020007480177779c73fcba9 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Wed, 22 Sep 2021 18:51:54 +0200 Subject: [PATCH] sched,nr: use MAC-NR as prefix for NR scheduler --- srsenb/hdr/stack/mac/nr/sched_nr_interface.h | 2 +- srsenb/src/stack/mac/nr/sched_nr.cc | 4 +++- srsenb/src/stack/mac/nr/sched_nr_cell.cc | 10 +++++++--- srsenb/src/stack/mac/nr/sched_nr_helpers.cc | 3 ++- srsenb/src/stack/mac/nr/sched_nr_worker.cc | 7 +++++-- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/srsenb/hdr/stack/mac/nr/sched_nr_interface.h b/srsenb/hdr/stack/mac/nr/sched_nr_interface.h index b8fb7c94a..700ba7942 100644 --- a/srsenb/hdr/stack/mac/nr/sched_nr_interface.h +++ b/srsenb/hdr/stack/mac/nr/sched_nr_interface.h @@ -69,7 +69,7 @@ public: bool pdsch_enabled = true; bool pusch_enabled = true; bool auto_refill_buffer = false; - std::string logger_name = "MAC"; + std::string logger_name = "MAC-NR"; }; struct ue_cc_cfg_t { diff --git a/srsenb/src/stack/mac/nr/sched_nr.cc b/srsenb/src/stack/mac/nr/sched_nr.cc index 53d541aee..b2c503f07 100644 --- a/srsenb/src/stack/mac/nr/sched_nr.cc +++ b/srsenb/src/stack/mac/nr/sched_nr.cc @@ -65,7 +65,9 @@ private: /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -sched_nr::sched_nr(const sched_cfg_t& sched_cfg) : cfg(sched_cfg), logger(srslog::fetch_basic_logger("MAC-NR")) {} +sched_nr::sched_nr(const sched_cfg_t& sched_cfg) : + cfg(sched_cfg), logger(srslog::fetch_basic_logger(sched_cfg.logger_name)) +{} sched_nr::~sched_nr() {} diff --git a/srsenb/src/stack/mac/nr/sched_nr_cell.cc b/srsenb/src/stack/mac/nr/sched_nr_cell.cc index 7caa57e97..909263669 100644 --- a/srsenb/src/stack/mac/nr/sched_nr_cell.cc +++ b/srsenb/src/stack/mac/nr/sched_nr_cell.cc @@ -17,7 +17,9 @@ namespace srsenb { namespace sched_nr_impl { -si_sched::si_sched(const bwp_params& bwp_cfg_) : bwp_cfg(&bwp_cfg_), logger(srslog::fetch_basic_logger("MAC")) {} +si_sched::si_sched(const bwp_params& bwp_cfg_) : + bwp_cfg(&bwp_cfg_), logger(srslog::fetch_basic_logger(bwp_cfg_.sched_cfg.logger_name)) +{} void si_sched::run_slot(bwp_slot_allocator& slot_alloc) { @@ -75,7 +77,9 @@ void si_sched::run_slot(bwp_slot_allocator& slot_alloc) /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -ra_sched::ra_sched(const bwp_params& bwp_cfg_) : bwp_cfg(&bwp_cfg_), logger(srslog::fetch_basic_logger("MAC")) {} +ra_sched::ra_sched(const bwp_params& bwp_cfg_) : + bwp_cfg(&bwp_cfg_), logger(srslog::fetch_basic_logger(bwp_cfg_.sched_cfg.logger_name)) +{} alloc_result ra_sched::allocate_pending_rar(bwp_slot_allocator& slot_grid, const pending_rar_t& rar, uint32_t& nof_grants_alloc) @@ -223,7 +227,7 @@ bwp_ctxt::bwp_ctxt(const bwp_params& bwp_cfg) : ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// serv_cell_manager::serv_cell_manager(const sched_cell_params& cell_cfg_) : - cfg(cell_cfg_), logger(srslog::fetch_basic_logger("MAC")) + cfg(cell_cfg_), logger(srslog::fetch_basic_logger(cell_cfg_.sched_cfg.logger_name)) { for (uint32_t bwp_id = 0; bwp_id < cfg.cell_cfg.bwps.size(); ++bwp_id) { bwps.emplace_back(cell_cfg_.bwps[bwp_id]); diff --git a/srsenb/src/stack/mac/nr/sched_nr_helpers.cc b/srsenb/src/stack/mac/nr/sched_nr_helpers.cc index ddc49d081..b55b10c81 100644 --- a/srsenb/src/stack/mac/nr/sched_nr_helpers.cc +++ b/srsenb/src/stack/mac/nr/sched_nr_helpers.cc @@ -162,13 +162,14 @@ void log_sched_bwp_result(srslog::basic_logger& logger, if (pdcch.dci.ctx.rnti_type == srsran_rnti_type_c) { const slot_ue& ue = slot_ues[pdcch.dci.ctx.rnti]; fmt::format_to(fmtbuf, - "SCHED: UL {}, cc={}, rnti=0x{:x}, pid={}, f={}, nrtx={}, tbs={}, tti_pusch={}", + "SCHED: UL {}, cc={}, rnti=0x{:x}, pid={}, f={}, nrtx={}, pending_bytes={}, tbs={}, tti_pusch={}", ue.h_ul->nof_retx() == 0 ? "tx" : "retx", res_grid.cfg->cc, ue.rnti, pdcch.dci.pid, srsran_dci_format_nr_string(pdcch.dci.ctx.format), ue.h_ul->nof_retx(), + ue.ul_pending_bytes, ue.h_ul->tbs(), ue.pusch_slot); } else if (pdcch.dci.ctx.rnti_type == srsran_rnti_type_tc) { diff --git a/srsenb/src/stack/mac/nr/sched_nr_worker.cc b/srsenb/src/stack/mac/nr/sched_nr_worker.cc index 74e593c50..2d560036a 100644 --- a/srsenb/src/stack/mac/nr/sched_nr_worker.cc +++ b/srsenb/src/stack/mac/nr/sched_nr_worker.cc @@ -17,7 +17,10 @@ namespace srsenb { namespace sched_nr_impl { slot_cc_worker::slot_cc_worker(serv_cell_manager& cc_sched) : - cell(cc_sched), cfg(cc_sched.cfg), bwp_alloc(cc_sched.bwps[0].grid), logger(srslog::fetch_basic_logger("MAC")) + cell(cc_sched), + cfg(cc_sched.cfg), + bwp_alloc(cc_sched.bwps[0].grid), + logger(srslog::fetch_basic_logger(cc_sched.cfg.sched_cfg.logger_name)) {} void slot_cc_worker::enqueue_cc_event(srsran::move_callback ev) @@ -202,7 +205,7 @@ void slot_cc_worker::postprocess_decisions() sched_worker_manager::sched_worker_manager(ue_map_t& ue_db_, const sched_params& cfg_, srsran::span > cells_) : - cfg(cfg_), ue_db(ue_db_), logger(srslog::fetch_basic_logger("MAC")), cells(cells_) + cfg(cfg_), ue_db(ue_db_), logger(srslog::fetch_basic_logger(cfg_.sched_cfg.logger_name)), cells(cells_) { cc_worker_list.reserve(cfg.cells.size()); for (uint32_t cc = 0; cc < cfg.cells.size(); ++cc) {