diff --git a/common/utils/system.c b/common/utils/system.c index 96daf6f74761a83c12876e23596acee531e63615..4eb8c8cb19752b060df0b819d42ba4746cb604b8 100644 --- a/common/utils/system.c +++ b/common/utils/system.c @@ -95,6 +95,22 @@ static void read_pipe(int p, char *b, int size) { 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 */ diff --git a/openair2/COMMON/platform_types.h b/openair2/COMMON/platform_types.h index 23b33dd8b13ab1f8249942f2e304c5e800d72dd4..7f8e4ee568318e9caa9d65f346b5387ddeeb5a5d 100644 --- a/openair2/COMMON/platform_types.h +++ b/openair2/COMMON/platform_types.h @@ -233,7 +233,6 @@ typedef struct protocol_ctxt_s { frame_t frame; /*!< \brief LTE 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) */ - boolean_t configured; /*!< \brief flag indicating whether the instance is configured or not */ boolean_t brOption; } protocol_ctxt_t; // warning time hardcoded diff --git a/openair2/F1AP/f1ap_cu_rrc_message_transfer.c b/openair2/F1AP/f1ap_cu_rrc_message_transfer.c index 78e7ae2c304e8922cc314593ea4e49bfaf020ecb..abb846e923d6504a4eb8ce87a3cdb7cce4cdcbb5 100644 --- a/openair2/F1AP/f1ap_cu_rrc_message_transfer.c +++ b/openair2/F1AP/f1ap_cu_rrc_message_transfer.c @@ -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.enb_flag = 1; ctxt.eNB_index = 0; - ctxt.configured = 1; 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); 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); diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c index cddb666bfdbd346cf2dc7ae4cd7837bc50d850bf..7fac0bdfcacf064991667418025bbf06e1ca166e 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c @@ -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", PROTOCOL_CTXT_ARGS(ctxt_pP), rb_idP); - ctxt_pP->configured=FALSE; return FALSE; } - } else { - // instance for a given RB is configured - ctxt_pP->configured=TRUE; } if (ctxt_pP->enb_flag == ENB_FLAG_YES) { diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent_common.c b/openair2/LAYER2/PROTO_AGENT/proto_agent_common.c index f19d7526fe3dc0467bb346ccd8d1a5ed36c4d263..50c97f06bea4900a41700c5d083a1086450d2b31 100644 --- a/openair2/LAYER2/PROTO_AGENT/proto_agent_common.c +++ b/openair2/LAYER2/PROTO_AGENT/proto_agent_common.c @@ -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.frame = ctxt->fsp_frame; ctxt_pP.subframe = ctxt->fsp_subframe; - ctxt_pP.configured = 1; ctxt_pP.brOption = 0; ctxt_pP.eNB_index = ctxt->fsp_enb_index; srb_flagP = rlc_data->fsp_srb_flag; diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c index 78ea9bfbf995f43b2b750e2fcba806b2042e22bc..486a032e8aeb57531667b667d0b8b9f4738f042e 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c @@ -263,7 +263,6 @@ static void *enb_tun_read_thread(void *_) ctxt.frame = 0; ctxt.subframe = 0; ctxt.eNB_index = 0; - ctxt.configured = 1; ctxt.brOption = 0; ctxt.rnti = rnti; @@ -307,7 +306,6 @@ static void *ue_tun_read_thread(void *_) ctxt.frame = 0; ctxt.subframe = 0; ctxt.eNB_index = 0; - ctxt.configured = 1; ctxt.brOption = 0; ctxt.rnti = rnti; @@ -515,11 +513,31 @@ rb_found: ctxt.frame = 0; ctxt.subframe = 0; ctxt.eNB_index = 0; - ctxt.configured = 1; ctxt.brOption = 0; 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=>PV1U_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__); memcpy(memblock->data, buf, size); @@ -603,7 +621,6 @@ srb_found: ctxt.frame = 0; ctxt.subframe = 0; ctxt.eNB_index = 0; - ctxt.configured = 1; ctxt.brOption = 0; ctxt.rnti = ue->rnti; @@ -646,7 +663,6 @@ boolean_t pdcp_data_ind( //ctxt_pP->enb_flag != 1 || ctxt_pP->instance != 0 || ctxt_pP->eNB_index != 0 || - ctxt_pP->configured != 1 || ctxt_pP->brOption != 0) { LOG_E(PDCP, "%s:%d:%s: fatal\n", __FILE__, __LINE__, __FUNCTION__); exit(1); @@ -697,7 +713,6 @@ void pdcp_run(const protocol_ctxt_t *const ctxt_pP) .frame=-1, .subframe=-1, .eNB_index=0, - .configured=true, .brOption=false }; @@ -1223,25 +1238,21 @@ boolean_t cu_f1u_data_req( ,const uint32_t *const destinationL2Id #endif ) { - MessageDef *message_p = itti_alloc_new_message_sized(TASK_PDCP_ENB, 0, - GTPV1U_GNB_TUNNEL_DATA_REQ, - sizeof(gtpv1u_gnb_tunnel_data_req_t) - + sdu_buffer_size - + GTPU_HEADER_OVERHEAD_MAX); - AssertFatal(message_p != NULL, "OUT OF MEMORY"); - gtpv1u_gnb_tunnel_data_req_t *req=>PV1U_GNB_TUNNEL_DATA_REQ(message_p); - uint8_t *gtpu_buffer_p = (uint8_t*)(req+1); - memcpy(gtpu_buffer_p+GTPU_HEADER_OVERHEAD_MAX, - sdu_buffer, sdu_buffer_size); - req->buffer = gtpu_buffer_p; - req->length = sdu_buffer_size; - req->offset = GTPU_HEADER_OVERHEAD_MAX; - req->rnti = ctxt_pP->rnti; - req->pdusession_id = rb_id; - 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; + + //Force instance id to 0, OAI incoherent instance management + ctxt_pP->instance=0; + mem_block_t *memblock = get_free_mem_block(sdu_buffer_size, __func__); + if (memblock == NULL) { + LOG_E(RLC, "%s:%d:%s: ERROR: get_free_mem_block failed\n", __FILE__, __LINE__, __FUNCTION__); + exit(1); + } + memcpy(memblock->data,sdu_buffer, sdu_buffer_size); + int ret=pdcp_data_ind(ctxt_pP,srb_flagP, false, rb_id, sdu_buffer_size, memblock); + if (!ret) { + LOG_E(RLC, "%s:%d:%s: ERROR: pdcp_data_ind failed\n", __FILE__, __LINE__, __FUNCTION__); + /* what to do in case of failure? for the moment: nothing */ + } + return ret; } boolean_t pdcp_data_req( diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c index 8c8067e7ded5d46a16bb7b85e806a76abf6b097f..44a7b7ac0126651fcb6615d2845641878cbe3e1d 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c @@ -461,7 +461,6 @@ rb_found: ctx.frame = 0; ctx.subframe = 0; ctx.eNB_index = 0; - ctx.configured = 1; ctx.brOption = 0; /* used fields? */ @@ -486,30 +485,32 @@ rb_found: // return; // } - if (NODE_IS_DU(type) && is_srb == 1) { - MessageDef *msg; - msg = itti_alloc_new_message(TASK_RLC_ENB, 0, F1AP_UL_RRC_MESSAGE); - uint8_t *message_buffer = itti_malloc (TASK_RLC_ENB, TASK_DU_F1, size); - memcpy (message_buffer, buf, size); - F1AP_UL_RRC_MESSAGE(msg).rnti = ue->rnti; - F1AP_UL_RRC_MESSAGE(msg).srb_id = rb_id; - F1AP_UL_RRC_MESSAGE(msg).rrc_container = message_buffer; - F1AP_UL_RRC_MESSAGE(msg).rrc_container_length = size; - 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) { - MessageDef *msg = itti_alloc_new_message_sized(TASK_RLC_ENB, 0, GTPV1U_GNB_TUNNEL_DATA_REQ, sizeof(gtpv1u_gnb_tunnel_data_req_t) + size); - gtpv1u_gnb_tunnel_data_req_t *req=>PV1U_GNB_TUNNEL_DATA_REQ(msg); - req->buffer=(uint8_t*)(req+1); - memcpy(req->buffer,buf,size); - req->length=size; - req->offset=0; - req->rnti=ue->rnti; - req->pdusession_id=rb_id; - LOG_D(RLC, "Received uplink user-plane traffic at RLC-DU to be sent to the CU, size %d \n", size); - itti_send_msg_to_task(OCP_GTPV1_U, 0, msg); - return; + if (NODE_IS_DU(type)) { + if(is_srb) { + MessageDef *msg; + msg = itti_alloc_new_message(TASK_RLC_ENB, 0, F1AP_UL_RRC_MESSAGE); + uint8_t *message_buffer = itti_malloc (TASK_RLC_ENB, TASK_DU_F1, size); + memcpy (message_buffer, buf, size); + F1AP_UL_RRC_MESSAGE(msg).rnti = ue->rnti; + F1AP_UL_RRC_MESSAGE(msg).srb_id = rb_id; + F1AP_UL_RRC_MESSAGE(msg).rrc_container = message_buffer; + F1AP_UL_RRC_MESSAGE(msg).rrc_container_length = size; + itti_send_msg_to_task(TASK_DU_F1, ENB_MODULE_ID_TO_INSTANCE(0 /*ctxt_pP->module_id*/), msg); + return; + } 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); + gtpv1u_gnb_tunnel_data_req_t *req=>PV1U_GNB_TUNNEL_DATA_REQ(msg); + req->buffer=(uint8_t*)(req+1); + memcpy(req->buffer,buf,size); + req->length=size; + req->offset=0; + req->rnti=ue->rnti; + req->pdusession_id=rb_id; + LOG_D(RLC, "Received uplink user-plane traffic at RLC-DU to be sent to the CU, size %d \n", size); + 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 if (/*ctxt_pP->enb_flag != 1 ||*/ ctxt_pP->module_id != 0 /*|| ctxt_pP->instance != 0 || ctxt_pP->eNB_index != 0 || - ctxt_pP->configured != 1 || ctxt_pP->brOption != 0 */) { - LOG_E(RLC, "%s: ctxt_pP not handled (%d %d %ld %d %d %d)\n", __FUNCTION__, + ctxt_pP->brOption != 0 */) { + 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_index, ctxt_pP->configured, ctxt_pP->brOption); + ctxt_pP->eNB_index, ctxt_pP->brOption); exit(1); } diff --git a/openair2/LAYER2/rlc_v2/rlc_oai_api.c b/openair2/LAYER2/rlc_v2/rlc_oai_api.c index 0cf4b85fa2cb98145cc1bc24f0a0a41f5eca793f..799beac2584810273ea86cc6960cfac6b2217bab 100644 --- a/openair2/LAYER2/rlc_v2/rlc_oai_api.c +++ b/openair2/LAYER2/rlc_v2/rlc_oai_api.c @@ -406,7 +406,6 @@ rb_found: ctx.frame = 0; ctx.subframe = 0; ctx.eNB_index = 0; - ctx.configured = 1; ctx.brOption = 0; /* used fields? */ @@ -832,10 +831,10 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP if (0 /*|| ctxt_pP->instance != 0 || ctxt_pP->eNB_index != 0 || - ctxt_pP->configured != 1 || ctxt_pP->brOption != 0 */) { - LOG_E(RLC, "%s: ctxt_pP not handled (%d %d %ld %d %d %d)\n", __FUNCTION__, + ctxt_pP->brOption != 0 */) { + 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_index, ctxt_pP->configured, ctxt_pP->brOption); + ctxt_pP->eNB_index, ctxt_pP->brOption); exit(1); } @@ -1041,4 +1040,4 @@ void du_rlc_data_req(const protocol_ctxt_t *const ctxt_pP, sdu_size_t sdu_sizeP, mem_block_t *sdu_pP){ -} \ No newline at end of file +} diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 891d7957c434acfb4bc9127a12e01a975017c637..5826e838f997e8217c89cc7b9963adf7175b910d 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -3586,7 +3586,6 @@ void *rrc_gnb_task(void *args_p) { .frame=-1, .subframe=-1, .eNB_index=0, - .configured=true, .brOption=false }; itti_mark_task_ready(TASK_RRC_GNB); diff --git a/openair3/GTPV1-U/gtpv1u_eNB.c b/openair3/GTPV1-U/gtpv1u_eNB.c index 0fe2741d7bd1f3bd9d3b3357b64e8d01a32ce807..9cf429426c7a6b46b99bfdc3cadbe5cc94c367ea 100644 --- a/openair3/GTPV1-U/gtpv1u_eNB.c +++ b/openair3/GTPV1-U/gtpv1u_eNB.c @@ -432,11 +432,7 @@ NwGtpv1uRcT gtpv1u_eNB_process_stack_req( ); if ( result == FALSE ) { - if (ctxt.configured == FALSE ) - 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"); - + LOG_W(GTPU, "PDCP data request failed\n"); return NW_GTPV1U_FAILURE; } } else { diff --git a/openair3/GTPV1-U/gtpv1u_gNB.c b/openair3/GTPV1-U/gtpv1u_gNB.c index 15353968032890be5fd8ba0eda18d9f517659765..ff7c8c06042ada5c623c3090ac655e52d616012e 100644 --- a/openair3/GTPV1-U/gtpv1u_gNB.c +++ b/openair3/GTPV1-U/gtpv1u_gNB.c @@ -191,9 +191,6 @@ NwGtpv1uRcT gtpv1u_gNB_process_stack_req( ); 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"); return NW_GTPV1U_FAILURE; @@ -390,9 +387,6 @@ NwGtpv1uRcT nr_gtpv1u_gNB_process_stack_req( ); 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"); return NW_GTPV1U_FAILURE; diff --git a/openair3/ocp-gtpu/gtp_itf.cpp b/openair3/ocp-gtpu/gtp_itf.cpp index 2a5e697f8ddc89ca27f4b91abdfada95fdbf00af..e7c73be14fc8c4283c6af6e26fe2131db5f80634 100644 --- a/openair3/ocp-gtpu/gtp_itf.cpp +++ b/openair3/ocp-gtpu/gtp_itf.cpp @@ -691,7 +691,6 @@ static int Gtpv1uHandleEndMarker(int h, ctxt.frame = 0; ctxt.subframe = 0; ctxt.eNB_index = 0; - ctxt.configured = 0; ctxt.brOption = 0; const srb_flag_t srb_flag=SRB_FLAG_NO; const rb_id_t rb_id=tunnel->second.incoming_rb_id; @@ -757,7 +756,6 @@ static int Gtpv1uHandleGpdu(int h, ctxt.frame = 0; ctxt.subframe = 0; ctxt.eNB_index = 0; - ctxt.configured = 0; ctxt.brOption = 0; const srb_flag_t srb_flag=SRB_FLAG_NO; const rb_id_t rb_id=tunnel->second.incoming_rb_id;