Commit 32ebb876 authored by Laurent THOMAS's avatar Laurent THOMAS

F1-U in gtp-U LTE case, working

parent c7f9365c
......@@ -522,8 +522,8 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
f1ap_ue_context_setup_req->drbs_to_be_setup[i].up_ul_tnl[j].teid=
newGtpuCreateTunnel(getCxt(CUtype, instance)->gtpInst,
f1ap_ue_context_setup_req->rnti,
f1ap_ue_context_setup_req->drbs_to_be_setup[i].drb_id-4,
f1ap_ue_context_setup_req->drbs_to_be_setup[i].drb_id-4,
f1ap_ue_context_setup_req->drbs_to_be_setup[i].drb_id,
f1ap_ue_context_setup_req->drbs_to_be_setup[i].drb_id,
0xFFFF, // We will set the right value from DU answer
addr,
f1ap_ue_context_setup_req->drbs_to_be_setup[i].up_dl_tnl[0].port,
......
......@@ -55,7 +55,11 @@ boolean_t lteDURecvCb( protocol_ctxt_t *ctxt_pP,
// The buffer comes from the stack in gtp-u thread, we have a make a separate buffer to enqueue in a inter-thread message queue
mem_block_t *sdu=get_free_mem_block(sdu_buffer_sizeP, __func__);
memcpy(sdu->data, sdu_buffer_pP, sdu_buffer_sizeP);
du_rlc_data_req(ctxt_pP,srb_flagP, false, rb_idP,muiP, confirmP, sdu_buffer_sizeP, sdu);
// weird rb id management in 4G, not fully understand (looks bad design)
// overcomplex: if i understand, on the interface DRB start at 4 because there can be SRB 0..3
// but it would be much simpler to use absolute numbering
// instead of this "srb flag" associated to these +/-4
du_rlc_data_req(ctxt_pP,srb_flagP, false, rb_idP-4,muiP, confirmP, sdu_buffer_sizeP, sdu);
return true;
}
......@@ -175,6 +179,7 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
addr,
2152,
lteDURecvCb);
drb_p->up_dl_tnl_length++;
}
}
}
......@@ -220,7 +225,6 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
ctxt.enb_flag = 1;
mem_block_t *pdcp_pdu_p = get_free_mem_block(ieRRC->value.choice.RRCContainer.size, __func__);
memcpy(&pdcp_pdu_p->data[0], ieRRC->value.choice.RRCContainer.buf, ieRRC->value.choice.RRCContainer.size);
/* for rfsim */
du_rlc_data_req(&ctxt, 1, 0x00, 1, 1, 0, ieRRC->value.choice.RRCContainer.size, pdcp_pdu_p);
} else {
LOG_E(F1AP, " RRCContainer in UEContextSetupRequestIEs size id 0\n");
......@@ -229,9 +233,11 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
LOG_W(F1AP, "can't find RRCContainer in UEContextSetupRequestIEs by id %ld \n", F1AP_ProtocolIE_ID_id_RRCContainer);
}
//DU_send_UE_CONTEXT_SETUP_RESPONSE(instance, f1ap_ue_context_setup_req);
if (RC.nrrrc && RC.nrrrc[instance]->node_type == ngran_gNB_DU)
itti_send_msg_to_task(TASK_RRC_GNB, instance, msg_p);
else
// in 4G, race conditon is to fix
DU_send_UE_CONTEXT_SETUP_RESPONSE(instance, f1ap_ue_context_setup_req);
return 0;
}
......
......@@ -159,7 +159,11 @@ boolean_t cu_f1u_data_req(
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, NULL, NULL);
// weird rb id management in 4G, not fully understand (looks bad design)
// overcomplex: if i understand, on the interface DRB start at 4 because there can be SRB 0..3
// but it would be much simpler to use absolute numbering
// instead of this "srb flag" associated to these +/-4
int ret=pdcp_data_ind(ctxt_pP,srb_flagP, false, rb_id-4, sdu_buffer_size, memblock, NULL, NULL);
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 */
......@@ -221,7 +225,7 @@ rlc_op_status_t cu_send_to_du(const protocol_ctxt_t *const ctxt,
req->length = size;
req->offset = GTPU_HEADER_OVERHEAD_MAX;
req->rnti = ctxt->rnti;
req->rab_id = rb_id;
req->rab_id = rb_id+4;
LOG_D(PDCP, "%s() (drb %ld) sending message to gtp size %d\n",
__func__, rb_id, size);
extern instance_t CUuniqInstance;
......
......@@ -1054,5 +1054,12 @@ void du_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
confirm_t confirmP,
sdu_size_t sdu_sizeP,
mem_block_t *sdu_pP){
rlc_data_req (ctxt_pP,
srb_flagP,
MBMS_flagP,
rb_idP,
muiP,
confirmP,
sdu_sizeP,
sdu_pP, NULL, NULL);
}
......@@ -171,7 +171,7 @@ static void gtpv1uSend(instance_t instance, gtpv1u_enb_tunnel_data_req_t *req, b
map<int, ocp_gtpv1u_bearer_t>::iterator ptr2=ptrRnti->second.bearers.find(rab_id);
if ( ptr2 == ptrRnti->second.bearers.end() ) {
LOG_E(GTPU,"sending a packet to a non existant RNTI:RAB: %x/%x\n", rnti, rab_id);
LOG_E(GTPU,"GTP-U instance: %ld sending a packet to a non existant RNTI:RAB: %x/%x\n", instance, rnti, rab_id);
pthread_mutex_unlock(&globGtp.gtp_lock);
return;
}
......@@ -253,7 +253,7 @@ static void gtpv1uEndTunnel(instance_t instance, gtpv1u_enb_tunnel_data_req_t *r
map<int, ocp_gtpv1u_bearer_t>::iterator ptr2=ptrRnti->second.bearers.find(rab_id);
if ( ptr2 == ptrRnti->second.bearers.end() ) {
LOG_E(GTPU,"sending a packet to a non existant RNTI:RAB: %x/%x\n", rnti, rab_id);
LOG_E(GTPU,"GTP-U instance: %ld sending a packet to a non existant RNTI:RAB: %x/%x\n", instance, rnti, rab_id);
pthread_mutex_unlock(&globGtp.gtp_lock);
return;
}
......
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