Skip to content

Commit d0d20a7

Browse files
herlesupreethcodebot
authored andcommitted
gnb: handle case of slicing parameters provided in DU and CU-CP
1 parent af04457 commit d0d20a7

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

apps/gnb/gnb.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,26 @@ static void register_app_logs(const logger_appconfig& log_cfg,
172172
register_dynamic_du_loggers(du_loggers);
173173
}
174174

175+
static void autoderive_slicing_args(dynamic_du_unit_config& du_unit_cfg, cu_cp_unit_config& cu_cp_config)
176+
{
177+
std::vector<s_nssai_t> du_slices;
178+
for (const auto& cell_cfg : du_unit_cfg.du_high_cfg.config.cells_cfg) {
179+
for (const auto& slice : cell_cfg.cell.slice_cfg) {
180+
if (du_slices.end() == std::find(du_slices.begin(), du_slices.end(), slice.s_nssai)) {
181+
du_slices.push_back(slice.s_nssai);
182+
}
183+
}
184+
}
185+
// NOTE: A CU-CP can serve more slices than slices configured in the DU cells.
186+
// [Implementation-defined] Ensure that all slices served by DU cells are part of CU-CP served slices.
187+
for (const auto& slice : du_slices) {
188+
if (cu_cp_config.slice_cfg.end() ==
189+
std::find(cu_cp_config.slice_cfg.begin(), cu_cp_config.slice_cfg.end(), slice)) {
190+
cu_cp_config.slice_cfg.push_back(slice);
191+
}
192+
}
193+
}
194+
175195
int main(int argc, char** argv)
176196
{
177197
// Set the application error handler.
@@ -213,6 +233,7 @@ int main(int argc, char** argv)
213233
// Set the callback for the app calling all the autoderivation functions.
214234
app.callback([&app, &gnb_cfg, &du_unit_cfg, &cu_cp_config]() {
215235
autoderive_gnb_parameters_after_parsing(app, gnb_cfg);
236+
autoderive_slicing_args(du_unit_cfg, cu_cp_config);
216237
autoderive_dynamic_du_parameters_after_parsing(app, du_unit_cfg);
217238

218239
// Create the PLMN and TAC list from the cells.

0 commit comments

Comments
 (0)