Skip to content

Commit af04457

Browse files
herlesupreethcodebot
authored andcommitted
du,du_high_unit: add option to set RAN slices and their scheduling parameters
1 parent dc18e79 commit af04457

File tree

5 files changed

+89
-0
lines changed

5 files changed

+89
-0
lines changed

apps/units/flexible_du/du_high/du_high_config.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "srsran/ran/pucch/pucch_configuration.h"
2828
#include "srsran/ran/pusch/pusch_mcs.h"
2929
#include "srsran/ran/rnti.h"
30+
#include "srsran/ran/s_nssai.h"
3031
#include "srsran/ran/sib/system_info_config.h"
3132
#include "srsran/ran/slot_pdu_capacity_constants.h"
3233
#include "srsran/ran/subcarrier_spacing.h"
@@ -486,6 +487,22 @@ struct du_high_unit_prach_config {
486487
uint8_t nof_cb_preambles_per_ssb = 64;
487488
};
488489

490+
/// Slice scheduling configuration for a cell.
491+
struct du_high_unit_cell_slice_sched_config {
492+
/// Sets the minimum number of PRBs to be allocated to this group.
493+
unsigned min_prb = 0;
494+
/// Sets the maximum number of PRBs to be allocated to this group.
495+
unsigned max_prb = MAX_NOF_PRBS;
496+
};
497+
498+
/// Slice configuration for a cell.
499+
struct du_high_unit_cell_slice_config {
500+
/// Slice identifier.
501+
s_nssai_t s_nssai = s_nssai_t{1};
502+
/// Slice scheduling configuration.
503+
du_high_unit_cell_slice_sched_config sched_cfg;
504+
};
505+
489506
/// Base cell configuration.
490507
struct du_high_unit_base_cell_config {
491508
/// Physical cell identifier.
@@ -540,6 +557,8 @@ struct du_high_unit_base_cell_config {
540557
du_high_unit_csi_config csi_cfg;
541558
/// Scheduler expert configuration.
542559
du_high_unit_scheduler_expert_config sched_expert_cfg;
560+
/// Network slice configuration.
561+
std::vector<du_high_unit_cell_slice_config> slice_cfg;
543562
};
544563

545564
struct du_high_unit_test_mode_ue_config {

apps/units/flexible_du/du_high/du_high_config_cli11_schema.cpp

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,31 @@ static void configure_cli11_sib_args(CLI::App& app, du_high_unit_sib_config& sib
10271027
->check(CLI::IsMember({100, 200, 300, 400, 600, 1000, 1500, 2000}));
10281028
}
10291029

1030+
static void configure_cli11_slicing_scheduling_args(CLI::App& app,
1031+
du_high_unit_cell_slice_sched_config& slice_sched_params)
1032+
{
1033+
add_option(app, "--min_prb", slice_sched_params.min_prb, "Minimum number of PRBs to be allocated to the slice")
1034+
->capture_default_str()
1035+
->check(CLI::Range(0U, (unsigned)MAX_NOF_PRBS));
1036+
add_option(app, "--max_prb", slice_sched_params.max_prb, "Maximum number of PRBs to be allocated to the slice")
1037+
->capture_default_str()
1038+
->check(CLI::Range(1U, (unsigned)MAX_NOF_PRBS));
1039+
}
1040+
1041+
static void configure_cli11_slicing_args(CLI::App& app, du_high_unit_cell_slice_config& slice_params)
1042+
{
1043+
add_option(app, "--sst", slice_params.s_nssai.sst, "Slice Service Type")
1044+
->capture_default_str()
1045+
->check(CLI::Range(0, 255));
1046+
add_option(app, "--sd", slice_params.s_nssai.sd, "Service Differentiator")
1047+
->capture_default_str()
1048+
->check(CLI::Range(0, 0xffffff));
1049+
1050+
// Scheduling configuration.
1051+
CLI::App* sched_cfg_subcmd = add_subcommand(app, "sched_cfg", "Slice scheduling configuration")->configurable();
1052+
configure_cli11_slicing_scheduling_args(*sched_cfg_subcmd, slice_params.sched_cfg);
1053+
}
1054+
10301055
static void configure_cli11_common_cell_args(CLI::App& app, du_high_unit_base_cell_config& cell_params)
10311056
{
10321057
add_option(app, "--pci", cell_params.pci, "PCI")->capture_default_str()->check(CLI::Range(0, 1007));
@@ -1180,6 +1205,23 @@ static void configure_cli11_common_cell_args(CLI::App& app, du_high_unit_base_ce
11801205
// Scheduler expert configuration.
11811206
CLI::App* sched_expert_subcmd = add_subcommand(app, "sched_expert_cfg", "Scheduler expert parameters");
11821207
configure_cli11_scheduler_expert_args(*sched_expert_subcmd, cell_params.sched_expert_cfg);
1208+
1209+
// Slicing configuration.
1210+
auto slicing_lambda = [&cell_params](const std::vector<std::string>& values) {
1211+
// Prepare the slices and its configuration.
1212+
cell_params.slice_cfg.resize(values.size());
1213+
1214+
// Format every slicing setting.
1215+
for (unsigned i = 0, e = values.size(); i != e; ++i) {
1216+
CLI::App subapp("Slicing parameters", "Slicing config, item #" + std::to_string(i));
1217+
subapp.config_formatter(create_yaml_config_parser());
1218+
subapp.allow_config_extras(CLI::config_extras_mode::capture);
1219+
configure_cli11_slicing_args(subapp, cell_params.slice_cfg[i]);
1220+
std::istringstream ss(values[i]);
1221+
subapp.parse_from_stream(ss);
1222+
}
1223+
};
1224+
add_option_cell(app, "--slicing", slicing_lambda, "Network slicing configuration");
11831225
}
11841226

11851227
static void configure_cli11_cells_args(CLI::App& app, du_high_unit_cell_config& cell_params)

apps/units/flexible_du/du_high/du_high_config_translators.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,9 @@ std::vector<du_cell_config> srsran::generate_du_cell_config(const du_high_unit_c
603603
du_pucch_cfg, out_cell.ul_cfg_common.init_ul_bwp.generic_params.crbs.length(), is_long_prach);
604604
}
605605

606+
// Slicing configuration.
607+
out_cell.rrm_policy_members = generate_du_slicing_rrm_policy_config(base_cell.plmn, base_cell.slice_cfg);
608+
606609
logger.info(
607610
"SSB derived parameters for cell: {}, band: {}, dl_arfcn:{}, crbs: {} scs:{}, ssb_scs:{}:\n\t - SSB offset "
608611
"pointA:{} \n\t - k_SSB:{} \n\t - SSB arfcn:{} \n\t - Coreset index:{} \n\t - Searchspace index:{}",
@@ -667,6 +670,21 @@ static mac_lc_config generate_mac_lc_config(const du_high_unit_mac_lc_config& in
667670
return out_mac;
668671
}
669672

673+
std::vector<slice_rrm_policy_config>
674+
srsran::generate_du_slicing_rrm_policy_config(const std::string& plmn,
675+
span<const du_high_unit_cell_slice_config> slice_cfg)
676+
{
677+
std::vector<slice_rrm_policy_config> rrm_policy_cfgs;
678+
for (const auto& cfg : slice_cfg) {
679+
rrm_policy_cfgs.emplace_back();
680+
rrm_policy_cfgs.back().rrc_member.s_nssai = cfg.s_nssai;
681+
rrm_policy_cfgs.back().rrc_member.plmn_id = plmn;
682+
rrm_policy_cfgs.back().min_prb = cfg.sched_cfg.min_prb;
683+
rrm_policy_cfgs.back().max_prb = cfg.sched_cfg.max_prb;
684+
}
685+
return rrm_policy_cfgs;
686+
}
687+
670688
std::map<five_qi_t, du_qos_config> srsran::generate_du_qos_config(const du_high_unit_config& config)
671689
{
672690
std::map<five_qi_t, du_qos_config> out_cfg = {};

apps/units/flexible_du/du_high/du_high_config_translators.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
*/
1010

1111
#pragma once
12+
13+
#include "du_high_config.h"
1214
#include "srsran/du/du_cell_config.h"
1315
#include "srsran/du/du_qos_config.h"
1416
#include "srsran/du/du_srb_config.h"
@@ -44,4 +46,8 @@ e2ap_configuration generate_e2_config(const du_high_unit_config& du_high);
4446
/// Augments RLC parameters based on NTN configuration.
4547
void ntn_augment_rlc_parameters(const ntn_config& ntn_cfg, std::map<srb_id_t, du_srb_config>& srb_cfgs);
4648

49+
/// Converts and returns the given gnb application configuration to a DU slice RRM policy configuration list.
50+
std::vector<slice_rrm_policy_config>
51+
generate_du_slicing_rrm_policy_config(const std::string& plmn, span<const du_high_unit_cell_slice_config> slice_cfg);
52+
4753
} // namespace srsran

include/srsran/du/du_cell_config.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "srsran/ran/tdd/tdd_ul_dl_config.h"
2121
#include "srsran/scheduler/config/bwp_configuration.h"
2222
#include "srsran/scheduler/config/serving_cell_config.h"
23+
#include "srsran/scheduler/config/slice_rrm_policy_config.h"
2324

2425
namespace srsran {
2526

@@ -167,6 +168,9 @@ struct du_cell_config {
167168

168169
/// Defines the maximum allowable channel delay in slots when runnning in NTN mode. seee (TS 38.300 section 16.14.2)
169170
unsigned ntn_cs_koffset = 0;
171+
172+
/// List of RAN slices to support in the scheduler.
173+
std::vector<slice_rrm_policy_config> rrm_policy_members;
170174
};
171175

172176
} // namespace srsran

0 commit comments

Comments
 (0)