From a2d7b2320a7d643b12aa83ca032769904a41e772 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Fri, 13 Sep 2019 11:54:12 +0100 Subject: [PATCH] placed GW packets in the same thread as UE stack thread --- srsue/hdr/stack/ue_stack_lte.h | 9 +++------ srsue/src/stack/ue_stack_lte.cc | 13 +++++++++++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/srsue/hdr/stack/ue_stack_lte.h b/srsue/hdr/stack/ue_stack_lte.h index 4d90c5ac8..ea5f7b06c 100644 --- a/srsue/hdr/stack/ue_stack_lte.h +++ b/srsue/hdr/stack/ue_stack_lte.h @@ -58,7 +58,7 @@ public: ue_stack_lte(); ~ue_stack_lte(); - std::string get_type(); + std::string get_type() final; int init(const stack_args_t& args_, srslte::logger* logger_); int init(const stack_args_t& args_, srslte::logger* logger_, phy_interface_stack_lte* phy_, gw_interface_stack* gw_); @@ -107,10 +107,7 @@ public: void run_tti(uint32_t tti) final; // Interface for GW - void write_sdu(uint32_t lcid, srslte::unique_byte_buffer_t sdu, bool blocking) final - { - pdcp.write_sdu(lcid, std::move(sdu), blocking); - } + void write_sdu(uint32_t lcid, srslte::unique_byte_buffer_t sdu, bool blocking) final; bool is_lcid_enabled(uint32_t lcid) final { return pdcp.is_lcid_enabled(lcid); } @@ -161,7 +158,7 @@ private: void operator()() { func(this); } }; srslte::multiqueue_handler pending_tasks; - int sync_queue_id = -1, ue_queue_id = -1; + int sync_queue_id = -1, ue_queue_id = -1, gw_queue_id = -1; }; } // namespace srsue diff --git a/srsue/src/stack/ue_stack_lte.cc b/srsue/src/stack/ue_stack_lte.cc index 67de04067..8a6b411b3 100644 --- a/srsue/src/stack/ue_stack_lte.cc +++ b/srsue/src/stack/ue_stack_lte.cc @@ -42,6 +42,7 @@ ue_stack_lte::ue_stack_lte() : { ue_queue_id = pending_tasks.add_queue(); sync_queue_id = pending_tasks.add_queue(); + gw_queue_id = pending_tasks.add_queue(); } ue_stack_lte::~ue_stack_lte() @@ -211,6 +212,18 @@ void ue_stack_lte::run_thread() } } +/*********************************************************************************************************************** + * Stack Interfaces + **********************************************************************************************************************/ + +void ue_stack_lte::write_sdu(uint32_t lcid, srslte::unique_byte_buffer_t sdu, bool blocking) +{ + task_t task; + task.pdu = std::move(sdu); + task.func = [this, lcid, blocking](task_t* task_ctxt) { pdcp.write_sdu(lcid, std::move(task_ctxt->pdu), blocking); }; + pending_tasks.try_push(gw_queue_id, std::move(task)); +} + void ue_stack_lte::in_sync() { pending_tasks.try_push(sync_queue_id, task_t{[this](task_t*) { rrc.in_sync(); }});