diff --git a/srsenb/hdr/stack/mac/nr/sched_nr_harq.h b/srsenb/hdr/stack/mac/nr/sched_nr_harq.h index 66f83f90b..d060baee2 100644 --- a/srsenb/hdr/stack/mac/nr/sched_nr_harq.h +++ b/srsenb/hdr/stack/mac/nr/sched_nr_harq.h @@ -44,7 +44,7 @@ public: slot_point harq_slot_tx() const { return slot_tx; } slot_point harq_slot_ack() const { return slot_ack; } - bool ack_info(uint32_t tb_idx, bool ack); + int ack_info(uint32_t tb_idx, bool ack); void new_slot(slot_point slot_rx); void reset(); @@ -124,8 +124,8 @@ public: explicit harq_entity(uint32_t nprb, uint32_t nof_harq_procs = SCHED_NR_MAX_HARQ); void new_slot(slot_point slot_rx_); - void dl_ack_info(uint32_t pid, uint32_t tb_idx, bool ack) { dl_harqs[pid].ack_info(tb_idx, ack); } - void ul_crc_info(uint32_t pid, bool ack) { ul_harqs[pid].ack_info(0, ack); } + int dl_ack_info(uint32_t pid, uint32_t tb_idx, bool ack) { return dl_harqs[pid].ack_info(tb_idx, ack); } + int ul_crc_info(uint32_t pid, bool ack) { return ul_harqs[pid].ack_info(0, ack); } uint32_t nof_dl_harqs() const { return dl_harqs.size(); } uint32_t nof_ul_harqs() const { return ul_harqs.size(); } diff --git a/srsenb/src/stack/mac/nr/sched_nr.cc b/srsenb/src/stack/mac/nr/sched_nr.cc index 967ef774e..441322cdc 100644 --- a/srsenb/src/stack/mac/nr/sched_nr.cc +++ b/srsenb/src/stack/mac/nr/sched_nr.cc @@ -155,13 +155,20 @@ int sched_nr::dl_rach_info(uint32_t cc, const dl_sched_rar_info_t& rar_info) void sched_nr::dl_ack_info(uint16_t rnti, uint32_t cc, uint32_t pid, uint32_t tb_idx, bool ack) { - sched_workers->enqueue_cc_feedback( - rnti, cc, [pid, tb_idx, ack](ue_carrier& ue_cc) { ue_cc.harq_ent.dl_ack_info(pid, tb_idx, ack); }); + sched_workers->enqueue_cc_feedback(rnti, cc, [this, pid, tb_idx, ack](ue_carrier& ue_cc) { + if (ue_cc.harq_ent.dl_ack_info(pid, tb_idx, ack) != SRSRAN_SUCCESS) { + logger->warning("SCHED: rnti=0x%x, received DL HARQ-ACK for empty pid=%d", ue_cc.rnti, pid); + } + }); } void sched_nr::ul_crc_info(uint16_t rnti, uint32_t cc, uint32_t pid, bool crc) { - sched_workers->enqueue_cc_feedback(rnti, cc, [pid, crc](ue_carrier& ue_cc) { ue_cc.harq_ent.ul_crc_info(pid, crc); }); + sched_workers->enqueue_cc_feedback(rnti, cc, [this, pid, crc](ue_carrier& ue_cc) { + if (ue_cc.harq_ent.ul_crc_info(pid, crc) != SRSRAN_SUCCESS) { + logger->warning("SCHED: rnti=0x%x, received CRC for empty pid=%d", ue_cc.rnti, pid); + } + }); } void sched_nr::ul_sr_info(uint16_t rnti) diff --git a/srsenb/src/stack/mac/nr/sched_nr_harq.cc b/srsenb/src/stack/mac/nr/sched_nr_harq.cc index 185a44c9c..11e6ae078 100644 --- a/srsenb/src/stack/mac/nr/sched_nr_harq.cc +++ b/srsenb/src/stack/mac/nr/sched_nr_harq.cc @@ -16,16 +16,16 @@ namespace srsenb { namespace sched_nr_impl { -bool harq_proc::ack_info(uint32_t tb_idx, bool ack) +int harq_proc::ack_info(uint32_t tb_idx, bool ack) { if (empty(tb_idx)) { - return false; + return SRSRAN_ERROR; } tb[tb_idx].ack_state = ack; if (ack) { tb[tb_idx].active = false; } - return true; + return SRSRAN_SUCCESS; } void harq_proc::new_slot(slot_point slot_rx)