GTPU bearer removal fixes

- call gtpu rem bearer when erab is removed
- fix gtpu bearer removal during handover
master
Francisco 4 years ago
parent b94b0e77b3
commit 4aa100f7ae

@ -311,6 +311,8 @@ int bearer_cfg_handler::release_erab(uint8_t erab_id)
srsran::rem_rrc_obj_id(current_drbs, drb_id); srsran::rem_rrc_obj_id(current_drbs, drb_id);
rem_gtpu_bearer(erab_id);
erabs.erase(it); erabs.erase(it);
erab_info_list.erase(erab_id); erab_info_list.erase(erab_id);
@ -319,8 +321,6 @@ int bearer_cfg_handler::release_erab(uint8_t erab_id)
void bearer_cfg_handler::release_erabs() void bearer_cfg_handler::release_erabs()
{ {
// TODO: notify GTPU layer for each ERAB
erabs.clear();
while (not erabs.empty()) { while (not erabs.empty()) {
release_erab(erabs.begin()->first); release_erab(erabs.begin()->first);
} }
@ -387,13 +387,7 @@ srsran::expected<uint32_t> bearer_cfg_handler::add_gtpu_bearer(uint32_t
void bearer_cfg_handler::rem_gtpu_bearer(uint32_t erab_id) void bearer_cfg_handler::rem_gtpu_bearer(uint32_t erab_id)
{ {
auto it = erabs.find(erab_id); gtpu->rem_bearer(rnti, erab_id - 2);
if (it != erabs.end()) {
// Map e.g. E-RAB 5 to LCID 3 (==DRB1)
gtpu->rem_bearer(rnti, erab_id - 2);
} else {
logger->error("Removing erab_id=%d to GTPU\n", erab_id);
}
} }
void bearer_cfg_handler::fill_pending_nas_info(asn1::rrc::rrc_conn_recfg_r8_ies_s* msg) void bearer_cfg_handler::fill_pending_nas_info(asn1::rrc::rrc_conn_recfg_r8_ies_s* msg)

@ -160,22 +160,20 @@ bool gtpu_tunnel_manager::remove_tunnel(uint32_t teidin)
bool gtpu_tunnel_manager::remove_bearer(uint16_t rnti, uint32_t lcid) bool gtpu_tunnel_manager::remove_bearer(uint16_t rnti, uint32_t lcid)
{ {
srsran::span<lcid_tunnel> to_rem = find_rnti_lcid_tunnels(rnti, lcid);
if (to_rem.empty()) {
return false;
}
logger.info("Removing rnti=0x%x,lcid=%d", rnti, lcid); logger.info("Removing rnti=0x%x,lcid=%d", rnti, lcid);
bool removed = false;
for (lcid_tunnel& lcid_tun : to_rem) { for (srsran::span<lcid_tunnel> to_rem = find_rnti_lcid_tunnels(rnti, lcid); not to_rem.empty();
bool ret = tunnels.erase(lcid_tun.teid); to_rem = find_rnti_lcid_tunnels(rnti, lcid)) {
uint32_t teid = to_rem.front().teid;
bool ret = remove_tunnel(teid);
srsran_expect(ret, srsran_expect(ret,
"Inconsistency detected between internal data structures for rnti=0x%x,lcid=%d," TEID_IN_FMT, "Inconsistency detected between internal data structures for rnti=0x%x,lcid=%d," TEID_IN_FMT,
rnti, rnti,
lcid, lcid,
lcid_tun.teid); teid);
removed |= ret;
} }
ue_teidin_db[rnti].erase(to_rem.begin(), to_rem.end()); return removed;
return true;
} }
bool gtpu_tunnel_manager::remove_rnti(uint16_t rnti) bool gtpu_tunnel_manager::remove_rnti(uint16_t rnti)

Loading…
Cancel
Save