Commit c5e608ff authored by aligungr's avatar aligungr

Performance improvements

parent effde35f
......@@ -160,8 +160,6 @@ struct NmUeRlsToRls : NtsMessage
enum PR
{
RECEIVE_RLS_MESSAGE,
DOWNLINK_DATA,
DOWNLINK_RRC,
RADIO_LINK_FAILURE,
TRANSMISSION_FAILURE,
} present;
......
#include "ctl_layer.hpp"
#include <ue/l3/task.hpp>
#include <ue/rls/task.hpp>
static constexpr const size_t MAX_PDU_COUNT = 128;
static constexpr const int MAX_PDU_TTL = 3000;
......@@ -7,14 +10,13 @@ namespace nr::ue
{
RlsCtlLayer::RlsCtlLayer(TaskBase *base, RlsSharedContext *shCtx)
: m_shCtx{shCtx}, m_servingCell{}, m_mainTask{}, m_udpTask{}, m_pduMap{}, m_pendingAck{}
: m_base{base}, m_shCtx{shCtx}, m_servingCell{}, m_udpTask{}, m_pduMap{}, m_pendingAck{}
{
m_logger = base->logBase->makeUniqueLogger(base->config->getLoggerPrefix() + "rls-ctl");
}
void RlsCtlLayer::onStart(NtsTask* mainTask, RlsUdpTask* udpTask)
void RlsCtlLayer::onStart(RlsUdpTask* udpTask)
{
m_mainTask = mainTask;
m_udpTask = udpTask;
}
......@@ -45,18 +47,18 @@ void RlsCtlLayer::handleRlsMessage(int cellId, rls::RlsMessage &msg)
return;
}
auto w = std::make_unique<NmUeRlsToRls>(NmUeRlsToRls::DOWNLINK_DATA);
auto w = std::make_unique<NmUeRlsToNas>(NmUeRlsToNas::DATA_PDU_DELIVERY);
w->psi = static_cast<int>(m.payload);
w->data = std::move(m.pdu);
m_mainTask->push(std::move(w));
w->pdu = std::move(m.pdu);
m_base->l3Task->push(std::move(w));
}
else if (m.pduType == rls::EPduType::RRC)
{
auto w = std::make_unique<NmUeRlsToRls>(NmUeRlsToRls::DOWNLINK_RRC);
auto w = std::make_unique<NmUeRlsToRrc>(NmUeRlsToRrc::DOWNLINK_RRC_DELIVERY);
w->cellId = cellId;
w->rrcChannel = static_cast<rrc::RrcChannel>(m.payload);
w->data = std::move(m.pdu);
m_mainTask->push(std::move(w));
w->channel = static_cast<rrc::RrcChannel>(m.payload);
w->pdu = std::move(m.pdu);
m_base->l3Task->push(std::move(w));
}
else
{
......@@ -79,7 +81,7 @@ void RlsCtlLayer::handleUplinkRrcDelivery(int cellId, uint32_t pduId, rrc::RrcCh
auto w = std::make_unique<NmUeRlsToRls>(NmUeRlsToRls::RADIO_LINK_FAILURE);
w->rlfCause = rls::ERlfCause::PDU_ID_EXISTS;
m_mainTask->push(std::move(w));
m_base->rlsTask->push(std::move(w));
return;
}
......@@ -89,7 +91,7 @@ void RlsCtlLayer::handleUplinkRrcDelivery(int cellId, uint32_t pduId, rrc::RrcCh
auto w = std::make_unique<NmUeRlsToRls>(NmUeRlsToRls::RADIO_LINK_FAILURE);
w->rlfCause = rls::ERlfCause::PDU_ID_FULL;
m_mainTask->push(std::move(w));
m_base->rlsTask->push(std::move(w));
return;
}
......@@ -144,7 +146,7 @@ void RlsCtlLayer::onAckControlTimerExpired()
{
auto w = std::make_unique<NmUeRlsToRls>(NmUeRlsToRls::TRANSMISSION_FAILURE);
w->pduList = std::move(transmissionFailures);
m_mainTask->push(std::move(w));
m_base->rlsTask->push(std::move(w));
}
}
......
......@@ -16,10 +16,10 @@ namespace nr::ue
class RlsCtlLayer
{
private:
TaskBase *m_base;
std::unique_ptr<Logger> m_logger;
RlsSharedContext *m_shCtx;
int m_servingCell;
NtsTask *m_mainTask;
RlsUdpTask *m_udpTask;
std::unordered_map<uint32_t, rls::PduInfo> m_pduMap;
std::unordered_map<int, std::vector<uint32_t>> m_pendingAck;
......@@ -29,7 +29,7 @@ class RlsCtlLayer
~RlsCtlLayer() = default;
public:
void onStart(NtsTask* mainTask, RlsUdpTask* udpTask);
void onStart(RlsUdpTask *udpTask);
void onQuit();
void onAckControlTimerExpired();
void onAckSendTimerExpired();
......@@ -39,4 +39,4 @@ class RlsCtlLayer
void handleRlsMessage(int cellId, rls::RlsMessage &msg);
};
}
\ No newline at end of file
} // namespace nr::ue
\ No newline at end of file
......@@ -35,7 +35,7 @@ UeRlsTask::UeRlsTask(TaskBase *base) : m_base{base}
void UeRlsTask::onStart()
{
m_udpTask->start();
m_ctlLayer->onStart(this, m_udpTask);
m_ctlLayer->onStart(m_udpTask);
setTimer(TIMER_ID_ACK_CONTROL, TIMER_PERIOD_ACK_CONTROL);
setTimer(TIMER_ID_ACK_SEND, TIMER_PERIOD_ACK_SEND);
......@@ -73,21 +73,6 @@ void UeRlsTask::onLoop()
m_ctlLayer->handleRlsMessage(w.cellId, *w.msg);
break;
}
case NmUeRlsToRls::DOWNLINK_DATA: {
auto m = std::make_unique<NmUeRlsToNas>(NmUeRlsToNas::DATA_PDU_DELIVERY);
m->psi = w.psi;
m->pdu = std::move(w.data);
m_base->l3Task->push(std::move(m));
break;
}
case NmUeRlsToRls::DOWNLINK_RRC: {
auto m = std::make_unique<NmUeRlsToRrc>(NmUeRlsToRrc::DOWNLINK_RRC_DELIVERY);
m->cellId = w.cellId;
m->channel = w.rrcChannel;
m->pdu = std::move(w.data);
m_base->l3Task->push(std::move(m));
break;
}
case NmUeRlsToRls::RADIO_LINK_FAILURE: {
auto m = std::make_unique<NmUeRlsToRrc>(NmUeRlsToRrc::RADIO_LINK_FAILURE);
m->rlfCause = w.rlfCause;
......
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