Commit b9fbbf41 authored by aligungr's avatar aligungr

Performance improvements

parent ffbec812
......@@ -38,6 +38,7 @@ ue::UeL23Task::UeL23Task(TaskBase *base) : m_base{base}
m_rlsCtl = std::make_unique<RlsCtlLayer>(base);
m_rrc = std::make_unique<UeRrcLayer>(base);
m_nas = std::make_unique<NasLayer>(base);
m_tun = std::make_unique<TunLayer>(base);
}
UeL23Task::~UeL23Task() = default;
......
......@@ -21,6 +21,7 @@
#include <ue/rls/ctl_layer.hpp>
#include <ue/rls/udp_layer.hpp>
#include <ue/rrc/layer.hpp>
#include <ue/tun/layer.hpp>
#include <ue/types.hpp>
#include <utils/common_types.hpp>
#include <utils/logger.hpp>
......@@ -38,6 +39,7 @@ class UeL23Task : public NtsTask
std::unique_ptr<RlsCtlLayer> m_rlsCtl;
std::unique_ptr<UeRrcLayer> m_rrc;
std::unique_ptr<NasLayer> m_nas;
std::unique_ptr<TunLayer> m_tun;
friend class UeCmdHandler;
......@@ -70,6 +72,11 @@ class UeL23Task : public NtsTask
{
return *m_nas;
}
inline TunLayer &tun()
{
return *m_tun;
}
};
} // namespace nr::ue
\ No newline at end of file
......@@ -11,6 +11,7 @@
#include <lib/nas/utils.hpp>
#include <optional>
#include <ue/app/task.hpp>
#include <ue/l23/task.hpp>
#include <ue/nas/mm/mm.hpp>
namespace nr::ue
......@@ -185,7 +186,8 @@ void NasSm::setupTunInterface(const PduSession &pduSession)
std::string ipAddress = utils::OctetStringToIp(pduSession.pduAddress->pduAddressInformation);
auto allocatedName = m_base->tunLayer->allocate(pduSession.psi, ipAddress, m_base->config->configureRouting, error);
auto allocatedName =
m_base->l23Task->tun().allocate(pduSession.psi, ipAddress, m_base->config->configureRouting, error);
m_logger->info("Connection setup for PDU session[%d] is successful, TUN interface[%s, %s] is up.", pduSession.psi,
allocatedName.c_str(), ipAddress.c_str());
......
......@@ -11,6 +11,7 @@
#include <lib/nas/proto_conf.hpp>
#include <lib/nas/utils.hpp>
#include <ue/app/task.hpp>
#include <ue/l23/task.hpp>
#include <ue/nas/mm/mm.hpp>
namespace nr::ue
......@@ -38,7 +39,7 @@ void NasSm::localReleaseSession(int psi)
freePduSessionId(psi);
if (isEstablished)
m_base->tunLayer->release(psi);
m_base->l23Task->tun().release(psi);
}
void NasSm::localReleaseAllSessions()
......
......@@ -79,7 +79,7 @@ void NasSm::handleDownlinkDataRequest(int psi, OctetString &&data)
state != EMmSubState::MM_SERVICE_REQUEST_INITIATED_PS)
return;
m_base->tunLayer->write(psi, data.data(), static_cast<size_t>(data.length()));
m_base->l23Task->tun().write(psi, data.data(), static_cast<size_t>(data.length()));
}
} // namespace nr::ue
......@@ -37,7 +37,7 @@ static void ReceiverThread(void *args)
while (true)
{
int psi;
size_t s = base->tunLayer->read(buffer, RECEIVER_BUFFER_SIZE, psi);
size_t s = base->l23Task->tun().read(buffer, RECEIVER_BUFFER_SIZE, psi);
if (s > 0)
{
......
......@@ -33,9 +33,7 @@ namespace nr::ue
class UeAppTask;
class UeL23Task;
class UeRlsTask;
class UserEquipment;
class TunLayer;
struct UeCellDesc
{
......@@ -201,7 +199,6 @@ struct TaskBase
UeAppTask *appTask{};
UeL23Task *l23Task{};
TunLayer* tunLayer{};
};
struct RrcTimers
......
......@@ -27,7 +27,6 @@ UserEquipment::UserEquipment(UeConfig *config, app::IUeController *ueController,
base->l23Task = new UeL23Task(base);
base->appTask = new UeAppTask(base);
base->tunLayer = new TunLayer(base);
taskBase = base;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment