sched,nr: fix max number of UEs in NR scheduler

master
Francisco Paisana 3 years ago
parent 201f29b4e5
commit cb2c339456

@ -15,10 +15,11 @@
#include "sched_nr_interface.h"
#include "sched_nr_rb.h"
#include "srsenb/hdr/common/common_enb.h"
namespace srsenb {
const static size_t SCHED_NR_MAX_USERS = 4;
const static size_t SCHED_NR_MAX_USERS = SRSENB_MAX_UES;
const static size_t SCHED_NR_NOF_SUBFRAMES = 10;
const static size_t SCHED_NR_NOF_HARQS = 16;
static const size_t MAX_NOF_AGGR_LEVELS = 5;

@ -114,8 +114,8 @@ private:
ue_cfg_t ue_cfg;
};
using ue_map_t = srsran::static_circular_map<uint16_t, std::unique_ptr<ue>, SCHED_NR_MAX_USERS>;
using slot_ue_map_t = srsran::static_circular_map<uint16_t, slot_ue, SCHED_NR_MAX_USERS>;
using ue_map_t = rnti_map_t<std::unique_ptr<ue> >;
using slot_ue_map_t = rnti_map_t<slot_ue>;
} // namespace sched_nr_impl

@ -101,7 +101,7 @@ public:
}
private:
void update_ue_db(slot_point slot_tx, bool update_ca_users);
void update_ue_db(slot_point slot_tx, bool locked_context);
bool save_sched_result(slot_point pdcch_slot, uint32_t cc, dl_sched_res_t& dl_res, ul_sched_t& ul_res);

@ -98,7 +98,12 @@ void sched_nr::ue_cfg(uint16_t rnti, const ue_cfg_t& uecfg)
void sched_nr::ue_cfg_impl(uint16_t rnti, const ue_cfg_t& uecfg)
{
if (not ue_db.contains(rnti)) {
ue_db.insert(rnti, std::unique_ptr<ue>(new ue{rnti, uecfg, cfg}));
auto ret = ue_db.insert(rnti, std::unique_ptr<ue>(new ue{rnti, uecfg, cfg}));
if (ret.has_value()) {
logger.info("SCHED: New user rnti=0x%x, cc=%d", rnti, cfg.cells[0].cc);
} else {
logger.error("SCHED: Failed to create new user rnti=0x%x", rnti);
}
} else {
ue_db[rnti]->set_cfg(uecfg);
}

@ -140,12 +140,7 @@ slot_ue ue::try_reserve(slot_point pdcch_slot, uint32_t cc)
return slot_ue();
}
slot_ue sfu = carriers[cc]->try_reserve(pdcch_slot, cfg(), dl_pending_bytes, ul_pending_bytes);
if (sfu.empty()) {
return slot_ue();
}
return sfu;
return carriers[cc]->try_reserve(pdcch_slot, cfg(), dl_pending_bytes, ul_pending_bytes);
}
} // namespace sched_nr_impl

@ -147,20 +147,21 @@ void sched_worker_manager::enqueue_cc_event(uint32_t cc, srsran::move_callback<v
/**
* Update UEs state that is non-CC specific (e.g. SRs, buffer status, UE configuration)
* @param slot_tx
* @param update_ca_users to update only UEs with CA enabled or not
* @param locked_context to update only UEs with CA enabled or not
*/
void sched_worker_manager::update_ue_db(slot_point slot_tx, bool update_ca_users)
void sched_worker_manager::update_ue_db(slot_point slot_tx, bool locked_context)
{
// process non-cc specific feedback if pending (e.g. SRs, buffer updates, UE config)
for (ue_event_t& ev : slot_events) {
if (not ue_db.contains(ev.rnti) or ue_db[ev.rnti]->has_ca() == update_ca_users) {
if ((locked_context and not ue_db.contains(ev.rnti)) or
(ue_db.contains(ev.rnti) and ue_db[ev.rnti]->has_ca() == locked_context)) {
ev.callback();
}
}
// prepare UEs internal state for new slot
for (auto& u : ue_db) {
if (u.second->has_ca() == update_ca_users) {
if (u.second->has_ca() == locked_context) {
u.second->new_slot(slot_tx);
}
}

Loading…
Cancel
Save