nr,gnb,rrc: correctly release NR RNTI user after Reestablishment

master
Francisco 3 years ago committed by Francisco Paisana
parent 59df04547e
commit 51806982f7

@ -126,11 +126,13 @@ private:
struct endc_disabled_st {}; // EN-DC disabled
// FSM guards
bool requires_rel_req(const sgnb_rel_req_ev& ev);
bool skip_rel_req(const sgnb_rel_req_ev& ev);
// FSM transition handlers
void handle_sgnb_add_req_ack(wait_sgnb_add_req_resp_st& s, const sgnb_add_req_ack_ev& ev);
void handle_sgnb_rel_req(endc_activated_st& s, const sgnb_rel_req_ev& ev);
void handle_rrc_reest(const rrc_reest_rx_ev& ev);
void handle_sgnb_rel_req(const sgnb_rel_req_ev& ev);
void handle_rrc_reest(endc_activated_st& s, const rrc_reest_rx_ev& ev);
void handle_endc_disabled(const disable_endc_ev& ev);
protected:
@ -163,9 +165,10 @@ protected:
row< wait_sgnb_add_req_resp_st, endc_deactivated_st, sgnb_add_req_reject_ev >,
row< prepare_recfg_st, wait_add_complete_st, rrc_recfg_sent_ev >,
row< wait_add_complete_st, endc_activated_st, sgnb_add_complete_ev >,
upd< endc_activated_st, rrc_reest_rx_ev, &fsm::handle_rrc_reest >,
// +---------------------------+--------------------------+------------------------+------------------------------+-------------------------+
row< endc_activated_st, wait_sgnb_rel_req_resp_st, sgnb_rel_req_ev, &fsm::handle_sgnb_rel_req >,
to_state< endc_deactivated_st, rrc_reest_rx_ev, &fsm::handle_rrc_reest >,
to_state< wait_sgnb_rel_req_resp_st, sgnb_rel_req_ev, &fsm::handle_sgnb_rel_req, &fsm::requires_rel_req >,
to_state< endc_deactivated_st, sgnb_rel_req_ev, &fsm::handle_sgnb_rel_req, &fsm::skip_rel_req >,
row< wait_sgnb_rel_req_resp_st, endc_deactivated_st, sgnb_rel_req_ack_ev >,
to_state< endc_disabled_st, disable_endc_ev, &fsm::handle_endc_disabled >
>;

@ -569,7 +569,7 @@ void rrc::set_erab_status(uint16_t rnti, const asn1::s1ap::bearers_subject_to_st
void rrc::sgnb_addition_ack(uint16_t eutra_rnti, sgnb_addition_ack_params_t params)
{
logger.info("Received SgNB addition acknowledgement for rnti=%d", eutra_rnti);
logger.info("Received SgNB addition acknowledgement for rnti=0x%x", eutra_rnti);
auto ue_it = users.find(eutra_rnti);
if (ue_it == users.end()) {
logger.warning("rnti=0x%x does not exist", eutra_rnti);

@ -312,7 +312,7 @@ void rrc::ue::rrc_endc::start_sgnb_addition()
rrc_nr_interface_rrc::sgnb_addition_req_params_t params = {};
params.eps_bearer_id =
rrc_enb->bearer_manager.get_lcid_bearer(rrc_ue->rnti, drb_to_lcid((lte_drb)eutra_drb_id)).eps_bearer_id;
logger.info("Triggering SgNB addition");
logger.info("Triggering SgNB addition for E-UTRA rnti=0x%x", rrc_ue->rnti);
rrc_enb->rrc_nr->sgnb_addition_request(rrc_ue->rnti, params);
sgnb_add_req_sent_ev sgnb_add_req{};
@ -358,9 +358,10 @@ void rrc::ue::rrc_endc::handle_sgnb_add_req_ack(wait_sgnb_add_req_resp_st& s, co
nr_rnti = ev.params.nr_rnti;
}
void rrc::ue::rrc_endc::handle_sgnb_rel_req(endc_activated_st& s, const sgnb_rel_req_ev& ev)
void rrc::ue::rrc_endc::handle_sgnb_rel_req(const sgnb_rel_req_ev& ev)
{
logger.info("Triggering SgNB release");
logger.info("Triggering SgNB release for E-UTRA rnti=0x%x", rrc_ue->rnti);
rrc_enb->bearer_manager.rem_user(nr_rnti);
rrc_enb->rrc_nr->sgnb_release_request(nr_rnti);
}
@ -369,14 +370,10 @@ bool rrc::ue::rrc_endc::is_endc_supported()
return not is_in_state<endc_disabled_st>();
}
void rrc::ue::rrc_endc::handle_rrc_reest(const rrc_reest_rx_ev& ev)
void rrc::ue::rrc_endc::handle_rrc_reest(endc_activated_st& s, const rrc_reest_rx_ev& ev)
{
auto& sgnb_config = get_state<prepare_recfg_st>()->sgnb_config;
// Transition GTPU tunnel rnti back from NR RNTI to LTE RNTI, given that the reconfiguration failed
rrc_enb->gtpu->mod_bearer_rnti(sgnb_config.nr_rnti, rrc_ue->rnti);
rrc_enb->bearer_manager.rem_user(sgnb_config.nr_rnti);
rrc_enb->gtpu->mod_bearer_rnti(nr_rnti, rrc_ue->rnti);
}
void rrc::ue::rrc_endc::handle_endc_disabled(const disable_endc_ev& ev)
@ -384,4 +381,14 @@ void rrc::ue::rrc_endc::handle_endc_disabled(const disable_endc_ev& ev)
logger.info("Disabling NR EN-DC support for rnti=0x%x", nr_rnti);
}
bool rrc::ue::rrc_endc::requires_rel_req(const sgnb_rel_req_ev& ev)
{
return not is_in_state<endc_disabled_st>() and not is_in_state<endc_deactivated_st>();
}
bool rrc::ue::rrc_endc::skip_rel_req(const sgnb_rel_req_ev& ev)
{
return not requires_rel_req(ev) and not is_in_state<disable_endc_ev>();
}
} // namespace srsenb

@ -538,8 +538,12 @@ int rrc_nr::sgnb_release_request(uint16_t nr_rnti)
{
task_sched.defer_task([this, nr_rnti]() {
// remove user
auto it = users.find(nr_rnti);
uint16_t eutra_rnti = it != users.end() ? it->second->get_eutra_rnti() : SRSRAN_INVALID_RNTI;
rem_user(nr_rnti);
rrc_eutra->sgnb_release_ack(nr_rnti);
if (eutra_rnti != SRSRAN_INVALID_RNTI) {
rrc_eutra->sgnb_release_ack(eutra_rnti);
}
});
return SRSRAN_SUCCESS;
}

Loading…
Cancel
Save