Commit 8b0be9cf authored by Cedric Roux's avatar Cedric Roux

nr rlc: speedup ack/nack reception

The code completely changed, expect problems.
parent 803864d4
This diff is collapsed.
...@@ -84,9 +84,6 @@ typedef struct { ...@@ -84,9 +84,6 @@ typedef struct {
nr_rlc_sdu_segment_t *wait_end; nr_rlc_sdu_segment_t *wait_end;
nr_rlc_sdu_segment_t *retransmit_list; nr_rlc_sdu_segment_t *retransmit_list;
nr_rlc_sdu_segment_t *retransmit_end;
nr_rlc_sdu_segment_t *ack_list;
} nr_rlc_entity_am_t; } nr_rlc_entity_am_t;
void nr_rlc_entity_am_recv_sdu(nr_rlc_entity_t *entity, void nr_rlc_entity_am_recv_sdu(nr_rlc_entity_t *entity,
......
...@@ -58,14 +58,19 @@ oom: ...@@ -58,14 +58,19 @@ oom:
exit(1); exit(1);
} }
void nr_rlc_free_sdu_segment(nr_rlc_sdu_segment_t *sdu) int nr_rlc_free_sdu_segment(nr_rlc_sdu_segment_t *sdu)
{ {
sdu->sdu->ref_count--; int ret = 0;
if (sdu->sdu->ref_count == 0) {
sdu->sdu->free_count++;
if (sdu->sdu->free_count == sdu->sdu->ref_count) {
free(sdu->sdu->data); free(sdu->sdu->data);
free(sdu->sdu); free(sdu->sdu);
ret = 1;
} }
free(sdu); free(sdu);
return ret;
} }
void nr_rlc_sdu_segment_list_append(nr_rlc_sdu_segment_t **list, void nr_rlc_sdu_segment_list_append(nr_rlc_sdu_segment_t **list,
......
...@@ -30,6 +30,10 @@ typedef struct nr_rlc_sdu_t { ...@@ -30,6 +30,10 @@ typedef struct nr_rlc_sdu_t {
int retx_count; int retx_count;
int ref_count; /* incremented each time the SDU is segmented */ int ref_count; /* incremented each time the SDU is segmented */
int free_count; /* incremented each time a segment is freed
* when it equals ref_count we can free the SDU
* completely
*/
} nr_rlc_sdu_t; } nr_rlc_sdu_t;
typedef struct nr_rlc_sdu_segment_t { typedef struct nr_rlc_sdu_segment_t {
...@@ -44,7 +48,8 @@ typedef struct nr_rlc_sdu_segment_t { ...@@ -44,7 +48,8 @@ typedef struct nr_rlc_sdu_segment_t {
nr_rlc_sdu_segment_t *nr_rlc_new_sdu( nr_rlc_sdu_segment_t *nr_rlc_new_sdu(
char *buffer, int size, char *buffer, int size,
int upper_layer_id); int upper_layer_id);
void nr_rlc_free_sdu_segment(nr_rlc_sdu_segment_t *sdu); /* return 1 if the SDU has been freed too, 0 if not (more segments to free) */
int nr_rlc_free_sdu_segment(nr_rlc_sdu_segment_t *sdu);
void nr_rlc_sdu_segment_list_append(nr_rlc_sdu_segment_t **list, void nr_rlc_sdu_segment_list_append(nr_rlc_sdu_segment_t **list,
nr_rlc_sdu_segment_t **end, nr_rlc_sdu_segment_t **end,
nr_rlc_sdu_segment_t *sdu); nr_rlc_sdu_segment_t *sdu);
......
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