Skip to content

Commit e516b8d

Browse files
committed
ofh: notify upper phy when the uplink request is late
1 parent d23cc13 commit e516b8d

28 files changed

+311
-169
lines changed

apps/units/flexible_o_du/split_7_2/helpers/ru_ofh_config.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ struct ru_ofh_unit_config {
154154
int gps_Beta = 0;
155155
/// Downlink processing time in microseconds.
156156
unsigned dl_processing_time = 400U;
157+
/// Uplink request processing time in microseconds.
158+
unsigned ul_processing_time = 30U;
157159
/// Loggers.
158160
ru_ofh_unit_logger_config loggers;
159161
/// \brief Individual Open Fronthaul cells configurations.

apps/units/flexible_o_du/split_7_2/helpers/ru_ofh_config_translator.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ static void generate_config(ru_ofh_configuration& out_cfg,
8181
sector_cfg.sector_id = i;
8282
sector_cfg.max_processing_delay_slots = max_processing_delay_slots;
8383
sector_cfg.dl_processing_time = std::chrono::microseconds(ru_cfg.dl_processing_time);
84+
sector_cfg.ul_processing_time = std::chrono::microseconds(ru_cfg.ul_processing_time);
8485
sector_cfg.uses_dpdk = ru_cfg.hal_config.has_value();
8586
sector_cfg.interface = cell_cfg.network_interface;
8687
sector_cfg.is_promiscuous_mode_enabled = cell_cfg.enable_promiscuous_mode;

include/srsran/ofh/ofh_error_notifier.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ class error_notifier
3333
///
3434
/// \param[in] context Context of the error.
3535
virtual void on_late_downlink_message(const error_context& context) = 0;
36+
37+
/// \brief Notifies a late uplink message.
38+
///
39+
/// \param[in] context Context of the error.
40+
virtual void on_late_uplink_message(const error_context& context) = 0;
3641
};
3742

3843
} // namespace ofh

include/srsran/ofh/ofh_sector_config.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ struct sector_configuration {
107107
unsigned max_processing_delay_slots;
108108
/// Downlink processing time in microseconds.
109109
std::chrono::microseconds dl_processing_time;
110+
/// Uplink request processing time in microseconds.
111+
std::chrono::microseconds ul_processing_time;
110112
/// Number of reception antennas.
111113
unsigned nof_antennas_ul;
112114

include/srsran/ofh/transmitter/ofh_transmitter_configuration.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ struct transmitter_config {
8080
float iq_scaling;
8181
/// Downlink processing time in microseconds.
8282
std::chrono::microseconds dl_processing_time;
83+
/// Uplink request processing time in microseconds.
84+
std::chrono::microseconds ul_processing_time;
8385
/// Optional TDD configuration.
8486
std::optional<tdd_ul_dl_config_common> tdd_config;
8587
/// Indicates if DPDK should be used by the underlying implementation.

include/srsran/ofh/transmitter/ofh_uplink_request_handler.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ class shared_resource_grid;
1919

2020
namespace ofh {
2121

22+
class error_notifier;
23+
2224
/// \brief Open Fronthaul uplink request handler.
2325
///
2426
/// Handles PRACH and uplink data requests to capture uplink data. The uplink received data will be notified through the
@@ -44,6 +46,9 @@ class uplink_request_handler
4446
/// \param[in] context Resource grid context.
4547
/// \param[in] buffer Resource grid to store the processed slot.
4648
virtual void handle_new_uplink_slot(const resource_grid_context& context, const shared_resource_grid& grid) = 0;
49+
50+
/// Sets the error notifier of this sector to the given one.
51+
virtual void set_error_notifier(error_notifier& notifier) = 0;
4752
};
4853

4954
} // namespace ofh

lib/ofh/ethernet/dpdk/dpdk_ethernet_receiver.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ static dummy_frame_notifier dummy_notifier;
3737
dpdk_receiver_impl::dpdk_receiver_impl(task_executor& executor_,
3838
std::shared_ptr<dpdk_port_context> port_ctx_,
3939
srslog::basic_logger& logger_) :
40-
logger(logger_), executor(executor_), notifier(dummy_notifier), port_ctx(std::move(port_ctx_))
40+
logger(logger_), executor(executor_), notifier(&dummy_notifier), port_ctx(std::move(port_ctx_))
4141
{
4242
srsran_assert(port_ctx, "Invalid port context");
4343
}
4444

4545
void dpdk_receiver_impl::start(frame_notifier& notifier_)
4646
{
47-
notifier = std::ref(notifier_);
47+
notifier = &notifier_;
4848

4949
std::promise<void> p;
5050
std::future<void> fut = p.get_future();
@@ -105,7 +105,7 @@ void dpdk_receiver_impl::receive()
105105

106106
for (auto* mbuf : span<::rte_mbuf*>(mbufs.data(), num_frames)) {
107107
::rte_vlan_strip(mbuf);
108-
notifier.get().on_new_frame(unique_rx_buffer(dpdk_rx_buffer_impl(mbuf)));
108+
notifier->on_new_frame(unique_rx_buffer(dpdk_rx_buffer_impl(mbuf)));
109109
}
110110
ofh_tracer << trace_event("ofh_dpdk_rx", dpdk_rx_tp);
111111
}

lib/ofh/ethernet/dpdk/dpdk_ethernet_receiver.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ class dpdk_receiver_impl : public receiver
4747
void receive();
4848

4949
private:
50-
srslog::basic_logger& logger;
51-
task_executor& executor;
52-
std::reference_wrapper<frame_notifier> notifier;
53-
std::shared_ptr<dpdk_port_context> port_ctx;
54-
std::atomic<receiver_status> rx_status{receiver_status::running};
50+
srslog::basic_logger& logger;
51+
task_executor& executor;
52+
frame_notifier* notifier;
53+
std::shared_ptr<dpdk_port_context> port_ctx;
54+
std::atomic<receiver_status> rx_status{receiver_status::running};
5555
};
5656

5757
} // namespace ether

lib/ofh/ethernet/ethernet_receiver_impl.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ receiver_impl::receiver_impl(const std::string& interface,
4444
bool is_promiscuous_mode_enabled,
4545
task_executor& executor_,
4646
srslog::basic_logger& logger_) :
47-
logger(logger_), executor(executor_), notifier(dummy_notifier), buffer_pool(BUFFER_SIZE)
47+
logger(logger_), executor(executor_), notifier(&dummy_notifier), buffer_pool(BUFFER_SIZE)
4848
{
4949
socket_fd = ::socket(AF_PACKET, SOCK_RAW, htons(ECPRI_ETH_TYPE));
5050
if (socket_fd < 0) {
@@ -86,7 +86,7 @@ void receiver_impl::start(frame_notifier& notifier_)
8686
{
8787
logger.info("Starting the ethernet frame receiver");
8888

89-
notifier = std::ref(notifier_);
89+
notifier = &notifier_;
9090

9191
std::promise<void> p;
9292
std::future<void> fut = p.get_future();
@@ -167,6 +167,6 @@ void receiver_impl::receive()
167167
}
168168
buffer.resize(nof_bytes);
169169

170-
notifier.get().on_new_frame(unique_rx_buffer(std::move(buffer)));
170+
notifier->on_new_frame(unique_rx_buffer(std::move(buffer)));
171171
ofh_tracer << trace_event("ofh_receiver", tp);
172172
}

lib/ofh/ethernet/ethernet_receiver_impl.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ class receiver_impl : public receiver
5050
void receive();
5151

5252
private:
53-
srslog::basic_logger& logger;
54-
task_executor& executor;
55-
std::reference_wrapper<frame_notifier> notifier;
56-
int socket_fd = -1;
57-
std::atomic<receiver_status> rx_status{receiver_status::running};
58-
ethernet_rx_buffer_pool buffer_pool;
53+
srslog::basic_logger& logger;
54+
task_executor& executor;
55+
frame_notifier* notifier;
56+
int socket_fd = -1;
57+
std::atomic<receiver_status> rx_status{receiver_status::running};
58+
ethernet_rx_buffer_pool buffer_pool;
5959
};
6060

6161
} // namespace ether

0 commit comments

Comments
 (0)