mirror of https://github.com/PentHertz/srsLTE.git
sched_nr: add dl_mac_ce() method to allow MAC to schedule CE
MAC can give the scheduler hints as to when to schedule certain CEs in the DL. For example when receiving a CCCH on SRB0.
This commit is contained in:
parent
33378c32c0
commit
db065239e0
|
@ -49,6 +49,7 @@ public:
|
|||
void ul_sr_info(uint16_t rnti) override;
|
||||
void ul_bsr(uint16_t rnti, uint32_t lcg_id, uint32_t bsr) override;
|
||||
void dl_buffer_state(uint16_t rnti, uint32_t lcid, uint32_t newtx, uint32_t retx);
|
||||
void dl_mac_ce(uint16_t rnti, uint32_t ce_lcid) override;
|
||||
void dl_cqi_info(uint16_t rnti, uint32_t cc, uint32_t cqi_value);
|
||||
|
||||
/// Called once per slot in a non-concurrent fashion
|
||||
|
|
|
@ -149,6 +149,15 @@ public:
|
|||
virtual void ul_crc_info(uint16_t rnti, uint32_t cc, uint32_t pid, bool crc) = 0;
|
||||
virtual void ul_sr_info(uint16_t rnti) = 0;
|
||||
virtual void ul_bsr(uint16_t rnti, uint32_t lcg_id, uint32_t bsr) = 0;
|
||||
|
||||
/**
|
||||
* Enqueue MAC CEs for DL transmission
|
||||
*
|
||||
* @param rnti user rnti
|
||||
* @param ce_lcid lcid of the MAC CE
|
||||
* @return error code
|
||||
*/
|
||||
virtual void dl_mac_ce(uint16_t rnti, uint32_t ce_lcid) = 0;
|
||||
};
|
||||
|
||||
} // namespace srsenb
|
||||
|
|
|
@ -128,7 +128,7 @@ public:
|
|||
void set_cfg(const ue_cfg_t& cfg);
|
||||
const ue_cfg_t& cfg() const { return ue_cfg; }
|
||||
|
||||
void mac_buffer_state(uint32_t ce_lcid, uint32_t nof_cmds = 1);
|
||||
void add_dl_mac_ce(uint32_t ce_lcid, uint32_t nof_cmds = 1);
|
||||
void rlc_buffer_state(uint32_t lcid, uint32_t newtx, uint32_t retx);
|
||||
|
||||
/// UE state feedback
|
||||
|
|
|
@ -471,6 +471,15 @@ void sched_nr::ul_bsr(uint16_t rnti, uint32_t lcg_id, uint32_t bsr)
|
|||
});
|
||||
}
|
||||
|
||||
void sched_nr::dl_mac_ce(uint16_t rnti, uint32_t ce_lcid)
|
||||
{
|
||||
pending_events->enqueue_ue_event("dl_mac_ce", rnti, [ce_lcid](ue& u, event_manager::logger& event_logger) {
|
||||
// CE is added to list of pending CE
|
||||
u.add_dl_mac_ce(ce_lcid, 1);
|
||||
event_logger.push("0x{:x}: dl_mac_ce(lcid={})", u.rnti, ce_lcid);
|
||||
});
|
||||
}
|
||||
|
||||
void sched_nr::dl_buffer_state(uint16_t rnti, uint32_t lcid, uint32_t newtx, uint32_t retx)
|
||||
{
|
||||
pending_events->enqueue_ue_event(
|
||||
|
|
|
@ -157,7 +157,7 @@ void ue::set_cfg(const ue_cfg_t& cfg)
|
|||
buffers.config_lcids(cfg.ue_bearers);
|
||||
}
|
||||
|
||||
void ue::mac_buffer_state(uint32_t ce_lcid, uint32_t nof_cmds)
|
||||
void ue::add_dl_mac_ce(uint32_t ce_lcid, uint32_t nof_cmds)
|
||||
{
|
||||
for (uint32_t i = 0; i < nof_cmds; ++i) {
|
||||
// If not specified otherwise, the CE is transmitted in PCell
|
||||
|
@ -167,13 +167,6 @@ 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 priotx)
|
||||
{
|
||||
if (lcid == 0 and (newtx + priotx > 0) and buffers.get_dl_tx_total(0) == 0) {
|
||||
// In case of DL-CCCH, schedule ConRes CE
|
||||
// Note1: rlc_buffer_state may be called multiple times for the same CCCH. Thus, we need to confirm lcid=0 buffer
|
||||
// state is zero to avoid that multiple CEs being scheduled.
|
||||
// Note2: 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, priotx);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue