fix deadlock in handover

master
Francisco Paisana 4 years ago
parent 8a651c972e
commit 5242f9422b

@ -307,6 +307,7 @@ private:
// state // state
uint32_t target_earfcn; uint32_t target_earfcn;
bool sec_cfg_failed = false;
enum state_t { launch_phy_cell_select, wait_phy_cell_select_complete, wait_ra_completion } state; enum state_t { launch_phy_cell_select, wait_phy_cell_select_complete, wait_ra_completion } state;
}; };

@ -887,7 +887,7 @@ bool rrc::con_reconfig(const rrc_conn_recfg_s& reconfig)
apply_scell_config(&reconfig_r8_); apply_scell_config(&reconfig_r8_);
// notify back RRC // notify back RRC
task_sched.defer_task([this, reconfig_r8_]() { task_sched.notify_background_task_result([this, reconfig_r8_]() {
const rrc_conn_recfg_r8_ies_s* reconfig_r8 = &reconfig_r8_; const rrc_conn_recfg_r8_ies_s* reconfig_r8 = &reconfig_r8_;
if (!measurements->parse_meas_config( if (!measurements->parse_meas_config(

@ -1348,6 +1348,7 @@ rrc::ho_proc::ho_proc(srsue::rrc* rrc_) : rrc_ptr(rrc_) {}
srslte::proc_outcome_t rrc::ho_proc::init(const asn1::rrc::rrc_conn_recfg_s& rrc_reconf) srslte::proc_outcome_t rrc::ho_proc::init(const asn1::rrc::rrc_conn_recfg_s& rrc_reconf)
{ {
Info("Starting...\n"); Info("Starting...\n");
sec_cfg_failed = false;
recfg_r8 = rrc_reconf.crit_exts.c1().rrc_conn_recfg_r8(); recfg_r8 = rrc_reconf.crit_exts.c1().rrc_conn_recfg_r8();
asn1::rrc::mob_ctrl_info_s* mob_ctrl_info = &recfg_r8.mob_ctrl_info; asn1::rrc::mob_ctrl_info_s* mob_ctrl_info = &recfg_r8.mob_ctrl_info;
@ -1416,8 +1417,10 @@ srslte::proc_outcome_t rrc::ho_proc::react(const bool& cs_ret)
rrc_ptr->set_serving_cell(target_cell->phy_cell, false); rrc_ptr->set_serving_cell(target_cell->phy_cell, false);
// Extract and apply scell config if any // Extract and apply scell config if any
rrc_ptr->task_sched.enqueue_background_task([this](uint32_t wid) {
rrc_ptr->apply_scell_config(&recfg_r8); rrc_ptr->apply_scell_config(&recfg_r8);
rrc_ptr->task_sched.notify_background_task_result([this]() {
if (recfg_r8.mob_ctrl_info.rach_cfg_ded_present) { if (recfg_r8.mob_ctrl_info.rach_cfg_ded_present) {
Info("Starting non-contention based RA with preamble_idx=%d, mask_idx=%d\n", Info("Starting non-contention based RA with preamble_idx=%d, mask_idx=%d\n",
recfg_r8.mob_ctrl_info.rach_cfg_ded.ra_preamb_idx, recfg_r8.mob_ctrl_info.rach_cfg_ded.ra_preamb_idx,
@ -1435,13 +1438,14 @@ srslte::proc_outcome_t rrc::ho_proc::react(const bool& cs_ret)
ncc = sec_intralte.next_hop_chaining_count; ncc = sec_intralte.next_hop_chaining_count;
if (sec_intralte.key_change_ind) { if (sec_intralte.key_change_ind) {
rrc_ptr->rrc_log->console("keyChangeIndicator in securityConfigHO not supported\n"); rrc_ptr->rrc_log->console("keyChangeIndicator in securityConfigHO not supported\n");
return proc_outcome_t::error; sec_cfg_failed = true;
return;
} }
if (sec_intralte.security_algorithm_cfg_present) { if (sec_intralte.security_algorithm_cfg_present) {
rrc_ptr->sec_cfg.cipher_algo = rrc_ptr->sec_cfg.cipher_algo =
(srslte::CIPHERING_ALGORITHM_ID_ENUM)sec_intralte.security_algorithm_cfg.ciphering_algorithm.to_number(); (srslte::CIPHERING_ALGORITHM_ID_ENUM)sec_intralte.security_algorithm_cfg.ciphering_algorithm.to_number();
rrc_ptr->sec_cfg.integ_algo = rrc_ptr->sec_cfg.integ_algo = (srslte::INTEGRITY_ALGORITHM_ID_ENUM)
(srslte::INTEGRITY_ALGORITHM_ID_ENUM)sec_intralte.security_algorithm_cfg.integrity_prot_algorithm.to_number(); sec_intralte.security_algorithm_cfg.integrity_prot_algorithm.to_number();
Info("Changed Ciphering to %s and Integrity to %s\n", Info("Changed Ciphering to %s and Integrity to %s\n",
srslte::ciphering_algorithm_id_text[rrc_ptr->sec_cfg.cipher_algo], srslte::ciphering_algorithm_id_text[rrc_ptr->sec_cfg.cipher_algo],
srslte::integrity_algorithm_id_text[rrc_ptr->sec_cfg.integ_algo]); srslte::integrity_algorithm_id_text[rrc_ptr->sec_cfg.integ_algo]);
@ -1455,7 +1459,8 @@ srslte::proc_outcome_t rrc::ho_proc::react(const bool& cs_ret)
// Have RRCReconfComplete message ready when Msg3 is sent // Have RRCReconfComplete message ready when Msg3 is sent
rrc_ptr->send_rrc_con_reconfig_complete(); rrc_ptr->send_rrc_con_reconfig_complete();
});
});
state = wait_ra_completion; state = wait_ra_completion;
return proc_outcome_t::yield; return proc_outcome_t::yield;
} }
@ -1511,7 +1516,7 @@ srslte::proc_outcome_t rrc::ho_proc::react(ra_completed_ev ev)
return proc_outcome_t::yield; return proc_outcome_t::yield;
} }
if (ev.success) { if (ev.success and not sec_cfg_failed) {
if (not rrc_ptr->measurements->parse_meas_config(&recfg_r8, true, ho_src_cell.get_earfcn())) { if (not rrc_ptr->measurements->parse_meas_config(&recfg_r8, true, ho_src_cell.get_earfcn())) {
Error("Parsing measurementConfig. TODO: Send ReconfigurationReject\n"); Error("Parsing measurementConfig. TODO: Send ReconfigurationReject\n");
} }

Loading…
Cancel
Save