Merge remote-tracking branch 'origin/fix-regression-4G' into integration_2024_w44 (!3008)

Fix Regression 4G

- Fix various bugs and/or regressions in 4G code
- Also, the CI does not test RFsim 4G with --sanitize, enables this to
  detect problems.
This commit is contained in:
Robert Schmidt
2024-11-04 19:43:52 +01:00
58 changed files with 363 additions and 470 deletions
+1 -1
View File
@@ -167,7 +167,7 @@ typedef struct as_stmsi_s {
/* Dedicated NAS information */
typedef struct as_nas_info_s {
uint32_t length; /* Length of the NAS information data */
Byte_t* data; /* Dedicated NAS information data container */
Byte_t* nas_data; /* Dedicated NAS information data container */
} as_nas_info_t;
/* Radio Access Bearer identity */
+15 -15
View File
@@ -57,26 +57,26 @@ MESSAGE_DEF(RRC_CONFIGURATION_REQ, MESSAGE_PRIORITY_MED, RrcConfigura
MESSAGE_DEF(NBIOTRRC_CONFIGURATION_REQ, MESSAGE_PRIORITY_MED, NbIoTRrcConfigurationReq, nbiotrrc_configuration_req)
// UE: NAS -> RRC messages
MESSAGE_DEF(NAS_KENB_REFRESH_REQ, MESSAGE_PRIORITY_MED, NasKenbRefreshReq, nas_kenb_refresh_req)
MESSAGE_DEF(NAS_CELL_SELECTION_REQ, MESSAGE_PRIORITY_MED, NasCellSelectionReq, nas_cell_selection_req)
MESSAGE_DEF(NAS_CONN_ESTABLI_REQ, MESSAGE_PRIORITY_MED, NasConnEstabliReq, nas_conn_establi_req)
MESSAGE_DEF(NAS_UPLINK_DATA_REQ, MESSAGE_PRIORITY_MED, NasUlDataReq, nas_ul_data_req)
MESSAGE_DEF(NAS_DETACH_REQ, MESSAGE_PRIORITY_MED, NasDetachReq, nas_detach_req)
MESSAGE_DEF(NAS_DEREGISTRATION_REQ, MESSAGE_PRIORITY_MED, NasDeregistrationReq, nas_deregistration_req)
MESSAGE_DEF(NAS_KENB_REFRESH_REQ, MESSAGE_PRIORITY_MED, kenb_refresh_req_t, nas_kenb_refresh_req)
MESSAGE_DEF(NAS_CELL_SELECTION_REQ, MESSAGE_PRIORITY_MED, cell_info_req_t, nas_cell_selection_req)
MESSAGE_DEF(NAS_CONN_ESTABLI_REQ, MESSAGE_PRIORITY_MED, nas_establish_req_t, nas_conn_establi_req)
MESSAGE_DEF(NAS_UPLINK_DATA_REQ, MESSAGE_PRIORITY_MED, ul_info_transfer_req_t, nas_ul_data_req)
MESSAGE_DEF(NAS_DETACH_REQ, MESSAGE_PRIORITY_MED, nas_detach_req_t, nas_detach_req)
MESSAGE_DEF(NAS_DEREGISTRATION_REQ, MESSAGE_PRIORITY_MED, nas_deregistration_req_t, nas_deregistration_req)
MESSAGE_DEF(NAS_RAB_ESTABLI_RSP, MESSAGE_PRIORITY_MED, NasRabEstRsp, nas_rab_est_rsp)
MESSAGE_DEF(NAS_RAB_ESTABLI_RSP, MESSAGE_PRIORITY_MED, rab_establish_rsp_t, nas_rab_est_rsp)
MESSAGE_DEF(NAS_OAI_TUN_NSA, MESSAGE_PRIORITY_MED, NasOaiTunNsa, nas_oai_tun_nsa)
MESSAGE_DEF(NAS_OAI_TUN_NSA, MESSAGE_PRIORITY_MED, nas_oai_tun_nsa_t, nas_oai_tun_nsa)
// UE: RRC -> NAS messages
MESSAGE_DEF(NAS_CELL_SELECTION_CNF, MESSAGE_PRIORITY_MED, NasCellSelectionCnf, nas_cell_selection_cnf)
MESSAGE_DEF(NAS_CELL_SELECTION_IND, MESSAGE_PRIORITY_MED, NasCellSelectionInd, nas_cell_selection_ind)
MESSAGE_DEF(NAS_PAGING_IND, MESSAGE_PRIORITY_MED, NasPagingInd, nas_paging_ind)
MESSAGE_DEF(NAS_CONN_ESTABLI_CNF, MESSAGE_PRIORITY_MED, NasConnEstabCnf, nas_conn_establi_cnf)
MESSAGE_DEF(NAS_CONN_RELEASE_IND, MESSAGE_PRIORITY_MED, NasConnReleaseInd, nas_conn_release_ind)
MESSAGE_DEF(NAS_CELL_SELECTION_CNF, MESSAGE_PRIORITY_MED, cell_info_cnf_t, nas_cell_selection_cnf)
MESSAGE_DEF(NAS_CELL_SELECTION_IND, MESSAGE_PRIORITY_MED, cell_info_ind_t, nas_cell_selection_ind)
MESSAGE_DEF(NAS_PAGING_IND, MESSAGE_PRIORITY_MED, paging_ind_t, nas_paging_ind)
MESSAGE_DEF(NAS_CONN_ESTABLI_CNF, MESSAGE_PRIORITY_MED, nas_establish_cnf_t, nas_conn_establi_cnf)
MESSAGE_DEF(NAS_CONN_RELEASE_IND, MESSAGE_PRIORITY_MED, nas_release_ind_t, nas_conn_release_ind)
MESSAGE_DEF(NR_NAS_CONN_RELEASE_IND, MESSAGE_PRIORITY_MED, NRNasConnReleaseInd, nr_nas_conn_release_ind)
MESSAGE_DEF(NAS_UPLINK_DATA_CNF, MESSAGE_PRIORITY_MED, NasUlDataCnf, nas_ul_data_cnf)
MESSAGE_DEF(NAS_DOWNLINK_DATA_IND, MESSAGE_PRIORITY_MED, NasDlDataInd, nas_dl_data_ind)
MESSAGE_DEF(NAS_UPLINK_DATA_CNF, MESSAGE_PRIORITY_MED, ul_info_transfer_cnf_t, nas_ul_data_cnf)
MESSAGE_DEF(NAS_DOWNLINK_DATA_IND, MESSAGE_PRIORITY_MED, dl_info_transfer_ind_t, nas_dl_data_ind)
// xNB: realtime -> RRC messages
MESSAGE_DEF(RRC_SUBFRAME_PROCESS, MESSAGE_PRIORITY_MED, RrcSubframeProcess, rrc_subframe_process)
+1 -22
View File
@@ -422,28 +422,7 @@ typedef struct NRDuDlReq_s {
rnti_t rnti;
uint8_t *buf;
uint64_t srb_id;
} NRDuDlReq_t;
// UE: NAS -> RRC messages
typedef kenb_refresh_req_t NasKenbRefreshReq;
typedef cell_info_req_t NasCellSelectionReq;
typedef nas_establish_req_t NasConnEstabliReq;
typedef ul_info_transfer_req_t NasUlDataReq;
typedef nas_deregistration_req_t NasDeregistrationReq;
typedef nas_detach_req_t NasDetachReq;
typedef rab_establish_rsp_t NasRabEstRsp;
typedef nas_oai_tun_nsa_t NasOaiTunNsa;
// UE: RRC -> NAS messages
typedef cell_info_cnf_t NasCellSelectionCnf;
typedef cell_info_ind_t NasCellSelectionInd;
typedef paging_ind_t NasPagingInd;
typedef nas_establish_cnf_t NasConnEstabCnf;
typedef nas_release_ind_t NasConnReleaseInd;
typedef ul_info_transfer_cnf_t NasUlDataCnf;
typedef dl_info_transfer_ind_t NasDlDataInd;
} NRDuDlReq_t;
// eNB: realtime -> RRC messages
typedef struct rrc_subframe_process_s {
+1 -24
View File
@@ -888,30 +888,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
pdcp_remove_UE(&ctxt);
}
/* Note: This should not be done in the MAC! */
/*
for (int ii=0; ii<MAX_MOBILES_PER_ENB; ii++) {
LTE_eNB_ULSCH_t *ulsch = RC.eNB[module_idP][CC_id]->ulsch[ii];
if((ulsch != NULL) && (ulsch->rnti == rnti)) {
void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch);
LOG_I(MAC, "clean_eNb_ulsch UE %x \n", rnti);
clean_eNb_ulsch(ulsch);
}
}
for (int ii=0; ii<MAX_MOBILES_PER_ENB; ii++) {
LTE_eNB_DLSCH_t *dlsch = RC.eNB[module_idP][CC_id]->dlsch[ii][0];
if((dlsch != NULL) && (dlsch->rnti == rnti)) {
void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch);
LOG_I(MAC, "clean_eNb_dlsch UE %x \n", rnti);
clean_eNb_dlsch(dlsch);
}
}
*/
int id;
int id;
// clean ULSCH entries for rnti
id = find_ulsch(rnti,RC.eNB[module_idP][CC_id],SEARCH_EXIST);
+8 -7
View File
@@ -449,7 +449,7 @@ void generate_Msg2(module_id_t module_idP,
add_msg3 (module_idP, CC_idP, ra, frameP, subframeP);
ra->eRA_state = WAITMSG3;
/* DL request */
LOG_D(MAC, "[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, Programming TX Req\n",
LOG_I(MAC, "[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, Programming TX Req\n",
module_idP,
frameP,
subframeP);
@@ -465,12 +465,13 @@ void generate_Msg2(module_id_t module_idP,
}
} else {
if ((ra->Msg2_frame == frameP) && (ra->Msg2_subframe == subframeP)) {
LOG_D(MAC,
"[eNB %d] CC_id %d Frame %d, subframeP %d: Generating RAR DCI, state %s\n",
LOG_I(MAC,
"[eNB %d] CC_id %d Frame %d, subframeP %d: Generating RAR DCI for rnti %x, state %s\n",
module_idP,
CC_idP,
frameP,
subframeP,
ra->RA_rnti,
era_text[ra->eRA_state]);
// Allocate 4 PRBS starting in RB 0
first_rb = 0;
@@ -1227,7 +1228,7 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP,
} // Msg4 frame/subframe
} // regular LTE case
} else {
LOG_D(MAC,
LOG_I(MAC,
"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d : Msg4 acknowledged\n",
module_idP, CC_idP, frameP, subframeP);
ra->eRA_state = IDLE;
@@ -1284,7 +1285,7 @@ initiate_ra_proc(module_id_t module_idP,
) {
uint8_t i;
COMMON_channels_t *cc = &RC.mac[module_idP]->common_channels[CC_id];
RA_t *ra = &cc->ra[0];
RA_t *ra = cc->ra;
struct LTE_PRACH_ConfigSIB_v1310 *ext4_prach = NULL;
LTE_PRACH_ParametersListCE_r13_t *prach_ParametersListCE_r13 = NULL;
@@ -1451,7 +1452,7 @@ cancel_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP,
rnti_t rnti) {
unsigned char i;
RA_t *ra = (RA_t *) & RC.mac[module_idP]->common_channels[CC_id].ra[0];
LOG_D(MAC,
LOG_I(MAC,
"[eNB %d][RAPROC] CC_id %d Frame %d Cancelling RA procedure for UE rnti %x\n",
module_idP, CC_id, frameP, rnti);
@@ -1472,7 +1473,7 @@ void clear_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP) {
RA_t *ra = (RA_t *) & RC.mac[module_idP]->common_channels[CC_id].ra[0];
for (i = 0; i < NB_RA_PROC_MAX; i++) {
LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Clear Random access information rnti %x\n", module_idP, CC_id, frameP, ra[i].rnti);
LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Clear Random access information rnti %x\n", module_idP, CC_id, frameP, ra[i].rnti);
ra[i].eRA_state = IDLE;
ra[i].timing_offset = 0;
ra[i].RRC_timer = 20;
@@ -3471,7 +3471,7 @@ CCE_allocation_infeasible(int module_idP,
if (format_flag != 2) { // DL DCI
if (DL_req->number_pdu == MAX_NUM_DL_PDU) {
LOG_W(MAC, "Subframe %d: FAPI DL structure is full, skip scheduling UE %d\n", subframe, rnti);
LOG_W(MAC, "Subframe %d: FAPI DL structure is full, skip scheduling UE %x\n", subframe, rnti);
} else {
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG;
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE;
@@ -3489,7 +3489,7 @@ CCE_allocation_infeasible(int module_idP,
}
} else { // ue-specific UL DCI
if (HI_DCI0_req->number_of_dci + HI_DCI0_req->number_of_hi == MAX_NUM_HI_DCI0_PDU) {
LOG_W(MAC, "Subframe %d: FAPI UL structure is full, skip scheduling UE %d\n", subframe, rnti);
LOG_W(MAC, "Subframe %d: FAPI UL structure is full, skip scheduling UE %x\n", subframe, rnti);
} else {
hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_DCI_PDU_TYPE;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.tl.tag = NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL8_TAG;
@@ -3516,7 +3516,7 @@ int CCE_try_allocate_dlsch(int module_id,
nfapi_dl_config_request_body_t *DL_req = &RC.mac[module_id]->DL_req[CC_id].dl_config_request_body;
if (DL_req->number_pdu >= MAX_NUM_DL_PDU) {
LOG_W(MAC, "Subframe %d: FAPI DL structure is full, skip scheduling UE %d\n", subframe, rnti);
LOG_W(MAC, "Subframe %d: FAPI DL structure is full, skip scheduling UE %x\n", subframe, rnti);
return -1;
}
@@ -3577,7 +3577,7 @@ int CCE_try_allocate_ulsch(int module_id,
nfapi_hi_dci0_request_body_t *HI_DCI0_req = &RC.mac[module_id]->HI_DCI0_req[CC_id][subframe].hi_dci0_request_body;
if (HI_DCI0_req->number_of_dci + HI_DCI0_req->number_of_hi >= MAX_NUM_HI_DCI0_PDU) {
LOG_W(MAC, "Subframe %d: FAPI UL structure is full, skip scheduling UE %d\n", subframe, rnti);
LOG_W(MAC, "Subframe %d: FAPI UL structure is full, skip scheduling UE %x\n", subframe, rnti);
return -1;
}
+1 -1
View File
@@ -506,7 +506,7 @@ typedef struct {
/*!\brief RA process state*/
typedef enum { IDLE = 0, MSG2, WAITMSG3, MSG4, WAITMSG4ACK, MSGCRNTI, MSGCRNTI_ACK } eRA_state;
static const char *const era_text[] = {"IDLE", "Ms2", "WAITMSG3", "WAITMSG4ACK", "MSGCRNTI", "MSGCRNTIACK"};
static const char *const era_text[] = {"IDLE", "Msg2", "WAITMSG3", "WAITMSG4ACK", "MSGCRNTI", "MSGCRNTIACK"};
/*!\brief UE DLSCH scheduling states*/
typedef enum { S_DL_NONE = 0, S_DL_SCHEDULED } UE_DLSCH_STATUS;
+14 -12
View File
@@ -557,6 +557,9 @@ bool pdcp_data_req(protocol_ctxt_t *ctxt_pP,
break;
}
if (pdcp_uid == MAX_MOBILES_PER_ENB)
return ret;
LOG_D(PDCP,"ueid %d lcid %d tx seq num %d\n", pdcp_uid, (int)(rb_idP+rb_offset), current_sn);
Pdcp_stats_tx[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]++;
Pdcp_stats_tx_tmp_w[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]++;
@@ -1104,16 +1107,17 @@ bool pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP,
break;
}
}
Pdcp_stats_rx[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]++;
Pdcp_stats_rx_tmp_w[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]++;
Pdcp_stats_rx_bytes[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+=(sdu_buffer_sizeP - payload_offset);
Pdcp_stats_rx_bytes_tmp_w[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+=(sdu_buffer_sizeP - payload_offset);
Pdcp_stats_rx_sn[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]=sequence_number;
Pdcp_stats_rx_aiat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+= (pdcp_enb[ctxt_pP->module_id].sfn - Pdcp_stats_rx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]);
Pdcp_stats_rx_aiat_tmp_w[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+=(pdcp_enb[ctxt_pP->module_id].sfn - Pdcp_stats_rx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]);
Pdcp_stats_rx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]=pdcp_enb[ctxt_pP->module_id].sfn;
if( pdcp_uid < MAX_MOBILES_PER_ENB ) {
Pdcp_stats_rx[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]++;
Pdcp_stats_rx_tmp_w[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]++;
Pdcp_stats_rx_bytes[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+=(sdu_buffer_sizeP - payload_offset);
Pdcp_stats_rx_bytes_tmp_w[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+=(sdu_buffer_sizeP - payload_offset);
Pdcp_stats_rx_sn[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]=sequence_number;
Pdcp_stats_rx_aiat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+= (pdcp_enb[ctxt_pP->module_id].sfn - Pdcp_stats_rx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]);
Pdcp_stats_rx_aiat_tmp_w[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+=(pdcp_enb[ctxt_pP->module_id].sfn - Pdcp_stats_rx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]);
Pdcp_stats_rx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]=pdcp_enb[ctxt_pP->module_id].sfn;
}
free(sdu_buffer_pP);
if (ctxt_pP->enb_flag) {
@@ -2298,8 +2302,6 @@ uint64_t pdcp_module_init( uint64_t pdcp_optmask, int id) {
if (UE_NAS_USE_TUN) {
int num_if = (NFAPI_MODE == NFAPI_UE_STUB_PNF || IS_SOFTMODEM_SIML1 || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) ? MAX_MOBILES_PER_ENB : 1;
tun_init("oaitun_ue", num_if, id);
if (IS_SOFTMODEM_NOS1)
tun_config(1, "10.0.1.2", NULL, "oaitun_ue");
tun_init_mbms("oaitun_uem", id + 1);
tun_config(1, "10.0.2.2", NULL, "oaitun_uem");
LOG_I(PDCP, "UE pdcp will use tun interface\n");
+6 -11
View File
@@ -97,8 +97,7 @@ void mac_rlc_data_ind (
rb->set_time(rb, rlc_current_time);
rb->recv_pdu(rb, buffer_pP, tb_sizeP);
} else {
LOG_E(RLC, "%s:%d:%s: fatal: no RB found (rnti %d channel ID %d)\n",
__FILE__, __LINE__, __FUNCTION__, rnti, channel_id);
LOG_E(RLC, "fatal: no RB found (rnti %x channel ID %d)\n", rnti, channel_id);
exit(1);
}
@@ -388,9 +387,7 @@ static void deliver_sdu(void *_ue, rlc_entity_t *entity, char *buf, int size)
exit(1);
rb_found:
LOG_D(RLC, "%s:%d:%s: delivering SDU (rnti %d is_srb %d rb_id %d) size %d",
__FILE__, __LINE__, __FUNCTION__, ue->rnti, is_srb, rb_id, size);
LOG_D(RLC, "delivering SDU (rnti %x is_srb %d rb_id %d) size %d", ue->rnti, is_srb, rb_id, size);
/* unused fields? */
ctx.instance = ue->module_id;
@@ -419,9 +416,7 @@ rb_found:
}
memcpy(memblock, buf, size);
if (!pdcp_data_ind(&ctx, is_srb, is_mbms, rb_id, size, memblock, NULL, NULL)) {
LOG_E(RLC, "%s:%d:%s: ERROR: pdcp_data_ind failed (is_srb %d rb_id %d rnti %d)\n",
__FILE__, __LINE__, __FUNCTION__,
is_srb, rb_id, ue->rnti);
LOG_E(RLC, "ERROR: pdcp_data_ind failed (is_srb %d rb_id %d rnti %x)\n", is_srb, rb_id, ue->rnti);
/* what to do in case of failure? for the moment: nothing */
}
}
@@ -623,7 +618,7 @@ static void add_srb(int rnti, int module_id, struct LTE_SRB_ToAddMod *s)
poll_pdu, poll_byte, max_retx_threshold);
rlc_ue_add_srb_rlc_entity(ue, srb_id, rlc_am);
LOG_D(RLC, "%s:%d:%s: added SRB %d to UE RNTI %x\n", __FILE__, __LINE__, __FUNCTION__, srb_id, rnti);
LOG_D(RLC, "added SRB %d to UE RNTI %x\n", srb_id, rnti);
}
rlc_manager_unlock(rlc_ue_manager);
}
@@ -944,7 +939,7 @@ rlc_op_status_t rrc_rlc_config_req (
exit(1);
}
rlc_manager_lock(rlc_ue_manager);
LOG_D(RLC, "%s:%d:%s: remove rb %d (is_srb %d) for UE %ld\n", __FILE__, __LINE__, __FUNCTION__, (int)rb_idP, srb_flagP, ctxt_pP->rntiMaybeUEid);
LOG_D(RLC, "remove rb %d (is_srb %d) for UE %lx\n", (int)rb_idP, srb_flagP, ctxt_pP->rntiMaybeUEid);
ue = rlc_manager_get_ue(rlc_ue_manager, ctxt_pP->rntiMaybeUEid);
if (srb_flagP) {
if (ue->srb[rb_idP-1] != NULL) {
@@ -976,7 +971,7 @@ rlc_op_status_t rrc_rlc_config_req (
rlc_op_status_t rrc_rlc_remove_ue (const protocol_ctxt_t* const x)
{
LOG_D(RLC, "%s:%d:%s: remove UE %ld\n", __FILE__, __LINE__, __FUNCTION__, x->rntiMaybeUEid);
LOG_D(RLC, "remove UE %lx\n", x->rntiMaybeUEid);
rlc_manager_lock(rlc_ue_manager);
rlc_manager_remove_ue(rlc_ue_manager, x->rntiMaybeUEid);
rlc_manager_unlock(rlc_ue_manager);
+1 -1
View File
@@ -85,7 +85,7 @@ rlc_ue_t *rlc_manager_get_ue(rlc_ue_manager_t *_m, int rnti)
if (m->ue_list[i]->rnti == rnti)
return m->ue_list[i];
LOG_D(RLC, "%s:%d:%s: new UE %d\n", __FILE__, __LINE__, __FUNCTION__, rnti);
LOG_D(RLC, "new UE %x\n", rnti);
m->ue_count++;
m->ue_list = realloc(m->ue_list, sizeof(rlc_ue_t *) * m->ue_count);
+1 -2
View File
@@ -369,8 +369,7 @@ static void match_crc_rx_pdu(nfapi_nr_rx_data_indication_t *rx_ind, nfapi_nr_crc
rx_ind_unmatched->pdu_list = calloc(rx_ind_unmatched->number_of_pdus, sizeof(nfapi_nr_pdu_t));
for (int i = 0; i < rx_ind->number_of_pdus; i++) {
if (!crc_ind_has_rnti(crc_ind, rx_ind->pdu_list[i].rnti)) {
LOG_I(NR_MAC, "rx_ind->pdu_list[%d].rnti %d does not match any crc_ind pdu rnti\n",
i, rx_ind->pdu_list[i].rnti);
LOG_I(NR_MAC, "rx_ind->pdu_list[%d].rnti %x does not match any crc_ind pdu rnti\n", i, rx_ind->pdu_list[i].rnti);
rx_ind_unmatched->pdu_list[num_unmatched_rxs] = rx_ind->pdu_list[i];
num_unmatched_rxs++;
remove_rx_pdu(rx_ind, i);
+33 -31
View File
@@ -536,18 +536,18 @@ rrc_t310_expiration(
}
//-----------------------------------------------------------------------------
static void rrc_ue_generate_RRCConnectionSetupComplete(
const protocol_ctxt_t *const ctxt_pP,
const uint8_t eNB_index,
const uint8_t Transaction_id,
uint8_t sel_plmn_id) {
static void rrc_ue_generate_RRCConnectionSetupComplete(const protocol_ctxt_t *const ctxt_pP,
const uint8_t eNB_index,
const uint8_t Transaction_id,
uint8_t sel_plmn_id)
{
uint8_t buffer[100];
uint8_t size;
const char *nas_msg;
int nas_msg_length;
if (EPC_MODE_ENABLED) {
nas_msg = (char *) UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.data;
nas_msg = (char *)UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.nas_data;
nas_msg_length = UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.length;
} else {
nas_msg = nas_attach_req_imsi;
@@ -771,7 +771,7 @@ rrc_ue_establish_drb(
"10.0.%d.%d",
UE_NAS_USE_TUN ? 1 : (ip_addr_offset3 + ue_mod_idP + 1),
ip_addr_offset4 + ue_mod_idP + 1);
oip_ifup = tun_config(ip_addr_offset3 + ue_mod_idP + 1, ip, NULL, "oaitun_oip");
oip_ifup = tun_config(ip_addr_offset3 + ue_mod_idP + 1, ip, NULL, "oaitun_ue");
if (oip_ifup == 0 && (!UE_NAS_USE_TUN)) { // interface is up --> send a config the DRB
LOG_I(OIP,"[UE %d] Config the ue net interface %d to send/receive pkt on DRB %ld to/from the protocol stack\n",
@@ -1904,14 +1904,13 @@ static bool is_nr_r15_config_present(LTE_RRCConnectionReconfiguration_r8_IEs_t *
#undef NCE
#undef chk
}
//-----------------------------------------------------------------------------
void
rrc_ue_process_rrcConnectionReconfiguration(
const protocol_ctxt_t *const ctxt_pP,
LTE_RRCConnectionReconfiguration_t *rrcConnectionReconfiguration,
uint8_t eNB_index
)
/** \brief process the received rrcConnectionReconfiguration message at UE
\param ctxt_pP Running context
\param *rrcConnectionReconfiguration pointer to the sturcture
\param eNB_index Index of corresponding eNB/CH*/
static void rrc_ue_process_rrcConnectionReconfiguration(const protocol_ctxt_t *const ctxt_pP,
LTE_RRCConnectionReconfiguration_t *rrcConnectionReconfiguration,
uint8_t eNB_index)
//-----------------------------------------------------------------------------
{
LOG_I(RRC,"[UE %d] Frame %d: Receiving from SRB1 (DL-DCCH), Processing RRCConnectionReconfiguration (eNB %d)\n",
@@ -2035,7 +2034,7 @@ rrc_ue_process_rrcConnectionReconfiguration(
msg_p = itti_alloc_new_message(TASK_RRC_UE, 0, NAS_CONN_ESTABLI_CNF);
NAS_CONN_ESTABLI_CNF(msg_p).errCode = AS_SUCCESS;
NAS_CONN_ESTABLI_CNF(msg_p).nasMsg.length = pdu_length;
NAS_CONN_ESTABLI_CNF(msg_p).nasMsg.data = pdu_buffer;
NAS_CONN_ESTABLI_CNF(msg_p).nasMsg.nas_data = pdu_buffer;
itti_send_msg_to_task(TASK_NAS_UE, ctxt_pP->instance, msg_p);
}
LOG_D(RRC, "Sent NAS_CONN_ESTABLI_CNF to NAS layer via itti!\n");
@@ -2185,14 +2184,17 @@ rrc_detach_from_eNB(
}
//-----------------------------------------------------------------------------
void
rrc_ue_decode_dcch(
const protocol_ctxt_t *const ctxt_pP,
const rb_id_t Srb_id,
const uint8_t *const Buffer,
const uint32_t Buffer_size,
const uint8_t eNB_indexP
)
/** \brief Decodes a DL-DCCH message and invokes appropriate routine to handle the message
\param ctxt_pP Running context
\param Srb_id Index of Srb (1,2)
\param Buffer Pointer to received SDU
\param Buffer_size
\param eNB_indexP Index of corresponding eNB/CH*/
static void rrc_ue_decode_dcch(const protocol_ctxt_t *const ctxt_pP,
const rb_id_t Srb_id,
const uint8_t *const Buffer,
const uint32_t Buffer_size,
const uint8_t eNB_indexP)
//-----------------------------------------------------------------------------
{
//DL_DCCH_Message_t dldcchmsg;
@@ -2247,15 +2249,14 @@ rrc_ue_decode_dcch(
/* This message hold a dedicated info NAS payload, forward it to NAS */
struct LTE_DLInformationTransfer_r8_IEs__dedicatedInfoType *dedicatedInfoType =
&dlInformationTransfer->criticalExtensions.choice.c1.choice.dlInformationTransfer_r8.dedicatedInfoType;
uint32_t pdu_length;
uint8_t *pdu_buffer;
MessageDef *msg_p;
pdu_length = dedicatedInfoType->choice.dedicatedInfoNAS.size;
pdu_buffer = dedicatedInfoType->choice.dedicatedInfoNAS.buf;
uint32_t pdu_length = dedicatedInfoType->choice.dedicatedInfoNAS.size;
uint8_t *pdu_buffer = malloc(pdu_length);
memcpy(pdu_buffer, dedicatedInfoType->choice.dedicatedInfoNAS.buf, pdu_length);
msg_p = itti_alloc_new_message(TASK_RRC_UE, 0, NAS_DOWNLINK_DATA_IND);
NAS_DOWNLINK_DATA_IND(msg_p).UEid = ctxt_pP->module_id; // TODO set the UEid to something else ?
NAS_DOWNLINK_DATA_IND(msg_p).nasMsg.length = pdu_length;
NAS_DOWNLINK_DATA_IND(msg_p).nasMsg.data = pdu_buffer;
NAS_DOWNLINK_DATA_IND(msg_p).nasMsg.nas_data = pdu_buffer;
itti_send_msg_to_task(TASK_NAS_UE, ctxt_pP->instance, msg_p);
}
@@ -2918,7 +2919,7 @@ int decode_BCCH_DLSCH_Message(
}
if (rrc_get_sub_state(ctxt_pP->module_id) == RRC_SUB_STATE_IDLE_SIB_COMPLETE) {
if ( (UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.data != NULL) || (!EPC_MODE_ENABLED)) {
if ((UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.nas_data != NULL) || (!EPC_MODE_ENABLED)) {
rrc_ue_generate_RRCConnectionRequest(ctxt_pP, 0);
rrc_set_sub_state( ctxt_pP->module_id, RRC_SUB_STATE_IDLE_CONNECTING );
}
@@ -5173,7 +5174,8 @@ void *rrc_ue_task( void *args_p ) {
uint8_t *buffer;
LOG_D(RRC, "[UE %d] Received %s: UEid %d\n", ue_mod_id, ITTI_MSG_NAME (msg_p), NAS_UPLINK_DATA_REQ (msg_p).UEid);
/* Create message for PDCP (ULInformationTransfer_t) */
length = do_ULInformationTransfer(&buffer, NAS_UPLINK_DATA_REQ (msg_p).nasMsg.length, NAS_UPLINK_DATA_REQ (msg_p).nasMsg.data);
length =
do_ULInformationTransfer(&buffer, NAS_UPLINK_DATA_REQ(msg_p).nasMsg.length, NAS_UPLINK_DATA_REQ(msg_p).nasMsg.nas_data);
/* Transfer data to PDCP */
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, ue_mod_id, ENB_FLAG_NO, UE_rrc_inst[ue_mod_id].Info[0].rnti, 0, 0,0);
+21 -15
View File
@@ -98,6 +98,8 @@
#include "SIMULATION/TOOLS/sim.h" // for taus
#include "openair1/PHY/LTE_TRANSPORT/transport_proto.h"
#define ASN_MAX_ENCODE_SIZE 4096
#define NUMBEROF_DRBS_TOBE_ADDED 1
static int encode_CG_ConfigInfo(char *buffer,int buffer_size,rrc_eNB_ue_context_t *const ue_context_pP,int *enc_size);
@@ -878,7 +880,7 @@ rrc_eNB_free_UE(
void put_UE_in_freelist(module_id_t mod_id, rnti_t rnti, bool removeFlag) {
eNB_MAC_INST *eNB_MAC = RC.mac[mod_id];
pthread_mutex_lock(&lock_ue_freelist);
LOG_I(PHY,"add ue %d in free list, context flag: %d\n", rnti, removeFlag);
LOG_I(PHY, "adding ue %x in UE to free list, context flag: %d\n", rnti, removeFlag);
int i;
for (i=0; i < sizeofArray(eNB_MAC->UE_free_ctrl); i++)
if (eNB_MAC->UE_free_ctrl[i].rnti == 0)
@@ -891,16 +893,18 @@ void put_UE_in_freelist(module_id_t mod_id, rnti_t rnti, bool removeFlag) {
eNB_MAC->UE_free_ctrl[i].rnti = rnti;
eNB_MAC->UE_free_ctrl[i].removeContextFlg = removeFlag;
eNB_MAC->UE_free_ctrl[i].raFlag = 0;
eNB_MAC->UE_release_req.ue_release_request_body.ue_release_request_TLVs_list[eNB_MAC->UE_release_req.ue_release_request_body.number_of_TLVs].rnti = rnti;
eNB_MAC->UE_release_req.ue_release_request_body.number_of_TLVs++;
if (eNB_MAC->UE_release_req.ue_release_request_body.number_of_TLVs < NFAPI_RELEASE_MAX_RNTI) {
eNB_MAC->UE_release_req.ue_release_request_body
.ue_release_request_TLVs_list[eNB_MAC->UE_release_req.ue_release_request_body.number_of_TLVs]
.rnti = rnti;
eNB_MAC->UE_release_req.ue_release_request_body.number_of_TLVs++;
} else {
LOG_E(PHY, "fapi List of UE to release is full\n");
}
pthread_mutex_unlock(&lock_ue_freelist);
}
extern int16_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type);
extern int16_t find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type);
extern void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch);
extern void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch);
void release_UE_in_freeList(module_id_t mod_id) {
PHY_VARS_eNB *eNB_PHY = NULL;
eNB_MAC_INST *eNB_MAC = RC.mac[mod_id];
@@ -918,13 +922,11 @@ void release_UE_in_freeList(module_id_t mod_id) {
int id;
// clean ULSCH entries for rnti
id = find_ulsch(rnti, eNB_PHY, eNB_MAC->UE_free_ctrl[ue_num].raFlag ? SEARCH_EXIST_RA : SEARCH_EXIST);
if (id >= 0)
clean_eNb_ulsch(eNB_PHY->ulsch[id]);
// clean DLSCH entries for rnti
id = find_dlsch(rnti, eNB_PHY, eNB_MAC->UE_free_ctrl[ue_num].raFlag ? SEARCH_EXIST_RA : SEARCH_EXIST);
if (id >= 0)
clean_eNb_dlsch(eNB_PHY->dlsch[id][0]);
@@ -3886,7 +3888,11 @@ check_handovers(
ue_context_p->ue_context.handover_info->buf,
PDCP_TRANSMISSION_MODE_CONTROL);
ue_context_p->ue_context.handover_info->state = HO_COMPLETE;
LOG_I(RRC, "RRC Sends RRCConnectionReconfiguration to UE %d at frame %d and subframe %d \n", ue_context_p->ue_context.rnti, ctxt_pP->frame,ctxt_pP->subframe);
LOG_I(RRC,
"RRC Sends RRCConnectionReconfiguration to UE %x at frame %d and subframe %d \n",
ue_context_p->ue_context.rnti,
ctxt_pP->frame,
ctxt_pP->subframe);
}
/* in the target, UE in HO_ACK mode */
@@ -7568,16 +7574,16 @@ void rrc_eNB_process_ENDC_DC_prep_timeout(module_id_t module_id, x2ap_ENDC_dc_pr
ue_context = rrc_eNB_get_ue_context(RC.rrc[module_id], m->rnti);
if (ue_context == NULL) {
LOG_E(RRC, "receiving DC prep timeout for unknown UE rnti %d\n", m->rnti);
LOG_E(RRC, "receiving DC prep timeout for unknown UE rnti %x\n", m->rnti);
return;
}
if (ue_context->ue_context.StatusRrc != RRC_NR_NSA) {
LOG_E(RRC, "receiving DC prep timeout for UE rnti %d not in state RRC_NR_NSA\n", m->rnti);
LOG_E(RRC, "receiving DC prep timeout for UE rnti %x not in state RRC_NR_NSA\n", m->rnti);
return;
}
LOG_I(RRC, "DC prep timeout for UE rnti %d, put back to RRC_RECONFIGURED mode\n", m->rnti);
LOG_I(RRC, "DC prep timeout for UE rnti %x, put back to RRC_RECONFIGURED mode\n", m->rnti);
ue_context->ue_context.StatusRrc = RRC_RECONFIGURED;
}
@@ -7588,7 +7594,7 @@ void rrc_eNB_process_ENDC_sgNB_release_required(module_id_t module_id, x2ap_ENDC
ue_context = rrc_eNB_find_ue_context_from_gnb_rnti(RC.rrc[module_id], m->gnb_rnti);
if (ue_context == NULL) {
LOG_E(RRC, "receiving ENDC SgNB Release Required for unknown UE (with gNB's rnti %d)\n", m->gnb_rnti);
LOG_E(RRC, "receiving ENDC SgNB Release Required for unknown UE (with gNB's rnti %x)\n", m->gnb_rnti);
return;
}
-26
View File
@@ -93,21 +93,6 @@ rrc_rx_tx_ue(
\param eNB_index Index of corresponding eNB/CH*/
int rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const SRB_INFO *const Srb_info, const uint8_t eNB_index );
/** \brief Decodes a DL-DCCH message and invokes appropriate routine to handle the message
\param ctxt_pP Running context
\param Srb_id Index of Srb (1,2)
\param Buffer Pointer to received SDU
\param Buffer_size
\param eNB_indexP Index of corresponding eNB/CH*/
void
rrc_ue_decode_dcch(
const protocol_ctxt_t *const ctxt_pP,
const rb_id_t Srb_id,
const uint8_t *const Buffer,
const uint32_t Buffer_size,
const uint8_t eNB_indexP
);
int decode_SL_Discovery_Message(
const protocol_ctxt_t *const ctxt_pP,
const uint8_t eNB_index,
@@ -123,17 +108,6 @@ rrc_ue_generate_RRCConnectionRequest(
const uint8_t eNB_index
);
/** \brief process the received rrcConnectionReconfiguration message at UE
\param ctxt_pP Running context
\param *rrcConnectionReconfiguration pointer to the sturcture
\param eNB_index Index of corresponding eNB/CH*/
void
rrc_ue_process_rrcConnectionReconfiguration(
const protocol_ctxt_t *const ctxt_pP,
LTE_RRCConnectionReconfiguration_t *rrcConnectionReconfiguration,
uint8_t eNB_index
);
/** \brief Establish SRB1 based on configuration in SRB_ToAddMod structure. Configures RLC/PDCP accordingly
\param module_idP Instance ID of UE
\param frameP Frame index
+3 -3
View File
@@ -391,12 +391,12 @@ void rrc_remove_nsa_user(gNB_RRC_INST *rrc, int rnti) {
rrc_gNB_ue_context_t *ue_context;
int e_rab;
LOG_D(RRC, "calling rrc_remove_nsa_user rnti %d\n", rnti);
LOG_D(RRC, "calling rrc_remove_nsa_user rnti %x\n", rnti);
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, rrc->module_id, GNB_FLAG_YES, rnti, 0, 0, rrc->module_id);
ue_context = rrc_gNB_get_ue_context_by_rnti_any_du(rrc, rnti);
if (ue_context == NULL) {
LOG_W(RRC, "rrc_remove_nsa_user: rnti %d not found\n", rnti);
LOG_W(RRC, "rrc_remove_nsa_user: rnti %x not found\n", rnti);
return;
}
@@ -411,7 +411,7 @@ void rrc_remove_nsa_user(gNB_RRC_INST *rrc, int rnti) {
gtpv1u_enb_delete_tunnel_req_t tmp={0};
tmp.rnti=rnti;
tmp.from_gnb=1;
LOG_D(RRC, "ue_context->ue_context.nb_of_e_rabs %d will be deleted for rnti %d\n", ue_context->ue_context.nb_of_e_rabs, rnti);
LOG_D(RRC, "ue_context->ue_context.nb_of_e_rabs %d will be deleted for rnti %x\n", ue_context->ue_context.nb_of_e_rabs, rnti);
for (e_rab = 0; e_rab < ue_context->ue_context.nb_of_e_rabs; e_rab++) {
tmp.eps_bearer_id[tmp.num_erab++]= ue_context->ue_context.nsa_gtp_ebi[e_rab];
// erase data
+9 -8
View File
@@ -189,10 +189,10 @@ static void nr_rrc_ue_process_rrcReconfiguration(NR_UE_RRC_INST_t *rrc,
struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList *tmp = ext->dedicatedNAS_MessageList;
for (int i = 0; i < tmp->list.count; i++) {
MessageDef *ittiMsg = itti_alloc_new_message(TASK_RRC_NRUE, rrc->ue_id, NAS_CONN_ESTABLI_CNF);
NasConnEstabCnf *msg = &NAS_CONN_ESTABLI_CNF(ittiMsg);
nas_establish_cnf_t *msg = &NAS_CONN_ESTABLI_CNF(ittiMsg);
msg->errCode = AS_SUCCESS;
msg->nasMsg.length = tmp->list.array[i]->size;
msg->nasMsg.data = tmp->list.array[i]->buf;
msg->nasMsg.nas_data = tmp->list.array[i]->buf;
itti_send_msg_to_task(TASK_NAS_NRUE, rrc->ue_id, ittiMsg);
}
tmp->list.count = 0; // to prevent the automatic free by ASN1_FREE
@@ -998,7 +998,7 @@ static void rrc_ue_generate_RRCSetupComplete(const NR_UE_RRC_INST_t *rrc, const
as_nas_info_t initialNasMsg;
nr_ue_nas_t *nas = get_ue_nas_info(rrc->ue_id);
generateRegistrationRequest(&initialNasMsg, nas);
nas_msg = (char*)initialNasMsg.data;
nas_msg = (char *)initialNasMsg.nas_data;
nas_msg_length = initialNasMsg.length;
} else {
nas_msg = nr_nas_attach_req_imsi_dummy_NSA_case;
@@ -1751,10 +1751,11 @@ static int nr_rrc_ue_decode_dcch(NR_UE_RRC_INST_t *rrc,
dlInformationTransfer->criticalExtensions.choice.dlInformationTransfer->dedicatedNAS_Message;
MessageDef *ittiMsg = itti_alloc_new_message(TASK_RRC_NRUE, rrc->ue_id, NAS_DOWNLINK_DATA_IND);
NasDlDataInd *msg = &NAS_DOWNLINK_DATA_IND(ittiMsg);
dl_info_transfer_ind_t *msg = &NAS_DOWNLINK_DATA_IND(ittiMsg);
msg->UEid = rrc->ue_id;
msg->nasMsg.length = dedicatedNAS_Message->size;
msg->nasMsg.data = dedicatedNAS_Message->buf;
msg->nasMsg.nas_data = malloc(msg->nasMsg.length);
memcpy(msg->nasMsg.nas_data, dedicatedNAS_Message->buf, msg->nasMsg.length);
itti_send_msg_to_task(TASK_NAS_NRUE, rrc->ue_id, ittiMsg);
dedicatedNAS_Message->buf = NULL; // to keep the buffer, up to NAS to free it
}
@@ -1907,15 +1908,15 @@ void *rrc_nrue(void *notUsed)
case NAS_UPLINK_DATA_REQ: {
uint32_t length;
uint8_t *buffer = NULL;
NasUlDataReq *req = &NAS_UPLINK_DATA_REQ(msg_p);
ul_info_transfer_req_t *req = &NAS_UPLINK_DATA_REQ(msg_p);
/* Create message for PDCP (ULInformationTransfer_t) */
length = do_NR_ULInformationTransfer(&buffer, req->nasMsg.length, req->nasMsg.data);
length = do_NR_ULInformationTransfer(&buffer, req->nasMsg.length, req->nasMsg.nas_data);
/* Transfer data to PDCP */
// check if SRB2 is created, if yes request data_req on SRB2
// error: the remote gNB is hardcoded here
rb_id_t srb_id = rrc->Srb[2] == RB_ESTABLISHED ? 2 : 1;
nr_pdcp_data_req_srb(rrc->ue_id, srb_id, 0, length, buffer, deliver_pdu_srb_rlc, NULL);
free(req->nasMsg.data);
free(req->nasMsg.nas_data);
free(buffer);
break;
}