mirror of https://github.com/PentHertz/srsLTE.git
lib,rlc_am_nr: make sure that tx_buffer_queue size is configurable
This commit is contained in:
parent
10c921573f
commit
63877ba209
|
@ -101,6 +101,7 @@ public:
|
||||||
|
|
||||||
int write_sdu(unique_byte_buffer_t sdu);
|
int write_sdu(unique_byte_buffer_t sdu);
|
||||||
void empty_queue() final;
|
void empty_queue() final;
|
||||||
|
void empty_queue_no_lock();
|
||||||
|
|
||||||
// Data PDU helpers
|
// Data PDU helpers
|
||||||
uint32_t build_new_pdu(uint8_t* payload, uint32_t nof_bytes);
|
uint32_t build_new_pdu(uint8_t* payload, uint32_t nof_bytes);
|
||||||
|
|
|
@ -79,17 +79,18 @@ bool rlc_am::configure(const rlc_config_t& cfg_)
|
||||||
|
|
||||||
if (cfg.rat == srsran_rat_t::lte) {
|
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, "
|
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.t_poll_retx,
|
||||||
cfg.am.poll_pdu,
|
cfg.am.poll_pdu,
|
||||||
cfg.am.poll_byte,
|
cfg.am.poll_byte,
|
||||||
cfg.am.max_retx_thresh,
|
cfg.am.max_retx_thresh,
|
||||||
cfg.am.t_reordering,
|
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) {
|
} else if (cfg.rat == srsran_rat_t::nr) {
|
||||||
RlcInfo("AM NR configured - tx_sn_field_length=%d, rx_sn_field_length=%d, "
|
RlcInfo("AM NR configured - tx_sn_field_length=%d, rx_sn_field_length=%d, "
|
||||||
"t_poll_retx=%d, poll_pdu=%d, poll_byte=%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.tx_sn_field_length),
|
||||||
to_number(cfg.am_nr.rx_sn_field_length),
|
to_number(cfg.am_nr.rx_sn_field_length),
|
||||||
cfg.am_nr.t_poll_retx,
|
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.poll_byte,
|
||||||
cfg.am_nr.max_retx_thresh,
|
cfg.am_nr.max_retx_thresh,
|
||||||
cfg.am_nr.t_reassembly,
|
cfg.am_nr.t_reassembly,
|
||||||
cfg.am_nr.t_status_prohibit);
|
cfg.am_nr.t_status_prohibit,
|
||||||
|
cfg.tx_queue_length);
|
||||||
} else {
|
} else {
|
||||||
RlcError("Invalid RAT at entity configuration");
|
RlcError("Invalid RAT at entity configuration");
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,6 +69,10 @@ bool rlc_am_nr_tx::configure(const rlc_config_t& cfg_)
|
||||||
|
|
||||||
max_hdr_size = min_hdr_size + so_size;
|
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;
|
tx_enabled = true;
|
||||||
|
|
||||||
RlcDebug("RLC AM NR configured tx entity.");
|
RlcDebug("RLC AM NR configured tx entity.");
|
||||||
|
@ -1063,8 +1067,19 @@ bool rlc_am_nr_tx::sdu_queue_is_full()
|
||||||
return false;
|
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() {}
|
void rlc_am_nr_tx::stop() {}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue