From 544fe03db3c9a5033d3cfa6bcba797d5215a77be Mon Sep 17 00:00:00 2001 From: Francisco Date: Mon, 15 Mar 2021 20:08:22 +0000 Subject: [PATCH] sched,optimization - considering that cfi is static for sib/rar allocations, pick from the start of the tti, the optimal CFI in terms of largest number of CCE positions available --- .../stack/mac/sched_phy_ch/sf_cch_allocator.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/srsenb/src/stack/mac/sched_phy_ch/sf_cch_allocator.cc b/srsenb/src/stack/mac/sched_phy_ch/sf_cch_allocator.cc index 5c0859c75..6dc393d99 100644 --- a/srsenb/src/stack/mac/sched_phy_ch/sf_cch_allocator.cc +++ b/srsenb/src/stack/mac/sched_phy_ch/sf_cch_allocator.cc @@ -66,6 +66,21 @@ bool sf_cch_allocator::alloc_dci(alloc_type_t alloc_type, uint32_t aggr_idx, sch // TODO: Make the alloc tree update lazy alloc_record_t record{.user = user, .aggr_idx = aggr_idx, .alloc_type = alloc_type, .pusch_uci = has_pusch_grant}; + if (is_dl_ctrl_alloc(alloc_type) and current_max_cfix > current_cfix) { + // Given that CFI is not currently dynamic for ctrl allocs, in case of SIB/RAR alloc, start with optimal CFI + // in terms of nof CCE locs + uint32_t nof_locs = 0; + for (uint32_t cfix_tmp = current_max_cfix; cfix_tmp > current_cfix; ++cfix_tmp) { + const cce_cfi_position_table* dci_locs = get_cce_loc_table(record.alloc_type, record.user, cfix_tmp); + if ((*dci_locs)[record.aggr_idx].size() >= nof_locs) { + nof_locs = (*dci_locs)[record.aggr_idx].size(); + current_cfix = cfix_tmp; + } else { + break; + } + } + } + // Try to allocate user in PDCCH for given CFI. If it fails, increment CFI. uint32_t first_cfi = get_cfi(); bool success;