Skip to content

Commit 7ad6890

Browse files
AlaiaLcodebot
authored andcommitted
ofh: removed the vector of executors for downlink as it uses a pool executor
1 parent 504aa3d commit 7ad6890

12 files changed

+67
-112
lines changed

apps/gnb/gnb.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ static void configure_ru_ofh_executors_and_notifiers(ru_ofh_configuration&
143143
sector_deps.logger = dependencies.logger;
144144
sector_deps.receiver_executor = workers.ru_rx_exec[i];
145145
sector_deps.transmitter_executor = workers.ru_tx_exec[i];
146-
sector_deps.downlink_executors = workers.ru_dl_exec[i];
146+
sector_deps.downlink_executor = workers.ru_dl_exec[i];
147147
}
148148
}
149149

apps/gnb/gnb_worker_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ void worker_manager::create_ofh_executors(span<const cell_appconfig> cells, bool
404404
cpu_masks.push_back(affinity_mng.calcute_affinity_mask(gnb_sched_affinity_mask_types::ru));
405405
}
406406
create_worker_pool(name, nof_ofh_dl_workers, task_worker_queue_size, {{exec_name}}, prio, cpu_masks);
407-
ru_dl_exec[i].push_back(exec_mng.executors().at(exec_name));
407+
ru_dl_exec[i] = exec_mng.executors().at(exec_name);
408408
}
409409

410410
// Executor for Open Fronthaul messages transmission.

apps/gnb/gnb_worker_manager.h

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -38,29 +38,29 @@ struct worker_manager {
3838
/// - e1ap_cu_cp::handle_message calls cu-cp ctrl exec
3939
/// - e1ap_cu_up::handle_message calls cu-up ue exec
4040

41-
task_executor* cu_cp_exec = nullptr;
42-
task_executor* cu_up_ctrl_exec = nullptr; ///< CU-UP executor for control
43-
task_executor* cu_up_dl_exec = nullptr; ///< CU-UP executor for DL data flow
44-
task_executor* cu_up_ul_exec = nullptr; ///< CU-UP executor for UL data flow
45-
std::vector<task_executor*> lower_phy_tx_exec;
46-
std::vector<task_executor*> lower_phy_rx_exec;
47-
std::vector<task_executor*> lower_phy_dl_exec;
48-
std::vector<task_executor*> lower_phy_ul_exec;
49-
std::vector<task_executor*> lower_prach_exec;
50-
std::vector<task_executor*> upper_pusch_exec;
51-
std::vector<task_executor*> upper_pusch_decoder_exec;
52-
std::vector<task_executor*> upper_pucch_exec;
53-
std::vector<task_executor*> upper_prach_exec;
54-
std::vector<task_executor*> upper_pdsch_exec;
55-
task_executor* radio_exec = nullptr;
56-
task_executor* ru_printer_exec = nullptr;
57-
task_executor* ru_timing_exec = nullptr;
58-
std::vector<std::vector<task_executor*>> ru_dl_exec;
59-
std::vector<task_executor*> ru_tx_exec;
60-
std::vector<task_executor*> ru_rx_exec;
61-
task_executor* cu_cp_e2_exec = nullptr;
62-
task_executor* cu_up_e2_exec = nullptr;
63-
task_executor* metrics_hub_exec = nullptr;
41+
task_executor* cu_cp_exec = nullptr;
42+
task_executor* cu_up_ctrl_exec = nullptr; ///< CU-UP executor for control
43+
task_executor* cu_up_dl_exec = nullptr; ///< CU-UP executor for DL data flow
44+
task_executor* cu_up_ul_exec = nullptr; ///< CU-UP executor for UL data flow
45+
std::vector<task_executor*> lower_phy_tx_exec;
46+
std::vector<task_executor*> lower_phy_rx_exec;
47+
std::vector<task_executor*> lower_phy_dl_exec;
48+
std::vector<task_executor*> lower_phy_ul_exec;
49+
std::vector<task_executor*> lower_prach_exec;
50+
std::vector<task_executor*> upper_pusch_exec;
51+
std::vector<task_executor*> upper_pusch_decoder_exec;
52+
std::vector<task_executor*> upper_pucch_exec;
53+
std::vector<task_executor*> upper_prach_exec;
54+
std::vector<task_executor*> upper_pdsch_exec;
55+
task_executor* radio_exec = nullptr;
56+
task_executor* ru_printer_exec = nullptr;
57+
task_executor* ru_timing_exec = nullptr;
58+
std::vector<task_executor*> ru_dl_exec;
59+
std::vector<task_executor*> ru_tx_exec;
60+
std::vector<task_executor*> ru_rx_exec;
61+
task_executor* cu_cp_e2_exec = nullptr;
62+
task_executor* cu_up_e2_exec = nullptr;
63+
task_executor* metrics_hub_exec = nullptr;
6464

6565
std::unique_ptr<cu_up_executor_pool> cu_up_exec_mapper;
6666

include/srsran/ofh/ofh_sector_config.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ struct sector_configuration {
106106
struct sector_dependencies {
107107
/// Logger.
108108
srslog::basic_logger* logger = nullptr;
109-
/// Downlink task executors.
110-
std::vector<task_executor*> downlink_executors;
109+
/// Downlink task executor.
110+
task_executor* downlink_executor;
111111
/// Transmitter task executor.
112112
task_executor* transmitter_executor = nullptr;
113113
/// Receiver task executor.

include/srsran/ru/ru_ofh_configuration.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ struct ru_ofh_configuration {
110110
struct ru_ofh_sector_dependencies {
111111
/// Logger.
112112
srslog::basic_logger* logger = nullptr;
113-
/// Downlink task executors.
114-
std::vector<task_executor*> downlink_executors;
113+
/// Downlink task executor.
114+
task_executor* downlink_executor;
115115
/// Receiver task executor.
116116
task_executor* receiver_executor = nullptr;
117117
/// Transmitter task executor.

lib/ofh/ofh_factories.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ std::unique_ptr<sector> srsran::ofh::create_ofh_sector(const sector_configuratio
106106
auto transmitter = create_transmitter(tx_config,
107107
*sector_deps.logger,
108108
*sector_deps.transmitter_executor,
109-
sector_deps.downlink_executors,
109+
*sector_deps.downlink_executor,
110110
std::move(sector_deps.eth_gateway),
111111
prach_repo,
112112
slot_repo,

lib/ofh/transmitter/ofh_data_flow_cplane_scheduling_commands_task_dispatcher.h

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -18,38 +18,21 @@
1818
namespace srsran {
1919
namespace ofh {
2020

21-
/// Open Fronthaul Control-Plane scheduling and beamforming commands data flow task dispatcher implementation entry.
22-
struct data_flow_cplane_downlink_task_dispatcher_entry {
23-
data_flow_cplane_downlink_task_dispatcher_entry(
24-
std::unique_ptr<data_flow_cplane_scheduling_commands> data_flow_cplane_,
25-
task_executor& executor_) :
26-
data_flow_cplane(std::move(data_flow_cplane_)), executor(executor_)
27-
{
28-
srsran_assert(data_flow_cplane, "Invalid data flow");
29-
}
30-
31-
std::unique_ptr<data_flow_cplane_scheduling_commands> data_flow_cplane;
32-
task_executor& executor;
33-
};
34-
3521
/// Open Fronthaul Control-Plane scheduling and beamforming commands data flow task dispatcher implementation.
3622
class data_flow_cplane_downlink_task_dispatcher : public data_flow_cplane_scheduling_commands
3723
{
3824
public:
39-
data_flow_cplane_downlink_task_dispatcher(std::vector<data_flow_cplane_downlink_task_dispatcher_entry>&& config_) :
40-
dispatchers(std::move(config_))
25+
data_flow_cplane_downlink_task_dispatcher(std::unique_ptr<data_flow_cplane_scheduling_commands> data_flow_cplane_,
26+
task_executor& executor_) :
27+
data_flow_cplane(std::move(data_flow_cplane_)), executor(executor_)
4128
{
29+
srsran_assert(data_flow_cplane, "Invalid data flow");
4230
}
4331

4432
// See interface for documentation.
4533
void enqueue_section_type_1_message(const data_flow_cplane_type_1_context& context) override
4634
{
47-
unsigned index = last_used++ % dispatchers.size();
48-
data_flow_cplane_downlink_task_dispatcher_entry& dispatcher = dispatchers[index];
49-
data_flow_cplane_scheduling_commands& data_flow_cplane = *dispatcher.data_flow_cplane;
50-
51-
if (not dispatcher.executor.execute(
52-
[&data_flow_cplane, context]() { data_flow_cplane.enqueue_section_type_1_message(context); })) {
35+
if (!executor.execute([this, context]() { data_flow_cplane->enqueue_section_type_1_message(context); })) {
5336
srslog::fetch_basic_logger("OFH").warning("Failed to dispatch Control-Plane type 1 message for slot={}",
5437
context.slot);
5538
}
@@ -58,20 +41,15 @@ class data_flow_cplane_downlink_task_dispatcher : public data_flow_cplane_schedu
5841
// See interface for documentation.
5942
void enqueue_section_type_3_prach_message(const data_flow_cplane_scheduling_prach_context& context) override
6043
{
61-
unsigned index = last_used++ % dispatchers.size();
62-
data_flow_cplane_downlink_task_dispatcher_entry& dispatcher = dispatchers[index];
63-
data_flow_cplane_scheduling_commands& data_flow_cplane = *dispatcher.data_flow_cplane;
64-
65-
if (not dispatcher.executor.execute(
66-
[&data_flow_cplane, context]() { data_flow_cplane.enqueue_section_type_3_prach_message(context); })) {
44+
if (!executor.execute([this, context]() { data_flow_cplane->enqueue_section_type_3_prach_message(context); })) {
6745
srslog::fetch_basic_logger("OFH").warning("Failed to dispatch Control-Plane type 3 message for slot={}",
6846
context.slot);
6947
}
7048
}
7149

7250
private:
73-
std::atomic<unsigned> last_used{0};
74-
std::vector<data_flow_cplane_downlink_task_dispatcher_entry> dispatchers;
51+
std::unique_ptr<data_flow_cplane_scheduling_commands> data_flow_cplane;
52+
task_executor& executor;
7553
};
7654

7755
} // namespace ofh

lib/ofh/transmitter/ofh_data_flow_uplane_downlink_task_dispatcher.h

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,46 +17,31 @@
1717
namespace srsran {
1818
namespace ofh {
1919

20-
/// Open Fronthaul User-Plane downlink data flow task dispatcher entry.
21-
struct data_flow_uplane_downlink_task_dispatcher_entry {
22-
data_flow_uplane_downlink_task_dispatcher_entry(std::unique_ptr<data_flow_uplane_downlink_data> data_flow_uplane_,
23-
task_executor& executor_) :
24-
data_flow_uplane(std::move(data_flow_uplane_)), executor(executor_)
25-
{
26-
srsran_assert(data_flow_uplane, "Invalid data flow");
27-
}
28-
29-
std::unique_ptr<data_flow_uplane_downlink_data> data_flow_uplane;
30-
task_executor& executor;
31-
};
32-
3320
/// Open Fronthaul User-Plane downlink data flow task dispatcher implementation.
3421
class data_flow_uplane_downlink_task_dispatcher : public data_flow_uplane_downlink_data
3522
{
3623
public:
37-
data_flow_uplane_downlink_task_dispatcher(std::vector<data_flow_uplane_downlink_task_dispatcher_entry>&& config_) :
38-
dispatchers(std::move(config_))
24+
data_flow_uplane_downlink_task_dispatcher(std::unique_ptr<data_flow_uplane_downlink_data> data_flow_uplane_,
25+
task_executor& executor_) :
26+
data_flow_uplane(std::move(data_flow_uplane_)), executor(executor_)
3927
{
28+
srsran_assert(data_flow_uplane, "Invalid data flow");
4029
}
4130

4231
// See interface for documentation.
4332
void enqueue_section_type_1_message(const data_flow_uplane_resource_grid_context& context,
4433
const resource_grid_reader& grid) override
4534
{
46-
unsigned index = context.port % dispatchers.size();
47-
data_flow_uplane_downlink_task_dispatcher_entry& dispatcher = dispatchers[index];
48-
data_flow_uplane_downlink_data& data_flow_uplane = *dispatcher.data_flow_uplane;
49-
50-
if (not dispatcher.executor.execute([&data_flow_uplane, context, &grid]() {
51-
data_flow_uplane.enqueue_section_type_1_message(context, grid);
52-
})) {
35+
if (!executor.execute(
36+
[this, context, &grid]() { data_flow_uplane->enqueue_section_type_1_message(context, grid); })) {
5337
srslog::fetch_basic_logger("OFH").warning(
5438
"Failed to dispatch message in the downlink data flow User-Plane for slot={}", context.slot);
5539
}
5640
}
5741

5842
private:
59-
std::vector<data_flow_uplane_downlink_task_dispatcher_entry> dispatchers;
43+
std::unique_ptr<data_flow_uplane_downlink_data> data_flow_uplane;
44+
task_executor& executor;
6045
};
6146

6247
} // namespace ofh

lib/ofh/transmitter/ofh_transmitter_factories.cpp

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -103,20 +103,12 @@ create_downlink_manager(const transmitter_config& tx_con
103103
srslog::basic_logger& logger,
104104
std::shared_ptr<ether::eth_frame_pool> frame_pool,
105105
std::shared_ptr<uplink_cplane_context_repository> ul_cp_context_repo,
106-
const std::vector<task_executor*>& executors)
106+
task_executor& executor)
107107
{
108-
std::vector<data_flow_uplane_downlink_task_dispatcher_entry> df_uplane_task_dispatcher_cfg;
109-
std::vector<data_flow_cplane_downlink_task_dispatcher_entry> df_cplane_task_dispatcher_cfg;
110-
for (auto* executor : executors) {
111-
df_cplane_task_dispatcher_cfg.emplace_back(
112-
create_data_flow_cplane_sched(tx_config, logger, frame_pool, ul_cp_context_repo), *executor);
113-
df_uplane_task_dispatcher_cfg.emplace_back(create_data_flow_uplane_data(tx_config, logger, frame_pool), *executor);
114-
}
115-
116-
auto data_flow_cplane =
117-
std::make_unique<data_flow_cplane_downlink_task_dispatcher>(std::move(df_cplane_task_dispatcher_cfg));
118-
auto data_flow_uplane =
119-
std::make_unique<data_flow_uplane_downlink_task_dispatcher>(std::move(df_uplane_task_dispatcher_cfg));
108+
auto data_flow_cplane = std::make_unique<data_flow_cplane_downlink_task_dispatcher>(
109+
create_data_flow_cplane_sched(tx_config, logger, frame_pool, ul_cp_context_repo), executor);
110+
auto data_flow_uplane = std::make_unique<data_flow_uplane_downlink_task_dispatcher>(
111+
create_data_flow_uplane_data(tx_config, logger, frame_pool), executor);
120112

121113
if (tx_config.downlink_broadcast) {
122114
downlink_handler_broadcast_impl_config dl_config;
@@ -210,7 +202,7 @@ static transmitter_impl_dependencies
210202
resolve_transmitter_dependencies(const transmitter_config& tx_config,
211203
srslog::basic_logger& logger,
212204
task_executor& tx_executor,
213-
const std::vector<task_executor*>& downlink_executors,
205+
task_executor& downlink_executor,
214206
std::unique_ptr<ether::gateway> eth_gateway,
215207
std::shared_ptr<prach_context_repository> prach_context_repo,
216208
std::shared_ptr<uplink_context_repository> ul_slot_context_repo,
@@ -224,12 +216,12 @@ resolve_transmitter_dependencies(const transmitter_config&
224216
auto frame_pool = create_eth_frame_pool(tx_config, logger);
225217

226218
dependencies.dl_manager =
227-
create_downlink_manager(tx_config, logger, frame_pool, ul_cp_context_repo, downlink_executors);
219+
create_downlink_manager(tx_config, logger, frame_pool, ul_cp_context_repo, downlink_executor);
228220

229221
dependencies.ul_request_handler = std::make_unique<uplink_request_handler_task_dispatcher>(
230222
create_uplink_request_handler(
231223
tx_config, logger, frame_pool, prach_context_repo, ul_slot_context_repo, ul_cp_context_repo),
232-
*downlink_executors.front());
224+
downlink_executor);
233225

234226
ether::gw_config eth_cfg;
235227
eth_cfg.interface = tx_config.interface;
@@ -259,7 +251,7 @@ std::unique_ptr<transmitter>
259251
srsran::ofh::create_transmitter(const transmitter_config& transmitter_cfg,
260252
srslog::basic_logger& logger,
261253
task_executor& tx_executor,
262-
const std::vector<task_executor*>& downlink_executors,
254+
task_executor& downlink_executor,
263255
std::unique_ptr<ether::gateway> eth_gateway,
264256
std::shared_ptr<prach_context_repository> prach_context_repo,
265257
std::shared_ptr<uplink_context_repository> ul_slot_context_repo,
@@ -269,7 +261,7 @@ srsran::ofh::create_transmitter(const transmitter_config&
269261
resolve_transmitter_dependencies(transmitter_cfg,
270262
logger,
271263
tx_executor,
272-
downlink_executors,
264+
downlink_executor,
273265
std::move(eth_gateway),
274266
prach_context_repo,
275267
ul_slot_context_repo,

lib/ofh/transmitter/ofh_transmitter_factories.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace ofh {
3030
std::unique_ptr<transmitter> create_transmitter(const transmitter_config& transmitter_cfg,
3131
srslog::basic_logger& logger,
3232
task_executor& tx_executor,
33-
const std::vector<task_executor*>& downlink_executors,
33+
task_executor& downlink_executor,
3434
std::unique_ptr<ether::gateway> eth_gateway,
3535
std::shared_ptr<prach_context_repository> prach_context_repo,
3636
std::shared_ptr<uplink_context_repository> ul_slot_context_repo,

0 commit comments

Comments
 (0)