Commit ab4dbcc2 authored by aligungr's avatar aligungr

Performance improvements

parent f711d762
...@@ -15,14 +15,6 @@ RlsCtlLayer::RlsCtlLayer(TaskBase *base) ...@@ -15,14 +15,6 @@ RlsCtlLayer::RlsCtlLayer(TaskBase *base)
m_logger = base->logBase->makeUniqueLogger(base->config->getLoggerPrefix() + "rls-ctl"); m_logger = base->logBase->makeUniqueLogger(base->config->getLoggerPrefix() + "rls-ctl");
} }
void RlsCtlLayer::onStart()
{
}
void RlsCtlLayer::onQuit()
{
}
void RlsCtlLayer::handleRlsMessage(int cellId, rls::RlsMessage &msg) void RlsCtlLayer::handleRlsMessage(int cellId, rls::RlsMessage &msg)
{ {
if (msg.msgType == rls::EMessageType::PDU_TRANSMISSION_ACK) if (msg.msgType == rls::EMessageType::PDU_TRANSMISSION_ACK)
......
...@@ -36,8 +36,6 @@ class RlsCtlLayer ...@@ -36,8 +36,6 @@ class RlsCtlLayer
void declareRadioLinkFailure(rls::ERlfCause cause); void declareRadioLinkFailure(rls::ERlfCause cause);
public: public:
void onStart();
void onQuit();
void onAckControlTimerExpired(); void onAckControlTimerExpired();
void onAckSendTimerExpired(); void onAckSendTimerExpired();
void handleRlsMessage(int cellId, rls::RlsMessage &msg); void handleRlsMessage(int cellId, rls::RlsMessage &msg);
......
...@@ -27,15 +27,12 @@ UeRlsTask::UeRlsTask(TaskBase *base) : m_base{base} ...@@ -27,15 +27,12 @@ UeRlsTask::UeRlsTask(TaskBase *base) : m_base{base}
base->shCtx.sti = Random::Mixed(base->config->getNodeName()).nextL(); base->shCtx.sti = Random::Mixed(base->config->getNodeName()).nextL();
m_udpLayer = std::make_unique<RlsUdpLayer>(base); m_udpLayer = std::make_unique<RlsUdpLayer>(base, this);
m_ctlLayer = std::make_unique<RlsCtlLayer>(base); m_ctlLayer = std::make_unique<RlsCtlLayer>(base);
} }
void UeRlsTask::onStart() void UeRlsTask::onStart()
{ {
m_udpLayer->onStart();
m_ctlLayer->onStart();
setTimer(TIMER_ID_ACK_CONTROL, TIMER_PERIOD_ACK_CONTROL); setTimer(TIMER_ID_ACK_CONTROL, TIMER_PERIOD_ACK_CONTROL);
setTimer(TIMER_ID_ACK_SEND, TIMER_PERIOD_ACK_SEND); setTimer(TIMER_ID_ACK_SEND, TIMER_PERIOD_ACK_SEND);
} }
...@@ -113,8 +110,7 @@ void UeRlsTask::onLoop() ...@@ -113,8 +110,7 @@ void UeRlsTask::onLoop()
void UeRlsTask::onQuit() void UeRlsTask::onQuit()
{ {
m_udpLayer->onQuit();
m_ctlLayer->onQuit();
} }
RlsCtlLayer &UeRlsTask::ctl() RlsCtlLayer &UeRlsTask::ctl()
......
...@@ -16,7 +16,7 @@ static constexpr const int HEARTBEAT_THRESHOLD = 2000; // (LOOP_PERIOD + RECEIVE ...@@ -16,7 +16,7 @@ static constexpr const int HEARTBEAT_THRESHOLD = 2000; // (LOOP_PERIOD + RECEIVE
namespace nr::ue namespace nr::ue
{ {
RlsUdpLayer::RlsUdpLayer(TaskBase *base) RlsUdpLayer::RlsUdpLayer(TaskBase *base, NtsTask *rlsTask)
: m_base{base}, m_sendBuffer{new uint8_t[SEND_BUFFER]}, m_server{}, m_searchSpace{}, m_cells{}, m_cellIdToSti{}, : m_base{base}, m_sendBuffer{new uint8_t[SEND_BUFFER]}, m_server{}, m_searchSpace{}, m_cells{}, m_cellIdToSti{},
m_lastLoop{}, m_cellIdCounter{} m_lastLoop{}, m_cellIdCounter{}
{ {
...@@ -26,12 +26,14 @@ RlsUdpLayer::RlsUdpLayer(TaskBase *base) ...@@ -26,12 +26,14 @@ RlsUdpLayer::RlsUdpLayer(TaskBase *base)
m_searchSpace.emplace_back(ip, cons::RadioLinkPort); m_searchSpace.emplace_back(ip, cons::RadioLinkPort);
m_simPos = Vector3{}; m_simPos = Vector3{};
m_server = std::make_unique<udp::UdpServerTask>(rlsTask);
m_server->start();
} }
void RlsUdpLayer::onStart() RlsUdpLayer::~RlsUdpLayer()
{ {
m_server = std::make_unique<udp::UdpServerTask>(m_base->rlsTask); m_server->quit();
m_server->start();
} }
void RlsUdpLayer::checkHeartbeat() void RlsUdpLayer::checkHeartbeat()
...@@ -44,11 +46,6 @@ void RlsUdpLayer::checkHeartbeat() ...@@ -44,11 +46,6 @@ void RlsUdpLayer::checkHeartbeat()
} }
} }
void RlsUdpLayer::onQuit()
{
m_server->quit();
}
void RlsUdpLayer::sendRlsPdu(const InetAddress &address, const rls::RlsMessage &msg) void RlsUdpLayer::sendRlsPdu(const InetAddress &address, const rls::RlsMessage &msg)
{ {
int n = rls::EncodeRlsMessage(msg, m_sendBuffer.get()); int n = rls::EncodeRlsMessage(msg, m_sendBuffer.get());
......
...@@ -47,8 +47,8 @@ class RlsUdpLayer ...@@ -47,8 +47,8 @@ class RlsUdpLayer
friend class UeCmdHandler; friend class UeCmdHandler;
public: public:
explicit RlsUdpLayer(TaskBase *base); explicit RlsUdpLayer(TaskBase *base, NtsTask *rlsTask);
~RlsUdpLayer() = default; ~RlsUdpLayer();
private: private:
void sendRlsPdu(const InetAddress &address, const rls::RlsMessage &msg); void sendRlsPdu(const InetAddress &address, const rls::RlsMessage &msg);
...@@ -56,8 +56,6 @@ class RlsUdpLayer ...@@ -56,8 +56,6 @@ class RlsUdpLayer
void heartbeatCycle(uint64_t time, const Vector3 &simPos); void heartbeatCycle(uint64_t time, const Vector3 &simPos);
public: public:
void onStart();
void onQuit();
void checkHeartbeat(); void checkHeartbeat();
void send(int cellId, const rls::RlsMessage &msg); void send(int cellId, const rls::RlsMessage &msg);
void receiveRlsPdu(const InetAddress &address, std::unique_ptr<rls::RlsMessage> &&msg); void receiveRlsPdu(const InetAddress &address, std::unique_ptr<rls::RlsMessage> &&msg);
......
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