Skip to content

Commit dabcecf

Browse files
robertfalkenbergcodebot
authored andcommitted
gnb: configurable number of non real time threads
1 parent 75e1680 commit dabcecf

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

apps/gnb/gnb_appconfig.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,6 +1093,12 @@ struct cpu_affinities_appconfig {
10931093
gnb_sched_affinity_mask_policy::mask};
10941094
};
10951095

1096+
/// Non real time thread configuration for the gNB.
1097+
struct non_rt_threads_appconfig {
1098+
/// Number of non real time threads for processing of CP and UP data in the upper layers
1099+
unsigned nof_non_rt_threads = 4;
1100+
};
1101+
10961102
/// Upper PHY thread configuration for the gNB.
10971103
struct upper_phy_threads_appconfig {
10981104
/// \brief PDSCH processor type.
@@ -1163,6 +1169,8 @@ struct expert_threads_appconfig {
11631169
}
11641170
}
11651171

1172+
/// Non real time thread configuration of the gNB app.
1173+
non_rt_threads_appconfig non_rt_threads;
11661174
/// Upper PHY thread configuration of the gNB app.
11671175
upper_phy_threads_appconfig upper_threads;
11681176
/// Lower PHY thread configuration of the gNB app.

apps/gnb/gnb_appconfig_cli11_schema.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2061,6 +2061,15 @@ static void configure_cli11_cell_affinity_args(CLI::App& app, cpu_affinities_cel
20612061
"Policy used for assigning CPU cores to the Radio Unit tasks");
20622062
}
20632063

2064+
static void configure_cli11_non_rt_threads_args(CLI::App& app, non_rt_threads_appconfig& config)
2065+
{
2066+
app.add_option("--nof_non_rt_threads",
2067+
config.nof_non_rt_threads,
2068+
"Number of non real time threads for processing of CP and UP data in upper layers.")
2069+
->capture_default_str()
2070+
->check(CLI::Number);
2071+
}
2072+
20642073
static void configure_cli11_upper_phy_threads_args(CLI::App& app, upper_phy_threads_appconfig& config)
20652074
{
20662075
auto pdsch_processor_check = [](const std::string& value) -> std::string {
@@ -2163,6 +2172,11 @@ static void configure_cli11_expert_execution_args(CLI::App& app, expert_executio
21632172
// Threads section.
21642173
CLI::App* threads_subcmd = app.add_subcommand("threads", "Threads configuration")->configurable();
21652174

2175+
// Non real time threads.
2176+
CLI::App* non_rt_threads_subcmd =
2177+
threads_subcmd->add_subcommand("non_rt", "Non real time thread configuration")->configurable();
2178+
configure_cli11_non_rt_threads_args(*non_rt_threads_subcmd, config.threads.non_rt_threads);
2179+
21662180
// Upper PHY threads.
21672181
CLI::App* upper_phy_threads_subcmd =
21682182
threads_subcmd->add_subcommand("upper_phy", "Upper PHY thread configuration")->configurable();

apps/gnb/gnb_worker_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ void worker_manager::create_du_cu_executors(const gnb_appconfig& appcfg)
101101
// Configure non-RT worker pool.
102102
worker_pool non_rt_pool{
103103
"non_rt_pool",
104-
std::max(3U, (unsigned)appcfg.expert_execution_cfg.affinities.low_priority_cpu_cfg.mask.count()),
104+
appcfg.expert_execution_cfg.threads.non_rt_threads.nof_non_rt_threads,
105105
{{concurrent_queue_policy::lockfree_mpmc, task_worker_queue_size}, // two task priority levels.
106106
{concurrent_queue_policy::lockfree_mpmc, task_worker_queue_size}},
107107
{{"low_prio_exec", task_priority::max - 1}, // used for pcap writing.

0 commit comments

Comments
 (0)