From e146345df08d20e8dca768df3b677093e4553854 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Fri, 3 Sep 2021 15:23:54 +0200 Subject: [PATCH] sched,nr: add ue removal method to nr sched --- srsenb/hdr/stack/mac/nr/sched_nr.h | 1 + srsenb/hdr/stack/mac/nr/sched_nr_interface.h | 1 + srsenb/src/stack/mac/nr/sched_nr.cc | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/srsenb/hdr/stack/mac/nr/sched_nr.h b/srsenb/hdr/stack/mac/nr/sched_nr.h index 7a5b9e54d..8d59445a2 100644 --- a/srsenb/hdr/stack/mac/nr/sched_nr.h +++ b/srsenb/hdr/stack/mac/nr/sched_nr.h @@ -40,6 +40,7 @@ public: ~sched_nr() override; int cell_cfg(srsran::const_span cell_list) override; void ue_cfg(uint16_t rnti, const ue_cfg_t& cfg) override; + void ue_rem(uint16_t rnti) override; int dl_rach_info(uint32_t cc, const dl_sched_rar_info_t& rar_info); diff --git a/srsenb/hdr/stack/mac/nr/sched_nr_interface.h b/srsenb/hdr/stack/mac/nr/sched_nr_interface.h index a72a58a9a..182831a17 100644 --- a/srsenb/hdr/stack/mac/nr/sched_nr_interface.h +++ b/srsenb/hdr/stack/mac/nr/sched_nr_interface.h @@ -118,6 +118,7 @@ public: virtual ~sched_nr_interface() = default; virtual int cell_cfg(srsran::const_span ue_cfg) = 0; virtual void ue_cfg(uint16_t rnti, const ue_cfg_t& ue_cfg) = 0; + virtual void ue_rem(uint16_t rnti) = 0; virtual int get_dl_sched(slot_point slot_rx, uint32_t cc, dl_sched_res_t& result) = 0; virtual int get_ul_sched(slot_point slot_rx, uint32_t cc, ul_sched_t& result) = 0; diff --git a/srsenb/src/stack/mac/nr/sched_nr.cc b/srsenb/src/stack/mac/nr/sched_nr.cc index 7bfcdd521..477cc8724 100644 --- a/srsenb/src/stack/mac/nr/sched_nr.cc +++ b/srsenb/src/stack/mac/nr/sched_nr.cc @@ -95,6 +95,11 @@ void sched_nr::ue_cfg(uint16_t rnti, const ue_cfg_t& uecfg) sched_workers->enqueue_event(rnti, [this, rnti, uecfg]() { ue_cfg_impl(rnti, uecfg); }); } +void sched_nr::ue_rem(uint16_t rnti) +{ + sched_workers->enqueue_event(rnti, [this, rnti]() { ue_db.erase(rnti); }); +} + void sched_nr::ue_cfg_impl(uint16_t rnti, const ue_cfg_t& uecfg) { if (not ue_db.contains(rnti)) {