Skip to content

Commit 7b03b20

Browse files
carlo-galcodebot
authored andcommitted
sched: fix uninited var + remove unused function
Signed-off-by: Carlo Galiotto <[email protected]>
1 parent 7770d80 commit 7b03b20

File tree

9 files changed

+26
-100
lines changed

9 files changed

+26
-100
lines changed

lib/scheduler/ue_scheduling/harq_process.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ class dl_harq_process : public detail::harq_process<true>
270270
std::array<optional<tb_params>, base_type::MAX_NOF_TBS> tb;
271271
cqi_value cqi;
272272
unsigned nof_layers;
273-
bool is_fallback;
273+
bool is_fallback{false};
274274
};
275275

276276
struct dl_ack_info_result {

lib/scheduler/ue_scheduling/ue_event_manager.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class ue_event_manager::ue_dl_buffer_occupancy_manager final : public scheduler_
8080
u.handle_dl_buffer_state_indication(dl_bo);
8181
if (dl_bo.lcid == LCID_SRB0 or (u.get_pcell().is_in_fallback_mode() and dl_bo.lcid == LCID_SRB1)) {
8282
// Signal SRB fallback scheduler with the new SRB0/SRB1 buffer state.
83-
parent.du_cells[u.get_pcell().cell_index].srb0_sched->handle_dl_buffer_state_indication_srb(
83+
parent.du_cells[u.get_pcell().cell_index].fallback_sched->handle_dl_buffer_state_indication_srb(
8484
dl_bo.ue_index, dl_bo.lcid == LCID_SRB0);
8585
}
8686

@@ -632,16 +632,16 @@ 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_fallback_scheduler& srb0_sched,
635+
ue_fallback_scheduler& fallback_sched,
636636
uci_scheduler_impl& uci_sched)
637637
{
638638
const du_cell_index_t cell_index = cell_res_grid.cell_index();
639639
srsran_assert(not cell_exists(cell_index), "Overwriting cell configurations not supported");
640640

641-
du_cells[cell_index].cfg = &cell_res_grid.cfg;
642-
du_cells[cell_index].res_grid = &cell_res_grid;
643-
du_cells[cell_index].srb0_sched = &srb0_sched;
644-
du_cells[cell_index].uci_sched = &uci_sched;
641+
du_cells[cell_index].cfg = &cell_res_grid.cfg;
642+
du_cells[cell_index].res_grid = &cell_res_grid;
643+
du_cells[cell_index].fallback_sched = &fallback_sched;
644+
du_cells[cell_index].uci_sched = &uci_sched;
645645
}
646646

647647
bool ue_event_manager::cell_exists(du_cell_index_t cell_index) const

lib/scheduler/ue_scheduling/ue_event_manager.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ 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
40-
add_cell(cell_resource_allocator& cell_res_grid, ue_fallback_scheduler& srb0_sched, uci_scheduler_impl& uci_sched);
39+
void add_cell(cell_resource_allocator& cell_res_grid,
40+
ue_fallback_scheduler& fallback_sched,
41+
uci_scheduler_impl& uci_sched);
4142

4243
/// UE Add/Mod/Remove interface.
4344
void handle_ue_creation(ue_config_update_event ev) override;
@@ -113,8 +114,8 @@ class ue_event_manager final : public sched_ue_configuration_handler,
113114

114115
cell_resource_allocator* res_grid = nullptr;
115116

116-
// Reference to SRB0 and other bearers scheduler
117-
ue_fallback_scheduler* srb0_sched = nullptr;
117+
// Reference to fallback scheduler.
118+
ue_fallback_scheduler* fallback_sched = nullptr;
118119

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

lib/scheduler/ue_scheduling/ue_fallback_scheduler.cpp

Lines changed: 1 addition & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ dl_harq_process* ue_fallback_scheduler::schedule_srb0(ue& u
337337

338338
if (mcs_idx > expert_cfg.max_msg4_mcs) {
339339
logger.debug("rnti={}: Postponing SRB0 PDU allocation. Cause: MCS index chosen ({}) for SRB0 exceeds maximum"
340-
"allowed MCS index ({})",
340+
" allowed MCS index ({})",
341341
u.crnti,
342342
mcs_idx,
343343
expert_cfg.max_msg4_mcs);
@@ -567,68 +567,6 @@ dl_harq_process* ue_fallback_scheduler::schedule_srb1(ue& u
567567
return h_dl;
568568
}
569569

570-
void ue_fallback_scheduler::fill_srb0_grant(ue& u,
571-
slot_point pdsch_slot,
572-
dl_harq_process& h_dl,
573-
pdcch_dl_information& pdcch,
574-
dl_msg_alloc& msg,
575-
unsigned pucch_res_indicator,
576-
unsigned pdsch_time_res,
577-
unsigned k1,
578-
sch_mcs_index mcs_idx,
579-
const crb_interval& ue_grant_crbs,
580-
const pdsch_config_params& pdsch_params,
581-
unsigned tbs_bytes,
582-
bool is_retx)
583-
{
584-
// Allocate DL HARQ.
585-
// NOTE: We do not multiplex the SRBO PUCCH with existing PUCCH HARQs, thus both DAI and HARQ-ACK bit index are 0.
586-
if (not is_retx) {
587-
const bool is_fallback = true;
588-
static constexpr uint8_t srb0_dai = 0;
589-
h_dl.new_tx(pdsch_slot,
590-
k1,
591-
expert_cfg.max_nof_harq_retxs,
592-
srb0_dai,
593-
u.get_pcell().channel_state_manager().get_wideband_cqi(),
594-
u.get_pcell().channel_state_manager().get_nof_dl_layers(),
595-
is_fallback);
596-
} else {
597-
const unsigned harq_bit_idx = 0U;
598-
h_dl.new_retx(pdsch_slot, k1, harq_bit_idx);
599-
}
600-
601-
// Fill DL PDCCH DCI.
602-
static const uint8_t msg4_rv = 0;
603-
build_dci_f1_0_tc_rnti(pdcch.dci,
604-
cell_cfg.dl_cfg_common.init_dl_bwp,
605-
ue_grant_crbs,
606-
pdsch_time_res,
607-
k1,
608-
pucch_res_indicator,
609-
mcs_idx,
610-
msg4_rv,
611-
h_dl);
612-
613-
// Fill PDSCH PDU.
614-
msg.context.ue_index = u.ue_index;
615-
msg.context.k1 = k1;
616-
msg.context.ss_id = pdcch.ctx.context.ss_id;
617-
msg.context.nof_retxs = h_dl.tb(0).nof_retxs;
618-
msg.context.olla_offset = 0;
619-
build_pdsch_f1_0_tc_rnti(
620-
msg.pdsch_cfg, pdsch_params, tbs_bytes, u.crnti, cell_cfg, pdcch.dci.tc_rnti_f1_0, ue_grant_crbs, not is_retx);
621-
622-
if (not is_retx) {
623-
// Set MAC logical channels to schedule in this PDU.
624-
u.build_dl_fallback_transport_block_info(
625-
msg.tb_list.emplace_back(), msg.pdsch_cfg.codewords[0].tb_size_bytes, true);
626-
}
627-
628-
// Save in HARQ the parameters set for this PDCCH and PDSCH PDUs.
629-
h_dl.save_alloc_params(pdcch.dci.type, msg.pdsch_cfg);
630-
}
631-
632570
void ue_fallback_scheduler::fill_srb_grant(ue& u,
633571
slot_point pdsch_slot,
634572
dl_harq_process& h_dl,

lib/scheduler/ue_scheduling/ue_fallback_scheduler.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,6 @@ class ue_fallback_scheduler
7171
slot_point most_recent_ack_slot,
7272
dl_harq_process* h_dl_retx = nullptr);
7373

74-
void fill_srb0_grant(ue& u,
75-
slot_point pdsch_slot,
76-
dl_harq_process& h_dl,
77-
pdcch_dl_information& pdcch,
78-
dl_msg_alloc& msg,
79-
unsigned pucch_res_indicator,
80-
unsigned pdsch_time_res,
81-
unsigned k1,
82-
sch_mcs_index mcs_idx,
83-
const crb_interval& ue_grant_crbs,
84-
const pdsch_config_params& pdsch_params,
85-
unsigned tbs_bytes,
86-
bool is_retx);
87-
8874
void fill_srb_grant(ue& u,
8975
slot_point pdsch_slot,
9076
dl_harq_process& h_dl,

lib/scheduler/ue_scheduling/ue_pdsch_param_candidate_searcher.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class ue_pdsch_param_candidate_searcher
137137
// Create list of DL HARQ processes with pending retx, sorted from oldest to newest.
138138
for (unsigned i = 0; i != ue_cc.harqs.nof_dl_harqs(); ++i) {
139139
const dl_harq_process& h = ue_cc.harqs.dl_harq(i);
140-
if ((not h.last_alloc_params().is_fallback) and h.has_pending_retx()) {
140+
if (h.has_pending_retx() and (not h.last_alloc_params().is_fallback)) {
141141
dl_harq_candidates.push_back(&h);
142142
}
143143
}

lib/scheduler/ue_scheduling/ue_scheduler_impl.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ void ue_scheduler_impl::add_cell(const ue_scheduler_cell_params& params)
3030
{
3131
ue_res_grid_view.add_cell(*params.cell_res_alloc);
3232
cells[params.cell_index] = std::make_unique<cell>(expert_cfg, params, ue_db);
33-
event_mng.add_cell(*params.cell_res_alloc, cells[params.cell_index]->srb0_sched, cells[params.cell_index]->uci_sched);
33+
event_mng.add_cell(
34+
*params.cell_res_alloc, cells[params.cell_index]->fallback_sched, cells[params.cell_index]->uci_sched);
3435
ue_alloc.add_cell(params.cell_index, *params.pdcch_sched, *params.uci_alloc, *params.cell_res_alloc);
3536
}
3637

@@ -155,7 +156,7 @@ void ue_scheduler_impl::run_slot(slot_point slot_tx, du_cell_index_t cell_index)
155156
cells[cell_index]->uci_sched.run_slot(*cells[cell_index]->cell_res_alloc);
156157

157158
// Run cell-specific SRB0 scheduler.
158-
cells[cell_index]->srb0_sched.run_slot(*cells[cell_index]->cell_res_alloc);
159+
cells[cell_index]->fallback_sched.run_slot(*cells[cell_index]->cell_res_alloc);
159160

160161
// Synchronize all carriers. Last thread to reach this synchronization point, runs UE scheduling strategy.
161162
sync_point.wait(

lib/scheduler/ue_scheduling/ue_scheduler_impl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ class ue_scheduler_impl final : public ue_scheduler
6868
/// PUCCH scheduler.
6969
uci_scheduler_impl uci_sched;
7070

71-
/// SRB0 scheduler.
72-
ue_fallback_scheduler srb0_sched;
71+
/// Fallback scheduler.
72+
ue_fallback_scheduler fallback_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),
7676
uci_sched(params.cell_res_alloc->cfg, *params.uci_alloc, ues),
77-
srb0_sched(expert_cfg, params.cell_res_alloc->cfg, *params.pdcch_sched, *params.pucch_alloc, ues)
77+
fallback_sched(expert_cfg, params.cell_res_alloc->cfg, *params.pdcch_sched, *params.pucch_alloc, ues)
7878
{
7979
}
8080
};

tests/unittests/scheduler/ue_scheduling/fallback_scheduler_test.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -935,13 +935,13 @@ class fallback_scheduler_srb1_segmentation : public base_fallback_tester,
935935
test_rgen::uniform_int(20U, 40U)};
936936
}
937937

938-
const cell_configuration& cell_cfg;
939-
ue& test_ue;
940-
slot_point slot_update_srb_traffic;
941-
unsigned nof_packet_to_tx;
938+
const cell_configuration& cell_cfg;
939+
ue& test_ue;
940+
slot_point slot_update_srb_traffic;
941+
unsigned nof_packet_to_tx;
942942
fallback_scheduler_srb1_segmentation* parent;
943-
srslog::basic_logger& test_logger = srslog::fetch_basic_logger("TEST");
944-
unsigned missing_retx = 0;
943+
srslog::basic_logger& test_logger = srslog::fetch_basic_logger("TEST");
944+
unsigned missing_retx = 0;
945945

946946
using h_state = srsran::dl_harq_process::harq_process::transport_block::state_t;
947947
std::vector<h_state> latest_harq_states;

0 commit comments

Comments
 (0)