Commit c5310874 authored by teramoto.genki's avatar teramoto.genki

Merge branch 'sp3_rlc_assertion' of...

Merge branch 'sp3_rlc_assertion' of http://10.37.145.15:8000/gitlab/vran/release_enb into sp3_rlc_assertion

# Conflicts:
#	openair2/LAYER2/RLC/rlc.c
parents 43382def 8b44c8bf
...@@ -568,7 +568,11 @@ rlc_um_mac_data_request (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP,cons ...@@ -568,7 +568,11 @@ rlc_um_mac_data_request (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP,cons
l_rlc_p->stat_tx_data_pdu += 1; l_rlc_p->stat_tx_data_pdu += 1;
l_rlc_p->stat_tx_data_bytes += tb_size_in_bytes; l_rlc_p->stat_tx_data_bytes += tb_size_in_bytes;
AssertFatal( tb_size_in_bytes > 0 , "RLC UM PDU LENGTH %d", tb_size_in_bytes); //AssertFatal( tb_size_in_bytes > 0 , "RLC UM PDU LENGTH %d", tb_size_in_bytes);
if(tb_size_in_bytes <= 0) {
LOG_E(RLC, "RLC UM PDU LENGTH %d\n", tb_size_in_bytes);
}
#if TRACE_RLC_UM_PDU || MESSAGE_CHART_GENERATOR #if TRACE_RLC_UM_PDU || MESSAGE_CHART_GENERATOR
rlc_um_get_pdu_infos(ctxt_pP, l_rlc_p,(rlc_um_pdu_sn_10_t*) ((struct mac_tb_req*) (tb_p->data))->data_ptr, tb_size_in_bytes, &pdu_info, l_rlc_p->rx_sn_length); rlc_um_get_pdu_infos(ctxt_pP, l_rlc_p,(rlc_um_pdu_sn_10_t*) ((struct mac_tb_req*) (tb_p->data))->data_ptr, tb_size_in_bytes, &pdu_info, l_rlc_p->rx_sn_length);
#endif #endif
......
...@@ -106,28 +106,48 @@ void config_req_rlc_um_asn1 ( ...@@ -106,28 +106,48 @@ void config_req_rlc_um_asn1 (
#if defined(Rel10) || defined(Rel14) #if defined(Rel10) || defined(Rel14)
if (mbms_flagP) { if (mbms_flagP) {
AssertFatal(dl_rlc_pP, "No RLC UM DL config"); //AssertFatal(dl_rlc_pP, "No RLC UM DL config");
AssertFatal(ul_rlc_pP == NULL, "RLC UM UL config present"); if(dl_rlc_pP == NULL) {
LOG_E(RLC, "No RLC UM DL config\n");
return;
}
//AssertFatal(ul_rlc_pP == NULL, "RLC UM UL config present");
if(ul_rlc_pP != NULL) {
LOG_E(RLC, "RLC UM UL config present\n");
return;
}
key = RLC_COLL_KEY_MBMS_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, mbms_service_idP, mbms_session_idP); key = RLC_COLL_KEY_MBMS_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, mbms_service_idP, mbms_session_idP);
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p); h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
AssertFatal (h_rc == HASH_TABLE_OK, "RLC NOT FOUND enb id %u rnti %i enb flag %u service id %u, session id %u", //AssertFatal (h_rc == HASH_TABLE_OK, "RLC NOT FOUND enb id %u rnti %i enb flag %u service id %u, session id %u",
ctxt_pP->module_id, // ctxt_pP->module_id,
ctxt_pP->rnti, // ctxt_pP->rnti,
ctxt_pP->enb_flag, // ctxt_pP->enb_flag,
mbms_service_idP, // mbms_service_idP,
mbms_session_idP); // mbms_session_idP);
if(h_rc != HASH_TABLE_OK) {
LOG_E(RLC, "RLC NOT FOUND enb id %u rnti %i enb flag %u service id %u, session id %u\n",
ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, mbms_service_idP, mbms_session_idP);
return;
}
rlc_p = &rlc_union_p->rlc.um; rlc_p = &rlc_union_p->rlc.um;
} else } else
#endif #endif
{ {
key = RLC_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP); key = RLC_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP);
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p); h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
AssertFatal (h_rc == HASH_TABLE_OK, "RLC NOT FOUND enb id %u ue id %i enb flag %u rb id %u, srb flag %u", //AssertFatal (h_rc == HASH_TABLE_OK, "RLC NOT FOUND enb id %u ue id %i enb flag %u rb id %u, srb flag %u",
ctxt_pP->module_id, // ctxt_pP->module_id,
ctxt_pP->rnti, // ctxt_pP->rnti,
ctxt_pP->enb_flag, // ctxt_pP->enb_flag,
rb_idP, // rb_idP,
srb_flagP); // srb_flagP);
if(h_rc != HASH_TABLE_OK) {
LOG_E(RLC, "RLC NOT FOUND enb id %u ue id %i enb flag %u rb id %u, srb flag %u\n",
ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP);
return;
}
rlc_p = &rlc_union_p->rlc.um; rlc_p = &rlc_union_p->rlc.um;
} }
...@@ -269,7 +289,11 @@ rlc_um_init ( ...@@ -269,7 +289,11 @@ rlc_um_init (
) )
{ {
AssertFatal(rlc_pP, "Bad RLC UM pointer (NULL)"); //AssertFatal(rlc_pP, "Bad RLC UM pointer (NULL)");
if(rlc_pP == NULL) {
LOG_E(RLC, "Bad RLC UM pointer (NULL)\n");
return;
}
if (rlc_pP->initialized) { if (rlc_pP->initialized) {
LOG_D(RLC,PROTOCOL_RLC_UM_CTXT_FMT" [INIT] ALREADY DONE, DOING NOTHING\n", LOG_D(RLC,PROTOCOL_RLC_UM_CTXT_FMT" [INIT] ALREADY DONE, DOING NOTHING\n",
......
...@@ -47,7 +47,11 @@ signed int rlc_um_get_pdu_infos( ...@@ -47,7 +47,11 @@ signed int rlc_um_get_pdu_infos(
pdu_info_pP->num_li = 0; pdu_info_pP->num_li = 0;
AssertFatal( total_sizeP > 0 , "RLC UM PDU LENGTH %d", total_sizeP); //AssertFatal( total_sizeP > 0 , "RLC UM PDU LENGTH %d", total_sizeP);
if(total_sizeP <= 0) {
LOG_E(RLC, "RLC UM PDU LENGTH %d\n", total_sizeP);
return -1;
}
if (sn_lengthP == 10) { if (sn_lengthP == 10) {
pdu_info_pP->fi = (header_pP->b1 >> 3) & 0x03; pdu_info_pP->fi = (header_pP->b1 >> 3) & 0x03;
...@@ -62,7 +66,11 @@ signed int rlc_um_get_pdu_infos( ...@@ -62,7 +66,11 @@ signed int rlc_um_get_pdu_infos(
pdu_info_pP->header_size = 1; pdu_info_pP->header_size = 1;
pdu_info_pP->payload = &header_pP->b2; pdu_info_pP->payload = &header_pP->b2;
} else { } else {
AssertFatal( sn_lengthP == 5 || sn_lengthP == 10, "RLC UM SN LENGTH %d", sn_lengthP); //AssertFatal( sn_lengthP == 5 || sn_lengthP == 10, "RLC UM SN LENGTH %d", sn_lengthP);
if(!(sn_lengthP == 5 || sn_lengthP == 10)) {
LOG_E(RLC, "RLC UM SN LENGTH %d\n", sn_lengthP);
return -1;
}
} }
...@@ -77,15 +85,23 @@ signed int rlc_um_get_pdu_infos( ...@@ -77,15 +85,23 @@ signed int rlc_um_get_pdu_infos(
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_p->b2) - (uint64_t)header_pP), //AssertFatal( total_sizeP >= ((uint64_t)(&e_li_p->b2) - (uint64_t)header_pP),
"DECODING PDU TOO FAR PDU size %d", total_sizeP); // "DECODING PDU TOO FAR PDU size %d", total_sizeP);
if(total_sizeP < ((uint64_t)(&e_li_p->b2) - (uint64_t)header_pP)) {
LOG_E(RLC, "DECODING PDU TOO FAR PDU size %d\n", total_sizeP);
return -1;
}
pdu_info_pP->li_list[pdu_info_pP->num_li] = ((uint16_t)(e_li_p->b1 << 4)) & 0x07F0; pdu_info_pP->li_list[pdu_info_pP->num_li] = ((uint16_t)(e_li_p->b1 << 4)) & 0x07F0;
pdu_info_pP->li_list[pdu_info_pP->num_li] |= (((uint8_t)(e_li_p->b2 >> 4)) & 0x000F); pdu_info_pP->li_list[pdu_info_pP->num_li] |= (((uint8_t)(e_li_p->b2 >> 4)) & 0x000F);
li_to_read = e_li_p->b1 & 0x80; li_to_read = e_li_p->b1 & 0x80;
pdu_info_pP->header_size += 2; pdu_info_pP->header_size += 2;
} else { } else {
AssertFatal( total_sizeP >= ((uint64_t)(&e_li_p->b3) - (uint64_t)header_pP), //AssertFatal( total_sizeP >= ((uint64_t)(&e_li_p->b3) - (uint64_t)header_pP),
"DECODING PDU TOO FAR PDU size %d", total_sizeP); // "DECODING PDU TOO FAR PDU size %d", total_sizeP);
if(total_sizeP < ((uint64_t)(&e_li_p->b3) - (uint64_t)header_pP)) {
LOG_E(RLC, "DECODING PDU TOO FAR PDU size %d\n", total_sizeP);
return -1;
}
pdu_info_pP->li_list[pdu_info_pP->num_li] = ((uint16_t)(e_li_p->b2 << 8)) & 0x0700; pdu_info_pP->li_list[pdu_info_pP->num_li] = ((uint16_t)(e_li_p->b2 << 8)) & 0x0700;
pdu_info_pP->li_list[pdu_info_pP->num_li] |= e_li_p->b3; pdu_info_pP->li_list[pdu_info_pP->num_li] |= e_li_p->b3;
li_to_read = e_li_p->b2 & 0x08; li_to_read = e_li_p->b2 & 0x08;
...@@ -93,10 +109,16 @@ signed int rlc_um_get_pdu_infos( ...@@ -93,10 +109,16 @@ signed int rlc_um_get_pdu_infos(
pdu_info_pP->header_size += 1; pdu_info_pP->header_size += 1;
} }
AssertFatal( pdu_info_pP->num_li <= RLC_UM_SEGMENT_NB_MAX_LI_PER_PDU, //AssertFatal( pdu_info_pP->num_li <= RLC_UM_SEGMENT_NB_MAX_LI_PER_PDU,
PROTOCOL_RLC_UM_CTXT_FMT"[GET PDU INFO] SN %04d TOO MANY LIs ", // PROTOCOL_RLC_UM_CTXT_FMT"[GET PDU INFO] SN %04d TOO MANY LIs ",
// PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP),
// pdu_info_pP->sn);
if(pdu_info_pP->num_li > RLC_UM_SEGMENT_NB_MAX_LI_PER_PDU) {
LOG_E(RLC, PROTOCOL_RLC_UM_CTXT_FMT"[GET PDU INFO] SN %04d TOO MANY LIs \n",
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP), PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP),
pdu_info_pP->sn); pdu_info_pP->sn);
return -1;
}
sum_li += pdu_info_pP->li_list[pdu_info_pP->num_li]; sum_li += pdu_info_pP->li_list[pdu_info_pP->num_li];
pdu_info_pP->num_li = pdu_info_pP->num_li + 1; pdu_info_pP->num_li = pdu_info_pP->num_li + 1;
...@@ -308,9 +330,17 @@ rlc_um_try_reassembly( ...@@ -308,9 +330,17 @@ rlc_um_try_reassembly(
__LINE__); __LINE__);
#endif #endif
} }
AssertFatal(size >= 0, "invalid size!"); //AssertFatal(size >= 0, "invalid size!");
AssertFatal((e==0) || (e==1), "invalid e!"); //AssertFatal((e==0) || (e==1), "invalid e!");
AssertFatal((fi >= 0) && (fi <= 3), "invalid fi!"); //AssertFatal((fi >= 0) && (fi <= 3), "invalid fi!");
if((size < 0) || ((e!=0) && (e!=1)) || ((fi < 0) || (fi > 3))){
LOG_E(RLC, "invalid size %d, e %d, fi %d\n", size, e, fi);
sn = (sn + 1) % rlc_pP->rx_sn_modulo;
if ((sn == rlc_pP->vr_uh) || (sn == end_snP)) {
continue_reassembly = 0;
}
continue;
}
if (e == RLC_E_FIXED_PART_DATA_FIELD_FOLLOW) { if (e == RLC_E_FIXED_PART_DATA_FIELD_FOLLOW) {
switch (fi) { switch (fi) {
...@@ -400,11 +430,14 @@ rlc_um_try_reassembly( ...@@ -400,11 +430,14 @@ rlc_um_try_reassembly(
break; break;
default: default:
AssertFatal( 0 , PROTOCOL_RLC_UM_CTXT_FMT" fi=%d! TRY REASSEMBLY SHOULD NOT GO HERE (%s:%u)\n", //AssertFatal( 0 , PROTOCOL_RLC_UM_CTXT_FMT" fi=%d! TRY REASSEMBLY SHOULD NOT GO HERE (%s:%u)\n",
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP), // PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP),
fi, // fi,
__FILE__, // __FILE__,
__LINE__); // __LINE__);
LOG_E(RLC, PROTOCOL_RLC_UM_CTXT_FMT" fi=%d! TRY REASSEMBLY SHOULD NOT GO HERE (%s:%u)\n",
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP), fi, __FILE__, __LINE__);
} }
} else { } else {
if (rlc_um_read_length_indicators(&data_p, e_li_p, li_array, &num_li, &size ) >= 0) { if (rlc_um_read_length_indicators(&data_p, e_li_p, li_array, &num_li, &size ) >= 0) {
...@@ -543,11 +576,14 @@ rlc_um_try_reassembly( ...@@ -543,11 +576,14 @@ rlc_um_try_reassembly(
// data_p is already ok, done by last loop above // data_p is already ok, done by last loop above
rlc_um_reassembly (ctxt_pP, rlc_pP, data_p, size); rlc_um_reassembly (ctxt_pP, rlc_pP, data_p, size);
} else { } else {
AssertFatal( 0 !=0, PROTOCOL_RLC_UM_CTXT_FMT" size=%d! SHOULD NOT GO HERE (%s:%u)\n", //AssertFatal( 0 !=0, PROTOCOL_RLC_UM_CTXT_FMT" size=%d! SHOULD NOT GO HERE (%s:%u)\n",
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP), // PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP),
size, // size,
__FILE__, // __FILE__,
__LINE__); // __LINE__);
LOG_E(RLC, PROTOCOL_RLC_UM_CTXT_FMT" size=%d! SHOULD NOT GO HERE (%s:%u)\n",
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP), size, __FILE__, __LINE__);
//rlc_pP->stat_rx_data_pdu_dropped += 1; //rlc_pP->stat_rx_data_pdu_dropped += 1;
rlc_pP->stat_rx_data_bytes_dropped += size; rlc_pP->stat_rx_data_bytes_dropped += size;
} }
......
...@@ -52,7 +52,7 @@ rlc_um_fsm_notify_event ( ...@@ -52,7 +52,7 @@ rlc_um_fsm_notify_event (
LOG_E(RLC, PROTOCOL_RLC_UM_CTXT_FMT" FSM WARNING PROTOCOL ERROR - EVENT %02X hex NOT EXPECTED FROM NULL_STATE\n", LOG_E(RLC, PROTOCOL_RLC_UM_CTXT_FMT" FSM WARNING PROTOCOL ERROR - EVENT %02X hex NOT EXPECTED FROM NULL_STATE\n",
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP), PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP),
eventP); eventP);
AssertFatal(1==0,"RLC-UM FSM WARNING PROTOCOL ERROR - EVENT NOT EXPECTED FROM NULL_STATE"); //AssertFatal(1==0,"RLC-UM FSM WARNING PROTOCOL ERROR - EVENT NOT EXPECTED FROM NULL_STATE");
return 0; return 0;
} }
......
...@@ -411,7 +411,11 @@ rlc_um_segment_10 (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t *rlc_pP ...@@ -411,7 +411,11 @@ rlc_um_segment_10 (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t *rlc_pP
#if TRACE_RLC_PAYLOAD #if TRACE_RLC_PAYLOAD
rlc_util_print_hex_octets(RLC, pdu_mem_p->data, data_pdu_size); rlc_util_print_hex_octets(RLC, pdu_mem_p->data, data_pdu_size);
#endif #endif
AssertFatal( pdu_tb_req_p->tb_size > 0 , "SEGMENT10: FINAL RLC UM PDU LENGTH %d", pdu_tb_req_p->tb_size); //AssertFatal( pdu_tb_req_p->tb_size > 0 , "SEGMENT10: FINAL RLC UM PDU LENGTH %d", pdu_tb_req_p->tb_size);
if(pdu_tb_req_p->tb_size <= 0) {
LOG_E(RLC, "SEGMENT10: FINAL RLC UM PDU LENGTH %d\n", pdu_tb_req_p->tb_size);
break;
}
pdu_p = NULL; pdu_p = NULL;
pdu_mem_p = NULL; pdu_mem_p = NULL;
...@@ -792,7 +796,11 @@ rlc_um_segment_5 (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t *rlc_pP) ...@@ -792,7 +796,11 @@ rlc_um_segment_5 (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t *rlc_pP)
#if TRACE_RLC_PAYLOAD #if TRACE_RLC_PAYLOAD
rlc_util_print_hex_octets(RLC, (unsigned char*)pdu_mem_p->data, data_pdu_size); rlc_util_print_hex_octets(RLC, (unsigned char*)pdu_mem_p->data, data_pdu_size);
#endif #endif
AssertFatal( pdu_tb_req_p->tb_size > 0 , "SEGMENT5: FINAL RLC UM PDU LENGTH %d", pdu_tb_req_p->tb_size); //AssertFatal( pdu_tb_req_p->tb_size > 0 , "SEGMENT5: FINAL RLC UM PDU LENGTH %d", pdu_tb_req_p->tb_size);
if(pdu_tb_req_p->tb_size <= 0) {
LOG_E(RLC, "SEGMENT5: FINAL RLC UM PDU LENGTH %d\n", pdu_tb_req_p->tb_size);
break;
}
pdu_p = NULL; pdu_p = NULL;
pdu_mem_p = NULL; pdu_mem_p = NULL;
......
...@@ -372,8 +372,11 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t* const ctxt_pP, ...@@ -372,8 +372,11 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t* const ctxt_pP,
return RLC_OP_STATUS_BAD_PARAMETER; return RLC_OP_STATUS_BAD_PARAMETER;
} }
//DevCheck(sdu_sizeP > 0, sdu_sizeP, 0, 0);
DevCheck(sdu_sizeP > 0, sdu_sizeP, 0, 0); if(sdu_sizeP <= 0) {
LOG_E(RLC, "sdu_sizeP %d, file %s, line %s\n", sdu_sizeP, __FILE__ ,__LINE__);
return RLC_OP_STATUS_BAD_PARAMETER;
}
#if !defined(Rel10) && !defined(Rel14) #if !defined(Rel10) && !defined(Rel14)
DevCheck(MBMS_flagP == 0, MBMS_flagP, 0, 0); DevCheck(MBMS_flagP == 0, MBMS_flagP, 0, 0);
...@@ -629,7 +632,11 @@ rlc_module_init (void) ...@@ -629,7 +632,11 @@ rlc_module_init (void)
rlc_rrc_data_conf = NULL; rlc_rrc_data_conf = NULL;
rlc_coll_p = hashtable_create ((maxDRB + 2) * 16, NULL, rb_free_rlc_union); rlc_coll_p = hashtable_create ((maxDRB + 2) * 16, NULL, rb_free_rlc_union);
AssertFatal(rlc_coll_p != NULL, "UNRECOVERABLE error, RLC hashtable_create failed"); //AssertFatal(rlc_coll_p != NULL, "UNRECOVERABLE error, RLC hashtable_create failed");
if(rlc_coll_p == NULL) {
LOG_E(RLC, "UNRECOVERABLE error, RLC hashtable_create failed\n");
return -1;
}
for (module_id1=0; module_id1 < NUMBER_OF_UE_MAX; module_id1++) { for (module_id1=0; module_id1 < NUMBER_OF_UE_MAX; module_id1++) {
#if defined(Rel10) || defined(Rel14) #if defined(Rel10) || defined(Rel14)
......
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