Skip to content

Commit 263cf8e

Browse files
FabianEckermannasaezper
authored andcommitted
cu_cp: fix handling of drb allocation failure
1 parent dc7bc86 commit 263cf8e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/cu_cp/up_resource_manager/up_resource_manager_helpers.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ static drb_id_t allocate_qos_flow(up_pdu_session_context_update& new_session
211211
// potential optimization to support more QoS flows is to map non-GPB flows onto existing DRBs.
212212
if (full_context.drb_map.size() >= cfg.max_nof_drbs_per_ue) {
213213
logger.warning("DRB creation failed. Cause: Maximum number of DRBs per UE already created ({}). To increase the "
214-
"number of allowed DRBs per UE change the \"--max_nof_drbs_per_ue\" in the CU-CP configuration\n",
214+
"number of allowed DRBs per UE change the \"--max_nof_drbs_per_ue\" in the CU-CP configuration",
215215
cfg.max_nof_drbs_per_ue);
216216
return drb_id_t::invalid;
217217
}
@@ -305,14 +305,20 @@ up_config_update srsran::srs_cu_cp::calculate_update(
305305
up_pdu_session_context_update new_ctxt(pdu_session.pdu_session_id);
306306
for (const auto& flow_item : pdu_session.qos_flow_setup_request_items) {
307307
auto drb_id = allocate_qos_flow(new_ctxt, flow_item, config, context, cfg, logger);
308+
if (drb_id == drb_id_t::invalid) {
309+
logger.warning("Couldn't allocate {}", flow_item.qos_flow_id);
310+
continue;
311+
}
308312
// S-NSSAI
309313
new_ctxt.drb_to_add.at(drb_id).s_nssai = pdu_session.s_nssai;
310314
logger.debug("Allocated {} to {} with {}",
311315
flow_item.qos_flow_id,
312316
drb_id,
313317
new_ctxt.drb_to_add.at(drb_id).qos_params.qos_desc.get_5qi());
314318
}
315-
config.pdu_sessions_to_setup_list.emplace(new_ctxt.id, new_ctxt);
319+
if (!new_ctxt.drb_to_add.empty()) {
320+
config.pdu_sessions_to_setup_list.emplace(new_ctxt.id, new_ctxt);
321+
}
316322
}
317323

318324
return config;

0 commit comments

Comments
 (0)