simplify PDCP init and also bypass it for SRB0 on eNB

master
Andre Puschmann 6 years ago
parent 0ef96f789b
commit e0a28cf4c0

@ -193,6 +193,7 @@ public:
virtual void add_bearer(uint16_t rnti, uint32_t lcid) = 0; virtual void add_bearer(uint16_t rnti, uint32_t lcid) = 0;
virtual void add_bearer(uint16_t rnti, uint32_t lcid, srslte::srslte_rlc_config_t cnfg) = 0; virtual void add_bearer(uint16_t rnti, uint32_t lcid, srslte::srslte_rlc_config_t cnfg) = 0;
virtual void add_bearer_mrb(uint16_t rnti, uint32_t lcid) = 0; virtual void add_bearer_mrb(uint16_t rnti, uint32_t lcid) = 0;
virtual void write_sdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t sdu) = 0;
}; };
// PDCP interface for GTPU // PDCP interface for GTPU
@ -237,6 +238,7 @@ public:
virtual void read_pdu_bcch_dlsch(uint32_t sib_index, uint8_t *payload) = 0; virtual void read_pdu_bcch_dlsch(uint32_t sib_index, uint8_t *payload) = 0;
virtual void read_pdu_pcch(uint8_t *payload, uint32_t payload_size) = 0; virtual void read_pdu_pcch(uint8_t *payload, uint32_t payload_size) = 0;
virtual void max_retx_attempted(uint16_t rnti) = 0; virtual void max_retx_attempted(uint16_t rnti) = 0;
virtual void write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t sdu) = 0;
}; };
// RRC interface for MAC // RRC interface for MAC

@ -37,12 +37,8 @@ class pdcp
public: public:
pdcp(); pdcp();
virtual ~pdcp(); virtual ~pdcp();
void init(srsue::rlc_interface_pdcp *rlc_, void
srsue::rrc_interface_pdcp *rrc_, init(srsue::rlc_interface_pdcp* rlc_, srsue::rrc_interface_pdcp* rrc_, srsue::gw_interface_pdcp* gw_, log* pdcp_log_);
srsue::gw_interface_pdcp *gw_,
log *pdcp_log_,
uint32_t lcid_,
uint8_t direction_);
void stop(); void stop();
// GW interface // GW interface
@ -82,14 +78,14 @@ public:
void write_pdu_pcch(unique_byte_buffer_t sdu); void write_pdu_pcch(unique_byte_buffer_t sdu);
private: private:
srsue::rlc_interface_pdcp *rlc; srsue::rlc_interface_pdcp* rlc = nullptr;
srsue::rrc_interface_pdcp *rrc; srsue::rrc_interface_pdcp* rrc = nullptr;
srsue::gw_interface_pdcp *gw; srsue::gw_interface_pdcp* gw = nullptr;
typedef std::map<uint16_t, pdcp_entity_interface*> pdcp_map_t; typedef std::map<uint16_t, pdcp_entity_interface*> pdcp_map_t;
typedef std::pair<uint16_t, pdcp_entity_interface*> pdcp_map_pair_t; typedef std::pair<uint16_t, pdcp_entity_interface*> pdcp_map_pair_t;
log *pdcp_log; log* pdcp_log = nullptr;
pdcp_map_t pdcp_array, pdcp_array_mrb; pdcp_map_t pdcp_array, pdcp_array_mrb;
pthread_rwlock_t rwlock; pthread_rwlock_t rwlock;

@ -25,10 +25,6 @@ namespace srslte {
pdcp::pdcp() pdcp::pdcp()
{ {
rlc = NULL;
rrc = NULL;
gw = NULL;
pdcp_log = NULL;
pthread_rwlock_init(&rwlock, NULL); pthread_rwlock_init(&rwlock, NULL);
} }
@ -50,7 +46,10 @@ pdcp::~pdcp()
pthread_rwlock_destroy(&rwlock); pthread_rwlock_destroy(&rwlock);
} }
void pdcp::init(srsue::rlc_interface_pdcp *rlc_, srsue::rrc_interface_pdcp *rrc_, srsue::gw_interface_pdcp *gw_, log *pdcp_log_, uint32_t lcid_, uint8_t direction_) void pdcp::init(srsue::rlc_interface_pdcp* rlc_,
srsue::rrc_interface_pdcp* rrc_,
srsue::gw_interface_pdcp* gw_,
log* pdcp_log_)
{ {
rlc = rlc_; rlc = rlc_;
rrc = rrc_; rrc = rrc_;

@ -1978,11 +1978,10 @@ void rrc::ue::send_dl_ccch(dl_ccch_msg_s* dl_ccch_msg)
dl_ccch_msg->pack(bref); dl_ccch_msg->pack(bref);
pdu->N_bytes = 1u + (uint32_t)bref.distance_bytes(pdu->msg); pdu->N_bytes = 1u + (uint32_t)bref.distance_bytes(pdu->msg);
char buf[32]; char buf[32] = {};
sprintf(buf, "SRB0 - rnti=0x%x", rnti); sprintf(buf, "SRB0 - rnti=0x%x", rnti);
parent->log_rrc_message(buf, Tx, pdu.get(), *dl_ccch_msg); parent->log_rrc_message(buf, Tx, pdu.get(), *dl_ccch_msg);
parent->rlc->write_sdu(rnti, RB_ID_SRB0, std::move(pdu));
parent->pdcp->write_sdu(rnti, RB_ID_SRB0, std::move(pdu));
} else { } else {
parent->rrc_log->error("Allocating pdu\n"); parent->rrc_log->error("Allocating pdu\n");
} }
@ -1998,12 +1997,10 @@ void rrc::ue::send_dl_dcch(dl_dcch_msg_s* dl_dcch_msg, srslte::unique_byte_buffe
dl_dcch_msg->pack(bref); dl_dcch_msg->pack(bref);
pdu->N_bytes = 1u + (uint32_t)bref.distance_bytes(pdu->msg); pdu->N_bytes = 1u + (uint32_t)bref.distance_bytes(pdu->msg);
char buf[32]; char buf[32] = {};
sprintf(buf, "SRB1 - rnti=0x%x", rnti); sprintf(buf, "SRB1 - rnti=0x%x", rnti);
parent->log_rrc_message(buf, Tx, pdu.get(), *dl_dcch_msg); parent->log_rrc_message(buf, Tx, pdu.get(), *dl_dcch_msg);
parent->pdcp->write_sdu(rnti, RB_ID_SRB1, std::move(pdu)); parent->pdcp->write_sdu(rnti, RB_ID_SRB1, std::move(pdu));
} else { } else {
parent->rrc_log->error("Allocating pdu\n"); parent->rrc_log->error("Allocating pdu\n");
} }

@ -52,7 +52,7 @@ void pdcp::add_user(uint16_t rnti)
pthread_rwlock_rdlock(&rwlock); pthread_rwlock_rdlock(&rwlock);
if (users.count(rnti) == 0) { if (users.count(rnti) == 0) {
srslte::pdcp *obj = new srslte::pdcp; srslte::pdcp *obj = new srslte::pdcp;
obj->init(&users[rnti].rlc_itf, &users[rnti].rrc_itf, &users[rnti].gtpu_itf, log_h, RB_ID_SRB0, SECURITY_DIRECTION_DOWNLINK); obj->init(&users[rnti].rlc_itf, &users[rnti].rrc_itf, &users[rnti].gtpu_itf, log_h);
users[rnti].rlc_itf.rnti = rnti; users[rnti].rlc_itf.rnti = rnti;
users[rnti].gtpu_itf.rnti = rnti; users[rnti].gtpu_itf.rnti = rnti;
users[rnti].rrc_itf.rnti = rnti; users[rnti].rrc_itf.rnti = rnti;

@ -210,7 +210,11 @@ void rlc::user_interface::max_retx_attempted()
void rlc::user_interface::write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t sdu) void rlc::user_interface::write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t sdu)
{ {
pdcp->write_pdu(rnti, lcid, std::move(sdu)); if (lcid == RB_ID_SRB0) {
rrc->write_pdu(rnti, lcid, std::move(sdu));
} else {
pdcp->write_pdu(rnti, lcid, std::move(sdu));
}
} }
void rlc::user_interface::write_pdu_bcch_bch(srslte::unique_byte_buffer_t sdu) void rlc::user_interface::write_pdu_bcch_bch(srslte::unique_byte_buffer_t sdu)

@ -103,7 +103,7 @@ int ue_stack_lte::init(const stack_args_t& args_, srslte::logger* logger_)
mac.init(phy, &rlc, &rrc, &mac_log); mac.init(phy, &rlc, &rrc, &mac_log);
rlc.init(&pdcp, &rrc, &rlc_log, &mac, 0 /* RB_ID_SRB0 */); rlc.init(&pdcp, &rrc, &rlc_log, &mac, 0 /* RB_ID_SRB0 */);
pdcp.init(&rlc, &rrc, gw, &pdcp_log, 0 /* RB_ID_SRB0 */, SECURITY_DIRECTION_UPLINK); pdcp.init(&rlc, &rrc, gw, &pdcp_log);
nas.init(usim.get(), &rrc, gw, &nas_log, args.nas); nas.init(usim.get(), &rrc, gw, &nas_log, args.nas);
rrc.init(phy, &mac, &rlc, &pdcp, &nas, usim.get(), gw, &mac, &rrc_log, args.rrc); rrc.init(phy, &mac, &rlc, &pdcp, &nas, usim.get(), gw, &mac, &rrc_log, args.rrc);

Loading…
Cancel
Save