lib,rlc_am_nr: make sure that tx_buffer_queue size is configurable

This commit is contained in:
Pedro Alvarez 2022-04-22 13:15:46 +01:00
parent 10c921573f
commit 63877ba209
3 changed files with 26 additions and 8 deletions

View File

@ -101,6 +101,7 @@ public:
int write_sdu(unique_byte_buffer_t sdu);
void empty_queue() final;
void empty_queue_no_lock();
// Data PDU helpers
uint32_t build_new_pdu(uint8_t* payload, uint32_t nof_bytes);
@ -151,8 +152,8 @@ private:
// Queues, buffers and container
std::unique_ptr<pdu_retx_queue_base<rlc_amd_retx_nr_t> > retx_queue;
uint32_t sdu_under_segmentation_sn = INVALID_RLC_SN; // SN of the SDU currently being segmented.
pdcp_sn_vector_t notify_info_vec;
uint32_t sdu_under_segmentation_sn = INVALID_RLC_SN; // SN of the SDU currently being segmented.
pdcp_sn_vector_t notify_info_vec;
// Helper constants
uint32_t min_hdr_size = 2;

View File

@ -79,17 +79,18 @@ bool rlc_am::configure(const rlc_config_t& cfg_)
if (cfg.rat == srsran_rat_t::lte) {
RlcInfo("AM LTE configured - t_poll_retx=%d, poll_pdu=%d, poll_byte=%d, max_retx_thresh=%d, "
"t_reordering=%d, t_status_prohibit=%d",
"t_reordering=%d, t_status_prohibit=%d, tx_queue_length=%d",
cfg.am.t_poll_retx,
cfg.am.poll_pdu,
cfg.am.poll_byte,
cfg.am.max_retx_thresh,
cfg.am.t_reordering,
cfg.am.t_status_prohibit);
cfg.am.t_status_prohibit,
cfg.tx_queue_length);
} else if (cfg.rat == srsran_rat_t::nr) {
RlcInfo("AM NR configured - tx_sn_field_length=%d, rx_sn_field_length=%d, "
"t_poll_retx=%d, poll_pdu=%d, poll_byte=%d, "
"max_retx_thresh=%d, t_reassembly=%d, t_status_prohibit=%d",
"max_retx_thresh=%d, t_reassembly=%d, t_status_prohibit=%di, tx_queue_length=%d",
to_number(cfg.am_nr.tx_sn_field_length),
to_number(cfg.am_nr.rx_sn_field_length),
cfg.am_nr.t_poll_retx,
@ -97,7 +98,8 @@ bool rlc_am::configure(const rlc_config_t& cfg_)
cfg.am_nr.poll_byte,
cfg.am_nr.max_retx_thresh,
cfg.am_nr.t_reassembly,
cfg.am_nr.t_status_prohibit);
cfg.am_nr.t_status_prohibit,
cfg.tx_queue_length);
} else {
RlcError("Invalid RAT at entity configuration");
}

View File

@ -69,6 +69,10 @@ bool rlc_am_nr_tx::configure(const rlc_config_t& cfg_)
max_hdr_size = min_hdr_size + so_size;
// make sure Tx queue is empty before attempting to resize
empty_queue_no_lock();
tx_sdu_queue.resize(cfg_.tx_queue_length);
tx_enabled = true;
RlcDebug("RLC AM NR configured tx entity.");
@ -725,7 +729,7 @@ uint32_t rlc_am_nr_tx::build_status_pdu(byte_buffer_t* payload, uint32_t nof_byt
{
RlcInfo("generating status PDU. Bytes available:%d", nof_bytes);
rlc_am_nr_status_pdu_t status(cfg.rx_sn_field_length); // carries status of RX entity, hence use SN length of RX
int pdu_len = rx->get_status_pdu(&status, nof_bytes);
int pdu_len = rx->get_status_pdu(&status, nof_bytes);
if (pdu_len == SRSRAN_ERROR) {
RlcDebug("deferred status PDU. Cause: Failed to acquire rx lock");
pdu_len = 0;
@ -1063,8 +1067,19 @@ bool rlc_am_nr_tx::sdu_queue_is_full()
return false;
}
void rlc_am_nr_tx::empty_queue() {}
void rlc_am_nr_tx::empty_queue()
{
std::lock_guard<std::mutex> lock(mutex);
empty_queue_no_lock();
}
void rlc_am_nr_tx::empty_queue_no_lock()
{
// deallocate all SDUs in transmit queue
while (tx_sdu_queue.size() > 0) {
unique_byte_buffer_t buf = tx_sdu_queue.read();
}
}
void rlc_am_nr_tx::stop() {}
/*