nr,sched: fix recomputation of ue_bwp_cfg when sched receives new ue_cfg objects

master
Francisco 3 years ago committed by Francisco Paisana
parent fed53c91d0
commit 64ffd81cf9

@ -124,10 +124,18 @@ public:
bwp_ue_cfg() = default;
explicit bwp_ue_cfg(uint16_t rnti, const bwp_params_t& bwp_cfg, const ue_cfg_t& uecfg_);
const ue_cfg_t* ue_cfg() const { return cfg_; }
const srsran::phy_cfg_nr_t& phy() const { return cfg_->phy_cfg; }
const bwp_params_t& active_bwp() const { return *bwp_cfg; }
const bwp_cce_pos_list& cce_pos_list(uint32_t search_id) const
const ue_cfg_t* ue_cfg() const { return cfg_; }
const srsran::phy_cfg_nr_t& phy() const { return cfg_->phy_cfg; }
const bwp_params_t& active_bwp() const { return *bwp_cfg; }
srsran::const_span<uint32_t> cce_pos_list(uint32_t search_id, uint32_t slot_idx, uint32_t aggr_idx) const
{
if (cce_positions_list.size() > ss_id_to_cce_idx[search_id]) {
auto& lst = cce_pos_list(search_id);
return lst[slot_idx][aggr_idx];
}
return srsran::const_span<uint32_t>{};
}
const bwp_cce_pos_list& cce_pos_list(uint32_t search_id) const
{
return cce_positions_list[ss_id_to_cce_idx[search_id]];
}

@ -63,7 +63,8 @@ class ue_carrier
{
public:
ue_carrier(uint16_t rnti, const ue_cfg_t& cfg, const cell_params_t& cell_params_);
slot_ue try_reserve(slot_point pdcch_slot, const ue_cfg_t& uecfg_, uint32_t dl_harq_bytes, uint32_t ul_harq_bytes);
void set_cfg(const ue_cfg_t& ue_cfg);
slot_ue try_reserve(slot_point pdcch_slot, uint32_t dl_harq_bytes, uint32_t ul_harq_bytes);
const uint16_t rnti;
const uint32_t cc;

@ -179,9 +179,9 @@ srsran::span<const uint32_t> coreset_region::get_cce_loc_table(const alloc_recor
{
switch (record.alloc_type) {
case pdcch_grant_type_t::dl_data:
return record.ue->cfg->cce_pos_list(record.ss_id)[slot_idx][record.aggr_idx];
return record.ue->cfg->cce_pos_list(record.ss_id, slot_idx, record.aggr_idx);
case pdcch_grant_type_t::ul_data:
return record.ue->cfg->cce_pos_list(record.ss_id)[slot_idx][record.aggr_idx];
return record.ue->cfg->cce_pos_list(record.ss_id, slot_idx, record.aggr_idx);
case pdcch_grant_type_t::rar:
return rar_cce_list[slot_idx][record.aggr_idx];
default:
@ -191,4 +191,4 @@ srsran::span<const uint32_t> coreset_region::get_cce_loc_table(const alloc_recor
}
} // namespace sched_nr_impl
} // namespace srsenb
} // namespace srsenb

@ -29,17 +29,14 @@ ue_carrier::ue_carrier(uint16_t rnti_, const ue_cfg_t& uecfg_, const cell_params
harq_ent(cell_params_.nof_prb())
{}
slot_ue ue_carrier::try_reserve(slot_point pdcch_slot,
const ue_cfg_t& uecfg_,
uint32_t dl_pending_bytes,
uint32_t ul_pending_bytes)
void ue_carrier::set_cfg(const ue_cfg_t& ue_cfg)
{
slot_point slot_rx = pdcch_slot - TX_ENB_DELAY;
bwp_cfg = bwp_ue_cfg(rnti, cell_params.bwps[0], ue_cfg);
}
// update CC/BWP config if there were changes
if (bwp_cfg.ue_cfg() != &uecfg_) {
bwp_cfg = bwp_ue_cfg(rnti, cell_params.bwps[0], uecfg_);
}
slot_ue ue_carrier::try_reserve(slot_point pdcch_slot, uint32_t dl_pending_bytes, uint32_t ul_pending_bytes)
{
slot_point slot_rx = pdcch_slot - TX_ENB_DELAY;
// copy cc-specific parameters and find available HARQs
slot_ue sfu(rnti, slot_rx, cc);
@ -90,8 +87,12 @@ void ue::set_cfg(const ue_cfg_t& cfg)
{
ue_cfg = cfg;
for (auto& ue_cc_cfg : cfg.carriers) {
if (ue_cc_cfg.active and carriers[ue_cc_cfg.cc] == nullptr) {
carriers[ue_cc_cfg.cc].reset(new ue_carrier(rnti, cfg, sched_cfg.cells[ue_cc_cfg.cc]));
if (ue_cc_cfg.active) {
if (carriers[ue_cc_cfg.cc] == nullptr) {
carriers[ue_cc_cfg.cc].reset(new ue_carrier(rnti, cfg, sched_cfg.cells[ue_cc_cfg.cc]));
} else {
carriers[ue_cc_cfg.cc]->set_cfg(ue_cfg);
}
}
}
@ -147,7 +148,7 @@ slot_ue ue::try_reserve(slot_point pdcch_slot, uint32_t cc)
return slot_ue();
}
return carriers[cc]->try_reserve(pdcch_slot, cfg(), dl_pending_bytes, ul_pending_bytes);
return carriers[cc]->try_reserve(pdcch_slot, dl_pending_bytes, ul_pending_bytes);
}
} // namespace sched_nr_impl

Loading…
Cancel
Save