From 67a39fbb8167f232329251a76c6c502ff032507a Mon Sep 17 00:00:00 2001 From: Francisco Date: Fri, 22 Oct 2021 10:53:11 +0100 Subject: [PATCH] nr,sched: push BSRs into the scheduler when nr_phy_test is run with PUSCH enabled --- srsenb/hdr/stack/mac/nr/mac_nr.h | 3 +++ srsenb/src/stack/mac/nr/mac_nr.cc | 5 +++++ test/phy/dummy_gnb_stack.h | 9 +++++---- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/srsenb/hdr/stack/mac/nr/mac_nr.h b/srsenb/hdr/stack/mac/nr/mac_nr.h index 33f0d08de..1104477fe 100644 --- a/srsenb/hdr/stack/mac/nr/mac_nr.h +++ b/srsenb/hdr/stack/mac/nr/mac_nr.h @@ -69,6 +69,9 @@ public: int pusch_info(const srsran_slot_cfg_t& slot_cfg, pusch_info_t& pusch_info) override; void rach_detected(const rach_info_t& rach_info) override; + // Test interface + void ul_bsr(uint16_t rnti, uint32_t lcid, uint32_t bsr); + private: uint16_t add_ue_(uint32_t enb_cc_idx); uint16_t alloc_ue(uint32_t enb_cc_idx); diff --git a/srsenb/src/stack/mac/nr/mac_nr.cc b/srsenb/src/stack/mac/nr/mac_nr.cc index 18ddb266a..a2988f872 100644 --- a/srsenb/src/stack/mac/nr/mac_nr.cc +++ b/srsenb/src/stack/mac/nr/mac_nr.cc @@ -286,6 +286,11 @@ int mac_nr::rlc_buffer_state(uint16_t rnti, uint32_t lc_id, uint32_t tx_queue, u return SRSRAN_SUCCESS; } +void mac_nr::ul_bsr(uint16_t rnti, uint32_t lcid, uint32_t bsr) +{ + sched.ul_bsr(rnti, lcid, bsr); +} + int mac_nr::slot_indication(const srsran_slot_cfg_t& slot_cfg) { return 0; diff --git a/test/phy/dummy_gnb_stack.h b/test/phy/dummy_gnb_stack.h index 4c86daf24..42839fd5d 100644 --- a/test/phy/dummy_gnb_stack.h +++ b/test/phy/dummy_gnb_stack.h @@ -86,7 +86,7 @@ private: srsenb::rlc_dummy rlc_obj; std::unique_ptr mac; srslog::basic_logger& sched_logger; - bool autofill_pdsch_bsr = false; + bool autofill_sch_bsr = false; std::mutex metrics_mutex; metrics_t metrics = {}; @@ -359,7 +359,7 @@ public: sched_logger.set_level(srslog::str_to_basic_level(args.log_level)); srslog::fetch_basic_logger("MAC-NR").set_level(srslog::str_to_basic_level(args.log_level)); - autofill_pdsch_bsr = args.pdsch.slots != "" and args.pdsch.slots != "none"; + autofill_sch_bsr = args.pdsch.slots != "" and args.pdsch.slots != "none"; // create sched object mac.reset(new srsenb::mac_nr{&task_sched}); @@ -464,8 +464,9 @@ public: sched_logger.set_context(slot_cfg.idx); if (not use_dummy_mac) { - if (autofill_pdsch_bsr) { - mac->rlc_buffer_state(rnti, 0, 10000, 0); + if (autofill_sch_bsr) { + mac->rlc_buffer_state(rnti, 0, 100000, 0); + mac->ul_bsr(rnti, 0, 100000); } int ret = mac->get_dl_sched(slot_cfg, dl_sched);