From 410cec7557c8262960f13f6841904a16a979839f Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Mon, 4 Oct 2021 19:38:41 +0200 Subject: [PATCH] NR: assume all zero LCG is SBSR with 0 is received --- srsenb/hdr/stack/mac/common/ue_buffer_manager.h | 2 +- srsenb/hdr/stack/mac/nr/sched_nr_interface.h | 1 + srsenb/src/stack/mac/nr/ue_nr.cc | 9 ++++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/srsenb/hdr/stack/mac/common/ue_buffer_manager.h b/srsenb/hdr/stack/mac/common/ue_buffer_manager.h index 8eaba18f7..3e9e828f0 100644 --- a/srsenb/hdr/stack/mac/common/ue_buffer_manager.h +++ b/srsenb/hdr/stack/mac/common/ue_buffer_manager.h @@ -29,7 +29,7 @@ class ue_buffer_manager { protected: const static uint32_t MAX_LC_ID = isNR ? srsran::MAX_NR_NOF_BEARERS : srsran::MAX_LTE_LCID; - const static uint32_t MAX_LCG_ID = isNR ? 7 : 3; + const static uint32_t MAX_LCG_ID = isNR ? 7 : 3; // Should import from sched_interface and sched_nr_interface const static uint32_t MAX_SRB_LC_ID = isNR ? srsran::MAX_NR_SRB_ID : srsran::MAX_LTE_SRB_ID; const static uint32_t MAX_NOF_LCIDS = MAX_LC_ID + 1; const static uint32_t MAX_NOF_LCGS = MAX_LCG_ID + 1; diff --git a/srsenb/hdr/stack/mac/nr/sched_nr_interface.h b/srsenb/hdr/stack/mac/nr/sched_nr_interface.h index 874ec03ee..c0813aa5d 100644 --- a/srsenb/hdr/stack/mac/nr/sched_nr_interface.h +++ b/srsenb/hdr/stack/mac/nr/sched_nr_interface.h @@ -31,6 +31,7 @@ const static size_t SCHED_NR_MAX_TB = 1; const static size_t SCHED_NR_MAX_HARQ = 16; const static size_t SCHED_NR_MAX_BWP_PER_CELL = 2; const static size_t SCHED_NR_MAX_LCID = 32; +const static size_t SCHED_NR_MAX_LC_GROUP = 7; class sched_nr_interface { diff --git a/srsenb/src/stack/mac/nr/ue_nr.cc b/srsenb/src/stack/mac/nr/ue_nr.cc index 9a3d45337..e9f3c701a 100644 --- a/srsenb/src/stack/mac/nr/ue_nr.cc +++ b/srsenb/src/stack/mac/nr/ue_nr.cc @@ -99,7 +99,14 @@ int ue_nr::process_pdu(srsran::unique_byte_buffer_t pdu) case srsran::mac_sch_subpdu_nr::nr_lcid_sch_t::SHORT_TRUNC_BSR: { srsran::mac_sch_subpdu_nr::lcg_bsr_t sbsr = subpdu.get_sbsr(); uint32_t buffer_size_bytes = buff_size_field_to_bytes(sbsr.buffer_size, srsran::SHORT_BSR); - sched->ul_bsr(rnti, sbsr.lcg_id, buffer_size_bytes); + // Assume all LCGs are 0 if reported SBSR is 0 + if (buffer_size_bytes == 0) { + for (uint32_t j = 0; j < SCHED_NR_MAX_LC_GROUP; j++) { + sched->ul_bsr(rnti, j, 0); + } + } else { + sched->ul_bsr(rnti, sbsr.lcg_id, buffer_size_bytes); + } } break; case srsran::mac_sch_subpdu_nr::nr_lcid_sch_t::LONG_BSR: logger.info("LONG_BSR CE not implemented.");