Commit eebf2cb9 authored by Cedric Roux's avatar Cedric Roux

rlc v2: improve buffer status reporting

The old method was wrong.
The new method is better, but not accurate, especially when the
TX buffer contains SDU of size > 2047 bytes.

Plus it's probably too slow.

To be refined at some point.
parent d860ca51
......@@ -1394,10 +1394,15 @@ rlc_entity_buffer_status_t rlc_entity_am_buffer_status(
ret.status_size = 0;
/* TX PDU */
/* todo: if an SDU has size >2047 in the tx list then processing
* stops and computed size will not be accurate. Change the computation
* to be more accurate (if needed).
*/
tx_size = compute_new_pdu_size(entity, maxsize);
ret.tx_size = tx_size.data_size + tx_size.header_size;
/* reTX PDU */
/* todo: report size of all available data, not just first PDU */
ret.retx_size = retx_pdu_size(entity, maxsize);
return ret;
......
......@@ -407,6 +407,10 @@ rlc_entity_buffer_status_t rlc_entity_um_buffer_status(
ret.status_size = 0;
/* todo: if an SDU has size >2047 in the tx list then processing
* stops and computed size will not be accurate. Change the computation
* to be more accurate (if needed).
*/
tx_size = tx_pdu_size(entity, maxsize);
ret.tx_size = tx_size.data_size + tx_size.header_size;
......
......@@ -170,13 +170,14 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
if (rb != NULL) {
rlc_entity_buffer_status_t buf_stat;
rb->set_time(rb, rlc_current_time);
buf_stat = rb->buffer_status(rb, tb_sizeP ? tb_sizeP : 1000000);
if (buf_stat.status_size)
ret.bytes_in_buffer = buf_stat.status_size;
else if (buf_stat.retx_size)
ret.bytes_in_buffer = buf_stat.retx_size;
else
ret.bytes_in_buffer = buf_stat.tx_size;
/* 36.321 deals with BSR values up to 3000000 bytes, after what it
* reports '> 3000000' (table 6.1.3.1-2). Passing 4000000 is thus
* more than enough.
*/
buf_stat = rb->buffer_status(rb, 4000000);
ret.bytes_in_buffer = buf_stat.status_size
+ buf_stat.retx_size
+ buf_stat.tx_size;
ue->saved_status_ind_tb_size[channel_idP - 1] = tb_sizeP;
} else {
ret.bytes_in_buffer = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment