avoid allocating DL harqs when respective acks are still pending, when there is a reordering of ttis in the phy

master
Francisco Paisana 4 years ago
parent 92b11c1adb
commit 9de318c7e6

@ -73,6 +73,7 @@ public:
int set_ack(uint32_t tb_idx, bool ack); int set_ack(uint32_t tb_idx, bool ack);
rbgmask_t get_rbgmask() const; rbgmask_t get_rbgmask() const;
bool has_pending_retx(uint32_t tb_idx, tti_point tti_tx_dl) const; bool has_pending_retx(uint32_t tb_idx, tti_point tti_tx_dl) const;
bool has_pending_retx(tti_point tti_tx_dl) const;
int get_tbs(uint32_t tb_idx) const; int get_tbs(uint32_t tb_idx) const;
uint32_t get_n_cce() const; uint32_t get_n_cce() const;
void reset_pending_data(); void reset_pending_data();
@ -111,6 +112,7 @@ public:
harq_entity(size_t nof_dl_harqs, size_t nof_ul_harqs); harq_entity(size_t nof_dl_harqs, size_t nof_ul_harqs);
void reset(); void reset();
void new_tti(tti_point tti_rx);
size_t nof_dl_harqs() const { return dl_harqs.size(); } size_t nof_dl_harqs() const { return dl_harqs.size(); }
size_t nof_ul_harqs() const { return ul_harqs.size(); } size_t nof_ul_harqs() const { return ul_harqs.size(); }
@ -155,6 +157,7 @@ private:
dl_harq_proc* get_oldest_dl_harq(tti_point tti_tx_dl); dl_harq_proc* get_oldest_dl_harq(tti_point tti_tx_dl);
srslte::log_ref log_h; srslte::log_ref log_h;
std::array<tti_point, SRSLTE_FDD_NOF_HARQ> last_ttis;
std::vector<dl_harq_proc> dl_harqs; std::vector<dl_harq_proc> dl_harqs;
std::vector<ul_harq_proc> ul_harqs; std::vector<ul_harq_proc> ul_harqs;

@ -258,6 +258,7 @@ private:
bool phy_config_dedicated_enabled = false; bool phy_config_dedicated_enabled = false;
tti_point current_tti; tti_point current_tti;
std::array<tti_point, 4> last_ttis;
std::vector<cc_sched_ue> carriers; ///< map of UE CellIndex to carrier configuration std::vector<cc_sched_ue> carriers; ///< map of UE CellIndex to carrier configuration
std::vector<int> enb_ue_cc_idx_map; std::vector<int> enb_ue_cc_idx_map;
}; };

@ -206,6 +206,11 @@ bool dl_harq_proc::has_pending_retx(uint32_t tb_idx, tti_point tti_tx_dl) const
return (tti_tx_dl >= to_tx_dl_ack(tti)) and has_pending_retx_common(tb_idx); return (tti_tx_dl >= to_tx_dl_ack(tti)) and has_pending_retx_common(tb_idx);
} }
bool dl_harq_proc::has_pending_retx(tti_point tti_tx_dl) const
{
return has_pending_retx(0, tti_tx_dl) or has_pending_retx(1, tti_tx_dl);
}
int dl_harq_proc::get_tbs(uint32_t tb_idx) const int dl_harq_proc::get_tbs(uint32_t tb_idx) const
{ {
return last_tbs[tb_idx]; return last_tbs[tb_idx];
@ -314,6 +319,11 @@ void harq_entity::reset()
} }
} }
void harq_entity::new_tti(tti_point tti_rx)
{
last_ttis[tti_rx.to_uint() % last_ttis.size()] = tti_rx;
}
dl_harq_proc* harq_entity::get_empty_dl_harq(tti_point tti_tx_dl) dl_harq_proc* harq_entity::get_empty_dl_harq(tti_point tti_tx_dl)
{ {
if (not is_async) { if (not is_async) {
@ -382,7 +392,8 @@ dl_harq_proc* harq_entity::get_oldest_dl_harq(tti_point tti_tx_dl)
int oldest_idx = -1; int oldest_idx = -1;
uint32_t oldest_tti = 0; uint32_t oldest_tti = 0;
for (const dl_harq_proc& h : dl_harqs) { for (const dl_harq_proc& h : dl_harqs) {
if (h.has_pending_retx(0, tti_tx_dl) or h.has_pending_retx(1, tti_tx_dl)) { tti_point ack_tti_rx = h.get_tti() + FDD_HARQ_DELAY_DL_MS;
if (h.has_pending_retx(tti_tx_dl) and (last_ttis[ack_tti_rx.to_uint() % last_ttis.size()] == ack_tti_rx)) {
uint32_t x = tti_tx_dl - h.get_tti(); uint32_t x = tti_tx_dl - h.get_tti();
if (x > oldest_tti) { if (x > oldest_tti) {
oldest_idx = h.get_id(); oldest_idx = h.get_id();

@ -227,6 +227,9 @@ void sched_ue::new_subframe(tti_point tti_rx, uint32_t enb_cc_idx)
if (current_tti != tti_rx) { if (current_tti != tti_rx) {
current_tti = tti_rx; current_tti = tti_rx;
lch_handler.new_tti(); lch_handler.new_tti();
for (auto& cc : carriers) {
cc.harq_ent.new_tti(tti_rx);
}
} }
int ue_cc_idx = enb_ue_cc_idx_map[enb_cc_idx]; int ue_cc_idx = enb_ue_cc_idx_map[enb_cc_idx];
if (ue_cc_idx >= 0) { if (ue_cc_idx >= 0) {
@ -1501,7 +1504,7 @@ int cc_sched_ue::get_required_prb_dl(uint32_t req_bytes, uint32_t nof_ctrl_symbo
{ {
auto compute_tbs_approx = [this, nof_ctrl_symbols](uint32_t nof_prb) { auto compute_tbs_approx = [this, nof_ctrl_symbols](uint32_t nof_prb) {
uint32_t nof_re = srslte_ra_dl_approx_nof_re(&cell_params->cfg.cell, nof_prb, nof_ctrl_symbols); uint32_t nof_re = srslte_ra_dl_approx_nof_re(&cell_params->cfg.cell, nof_prb, nof_ctrl_symbols);
int mcs, tbs; int mcs;
if (fixed_mcs_dl < 0 or not dl_cqi_rx) { if (fixed_mcs_dl < 0 or not dl_cqi_rx) {
return alloc_tbs_dl(nof_prb, nof_re, 0, &mcs); return alloc_tbs_dl(nof_prb, nof_re, 0, &mcs);
} }
@ -1523,7 +1526,7 @@ uint32_t cc_sched_ue::get_required_prb_ul(uint32_t req_bytes)
auto compute_tbs_approx = [this](uint32_t nof_prb) { auto compute_tbs_approx = [this](uint32_t nof_prb) {
const uint32_t N_srs = 0; const uint32_t N_srs = 0;
uint32_t nof_re = (2 * (SRSLTE_CP_NSYMB(cell_params->cfg.cell.cp) - 1) - N_srs) * nof_prb * SRSLTE_NRE; uint32_t nof_re = (2 * (SRSLTE_CP_NSYMB(cell_params->cfg.cell.cp) - 1) - N_srs) * nof_prb * SRSLTE_NRE;
int mcs, tbs; int mcs;
if (fixed_mcs_ul < 0) { if (fixed_mcs_ul < 0) {
return alloc_tbs_ul(nof_prb, nof_re, 0, &mcs); return alloc_tbs_ul(nof_prb, nof_re, 0, &mcs);
} }

Loading…
Cancel
Save