Skip to content

Commit 99b73d8

Browse files
committed
cu_up,f1u: added stop flag to CU F1-U bearer
1 parent c85172b commit 99b73d8

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

lib/f1u/cu_up/f1u_bearer_impl.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ void f1u_bearer_impl::handle_pdu(nru_ul_message msg)
5555

5656
void f1u_bearer_impl::handle_pdu_impl(nru_ul_message msg)
5757
{
58+
if (stopped) {
59+
return;
60+
}
5861
logger.log_debug("F1-U bearer received PDU");
5962

6063
// handle T-PDU
@@ -124,6 +127,10 @@ void f1u_bearer_impl::handle_pdu_impl(nru_ul_message msg)
124127

125128
void f1u_bearer_impl::handle_sdu(byte_buffer sdu, bool is_retx)
126129
{
130+
if (stopped) {
131+
return;
132+
}
133+
127134
logger.log_debug("F1-U bearer received SDU. size={} is_retx={}", sdu.length(), is_retx);
128135
nru_dl_message msg = {};
129136

@@ -186,6 +193,9 @@ void f1u_bearer_impl::fill_discard_blocks(nru_dl_message& msg)
186193

187194
void f1u_bearer_impl::on_expired_dl_notif_timer()
188195
{
196+
if (stopped) {
197+
return;
198+
}
189199
logger.log_debug("DL notification timer expired");
190200
flush_discard_blocks();
191201
}

lib/f1u/cu_up/f1u_bearer_impl.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,14 @@ class f1u_bearer_impl final : public f1u_bearer, public f1u_rx_pdu_handler, publ
4343
f1u_rx_pdu_handler& get_rx_pdu_handler() override { return *this; }
4444
f1u_tx_sdu_handler& get_tx_sdu_handler() override { return *this; }
4545

46-
void stop() override { dl_notif_timer.stop(); }
46+
void stop() override
47+
{
48+
if (stopped) {
49+
return;
50+
}
51+
stopped = true;
52+
dl_notif_timer.stop();
53+
}
4754

4855
void handle_pdu(nru_ul_message msg) override;
4956
void handle_sdu(byte_buffer sdu, bool is_retx) override;
@@ -73,6 +80,8 @@ class f1u_bearer_impl final : public f1u_bearer, public f1u_rx_pdu_handler, publ
7380
task_executor& dl_exec;
7481
task_executor& ul_exec;
7582

83+
bool stopped = false;
84+
7685
/// Sentinel value representing a not-yet set PDCP SN
7786
static constexpr uint32_t unset_pdcp_sn = UINT32_MAX;
7887

0 commit comments

Comments
 (0)