bugfix,scheduler: avoid offset to increase decrease unboundedly when mcs is equal to 0 or max_mcs

master
Francisco 3 years ago committed by Andre Puschmann
parent 0dafe4dd58
commit 200006c4b7

@ -181,7 +181,7 @@ enable = false
#policy_args = 2
#min_aggr_level = 0
#max_aggr_level = 3
#adaptive_aggr_level = true
#adaptive_aggr_level = false
#pdsch_mcs = -1
#pdsch_max_mcs = -1
#pusch_mcs = -1

@ -36,6 +36,7 @@ public:
srsran::tti_point get_tti() const;
bool get_ndi(uint32_t tb_idx) const;
uint32_t max_nof_retx() const;
int get_mcs(uint32_t tb_idx) const { return last_mcs[tb_idx]; }
protected:
void new_tx_common(uint32_t tb_idx, srsran::tti_point tti, int mcs, int tbs, uint32_t max_retx_);
@ -147,9 +148,9 @@ public:
* @param tti_rx tti the DL ACK was received
* @param tb_idx TB index for the given ACK
* @param ack true for ACK and false for NACK
* @return pair with pid and size of TB of the DL harq that was ACKed
* @return tuple with pid, TBS and MCS of the DL harq that was ACKed
*/
std::pair<uint32_t, int> set_ack_info(tti_point tti_rx, uint32_t tb_idx, bool ack);
std::tuple<uint32_t, int, int> set_ack_info(tti_point tti_rx, uint32_t tb_idx, bool ack);
//! Get UL Harq for a given tti_tx_ul
ul_harq_proc* get_ul_harq(tti_point tti_tx_ul);

@ -91,7 +91,7 @@ private:
cc_st cc_state_ = cc_st::idle;
// CQI
float delta_down = 0, delta_up = 0;
float delta_inc = 0, delta_dec = 0;
float dl_cqi_coeff = 0, ul_snr_coeff = 0;
float max_cqi_coeff = -5, max_snr_coeff = 5;

@ -147,7 +147,7 @@ void parse_args(all_args_t* args, int argc, char* argv[])
("scheduler.pusch_max_mcs", bpo::value<int>(&args->stack.mac.sched.pusch_max_mcs)->default_value(-1), "Optional PUSCH MCS limit")
("scheduler.min_aggr_level", bpo::value<int>(&args->stack.mac.sched.min_aggr_level)->default_value(0), "Optional minimum aggregation level index (l=log2(L)) ")
("scheduler.max_aggr_level", bpo::value<int>(&args->stack.mac.sched.max_aggr_level)->default_value(3), "Optional maximum aggregation level index (l=log2(L)) ")
("scheduler.adaptive_aggr_level", bpo::value<bool>(&args->stack.mac.sched.adaptive_aggr_level)->default_value(true), "Boolean flag to enable/disable adaptive aggregation level based on target BLER")
("scheduler.adaptive_aggr_level", bpo::value<bool>(&args->stack.mac.sched.adaptive_aggr_level)->default_value(false), "Boolean flag to enable/disable adaptive aggregation level based on target BLER")
("scheduler.max_nof_ctrl_symbols", bpo::value<uint32_t>(&args->stack.mac.sched.max_nof_ctrl_symbols)->default_value(3), "Number of control symbols")
("scheduler.min_nof_ctrl_symbols", bpo::value<uint32_t>(&args->stack.mac.sched.min_nof_ctrl_symbols)->default_value(1), "Minimum number of control symbols")
("scheduler.pucch_multiplex_enable", bpo::value<bool>(&args->stack.mac.sched.pucch_mux_enabled)->default_value(false), "Enable PUCCH multiplexing")

@ -366,17 +366,17 @@ dl_harq_proc* harq_entity::get_pending_dl_harq(tti_point tti_tx_dl)
return get_oldest_dl_harq(tti_tx_dl);
}
std::pair<uint32_t, int> harq_entity::set_ack_info(tti_point tti_rx, uint32_t tb_idx, bool ack)
std::tuple<uint32_t, int, int> harq_entity::set_ack_info(tti_point tti_rx, uint32_t tb_idx, bool ack)
{
for (auto& h : dl_harqs) {
if (h.get_tti() + FDD_HARQ_DELAY_DL_MS == tti_rx) {
if (h.set_ack(tb_idx, ack) == SRSRAN_SUCCESS) {
return {h.get_id(), h.get_tbs(tb_idx)};
return {h.get_id(), h.get_tbs(tb_idx), h.get_mcs(tb_idx)};
}
return {h.get_id(), -1};
return {h.get_id(), -1, -1};
}
}
return {dl_harqs.size(), -1};
return {dl_harqs.size(), -1, -1};
}
ul_harq_proc* harq_entity::get_ul_harq(tti_point tti_tx_ul)

@ -49,8 +49,8 @@ sched_ue_cell::sched_ue_cell(uint16_t rnti_, const sched_cell_params_t& cell_cfg
clear_feedback();
float target_bler = cell_cfg->sched_cfg->target_bler;
delta_down = cell_cfg->sched_cfg->adaptive_link_step_size;
delta_up = (1 - target_bler) * delta_down / target_bler;
delta_inc = cell_cfg->sched_cfg->adaptive_link_step_size; // delta_{down} of OLLA
delta_dec = (1 - target_bler) * delta_inc / target_bler;
max_cqi_coeff = cell_cfg->sched_cfg->max_delta_dl_cqi;
max_snr_coeff = cell_cfg->sched_cfg->max_delta_ul_snr;
}
@ -178,6 +178,24 @@ int sched_ue_cell::set_dl_wb_cqi(tti_point tti_rx, uint32_t dl_cqi_)
int sched_ue_cell::set_ul_crc(tti_point tti_rx, bool crc_res)
{
CHECK_VALID_CC("UL CRC");
// Adapt UL MCS based on BLER
if (cell_cfg->sched_cfg->target_bler > 0 and fixed_mcs_ul < 0) {
auto* ul_harq = harq_ent.get_ul_harq(tti_rx);
if (ul_harq != nullptr) {
int mcs = ul_harq->get_mcs(0);
// Note: Avoid keeping increasing the snr delta offset, if MCS is already is at its limit
float delta_dec_eff = mcs <= 0 ? 0 : delta_dec;
float delta_inc_eff = mcs >= (int)max_mcs_ul ? 0 : delta_inc;
ul_snr_coeff += crc_res ? delta_inc_eff : -delta_dec_eff;
ul_snr_coeff = std::min(std::max(-max_snr_coeff, ul_snr_coeff), max_snr_coeff);
logger.info("SCHED: UL adaptive link: snr_estim=%.2f, last_mcs=%d, snr_offset=%f",
tpc_fsm.get_ul_snr_estim(),
mcs,
ul_snr_coeff);
}
}
// Update HARQ process
int pid = harq_ent.set_ul_crc(tti_rx, 0, crc_res);
if (pid < 0) {
@ -185,30 +203,30 @@ int sched_ue_cell::set_ul_crc(tti_point tti_rx, bool crc_res)
return SRSRAN_ERROR;
}
if (cell_cfg->sched_cfg->target_bler > 0) {
ul_snr_coeff += delta_down - static_cast<float>(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;
}
int sched_ue_cell::set_ack_info(tti_point tti_rx, uint32_t tb_idx, bool ack)
{
CHECK_VALID_CC("DL ACK Info");
std::pair<uint32_t, int> p2 = harq_ent.set_ack_info(tti_rx, tb_idx, ack);
int tbs_acked = p2.second;
if (tbs_acked > 0) {
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());
if (cell_cfg->sched_cfg->target_bler > 0) {
dl_cqi_coeff += delta_down - static_cast<float>(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 {
std::tuple<uint32_t, int, int> p2 = harq_ent.set_ack_info(tti_rx, tb_idx, ack);
int tbs_acked = std::get<1>(p2);
if (tbs_acked <= 0) {
logger.warning("SCHED: Received ACK info for unknown TTI=%d", tti_rx.to_uint());
return tbs_acked;
}
// Adapt DL MCS based on BLER
if (cell_cfg->sched_cfg->target_bler > 0 and fixed_mcs_dl < 0) {
int mcs = std::get<2>(p2);
// Note: Avoid keeping increasing the snr delta offset, if MCS is already is at its limit
float delta_dec_eff = mcs <= 0 ? 0 : delta_dec;
float delta_inc_eff = mcs >= (int)max_mcs_dl ? 0 : delta_inc;
dl_cqi_coeff += ack ? delta_inc_eff : -delta_dec_eff;
dl_cqi_coeff = std::min(std::max(-max_cqi_coeff, dl_cqi_coeff), max_cqi_coeff);
logger.info(
"SCHED: DL adaptive link: cqi=%d, last_mcs=%d, cqi_offset=%f", dl_cqi_ctxt.get_avg_cqi(), mcs, dl_cqi_coeff);
}
return tbs_acked;
}

Loading…
Cancel
Save