From 2ffb674d5842f9b65a94a5c513f46c153565a672 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 11 Dec 2024 08:28:16 +0100 Subject: [PATCH] F1AP: Use GTP direct API instead of ITTI See parent commit for more information. --- doc/F1AP/F1-design.md | 8 ++++---- openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c | 16 +--------------- openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c | 12 ++---------- 3 files changed, 7 insertions(+), 29 deletions(-) diff --git a/doc/F1AP/F1-design.md b/doc/F1AP/F1-design.md index 627e2b4fc2..65ea6b38cf 100644 --- a/doc/F1AP/F1-design.md +++ b/doc/F1AP/F1-design.md @@ -378,15 +378,15 @@ You might also want to consult TS 38.401 regarding the message exchange. ### General In the DU in UL, RLC checks in `deliver_sdu()` if we are operating in split -mode, and either (direct) calls `pdcp_data_ind` (DRB) or (f1ap) sends an -`GTPV1U_TUNNEL_DATA_REQ` ITTI message to the GTP task. +mode, and either (direct) calls `pdcp_data_ind` (DRB) or (f1ap) sends a GTP +message through the GTP API. In the CU in UL, assuming the tunnel is in place, GTP decapsulates the packet and calls the callback `cu_f1u_data_req()`, which calls `pdcp_data_ind()` in CU. In the CU in DL, the PDCP function `deliver_pdu_drb_gnb()` either (direct) calls -into the RLC via `enqueue_rlc_data_req()`, or (f1ap) sends a -`GTPV1U_TUNNEL_DATA_REQ` ITTI message to the GTP task. +into the RLC via `enqueue_rlc_data_req()`, or (f1ap) sends a GTP message +through the GTP API. In the DU in DL, assuming the GTP-U tunnel exists, GTP decapsulates the packet and calls the reception call back `du_rlc_data_req()`, which calls diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c index cb80ec99ce..7691871b33 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c @@ -718,23 +718,9 @@ static void deliver_pdu_drb_gnb(void *deliver_pdu_data, ue_id_t ue_id, int rb_id protocol_ctxt_t ctxt = { .enb_flag = 1, .rntiMaybeUEid = ue_data.secondary_ue }; if (NODE_IS_CU(node_type)) { - MessageDef *message_p = itti_alloc_new_message_sized(TASK_PDCP_ENB, 0, - GTPV1U_TUNNEL_DATA_REQ, - sizeof(gtpv1u_tunnel_data_req_t) - + size - + GTPU_HEADER_OVERHEAD_MAX); - AssertFatal(message_p != NULL, "OUT OF MEMORY"); - gtpv1u_tunnel_data_req_t *req=>PV1U_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->ue_id = ue_id; // use CU UE ID as GTP will use that to look up TEID - req->bearer_id = rb_id; LOG_D(PDCP, "%s() (drb %d) sending message to gtp size %d\n", __func__, rb_id, size); extern instance_t CUuniqInstance; - itti_send_msg_to_task(TASK_GTPV1_U, CUuniqInstance, message_p); + gtpv1uSendDirect(CUuniqInstance, ue_id, rb_id, (uint8_t *)buf, size, false, false); } else { uint8_t *memblock = malloc16(size); memcpy(memblock, buf, size); diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c index 2ebd18f5e7..64a152f847 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c @@ -40,6 +40,7 @@ #include "openair2/F1AP/f1ap_du_rrc_message_transfer.h" #include "openair2/F1AP/f1ap_ids.h" +#include "openair3/ocp-gtpu/gtp_itf.h" extern RAN_CONTEXT_t RC; @@ -525,18 +526,9 @@ rb_found: 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_TUNNEL_DATA_REQ, - sizeof(gtpv1u_tunnel_data_req_t) + size); - gtpv1u_tunnel_data_req_t *req=>PV1U_TUNNEL_DATA_REQ(msg); - req->buffer=(uint8_t*)(req+1); - memcpy(req->buffer,buf,size); - req->length=size; - req->offset = 0; - req->ue_id = ue->ue_id; - req->bearer_id=rb_id; LOG_D(RLC, "Received uplink user-plane traffic at RLC-DU to be sent to the CU, size %d \n", size); extern instance_t DUuniqInstance; - itti_send_msg_to_task(TASK_GTPV1_U, DUuniqInstance, msg); + gtpv1uSendDirect(DUuniqInstance, ue->ue_id, rb_id, (uint8_t*) buf, size, false, false); return; } }