From 0e69d52b90c5ba0c7c46830afbadb4615dee8161 Mon Sep 17 00:00:00 2001 From: barveankit Date: Mon, 13 Jun 2022 12:50:05 +0530 Subject: [PATCH] [Issue Id-ODUHIGH-457] Fixes related to slice configuration in Ue Context Setup Signed-off-by: barveankit Change-Id: I717cfda2b815bb1218a081c41abaa594f8a366d6 Signed-off-by: barveankit --- src/cu_stub/cu_f1ap_msg_hdl.c | 6 ++++-- src/cu_stub/cu_stub.c | 38 ++++++++++++++++++++++++-------------- src/cu_stub/cu_stub_egtp.c | 35 ++++++++++++++++------------------- src/cu_stub/cu_stub_egtp.h | 4 ++-- src/phy_stub/phy_stub_msg_hdl.c | 19 ++++++++++++------- 5 files changed, 58 insertions(+), 44 deletions(-) diff --git a/src/cu_stub/cu_f1ap_msg_hdl.c b/src/cu_stub/cu_f1ap_msg_hdl.c index aef220d44..2c7335650 100644 --- a/src/cu_stub/cu_f1ap_msg_hdl.c +++ b/src/cu_stub/cu_f1ap_msg_hdl.c @@ -2660,6 +2660,7 @@ uint8_t BuildULTnlInfo(uint8_t duId, TnlInfo *ulUpTnlInfo, ULUPTNLInformation_To * ****************************************************************/ uint8_t BuildDRBSetup(uint32_t duId, CuUeCb *ueCb, DRBs_ToBeSetup_List_t *drbSet) { + uint16_t snssaiIdx=0; uint8_t idx = 0, extIeIdx = 0; uint8_t elementCnt = 0, drbCnt = 0; uint8_t BuildQOSInforet = 0,BuildSNSSAIret = 0; @@ -2728,12 +2729,13 @@ uint8_t BuildDRBSetup(uint32_t duId, CuUeCb *ueCb, DRBs_ToBeSetup_List_t *drbSet } /*SNSSAI*/ + snssaiIdx = (idx% cuCb.numSnssaiSupported); if(ueCb->state != UE_HANDOVER_IN_PROGRESS) BuildSNSSAIret = BuildSNSSAI(&ueCb->drbList[ueCb->numDrb], &drbSetItem->qoSInformation.choice.\ - choice_extension->value.choice.DRB_Information.sNSSAI, cuCb.snssaiList[0], FALSE); + choice_extension->value.choice.DRB_Information.sNSSAI, cuCb.snssaiList[snssaiIdx], FALSE); else BuildSNSSAIret = BuildSNSSAI(&ueCb->drbList[idx], &drbSetItem->qoSInformation.choice.\ - choice_extension->value.choice.DRB_Information.sNSSAI, cuCb.snssaiList[0], TRUE); + choice_extension->value.choice.DRB_Information.sNSSAI, NULLP, TRUE); if(BuildSNSSAIret != ROK) { DU_LOG("\nERROR --> F1AP : Failed to build SNSSAI Info in BuildDRBSetup"); diff --git a/src/cu_stub/cu_stub.c b/src/cu_stub/cu_stub.c index 422420185..a57bf06cf 100644 --- a/src/cu_stub/cu_stub.c +++ b/src/cu_stub/cu_stub.c @@ -273,9 +273,11 @@ void initiateInterDuHandover(uint32_t sourceDuId, uint32_t targetDuId, uint32_t void *cuConsoleHandler(void *args) { char ch; - uint8_t teId = 0; + uint32_t teId = 0; + uint32_t duId; uint8_t ret = ROK; uint8_t cnt = 0; + EgtpTeIdCb *teidCb = NULLP; /* This variable is taken for sending specific number of downlink data packet. * Presently the code is supporting total 4500 data packets trasfer for 3 UEs only with sleep(1). @@ -283,7 +285,7 @@ void *cuConsoleHandler(void *args) * NUM_TUNNEL_TO_PUMP_DATA = 9, NUM_DL_PACKETS = 1. * totalDataPacket = totalNumOfTestFlow * NUM_TUNNEL_TO_PUMP_DATA * NUM_DL_PACKETS * totalDataPacket = [500*9*1] */ - int32_t totalNumOfTestFlow = 5; + int32_t totalNumOfTestFlow = 2; while(true) { @@ -318,24 +320,32 @@ void *cuConsoleHandler(void *args) cnt++; } #else + while(totalNumOfTestFlow) { - for(teId = 1; teId <= NUM_TUNNEL_TO_PUMP_DATA; teId++) + for(duId = 1; duId<=MAX_DU_SUPPORTED; duId++) { - DU_LOG("\nDEBUG --> EGTP: Sending DL User Data(teId:%d)\n",teId); - cnt =0; - while(cnt < NUM_DL_PACKETS) + for(teId = 1; teId <= NUM_TUNNEL_TO_PUMP_DATA; teId++) { - ret = cuEgtpDatReq(teId); - if(ret != ROK) + DU_LOG("\nDEBUG --> EGTP: Sending DL User Data(duId %d, teId:%d)\n", duId, teId); + cmHashListFind(&(egtpCb.dstCb[duId-1].teIdLst), (uint8_t *)&(teId), sizeof(uint32_t), 0, (PTR *)&teidCb); + if(teidCb) { - DU_LOG("\nERROR --> EGTP: Issue with teid=%d\n",teId); - break; + cnt =0; + while(cnt < NUM_DL_PACKETS) + { + ret = cuEgtpDatReq(duId, teId); + if(ret != ROK) + { + DU_LOG("\nERROR --> EGTP: Issue with teid=%d\n",teId); + break; + } + /* TODO : sleep(1) will be removed later once we will be able to + * support the continuous data pack transfer */ + sleep(1); + cnt++; + } } - /* TODO : sleep(1) will be removed later once we will be able to - * support the continuous data pack transfer */ - sleep(1); - cnt++; } } totalNumOfTestFlow--; diff --git a/src/cu_stub/cu_stub_egtp.c b/src/cu_stub/cu_stub_egtp.c index 0def93c04..c53bc6d92 100644 --- a/src/cu_stub/cu_stub_egtp.c +++ b/src/cu_stub/cu_stub_egtp.c @@ -686,9 +686,9 @@ S16 cuEgtpDecodeHdr(Buffer *mBuf) * RFAILED - failure * * ****************************************************************/ -uint16_t cuEgtpDatReq(uint8_t teId) +uint16_t cuEgtpDatReq(uint32_t duId, uint8_t teId) { - uint8_t ret = ROK, cnt = 0, duId =0; + uint8_t ret = ROK, cnt = 0; EgtpMsg egtpMsg; egtpMsg.msgHdr.teId = teId; @@ -698,26 +698,23 @@ uint16_t cuEgtpDatReq(uint8_t teId) DU_LOG("\nERROR --> EGTP : DRB not created"); return RFAILED ; } - for(duId = 1; duId<=egtpCb.numDu; duId++) + /* Build Application message that is supposed to come from app to egtp */ + ret = BuildAppMsg(duId, &egtpMsg); + if(ret != ROK) { - /* Build Application message that is supposed to come from app to egtp */ - ret = BuildAppMsg(duId, &egtpMsg); - if(ret != ROK) - { - DU_LOG("\nERROR --> EGTP : Failed to build App Msg"); - return RFAILED; - } + DU_LOG("\nERROR --> EGTP : Failed to build App Msg"); + return RFAILED; + } - /* Encode EGTP header to build final EGTP message */ - ret = BuildEgtpMsg(duId, &egtpMsg); - if(ret != ROK) - { - DU_LOG("\nERROR --> EGTP : Failed to build EGTP Msg"); - return RFAILED; - } - cuEgtpSendMsg(duId, egtpMsg.msg); - ODU_PUT_MSG_BUF(egtpMsg.msg); + /* Encode EGTP header to build final EGTP message */ + ret = BuildEgtpMsg(duId, &egtpMsg); + if(ret != ROK) + { + DU_LOG("\nERROR --> EGTP : Failed to build EGTP Msg"); + return RFAILED; } + cuEgtpSendMsg(duId, egtpMsg.msg); + ODU_PUT_MSG_BUF(egtpMsg.msg); return ROK; } diff --git a/src/cu_stub/cu_stub_egtp.h b/src/cu_stub/cu_stub_egtp.h index 044959817..4decfda12 100644 --- a/src/cu_stub/cu_stub_egtp.h +++ b/src/cu_stub/cu_stub_egtp.h @@ -44,7 +44,7 @@ #define MIN_TEID 1 /*[Spec 29.281,Sec 5.1]: All Zero TEIDs are never assigned for setting up GTP-U Tunnel*/ #define MAX_TEID MAX_NUM_DRB * MAX_NUM_UE /*[Spec 29.281]: Max limit is not mentioned but as per GTP-U Header Format, TEID occupies 4 octets */ -#define NUM_TUNNEL_TO_PUMP_DATA 9 +#define NUM_TUNNEL_TO_PUMP_DATA 4 #define NUM_DL_PACKETS 1 uint8_t sockType; @@ -155,7 +155,7 @@ S16 cuEgtpTnlMod(uint32_t duId,EgtpTnlEvt tnlEvt); S16 cuEgtpTnlDel(uint32_t duId,EgtpTnlEvt tnlEvt); S16 cuEgtpEncodeHdr(uint8_t *preEncodedHdr, EgtpMsgHdr *preDefHdr, uint8_t *hdrIdx); S16 cuEgtpHdlRecvMsg(Buffer *mBuf); -uint16_t cuEgtpDatReq(uint8_t teId); +uint16_t cuEgtpDatReq(uint32_t duId, uint8_t teId); S16 BuildAppMsg(uint32_t duId, EgtpMsg *egtpMsg); S16 BuildEgtpMsg(uint32_t duId, EgtpMsg *egtpMsg); S16 cuEgtpSendMsg(uint32_t duId, Buffer *mBuf); diff --git a/src/phy_stub/phy_stub_msg_hdl.c b/src/phy_stub/phy_stub_msg_hdl.c index c3d33ae8a..2c14f2ba8 100644 --- a/src/phy_stub/phy_stub_msg_hdl.c +++ b/src/phy_stub/phy_stub_msg_hdl.c @@ -356,12 +356,17 @@ uint16_t l1BuildAndSendRxDataInd(uint16_t slot, uint16_t sfn, fapi_ul_pusch_pdu_ GET_UE_ID(puschPdu.rnti, ueId); if(phyDb.ueDb.ueCb[ueId-1].isCFRA) { - /* In CF-RA in case of handover, RRC Reconfiguration Complete is sent - * by UE once RAR is received from DU */ - phyDb.ueDb.ueCb[ueId-1].ueId = ueId; - phyDb.ueDb.ueCb[ueId-1].crnti = puschPdu.rnti; - phyDb.ueDb.ueCb[ueId-1].msgRrcReconfigComp = true; - type = MSG_TYPE_RRC_RECONFIG_COMPLETE; + if(!phyDb.ueDb.ueCb[ueId-1].msgRrcReconfigComp) + { + /* In CF-RA in case of handover, RRC Reconfiguration Complete is sent + * by UE once RAR is received from DU */ + phyDb.ueDb.ueCb[ueId-1].ueId = ueId; + phyDb.ueDb.ueCb[ueId-1].crnti = puschPdu.rnti; + phyDb.ueDb.ueCb[ueId-1].msgRrcReconfigComp = true; + type = MSG_TYPE_RRC_RECONFIG_COMPLETE; + } + else + return ROK; } else { @@ -399,7 +404,7 @@ uint16_t l1BuildAndSendRxDataInd(uint16_t slot, uint16_t sfn, fapi_ul_pusch_pdu_ type = MSG_TYPE_RRC_RECONFIG_COMPLETE; } else - return RFAILED; + return ROK; } MAC_ALLOC(rxDataInd, sizeof(fapi_rx_data_indication_t)); -- 2.16.6