Allow NAS PDUs to be cleared only after the Reconfiguration Complete is received by the eNB

master
Francisco Paisana 2 years ago committed by Justin Tallon
parent 25d9ae460e
commit 3daaf9b356

@ -114,6 +114,7 @@ public:
const gtpu_interface_rrc::bearer_props* props = nullptr); const gtpu_interface_rrc::bearer_props* props = nullptr);
void rem_gtpu_bearer(uint32_t erab_id); void rem_gtpu_bearer(uint32_t erab_id);
void fill_pending_nas_info(asn1::rrc::rrc_conn_recfg_r8_ies_s* msg); void fill_pending_nas_info(asn1::rrc::rrc_conn_recfg_r8_ies_s* msg);
void clear_pending_nas_info();
const std::map<uint8_t, erab_t>& get_erabs() const { return erabs; } const std::map<uint8_t, erab_t>& get_erabs() const { return erabs; }
const asn1::rrc::drb_to_add_mod_list_l& get_established_drbs() const { return current_drbs; } const asn1::rrc::drb_to_add_mod_list_l& get_established_drbs() const { return current_drbs; }
@ -127,6 +128,9 @@ private:
const rrc_cfg_t* cfg = nullptr; const rrc_cfg_t* cfg = nullptr;
gtpu_interface_rrc* gtpu = nullptr; gtpu_interface_rrc* gtpu = nullptr;
// NAS PDUs being currently sent.
std::vector<uint32_t> erab_ids_with_pending_nas_pdus;
// last cfg // last cfg
asn1::rrc::drb_to_add_mod_list_l current_drbs; asn1::rrc::drb_to_add_mod_list_l current_drbs;
}; };

@ -417,6 +417,8 @@ void bearer_cfg_handler::fill_pending_nas_info(asn1::rrc::rrc_conn_recfg_r8_ies_
// DRBs have already been configured in GTPU during bearer setup // DRBs have already been configured in GTPU during bearer setup
// Add E-RAB info message for the E-RABs // Add E-RAB info message for the E-RABs
if (msg->rr_cfg_ded.drb_to_add_mod_list_present) { if (msg->rr_cfg_ded.drb_to_add_mod_list_present) {
erab_ids_with_pending_nas_pdus.clear();
for (const drb_to_add_mod_s& drb : msg->rr_cfg_ded.drb_to_add_mod_list) { for (const drb_to_add_mod_s& drb : msg->rr_cfg_ded.drb_to_add_mod_list) {
uint32_t lcid = drb_to_lcid((lte_drb)drb.drb_id); uint32_t lcid = drb_to_lcid((lte_drb)drb.drb_id);
auto erab_it = std::find_if( auto erab_it = std::find_if(
@ -429,7 +431,7 @@ void bearer_cfg_handler::fill_pending_nas_info(asn1::rrc::rrc_conn_recfg_r8_ies_
msg->ded_info_nas_list.push_back({}); msg->ded_info_nas_list.push_back({});
msg->ded_info_nas_list.back().resize(erab_info.size()); msg->ded_info_nas_list.back().resize(erab_info.size());
memcpy(msg->ded_info_nas_list.back().data(), &erab_info[0], erab_info.size()); memcpy(msg->ded_info_nas_list.back().data(), &erab_info[0], erab_info.size());
erab_info_list.erase(info_it); erab_ids_with_pending_nas_pdus.push_back(erab_id);
} else { } else {
logger->warning("Not adding NAS message to connection reconfiguration. E-RAB id %d", erab_id); logger->warning("Not adding NAS message to connection reconfiguration. E-RAB id %d", erab_id);
} }
@ -438,4 +440,18 @@ void bearer_cfg_handler::fill_pending_nas_info(asn1::rrc::rrc_conn_recfg_r8_ies_
} }
} }
void bearer_cfg_handler::clear_pending_nas_info()
{
for (uint32_t erab_id : erab_ids_with_pending_nas_pdus) {
auto info_it = erab_info_list.find(erab_id);
if (info_it == erab_info_list.end()) {
logger->warning("NAS PDU with ERAB id={} went missing", erab_id);
continue;
}
erab_info_list.erase(info_it);
}
erab_ids_with_pending_nas_pdus.clear();
}
} // namespace srsenb } // namespace srsenb

@ -961,6 +961,9 @@ void rrc::ue::handle_rrc_reconf_complete(rrc_conn_recfg_complete_s* msg, srsran:
// If performing handover, signal its completion // If performing handover, signal its completion
mobility_handler->trigger(*msg); mobility_handler->trigger(*msg);
// Clear pending NAS PDUs
bearer_list.clear_pending_nas_info();
// 2> if the UE has radio link failure or handover failure information available // 2> if the UE has radio link failure or handover failure information available
const auto& complete_r8 = msg->crit_exts.rrc_conn_recfg_complete_r8(); const auto& complete_r8 = msg->crit_exts.rrc_conn_recfg_complete_r8();
if (complete_r8.non_crit_ext.non_crit_ext.rlf_info_available_r10_present or rlf_info_pending) { if (complete_r8.non_crit_ext.non_crit_ext.rlf_info_available_r10_present or rlf_info_pending) {

Loading…
Cancel
Save