Skip to content

Commit d5b684c

Browse files
robertfalkenbergcodebot
authored andcommitted
rlc,nru: notify "desired buffer size for DRB" according to TS 38.425
This value informs the CU of the amount of data per DRB to be sent beyond the highest delivered PDCP SN (AM) or highest transmitted PDCP SN (UM). It corresponds to the total capacity of the RLC queue (in bytes). TS 38.245 Sec. 5.4.2.1: (...) - If the value of the desired buffer size is 0, the hosting node shall stop sending any data per bearer. - If the value of the desired buffer size in b) above is greater than 0, the hosting node may send up to this amount of data per bearer beyond the "Highest Delivered NR PDCP SN" for RLC AM, or the hosting node may send up to this amount of data per bearer beyond the "Highest Transmitted NR PDCP SN" for RLM UM. (...)
1 parent 7ba23dc commit d5b684c

22 files changed

+98
-35
lines changed

include/srsran/f1ap/du/f1c_bearer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class f1c_tx_delivery_handler
4747
/// the lower layers (i.e. by the RLC).
4848
///
4949
/// \param highest_sn Highest transmitted PDCP PDU sequence number.
50-
virtual void handle_transmit_notification(uint32_t highest_pdcp_sn, uint32_t queue_free_bytes) = 0;
50+
virtual void handle_transmit_notification(uint32_t highest_pdcp_sn) = 0;
5151

5252
/// \brief Informs the F1-C bearer about the highest PDCP PDU sequence number that was successfully
5353
/// delivered in sequence towards the UE.

include/srsran/f1u/du/f1u_tx_delivery_handler.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,18 @@ class f1u_tx_delivery_handler
2727
///
2828
/// Notification must be performed in ascending order of PDCP sequence numbers. It is the responsibility of the
2929
/// calling function (i.e. the RLC) to prevent out-of-order notifications.
30+
/// The parameter \c desired_buf_size informs the CU of the amount of data per DRB to be sent beyond the
31+
/// highest delivered PDCP SN (AM) or highest transmitted PDCP SN (UM).
32+
/// This corresponds to the total capacity of the RLC queue (in bytes).
3033
///
3134
/// This function is quick and shall be called directly from pcell_executor to avoid excessive transitions across
3235
/// executors.
3336
///
3437
/// Safe execution from: pcell_executor
3538
///
3639
/// \param highest_pdcp_sn The highest transmitted PDCP sequence number
37-
virtual void handle_transmit_notification(uint32_t highest_pdcp_sn, uint32_t queue_free_bytes) = 0;
40+
/// \param desired_buf_size Desired buffer size for DRB
41+
virtual void handle_transmit_notification(uint32_t highest_pdcp_sn, uint32_t desired_buf_size) = 0;
3842

3943
/// \brief Handles a delivery notification from lower layers (i.e. from RLC AM).
4044
///

include/srsran/rlc/rlc_tx.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ class rlc_tx_upper_layer_data_notifier
8989
/// lower layers.
9090
///
9191
/// \param max_tx_pdcp_sn Highest transmitted PDCP PDU sequence number.
92-
virtual void on_transmitted_sdu(uint32_t max_tx_pdcp_sn, uint32_t bytes_free_in_queue) = 0;
92+
/// \param desired_buf_size Desired buffer size for DRB. Ignored for SRBs.
93+
virtual void on_transmitted_sdu(uint32_t max_tx_pdcp_sn, uint32_t desired_buf_size) = 0;
9394

9495
/// \brief Informs upper layer about the highest PDCP PDU sequence number of the PDCP PDU that was successfully
9596
/// delivered in sequence towards the UE.

lib/du/du_high/du_manager/du_ue/du_ue_adapters.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class null_sink_f1c_bearer : public f1c_bearer
2929
{
3030
return launch_no_op_task(true);
3131
}
32-
void handle_transmit_notification(uint32_t highest_pdcp_sn, uint32_t queue_bytes_free) override {}
32+
void handle_transmit_notification(uint32_t highest_pdcp_sn) override {}
3333
void handle_delivery_notification(uint32_t highest_pdcp_sn) override {}
3434
void handle_sdu(byte_buffer_chain sdu) override {}
3535
} null_f1c_bearer;
@@ -46,7 +46,7 @@ class null_sink_f1u_bearer : public f1u_bearer,
4646
f1u_tx_sdu_handler& get_tx_sdu_handler() override { return *this; }
4747

4848
void handle_pdu(nru_dl_message msg) override {}
49-
void handle_transmit_notification(uint32_t highest_pdcp_sn, uint32_t queue_bytes_free) override {}
49+
void handle_transmit_notification(uint32_t highest_pdcp_sn, uint32_t desired_buf_size) override {}
5050
void handle_delivery_notification(uint32_t highest_pdcp_sn) override {}
5151
void handle_retransmit_notification(uint32_t highest_pdcp_sn) override {}
5252
void handle_delivery_retransmitted_notification(uint32_t highest_pdcp_sn) override {}

lib/du/du_high/du_manager/du_ue/du_ue_adapters.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,11 @@ class rlc_f1c_tx_data_notifier : public rlc_tx_upper_layer_data_notifier
127127

128128
void disconnect();
129129

130-
void on_transmitted_sdu(uint32_t max_deliv_pdcp_sn, uint32_t queue_free_bytes) override
130+
void on_transmitted_sdu(uint32_t max_deliv_pdcp_sn, uint32_t desired_buf_size) override
131131
{
132132
f1c_bearer* b = bearer.load(std::memory_order_relaxed);
133133
srsran_assert(b != nullptr, "RLC to F1-C TX data notifier is disconnected");
134-
b->handle_transmit_notification(max_deliv_pdcp_sn, queue_free_bytes);
134+
b->handle_transmit_notification(max_deliv_pdcp_sn);
135135
}
136136

137137
void on_delivered_sdu(uint32_t max_deliv_pdcp_sn) override
@@ -166,11 +166,11 @@ class rlc_f1u_tx_data_notifier : public rlc_tx_upper_layer_data_notifier
166166

167167
void disconnect();
168168

169-
void on_transmitted_sdu(uint32_t max_deliv_pdcp_sn, uint32_t queue_free_bytes) override
169+
void on_transmitted_sdu(uint32_t max_deliv_pdcp_sn, uint32_t desired_buf_size) override
170170
{
171171
f1u_tx_delivery_handler* h = handler.load(std::memory_order_relaxed);
172172
srsran_assert(h != nullptr, "RLC to F1-U TX data notifier is disconnected");
173-
h->handle_transmit_notification(max_deliv_pdcp_sn, queue_free_bytes);
173+
h->handle_transmit_notification(max_deliv_pdcp_sn, desired_buf_size);
174174
}
175175

176176
void on_delivered_sdu(uint32_t max_deliv_pdcp_sn) override

lib/f1ap/du/ue_context/f1c_du_bearer_impl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ void f1c_srb0_du_bearer::handle_sdu(byte_buffer_chain sdu)
7878
}
7979
}
8080

81-
void f1c_srb0_du_bearer::handle_transmit_notification(uint32_t highest_pdcp_sn, uint32_t queue_free_bytes)
81+
void f1c_srb0_du_bearer::handle_transmit_notification(uint32_t highest_pdcp_sn)
8282
{
8383
report_fatal_error("Transmission notifications do not exist for SRB0");
8484
}
@@ -221,7 +221,7 @@ async_task<bool> f1c_other_srb_du_bearer::handle_pdu_and_await_delivery(byte_buf
221221
return handle_pdu_and_await(std::move(pdu), false, time_to_wait);
222222
}
223223

224-
void f1c_other_srb_du_bearer::handle_transmit_notification(uint32_t highest_pdcp_sn, uint32_t queue_free_bytes)
224+
void f1c_other_srb_du_bearer::handle_transmit_notification(uint32_t highest_pdcp_sn)
225225
{
226226
if (not ue_exec.defer([this, highest_pdcp_sn]() { handle_notification(highest_pdcp_sn, true); })) {
227227
logger.warning("Discarded transmit notification for SRB{} because the task executor queue is full.",

lib/f1ap/du/ue_context/f1c_du_bearer_impl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class f1c_srb0_du_bearer final : public f1c_bearer
4242
/// transfer message.
4343
void handle_sdu(byte_buffer_chain sdu) override;
4444

45-
void handle_transmit_notification(uint32_t highest_pdcp_sn, uint32_t queue_free_bytes) override;
45+
void handle_transmit_notification(uint32_t highest_pdcp_sn) override;
4646
void handle_delivery_notification(uint32_t highest_pdcp_sn) override;
4747

4848
void handle_pdu(byte_buffer pdu) override;
@@ -78,7 +78,7 @@ class f1c_other_srb_du_bearer final : public f1c_bearer
7878
/// \param[in] sdu The message to be encoded in the RRC container of the UL RRC message transfer message to transmit.
7979
void handle_sdu(byte_buffer_chain sdu) override;
8080

81-
void handle_transmit_notification(uint32_t highest_pdcp_sn, uint32_t queue_free_bytes) override;
81+
void handle_transmit_notification(uint32_t highest_pdcp_sn) override;
8282
void handle_delivery_notification(uint32_t highest_pdcp_sn) override;
8383

8484
void handle_pdu(byte_buffer sdu) override;

lib/f1u/du/f1u_bearer_impl.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,12 @@ void f1u_bearer_impl::handle_pdu_impl(nru_dl_message msg)
104104
}
105105
}
106106

107-
void f1u_bearer_impl::handle_transmit_notification(uint32_t highest_pdcp_sn, uint32_t queue_bytes_free)
107+
void f1u_bearer_impl::handle_transmit_notification(uint32_t highest_pdcp_sn, uint32_t desired_buf_size)
108108
{
109109
// This function may be called from pcell_executor, since it only writes to an atomic variable
110-
logger.log_debug(
111-
"Storing highest transmitted pdcp_sn={} and desired buffer size bs={}", highest_pdcp_sn, queue_bytes_free);
110+
logger.log_debug("Storing highest transmitted pdcp_sn={} and desired_buf_size={}", highest_pdcp_sn, desired_buf_size);
112111
highest_transmitted_pdcp_sn.store(highest_pdcp_sn, std::memory_order_relaxed);
113-
desired_buffer_size_for_data_radio_bearer.store(queue_bytes_free, std::memory_order_relaxed);
112+
desired_buffer_size_for_data_radio_bearer.store(desired_buf_size, std::memory_order_relaxed);
114113
}
115114

116115
void f1u_bearer_impl::handle_delivery_notification(uint32_t highest_pdcp_sn)

lib/f1u/du/f1u_bearer_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class f1u_bearer_impl final : public f1u_bearer,
4444
f1u_rx_pdu_handler& get_rx_pdu_handler() override { return *this; }
4545

4646
void handle_sdu(byte_buffer_chain sdu) override;
47-
void handle_transmit_notification(uint32_t highest_pdcp_sn, uint32_t queue_bytes_free) override;
47+
void handle_transmit_notification(uint32_t highest_pdcp_sn, uint32_t desired_buf_size) override;
4848
void handle_delivery_notification(uint32_t highest_pdcp_sn) override;
4949
void handle_retransmit_notification(uint32_t highest_pdcp_sn) override;
5050
void handle_delivery_retransmitted_notification(uint32_t highest_pdcp_sn) override;

lib/rlc/rlc_tx_am_entity.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,13 @@ size_t rlc_tx_am_entity::build_new_pdu(span<uint8_t> rlc_pdu_buf)
263263
if (sdu.is_retx) {
264264
upper_dn.on_retransmitted_sdu(sdu.pdcp_sn.value());
265265
} else {
266-
upper_dn.on_transmitted_sdu(sdu.pdcp_sn.value(), cfg.queue_size_bytes - queue_state.n_bytes);
266+
// Use size of SDU queue for desired_buf_size
267+
//
268+
// From TS 38.425 Sec. 5.4.2.1:
269+
// - If the value of the desired buffer size is 0, the hosting node shall stop sending any data per bearer.
270+
// - If the value of the desired buffer size in b) above is greater than 0, the hosting node may send up to this
271+
// amount of data per bearer beyond the "Highest Delivered NR PDCP SN" for RLC AM, (...)
272+
upper_dn.on_transmitted_sdu(sdu.pdcp_sn.value(), cfg.queue_size_bytes);
267273
}
268274
}
269275

0 commit comments

Comments
 (0)