2222
2323#include " gnb_appconfig_cli11_schema.h"
2424#include " gnb_appconfig.h"
25+ #include " srsran/ran/duplex_mode.h"
2526#include " srsran/ran/pdsch/pdsch_mcs.h"
2627#include " srsran/support/cli11_utils.h"
2728#include " srsran/support/config_parsers.h"
@@ -388,6 +389,11 @@ static void configure_cli11_cu_cp_args(CLI::App& app, cu_cp_appconfig& cu_cp_par
388389 configure_cli11_security_args (*security_subcmd, cu_cp_params.security_config );
389390}
390391
392+ static void configure_cli11_cu_up_args (CLI::App& app, cu_up_appconfig& cu_up_params)
393+ {
394+ app.add_option (" --gtpu_queue_size" , cu_up_params.gtpu_queue_size , " GTP-U queue size, in PDUs" )->capture_default_str ();
395+ }
396+
391397static void configure_cli11_expert_phy_args (CLI::App& app, expert_upper_phy_appconfig& expert_phy_params)
392398{
393399 auto pusch_sinr_method_check = [](const std::string& value) -> std::string {
@@ -1288,6 +1294,8 @@ static void configure_cli11_rlc_um_args(CLI::App& app, rlc_um_appconfig& rlc_um_
12881294{
12891295 CLI::App* rlc_tx_um_subcmd = app.add_subcommand (" tx" , " UM TX parameters" );
12901296 rlc_tx_um_subcmd->add_option (" --sn" , rlc_um_params.tx .sn_field_length , " RLC UM TX SN" )->capture_default_str ();
1297+ rlc_tx_um_subcmd->add_option (" --queue-size" , rlc_um_params.tx .queue_size , " RLC UM TX SDU queue size" )
1298+ ->capture_default_str ();
12911299 CLI::App* rlc_rx_um_subcmd = app.add_subcommand (" rx" , " UM TX parameters" );
12921300 rlc_rx_um_subcmd->add_option (" --sn" , rlc_um_params.rx .sn_field_length , " RLC UM RX SN" )->capture_default_str ();
12931301 rlc_rx_um_subcmd->add_option (" --t-reassembly" , rlc_um_params.rx .t_reassembly , " RLC UM t-Reassembly" )
@@ -1304,11 +1312,12 @@ static void configure_cli11_rlc_am_args(CLI::App& app, rlc_am_appconfig& rlc_am_
13041312 ->capture_default_str ();
13051313 rlc_tx_am_subcmd->add_option (" --poll-pdu" , rlc_am_params.tx .poll_pdu , " RLC AM TX PollPdu" )->capture_default_str ();
13061314 rlc_tx_am_subcmd->add_option (" --poll-byte" , rlc_am_params.tx .poll_byte , " RLC AM TX PollByte" )->capture_default_str ();
1307- rlc_tx_am_subcmd
1308- ->add_option (" --max_window" ,
1309- rlc_am_params.tx .max_window ,
1310- " Non-standard parameter that limits the tx window size. Can be used for limiting memory usage with "
1311- " large windows. 0 means no limits other than the SN size (i.e. 2^[sn_size-1])." )
1315+ rlc_tx_am_subcmd->add_option (
1316+ " --max_window" ,
1317+ rlc_am_params.tx .max_window ,
1318+ " Non-standard parameter that limits the tx window size. Can be used for limiting memory usage with "
1319+ " large windows. 0 means no limits other than the SN size (i.e. 2^[sn_size-1])." );
1320+ rlc_tx_am_subcmd->add_option (" --queue-size" , rlc_am_params.tx .queue_size , " RLC AM TX SDU queue size" )
13121321 ->capture_default_str ();
13131322 CLI::App* rlc_rx_am_subcmd = app.add_subcommand (" rx" , " AM RX parameters" );
13141323 rlc_rx_am_subcmd->add_option (" --sn" , rlc_am_params.rx .sn_field_length , " RLC AM RX SN" )->capture_default_str ();
@@ -1656,6 +1665,8 @@ static void configure_cli11_ru_ofh_cells_args(CLI::App& app, ru_ofh_cell_appconf
16561665{
16571666 configure_cli11_ru_ofh_base_cell_args (app, config.cell );
16581667 app.add_option (" --network_interface" , config.network_interface , " Network interface" )->capture_default_str ();
1668+ app.add_option (" --enable_promiscuous" , config.enable_promiscuous_mode , " Promiscuous mode flag" )
1669+ ->capture_default_str ();
16591670 app.add_option (" --ru_mac_addr" , config.ru_mac_address , " Radio Unit MAC address" )->capture_default_str ();
16601671 app.add_option (" --du_mac_addr" , config.du_mac_address , " Distributed Unit MAC address" )->capture_default_str ();
16611672 app.add_option (" --vlan_tag" , config.vlan_tag , " V-LAN identifier" )->capture_default_str ()->check (CLI::Range (1 , 4094 ));
@@ -1986,6 +1997,47 @@ static void manage_hal_optional(CLI::App& app, gnb_appconfig& gnb_cfg)
19861997 }
19871998}
19881999
2000+ static void manage_expert_execution_threads (CLI::App& app, gnb_appconfig& gnb_cfg)
2001+ {
2002+ if (!variant_holds_alternative<ru_sdr_appconfig>(gnb_cfg.ru_cfg )) {
2003+ return ;
2004+ }
2005+
2006+ // Ignore the default settings based in the number of CPU cores for ZMQ.
2007+ if (variant_get<ru_sdr_appconfig>(gnb_cfg.ru_cfg ).device_driver == " zmq" ) {
2008+ upper_phy_threads_appconfig& upper = gnb_cfg.expert_execution_cfg .threads .upper_threads ;
2009+ upper.nof_pdsch_threads = 1 ;
2010+ upper.nof_pusch_decoder_threads = 0 ;
2011+ upper.nof_ul_threads = 1 ;
2012+ upper.nof_dl_threads = 1 ;
2013+ gnb_cfg.expert_execution_cfg .threads .lower_threads .execution_profile = lower_phy_thread_profile::blocking;
2014+ }
2015+ }
2016+
2017+ static void manage_processing_delay (CLI::App& app, gnb_appconfig& gnb_cfg)
2018+ {
2019+ // If max proc delay property is present in the config, do nothing.
2020+ CLI::App* expert_cmd = app.get_subcommand (" expert_phy" );
2021+ if (expert_cmd->count_all () >= 1 && expert_cmd->count (" --max_proc_delay" ) >= 1 ) {
2022+ return ;
2023+ }
2024+
2025+ // As processing delay is not cell related, use the first cell to update the value.
2026+ const auto & cell = gnb_cfg.cells_cfg .front ().cell ;
2027+ nr_band band = cell.band ? cell.band .value () : band_helper::get_band_from_dl_arfcn (cell.dl_arfcn );
2028+
2029+ switch (band_helper::get_duplex_mode (band)) {
2030+ case duplex_mode::TDD:
2031+ gnb_cfg.expert_phy_cfg .max_processing_delay_slots = 5 ;
2032+ break ;
2033+ case duplex_mode::FDD:
2034+ gnb_cfg.expert_phy_cfg .max_processing_delay_slots = 2 ;
2035+ break ;
2036+ default :
2037+ break ;
2038+ }
2039+ }
2040+
19892041void srsran::configure_cli11_with_gnb_appconfig_schema (CLI::App& app, gnb_appconfig& gnb_cfg)
19902042{
19912043 app.add_option (" --gnb_id" , gnb_cfg.gnb_id , " gNodeB identifier" )->capture_default_str ();
@@ -2018,6 +2070,10 @@ void srsran::configure_cli11_with_gnb_appconfig_schema(CLI::App& app, gnb_appcon
20182070 CLI::App* cu_cp_subcmd = app.add_subcommand (" cu_cp" , " CU-CP parameters" )->configurable ();
20192071 configure_cli11_cu_cp_args (*cu_cp_subcmd, gnb_cfg.cu_cp_cfg );
20202072
2073+ // CU-UP section
2074+ CLI::App* cu_up_subcmd = app.add_subcommand (" cu_up" , " CU-CP parameters" )->configurable ();
2075+ configure_cli11_cu_up_args (*cu_up_subcmd, gnb_cfg.cu_up_cfg );
2076+
20212077 // NOTE: CLI11 needs that the life of the variable lasts longer than the call of this function. As both options need
20222078 // to be added and a variant is used to store the Radio Unit configuration, the configuration is parsed in a helper
20232079 // variable, but as it is requested later, the variable needs to be static.
@@ -2121,5 +2177,7 @@ void srsran::configure_cli11_with_gnb_appconfig_schema(CLI::App& app, gnb_appcon
21212177 app.callback ([&]() {
21222178 manage_ru_variant (app, gnb_cfg, sdr_cfg, ofh_cfg);
21232179 manage_hal_optional (app, gnb_cfg);
2180+ manage_expert_execution_threads (app, gnb_cfg);
2181+ manage_processing_delay (app, gnb_cfg);
21242182 });
21252183}
0 commit comments