allocation of UE rlc and pdcp classes in the ue dedicated memory pool

master
Francisco 4 years ago committed by Francisco Paisana
parent 60d5c6df7b
commit 344bdf3165

@ -10,6 +10,7 @@
*
*/
#include "srsenb/hdr/common/rnti_pool.h"
#include "srsran/common/timers.h"
#include "srsran/interfaces/enb_metrics_interface.h"
#include "srsran/interfaces/enb_pdcp_interfaces.h"
@ -104,10 +105,10 @@ private:
class user_interface
{
public:
user_interface_rlc rlc_itf;
user_interface_gtpu gtpu_itf;
user_interface_rrc rrc_itf;
srsran::pdcp* pdcp;
user_interface_rlc rlc_itf;
user_interface_gtpu gtpu_itf;
user_interface_rrc rrc_itf;
unique_rnti_ptr<srsran::pdcp> pdcp;
};
void clear_user(user_interface* ue);

@ -10,6 +10,7 @@
*
*/
#include "srsenb/hdr/common/rnti_pool.h"
#include "srsran/interfaces/enb_metrics_interface.h"
#include "srsran/interfaces/enb_rlc_interfaces.h"
#include "srsran/interfaces/ue_interfaces.h"
@ -38,7 +39,7 @@ class rlc : public rlc_interface_mac, public rlc_interface_rrc, public rlc_inter
public:
explicit rlc(srslog::basic_logger& logger) : logger(logger) {}
void
init(pdcp_interface_rlc* pdcp_, rrc_interface_rlc* rrc_, mac_interface_rlc* mac_, srsran::timer_handler* timers_);
init(pdcp_interface_rlc* pdcp_, rrc_interface_rlc* rrc_, mac_interface_rlc* mac_, srsran::timer_handler* timers_);
void stop();
void get_metrics(rlc_metrics_t& m, const uint32_t nof_tti);
@ -83,7 +84,7 @@ private:
srsenb::pdcp_interface_rlc* pdcp;
srsenb::rrc_interface_rlc* rrc;
std::unique_ptr<srsran::rlc> rlc;
unique_rnti_ptr<srsran::rlc> rlc;
srsenb::rlc* parent;
};

@ -40,7 +40,7 @@ void pdcp::stop()
void pdcp::add_user(uint16_t rnti)
{
if (users.count(rnti) == 0) {
srsran::pdcp* obj = new srsran::pdcp(task_sched, logger.id().c_str());
unique_rnti_ptr<srsran::pdcp> obj = make_rnti_obj<srsran::pdcp>(rnti, task_sched, logger.id().c_str());
obj->init(&users[rnti].rlc_itf, &users[rnti].rrc_itf, &users[rnti].gtpu_itf);
users[rnti].rlc_itf.rnti = rnti;
users[rnti].gtpu_itf.rnti = rnti;
@ -49,7 +49,7 @@ void pdcp::add_user(uint16_t rnti)
users[rnti].rrc_itf.rrc = rrc;
users[rnti].rlc_itf.rlc = rlc;
users[rnti].gtpu_itf.gtpu = gtpu;
users[rnti].pdcp = obj;
users[rnti].pdcp = std::move(obj);
}
}
@ -57,8 +57,7 @@ void pdcp::add_user(uint16_t rnti)
void pdcp::clear_user(user_interface* ue)
{
ue->pdcp->stop();
delete ue->pdcp;
ue->pdcp = NULL;
ue->pdcp.reset();
}
void pdcp::rem_user(uint16_t rnti)

@ -56,7 +56,7 @@ void rlc::add_user(uint16_t rnti)
{
pthread_rwlock_rdlock(&rwlock);
if (users.count(rnti) == 0) {
std::unique_ptr<srsran::rlc> obj(new srsran::rlc(logger.id().c_str()));
auto obj = make_rnti_obj<srsran::rlc>(rnti, logger.id().c_str());
obj->init(&users[rnti],
&users[rnti],
timers,

Loading…
Cancel
Save