Commit 69c87b23 authored by Laurent THOMAS's avatar Laurent THOMAS

add F1-U DU Uplink

parent 229ccd6b
...@@ -470,18 +470,21 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity, ...@@ -470,18 +470,21 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity,
int offset=0; int offset=0;
if (entity->has_sdap == 1 && entity->has_sdapULheader == 1) offset = 1; // this is the offset of the SDAP header in bytes if (entity->has_sdap == 1 && entity->has_sdapULheader == 1) offset = 1; // this is the offset of the SDAP header in bytes
gtpu_buffer_p = itti_malloc(TASK_PDCP_ENB, TASK_GTPV1_U, message_p = itti_alloc_new_message_sized(TASK_PDCP_ENB, 0,
size + GTPU_HEADER_OVERHEAD_MAX - offset); GTPV1U_GNB_TUNNEL_DATA_REQ,
AssertFatal(gtpu_buffer_p != NULL, "OUT OF MEMORY"); sizeof(gtpv1u_gnb_tunnel_data_req_t) + size
memcpy(&gtpu_buffer_p[GTPU_HEADER_OVERHEAD_MAX], buf+offset, size-offset); + GTPU_HEADER_OVERHEAD_MAX - offset);
message_p = itti_alloc_new_message(TASK_PDCP_ENB, 0, GTPV1U_GNB_TUNNEL_DATA_REQ);
AssertFatal(message_p != NULL, "OUT OF MEMORY"); AssertFatal(message_p != NULL, "OUT OF MEMORY");
GTPV1U_GNB_TUNNEL_DATA_REQ(message_p).buffer = gtpu_buffer_p; gtpv1u_gnb_tunnel_data_req_t *req=&GTPV1U_GNB_TUNNEL_DATA_REQ(message_p);
GTPV1U_GNB_TUNNEL_DATA_REQ(message_p).length = size-offset; gtpu_buffer_p = (uint8_t*)(req+1);
GTPV1U_GNB_TUNNEL_DATA_REQ(message_p).offset = GTPU_HEADER_OVERHEAD_MAX; memcpy(gtpu_buffer_p+GTPU_HEADER_OVERHEAD_MAX, buf+offset, size-offset);
GTPV1U_GNB_TUNNEL_DATA_REQ(message_p).rnti = ue->rnti; req->buffer = gtpu_buffer_p;
GTPV1U_GNB_TUNNEL_DATA_REQ(message_p).pdusession_id = entity->pdusession_id; req->length = size-offset;
if (offset==1) LOG_I(PDCP, "%s() (drb %d) SDAP header %2x\n",__func__, rb_id, buf[0]); req->offset = GTPU_HEADER_OVERHEAD_MAX;
req->rnti = ue->rnti;
req->pdusession_id = entity->pdusession_id;
if (offset==1)
LOG_I(PDCP, "%s() (drb %d) SDAP header %2x\n",__func__, rb_id, buf[0]);
LOG_D(PDCP, "%s() (drb %d) sending message to gtp size %d\n", __func__, rb_id, size-offset); LOG_D(PDCP, "%s() (drb %d) sending message to gtp size %d\n", __func__, rb_id, size-offset);
itti_send_msg_to_task(TASK_VARIABLE, INSTANCE_DEFAULT, message_p); itti_send_msg_to_task(TASK_VARIABLE, INSTANCE_DEFAULT, message_p);
} }
......
...@@ -456,13 +456,6 @@ rb_found: ...@@ -456,13 +456,6 @@ rb_found:
LOG_D(RLC, "%s:%d:%s: delivering SDU (rnti %d is_srb %d rb_id %d) size %d\n", LOG_D(RLC, "%s:%d:%s: delivering SDU (rnti %d is_srb %d rb_id %d) size %d\n",
__FILE__, __LINE__, __FUNCTION__, ue->rnti, is_srb, rb_id, size); __FILE__, __LINE__, __FUNCTION__, ue->rnti, is_srb, rb_id, size);
memblock = get_free_mem_block(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, buf, size);
/* unused fields? */ /* unused fields? */
ctx.instance = 0; ctx.instance = 0;
ctx.frame = 0; ctx.frame = 0;
...@@ -506,11 +499,26 @@ rb_found: ...@@ -506,11 +499,26 @@ rb_found:
return; return;
} }
else if(NODE_IS_DU(type) && is_srb == 0) { else if(NODE_IS_DU(type) && is_srb == 0) {
LOG_W(RLC, "Received uplink user-plane traffic at RLC-DU to be sent to the CU, but F1-U implementation is not in place yet \n"); 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=&GTPV1U_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; return;
} }
} }
memblock = get_free_mem_block(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, buf, size);
if (!pdcp_data_ind(&ctx, is_srb, 0, rb_id, size, memblock)) { if (!pdcp_data_ind(&ctx, is_srb, 0, rb_id, size, memblock)) {
LOG_E(RLC, "%s:%d:%s: ERROR: pdcp_data_ind failed\n", __FILE__, __LINE__, __FUNCTION__); 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 */ /* what to do in case of failure? for the moment: nothing */
......
...@@ -841,7 +841,6 @@ void *ocp_gtpv1uTask(void *args) { ...@@ -841,7 +841,6 @@ void *ocp_gtpv1uTask(void *args) {
case GTPV1U_GNB_TUNNEL_DATA_REQ: { case GTPV1U_GNB_TUNNEL_DATA_REQ: {
gtpv1uSend2(compatInst(ITTI_MSG_DESTINATION_INSTANCE(message_p)), gtpv1uSend2(compatInst(ITTI_MSG_DESTINATION_INSTANCE(message_p)),
&GTPV1U_GNB_TUNNEL_DATA_REQ(message_p), false, false); &GTPV1U_GNB_TUNNEL_DATA_REQ(message_p), false, false);
itti_free(OCP_GTPV1_U, GTPV1U_GNB_TUNNEL_DATA_REQ(message_p).buffer);
} }
break; break;
......
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