Commit 19383ed3 authored by Lionel Gauthier's avatar Lionel Gauthier

ADDED RLC FLAG FOR ASSERTING ON MISSING PDUS

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4847 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 674963da
...@@ -282,6 +282,10 @@ void rlc_am_receive_process_data_pdu (rlc_am_entity_t *rlcP, u32_t frame, u8_t e ...@@ -282,6 +282,10 @@ void rlc_am_receive_process_data_pdu (rlc_am_entity_t *rlcP, u32_t frame, u8_t e
free_mem_block (tbP); free_mem_block (tbP);
LOG_D(RLC, "[FRAME %05d][RLC_AM][MOD %02d][RB %02d][PROCESS RX PDU] PDU DISCARDED, STATUS REQUESTED:\n", frame, rlcP->module_id, rlcP->rb_id); LOG_D(RLC, "[FRAME %05d][RLC_AM][MOD %02d][RB %02d][PROCESS RX PDU] PDU DISCARDED, STATUS REQUESTED:\n", frame, rlcP->module_id, rlcP->rb_id);
rlcP->status_requested = 1; rlcP->status_requested = 1;
#if defined(RLC_STOP_ON_LOST_PDU)
AssertFatal( 0 == 1,
"[FRAME %05d][RLC_AM][MOD %d][RB %d] LOST PDU DETECTED\n", frame, rlcP->module_id, rlcP->rb_id);
#endif
} else { } else {
// 5.1.3.2.3 // 5.1.3.2.3
// Actions when a RLC data PDU is placed in the reception buffer // Actions when a RLC data PDU is placed in the reception buffer
...@@ -333,6 +337,7 @@ void rlc_am_receive_process_data_pdu (rlc_am_entity_t *rlcP, u32_t frame, u8_t e ...@@ -333,6 +337,7 @@ void rlc_am_receive_process_data_pdu (rlc_am_entity_t *rlcP, u32_t frame, u8_t e
} }
rlc_am_rx_list_reassemble_rlc_sdus(rlcP,frame,eNB_flag); rlc_am_rx_list_reassemble_rlc_sdus(rlcP,frame,eNB_flag);
} }
if (rlcP->t_reordering.running) { if (rlcP->t_reordering.running) {
if ((rlcP->vr_x == rlcP->vr_r) || ((rlc_am_in_rx_window(rlcP, pdu_info->sn) == 0) && (rlcP->vr_x != rlcP->vr_mr))) { if ((rlcP->vr_x == rlcP->vr_r) || ((rlc_am_in_rx_window(rlcP, pdu_info->sn) == 0) && (rlcP->vr_x != rlcP->vr_mr))) {
rlc_am_stop_and_reset_timer_reordering(rlcP,frame); rlc_am_stop_and_reset_timer_reordering(rlcP,frame);
......
...@@ -29,13 +29,11 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis ...@@ -29,13 +29,11 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis
#define RLC_AM_MODULE #define RLC_AM_MODULE
#define RLC_AM_RX_LIST_C #define RLC_AM_RX_LIST_C
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#ifdef USER_MODE
#include <assert.h>
#endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
//#include "rtos_header.h" //#include "rtos_header.h"
#include "platform_types.h" #include "platform_types.h"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#include "assertions.h"
#include "list.h" #include "list.h"
#include "rlc_am.h" #include "rlc_am.h"
#include "LAYER2/MAC/extern.h" #include "LAYER2/MAC/extern.h"
...@@ -450,6 +448,12 @@ void rlc_am_rx_list_reassemble_rlc_sdus(rlc_am_entity_t* rlcP,u32_t frame, u8_t ...@@ -450,6 +448,12 @@ void rlc_am_rx_list_reassemble_rlc_sdus(rlc_am_entity_t* rlcP,u32_t frame, u8_t
} }
rlc_am_rx_pdu_management = ((rlc_am_rx_pdu_management_t*)(cursor->data)); rlc_am_rx_pdu_management = ((rlc_am_rx_pdu_management_t*)(cursor->data));
} else { } else {
#if defined(RLC_STOP_ON_LOST_PDU)
if (list2_get_head(&rlcP->receiver_buffer) != cursor) {
AssertFatal( 0 == 1,
"[FRAME %05d][RLC_AM][MOD %d][RB %d] LOST PDU DETECTED\n", frame, rlcP->module_id, rlcP->rb_id);
}
#endif
return; return;
} }
......
...@@ -70,20 +70,24 @@ signed int rlc_um_get_pdu_infos(u32_t frame,rlc_um_pdu_sn_10_t* headerP, s16_t t ...@@ -70,20 +70,24 @@ signed int rlc_um_get_pdu_infos(u32_t frame,rlc_um_pdu_sn_10_t* headerP, s16_t t
while (li_to_read) { while (li_to_read) {
li_length_in_bytes = li_length_in_bytes ^ 3; li_length_in_bytes = li_length_in_bytes ^ 3;
if (li_length_in_bytes == 2) { if (li_length_in_bytes == 2) {
AssertFatal( total_sizeP >= ((uint64_t)(&e_li->b2) - (uint64_t)headerP),
"DECODING PDU TOO FAR PDU size %d", total_sizeP);
pdu_infoP->li_list[pdu_infoP->num_li] = ((u16_t)(e_li->b1 << 4)) & 0x07F0; pdu_infoP->li_list[pdu_infoP->num_li] = ((u16_t)(e_li->b1 << 4)) & 0x07F0;
pdu_infoP->li_list[pdu_infoP->num_li] |= (((u8_t)(e_li->b2 >> 4)) & 0x000F); pdu_infoP->li_list[pdu_infoP->num_li] |= (((u8_t)(e_li->b2 >> 4)) & 0x000F);
li_to_read = e_li->b1 & 0x80; li_to_read = e_li->b1 & 0x80;
pdu_infoP->header_size += 2; pdu_infoP->header_size += 2;
} else { } else {
AssertFatal( total_sizeP >= ((uint64_t)(&e_li->b3) - (uint64_t)headerP),
"DECODING PDU TOO FAR PDU size %d", total_sizeP);
pdu_infoP->li_list[pdu_infoP->num_li] = ((u16_t)(e_li->b2 << 8)) & 0x0700; pdu_infoP->li_list[pdu_infoP->num_li] = ((u16_t)(e_li->b2 << 8)) & 0x0700;
pdu_infoP->li_list[pdu_infoP->num_li] |= e_li->b3; pdu_infoP->li_list[pdu_infoP->num_li] |= e_li->b3;
li_to_read = e_li->b2 & 0x08; li_to_read = e_li->b2 & 0x08;
e_li++; e_li++;
pdu_infoP->header_size += 1; pdu_infoP->header_size += 1;
} }
AssertFatal( pdu_infoP->num_li >= RLC_AM_MAX_SDU_IN_PDU, "[FRAME %05d][RLC_UM][MOD XX][RB XX][GET PDU INFO] SN %04d TOO MANY LIs ", frame, pdu_infoP->sn);
sum_li += pdu_infoP->li_list[pdu_infoP->num_li]; sum_li += pdu_infoP->li_list[pdu_infoP->num_li];
pdu_infoP->num_li = pdu_infoP->num_li + 1; pdu_infoP->num_li = pdu_infoP->num_li + 1;
AssertFatal( pdu_infoP->num_li > RLC_AM_MAX_SDU_IN_PDU, "[FRAME %05d][RLC_UM][MOD XX][RB XX][GET PDU INFO] SN %04d TOO MANY LIs ", frame, pdu_infoP->sn);
if (pdu_infoP->num_li > RLC_AM_MAX_SDU_IN_PDU) { if (pdu_infoP->num_li > RLC_AM_MAX_SDU_IN_PDU) {
return -2; return -2;
} }
...@@ -230,9 +234,9 @@ void rlc_um_try_reassembly(rlc_um_entity_t *rlcP, u32_t frame, u8_t eNB_flag, si ...@@ -230,9 +234,9 @@ void rlc_um_try_reassembly(rlc_um_entity_t *rlcP, u32_t frame, u8_t eNB_flag, si
rlc_um_reassembly (data, size, rlcP,frame); rlc_um_reassembly (data, size, rlcP,frame);
rlc_um_send_sdu(rlcP,frame,eNB_flag); rlc_um_send_sdu(rlcP,frame,eNB_flag);
} else { } else {
//clear sdu already done //clear sdu already done
rlcP->stat_rx_data_pdu_dropped += 1; rlcP->stat_rx_data_pdu_dropped += 1;
rlcP->stat_rx_data_bytes_dropped += tb_ind->size; rlcP->stat_rx_data_bytes_dropped += tb_ind->size;
} }
rlcP->reassembly_missing_sn_detected = 0; rlcP->reassembly_missing_sn_detected = 0;
break; break;
...@@ -246,8 +250,13 @@ void rlc_um_try_reassembly(rlc_um_entity_t *rlcP, u32_t frame, u8_t eNB_flag, si ...@@ -246,8 +250,13 @@ void rlc_um_try_reassembly(rlc_um_entity_t *rlcP, u32_t frame, u8_t eNB_flag, si
//LOG_D(RLC, "[MSC_NBOX][FRAME %05d][RLC_UM][MOD %02d][RB %02d][Missing SN detected][RLC_UM][MOD %02d][RB %02d]\n", //LOG_D(RLC, "[MSC_NBOX][FRAME %05d][RLC_UM][MOD %02d][RB %02d][Missing SN detected][RLC_UM][MOD %02d][RB %02d]\n",
// frame, rlcP->module_id,rlcP->rb_id, rlcP->module_id,rlcP->rb_id); // frame, rlcP->module_id,rlcP->rb_id, rlcP->module_id,rlcP->rb_id);
rlcP->reassembly_missing_sn_detected = 1; // not necessary but for readability of the code rlcP->reassembly_missing_sn_detected = 1; // not necessary but for readability of the code
rlcP->stat_rx_data_pdu_dropped += 1; rlcP->stat_rx_data_pdu_dropped += 1;
rlcP->stat_rx_data_bytes_dropped += tb_ind->size; rlcP->stat_rx_data_bytes_dropped += tb_ind->size;
#if defined(RLC_STOP_ON_LOST_PDU)
AssertFatal( rlcP->reassembly_missing_sn_detected == 1,
"[RLC_UM][MOD %d][RB %d][FRAME %05d] MISSING PDU DETECTED\n",
rlcP->module_id, rlcP->rb_id, frame);
#endif
} }
break; break;
...@@ -308,8 +317,8 @@ void rlc_um_try_reassembly(rlc_um_entity_t *rlcP, u32_t frame, u8_t eNB_flag, si ...@@ -308,8 +317,8 @@ void rlc_um_try_reassembly(rlc_um_entity_t *rlcP, u32_t frame, u8_t eNB_flag, si
if (rlcP->reassembly_missing_sn_detected) { if (rlcP->reassembly_missing_sn_detected) {
reassembly_start_index = 1; reassembly_start_index = 1;
data = &data[li_array[0]]; data = &data[li_array[0]];
//rlcP->stat_rx_data_pdu_dropped += 1; //rlcP->stat_rx_data_pdu_dropped += 1;
rlcP->stat_rx_data_bytes_dropped += li_array[0]; rlcP->stat_rx_data_bytes_dropped += li_array[0];
} else { } else {
reassembly_start_index = 0; reassembly_start_index = 0;
} }
...@@ -361,13 +370,14 @@ void rlc_um_try_reassembly(rlc_um_entity_t *rlcP, u32_t frame, u8_t eNB_flag, si ...@@ -361,13 +370,14 @@ void rlc_um_try_reassembly(rlc_um_entity_t *rlcP, u32_t frame, u8_t eNB_flag, si
default: default:
LOG_W(RLC, "[MSC_NBOX][FRAME %05d][RLC_UM][MOD %02d][RB %02d][Missing SN detected][RLC_UM][MOD %02d][RB %02d]\n", LOG_W(RLC, "[MSC_NBOX][FRAME %05d][RLC_UM][MOD %02d][RB %02d][Missing SN detected][RLC_UM][MOD %02d][RB %02d]\n",
frame, rlcP->module_id,rlcP->rb_id, rlcP->module_id,rlcP->rb_id); frame, rlcP->module_id,rlcP->rb_id, rlcP->module_id,rlcP->rb_id);
#ifdef USER_MODE rlcP->stat_rx_data_pdu_dropped += 1;
assert(1 != 1); rlcP->stat_rx_data_bytes_dropped += tb_ind->size;
#endif
rlcP->stat_rx_data_pdu_dropped += 1;
rlcP->stat_rx_data_bytes_dropped += tb_ind->size;
rlcP->reassembly_missing_sn_detected = 1; rlcP->reassembly_missing_sn_detected = 1;
#if defined(RLC_STOP_ON_LOST_PDU)
AssertFatal( rlcP->reassembly_missing_sn_detected == 1,
"[RLC_UM][MOD %d][RB %d][FRAME %05d] MISSING PDU DETECTED\n", rlcP->module_id, rlcP->rb_id, frame);
#endif
} }
} }
} }
...@@ -380,6 +390,10 @@ void rlc_um_try_reassembly(rlc_um_entity_t *rlcP, u32_t frame, u8_t eNB_flag, si ...@@ -380,6 +390,10 @@ void rlc_um_try_reassembly(rlc_um_entity_t *rlcP, u32_t frame, u8_t eNB_flag, si
frame, rlcP->module_id,rlcP->rb_id, sn, rlcP->module_id,rlcP->rb_id); frame, rlcP->module_id,rlcP->rb_id, sn, rlcP->module_id,rlcP->rb_id);
rlcP->reassembly_missing_sn_detected = 1; rlcP->reassembly_missing_sn_detected = 1;
rlc_um_clear_rx_sdu(rlcP); rlc_um_clear_rx_sdu(rlcP);
#if defined(RLC_STOP_ON_LOST_PDU)
AssertFatal( rlcP->reassembly_missing_sn_detected == 1,
"[FRAME %05d][RLC_UM][MOD %d][RB %d] MISSING PDU DETECTED\n", frame, rlcP->module_id, rlcP->rb_id);
#endif
} }
sn = (sn + 1) % rlcP->rx_sn_modulo; sn = (sn + 1) % rlcP->rx_sn_modulo;
if ((sn == rlcP->vr_uh) || (sn == end_snP)){ if ((sn == rlcP->vr_uh) || (sn == end_snP)){
......
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