Skip to content

Commit be81e3d

Browse files
frankistcodebot
authored andcommitted
du_manager: change RLF timer depending on whether the UE has a context or not
1 parent 8c2cc27 commit be81e3d

File tree

3 files changed

+33
-12
lines changed

3 files changed

+33
-12
lines changed

lib/du_manager/du_ue/du_ue.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ class du_ue_rlf_handler : public mac_ue_radio_link_notifier, public rlc_tx_upper
2424
public:
2525
~du_ue_rlf_handler() = default;
2626

27+
/// \brief Notify that the UE has now an SRB2 and DRB configured, so we need to account for its potential RRC
28+
/// reestablishment.
29+
virtual void on_drb_and_srb2_configured() = 0;
30+
31+
/// \brief Notify the RLF handler to stop listening to new RLF triggers.
2732
virtual void disconnect() = 0;
2833
};
2934

@@ -52,7 +57,6 @@ struct du_ue {
5257

5358
du_ue_bearer_manager bearers;
5459
ue_ran_resource_configurator resources;
55-
unique_timer rlf_timer;
5660
bool reestablishment_pending = false;
5761
};
5862

lib/du_manager/procedures/ue_configuration_procedure.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,9 @@ f1ap_ue_context_update_response ue_configuration_procedure::make_ue_config_respo
295295
srsran_assert(code == asn1::SRSASN_SUCCESS, "Invalid cellGroupConfig");
296296
}
297297

298+
// Update the RLF timeout to account for potential RRC Reestablishments, now that the UE has a context.
299+
ue->rlf_notifier->on_drb_and_srb2_configured();
300+
298301
return resp;
299302
}
300303

lib/du_manager/procedures/ue_creation_procedure.cpp

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,18 @@ class du_ue_rlf_notification_adapter final : public du_ue_rlf_handler
2525
{
2626
public:
2727
du_ue_rlf_notification_adapter(du_ue_index_t ue_index_,
28-
std::chrono::milliseconds release_timeout_,
28+
std::chrono::milliseconds t310_,
29+
std::chrono::milliseconds t311_,
2930
unique_timer release_request_timer,
3031
du_ue_manager_repository& du_ue_mng_) :
3132
ue_index(ue_index_),
32-
release_timeout(release_timeout_),
33+
t310(t310_),
34+
t311(t311_),
3335
rel_timer(std::move(release_request_timer)),
3436
du_ue_mng(du_ue_mng_),
35-
logger(srslog::fetch_basic_logger("DU-MNG"))
37+
logger(srslog::fetch_basic_logger("DU-MNG")),
38+
// The release timeout is short at the start, while the UE cannot yet perform RRC Reestablishment.
39+
release_timeout(t310)
3640
{
3741
}
3842

@@ -60,6 +64,12 @@ class du_ue_rlf_notification_adapter final : public du_ue_rlf_handler
6064
void on_protocol_failure() override { start_rlf_timer(rlf_cause::rlc_protocol_failure); }
6165
void on_max_retx() override { start_rlf_timer(rlf_cause::max_rlc_retxs_reached); }
6266

67+
void on_drb_and_srb2_configured() override
68+
{
69+
// Now that the UE contains a context, we need to account for the t311 in the RLF timer.
70+
release_timeout = t310 + t311;
71+
}
72+
6373
private:
6474
void start_rlf_timer(rlf_cause cause)
6575
{
@@ -91,11 +101,18 @@ class du_ue_rlf_notification_adapter final : public du_ue_rlf_handler
91101
bool is_connected_nolock() const { return rel_timer.is_valid(); }
92102

93103
const du_ue_index_t ue_index;
94-
const std::chrono::milliseconds release_timeout;
104+
const std::chrono::milliseconds t310;
105+
const std::chrono::milliseconds t311;
95106
unique_timer rel_timer;
96107
du_ue_manager_repository& du_ue_mng;
97108
srslog::basic_logger& logger;
98109

110+
// Note: Between an RLF being detected and the UE being released, the DU manager will wait for enough time to allow
111+
// the UE to perform C-RNTI CE (t310) and/or RRC re-establishment (t311).
112+
// Note: When the UE is initially created, it does not yet have a SRB2+DRB configured, so we do not need to account
113+
// for the t311 in the RLF timer, as the UE won't try to do RRC re-establishment at that stage.
114+
std::chrono::milliseconds release_timeout;
115+
99116
// This class is accessed directly from the MAC, so potential race conditions apply when accessing the \c rel_timer.
100117
std::mutex timer_mutex;
101118
};
@@ -181,14 +198,11 @@ du_ue* ue_creation_procedure::create_du_ue_context()
181198
}
182199

183200
// Create the adapter used by the MAC and RLC to notify the DU manager of a Radio Link Failure.
184-
const du_cell_config& pcell_cfg = du_params.ran.cells[req.pcell_index];
185-
// Note: Between an RLF being detected and the UE being released, the DU manager will wait for enough time to allow
186-
// the UE to perform C-RNTI CE (t310) and RRC re-establishment (t311).
187-
std::chrono::milliseconds release_timeout =
188-
pcell_cfg.ue_timers_and_constants.t310 + pcell_cfg.ue_timers_and_constants.t311;
189-
auto rlf_notifier = std::make_unique<du_ue_rlf_notification_adapter>(
201+
const du_cell_config& pcell_cfg = du_params.ran.cells[req.pcell_index];
202+
auto rlf_notifier = std::make_unique<du_ue_rlf_notification_adapter>(
190203
req.ue_index,
191-
release_timeout,
204+
pcell_cfg.ue_timers_and_constants.t310,
205+
pcell_cfg.ue_timers_and_constants.t311,
192206
du_params.services.timers.create_unique_timer(du_params.services.du_mng_exec),
193207
ue_mng);
194208

0 commit comments

Comments
 (0)