diff --git a/srsenb/hdr/stack/mac/nr/sched_nr_ue.h b/srsenb/hdr/stack/mac/nr/sched_nr_ue.h index 51780ceaa..1507b6206 100644 --- a/srsenb/hdr/stack/mac/nr/sched_nr_ue.h +++ b/srsenb/hdr/stack/mac/nr/sched_nr_ue.h @@ -118,7 +118,7 @@ public: ul_harq_proc* find_empty_ul_harq() { return ue->harq_ent.find_empty_ul_harq(); } // UE parameters common to all sectors - uint32_t dl_pending_bytes = 0, ul_pending_bytes = 0; + uint32_t dl_bytes = 0, ul_bytes = 0; // UE parameters that are sector specific bool dl_active; diff --git a/srsenb/src/stack/mac/nr/sched_nr_helpers.cc b/srsenb/src/stack/mac/nr/sched_nr_helpers.cc index 898955371..770e06be5 100644 --- a/srsenb/src/stack/mac/nr/sched_nr_helpers.cc +++ b/srsenb/src/stack/mac/nr/sched_nr_helpers.cc @@ -125,8 +125,7 @@ void log_sched_slot_ues(srslog::basic_logger& logger, slot_point pdcch_slot, uin for (const auto& ue_pair : slot_ues) { auto& ue = ue_pair->second; - fmt::format_to( - fmtbuf, "{}{{rnti=0x{:x}, dl_bs={}, ul_bs={}}}", use_comma, ue->rnti, ue.dl_pending_bytes, ue.ul_pending_bytes); + fmt::format_to(fmtbuf, "{}{{rnti=0x{:x}, dl_bs={}, ul_bs={}}}", use_comma, ue->rnti, ue.dl_bytes, ue.ul_bytes); use_comma = ", "; } @@ -157,7 +156,7 @@ void log_sched_bwp_result(srslog::basic_logger& logger, ue.h_dl->nof_retx(), pdcch.dci.dai, ue.h_dl->tbs() / 8u, - ue.dl_pending_bytes, + ue.dl_bytes, ue.pdsch_slot, ue.uci_slot); } else if (pdcch.dci.ctx.rnti_type == srsran_rnti_type_ra) { @@ -194,7 +193,7 @@ void log_sched_bwp_result(srslog::basic_logger& logger, srsran_dci_format_nr_string(pdcch.dci.ctx.format), ue.h_ul->nof_retx(), ue.h_ul->tbs() / 8u, - ue.ul_pending_bytes, + ue.ul_bytes, ue.pusch_slot); } else if (pdcch.dci.ctx.rnti_type == srsran_rnti_type_tc) { const slot_ue& ue = slot_ues[pdcch.dci.ctx.rnti]; diff --git a/srsenb/src/stack/mac/nr/sched_nr_time_rr.cc b/srsenb/src/stack/mac/nr/sched_nr_time_rr.cc index 4e8941ac5..b46ed63cb 100644 --- a/srsenb/src/stack/mac/nr/sched_nr_time_rr.cc +++ b/srsenb/src/stack/mac/nr/sched_nr_time_rr.cc @@ -51,7 +51,7 @@ void sched_nr_time_rr::sched_dl_users(slot_ue_map_t& ue_db, bwp_slot_allocator& // Move on to new txs round_robin_apply(ue_db, slot_alloc.get_pdcch_tti().to_uint(), [&slot_alloc](slot_ue& ue) { - if (ue.h_dl != nullptr and ue.h_dl->empty()) { + if (ue.dl_bytes > 0 and ue.h_dl != nullptr and ue.h_dl->empty()) { alloc_result res = slot_alloc.alloc_pdsch(ue, prb_interval{0, slot_alloc.cfg.cfg.rb_width}); if (res == alloc_result::success) { return true; @@ -78,7 +78,7 @@ void sched_nr_time_rr::sched_ul_users(slot_ue_map_t& ue_db, bwp_slot_allocator& // Move on to new txs round_robin_apply(ue_db, slot_alloc.get_pdcch_tti().to_uint(), [&slot_alloc](slot_ue& ue) { - if (ue.h_ul != nullptr and ue.h_ul->empty()) { + if (ue.ul_bytes > 0 and ue.h_ul != nullptr and ue.h_ul->empty()) { alloc_result res = slot_alloc.alloc_pusch(ue, prb_interval{0, slot_alloc.cfg.cfg.rb_width}); if (res == alloc_result::success) { return true; diff --git a/srsenb/src/stack/mac/nr/sched_nr_ue.cc b/srsenb/src/stack/mac/nr/sched_nr_ue.cc index 92d0917b7..1a41fb5c0 100644 --- a/srsenb/src/stack/mac/nr/sched_nr_ue.cc +++ b/srsenb/src/stack/mac/nr/sched_nr_ue.cc @@ -17,7 +17,7 @@ namespace srsenb { namespace sched_nr_impl { -slot_ue::slot_ue(ue_carrier& ue_, slot_point slot_tx_, uint32_t dl_bytes, uint32_t ul_bytes) : +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; @@ -31,16 +31,16 @@ slot_ue::slot_ue(ue_carrier& ue_, slot_point slot_tx_, uint32_t dl_bytes, uint32 dl_active = srsran_duplex_nr_is_dl(&tdd_cfg, 0, pdsch_slot.slot_idx()); if (dl_active) { - dl_pending_bytes = dl_bytes; - h_dl = ue->harq_ent.find_pending_dl_retx(); + dl_bytes = dl_pending_bytes; + h_dl = ue->harq_ent.find_pending_dl_retx(); if (h_dl == nullptr) { h_dl = ue->harq_ent.find_empty_dl_harq(); } } ul_active = srsran_duplex_nr_is_ul(&tdd_cfg, 0, pusch_slot.slot_idx()); if (ul_active) { - ul_pending_bytes = ul_bytes; - h_ul = ue->harq_ent.find_pending_ul_retx(); + ul_bytes = ul_pending_bytes; + h_ul = ue->harq_ent.find_pending_ul_retx(); if (h_ul == nullptr) { h_ul = ue->harq_ent.find_empty_ul_harq(); }