Skip to content

Commit 341f2ad

Browse files
committed
sched: handle failure to allocate pucch format2
1 parent e90544d commit 341f2ad

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

lib/du_manager/ran_resource_management/du_ran_resource_manager_impl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ ue_ran_resource_configurator du_ran_resource_manager_impl::create_ue_resource_co
8484
// UE initialized PCell.
8585
if (not allocate_cell_resources(ue_index, pcell_index, SERVING_CELL_PCELL_IDX)) {
8686
logger.warning("RAN Resource Allocation failed for ue={}", ue_index);
87+
ue_res_pool.erase(ue_index);
8788
return ue_ran_resource_configurator{std::unique_ptr<du_ue_ran_resource_updater_impl>{nullptr}};
8889
}
8990

lib/scheduler/pucch_scheduling/pucch_allocator_impl.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -674,13 +674,14 @@ pucch_harq_ack_grant pucch_allocator_impl::convert_to_format2(cell_slot_resource
674674
// indicator as for existing F1.
675675
else if (csi_part1_nof_bits > 0 and curr_harq_bits > 0) {
676676
int f1_pucch_res_ind = resource_manager.fetch_f1_pucch_res_indic(pucch_slot_alloc.slot, rnti);
677-
srsran_sanity_check(f1_pucch_res_ind >= 0, "PUCCH Resource Indicator for allocated resource not found");
678-
format2_res.pucch_res = resource_manager.reserve_specific_format2_res(
679-
pucch_slot_alloc.slot,
680-
rnti,
681-
static_cast<unsigned>(f1_pucch_res_ind),
682-
ue_cell_cfg.cfg_dedicated().ul_config.value().init_ul_bwp.pucch_cfg.value());
683-
format2_res.pucch_res_indicator = static_cast<unsigned>(f1_pucch_res_ind);
677+
if (f1_pucch_res_ind >= 0) {
678+
format2_res.pucch_res = resource_manager.reserve_specific_format2_res(
679+
pucch_slot_alloc.slot,
680+
rnti,
681+
static_cast<unsigned>(f1_pucch_res_ind),
682+
ue_cell_cfg.cfg_dedicated().ul_config.value().init_ul_bwp.pucch_cfg.value());
683+
format2_res.pucch_res_indicator = static_cast<unsigned>(f1_pucch_res_ind);
684+
}
684685
}
685686
// Case C) In any other case, just get any available PUCCH resource 2.
686687
else {

lib/scheduler/pucch_scheduling/pucch_resource_manager.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,11 @@ const pucch_resource* pucch_resource_manager::reserve_specific_format2_res(slot_
153153
rnti_pucch_res_id_slot_record& res_counter = get_slot_resource_counter(slot_harq);
154154

155155
const unsigned PUCCH_RESOURCE_SET_FORMAT2_IDX = 1;
156-
srsran_sanity_check(res_indicator < pucch_cfg.pucch_res_set[PUCCH_RESOURCE_SET_FORMAT2_IDX].pucch_res_id_list.size(),
157-
"PUCCH resource indicator exceeds the PUCCH resource set list.");
156+
if (res_indicator >= std::min(res_counter.ues_using_format2_res.size(),
157+
pucch_cfg.pucch_res_set[PUCCH_RESOURCE_SET_FORMAT2_IDX].pucch_res_id_list.size())) {
158+
// PUCCH resource indicator exceeds the PUCCH resource set list.
159+
return nullptr;
160+
}
158161

159162
const auto& pucch_res_list = pucch_cfg.pucch_res_list;
160163

0 commit comments

Comments
 (0)