Skip to content

Commit 69abfee

Browse files
committed
du: assign one extra PUCCH resource for SR signalling.
1 parent 3d027a5 commit 69abfee

File tree

4 files changed

+32
-27
lines changed

4 files changed

+32
-27
lines changed

lib/du_manager/ran_resource_management/du_pucch_resource_manager.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ du_pucch_resource_manager::du_pucch_resource_manager(span<const du_cell_config>
5050
continue;
5151
}
5252
}
53-
cell.sr_offset_free_list.push_back(offset);
53+
cell.sr_offset_free_list.emplace_back(default_pucch_cfg.sr_res_list[0].pucch_res_id - 1, offset);
54+
cell.sr_offset_free_list.emplace_back(default_pucch_cfg.sr_res_list[0].pucch_res_id, offset);
5455
}
5556

5657
for (unsigned offset = 0; offset != csi_period; ++offset) {
@@ -79,14 +80,13 @@ bool du_pucch_resource_manager::alloc_resources(cell_group_config& cell_grp_cfg)
7980
if (free_sr_list.empty()) {
8081
break;
8182
}
82-
sr_res_list[i].offset = free_sr_list.back();
83+
sr_res_list[i].pucch_res_id = free_sr_list.back().first;
84+
sr_res_list[i].offset = free_sr_list.back().second;
8385
free_sr_list.pop_back();
8486
}
8587
if (i != sr_res_list.size()) {
8688
// Allocation failed. Return resources back to the pool.
87-
for (unsigned j = 0; j != i; ++j) {
88-
free_sr_list.push_back(sr_res_list[i].offset);
89-
}
89+
dealloc_resources(cell_grp_cfg);
9090
return false;
9191
}
9292

@@ -98,6 +98,7 @@ bool du_pucch_resource_manager::alloc_resources(cell_group_config& cell_grp_cfg)
9898
auto& free_csi_list = cells[cell_grp_cfg.cells[0].serv_cell_cfg.cell_index].csi_offset_free_list;
9999
if (free_csi_list.empty()) {
100100
// Allocation failed.
101+
dealloc_resources(cell_grp_cfg);
101102
return false;
102103
}
103104
target_csi_cfg.report_slot_offset = free_csi_list.back();
@@ -110,7 +111,7 @@ bool du_pucch_resource_manager::alloc_resources(cell_group_config& cell_grp_cfg)
110111
void du_pucch_resource_manager::dealloc_resources(cell_group_config& cell_grp_cfg)
111112
{
112113
for (auto& sr : cell_grp_cfg.cells[0].serv_cell_cfg.ul_config->init_ul_bwp.pucch_cfg->sr_res_list) {
113-
cells[cell_grp_cfg.cells[0].serv_cell_cfg.cell_index].sr_offset_free_list.push_back(sr.offset);
114+
cells[cell_grp_cfg.cells[0].serv_cell_cfg.cell_index].sr_offset_free_list.emplace_back(sr.pucch_res_id, sr.offset);
114115
}
115116
if (cell_grp_cfg.cells[0].serv_cell_cfg.csi_meas_cfg.has_value()) {
116117
auto& target_csi_cfg = srsran::variant_get<csi_report_config::periodic_or_semi_persistent_report_on_pucch>(

lib/du_manager/ran_resource_management/du_pucch_resource_manager.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ class du_pucch_resource_manager
3939
const optional<csi_report_config> default_csi_report_cfg;
4040

4141
struct cell_resource_context {
42-
/// Pool of PUCCH SR offsets currently available to be allocated to UEs.
43-
std::vector<unsigned> sr_offset_free_list;
42+
/// \brief Pool of PUCCH SR offsets currently available to be allocated to UEs. Each element is represented by a
43+
/// pair (pucch_resource_id, slot_offset).
44+
std::vector<std::pair<unsigned, unsigned>> sr_offset_free_list;
4445
/// Pool of PUCCH CSI offsets currently available to be allocated to UEs.
4546
std::vector<unsigned> csi_offset_free_list;
4647
};

lib/scheduler/config/serving_cell_config_factory.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -446,13 +446,13 @@ uplink_config srsran::config_helpers::make_default_ue_uplink_config(const cell_c
446446

447447
// TODO: add more PUCCH resources.
448448

449-
// >>> SR Resource.
450-
const unsigned pucch_sr_res_id = pucch_cfg.pucch_res_list.size() - 1;
451-
pucch_cfg.sr_res_list.push_back(scheduling_request_resource_config{.sr_res_id = 1,
452-
.sr_id = uint_to_sched_req_id(0),
453-
.period = sr_periodicity::sl_40,
454-
.offset = 0,
455-
.pucch_res_id = pucch_sr_res_id});
449+
// >>> SR Resources.
450+
pucch_cfg.sr_res_list.push_back(
451+
scheduling_request_resource_config{.sr_res_id = 1,
452+
.sr_id = uint_to_sched_req_id(0),
453+
.period = sr_periodicity::sl_40,
454+
.offset = 0,
455+
.pucch_res_id = (unsigned)pucch_cfg.pucch_res_list.size() - 1U});
456456

457457
pucch_cfg.format_1_common_param.emplace();
458458
pucch_cfg.format_2_common_param.emplace(
@@ -579,9 +579,9 @@ csi_report_config srsran::config_helpers::make_default_csi_report_config(const c
579579

580580
csi_report_config::periodic_or_semi_persistent_report_on_pucch report_cfg_type{};
581581
report_cfg_type.report_type = csi_report_config::periodic_or_semi_persistent_report_on_pucch::report_type_t::periodic;
582-
csi_resource_periodicity csi_rs_period = get_max_csi_rs_period(params);
583-
// Set CSI report period equal to the CSI-RS period. No point in reporting more often than we get CSI-RS.
584-
report_cfg_type.report_slot_period = static_cast<csi_report_periodicity>(std::min((unsigned)csi_rs_period, 320U));
582+
// Note: the period for reporting is directly proportional to the number of CSI-RS resources available, and,
583+
// therefore, to the number of UEs supported by the gNB.
584+
report_cfg_type.report_slot_period = csi_report_periodicity::slots80;
585585
report_cfg_type.report_slot_offset = 9;
586586
report_cfg_type.pucch_csi_res_list.push_back(
587587
csi_report_config::pucch_csi_resource{.ul_bwp = to_bwp_id(0), .pucch_res_id = 9});

tests/unittests/du_manager/du_ran_resource_manager_test.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,20 +91,21 @@ TEST_P(du_ran_resource_manager_tester, when_multiple_ues_are_created_then_they_u
9191
{
9292
unsigned sr_period = get_config_sr_period();
9393
unsigned slots_per_frame = NOF_SUBFRAMES_PER_FRAME * get_nof_slots_per_subframe(cell_cfg_list[0].scs_common);
94-
unsigned nof_avail_sr_offsets = sr_period;
94+
unsigned nof_avail_sr_offsets = sr_period * 2;
9595
if (cell_cfg_list[0].tdd_ul_dl_cfg_common.has_value()) {
9696
nof_avail_sr_offsets = 0;
9797
for (unsigned i = 0; i != sr_period; ++i) {
9898
if (has_active_tdd_ul_symbols(*cell_cfg_list[0].tdd_ul_dl_cfg_common, i % slots_per_frame)) {
99-
nof_avail_sr_offsets++;
99+
nof_avail_sr_offsets += 2;
100100
}
101101
}
102102
}
103+
du_ue_index_t next_ue_index = to_du_ue_index(0);
103104

104-
// > Created UEs have unique SR offsets.
105-
std::set<unsigned> sr_offsets;
105+
// > Created UEs have unique (PUCCH resource, SR offset) pairs.
106+
std::set<std::pair<unsigned, unsigned>> sr_offsets;
106107
for (unsigned i = 0; i != nof_avail_sr_offsets; ++i) {
107-
ue_ran_resource_configurator& ue_res = create_ue(to_du_ue_index(i));
108+
ue_ran_resource_configurator& ue_res = create_ue(next_ue_index);
108109
ASSERT_FALSE(ue_res.empty());
109110
const auto& sr_res_list = ue_res->cells[0].serv_cell_cfg.ul_config->init_ul_bwp.pucch_cfg->sr_res_list;
110111
ASSERT_FALSE(sr_res_list.empty());
@@ -113,13 +114,14 @@ TEST_P(du_ran_resource_manager_tester, when_multiple_ues_are_created_then_they_u
113114
ASSERT_TRUE(
114115
has_active_tdd_ul_symbols(*cell_cfg_list[0].tdd_ul_dl_cfg_common, sr_res_list[0].offset % slots_per_frame));
115116
}
116-
ASSERT_EQ(sr_offsets.count(sr_res_list[0].offset), 0);
117-
sr_offsets.insert(sr_res_list[0].offset);
117+
ASSERT_EQ(sr_offsets.count(std::make_pair(sr_res_list[0].pucch_res_id, sr_res_list[0].offset)), 0);
118+
sr_offsets.insert(std::make_pair(sr_res_list[0].pucch_res_id, sr_res_list[0].offset));
119+
next_ue_index = to_du_ue_index((unsigned)next_ue_index + 1);
118120
}
119121

120122
{
121123
// > No more SR offsets available. UE Resource Allocation fails.
122-
ue_ran_resource_configurator& empty_ue_res = create_ue(to_du_ue_index(sr_period));
124+
ue_ran_resource_configurator& empty_ue_res = create_ue(next_ue_index);
123125
ASSERT_TRUE(empty_ue_res.empty());
124126
ues.erase(to_du_ue_index(sr_period));
125127
}
@@ -129,7 +131,8 @@ TEST_P(du_ran_resource_manager_tester, when_multiple_ues_are_created_then_they_u
129131
unsigned rem_sr_offset =
130132
ues[ue_idx_to_rem]->cells[0].serv_cell_cfg.ul_config->init_ul_bwp.pucch_cfg->sr_res_list[0].offset;
131133
ues.erase(ue_idx_to_rem);
132-
ue_ran_resource_configurator& ue_res = create_ue(to_du_ue_index(sr_period + 1));
134+
next_ue_index = to_du_ue_index((unsigned)next_ue_index + 1);
135+
ue_ran_resource_configurator& ue_res = create_ue(next_ue_index);
133136
ASSERT_FALSE(ue_res.empty());
134137
ASSERT_EQ(rem_sr_offset, ue_res->cells[0].serv_cell_cfg.ul_config->init_ul_bwp.pucch_cfg->sr_res_list[0].offset);
135138
}

0 commit comments

Comments
 (0)