diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h index 22d393d1a7..21c51cba8f 100644 --- a/common/utils/LOG/log.h +++ b/common/utils/LOG/log.h @@ -524,11 +524,6 @@ static inline void updateTimes(uint64_t start, Meas *M, int period, char * txt) } #endif - -pthread_mutex_t async_server_lock; -pthread_cond_t async_server_notify; -int async_server_shutdown; - #endif diff --git a/openair2/F1AP/f1ap_cu_task.c b/openair2/F1AP/f1ap_cu_task.c index 55a1160c46..925a6327d0 100644 --- a/openair2/F1AP/f1ap_cu_task.c +++ b/openair2/F1AP/f1ap_cu_task.c @@ -35,6 +35,7 @@ #include "f1ap_cu_interface_management.h" #include "f1ap_cu_rrc_message_transfer.h" #include "f1ap_cu_task.h" +#include "proto_agent.h" extern RAN_CONTEXT_t RC; @@ -64,6 +65,17 @@ void cu_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat f1ap_du_data_from_du->assoc_id = sctp_new_association_resp->assoc_id; f1ap_du_data_from_du->sctp_in_streams = sctp_new_association_resp->in_streams; f1ap_du_data_from_du->sctp_out_streams = sctp_new_association_resp->out_streams; + + /* setup parameters for F1U and start the server */ + const cudu_params_t params = { + .local_interface = NULL, /* is not used */ + .local_ipv4_address = RC.rrc[instance]->eth_params_s.my_addr, + .local_port = RC.rrc[instance]->eth_params_s.my_portd, + .remote_ipv4_address = RC.rrc[instance]->eth_params_s.remote_addr, + .remote_port = RC.rrc[instance]->eth_params_s.remote_portd + }; + AssertFatal(proto_agent_start(instance, ¶ms) == 0, + "could not start PROTO_AGENT for F1U on instance %d!\n", instance); } void cu_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind) { diff --git a/openair2/F1AP/f1ap_du_task.c b/openair2/F1AP/f1ap_du_task.c index 73dc40e655..bcd14cfa36 100644 --- a/openair2/F1AP/f1ap_du_task.c +++ b/openair2/F1AP/f1ap_du_task.c @@ -34,6 +34,9 @@ #include "f1ap_handlers.h" #include "f1ap_du_interface_management.h" #include "f1ap_du_task.h" +#include "proto_agent.h" + +extern RAN_CONTEXT_t RC; f1ap_setup_req_t *f1ap_du_data; @@ -95,6 +98,16 @@ void du_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat f1ap_du_data->sctp_out_streams = sctp_new_association_resp->out_streams; f1ap_du_data->default_sctp_stream_id = 0; + /* setup parameters for F1U and start the server */ + const cudu_params_t params = { + .local_interface = NULL, /* is not used */ + .local_ipv4_address = RC.mac[instance]->eth_params_n.my_addr, + .local_port = RC.mac[instance]->eth_params_n.my_portd, + .remote_ipv4_address = RC.mac[instance]->eth_params_n.remote_addr, + .remote_port = RC.mac[instance]->eth_params_n.remote_portd + }; + AssertFatal(proto_agent_start(instance, ¶ms) == 0, + "could not start PROTO_AGENT for F1U on instance %d!\n", instance); DU_send_F1_SETUP_REQUEST(instance); } diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c index 972d4f16ef..3b4983a59d 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c @@ -189,11 +189,23 @@ boolean_t pdcp_data_req( (unsigned char*)&pdcp_pdu_p->data[0], sdu_buffer_sizeP); #endif - rlc_status = rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_YES, rb_idP, muiP, confirmP, sdu_buffer_sizeP, pdcp_pdu_p + if (RC.rrc[ctxt_pP->module_id]->node_type == ngran_eNB_CU + || RC.rrc[ctxt_pP->module_id]->node_type == ngran_ng_eNB_CU + || RC.rrc[ctxt_pP->module_id]->node_type == ngran_gNB_CU) { + /* currently, there is no support to send also the source/destinationL2Id */ + proto_agent_send_rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_NO, rb_idP, muiP, + confirmP, sdu_buffer_sizeP, pdcp_pdu_p); + /* assume good status */ + rlc_status = RLC_OP_STATUS_OK; + + } else { + rlc_status = rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_YES, rb_idP, muiP, + confirmP, sdu_buffer_sizeP, pdcp_pdu_p #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) - ,NULL, NULL + ,NULL, NULL #endif - ); + ); + } } else { rlc_status = RLC_OP_STATUS_OUT_OF_RESSOURCES; LOG_W(PDCP,PROTOCOL_CTXT_FMT" PDCP_DATA_REQ SDU DROPPED, OUT OF MEMORY \n", @@ -377,24 +389,27 @@ boolean_t pdcp_data_req( #ifndef UETARGET if ((pdcp_pdu_p!=NULL) && (srb_flagP == 0) && (ctxt_pP->enb_flag == 1)) { + if (RC.rrc[ctxt_pP->module_id]->node_type == ngran_eNB_CU + || RC.rrc[ctxt_pP->module_id]->node_type == ngran_ng_eNB_CU + || RC.rrc[ctxt_pP->module_id]->node_type == ngran_gNB_CU) { + /* currently, there is no support to send also the source/destinationL2Id */ + proto_agent_send_rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_NO, rb_idP, muiP, + confirmP, pdcp_pdu_size, pdcp_pdu_p); + /* assume good status */ + rlc_status = RLC_OP_STATUS_OK; + } else { - { - LOG_E(PDCP, "proto_agent_send_rlc_data_req()\n"); - { - //proto_agent_send_rlc_data_req(0,cudu->cu[j].du_type, ctxt_pP, srb_flagP, - //MBMS_FLAG_NO,rb_idP, muiP, confirmP, pdcp_pdu_size, pdcp_pdu_p); - } - //rlc_status = rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_NO, rb_idP, muiP, confirmP, pdcp_pdu_size, pdcp_pdu_p + rlc_status = rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_NO, rb_idP, muiP, + confirmP, pdcp_pdu_size, pdcp_pdu_p #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) - //,sourceL2Id - //,destinationL2Id + ,sourceL2Id + ,destinationL2Id #endif - //); - - } + ); + } /* end if node_type is CU */ - free_mem_block(pdcp_pdu_p, __FUNCTION__); - rlc_status = ack_result; + free_mem_block(pdcp_pdu_p, __FUNCTION__); + rlc_status = ack_result; } else diff --git a/openair2/LAYER2/RLC/rlc.c b/openair2/LAYER2/RLC/rlc.c index f377869edd..d54938d400 100644 --- a/openair2/LAYER2/RLC/rlc.c +++ b/openair2/LAYER2/RLC/rlc.c @@ -54,68 +54,7 @@ extern boolean_t pdcp_data_ind( -#include "rlc_proto_agent_primitives.h" -// PROTO AGENT -#ifndef UETARGET -void -async_server_thread_init (void) -{ - //create log_list - //log_list_init(&log_list); - - //AssertFatal(0, "this should not be reached!\n"); - async_server_shutdown = 0; - - if ((pthread_mutex_init (&async_server_lock, NULL) != 0) - || (pthread_cond_init (&async_server_notify, NULL) != 0)) { - return; - } - //if (pthread_create (&async_server_thread, NULL, proto_server_init, (void*) NULL) - // != 0) { - // async_server_thread_finalize(); - // return; - //} - - -} - -int -async_server_thread_finalize (void) -{ - int err = 0; - - - if (pthread_mutex_lock (&async_server_lock) != 0) { - return -1; - } - - async_server_shutdown = 1; - - /* Wake up LOG thread */ - if ((pthread_cond_broadcast (&async_server_notify) != 0) - || (pthread_mutex_unlock (&async_server_lock) != 0)) { - err = -1; - } - - if (pthread_join (async_server_thread, NULL) != 0) { - err = -1; - } - - if (pthread_mutex_unlock (&async_server_lock) != 0) { - err = -1; - } - - if (!err) { - //log_list_free(&log_list); - pthread_mutex_lock (&async_server_lock); - pthread_mutex_destroy (&async_server_lock); - pthread_cond_destroy (&async_server_notify); - } - - return err; -} - -#endif /*UETARGET*/ +#include "proto_agent.h" //----------------------------------------------------------------------------- void rlc_util_print_hex_octets(comp_name_t componentP, unsigned char* dataP, const signed long sizeP) @@ -680,24 +619,13 @@ void rlc_data_ind ( T(T_ENB_RLC_UL, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->rnti), T_INT(rb_idP), T_INT(sdu_sizeP)); #endif #ifndef UETARGET - if ((!srb_flagP) && (ctxt_pP->enb_flag == 1)) + if (ctxt_pP->enb_flag == 1) { - proto_agent_send_pdcp_data_ind(ctxt_pP, - srb_flagP, - MBMS_flagP, - rb_idP, - sdu_sizeP, - sdu_pP); - } - else - - { - switch (RC.rrc[ctxt_pP->module_id]->node_type){ case ngran_eNB_CU : case ngran_ng_eNB_CU : case ngran_gNB_CU : - pdcp_data_ind ( + proto_agent_send_pdcp_data_ind ( ctxt_pP, 1, // srb_flagP, 0, // MBMS_flagP, @@ -804,19 +732,6 @@ rlc_module_init (void) pool_buffer_init(); -/* -#ifndef UETARGET - // Launch the RLC listening server - // as a separate thread - - static int started = 0; - if (started == 0) - { - async_server_thread_init(); - started = 1; - } -#endif -*/ return(0); } //----------------------------------------------------------------------------- diff --git a/openair2/LAYER2/RLC/rlc.h b/openair2/LAYER2/RLC/rlc.h index 9aee5cbc11..cedfbe17de 100644 --- a/openair2/LAYER2/RLC/rlc.h +++ b/openair2/LAYER2/RLC/rlc.h @@ -682,14 +682,4 @@ int rlc_module_init(void); #define RLC_REVERSE_VIDEO "\e[7m" #define RLC_NORMAL_VIDEO "\e[27m" -// PROTO AGENT -pthread_t async_server_thread; -int async_server_thread_finalize (void); -void async_server_thread_init (void); - - - - - - #endif