Commit 56ea023e authored by Lionel Gauthier's avatar Lionel Gauthier

minor checks on RX packet of MAC

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4844 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 9d359ce5
...@@ -41,8 +41,6 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis ...@@ -41,8 +41,6 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis
#define TRACE_RLC_AM_RX #define TRACE_RLC_AM_RX
//#define DEBUG_RLC_AM_DISPLAY_TB_DATA //#define DEBUG_RLC_AM_DISPLAY_TB_DATA
//#define RLC_AM_GENERATE_ERRORS //#define RLC_AM_GENERATE_ERRORS
#define DEBUG_DISPLAY_NVIDIA
#define RLC_ENABLE_PDU_CONCATENATION
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
signed int rlc_am_get_data_pdu_infos(u32_t frame, rlc_am_pdu_sn_10_t* headerP, s16_t total_sizeP, rlc_am_pdu_info_t* pdu_infoP) signed int rlc_am_get_data_pdu_infos(u32_t frame, rlc_am_pdu_sn_10_t* headerP, s16_t total_sizeP, rlc_am_pdu_info_t* pdu_infoP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -221,24 +219,10 @@ rlc_am_receive_routing (rlc_am_entity_t *rlcP, u32_t frame, u8_t eNB_flag, struc ...@@ -221,24 +219,10 @@ rlc_am_receive_routing (rlc_am_entity_t *rlcP, u32_t frame, u8_t eNB_flag, struc
rlcP->stat_rx_control_bytes += tb_size_in_bytes; rlcP->stat_rx_control_bytes += tb_size_in_bytes;
rlcP->stat_rx_control_pdu += 1; rlcP->stat_rx_control_pdu += 1;
rlc_am_receive_process_control_pdu (rlcP, frame, tb, &first_byte, &tb_size_in_bytes); rlc_am_receive_process_control_pdu (rlcP, frame, tb, &first_byte, &tb_size_in_bytes);
// if data pdu concatenated with control PDU (seen with real hardware LTE dongle integration) // Test if remaining bytes not processed (up to know, highest probability is bug in MAC)
if (tb_size_in_bytes > 0) { AssertFatal( tb_size_in_bytes == 0,
#if defined(RLC_ENABLE_PDU_CONCATENATION)
if ((*first_byte & 0x80) == 0x80) {
rlcP->stat_rx_data_bytes += tb_size_in_bytes;
rlcP->stat_rx_data_pdu += 1;
rlc_am_receive_process_data_pdu (rlcP, frame, eNB_flag, tb, first_byte, tb_size_in_bytes);
} else {
AssertFatal( tb_size_in_bytes == 0,
"Not a data PDU concatened to control PDU %ld bytes left",
tb_size_in_bytes);
}
#else
AssertFatal( tb_size_in_bytes == 0,
"Remaining %d bytes following a control PDU", "Remaining %d bytes following a control PDU",
tb_size_in_bytes); tb_size_in_bytes);
#endif
}
} }
LOG_D(RLC, "[FRAME %05d][RLC_AM][MOD %02d][RB %02d][RX ROUTING] VR(R)=%03d VR(MR)=%03d\n", frame, rlcP->module_id, rlcP->rb_id, rlcP->vr_r, rlcP->vr_mr); LOG_D(RLC, "[FRAME %05d][RLC_AM][MOD %02d][RB %02d][RX ROUTING] VR(R)=%03d VR(MR)=%03d\n", frame, rlcP->module_id, rlcP->rb_id, rlcP->vr_r, rlcP->vr_mr);
} }
......
...@@ -29,6 +29,7 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis ...@@ -29,6 +29,7 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis
#define RLC_UM_MODULE #define RLC_UM_MODULE
#define RLC_UM_DAR_C #define RLC_UM_DAR_C
#include "platform_types.h" #include "platform_types.h"
#include "assertions.h"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#include "rlc.h" #include "rlc.h"
#include "rlc_um.h" #include "rlc_um.h"
...@@ -82,8 +83,8 @@ signed int rlc_um_get_pdu_infos(u32_t frame,rlc_um_pdu_sn_10_t* headerP, s16_t t ...@@ -82,8 +83,8 @@ signed int rlc_um_get_pdu_infos(u32_t frame,rlc_um_pdu_sn_10_t* headerP, s16_t t
} }
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) {
LOG_E(RLC, "[FRAME %05d][RLC_UM][MOD XX][RB XX][GET PDU INFO] SN %04d TOO MANY LIs ", frame, pdu_infoP->sn);
return -2; return -2;
} }
} }
...@@ -251,10 +252,7 @@ void rlc_um_try_reassembly(rlc_um_entity_t *rlcP, u32_t frame, u8_t eNB_flag, si ...@@ -251,10 +252,7 @@ void rlc_um_try_reassembly(rlc_um_entity_t *rlcP, u32_t frame, u8_t eNB_flag, si
break; break;
default: default:
LOG_E(RLC, "[RLC_UM][MOD %d][RB %d][FRAME %05d] TRY REASSEMBLY SHOULD NOT GO HERE\n", rlcP->module_id, rlcP->rb_id, frame); AssertFatal( 0 !=0, "[RLC_UM][MOD %d][RB %d][FRAME %05d] TRY REASSEMBLY SHOULD NOT GO HERE\n", rlcP->module_id, rlcP->rb_id, frame);
#ifdef USER_MODE
assert(0 != 0);
#endif
} }
} else { } else {
if (rlc_um_read_length_indicators(&data, e_li, li_array, &num_li, &size ) >= 0) { if (rlc_um_read_length_indicators(&data, e_li, li_array, &num_li, &size ) >= 0) {
...@@ -354,10 +352,7 @@ void rlc_um_try_reassembly(rlc_um_entity_t *rlcP, u32_t frame, u8_t eNB_flag, si ...@@ -354,10 +352,7 @@ void rlc_um_try_reassembly(rlc_um_entity_t *rlcP, u32_t frame, u8_t eNB_flag, si
// data is already ok, done by last loop above // data is already ok, done by last loop above
rlc_um_reassembly (data, size, rlcP,frame); rlc_um_reassembly (data, size, rlcP,frame);
} else { } else {
LOG_E(RLC, "[RLC_UM][MOD %d][RB %d][FRAME %05d] SHOULD NOT GO HERE\n", rlcP->module_id, rlcP->rb_id, frame, li_array[0]); AssertFatal( 0 !=0, "[RLC_UM][MOD %d][RB %d][FRAME %05d] SHOULD NOT GO HERE\n", rlcP->module_id, rlcP->rb_id, frame);
#ifdef USER_MODE
assert (5!=5);
#endif
//rlcP->stat_rx_data_pdu_dropped += 1; //rlcP->stat_rx_data_pdu_dropped += 1;
rlcP->stat_rx_data_bytes_dropped += size; rlcP->stat_rx_data_bytes_dropped += size;
} }
......
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