diff --git a/srsenb/src/stack/mac/scheduler_harq.cc b/srsenb/src/stack/mac/scheduler_harq.cc index 9efa928cb..af4fdb166 100644 --- a/srsenb/src/stack/mac/scheduler_harq.cc +++ b/srsenb/src/stack/mac/scheduler_harq.cc @@ -268,10 +268,8 @@ void ul_harq_proc::new_tx(uint32_t tti_, int mcs, int tbs, ul_harq_proc::ul_allo void ul_harq_proc::new_retx(uint32_t tb_idx, uint32_t tti_, int* mcs, int* tbs, ul_harq_proc::ul_alloc_t alloc) { - if (alloc.L != allocation.L or alloc.RB_start != allocation.RB_start) { - is_adaptive = true; - } - allocation = alloc; + is_adaptive = alloc.L != allocation.L or alloc.RB_start != allocation.RB_start; + allocation = alloc; new_retx_common(tb_idx, tti_, mcs, tbs); } diff --git a/srsenb/src/stack/mac/scheduler_ue.cc b/srsenb/src/stack/mac/scheduler_ue.cc index 65178f60f..ddda5bcfb 100644 --- a/srsenb/src/stack/mac/scheduler_ue.cc +++ b/srsenb/src/stack/mac/scheduler_ue.cc @@ -395,11 +395,17 @@ int sched_ue::generate_format1(dl_harq_proc* h, mcs = mcs0; } + // Ensure tbs >= MIN_DATA_TBS + while (tbs < MIN_DATA_TBS and mcs != carriers[cc_idx].max_mcs_dl) { + mcs++; + tbs = srslte_ra_tbs_from_idx(srslte_ra_tbs_idx_from_mcs(mcs, false), nof_prb) / 8; + } if (tbs < MIN_DATA_TBS) { log_h->warning("SCHED: Allocation of TBS=%d that does not account header\n", tbs); return 0; } + // Allocate DL Harq h->new_tx(user_mask, 0, tti_tx_dl, mcs, tbs, data->dci.location.ncce); int rem_tbs = tbs; @@ -420,6 +426,7 @@ int sched_ue::generate_format1(dl_harq_proc* h, rem_tbs -= 2; } + // Allocate PDUs do { x = alloc_pdu(rem_tbs, &data->pdu[0][data->nof_pdu_elems[0]]); if (x) {