Commit a455ce7c authored by Laurent THOMAS's avatar Laurent THOMAS

fix F1-U bugs

parent 62f2d43f
...@@ -95,6 +95,22 @@ static void read_pipe(int p, char *b, int size) { ...@@ -95,6 +95,22 @@ static void read_pipe(int p, char *b, int size) {
size -= ret; size -= ret;
} }
} }
int checkIfFedoraDistribution(void) {
return system("grep -iq 'ID_LIKE.*fedora' /etc/os-release ");
}
int checkIfGenericKernelOnFedora(void) {
int ret=system("uname -a | grep -q rt");
return 1 - ret;
}
int checkIfInsideContainer(void) {
int res=system("egrep -q 'libpod|podman|kubepods' /proc/self/cgroup");
if (res > 0)
return 1;
else
return 0;
}
/********************************************************************/ /********************************************************************/
/* background process */ /* background process */
......
...@@ -233,7 +233,6 @@ typedef struct protocol_ctxt_s { ...@@ -233,7 +233,6 @@ typedef struct protocol_ctxt_s {
frame_t frame; /*!< \brief LTE frame number.*/ frame_t frame; /*!< \brief LTE frame number.*/
sub_frame_t subframe; /*!< \brief LTE sub frame number.*/ sub_frame_t subframe; /*!< \brief LTE sub frame number.*/
eNB_index_t eNB_index; /*!< \brief valid for UE indicating the index of connected eNB(s) */ eNB_index_t eNB_index; /*!< \brief valid for UE indicating the index of connected eNB(s) */
boolean_t configured; /*!< \brief flag indicating whether the instance is configured or not */
boolean_t brOption; boolean_t brOption;
} protocol_ctxt_t; } protocol_ctxt_t;
// warning time hardcoded // warning time hardcoded
......
...@@ -319,7 +319,6 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -319,7 +319,6 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
ctxt.rnti = f1ap_get_rnti_by_cu_id(true, instance, cu_ue_f1ap_id); ctxt.rnti = f1ap_get_rnti_by_cu_id(true, instance, cu_ue_f1ap_id);
ctxt.enb_flag = 1; ctxt.enb_flag = 1;
ctxt.eNB_index = 0; ctxt.eNB_index = 0;
ctxt.configured = 1;
mem_block_t *mb = get_free_mem_block(ie->value.choice.RRCContainer.size,__func__); mem_block_t *mb = get_free_mem_block(ie->value.choice.RRCContainer.size,__func__);
memcpy((void *)mb->data,(void *)ie->value.choice.RRCContainer.buf,ie->value.choice.RRCContainer.size); memcpy((void *)mb->data,(void *)ie->value.choice.RRCContainer.buf,ie->value.choice.RRCContainer.size);
LOG_I(F1AP, "Calling pdcp_data_ind for UE RNTI %x srb_id %lu with size %ld (DCCH) \n", ctxt.rnti, srb_id, ie->value.choice.RRCContainer.size); LOG_I(F1AP, "Calling pdcp_data_ind for UE RNTI %x srb_id %lu with size %ld (DCCH) \n", ctxt.rnti, srb_id, ie->value.choice.RRCContainer.size);
......
...@@ -249,12 +249,8 @@ boolean_t pdcp_data_req( ...@@ -249,12 +249,8 @@ boolean_t pdcp_data_req(
LOG_W(PDCP, PROTOCOL_CTXT_FMT" Instance is not configured for rb_id %ld Ignoring SDU...\n", LOG_W(PDCP, PROTOCOL_CTXT_FMT" Instance is not configured for rb_id %ld Ignoring SDU...\n",
PROTOCOL_CTXT_ARGS(ctxt_pP), PROTOCOL_CTXT_ARGS(ctxt_pP),
rb_idP); rb_idP);
ctxt_pP->configured=FALSE;
return FALSE; return FALSE;
} }
} else {
// instance for a given RB is configured
ctxt_pP->configured=TRUE;
} }
if (ctxt_pP->enb_flag == ENB_FLAG_YES) { if (ctxt_pP->enb_flag == ENB_FLAG_YES) {
......
...@@ -525,7 +525,6 @@ int proto_agent_pdcp_data_ind_process(mod_id_t mod_id, const void *params, Proto ...@@ -525,7 +525,6 @@ int proto_agent_pdcp_data_ind_process(mod_id_t mod_id, const void *params, Proto
ctxt_pP.rnti = ctxt->fsp_rnti; ctxt_pP.rnti = ctxt->fsp_rnti;
ctxt_pP.frame = ctxt->fsp_frame; ctxt_pP.frame = ctxt->fsp_frame;
ctxt_pP.subframe = ctxt->fsp_subframe; ctxt_pP.subframe = ctxt->fsp_subframe;
ctxt_pP.configured = 1;
ctxt_pP.brOption = 0; ctxt_pP.brOption = 0;
ctxt_pP.eNB_index = ctxt->fsp_enb_index; ctxt_pP.eNB_index = ctxt->fsp_enb_index;
srb_flagP = rlc_data->fsp_srb_flag; srb_flagP = rlc_data->fsp_srb_flag;
......
...@@ -263,7 +263,6 @@ static void *enb_tun_read_thread(void *_) ...@@ -263,7 +263,6 @@ static void *enb_tun_read_thread(void *_)
ctxt.frame = 0; ctxt.frame = 0;
ctxt.subframe = 0; ctxt.subframe = 0;
ctxt.eNB_index = 0; ctxt.eNB_index = 0;
ctxt.configured = 1;
ctxt.brOption = 0; ctxt.brOption = 0;
ctxt.rnti = rnti; ctxt.rnti = rnti;
...@@ -307,7 +306,6 @@ static void *ue_tun_read_thread(void *_) ...@@ -307,7 +306,6 @@ static void *ue_tun_read_thread(void *_)
ctxt.frame = 0; ctxt.frame = 0;
ctxt.subframe = 0; ctxt.subframe = 0;
ctxt.eNB_index = 0; ctxt.eNB_index = 0;
ctxt.configured = 1;
ctxt.brOption = 0; ctxt.brOption = 0;
ctxt.rnti = rnti; ctxt.rnti = rnti;
...@@ -515,11 +513,31 @@ rb_found: ...@@ -515,11 +513,31 @@ rb_found:
ctxt.frame = 0; ctxt.frame = 0;
ctxt.subframe = 0; ctxt.subframe = 0;
ctxt.eNB_index = 0; ctxt.eNB_index = 0;
ctxt.configured = 1;
ctxt.brOption = 0; ctxt.brOption = 0;
ctxt.rnti = ue->rnti; ctxt.rnti = ue->rnti;
if (RC.nrrrc != NULL && NODE_IS_CU(RC.nrrrc[0]->node_type)) {
MessageDef *message_p = itti_alloc_new_message_sized(TASK_PDCP_ENB, 0,
GTPV1U_GNB_TUNNEL_DATA_REQ,
sizeof(gtpv1u_gnb_tunnel_data_req_t)
+ size
+ GTPU_HEADER_OVERHEAD_MAX);
AssertFatal(message_p != NULL, "OUT OF MEMORY");
gtpv1u_gnb_tunnel_data_req_t *req=&GTPV1U_GNB_TUNNEL_DATA_REQ(message_p);
uint8_t *gtpu_buffer_p = (uint8_t*)(req+1);
memcpy(gtpu_buffer_p+GTPU_HEADER_OVERHEAD_MAX,
buf, size);
req->buffer = gtpu_buffer_p;
req->length = size;
req->offset = GTPU_HEADER_OVERHEAD_MAX;
req->rnti = ue->rnti;
req->pdusession_id = rb_id;
LOG_D(PDCP, "%s() (drb %d) sending message to gtp size %d\n",
__func__, rb_id, size);
itti_send_msg_to_task(TASK_VARIABLE, INSTANCE_DEFAULT, message_p);
return;
}
memblock = get_free_mem_block(size, __FUNCTION__); memblock = get_free_mem_block(size, __FUNCTION__);
memcpy(memblock->data, buf, size); memcpy(memblock->data, buf, size);
...@@ -603,7 +621,6 @@ srb_found: ...@@ -603,7 +621,6 @@ srb_found:
ctxt.frame = 0; ctxt.frame = 0;
ctxt.subframe = 0; ctxt.subframe = 0;
ctxt.eNB_index = 0; ctxt.eNB_index = 0;
ctxt.configured = 1;
ctxt.brOption = 0; ctxt.brOption = 0;
ctxt.rnti = ue->rnti; ctxt.rnti = ue->rnti;
...@@ -646,7 +663,6 @@ boolean_t pdcp_data_ind( ...@@ -646,7 +663,6 @@ boolean_t pdcp_data_ind(
//ctxt_pP->enb_flag != 1 || //ctxt_pP->enb_flag != 1 ||
ctxt_pP->instance != 0 || ctxt_pP->instance != 0 ||
ctxt_pP->eNB_index != 0 || ctxt_pP->eNB_index != 0 ||
ctxt_pP->configured != 1 ||
ctxt_pP->brOption != 0) { ctxt_pP->brOption != 0) {
LOG_E(PDCP, "%s:%d:%s: fatal\n", __FILE__, __LINE__, __FUNCTION__); LOG_E(PDCP, "%s:%d:%s: fatal\n", __FILE__, __LINE__, __FUNCTION__);
exit(1); exit(1);
...@@ -697,7 +713,6 @@ void pdcp_run(const protocol_ctxt_t *const ctxt_pP) ...@@ -697,7 +713,6 @@ void pdcp_run(const protocol_ctxt_t *const ctxt_pP)
.frame=-1, .frame=-1,
.subframe=-1, .subframe=-1,
.eNB_index=0, .eNB_index=0,
.configured=true,
.brOption=false .brOption=false
}; };
...@@ -1223,25 +1238,21 @@ boolean_t cu_f1u_data_req( ...@@ -1223,25 +1238,21 @@ boolean_t cu_f1u_data_req(
,const uint32_t *const destinationL2Id ,const uint32_t *const destinationL2Id
#endif #endif
) { ) {
MessageDef *message_p = itti_alloc_new_message_sized(TASK_PDCP_ENB, 0,
GTPV1U_GNB_TUNNEL_DATA_REQ, //Force instance id to 0, OAI incoherent instance management
sizeof(gtpv1u_gnb_tunnel_data_req_t) ctxt_pP->instance=0;
+ sdu_buffer_size mem_block_t *memblock = get_free_mem_block(sdu_buffer_size, __func__);
+ GTPU_HEADER_OVERHEAD_MAX); if (memblock == NULL) {
AssertFatal(message_p != NULL, "OUT OF MEMORY"); LOG_E(RLC, "%s:%d:%s: ERROR: get_free_mem_block failed\n", __FILE__, __LINE__, __FUNCTION__);
gtpv1u_gnb_tunnel_data_req_t *req=&GTPV1U_GNB_TUNNEL_DATA_REQ(message_p); exit(1);
uint8_t *gtpu_buffer_p = (uint8_t*)(req+1); }
memcpy(gtpu_buffer_p+GTPU_HEADER_OVERHEAD_MAX, memcpy(memblock->data,sdu_buffer, sdu_buffer_size);
sdu_buffer, sdu_buffer_size); int ret=pdcp_data_ind(ctxt_pP,srb_flagP, false, rb_id, sdu_buffer_size, memblock);
req->buffer = gtpu_buffer_p; if (!ret) {
req->length = sdu_buffer_size; LOG_E(RLC, "%s:%d:%s: ERROR: pdcp_data_ind failed\n", __FILE__, __LINE__, __FUNCTION__);
req->offset = GTPU_HEADER_OVERHEAD_MAX; /* what to do in case of failure? for the moment: nothing */
req->rnti = ctxt_pP->rnti; }
req->pdusession_id = rb_id; return ret;
LOG_D(PDCP, "%s() (drb %ld) sending message to gtp size %d\n",
__func__, rb_id, sdu_buffer_size);
itti_send_msg_to_task(TASK_VARIABLE, INSTANCE_DEFAULT, message_p);
return true;
} }
boolean_t pdcp_data_req( boolean_t pdcp_data_req(
......
...@@ -461,7 +461,6 @@ rb_found: ...@@ -461,7 +461,6 @@ rb_found:
ctx.frame = 0; ctx.frame = 0;
ctx.subframe = 0; ctx.subframe = 0;
ctx.eNB_index = 0; ctx.eNB_index = 0;
ctx.configured = 1;
ctx.brOption = 0; ctx.brOption = 0;
/* used fields? */ /* used fields? */
...@@ -486,30 +485,32 @@ rb_found: ...@@ -486,30 +485,32 @@ rb_found:
// return; // return;
// } // }
if (NODE_IS_DU(type) && is_srb == 1) { if (NODE_IS_DU(type)) {
MessageDef *msg; if(is_srb) {
msg = itti_alloc_new_message(TASK_RLC_ENB, 0, F1AP_UL_RRC_MESSAGE); MessageDef *msg;
uint8_t *message_buffer = itti_malloc (TASK_RLC_ENB, TASK_DU_F1, size); msg = itti_alloc_new_message(TASK_RLC_ENB, 0, F1AP_UL_RRC_MESSAGE);
memcpy (message_buffer, buf, size); uint8_t *message_buffer = itti_malloc (TASK_RLC_ENB, TASK_DU_F1, size);
F1AP_UL_RRC_MESSAGE(msg).rnti = ue->rnti; memcpy (message_buffer, buf, size);
F1AP_UL_RRC_MESSAGE(msg).srb_id = rb_id; F1AP_UL_RRC_MESSAGE(msg).rnti = ue->rnti;
F1AP_UL_RRC_MESSAGE(msg).rrc_container = message_buffer; F1AP_UL_RRC_MESSAGE(msg).srb_id = rb_id;
F1AP_UL_RRC_MESSAGE(msg).rrc_container_length = size; F1AP_UL_RRC_MESSAGE(msg).rrc_container = message_buffer;
itti_send_msg_to_task(TASK_DU_F1, ENB_MODULE_ID_TO_INSTANCE(0 /*ctxt_pP->module_id*/), msg); F1AP_UL_RRC_MESSAGE(msg).rrc_container_length = size;
return; itti_send_msg_to_task(TASK_DU_F1, ENB_MODULE_ID_TO_INSTANCE(0 /*ctxt_pP->module_id*/), msg);
} return;
else if(NODE_IS_DU(type) && is_srb == 0) { } else {
MessageDef *msg = itti_alloc_new_message_sized(TASK_RLC_ENB, 0, GTPV1U_GNB_TUNNEL_DATA_REQ, sizeof(gtpv1u_gnb_tunnel_data_req_t) + size); MessageDef *msg = itti_alloc_new_message_sized(TASK_RLC_ENB, 0, GTPV1U_GNB_TUNNEL_DATA_REQ,
gtpv1u_gnb_tunnel_data_req_t *req=&GTPV1U_GNB_TUNNEL_DATA_REQ(msg); sizeof(gtpv1u_gnb_tunnel_data_req_t) + size);
req->buffer=(uint8_t*)(req+1); gtpv1u_gnb_tunnel_data_req_t *req=&GTPV1U_GNB_TUNNEL_DATA_REQ(msg);
memcpy(req->buffer,buf,size); req->buffer=(uint8_t*)(req+1);
req->length=size; memcpy(req->buffer,buf,size);
req->offset=0; req->length=size;
req->rnti=ue->rnti; req->offset=0;
req->pdusession_id=rb_id; req->rnti=ue->rnti;
LOG_D(RLC, "Received uplink user-plane traffic at RLC-DU to be sent to the CU, size %d \n", size); req->pdusession_id=rb_id;
itti_send_msg_to_task(OCP_GTPV1_U, 0, msg); LOG_D(RLC, "Received uplink user-plane traffic at RLC-DU to be sent to the CU, size %d \n", size);
return; itti_send_msg_to_task(OCP_GTPV1_U, 0, msg);
return;
}
} }
} }
...@@ -923,10 +924,10 @@ rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt ...@@ -923,10 +924,10 @@ rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt
if (/*ctxt_pP->enb_flag != 1 ||*/ ctxt_pP->module_id != 0 /*|| if (/*ctxt_pP->enb_flag != 1 ||*/ ctxt_pP->module_id != 0 /*||
ctxt_pP->instance != 0 || ctxt_pP->eNB_index != 0 || ctxt_pP->instance != 0 || ctxt_pP->eNB_index != 0 ||
ctxt_pP->configured != 1 || ctxt_pP->brOption != 0 */) { ctxt_pP->brOption != 0 */) {
LOG_E(RLC, "%s: ctxt_pP not handled (%d %d %ld %d %d %d)\n", __FUNCTION__, LOG_E(RLC, "%s: ctxt_pP not handled (%d %d %ld %d %d)\n", __FUNCTION__,
ctxt_pP->enb_flag , ctxt_pP->module_id, ctxt_pP->instance, ctxt_pP->enb_flag , ctxt_pP->module_id, ctxt_pP->instance,
ctxt_pP->eNB_index, ctxt_pP->configured, ctxt_pP->brOption); ctxt_pP->eNB_index, ctxt_pP->brOption);
exit(1); exit(1);
} }
......
...@@ -406,7 +406,6 @@ rb_found: ...@@ -406,7 +406,6 @@ rb_found:
ctx.frame = 0; ctx.frame = 0;
ctx.subframe = 0; ctx.subframe = 0;
ctx.eNB_index = 0; ctx.eNB_index = 0;
ctx.configured = 1;
ctx.brOption = 0; ctx.brOption = 0;
/* used fields? */ /* used fields? */
...@@ -832,10 +831,10 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP ...@@ -832,10 +831,10 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP
if (0 /*|| if (0 /*||
ctxt_pP->instance != 0 || ctxt_pP->eNB_index != 0 || ctxt_pP->instance != 0 || ctxt_pP->eNB_index != 0 ||
ctxt_pP->configured != 1 || ctxt_pP->brOption != 0 */) { ctxt_pP->brOption != 0 */) {
LOG_E(RLC, "%s: ctxt_pP not handled (%d %d %ld %d %d %d)\n", __FUNCTION__, LOG_E(RLC, "%s: ctxt_pP not handled (%d %d %ld %d %d)\n", __FUNCTION__,
ctxt_pP->enb_flag , ctxt_pP->module_id, ctxt_pP->instance, ctxt_pP->enb_flag , ctxt_pP->module_id, ctxt_pP->instance,
ctxt_pP->eNB_index, ctxt_pP->configured, ctxt_pP->brOption); ctxt_pP->eNB_index, ctxt_pP->brOption);
exit(1); exit(1);
} }
...@@ -1041,4 +1040,4 @@ void du_rlc_data_req(const protocol_ctxt_t *const ctxt_pP, ...@@ -1041,4 +1040,4 @@ void du_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
sdu_size_t sdu_sizeP, sdu_size_t sdu_sizeP,
mem_block_t *sdu_pP){ mem_block_t *sdu_pP){
} }
\ No newline at end of file
...@@ -3586,7 +3586,6 @@ void *rrc_gnb_task(void *args_p) { ...@@ -3586,7 +3586,6 @@ void *rrc_gnb_task(void *args_p) {
.frame=-1, .frame=-1,
.subframe=-1, .subframe=-1,
.eNB_index=0, .eNB_index=0,
.configured=true,
.brOption=false .brOption=false
}; };
itti_mark_task_ready(TASK_RRC_GNB); itti_mark_task_ready(TASK_RRC_GNB);
......
...@@ -432,11 +432,7 @@ NwGtpv1uRcT gtpv1u_eNB_process_stack_req( ...@@ -432,11 +432,7 @@ NwGtpv1uRcT gtpv1u_eNB_process_stack_req(
); );
if ( result == FALSE ) { if ( result == FALSE ) {
if (ctxt.configured == FALSE ) LOG_W(GTPU, "PDCP data request failed\n");
LOG_W(GTPU, "PDCP data request failed, cause: [UE:%x]RB is not configured!\n", ctxt.rnti) ;
else
LOG_W(GTPU, "PDCP data request failed\n");
return NW_GTPV1U_FAILURE; return NW_GTPV1U_FAILURE;
} }
} else { } else {
......
...@@ -191,9 +191,6 @@ NwGtpv1uRcT gtpv1u_gNB_process_stack_req( ...@@ -191,9 +191,6 @@ NwGtpv1uRcT gtpv1u_gNB_process_stack_req(
); );
if ( result == FALSE ) { if ( result == FALSE ) {
if (ctxt.configured == FALSE )
LOG_W(GTPU, "gNB node PDCP data request failed, cause: [UE:%x]RB is not configured!\n", ctxt.rnti) ;
else
LOG_W(GTPU, "PDCP data request failed\n"); LOG_W(GTPU, "PDCP data request failed\n");
return NW_GTPV1U_FAILURE; return NW_GTPV1U_FAILURE;
...@@ -390,9 +387,6 @@ NwGtpv1uRcT nr_gtpv1u_gNB_process_stack_req( ...@@ -390,9 +387,6 @@ NwGtpv1uRcT nr_gtpv1u_gNB_process_stack_req(
); );
if ( result == FALSE ) { if ( result == FALSE ) {
if (ctxt.configured == FALSE )
LOG_W(GTPU, "gNB node PDCP data request failed, cause: [UE:%x]RB is not configured!\n", ctxt.rnti) ;
else
LOG_W(GTPU, "PDCP data request failed\n"); LOG_W(GTPU, "PDCP data request failed\n");
return NW_GTPV1U_FAILURE; return NW_GTPV1U_FAILURE;
......
...@@ -691,7 +691,6 @@ static int Gtpv1uHandleEndMarker(int h, ...@@ -691,7 +691,6 @@ static int Gtpv1uHandleEndMarker(int h,
ctxt.frame = 0; ctxt.frame = 0;
ctxt.subframe = 0; ctxt.subframe = 0;
ctxt.eNB_index = 0; ctxt.eNB_index = 0;
ctxt.configured = 0;
ctxt.brOption = 0; ctxt.brOption = 0;
const srb_flag_t srb_flag=SRB_FLAG_NO; const srb_flag_t srb_flag=SRB_FLAG_NO;
const rb_id_t rb_id=tunnel->second.incoming_rb_id; const rb_id_t rb_id=tunnel->second.incoming_rb_id;
...@@ -757,7 +756,6 @@ static int Gtpv1uHandleGpdu(int h, ...@@ -757,7 +756,6 @@ static int Gtpv1uHandleGpdu(int h,
ctxt.frame = 0; ctxt.frame = 0;
ctxt.subframe = 0; ctxt.subframe = 0;
ctxt.eNB_index = 0; ctxt.eNB_index = 0;
ctxt.configured = 0;
ctxt.brOption = 0; ctxt.brOption = 0;
const srb_flag_t srb_flag=SRB_FLAG_NO; const srb_flag_t srb_flag=SRB_FLAG_NO;
const rb_id_t rb_id=tunnel->second.incoming_rb_id; const rb_id_t rb_id=tunnel->second.incoming_rb_id;
......
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