Skip to content

Commit 7770d80

Browse files
carlo-galcodebot
authored andcommitted
sched: change filename and replace list with vector
Signed-off-by: Carlo Galiotto <[email protected]>
1 parent 4e061b1 commit 7770d80

File tree

11 files changed

+228
-222
lines changed

11 files changed

+228
-222
lines changed

lib/scheduler/ue_scheduling/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ set(SOURCES
1717
ue_cell.cpp
1818
ue_cell_grid_allocator.cpp
1919
ue_event_manager.cpp
20-
ue_srb0_scheduler.cpp
20+
ue_fallback_scheduler.cpp
2121
ue_scheduler_impl.cpp
2222
ue_repository.cpp)
2323

lib/scheduler/ue_scheduling/ue_event_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ void ue_event_manager::run(slot_point sl, du_cell_index_t cell_index)
632632
}
633633

634634
void ue_event_manager::add_cell(cell_resource_allocator& cell_res_grid,
635-
ue_srb0_scheduler& srb0_sched,
635+
ue_fallback_scheduler& srb0_sched,
636636
uci_scheduler_impl& uci_sched)
637637
{
638638
const du_cell_index_t cell_index = cell_res_grid.cell_index();

lib/scheduler/ue_scheduling/ue_event_manager.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "../policy/scheduler_policy.h"
1515
#include "../support/slot_event_list.h"
1616
#include "ue.h"
17-
#include "ue_srb0_scheduler.h"
17+
#include "ue_fallback_scheduler.h"
1818
#include "srsran/adt/unique_function.h"
1919
#include "srsran/ran/du_types.h"
2020
#include "srsran/ran/uci/uci_constants.h"
@@ -36,7 +36,8 @@ class ue_event_manager final : public sched_ue_configuration_handler,
3636
ue_event_manager(ue_repository& ue_db, scheduler_metrics_handler& metrics_handler, scheduler_event_logger& ev_logger);
3737
~ue_event_manager();
3838

39-
void add_cell(cell_resource_allocator& cell_res_grid, ue_srb0_scheduler& srb0_sched, uci_scheduler_impl& uci_sched);
39+
void
40+
add_cell(cell_resource_allocator& cell_res_grid, ue_fallback_scheduler& srb0_sched, uci_scheduler_impl& uci_sched);
4041

4142
/// UE Add/Mod/Remove interface.
4243
void handle_ue_creation(ue_config_update_event ev) override;
@@ -113,7 +114,7 @@ class ue_event_manager final : public sched_ue_configuration_handler,
113114
cell_resource_allocator* res_grid = nullptr;
114115

115116
// Reference to SRB0 and other bearers scheduler
116-
ue_srb0_scheduler* srb0_sched = nullptr;
117+
ue_fallback_scheduler* srb0_sched = nullptr;
117118

118119
// Reference to the CSI and SR UCI scheduler.
119120
uci_scheduler_impl* uci_sched = nullptr;

lib/scheduler/ue_scheduling/ue_srb0_scheduler.cpp renamed to lib/scheduler/ue_scheduling/ue_fallback_scheduler.cpp

Lines changed: 136 additions & 132 deletions
Large diffs are not rendered by default.

lib/scheduler/ue_scheduling/ue_srb0_scheduler.h renamed to lib/scheduler/ue_scheduling/ue_fallback_scheduler.h

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
namespace srsran {
2222

2323
/// Defines SRB0 scheduler that is used to allocate grants for UE's SRB0 DL messages in a given slot.
24-
class ue_srb0_scheduler
24+
class ue_fallback_scheduler
2525
{
2626
public:
27-
explicit ue_srb0_scheduler(const scheduler_ue_expert_config& expert_cfg_,
28-
const cell_configuration& cell_cfg_,
29-
pdcch_resource_allocator& pdcch_sch_,
30-
pucch_allocator& pucch_alloc_,
31-
ue_repository& ues_);
27+
explicit ue_fallback_scheduler(const scheduler_ue_expert_config& expert_cfg_,
28+
const cell_configuration& cell_cfg_,
29+
pdcch_resource_allocator& pdcch_sch_,
30+
pucch_allocator& pucch_alloc_,
31+
ue_repository& ues_);
3232

3333
/// Handles DL buffer state reported by upper layers.
3434
/// \param[in] ue_index UE's DU Index for which SRB0 message needs to be scheduled.
@@ -85,20 +85,21 @@ class ue_srb0_scheduler
8585
unsigned tbs_bytes,
8686
bool is_retx);
8787

88-
void fill_srb1_grant(ue& u,
89-
slot_point pdsch_slot,
90-
dl_harq_process& h_dl,
91-
pdcch_dl_information& pdcch,
92-
dci_dl_rnti_config_type dci_type,
93-
dl_msg_alloc& msg,
94-
unsigned pucch_res_indicator,
95-
unsigned pdsch_time_res,
96-
unsigned k1,
97-
sch_mcs_index mcs_idx,
98-
const crb_interval& ue_grant_crbs,
99-
const pdsch_config_params& pdsch_params,
100-
unsigned tbs_bytes,
101-
bool is_retx);
88+
void fill_srb_grant(ue& u,
89+
slot_point pdsch_slot,
90+
dl_harq_process& h_dl,
91+
pdcch_dl_information& pdcch,
92+
dci_dl_rnti_config_type dci_type,
93+
dl_msg_alloc& msg,
94+
unsigned pucch_res_indicator,
95+
unsigned pdsch_time_res,
96+
unsigned k1,
97+
sch_mcs_index mcs_idx,
98+
const crb_interval& ue_grant_crbs,
99+
const pdsch_config_params& pdsch_params,
100+
unsigned tbs_bytes,
101+
bool is_retx,
102+
bool is_srb0);
102103

103104
const pdsch_time_domain_resource_allocation& get_pdsch_td_cfg(unsigned pdsch_time_res_idx) const;
104105

@@ -115,27 +116,19 @@ class ue_srb0_scheduler
115116
{
116117
public:
117118
explicit ack_and_retx_tracker(du_ue_index_t ue_idx, dl_harq_process* h_dl_, bool is_srb0_, ue_repository& ues_) :
118-
ue_index(ue_idx), is_srb0(is_srb0_), h_dl(h_dl_), ues(ues_)
119+
ue_index(ue_idx), is_srb0(is_srb0_), h_dl(h_dl_)
119120
{
120-
srsran_assert(ues.contains(ue_index), "UE not found in the UE repository");
121-
srsran_assert(h_dl_ == &(ues[ue_idx].get_pcell().harqs.dl_harq(h_dl_->id)),
122-
"HARQ process not found among the UE HARQs");
123121
}
122+
explicit ack_and_retx_tracker(const ack_and_retx_tracker& other) = default;
124123

125124
bool match_ue_harq(du_ue_index_t ue_idx_, dl_harq_process* h_dl_) const
126125
{
127126
return ue_index == ue_idx_ and h_dl == h_dl_;
128127
}
129128

130-
// We make the access to the HARQ process is subject to the UE existence in the UE repository.
131-
dl_harq_process* get_harq_process() const { return ues.contains(ue_index) ? h_dl : nullptr; }
132-
133-
du_ue_index_t ue_index;
134-
bool is_srb0;
135-
136-
private:
129+
du_ue_index_t ue_index;
130+
bool is_srb0;
137131
dl_harq_process* h_dl;
138-
ue_repository& ues;
139132
};
140133

141134
void store_harq_tx(du_ue_index_t ue_index, dl_harq_process* h_dl, bool is_srb0);
@@ -167,7 +160,7 @@ class ue_srb0_scheduler
167160
coreset_configuration cs_cfg;
168161

169162
/// Cache the UEs that are waiting for SRB HARQ processes to be ACKed or retransmitted.
170-
std::list<ack_and_retx_tracker> ongoing_ues_ack_retxs;
163+
std::vector<ack_and_retx_tracker> ongoing_ues_ack_retxs;
171164

172165
std::vector<uint8_t> dci_1_0_k1_values;
173166

lib/scheduler/ue_scheduling/ue_scheduler_impl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
#include "../uci_scheduling/uci_scheduler_impl.h"
1919
#include "ue_cell_grid_allocator.h"
2020
#include "ue_event_manager.h"
21+
#include "ue_fallback_scheduler.h"
2122
#include "ue_repository.h"
2223
#include "ue_scheduler.h"
23-
#include "ue_srb0_scheduler.h"
2424
#include "srsran/adt/slotted_array.h"
2525
#include "srsran/adt/unique_function.h"
2626
#include "srsran/scheduler/config/scheduler_expert_config.h"
@@ -69,7 +69,7 @@ class ue_scheduler_impl final : public ue_scheduler
6969
uci_scheduler_impl uci_sched;
7070

7171
/// SRB0 scheduler.
72-
ue_srb0_scheduler srb0_sched;
72+
ue_fallback_scheduler srb0_sched;
7373

7474
cell(const scheduler_ue_expert_config& expert_cfg, const ue_scheduler_cell_params& params, ue_repository& ues) :
7575
cell_res_alloc(params.cell_res_alloc),

tests/unittests/scheduler/common_scheduling/paging_scheduler_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "lib/scheduler/pdcch_scheduling/pdcch_resource_allocator_impl.h"
1313
#include "lib/scheduler/scheduler_impl.h"
1414
#include "lib/scheduler/ue_scheduling/ue_cell_grid_allocator.h"
15-
#include "lib/scheduler/ue_scheduling/ue_srb0_scheduler.h"
15+
#include "lib/scheduler/ue_scheduling/ue_fallback_scheduler.h"
1616
#include "tests/unittests/scheduler/test_utils/config_generators.h"
1717
#include "tests/unittests/scheduler/test_utils/scheduler_test_suite.h"
1818
#include "srsran/ran/duplex_mode.h"

tests/unittests/scheduler/multiple_ue_sched_test.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#include "lib/scheduler/scheduler_impl.h"
1212
#include "lib/scheduler/ue_scheduling/ue_cell_grid_allocator.h"
13-
#include "lib/scheduler/ue_scheduling/ue_srb0_scheduler.h"
13+
#include "lib/scheduler/ue_scheduling/ue_fallback_scheduler.h"
1414
#include "test_utils/dummy_test_components.h"
1515
#include "tests/unittests/scheduler/test_utils/config_generators.h"
1616
#include "tests/unittests/scheduler/test_utils/scheduler_test_suite.h"
@@ -467,11 +467,11 @@ class scheduler_impl_tester
467467
uci_indication::uci_pdu::uci_pucch_f0_or_f1_pdu pucch_pdu{};
468468
if (pucch.format == pucch_format::FORMAT_0) {
469469
pucch_pdu.sr_detected = sr_nof_bits_to_uint(pucch.format_0.sr_bits) > 0;
470-
// Auto ACK latest_harq_states.
470+
// Auto ACK harqs.
471471
pucch_pdu.harqs.resize(pucch.format_0.harq_ack_nof_bits, mac_harq_ack_report_status::ack);
472472
} else {
473473
pucch_pdu.sr_detected = sr_nof_bits_to_uint(pucch.format_1.sr_bits) > 0;
474-
// Auto ACK latest_harq_states.
474+
// Auto ACK harqs.
475475
pucch_pdu.harqs.resize(pucch.format_1.harq_ack_nof_bits, mac_harq_ack_report_status::ack);
476476
}
477477
pucch_pdu.ul_sinr = 55;
@@ -482,7 +482,7 @@ class scheduler_impl_tester
482482
uci_indication::uci_pdu::uci_pucch_f2_or_f3_or_f4_pdu pucch_pdu{};
483483
pucch_pdu.sr_info.resize(sr_nof_bits_to_uint(pucch.format_2.sr_bits));
484484
pucch_pdu.sr_info.fill(0, sr_nof_bits_to_uint(pucch.format_2.sr_bits), true);
485-
// Auto ACK latest_harq_states.
485+
// Auto ACK harqs.
486486
pucch_pdu.harqs.resize(pucch.format_2.harq_ack_nof_bits, mac_harq_ack_report_status::ack);
487487
if (pucch.csi_rep_cfg.has_value()) {
488488
pucch_pdu.csi.emplace();

tests/unittests/scheduler/test_utils/scheduler_test_suite.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,16 @@ void srsran::assert_pdcch_pdsch_common_consistency(const cell_configuration&
161161
TESTASSERT(it != rars.end());
162162
linked_pdsch = &it->pdsch_cfg;
163163
} break;
164-
case dci_dl_rnti_config_type::c_rnti_f1_0:
164+
case dci_dl_rnti_config_type::c_rnti_f1_0: {
165+
uint8_t k0 =
166+
cell_cfg.dl_cfg_common.init_dl_bwp.pdsch_common.pdsch_td_alloc_list[pdcch.dci.c_rnti_f1_0.time_resource].k0;
167+
const auto& ue_grants = cell_res_grid[k0].result.dl.ue_grants;
168+
auto it = std::find_if(ue_grants.begin(), ue_grants.end(), [&pdcch](const auto& grant) {
169+
return grant.pdsch_cfg.rnti == pdcch.ctx.rnti;
170+
});
171+
TESTASSERT(it != ue_grants.end());
172+
linked_pdsch = &it->pdsch_cfg;
173+
} break;
165174
case dci_dl_rnti_config_type::tc_rnti_f1_0: {
166175
uint8_t k0 =
167176
cell_cfg.dl_cfg_common.init_dl_bwp.pdsch_common.pdsch_td_alloc_list[pdcch.dci.tc_rnti_f1_0.time_resource]

tests/unittests/scheduler/ue_scheduling/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ add_executable(ue_scheduler_test
1010
logical_channel_test.cpp
1111
harq_entity_test.cpp
1212
harq_process_test.cpp
13-
srb0_scheduler_test.cpp
13+
fallback_scheduler_test.cpp
1414
ue_configuration_test.cpp
1515
ue_grid_allocator_test.cpp
1616
ul_logical_channel_test.cpp

0 commit comments

Comments
 (0)