From d571d26b0a30d0ca9bc71a6ff9504e9d331b1233 Mon Sep 17 00:00:00 2001 From: Francisco Date: Tue, 30 Mar 2021 10:40:28 +0100 Subject: [PATCH] disable blocking queue in enb::mac when mac::stop() is called. Ignore PRACHs after stop() is called --- srsenb/src/stack/mac/mac.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/srsenb/src/stack/mac/mac.cc b/srsenb/src/stack/mac/mac.cc index 2accbce19..27fd0a8ae 100644 --- a/srsenb/src/stack/mac/mac.cc +++ b/srsenb/src/stack/mac/mac.cc @@ -89,6 +89,8 @@ void mac::stop() { srsran::rwlock_write_guard lock(rwlock); if (started) { + started = false; + ue_db.clear(); for (auto& cc : common_buffers) { for (int i = 0; i < NOF_BCCH_DLSCH_MSG; i++) { @@ -96,8 +98,8 @@ void mac::stop() } srsran_softbuffer_tx_free(&cc.pcch_softbuffer_tx); srsran_softbuffer_tx_free(&cc.rar_softbuffer_tx); - started = false; } + ue_pool.stop(); } } @@ -454,6 +456,10 @@ uint16_t mac::allocate_ue() // Add UE to map { srsran::rwlock_write_guard lock(rwlock); + if (not started) { + logger.info("RACH ignored as eNB is being shutdown"); + return SRSRAN_INVALID_RNTI; + } if (ue_db.size() >= args.max_nof_ues) { logger.warning("Maximum number of connected UEs %zd connected to the eNB. Ignoring PRACH", max_ues); return SRSRAN_INVALID_RNTI;