Stop PDCP for data bearers before initiating HO

master
Ismael Gomez 3 years ago
parent fa351cd285
commit 1c77998df5

@ -31,6 +31,7 @@ public:
class pdcp_interface_rrc
{
public:
virtual void set_enabled(uint16_t rnti, uint32_t lcid, bool enable) = 0;
virtual void reset(uint16_t rnti) = 0;
virtual void add_user(uint16_t rnti) = 0;
virtual void rem_user(uint16_t rnti) = 0;

@ -24,6 +24,7 @@ public:
virtual void reestablish() = 0;
virtual void reestablish(uint32_t lcid) = 0;
virtual void reset() = 0;
virtual void set_enabled(uint32_t lcid, bool enabled) = 0;
virtual void write_sdu(uint32_t lcid, srsran::unique_byte_buffer_t sdu, int sn = -1) = 0;
virtual int add_bearer(uint32_t lcid, srsran::pdcp_config_t cnfg) = 0;
virtual void del_bearer(uint32_t lcid) = 0;

@ -36,6 +36,7 @@ public:
void reestablish() override;
void reestablish(uint32_t lcid) override;
void reset() override;
void set_enabled(uint32_t lcid, bool enabled) override;
void write_sdu(uint32_t lcid, unique_byte_buffer_t sdu, int sn = -1) override;
void write_sdu_mch(uint32_t lcid, unique_byte_buffer_t sdu);
int add_bearer(uint32_t lcid, pdcp_config_t cnfg) override;

@ -60,6 +60,7 @@ public:
virtual void reset() = 0;
virtual void reestablish() = 0;
void set_enabled(bool enabled) { active = enabled; }
bool is_active() { return active; }
bool is_srb() { return cfg.rb_type == PDCP_RB_IS_SRB; }
bool is_drb() { return cfg.rb_type == PDCP_RB_IS_DRB; }

@ -63,6 +63,15 @@ void pdcp::reset()
pdcp_array.clear();
}
void pdcp::set_enabled(uint32_t lcid, bool enabled)
{
if (valid_lcid(lcid)) {
pdcp_array.at(lcid)->set_enabled(enabled);
} else {
logger.warning("LCID %d doesn't exist while setting enabled", lcid);
}
}
/*******************************************************************************
RRC/GW interface
*******************************************************************************/

@ -134,6 +134,11 @@ void pdcp_entity_lte::reset()
// GW/RRC interface
void pdcp_entity_lte::write_sdu(unique_byte_buffer_t sdu, int upper_sn)
{
if (!active) {
logger.warning("Dropping %s SDU due to inactive bearer", rrc->get_rb_name(lcid));
return;
}
if (rlc->sdu_queue_is_full(lcid)) {
logger.info(sdu->msg, sdu->N_bytes, "Dropping %s SDU due to full queue", rrc->get_rb_name(lcid));
return;
@ -216,6 +221,11 @@ void pdcp_entity_lte::write_sdu(unique_byte_buffer_t sdu, int upper_sn)
// RLC interface
void pdcp_entity_lte::write_pdu(unique_byte_buffer_t pdu)
{
if (!active) {
logger.warning("Dropping %s PDU due to inactive bearer", rrc->get_rb_name(lcid));
return;
}
// Handle control PDUs
if (is_drb() && is_control_pdu(pdu)) {
logger.info("Handling PDCP control PDU");

@ -44,6 +44,7 @@ public:
void write_pdu_mch(uint32_t lcid, srsran::unique_byte_buffer_t sdu) {}
// pdcp_interface_rrc
void set_enabled(uint16_t rnti, uint32_t lcid, bool enabled) override;
void reset(uint16_t rnti) override;
void add_user(uint16_t rnti) override;
void rem_user(uint16_t rnti) override;

@ -700,7 +700,10 @@ void rrc::ue::rrc_mobility::s1_source_ho_st::handle_ho_cmd(wait_ho_cmd& s, const
/* Enter Handover Execution */
// TODO: Do anything with MeasCfg info within the Msg (e.g. update ue_var_meas)?
// Disable DRBs in the MAC, while Reconfiguration is taking place.
// Disable DRBs in the MAC and PDCP, while Reconfiguration is taking place.
for (const drb_to_add_mod_s& drb : rrc_ue->bearer_list.get_established_drbs()) {
rrc_ue->parent->pdcp->set_enabled(rrc_ue->rnti, drb_to_lcid((lte_drb)drb.drb_id), false);
}
rrc_ue->mac_ctrl.set_drb_activation(false);
rrc_ue->mac_ctrl.update_mac(mac_controller::proc_stage_t::other);

@ -86,6 +86,13 @@ void pdcp::del_bearer(uint16_t rnti, uint32_t lcid)
}
}
void pdcp::set_enabled(uint16_t rnti, uint32_t lcid, bool enabled)
{
if (users.count(rnti)) {
users[rnti].pdcp->set_enabled(lcid, enabled);
}
}
void pdcp::reset(uint16_t rnti)
{
if (users.count(rnti)) {

@ -39,6 +39,7 @@ public:
class pdcp_dummy : public pdcp_interface_rrc, public pdcp_interface_gtpu
{
public:
void set_enabled(uint16_t rnti, uint32_t lcid, bool enabled) override {}
void reset(uint16_t rnti) override {}
void add_user(uint16_t rnti) override {}
void rem_user(uint16_t rnti) override {}

@ -62,6 +62,7 @@ class dummy_rlc : public rlc_interface_rrc
class dummy_pdcp : public pdcp_interface_rrc
{
void set_enabled(uint32_t lcid, bool enabled) {};
void reestablish(){};
void reestablish(uint32_t lcid){};
void reset(){};

Loading…
Cancel
Save