Possible solution to RLC Reestablishment

master
Ismael Gomez 6 years ago committed by Xavier Arteaga
parent 14b526f2aa
commit c2e9817f41

@ -284,6 +284,7 @@ public:
virtual void add_bearer(uint32_t lcid, srslte::srslte_rlc_config_t cnfg) = 0; virtual void add_bearer(uint32_t lcid, srslte::srslte_rlc_config_t cnfg) = 0;
virtual void add_bearer_mrb(uint32_t lcid) = 0; virtual void add_bearer_mrb(uint32_t lcid) = 0;
virtual void del_bearer(uint32_t lcid) = 0; virtual void del_bearer(uint32_t lcid) = 0;
virtual void resume_bearer(uint32_t lcid) = 0;
virtual void change_lcid(uint32_t old_lcid, uint32_t new_lcid) = 0; virtual void change_lcid(uint32_t old_lcid, uint32_t new_lcid) = 0;
virtual bool has_bearer(uint32_t lcid) = 0; virtual bool has_bearer(uint32_t lcid) = 0;
virtual bool has_data(const uint32_t lcid) = 0; virtual bool has_data(const uint32_t lcid) = 0;

@ -567,7 +567,7 @@ void rlc::resume_bearer(uint32_t lcid)
{ {
pthread_rwlock_wrlock(&rwlock); pthread_rwlock_wrlock(&rwlock);
if (not valid_lcid(lcid)) { if (valid_lcid(lcid)) {
// Need to call init again because timers have been destroyed // Need to call init again because timers have been destroyed
rlc_array.at(lcid)->init(rlc_log, lcid, pdcp, rrc, mac_timers); rlc_array.at(lcid)->init(rlc_log, lcid, pdcp, rrc, mac_timers);

@ -473,6 +473,7 @@ private:
bool go_idle; bool go_idle;
asn1::rrc::reest_cause_e m_reest_cause; asn1::rrc::reest_cause_e m_reest_cause;
uint16_t m_reest_rnti; uint16_t m_reest_rnti;
bool reestablishment_successful;
uint32_t rlc_flush_counter; uint32_t rlc_flush_counter;
uint32_t rlc_flush_timeout; uint32_t rlc_flush_timeout;

@ -170,6 +170,9 @@ uint8_t* mux::pdu_get(uint8_t* payload, uint32_t pdu_sz, uint32_t pid)
} }
} }
} else { } else {
if (pending_crnti_ce) {
Warning("Pending C-RNTI CE was not inserted because message was for CCCH\n");
}
is_rar = true; is_rar = true;
} }
pending_crnti_ce = 0; pending_crnti_ce = 0;

@ -63,6 +63,7 @@ rrc::rrc() :
go_idle = false; go_idle = false;
m_reest_cause = asn1::rrc::reest_cause_e::nulltype; m_reest_cause = asn1::rrc::reest_cause_e::nulltype;
m_reest_rnti = 0; m_reest_rnti = 0;
reestablishment_successful = false;
current_mac_cfg = {}; current_mac_cfg = {};
previous_mac_cfg = {}; previous_mac_cfg = {};
@ -1307,6 +1308,7 @@ void rrc::send_con_restablish_request()
// Clean reestablishment type // Clean reestablishment type
asn1::rrc::reest_cause_e cause = m_reest_cause; asn1::rrc::reest_cause_e cause = m_reest_cause;
m_reest_cause = asn1::rrc::reest_cause_e::nulltype; m_reest_cause = asn1::rrc::reest_cause_e::nulltype;
reestablishment_successful = false;
if (cause == asn1::rrc::reest_cause_e::ho_fail) { if (cause == asn1::rrc::reest_cause_e::ho_fail) {
crnti = ho_src_rnti; crnti = ho_src_rnti;
@ -1583,6 +1585,20 @@ bool rrc::con_reconfig_ho(asn1::rrc::rrc_conn_recfg_s* reconfig)
bool rrc::con_reconfig(asn1::rrc::rrc_conn_recfg_s* reconfig) bool rrc::con_reconfig(asn1::rrc::rrc_conn_recfg_s* reconfig)
{ {
asn1::rrc::rrc_conn_recfg_r8_ies_s* reconfig_r8 = &reconfig->crit_exts.c1().rrc_conn_recfg_r8(); asn1::rrc::rrc_conn_recfg_r8_ies_s* reconfig_r8 = &reconfig->crit_exts.c1().rrc_conn_recfg_r8();
// If this is the first con_reconfig after a reestablishment
if (reestablishment_successful) {
// Reestablish PDCP and RLC for SRB2 and all DRB
// FIXME: Which is the maximum LCID?
for (int i = 2; i < SRSLTE_N_RADIO_BEARERS; i++) {
if (rlc->has_bearer(i)) {
pdcp->reestablish(i);
rlc->reestablish(i);
}
}
}
// Apply RR config as in 5.3.10
if (reconfig_r8->rr_cfg_ded_present) { if (reconfig_r8->rr_cfg_ded_present) {
if (!apply_rr_config_dedicated(&reconfig_r8->rr_cfg_ded)) { if (!apply_rr_config_dedicated(&reconfig_r8->rr_cfg_ded)) {
return false; return false;
@ -1620,6 +1636,17 @@ bool rrc::con_reconfig(asn1::rrc::rrc_conn_recfg_s* reconfig)
} }
} }
} }
// If first message after reestablishment, resume SRB2 and all DRB
if (reestablishment_successful) {
reestablishment_successful = false;
for (int i = 2; i < SRSLTE_N_RADIO_BEARERS; i++) {
if (rlc->has_bearer(i)) {
rlc->resume_bearer(i);
}
}
}
if (reconfig_r8->meas_cfg_present) { if (reconfig_r8->meas_cfg_present) {
if (!measurements.parse_meas_config(&reconfig_r8->meas_cfg)) { if (!measurements.parse_meas_config(&reconfig_r8->meas_cfg)) {
return false; return false;
@ -1762,9 +1789,8 @@ void rrc::init_con_restablish_request(asn1::rrc::reest_cause_e cause)
mac_timers->timer_get(t311)->reset(); mac_timers->timer_get(t311)->reset();
mac_timers->timer_get(t311)->run(); mac_timers->timer_get(t311)->run();
// suspend all RBs except SRB0; // TODO: suspend all RBs except SRB0;
// rlc->reestablish(); // is this that RLC tx queue stops accepting SDUs?
// pdcp->reset();
// reset MAC; // reset MAC;
mac->reset(); mac->reset();
@ -2589,7 +2615,7 @@ void rrc::log_phy_config_dedicated()
phys_cfg_ded_s* current_cfg = &current_phy_cfg.dedicated; phys_cfg_ded_s* current_cfg = &current_phy_cfg.dedicated;
if (current_cfg->pdsch_cfg_ded_present) { if (current_cfg->pdsch_cfg_ded_present) {
rrc_log->info("Set PDSCH-Config=%s (present)\n", current_cfg->pdsch_cfg_ded.p_a.to_string().c_str()); rrc_log->info("Set PDSCH-Config p_a=%s\n", current_cfg->pdsch_cfg_ded.p_a.to_string().c_str());
} }
if (current_cfg->cqi_report_cfg_present) { if (current_cfg->cqi_report_cfg_present) {
@ -2904,8 +2930,9 @@ void rrc::handle_con_reest(rrc_conn_reest_s* setup)
mac_timers->timer_get(t301)->stop(); mac_timers->timer_get(t301)->stop();
pdcp->reestablish(); // Reestablish PDCP and RLC for SRB1
rlc->reestablish(); pdcp->reestablish(1);
rlc->reestablish(1);
// Update RRC Integrity keys // Update RRC Integrity keys
int ncc = setup->crit_exts.c1().rrc_conn_reest_r8().next_hop_chaining_count; int ncc = setup->crit_exts.c1().rrc_conn_reest_r8().next_hop_chaining_count;
@ -2923,8 +2950,13 @@ void rrc::handle_con_reest(rrc_conn_reest_s* setup)
// Apply the Radio Resource configuration // Apply the Radio Resource configuration
apply_rr_config_dedicated(&setup->crit_exts.c1().rrc_conn_reest_r8().rr_cfg_ded); apply_rr_config_dedicated(&setup->crit_exts.c1().rrc_conn_reest_r8().rr_cfg_ded);
// Resume SRB1 (if already configured in rr_config, this function does nothing)
rlc->resume_bearer(0);
// Send ConnectionSetupComplete message // Send ConnectionSetupComplete message
send_con_restablish_complete(); send_con_restablish_complete();
reestablishment_successful = true;
} }
void rrc::add_srb(srb_to_add_mod_s* srb_cnfg) void rrc::add_srb(srb_to_add_mod_s* srb_cnfg)
@ -3077,6 +3109,7 @@ void rrc::set_phy_default_pucch_srs()
current_phy_cfg.dedicated.srs_ul_cfg_ded_present = false; current_phy_cfg.dedicated.srs_ul_cfg_ded_present = false;
current_phy_cfg.dedicated.sched_request_cfg_present = false; current_phy_cfg.dedicated.sched_request_cfg_present = false;
rrc_log->info("Setting default PHY config dedicated\n");
set_phy_config_dedicated_default(); set_phy_config_dedicated_default();
} }

Loading…
Cancel
Save