From b56cb55e9c8cb987c01cde468303517cc737418f Mon Sep 17 00:00:00 2001 From: Lionel Gauthier Date: Thu, 6 Nov 2014 09:22:02 +0000 Subject: [PATCH] git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5988 818b1a75-f10b-46b9-bf7c-635c3b92a50f --- openair-cn/GTPV1-U/gtpv1u_eNB.c | 55 +++++++++++++++------------- openair-cn/GTPV1-U/gtpv1u_eNB_defs.h | 3 +- 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/openair-cn/GTPV1-U/gtpv1u_eNB.c b/openair-cn/GTPV1-U/gtpv1u_eNB.c index ce50b34776..0767b5f642 100644 --- a/openair-cn/GTPV1-U/gtpv1u_eNB.c +++ b/openair-cn/GTPV1-U/gtpv1u_eNB.c @@ -101,7 +101,6 @@ int uint32_t address, uint8_t *buffer, uint32_t length, - uint32_t offset, void *arg_p); //int //gtpv1u_create_tunnel_endpoint( @@ -137,7 +136,8 @@ gtpv1u_new_data_req( uint8_t ue_idP, uint8_t rab_idP, uint8_t *buffer_pP, - uint32_t buf_lenP); + uint32_t buf_lenP, + uint32_t buf_offsetP); static int gtpv1u_create_s1u_tunnel( @@ -170,7 +170,7 @@ static int gtpv1u_eNB_send_init_udp(uint16_t port_number) addr.s_addr = gtpv1u_data_g.enb_ip_address_for_S1u_S12_S4_up; UDP_INIT(message_p).address = inet_ntoa(addr); - GTPU_DEBUG("Tx UDP_INIT IP addr %s\n", UDP_INIT(message_p).address); + LOG_D(GTPU, "Tx UDP_INIT IP addr %s\n", UDP_INIT(message_p).address); return itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p); } @@ -181,7 +181,7 @@ NwGtpv1uRcT gtpv1u_eNB_log_request(NwGtpv1uLogMgrHandleT hLogMgr, NwU32T line, NwCharT *logStr) { - GTPU_DEBUG("%s\n", logStr); + LOG_D(GTPU, "%s\n", logStr); return NW_GTPV1U_OK; } @@ -237,7 +237,7 @@ NwGtpv1uRcT gtpv1u_eNB_process_stack_req( teid = pUlpApi->apiInfo.recvMsgInfo.teid; if (NW_GTPV1U_OK != nwGtpv1uMsgGetTpdu(pUlpApi->apiInfo.recvMsgInfo.hMsg, buffer, &buffer_len)) { - GTPU_ERROR("Error while retrieving T-PDU"); + LOG_E(GTPU, "Error while retrieving T-PDU"); } //----------------------- @@ -245,7 +245,7 @@ NwGtpv1uRcT gtpv1u_eNB_process_stack_req( //----------------------- hash_rc = hashtable_get(gtpv1u_data_g.teid_mapping, teid, (void**)>pv1u_teid_data_p); if (hash_rc == HASH_TABLE_OK) { - GTPU_DEBUG("Received T-PDU from gtpv1u stack teid %u size %d -> enb module id %u ue module id %u rab id %u\n", + LOG_D(GTPU, "Received T-PDU from gtpv1u stack teid %u size %d -> enb module id %u ue module id %u rab id %u\n", teid, buffer_len, gtpv1u_teid_data_p->enb_id, @@ -268,12 +268,12 @@ NwGtpv1uRcT gtpv1u_eNB_process_stack_req( PDCP_TRANSMISSION_MODE_DATA); AssertError (result == TRUE, return NW_GTPV1U_FAILURE ,"PDCP data request failed!\n"); } else { - GTPU_ERROR("Received T-PDU from gtpv1u stack teid %u unknown size %u", teid, buffer_len); + LOG_E(GTPU, "Received T-PDU from gtpv1u stack teid %u unknown size %u", teid, buffer_len); } } break; default: { - GTPU_ERROR("Received undefined UlpApi (%02x) from gtpv1u stack!\n", + LOG_E(GTPU, "Received undefined UlpApi (%02x) from gtpv1u stack!\n", pUlpApi->apiType); } } @@ -475,7 +475,9 @@ gtpv1u_new_data_req( uint8_t ue_idP, uint8_t rab_idP, uint8_t *buffer_pP, - uint32_t buf_lenP) + uint32_t buf_lenP, + uint32_t buf_offsetP + ) { NwGtpv1uUlpApiT stack_req; @@ -529,6 +531,7 @@ gtpv1u_new_data_req( gtpv1u_data_p->seq_num++, buffer_pP, buf_lenP, + buf_offsetP, &(stack_req.apiInfo.sendtoInfo.hMsg)); if (rc != NW_GTPV1U_OK) { @@ -577,7 +580,7 @@ static int gtpv1u_create_s1u_tunnel(gtpv1u_enb_create_tunnel_req_t *create_tunne for (i = 0; i < create_tunnel_req_pP->num_tunnels; i++) { ip_offset = 0; eps_bearer_id = create_tunnel_req_pP->eps_bearer_id[i]; - GTPU_DEBUG("Rx GTPV1U_ENB_CREATE_TUNNEL_REQ ue_index %u eps bearer id %u\n", + LOG_D(GTPU, "Rx GTPV1U_ENB_CREATE_TUNNEL_REQ ue_index %u eps bearer id %u\n", create_tunnel_req_pP->ue_index, eps_bearer_id); memset(&stack_req, 0, sizeof(NwGtpv1uUlpApiT)); @@ -585,13 +588,13 @@ static int gtpv1u_create_s1u_tunnel(gtpv1u_enb_create_tunnel_req_t *create_tunne do { s1u_teid = gtpv1u_new_teid(); - GTPU_DEBUG("gtpv1u_create_s1u_tunnel() 0x%x %u(dec)\n", s1u_teid, s1u_teid); + LOG_D(GTPU, "gtpv1u_create_s1u_tunnel() 0x%x %u(dec)\n", s1u_teid, s1u_teid); stack_req.apiInfo.createTunnelEndPointInfo.teid = s1u_teid; stack_req.apiInfo.createTunnelEndPointInfo.hUlpSession = 0; stack_req.apiInfo.createTunnelEndPointInfo.hStackSession = 0; rc = nwGtpv1uProcessUlpReq(gtpv1u_data_g.gtpv1u_stack, &stack_req); - GTPU_DEBUG(".\n"); + LOG_D(GTPU, ".\n"); } while (rc != NW_GTPV1U_OK); //----------------------- @@ -659,7 +662,7 @@ static int gtpv1u_create_s1u_tunnel(gtpv1u_enb_create_tunnel_req_t *create_tunne GTPV1U_ENB_CREATE_TUNNEL_RESP(message_p).status = 0xFF; } } - GTPU_DEBUG("Tx GTPV1U_ENB_CREATE_TUNNEL_RESP ue_index %u status %d\n", + LOG_D(GTPU, "Tx GTPV1U_ENB_CREATE_TUNNEL_RESP ue_index %u status %d\n", create_tunnel_req_pP->ue_index, GTPV1U_ENB_CREATE_TUNNEL_RESP(message_p).status); return itti_send_msg_to_task(TASK_RRC_ENB, INSTANCE_DEFAULT, message_p); @@ -675,7 +678,7 @@ static int gtpv1u_delete_s1u_tunnel(gtpv1u_enb_delete_tunnel_req_t *req_pP) gtpv1u_ue_data_t *gtpv1u_ue_data_p = NULL; hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - GTPU_DEBUG("Rx GTPV1U_ENB_DELETE_TUNNEL user index %u eNB S1U teid %u eps bearer id %u\n", req_pP->ue_index, req_pP->enb_S1u_teid, req_pP->eps_bearer_id); + LOG_D(GTPU, "Rx GTPV1U_ENB_DELETE_TUNNEL user index %u eNB S1U teid %u eps bearer id %u\n", req_pP->ue_index, req_pP->enb_S1u_teid, req_pP->eps_bearer_id); message_p = itti_alloc_new_message(TASK_GTPV1_U, GTPV1U_ENB_DELETE_TUNNEL_RESP); GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).enb_S1u_teid = req_pP->enb_S1u_teid; @@ -685,17 +688,17 @@ static int gtpv1u_delete_s1u_tunnel(gtpv1u_enb_delete_tunnel_req_t *req_pP) { memset(&stack_req, 0, sizeof(NwGtpv1uUlpApiT)); stack_req.apiType = NW_GTPV1U_ULP_API_DESTROY_TUNNEL_ENDPOINT; - GTPU_DEBUG("gtpv1u_delte_s1u_tunnel() %u\n", req_pP->enb_S1u_teid); + LOG_D(GTPU, "gtpv1u_delte_s1u_tunnel() %u\n", req_pP->enb_S1u_teid); stack_req.apiInfo.createTunnelEndPointInfo.teid = req_pP->enb_S1u_teid; stack_req.apiInfo.createTunnelEndPointInfo.hUlpSession = 0; stack_req.apiInfo.createTunnelEndPointInfo.hStackSession = 0; rc = nwGtpv1uProcessUlpReq(gtpv1u_data_g.gtpv1u_stack, &stack_req); - GTPU_DEBUG(".\n"); + LOG_D(GTPU, ".\n"); } if (rc != NW_GTPV1U_OK) { GTPV1U_ENB_CREATE_TUNNEL_RESP(message_p).status = 0xFF; - GTPU_ERROR("NW_GTPV1U_ULP_API_DESTROY_TUNNEL_ENDPOINT failed"); + LOG_E(GTPU, "NW_GTPV1U_ULP_API_DESTROY_TUNNEL_ENDPOINT failed"); } //----------------------- @@ -711,7 +714,7 @@ static int gtpv1u_delete_s1u_tunnel(gtpv1u_enb_delete_tunnel_req_t *req_pP) if (gtpv1u_ue_data_p->num_bearers == 0) { hash_rc = hashtable_remove(gtpv1u_data_g.ue_mapping, req_pP->ue_index); - GTPU_DEBUG("Removed user index %u,no more bearers configured\n", req_pP->ue_index); + LOG_D(GTPU, "Removed user index %u,no more bearers configured\n", req_pP->ue_index); } }// else silently do nothing @@ -720,7 +723,7 @@ static int gtpv1u_delete_s1u_tunnel(gtpv1u_enb_delete_tunnel_req_t *req_pP) //----------------------- hash_rc = hashtable_remove(gtpv1u_data_g.teid_mapping, req_pP->enb_S1u_teid); if (hash_rc != HASH_TABLE_OK) { - GTPU_DEBUG("Removed user index %u , enb S1U teid %u not found\n", req_pP->ue_index, req_pP->enb_S1u_teid); + LOG_D(GTPU, "Removed user index %u , enb S1U teid %u not found\n", req_pP->ue_index, req_pP->enb_S1u_teid); } LOG_D(GTPU, "Tx GTPV1U_ENB_DELETE_TUNNEL_RESP user index %u eNB S1U teid %u status %u\n", @@ -745,7 +748,7 @@ static int gtpv1u_eNB_init(void) memset(>pv1u_data_g, 0, sizeof(gtpv1u_data_g)); - GTPU_INFO("Initializing GTPU stack %p\n",>pv1u_data_g); + LOG_I(GTPU, "Initializing GTPU stack %p\n",>pv1u_data_g); //gtpv1u_data_g.gtpv1u_stack; /* Initialize UE hashtable */ gtpv1u_data_g.ue_mapping = hashtable_create (32, NULL, NULL); @@ -788,7 +791,7 @@ static int gtpv1u_eNB_init(void) udp.udpDataReqCallback = gtpv1u_eNB_send_udp_msg; if ((rc = nwGtpv1uSetUdpEntity(gtpv1u_data_g.gtpv1u_stack, &udp)) != NW_GTPV1U_OK) { - GTPU_ERROR("nwGtpv1uSetUdpEntity: %x", rc); + LOG_E(GTPU, "nwGtpv1uSetUdpEntity: %x", rc); return -1; } @@ -884,7 +887,7 @@ void *gtpv1u_eNB_task(void *args) hash_rc = hashtable_get(gtpv1u_data_g.ue_mapping, (uint64_t)data_req_p->ue_index, (void**)>pv1u_ue_data_p); if (hash_rc == HASH_TABLE_KEY_NOT_EXISTS) { - GTPU_ERROR("nwGtpv1uProcessUlpReq failed: while getting ue_index %u in hashtable ue_mapping\n", data_req_p->ue_index); + LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: while getting ue_index %u in hashtable ue_mapping\n", data_req_p->ue_index); } else { if ((data_req_p->rab_id >= GTPV1U_BEARER_OFFSET) && (data_req_p->rab_id <= max_val_DRB_Identity)) { enb_s1u_teid = gtpv1u_ue_data_p->bearers[data_req_p->rab_id - GTPV1U_BEARER_OFFSET].teid_eNB; @@ -904,16 +907,16 @@ void *gtpv1u_eNB_task(void *args) &(stack_req.apiInfo.sendtoInfo.hMsg)); if (rc != NW_GTPV1U_OK) { - GTPU_ERROR("nwGtpv1uGpduMsgNew failed: 0x%x\n", rc); + LOG_E(GTPU, "nwGtpv1uGpduMsgNew failed: 0x%x\n", rc); } else { rc = nwGtpv1uProcessUlpReq(gtpv1u_data_g.gtpv1u_stack, &stack_req); if (rc != NW_GTPV1U_OK) { - GTPU_ERROR("nwGtpv1uProcessUlpReq failed: 0x%x\n", rc); + LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: 0x%x\n", rc); } rc = nwGtpv1uMsgDelete(gtpv1u_data_g.gtpv1u_stack, stack_req.apiInfo.sendtoInfo.hMsg); if (rc != NW_GTPV1U_OK) { - GTPU_ERROR("nwGtpv1uMsgDelete failed: 0x%x\n", rc); + LOG_E(GTPU, "nwGtpv1uMsgDelete failed: 0x%x\n", rc); } } } @@ -937,7 +940,7 @@ void *gtpv1u_eNB_task(void *args) nwGtpv1uProcessTimeout(&received_message_p->ittiMsg.timer_has_expired.arg); break; default: { - GTPU_ERROR("Unkwnon message ID %d:%s\n", + LOG_E(GTPU, "Unkwnon message ID %d:%s\n", ITTI_MSG_ID(received_message_p), ITTI_MSG_NAME(received_message_p)); } diff --git a/openair-cn/GTPV1-U/gtpv1u_eNB_defs.h b/openair-cn/GTPV1-U/gtpv1u_eNB_defs.h index 8bdbd041b3..f8984e531a 100644 --- a/openair-cn/GTPV1-U/gtpv1u_eNB_defs.h +++ b/openair-cn/GTPV1-U/gtpv1u_eNB_defs.h @@ -125,7 +125,8 @@ gtpv1u_new_data_req( uint8_t ue_id, uint8_t rab_id, uint8_t *buffer, - uint32_t buf_len); + uint32_t buf_len, + uint32_t buf_offset); int gtpv1u_initial_req(