Commit 917c0bfc authored by Robert Schmidt's avatar Robert Schmidt

Merge remote-tracking branch 'origin/nr-rlc-speedup-ack-nack-reception' into develop

parents 4c4cbc96 8b0be9cf
This diff is collapsed.
......@@ -84,9 +84,6 @@ typedef struct {
nr_rlc_sdu_segment_t *wait_end;
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;
void nr_rlc_entity_am_recv_sdu(nr_rlc_entity_t *entity,
......
......@@ -58,14 +58,19 @@ oom:
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--;
if (sdu->sdu->ref_count == 0) {
int ret = 0;
sdu->sdu->free_count++;
if (sdu->sdu->free_count == sdu->sdu->ref_count) {
free(sdu->sdu->data);
free(sdu->sdu);
ret = 1;
}
free(sdu);
return ret;
}
void nr_rlc_sdu_segment_list_append(nr_rlc_sdu_segment_t **list,
......
......@@ -30,6 +30,10 @@ typedef struct nr_rlc_sdu_t {
int retx_count;
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;
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(
char *buffer, int size,
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,
nr_rlc_sdu_segment_t **end,
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