lte,enb,rlc: push to scheduler pending prioritized bytes both in case of RLC timer expiry or in case of new buffer state detection

master
Francisco 3 years ago committed by Francisco Paisana
parent 4a58c10f30
commit 7aa5f731ce

@ -59,6 +59,7 @@ public:
// MAC interface // MAC interface
bool has_data_locked(const uint32_t lcid); bool has_data_locked(const uint32_t lcid);
uint32_t get_buffer_state(const uint32_t lcid); uint32_t get_buffer_state(const uint32_t lcid);
void get_buffer_state(uint32_t lcid, uint32_t& tx_queue, uint32_t& prio_tx_queue);
uint32_t get_total_mch_buffer_state(uint32_t lcid); uint32_t get_total_mch_buffer_state(uint32_t lcid);
uint32_t read_pdu(uint32_t lcid, uint8_t* payload, uint32_t nof_bytes); uint32_t read_pdu(uint32_t lcid, uint8_t* payload, uint32_t nof_bytes);
uint32_t read_pdu_mch(uint32_t lcid, uint8_t* payload, uint32_t nof_bytes); uint32_t read_pdu_mch(uint32_t lcid, uint8_t* payload, uint32_t nof_bytes);

@ -346,6 +346,7 @@ public:
// MAC interface // MAC interface
bool has_data(); bool has_data();
uint32_t get_buffer_state(); uint32_t get_buffer_state();
void get_buffer_state(uint32_t& tx_queue, uint32_t& prio_tx_queue);
uint32_t read_pdu(uint8_t* payload, uint32_t nof_bytes); uint32_t read_pdu(uint8_t* payload, uint32_t nof_bytes);
void write_pdu(uint8_t* payload, uint32_t nof_bytes); void write_pdu(uint8_t* payload, uint32_t nof_bytes);

@ -273,6 +273,7 @@ public:
virtual bool has_data() = 0; virtual bool has_data() = 0;
bool is_suspended() { return suspended; }; bool is_suspended() { return suspended; };
virtual uint32_t get_buffer_state() = 0; virtual uint32_t get_buffer_state() = 0;
virtual void get_buffer_state(uint32_t& tx_queue, uint32_t& prio_tx_queue) = 0;
virtual uint32_t read_pdu(uint8_t* payload, uint32_t nof_bytes) = 0; virtual uint32_t read_pdu(uint8_t* payload, uint32_t nof_bytes) = 0;
virtual void write_pdu(uint8_t* payload, uint32_t nof_bytes) = 0; virtual void write_pdu(uint8_t* payload, uint32_t nof_bytes) = 0;

@ -54,6 +54,7 @@ public:
// MAC interface // MAC interface
bool has_data() override; bool has_data() override;
uint32_t get_buffer_state() override; uint32_t get_buffer_state() override;
void get_buffer_state(uint32_t& newtx_queue, uint32_t& prio_tx_queue) override;
uint32_t read_pdu(uint8_t* payload, uint32_t nof_bytes) override; uint32_t read_pdu(uint8_t* payload, uint32_t nof_bytes) override;
void write_pdu(uint8_t* payload, uint32_t nof_bytes) override; void write_pdu(uint8_t* payload, uint32_t nof_bytes) override;

@ -58,6 +58,7 @@ public:
// MAC interface // MAC interface
bool has_data(); bool has_data();
uint32_t get_buffer_state(); uint32_t get_buffer_state();
void get_buffer_state(uint32_t& newtx_queue, uint32_t& prio_tx_queue);
uint32_t read_pdu(uint8_t* payload, uint32_t nof_bytes); uint32_t read_pdu(uint8_t* payload, uint32_t nof_bytes);
void write_pdu(uint8_t* payload, uint32_t nof_bytes); void write_pdu(uint8_t* payload, uint32_t nof_bytes);
int get_increment_sequence_num(); int get_increment_sequence_num();

@ -239,20 +239,24 @@ bool rlc::has_data_locked(const uint32_t lcid)
return has_data(lcid); return has_data(lcid);
} }
uint32_t rlc::get_buffer_state(uint32_t lcid) void rlc::get_buffer_state(uint32_t lcid, uint32_t& tx_queue, uint32_t& prio_tx_queue)
{ {
uint32_t ret = 0;
rwlock_read_guard lock(rwlock); rwlock_read_guard lock(rwlock);
if (valid_lcid(lcid)) { if (valid_lcid(lcid)) {
if (rlc_array.at(lcid)->is_suspended()) { if (rlc_array.at(lcid)->is_suspended()) {
ret = 0; tx_queue = 0;
prio_tx_queue = 0;
} else { } else {
ret = rlc_array.at(lcid)->get_buffer_state(); rlc_array.at(lcid)->get_buffer_state(tx_queue, prio_tx_queue);
} }
} }
}
return ret; uint32_t rlc::get_buffer_state(uint32_t lcid)
{
uint32_t tx_queue, prio_tx_queue;
get_buffer_state(lcid, tx_queue, prio_tx_queue);
return tx_queue + prio_tx_queue;
} }
uint32_t rlc::get_total_mch_buffer_state(uint32_t lcid) uint32_t rlc::get_total_mch_buffer_state(uint32_t lcid)
@ -592,9 +596,9 @@ bool rlc::valid_lcid_mrb(uint32_t lcid)
void rlc::update_bsr(uint32_t lcid) void rlc::update_bsr(uint32_t lcid)
{ {
if (bsr_callback) { if (bsr_callback) {
uint32_t tx_queue = get_buffer_state(lcid); uint32_t tx_queue = 0, prio_tx_queue = 0;
uint32_t retx_queue = 0; // todo: separate tx_queue and retx_queue get_buffer_state(lcid, tx_queue, prio_tx_queue);
bsr_callback(lcid, tx_queue, retx_queue); bsr_callback(lcid, tx_queue, prio_tx_queue);
} }
} }

@ -258,6 +258,11 @@ uint32_t rlc_am_lte::get_buffer_state()
return tx.get_buffer_state(); return tx.get_buffer_state();
} }
void rlc_am_lte::get_buffer_state(uint32_t& tx_queue, uint32_t& prio_tx_queue)
{
tx.get_buffer_state(tx_queue, prio_tx_queue);
}
uint32_t rlc_am_lte::read_pdu(uint8_t* payload, uint32_t nof_bytes) uint32_t rlc_am_lte::read_pdu(uint8_t* payload, uint32_t nof_bytes)
{ {
uint32_t read_bytes = tx.read_pdu(payload, nof_bytes); uint32_t read_bytes = tx.read_pdu(payload, nof_bytes);

@ -124,6 +124,12 @@ uint32_t rlc_tm::get_buffer_state()
return ul_queue.size_bytes(); return ul_queue.size_bytes();
} }
void rlc_tm::get_buffer_state(uint32_t& newtx_queue, uint32_t& prio_tx_queue)
{
newtx_queue = get_buffer_state();
prio_tx_queue = 0;
}
rlc_bearer_metrics_t rlc_tm::get_metrics() rlc_bearer_metrics_t rlc_tm::get_metrics()
{ {
std::lock_guard<std::mutex> lock(metrics_mutex); std::lock_guard<std::mutex> lock(metrics_mutex);

@ -134,6 +134,12 @@ uint32_t rlc_um_base::get_buffer_state()
return 0; return 0;
} }
void rlc_um_base::get_buffer_state(uint32_t& newtx_queue, uint32_t& prio_tx_queue)
{
newtx_queue = get_buffer_state();
prio_tx_queue = 0;
}
uint32_t rlc_um_base::read_pdu(uint8_t* payload, uint32_t nof_bytes) uint32_t rlc_um_base::read_pdu(uint8_t* payload, uint32_t nof_bytes)
{ {
if (tx && tx_enabled) { if (tx && tx_enabled) {

@ -173,10 +173,10 @@ void rlc::reestablish(uint16_t rnti)
// In the eNodeB, there is no polling for buffer state from the scheduler. // In the eNodeB, there is no polling for buffer state from the scheduler.
// This function is called by UE RLC instance every time the tx/retx buffers are updated // This function is called by UE RLC instance every time the tx/retx buffers are updated
void rlc::update_bsr(uint32_t rnti, uint32_t lcid, uint32_t tx_queue, uint32_t retx_queue) void rlc::update_bsr(uint32_t rnti, uint32_t lcid, uint32_t tx_queue, uint32_t prio_tx_queue)
{ {
logger.debug("Buffer state: rnti=0x%x, lcid=%d, tx_queue=%d", rnti, lcid, tx_queue); logger.debug("Buffer state: rnti=0x%x, lcid=%d, tx_queue=%d, prio_tx_queue=%d", rnti, lcid, tx_queue, prio_tx_queue);
mac->rlc_buffer_state(rnti, lcid, tx_queue, retx_queue); mac->rlc_buffer_state(rnti, lcid, tx_queue, prio_tx_queue);
} }
int rlc::read_pdu(uint16_t rnti, uint32_t lcid, uint8_t* payload, uint32_t nof_bytes) int rlc::read_pdu(uint16_t rnti, uint32_t lcid, uint8_t* payload, uint32_t nof_bytes)

Loading…
Cancel
Save