From 4627ae98028a6c97d0a8962ae6a89aef24b18c74 Mon Sep 17 00:00:00 2001 From: Francisco Date: Mon, 24 May 2021 20:15:59 +0100 Subject: [PATCH] bugfix, scheduler: effectively disable adaptive mcs when target bler is unspecified --- srsenb/hdr/stack/mac/sched_ue_ctrl/tpc.h | 4 ++-- .../src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc | 16 ++++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/srsenb/hdr/stack/mac/sched_ue_ctrl/tpc.h b/srsenb/hdr/stack/mac/sched_ue_ctrl/tpc.h index 71bbd333f..ad6ad4b26 100644 --- a/srsenb/hdr/stack/mac/sched_ue_ctrl/tpc.h +++ b/srsenb/hdr/stack/mac/sched_ue_ctrl/tpc.h @@ -191,8 +191,8 @@ private: int pending_delta = 0; int acc_tpc_values = 0; - explicit ul_ch_snr_estim(float target_ul_snr = -1) : - snr_avg(0.1, target_ul_snr), win_tpc_values(FDD_HARQ_DELAY_UL_MS + FDD_HARQ_DELAY_DL_MS) + explicit ul_ch_snr_estim(float initial_snr) : + snr_avg(0.1, initial_snr < 0 ? 5 : initial_snr), win_tpc_values(FDD_HARQ_DELAY_UL_MS + FDD_HARQ_DELAY_DL_MS) {} }; std::array snr_estim_list; 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 8f1aca8eb..9304ea8e0 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 @@ -184,9 +184,11 @@ int sched_ue_cell::set_ul_crc(tti_point tti_rx, bool crc_res) return SRSRAN_ERROR; } - ul_snr_coeff += delta_down - static_cast(not crc_res) * (delta_down + delta_up); - ul_snr_coeff = std::min(std::max(-max_snr_coeff, ul_snr_coeff), max_snr_coeff); - logger.info("SCHED: UL adaptive link: snr_estim=%f, snr_offset=%f", tpc_fsm.get_ul_snr_estim(), ul_snr_coeff); + if (cell_cfg->sched_cfg->target_bler > 0) { + ul_snr_coeff += delta_down - static_cast(not crc_res) * (delta_down + delta_up); + ul_snr_coeff = std::min(std::max(-max_snr_coeff, ul_snr_coeff), max_snr_coeff); + logger.info("SCHED: UL adaptive link: snr_estim=%f, snr_offset=%f", tpc_fsm.get_ul_snr_estim(), ul_snr_coeff); + } return pid; } @@ -199,9 +201,11 @@ int sched_ue_cell::set_ack_info(tti_point tti_rx, uint32_t tb_idx, bool ack) logger.debug( "SCHED: Set DL ACK=%d for rnti=0x%x, pid=%d, tb=%d, tti=%d", ack, rnti, p2.first, tb_idx, tti_rx.to_uint()); - dl_cqi_coeff += delta_down - static_cast(not ack) * (delta_down + delta_up); - dl_cqi_coeff = std::min(std::max(-max_cqi_coeff, dl_cqi_coeff), max_cqi_coeff); - logger.info("SCHED: DL adaptive link: cqi=%d, cqi_offset=%f", dl_cqi_ctxt.get_avg_cqi(), dl_cqi_coeff); + if (cell_cfg->sched_cfg->target_bler > 0) { + dl_cqi_coeff += delta_down - static_cast(not ack) * (delta_down + delta_up); + dl_cqi_coeff = std::min(std::max(-max_cqi_coeff, dl_cqi_coeff), max_cqi_coeff); + logger.info("SCHED: DL adaptive link: cqi=%d, cqi_offset=%f", dl_cqi_ctxt.get_avg_cqi(), dl_cqi_coeff); + } } else { logger.warning("SCHED: Received ACK info for unknown TTI=%d", tti_rx.to_uint()); }