nr,gnb,sched: add extra checks to sched to ensure the max nof grants is not exceeded

master
Francisco 3 years ago committed by Francisco Paisana
parent 0c35045543
commit 0663594aa1

@ -72,9 +72,9 @@ private:
pdcch_grant_type_t alloc_type;
slot_ue* ue;
};
srsran::bounded_vector<alloc_record, MAX_GRANTS> dci_list;
pdcch_dl_list_t& pdcch_dl_list;
pdcch_ul_list_t& pdcch_ul_list;
srsran::bounded_vector<alloc_record, 2 * MAX_GRANTS> dci_list;
pdcch_dl_list_t& pdcch_dl_list;
pdcch_ul_list_t& pdcch_ul_list;
// DFS decision tree of PDCCH grants
struct tree_node {
@ -85,7 +85,7 @@ private:
/// Accumulation of all PDCCH masks for the current solution (DFS path)
coreset_bitmap total_mask, current_mask;
};
using alloc_tree_dfs_t = srsran::bounded_vector<tree_node, MAX_GRANTS>;
using alloc_tree_dfs_t = std::vector<tree_node>;
alloc_tree_dfs_t dfs_tree, saved_dfs_tree;
srsran::span<const uint32_t> get_cce_loc_table(const alloc_record& record) const;

@ -110,6 +110,13 @@ alloc_result bwp_slot_allocator::alloc_rar_and_msg3(uint16_t
if (ret != alloc_result::success) {
return ret;
}
if (bwp_pdcch_slot.rar.full()) {
return alloc_result::no_grant_space;
}
if (pending_rars.size() > MAX_GRANTS) {
logger.error("SCHED: Trying to allocate too many Msg3 grants in a single slot (%zd)", pending_rars.size());
return alloc_result::invalid_grant_params;
}
// Check DL RB collision
if (bwp_pdcch_slot.dl_prbs.collides(interv)) {
@ -209,6 +216,10 @@ alloc_result bwp_slot_allocator::alloc_pdsch(slot_ue& ue, const prb_grant& dl_gr
if (result != alloc_result::success) {
return result;
}
if (bwp_uci_slot.pending_acks.full()) {
logger.warning("SCHED: PDSCH allocation for rnti=0x%x failed due to lack of space for respective ACK", ue.rnti);
return alloc_result::no_grant_space;
}
if (bwp_pdsch_slot.dl_prbs.collides(dl_grant)) {
return alloc_result::sch_collision;
}

@ -56,6 +56,7 @@ bool coreset_region::alloc_dci(pdcch_grant_type_t alloc_type,
srsran_assert((user == nullptr) xor
(alloc_type == pdcch_grant_type_t::dl_data or alloc_type == pdcch_grant_type_t::ul_data),
"UE should be only provided for DL or UL data allocations");
srsran_assert(not dci_list.full(), "SCHED: Unable to allocate DCI");
saved_dfs_tree.clear();
alloc_record record;
@ -80,13 +81,13 @@ bool coreset_region::alloc_dci(pdcch_grant_type_t alloc_type,
dci_list.push_back(record);
return true;
}
if (dfs_tree.empty()) {
if (saved_dfs_tree.empty()) {
saved_dfs_tree = dfs_tree;
}
} while (get_next_dfs());
// Revert steps to initial state, before dci record allocation was attempted
dfs_tree = saved_dfs_tree;
dfs_tree.swap(saved_dfs_tree);
if (record.alloc_type == pdcch_grant_type_t::ul_data) {
pdcch_ul_list.pop_back();
} else {

@ -34,6 +34,10 @@ void sched_nzp_csi_rs(srsran::const_span<srsran_csi_rs_nzp_set_t> nzp_csi_rs_set
// Check if the resource is scheduled for this slot
if (srsran_csi_rs_send(&nzp_csi_resource.periodicity, &slot_cfg)) {
if (csi_rs_list.full()) {
srslog::fetch_basic_logger("MAC-NR").error("SCHED: Failed to allocate NZP-CSI RS");
return;
}
csi_rs_list.push_back(nzp_csi_resource);
}
}
@ -42,6 +46,10 @@ void sched_nzp_csi_rs(srsran::const_span<srsran_csi_rs_nzp_set_t> nzp_csi_rs_set
void sched_ssb_basic(const slot_point& sl_point, uint32_t ssb_periodicity, ssb_list& ssb_list)
{
if (ssb_list.full()) {
srslog::fetch_basic_logger("MAC-NR").error("SCHED: Failed to allocate SSB");
return;
}
// If the periodicity is 0, it means that the parameter was not passed by the upper layers.
// In that case, we use default value of 5ms (see Clause 4.1, TS 38.213)
if (ssb_periodicity == 0) {

@ -183,6 +183,10 @@ void slot_cc_worker::postprocess_decisions()
}
if (not has_pusch) {
// If any UCI information is triggered, schedule PUCCH
if (bwp_slot.pucch.full()) {
logger.warning("SCHED: Cannot fit pending UCI into PUCCH");
continue;
}
bwp_slot.pucch.emplace_back();
mac_interface_phy_nr::pucch_t& pucch = bwp_slot.pucch.back();

Loading…
Cancel
Save