placed GW packets in the same thread as UE stack thread

master
Francisco Paisana 5 years ago committed by Andre Puschmann
parent 647c624423
commit a2d7b2320a

@ -58,7 +58,7 @@ public:
ue_stack_lte(); ue_stack_lte();
~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_);
int init(const stack_args_t& args_, srslte::logger* logger_, phy_interface_stack_lte* phy_, gw_interface_stack* gw_); 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; void run_tti(uint32_t tti) final;
// Interface for GW // Interface for GW
void write_sdu(uint32_t lcid, srslte::unique_byte_buffer_t sdu, bool blocking) final void write_sdu(uint32_t lcid, srslte::unique_byte_buffer_t sdu, bool blocking) final;
{
pdcp.write_sdu(lcid, std::move(sdu), blocking);
}
bool is_lcid_enabled(uint32_t lcid) final { return pdcp.is_lcid_enabled(lcid); } bool is_lcid_enabled(uint32_t lcid) final { return pdcp.is_lcid_enabled(lcid); }
@ -161,7 +158,7 @@ private:
void operator()() { func(this); } void operator()() { func(this); }
}; };
srslte::multiqueue_handler<task_t> pending_tasks; srslte::multiqueue_handler<task_t> 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 } // namespace srsue

@ -42,6 +42,7 @@ ue_stack_lte::ue_stack_lte() :
{ {
ue_queue_id = pending_tasks.add_queue(); ue_queue_id = pending_tasks.add_queue();
sync_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() 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() void ue_stack_lte::in_sync()
{ {
pending_tasks.try_push(sync_queue_id, task_t{[this](task_t*) { rrc.in_sync(); }}); pending_tasks.try_push(sync_queue_id, task_t{[this](task_t*) { rrc.in_sync(); }});

Loading…
Cancel
Save