|
|
|
@ -27,7 +27,7 @@ int ue_buffer_manager::get_dl_tx_total() const
|
|
|
|
|
return total_bytes;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ue_buffer_manager::slot_itf::alloc_subpdus(uint32_t rem_bytes, sched_nr_interface::dl_pdu_t& pdu)
|
|
|
|
|
void ue_buffer_manager::pdu_builder::alloc_subpdus(uint32_t rem_bytes, sched_nr_interface::dl_pdu_t& pdu)
|
|
|
|
|
{
|
|
|
|
|
for (ce_t ce : parent->pending_ces) {
|
|
|
|
|
if (ce.cc == cc) {
|
|
|
|
@ -53,12 +53,8 @@ void ue_buffer_manager::slot_itf::alloc_subpdus(uint32_t rem_bytes, sched_nr_int
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
slot_ue::slot_ue(ue_carrier& ue_,
|
|
|
|
|
slot_point slot_tx_,
|
|
|
|
|
uint32_t dl_pending_bytes,
|
|
|
|
|
uint32_t ul_pending_bytes,
|
|
|
|
|
ue_buffer_manager::slot_itf buffers_) :
|
|
|
|
|
ue(&ue_), pdcch_slot(slot_tx_), buffers(buffers_)
|
|
|
|
|
slot_ue::slot_ue(ue_carrier& ue_, slot_point slot_tx_, uint32_t dl_pending_bytes, uint32_t ul_pending_bytes) :
|
|
|
|
|
ue(&ue_), pdcch_slot(slot_tx_)
|
|
|
|
|
{
|
|
|
|
|
const uint32_t k0 = 0;
|
|
|
|
|
pdsch_slot = pdcch_slot + k0;
|
|
|
|
@ -89,12 +85,16 @@ slot_ue::slot_ue(ue_carrier& ue_,
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
ue_carrier::ue_carrier(uint16_t rnti_, const ue_cfg_t& uecfg_, const cell_params_t& cell_params_) :
|
|
|
|
|
ue_carrier::ue_carrier(uint16_t rnti_,
|
|
|
|
|
const ue_cfg_t& uecfg_,
|
|
|
|
|
const cell_params_t& cell_params_,
|
|
|
|
|
const ue_buffer_manager::pdu_builder& pdu_builder_) :
|
|
|
|
|
rnti(rnti_),
|
|
|
|
|
cc(cell_params_.cc),
|
|
|
|
|
logger(srslog::fetch_basic_logger(cell_params_.sched_args.logger_name)),
|
|
|
|
|
bwp_cfg(rnti_, cell_params_.bwps[0], uecfg_),
|
|
|
|
|
cell_params(cell_params_),
|
|
|
|
|
pdu_builder(pdu_builder_),
|
|
|
|
|
harq_ent(rnti_, cell_params_.nof_prb(), SCHED_NR_MAX_HARQ, cell_params_.bwps[0].logger)
|
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
@ -138,13 +138,12 @@ ue::ue(uint16_t rnti_, const ue_cfg_t& cfg, const sched_params_t& sched_cfg_) :
|
|
|
|
|
|
|
|
|
|
void ue::set_cfg(const ue_cfg_t& cfg)
|
|
|
|
|
{
|
|
|
|
|
bool conres_needed = not cfg.is_temp_crnti and ue_cfg.is_temp_crnti;
|
|
|
|
|
|
|
|
|
|
ue_cfg = cfg;
|
|
|
|
|
for (auto& ue_cc_cfg : cfg.carriers) {
|
|
|
|
|
if (ue_cc_cfg.active) {
|
|
|
|
|
if (carriers[ue_cc_cfg.cc] == nullptr) {
|
|
|
|
|
carriers[ue_cc_cfg.cc].reset(new ue_carrier(rnti, ue_cfg, sched_cfg.cells[ue_cc_cfg.cc]));
|
|
|
|
|
carriers[ue_cc_cfg.cc].reset(new ue_carrier(
|
|
|
|
|
rnti, ue_cfg, sched_cfg.cells[ue_cc_cfg.cc], ue_buffer_manager::pdu_builder{ue_cc_cfg.cc, buffers}));
|
|
|
|
|
} else {
|
|
|
|
|
carriers[ue_cc_cfg.cc]->set_cfg(ue_cfg);
|
|
|
|
|
}
|
|
|
|
@ -152,10 +151,6 @@ void ue::set_cfg(const ue_cfg_t& cfg)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
buffers.config_lcids(cfg.ue_bearers);
|
|
|
|
|
|
|
|
|
|
if (conres_needed) {
|
|
|
|
|
mac_buffer_state(62, 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ue::mac_buffer_state(uint32_t ce_lcid, uint32_t nof_cmds)
|
|
|
|
@ -166,6 +161,16 @@ void ue::mac_buffer_state(uint32_t ce_lcid, uint32_t nof_cmds)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ue::rlc_buffer_state(uint32_t lcid, uint32_t newtx, uint32_t retx)
|
|
|
|
|
{
|
|
|
|
|
if (lcid == 0) {
|
|
|
|
|
// In case of DL-CCCH, schedule ConRes CE
|
|
|
|
|
// Note: use push_front because ConRes CE has priority
|
|
|
|
|
buffers.pending_ces.push_front({srsran::mac_sch_subpdu_nr::CON_RES_ID, cfg().carriers[0].cc});
|
|
|
|
|
}
|
|
|
|
|
buffers.dl_buffer_state(lcid, newtx, retx);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ue::new_slot(slot_point pdcch_slot)
|
|
|
|
|
{
|
|
|
|
|
last_pdcch_slot = pdcch_slot;
|
|
|
|
@ -208,11 +213,7 @@ void ue::new_slot(slot_point pdcch_slot)
|
|
|
|
|
slot_ue ue::make_slot_ue(slot_point pdcch_slot, uint32_t cc)
|
|
|
|
|
{
|
|
|
|
|
srsran_assert(carriers[cc] != nullptr, "make_slot_ue() called for inexistent rnti=0x%x,cc=%d", rnti, cc);
|
|
|
|
|
return slot_ue(*carriers[cc],
|
|
|
|
|
pdcch_slot,
|
|
|
|
|
dl_pending_bytes,
|
|
|
|
|
ul_pending_bytes,
|
|
|
|
|
ue_buffer_manager::slot_itf{cfg().carriers[cc].cc, buffers});
|
|
|
|
|
return slot_ue(*carriers[cc], pdcch_slot, dl_pending_bytes, ul_pending_bytes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace sched_nr_impl
|
|
|
|
|