nr,gnb,sched: ensure the users only get allocated if they have buffer state > 0

master
Francisco 3 years ago committed by Francisco Paisana
parent 6fb5257609
commit 885e1bcc60

@ -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;

@ -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];

@ -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;

@ -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,7 +31,7 @@ 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;
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();
@ -39,7 +39,7 @@ slot_ue::slot_ue(ue_carrier& ue_, slot_point slot_tx_, uint32_t dl_bytes, uint32
}
ul_active = srsran_duplex_nr_is_ul(&tdd_cfg, 0, pusch_slot.slot_idx());
if (ul_active) {
ul_pending_bytes = ul_bytes;
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();

Loading…
Cancel
Save