From 77f63f7bcda36bd01f42006aab3fc850fa46dabe Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Tue, 19 Nov 2019 17:13:57 +0000 Subject: [PATCH] removed gtpu mutex --- srsenb/hdr/stack/enb_stack_lte.h | 2 +- srsenb/hdr/stack/upper/gtpu.h | 2 -- srsenb/src/stack/enb_stack_lte.cc | 3 --- srsenb/src/stack/rrc/rrc.cc | 1 - srsenb/src/stack/upper/gtpu.cc | 13 ++----------- 5 files changed, 3 insertions(+), 18 deletions(-) diff --git a/srsenb/hdr/stack/enb_stack_lte.h b/srsenb/hdr/stack/enb_stack_lte.h index b2fa14cec..d2bf7f302 100644 --- a/srsenb/hdr/stack/enb_stack_lte.h +++ b/srsenb/hdr/stack/enb_stack_lte.h @@ -101,7 +101,7 @@ public: void add_gtpu_m1u_socket_handler(int fd) override; /* Stack-MAC interface */ - void process_pdus(); + void process_pdus() override; private: static const int STACK_MAIN_THREAD_PRIO = -1; // Use default high-priority below UHD diff --git a/srsenb/hdr/stack/upper/gtpu.h b/srsenb/hdr/stack/upper/gtpu.h index 7b22197f7..8f28b9c93 100644 --- a/srsenb/hdr/stack/upper/gtpu.h +++ b/srsenb/hdr/stack/upper/gtpu.h @@ -111,8 +111,6 @@ private: void echo_response(in_addr_t addr, in_port_t port, uint16_t seq); - pthread_mutex_t mutex; - /**************************************************************************** * TEID to RNIT/LCID helper functions ***************************************************************************/ diff --git a/srsenb/src/stack/enb_stack_lte.cc b/srsenb/src/stack/enb_stack_lte.cc index f8916831c..224daa238 100644 --- a/srsenb/src/stack/enb_stack_lte.cc +++ b/srsenb/src/stack/enb_stack_lte.cc @@ -177,13 +177,10 @@ void enb_stack_lte::stop_impl() s1ap.stop(); gtpu.stop(); mac.stop(); - usleep(50000); - rlc.stop(); pdcp.stop(); rrc.stop(); - usleep(10000); if (args.pcap.enable) { mac_pcap.close(); } diff --git a/srsenb/src/stack/rrc/rrc.cc b/srsenb/src/stack/rrc/rrc.cc index 69b95f08e..a335378d8 100644 --- a/srsenb/src/stack/rrc/rrc.cc +++ b/srsenb/src/stack/rrc/rrc.cc @@ -235,7 +235,6 @@ void rrc::add_user(uint16_t rnti) /* Function called by MAC after the reception of a C-RNTI CE indicating that the UE still has a * valid RNTI. - * Called by MAC reader thread (can wait to process) */ void rrc::upd_user(uint16_t new_rnti, uint16_t old_rnti) { diff --git a/srsenb/src/stack/upper/gtpu.cc b/srsenb/src/stack/upper/gtpu.cc index bb99f53ea..96c781ee5 100644 --- a/srsenb/src/stack/upper/gtpu.cc +++ b/srsenb/src/stack/upper/gtpu.cc @@ -30,10 +30,7 @@ using namespace srslte; namespace srsenb { -gtpu::gtpu() : m1u(this) -{ - pthread_mutex_init(&mutex, nullptr); -} +gtpu::gtpu() : m1u(this) {} bool gtpu::init(std::string gtp_bind_addr_, std::string mme_addr_, @@ -166,7 +163,6 @@ void gtpu::add_bearer(uint16_t rnti, uint32_t lcid, uint32_t addr, uint32_t teid void gtpu::rem_bearer(uint16_t rnti, uint32_t lcid) { - pthread_mutex_lock(&mutex); gtpu_log->info("Removing bearer for rnti: 0x%x, lcid: %d\n", rnti, lcid); rnti_bearers[rnti].teids_in[lcid] = 0; @@ -179,17 +175,14 @@ void gtpu::rem_bearer(uint16_t rnti, uint32_t lcid) rem = false; } } - if(rem) { + if (rem) { rnti_bearers.erase(rnti); } - pthread_mutex_unlock(&mutex); } void gtpu::rem_user(uint16_t rnti) { - pthread_mutex_lock(&mutex); rnti_bearers.erase(rnti); - pthread_mutex_unlock(&mutex); } void gtpu::handle_gtpu_s1u_rx_packet(srslte::unique_byte_buffer_t pdu, const sockaddr_in& addr) @@ -211,9 +204,7 @@ void gtpu::handle_gtpu_s1u_rx_packet(srslte::unique_byte_buffer_t pdu, const soc uint16_t lcid = 0; teidin_to_rntilcid(header.teid, &rnti, &lcid); - pthread_mutex_lock(&mutex); bool user_exists = (rnti_bearers.count(rnti) > 0); - pthread_mutex_unlock(&mutex); if (not user_exists) { gtpu_log->error("Unrecognized RNTI for DL PDU: 0x%x - dropping packet\n", rnti);