Commit 597890ab authored by Haruki NAOI's avatar Haruki NAOI

eNB RLC Assertions(assert macros) skip & fix warning.

parent b2798434
...@@ -130,8 +130,13 @@ rlc_am_pdu_sdu_data_cnf( ...@@ -130,8 +130,13 @@ rlc_am_pdu_sdu_data_cnf(
for (pdu_sdu_index = 0; pdu_sdu_index < rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE].nb_sdus; pdu_sdu_index++) { for (pdu_sdu_index = 0; pdu_sdu_index < rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE].nb_sdus; pdu_sdu_index++) {
sdu_index = rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE].sdus_index[pdu_sdu_index]; sdu_index = rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE].sdus_index[pdu_sdu_index];
assert(sdu_index >= 0); //assert(sdu_index >= 0);
assert(sdu_index < RLC_AM_SDU_CONTROL_BUFFER_SIZE); //assert(sdu_index < RLC_AM_SDU_CONTROL_BUFFER_SIZE);
if(sdu_index < 0 || sdu_index >= RLC_AM_SDU_CONTROL_BUFFER_SIZE) {
LOG_E(RLC, "sdu_index error. sdu_index %d, pdu_sdu_index %d\n", sdu_index, pdu_sdu_index);
continue;
}
rlc_pP->input_sdus[sdu_index].nb_pdus_ack += 1; rlc_pP->input_sdus[sdu_index].nb_pdus_ack += 1;
if ((rlc_pP->input_sdus[sdu_index].nb_pdus_ack == rlc_pP->input_sdus[sdu_index].nb_pdus) && if ((rlc_pP->input_sdus[sdu_index].nb_pdus_ack == rlc_pP->input_sdus[sdu_index].nb_pdus) &&
......
...@@ -57,7 +57,12 @@ rlc_am_reassembly ( ...@@ -57,7 +57,12 @@ rlc_am_reassembly (
if (rlc_pP->output_sdu_in_construction == NULL) { if (rlc_pP->output_sdu_in_construction == NULL) {
rlc_pP->output_sdu_in_construction = get_free_mem_block (RLC_SDU_MAX_SIZE, __func__); rlc_pP->output_sdu_in_construction = get_free_mem_block (RLC_SDU_MAX_SIZE, __func__);
rlc_pP->output_sdu_size_to_write = 0; rlc_pP->output_sdu_size_to_write = 0;
assert(rlc_pP->output_sdu_in_construction != NULL); //assert(rlc_pP->output_sdu_in_construction != NULL);
if(rlc_pP->output_sdu_in_construction == NULL) {
LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[REASSEMBLY PAYLOAD] output_sdu_in_construction is NULL\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
return;
}
} }
if (rlc_pP->output_sdu_in_construction != NULL) { if (rlc_pP->output_sdu_in_construction != NULL) {
......
...@@ -60,10 +60,14 @@ boolean_t rlc_am_nack_pdu ( ...@@ -60,10 +60,14 @@ boolean_t rlc_am_nack_pdu (
sdu_size_t pdu_data_to_retx = 0; sdu_size_t pdu_data_to_retx = 0;
if (mb_p != NULL) { if (mb_p != NULL) {
assert(so_startP <= so_endP); //assert(so_startP <= so_endP);
if(so_startP > so_endP) {
LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[NACK-PDU] ERROR NACK MISSING PDU, so_startP %d, so_endP %d\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),so_startP, so_endP);
status = FALSE;
}
// Handle full PDU NACK first // Handle full PDU NACK first
if ((so_startP == 0) && (so_endP == 0x7FFF)) { else if ((so_startP == 0) && (so_endP == 0x7FFF)) {
if ((prev_nack_snP != snP) && (tx_data_pdu_buffer_p->flags.ack == 0) && (tx_data_pdu_buffer_p->flags.max_retransmit == 0)) { if ((prev_nack_snP != snP) && (tx_data_pdu_buffer_p->flags.ack == 0) && (tx_data_pdu_buffer_p->flags.max_retransmit == 0)) {
pdu_data_to_retx = tx_data_pdu_buffer_p->payload_size; pdu_data_to_retx = tx_data_pdu_buffer_p->payload_size;
/* Increment VtReTxNext if this is the first NACK or if some segments have already been transmitted */ /* Increment VtReTxNext if this is the first NACK or if some segments have already been transmitted */
...@@ -82,7 +86,12 @@ boolean_t rlc_am_nack_pdu ( ...@@ -82,7 +86,12 @@ boolean_t rlc_am_nack_pdu (
snP, snP,
so_stopP); so_stopP);
#endif #endif
assert(tx_data_pdu_buffer_p->nack_so_start < tx_data_pdu_buffer_p->payload_size); //assert(tx_data_pdu_buffer_p->nack_so_start < tx_data_pdu_buffer_p->payload_size);
if(tx_data_pdu_buffer_p->nack_so_start >= tx_data_pdu_buffer_p->payload_size){
LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[NACK-PDU] ERROR NACK MISSING PDU, nack_so_start %d, payload_size %d\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),tx_data_pdu_buffer_p->nack_so_start, tx_data_pdu_buffer_p->payload_size);
status = FALSE;
}
} }
else { else {
status = FALSE; status = FALSE;
...@@ -230,7 +239,7 @@ void rlc_am_ack_pdu ( ...@@ -230,7 +239,7 @@ void rlc_am_ack_pdu (
{ {
LOG_E(RLC, "RLC AM Rx Status Report sn=%d acked twice but is pending for Retx vtA=%d vtS=%d LcId=%d\n", LOG_E(RLC, "RLC AM Rx Status Report sn=%d acked twice but is pending for Retx vtA=%d vtS=%d LcId=%d\n",
snP, rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id); snP, rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
return NULL; return;
} }
/* /*
AssertFatal (tx_data_pdu_buffer->flags.ack == 0, AssertFatal (tx_data_pdu_buffer->flags.ack == 0,
...@@ -1264,7 +1273,11 @@ void rlc_am_tx_buffer_display ( ...@@ -1264,7 +1273,11 @@ void rlc_am_tx_buffer_display (
LOG_D(RLC, "SO:%04d->%04d)\t", tx_data_pdu_buffer_p->nack_so_start, tx_data_pdu_buffer_p->nack_so_stop); LOG_D(RLC, "SO:%04d->%04d)\t", tx_data_pdu_buffer_p->nack_so_start, tx_data_pdu_buffer_p->nack_so_stop);
} else { } else {
for (i=0; i<tx_data_pdu_buffer_p->num_holes; i++) { for (i=0; i<tx_data_pdu_buffer_p->num_holes; i++) {
assert(i < RLC_AM_MAX_HOLES_REPORT_PER_PDU); //assert(i < RLC_AM_MAX_HOLES_REPORT_PER_PDU);
if(i >= RLC_AM_MAX_HOLES_REPORT_PER_PDU) {
LOG_E(RLC, "num_holes error. %d %d %d\n", tx_data_pdu_buffer_p->num_holes, i, RLC_AM_MAX_HOLES_REPORT_PER_PDU);
break;
}
LOG_D(RLC, "SO:%04d->%04d)\t", tx_data_pdu_buffer_p->hole_so_start[i], tx_data_pdu_buffer_p->hole_so_stop[i]); LOG_D(RLC, "SO:%04d->%04d)\t", tx_data_pdu_buffer_p->hole_so_start[i], tx_data_pdu_buffer_p->hole_so_stop[i]);
} }
} }
......
...@@ -1649,7 +1649,8 @@ list2_insert_before_element ( ...@@ -1649,7 +1649,8 @@ list2_insert_before_element (
return element_to_insert_pP; return element_to_insert_pP;
} else { } else {
assert(2==1); //assert(2==1);
LOG_E(RLC, "list2_insert_before_element error. element_to_insert_pP %p, element_pP %p\n", element_to_insert_pP,element_pP);
return NULL; return NULL;
} }
} }
...@@ -1676,7 +1677,8 @@ list2_insert_after_element ( ...@@ -1676,7 +1677,8 @@ list2_insert_after_element (
return element_to_insert_pP; return element_to_insert_pP;
} else { } else {
assert(2==1); //assert(2==1);
LOG_E(RLC, "list2_insert_after_element error. element_to_insert_pP %p, element_pP %p\n", element_to_insert_pP,element_pP);
return NULL; return NULL;
} }
} }
...@@ -1726,7 +1728,8 @@ rlc_am_rx_list_display ( ...@@ -1726,7 +1728,8 @@ rlc_am_rx_list_display (
//if (cursor_p == cursor_p->next) { //if (cursor_p == cursor_p->next) {
// rlc_am_v9_3_0_test_print_trace(); // rlc_am_v9_3_0_test_print_trace();
//} //}
assert(cursor_p != cursor_p->next); //assert(cursor_p != cursor_p->next);
LOG_E(RLC, "rlc_am_rx_list_display error. cursor_p %p, cursor_p->next %p\n", cursor_p, cursor_p->next);
cursor_p = cursor_p->next; cursor_p = cursor_p->next;
loop++; loop++;
} }
......
...@@ -299,7 +299,12 @@ void rlc_am_segment_10 ( ...@@ -299,7 +299,12 @@ void rlc_am_segment_10 (
pdu_mngt_p->sdus_index[pdu_mngt_p->nb_sdus++] = sdu_buffer_index; pdu_mngt_p->sdus_index[pdu_mngt_p->nb_sdus++] = sdu_buffer_index;
sdu_mngt_p->pdus_index[sdu_mngt_p->nb_pdus++] = rlc_pP->vt_s % RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE; sdu_mngt_p->pdus_index[sdu_mngt_p->nb_pdus++] = rlc_pP->vt_s % RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE;
assert(sdu_mngt_p->nb_pdus < RLC_AM_MAX_SDU_FRAGMENTS); //assert(sdu_mngt_p->nb_pdus < RLC_AM_MAX_SDU_FRAGMENTS);
if(sdu_mngt_p->nb_pdus >= RLC_AM_MAX_SDU_FRAGMENTS) {
LOG_E(RLC,PROTOCOL_RLC_AM_CTXT_FMT"[SEGMENT] loop error. %d %d\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), sdu_mngt_p->nb_pdus, RLC_AM_MAX_SDU_FRAGMENTS);
break;
}
sdu_buffer_index = (sdu_buffer_index + 1) % RLC_AM_SDU_CONTROL_BUFFER_SIZE; sdu_buffer_index = (sdu_buffer_index + 1) % RLC_AM_SDU_CONTROL_BUFFER_SIZE;
} }
...@@ -462,11 +467,11 @@ void rlc_am_segment_10 ( ...@@ -462,11 +467,11 @@ void rlc_am_segment_10 (
rlc_pP->current_sdu_index = (rlc_pP->current_sdu_index + 1) % RLC_AM_SDU_CONTROL_BUFFER_SIZE; rlc_pP->current_sdu_index = (rlc_pP->current_sdu_index + 1) % RLC_AM_SDU_CONTROL_BUFFER_SIZE;
} }
} else { } else {
LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEGMENT] Filling PDU with %d all remaining bytes of SDU and reduce TB size by %d bytes\n", LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEGMENT] Filling PDU with %d all remaining bytes of SDU and reduce TB size by %d bytes\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
sdu_mngt_p->sdu_remaining_size, sdu_mngt_p->sdu_remaining_size,
pdu_remaining_size - sdu_mngt_p->sdu_remaining_size); pdu_remaining_size - sdu_mngt_p->sdu_remaining_size);
assert(1!=1); //assert(1!=1);
memcpy(data, data_sdu_p, sdu_mngt_p->sdu_remaining_size); memcpy(data, data_sdu_p, sdu_mngt_p->sdu_remaining_size);
pdu_mngt_p->payload_size += sdu_mngt_p->sdu_remaining_size; pdu_mngt_p->payload_size += sdu_mngt_p->sdu_remaining_size;
pdu_remaining_size = pdu_remaining_size - sdu_mngt_p->sdu_remaining_size; pdu_remaining_size = pdu_remaining_size - sdu_mngt_p->sdu_remaining_size;
...@@ -520,7 +525,11 @@ void rlc_am_segment_10 ( ...@@ -520,7 +525,11 @@ void rlc_am_segment_10 (
pdu_tb_req_p->data_ptr = (unsigned char*)pdu_p; pdu_tb_req_p->data_ptr = (unsigned char*)pdu_p;
pdu_tb_req_p->tb_size = data_pdu_size - pdu_remaining_size; pdu_tb_req_p->tb_size = data_pdu_size - pdu_remaining_size;
//#warning "why 3000: changed to RLC_SDU_MAX_SIZE " //#warning "why 3000: changed to RLC_SDU_MAX_SIZE "
assert(pdu_tb_req_p->tb_size < RLC_SDU_MAX_SIZE ); //assert(pdu_tb_req_p->tb_size < RLC_SDU_MAX_SIZE );
if(pdu_tb_req_p->tb_size >= RLC_SDU_MAX_SIZE) {
LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEGMENT] tb_size error. %d, %d\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),pdu_tb_req_p->tb_size, RLC_SDU_MAX_SIZE);
}
rlc_am_pdu_polling(ctxt_pP, rlc_pP, pdu_p, pdu_mngt_p->payload_size,true); rlc_am_pdu_polling(ctxt_pP, rlc_pP, pdu_p, pdu_mngt_p->payload_size,true);
//list_add_tail_eurecom (pdu_mem_p, &rlc_pP->segmentation_pdu_list); //list_add_tail_eurecom (pdu_mem_p, &rlc_pP->segmentation_pdu_list);
......
...@@ -154,7 +154,10 @@ rlc_am_write16_bit_field( ...@@ -154,7 +154,10 @@ rlc_am_write16_bit_field(
signed int bits_to_writeP, signed int bits_to_writeP,
const uint16_t valueP) const uint16_t valueP)
{ {
assert(bits_to_writeP <= 16); //assert(bits_to_writeP <= 16);
if(bits_to_writeP > 16) {
LOG_E(RLC, "bits_to_writeP error. %d\n", bits_to_writeP);
}
if (bits_to_writeP > 8) { if (bits_to_writeP > 8) {
rlc_am_write8_bit_field(data_ppP,bit_pos_pP, bits_to_writeP - 8, (uint8_t)(valueP >> 8)); rlc_am_write8_bit_field(data_ppP,bit_pos_pP, bits_to_writeP - 8, (uint8_t)(valueP >> 8));
...@@ -309,8 +312,13 @@ rlc_am_receive_process_control_pdu( ...@@ -309,8 +312,13 @@ rlc_am_receive_process_control_pdu(
// POLL_SN: // POLL_SN:
// - if t-PollRetransmit is running: // - if t-PollRetransmit is running:
// - stop and reset t-PollRetransmit. // - stop and reset t-PollRetransmit.
assert(ack_sn < RLC_AM_SN_MODULO); //assert(ack_sn < RLC_AM_SN_MODULO);
assert(rlc_pP->control_pdu_info.num_nack < RLC_AM_MAX_NACK_IN_STATUS_PDU); //assert(rlc_pP->control_pdu_info.num_nack < RLC_AM_MAX_NACK_IN_STATUS_PDU);
if(ack_sn >= RLC_AM_SN_MODULO || rlc_pP->control_pdu_info.num_nack >= RLC_AM_MAX_NACK_IN_STATUS_PDU) {
LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT" illegal ack_sn %d, num_nack %d\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), ack_sn, rlc_pP->control_pdu_info.num_nack);
return;
}
/* Note : ackSn can be equal to current vtA only in case the status pdu contains a list of nack_sn with same value = vtA with SOStart/SOEnd */ /* Note : ackSn can be equal to current vtA only in case the status pdu contains a list of nack_sn with same value = vtA with SOStart/SOEnd */
/* and meaning the report is not complete due to not enough ressources to fill all SOStart/SOEnd of this NACK_SN */ /* and meaning the report is not complete due to not enough ressources to fill all SOStart/SOEnd of this NACK_SN */
......
...@@ -748,13 +748,11 @@ rlc_um_segment_5 (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t *rlc_pP) ...@@ -748,13 +748,11 @@ rlc_um_segment_5 (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t *rlc_pP)
sdu_mngt_p = NULL; sdu_mngt_p = NULL;
} else { } else {
#if TRACE_RLC_UM_SEGMENT LOG_E(RLC, PROTOCOL_RLC_UM_CTXT_FMT" Filling PDU with %d all remaining bytes of SDU and reduce TB size by %d bytes\n",
LOG_D(RLC, PROTOCOL_RLC_UM_CTXT_FMT" Filling PDU with %d all remaining bytes of SDU and reduce TB size by %d bytes\n",
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_pP), PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_pP),
sdu_mngt_p->sdu_remaining_size, sdu_mngt_p->sdu_remaining_size,
pdu_remaining_size - sdu_mngt_p->sdu_remaining_size); pdu_remaining_size - sdu_mngt_p->sdu_remaining_size);
#endif //assert(1!=1);
assert(1!=1);
memcpy(data, data_sdu_p, sdu_mngt_p->sdu_remaining_size); memcpy(data, data_sdu_p, sdu_mngt_p->sdu_remaining_size);
// reduce the size of the PDU // reduce the size of the PDU
continue_fill_pdu_with_sdu = 0; continue_fill_pdu_with_sdu = 0;
......
...@@ -374,7 +374,7 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t* const ctxt_pP, ...@@ -374,7 +374,7 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t* const ctxt_pP,
//DevCheck(sdu_sizeP > 0, sdu_sizeP, 0, 0); //DevCheck(sdu_sizeP > 0, sdu_sizeP, 0, 0);
if(sdu_sizeP <= 0) { if(sdu_sizeP <= 0) {
LOG_E(RLC, "sdu_sizeP %d, file %s, line %s\n", sdu_sizeP, __FILE__ ,__LINE__); LOG_E(RLC, "sdu_sizeP %d, file %s, line %d\n", sdu_sizeP, __FILE__ ,__LINE__);
return RLC_OP_STATUS_BAD_PARAMETER; return RLC_OP_STATUS_BAD_PARAMETER;
} }
...@@ -409,7 +409,7 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t* const ctxt_pP, ...@@ -409,7 +409,7 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t* const ctxt_pP,
} else { } else {
rlc_mode = RLC_MODE_NONE; rlc_mode = RLC_MODE_NONE;
//AssertFatal (0 , "RLC not configured key %ju\n", key); //AssertFatal (0 , "RLC not configured key %ju\n", key);
LOG_E("RLC not configured key %ju\n", key); LOG_E(RLC, "not configured key %lu\n", key);
return RLC_OP_STATUS_OUT_OF_RESSOURCES; return RLC_OP_STATUS_OUT_OF_RESSOURCES;
} }
......
...@@ -430,7 +430,7 @@ rlc_buffer_occupancy_t mac_rlc_get_buffer_occupancy_ind( ...@@ -430,7 +430,7 @@ rlc_buffer_occupancy_t mac_rlc_get_buffer_occupancy_ind(
/* Then this function is called during MAC multiplexing ue_get_sdu(), and it may be call several times for the same bearer if it is in AM mode and there are several PDU types to transmit */ /* Then this function is called during MAC multiplexing ue_get_sdu(), and it may be call several times for the same bearer if it is in AM mode and there are several PDU types to transmit */
//AssertFatal(enb_flagP == FALSE,"RLC Tx mac_rlc_get_buffer_occupancy_ind function is not implemented for eNB LcId=%d\n", channel_idP); //AssertFatal(enb_flagP == FALSE,"RLC Tx mac_rlc_get_buffer_occupancy_ind function is not implemented for eNB LcId=%d\n", channel_idP);
if(enb_flagP != FALSE){ if(enb_flagP != FALSE){
LOG_E("RLC Tx mac_rlc_get_buffer_occupancy_ind function is not implemented for eNB LcId=%d\n", channel_idP); LOG_E(RLC, "Tx mac_rlc_get_buffer_occupancy_ind function is not implemented for eNB LcId=%u\n", channel_idP);
return 0; return 0;
} }
......
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