Skip to content

Commit 62251a5

Browse files
committed
sched: improve comments of slice scheduler
1 parent 8248726 commit 62251a5

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

lib/scheduler/slicing/slice_scheduler.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ slice_scheduler::slice_scheduler(const cell_configuration& cell_cfg_) :
2727
slices.back().inst.policy =
2828
create_scheduler_strategy(scheduler_strategy_params{"time_rr", &logger}, cell_cfg.expert_cfg.ue);
2929
++id_count;
30-
// Configured RRM policy members
30+
// Configured RRM policy members.
3131
for (const slice_rrm_policy_config& rrm : cell_cfg.rrm_policy_members) {
3232
slices.emplace_back(id_count, cell_cfg, rrm);
3333
slices.back().inst.policy =
@@ -87,7 +87,7 @@ void slice_scheduler::rem_ue(du_ue_index_t ue_idx)
8787

8888
ran_slice_instance& slice_scheduler::get_slice(const rrm_policy_member& rrm)
8989
{
90-
auto it = std::find_if(slices.begin() + 1, slices.end(), [&rrm](const ran_slice_sched_context& slice) {
90+
auto it = std::find_if(slices.begin(), slices.end(), [&rrm](const ran_slice_sched_context& slice) {
9191
return slice.inst.cfg.rrc_member == rrm;
9292
});
9393
if (it == slices.end()) {
@@ -151,11 +151,11 @@ slice_scheduler::priority_type slice_scheduler::ran_slice_sched_context::get_pri
151151
{
152152
// Note: The positive integer representing the priority of a slice consists of a concatenation of three priority
153153
// values:
154-
// 1. slice traffic priority (16 bits). Differentiation of slices based on whether they have minimum required
155-
// traffic agreements (e.g. minRB ratio).
154+
// 1. slice traffic priority (16 most significant bits). It differentiates slices based on whether they have
155+
// minimum required traffic agreements (e.g. minRB ratio).
156156
// 2. delay priority (8 bits), which attributes the highest priority to slices that have not been scheduled for a
157-
// long time
158-
// 3. round-robin based on slot indication count (8 bits).
157+
// long time.
158+
// 3. round-robin based on slot indication count (8 least significant bits).
159159

160160
// Priority when slice has already reached its minimum RB ratio agreement.
161161
constexpr static priority_type default_prio = 0x1U;

lib/scheduler/slicing/slice_scheduler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class slice_scheduler
5757
{
5858
}
5959

60-
/// Get the slice priority as a candidate, considering also past decisions by the slice scheduler for this slot.
60+
/// Determines the slice candidate priority.
6161
priority_type get_prio(bool is_dl, slot_count_type current_slot_count, bool slice_resched) const;
6262
};
6363

tests/unittests/scheduler/slicing/slice_scheduler_test.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,13 @@ class rb_ratio_slice_scheduler_test : public slice_scheduler_test, public ::test
157157

158158
const ue_configuration* add_ue(du_ue_index_t ue_idx)
159159
{
160-
auto req = test_cfg.get_default_ue_config_request();
161-
req.ue_index = ue_idx;
162-
req.crnti = to_rnti(0x4601 + ue_idx);
163-
req.starts_in_fallback = false;
164-
(*req.cfg.lc_config_list)[2].rrm_policy.plmn_id = "00101";
165-
(*req.cfg.lc_config_list)[2].rrm_policy.s_nssai = s_nssai_t{1};
160+
const unsigned drb1_idx = 2;
161+
auto req = test_cfg.get_default_ue_config_request();
162+
req.ue_index = ue_idx;
163+
req.crnti = to_rnti(0x4601 + ue_idx);
164+
req.starts_in_fallback = false;
165+
(*req.cfg.lc_config_list)[drb1_idx].rrm_policy.plmn_id = "00101";
166+
(*req.cfg.lc_config_list)[drb1_idx].rrm_policy.s_nssai = s_nssai_t{1};
166167
return slice_scheduler_test::add_ue(req);
167168
}
168169
};

0 commit comments

Comments
 (0)