From b6b9cd39450a3cbf7ec962f2d8c65540af28eb29 Mon Sep 17 00:00:00 2001 From: barveankit Date: Thu, 23 Dec 2021 20:48:36 +0530 Subject: [PATCH] Change-Id: I58133c2fa8ab2d90cc15f36232a5b56698d2ca93 Signed-off-by: barveankit --- src/cm/ckw.h | 2 +- src/codec_utils/common/odu_common_codec.h | 3 +- src/cu_stub/cu_f1ap_msg_hdl.c | 62 ++++++++++++------------------- src/cu_stub/cu_f1ap_msg_hdl.h | 9 ++++- src/cu_stub/cu_stub.h | 2 +- src/du_app/du_cell_mgr.c | 31 ++++++++++++++-- src/du_app/du_cfg.c | 5 ++- src/du_app/du_cfg.h | 3 +- src/du_app/du_f1ap_msg_hdl.c | 7 ++-- src/du_app/du_mgr.h | 5 ++- src/du_app/du_msg_hdl.c | 13 ++++--- src/du_app/du_ue_mgr.c | 36 +++++++++--------- src/phy_stub/phy_stub_thread_hdl.c | 4 +- 13 files changed, 100 insertions(+), 82 deletions(-) diff --git a/src/cm/ckw.h b/src/cm/ckw.h index 2073ee084..52854d346 100755 --- a/src/cm/ckw.h +++ b/src/cm/ckw.h @@ -44,7 +44,7 @@ extern "C" { /* CKW Interface defines */ /* TODO: To verify if CKW_MAX_ENT_CFG represents LC or LCGs */ -#define CKW_MAX_ENT_CFG 11 /*!< Maximum number of entities to configure */ +#define CKW_MAX_ENT_CFG 32 /*!< Maximum number of entities to configure */ /* ckw_h_001.main_3 added support for L2 Measurement */ #ifdef LTE_L2_MEAS #define CKW_MAX_QCI 10 diff --git a/src/codec_utils/common/odu_common_codec.h b/src/codec_utils/common/odu_common_codec.h index c670f0963..6edd2c28d 100644 --- a/src/codec_utils/common/odu_common_codec.h +++ b/src/codec_utils/common/odu_common_codec.h @@ -19,7 +19,8 @@ #ifndef __ODU_COMMON_CODEC_H__ #define __ODU_COMMON_CODEC_H__ -#define ENC_BUF_MAX_LEN 400 +/*Buffer length which is used for allocation of encoded F1AP messages at CU*/ +#define ENC_BUF_MAX_LEN 2000 #define ENCODE_FAIL -1 #define TEID_BIT_SIZE 24 diff --git a/src/cu_stub/cu_f1ap_msg_hdl.c b/src/cu_stub/cu_f1ap_msg_hdl.c index 4cfdd5a6d..2174601c9 100644 --- a/src/cu_stub/cu_f1ap_msg_hdl.c +++ b/src/cu_stub/cu_f1ap_msg_hdl.c @@ -7357,7 +7357,7 @@ uint8_t deleteEgtpTunnel(uint8_t *buf) * RFAILED - failure * * ****************************************************************/ -uint8_t BuildUlTnlInfoforSetupMod(uint8_t ueId, ULUPTNLInformation_ToBeSetup_List_t *ulInfo, uint8_t actionType) +uint8_t BuildUlTnlInfoforSetupMod(uint8_t ueId, uint8_t drbId, ULUPTNLInformation_ToBeSetup_List_t *ulInfo, uint8_t actionType) { uint8_t arrIdx; uint8_t ulCnt; @@ -7438,22 +7438,10 @@ uint8_t BuildUlTnlInfoforSetupMod(uint8_t ueId, ULUPTNLInformation_ToBeSetup_Lis { /*TODO: DRB context to be stored in CU STUB so that tunnel Id can be easily * fetched based on the Drb Id */ - if(ueId == 1) - { - /* Tunnel Id for DRB 2 of UE 1 is 2. Hence passing the same TeId */ - ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel->gTP_TEID.buf[3] = 2; - } - else if(ueId == 2) - { - /* Tunnel Id for DRB 2 of UE 2 is 5. Hence passing the same TeId */ - ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel->gTP_TEID.buf[3] = 5; - } - else if(ueId == 3) - { - /* Tunnel Id for DRB 2 of UE 3 is 8. Hence passing the same TeId */ - ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel->gTP_TEID.buf[3] = 8; - } + /*For For UE Id=1, DRB=2 is modified. For UE Id = 2, DRB=5 is modified and so on.*/ + ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel->gTP_TEID.buf[3]=\ + (MAX_NUM_DRB_ADDED_PER_UE *(ueId - 1)) + drbId; } else { @@ -7569,7 +7557,7 @@ uint8_t FillDrbItemToSetupMod(uint8_t ueId, uint8_t arrIdx, DRBs_ToBeSetupMod_It uint8_t ret = ROK; /*Drb Id */ - drbItem->dRBID = arrIdx + DRB3; + drbItem->dRBID = arrIdx + DRB_ID_TO_ADD_MOD; /*qoSInformation*/ drbItem->qoSInformation.present = QoSInformation_PR_choice_extension; @@ -7643,7 +7631,7 @@ uint8_t FillDrbItemToSetupMod(uint8_t ueId, uint8_t arrIdx, DRBs_ToBeSetupMod_It } /*ULUPTNLInformation To Be Setup List*/ - ret = BuildUlTnlInfoforSetupMod(ueId, &drbItem->uLUPTNLInformation_ToBeSetup_List, \ + ret = BuildUlTnlInfoforSetupMod(ueId, drbItem->dRBID, &drbItem->uLUPTNLInformation_ToBeSetup_List, \ ProtocolIE_ID_id_DRBs_ToBeSetupMod_Item); if(ret != ROK) { @@ -7765,15 +7753,14 @@ uint8_t BuildDrbToBeSetupList(uint8_t ueId, DRBs_ToBeSetupMod_List_t *drbSet) if(drbSet->list.array[arrIdx] == NULLP) { DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDrbToBeSetupList for array idx [%d]", arrIdx); - return RFAILED; + return RFAILED; } - } - arrIdx = 0; - ret = FillDrbItemList(ueId, arrIdx, (DRBs_ToBeSetupMod_ItemIEs_t *)drbSet->list.array[arrIdx]); - if(ret != ROK) - { - DU_LOG("\nERROR --> F1AP : FillDrbItemList failed"); + ret = FillDrbItemList(ueId, arrIdx, (DRBs_ToBeSetupMod_ItemIEs_t *)drbSet->list.array[arrIdx]); + if(ret != ROK) + { + DU_LOG("\nERROR --> F1AP : FillDrbItemList failed"); + } } return ret; @@ -7796,12 +7783,12 @@ uint8_t BuildDrbToBeSetupList(uint8_t ueId, DRBs_ToBeSetupMod_List_t *drbSet) * * ****************************************************************/ -uint8_t FillDrbToBeModItem(uint8_t ueId, DRBs_ToBeModified_Item_t *drbItem) +uint8_t FillDrbToBeModItem(uint8_t ueId, uint8_t arrIdx, DRBs_ToBeModified_Item_t *drbItem) { uint8_t ret = ROK; /*Drb Id */ - drbItem->dRBID = DRB2; + drbItem->dRBID = DRB2 + arrIdx; /*qoSInformation*/ drbItem->qoSInformation = NULLP; @@ -7880,7 +7867,7 @@ uint8_t FillDrbToBeModItem(uint8_t ueId, DRBs_ToBeModified_Item_t *drbItem) }/* End of QoS */ /*ULUPTNLInformation To Be Setup List*/ - ret = BuildUlTnlInfoforSetupMod(ueId, &drbItem->uLUPTNLInformation_ToBeSetup_List,\ + ret = BuildUlTnlInfoforSetupMod(ueId, drbItem->dRBID, &drbItem->uLUPTNLInformation_ToBeSetup_List,\ ProtocolIE_ID_id_DRBs_ToBeModified_Item); if(ret != ROK) { @@ -7907,12 +7894,12 @@ uint8_t FillDrbToBeModItem(uint8_t ueId, DRBs_ToBeModified_Item_t *drbItem) * * ****************************************************************/ -uint8_t FillDrbToBeModItemList(uint8_t ueId, struct DRBs_ToBeModified_ItemIEs *drbItemIe) +uint8_t FillDrbToBeModItemList(uint8_t ueId, uint8_t arrIdx, struct DRBs_ToBeModified_ItemIEs *drbItemIe) { drbItemIe->id = ProtocolIE_ID_id_DRBs_ToBeModified_Item; drbItemIe->criticality = Criticality_reject; drbItemIe->value.present = DRBs_ToBeModified_ItemIEs__value_PR_DRBs_ToBeModified_Item; - if(FillDrbToBeModItem(ueId, &(drbItemIe->value.choice.DRBs_ToBeModified_Item)) != ROK) + if(FillDrbToBeModItem(ueId, arrIdx, &(drbItemIe->value.choice.DRBs_ToBeModified_Item)) != ROK) { DU_LOG("\nERROR --> F1AP : FillDrbToBeModItem failed"); return RFAILED; @@ -7944,7 +7931,7 @@ uint8_t BuildDrbToBeModifiedList(uint8_t ueId, DRBs_ToBeModified_List_t *drbSet) uint8_t arrIdx =0; uint8_t drbCnt =0; - drbCnt = 1; + drbCnt = MAX_DRB_MODIFIED_UE_MOD_REQ; drbSet->list.count = drbCnt; drbSet->list.size = drbCnt * sizeof(DRBs_ToBeModified_ItemIEs_t *); CU_ALLOC(drbSet->list.array, drbSet->list.size); @@ -7959,15 +7946,14 @@ uint8_t BuildDrbToBeModifiedList(uint8_t ueId, DRBs_ToBeModified_List_t *drbSet) if(drbSet->list.array[arrIdx] == NULLP) { DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDrbToBeSetupList"); - return RFAILED; + return RFAILED; } - } - arrIdx=0; - ret = FillDrbToBeModItemList(ueId, (DRBs_ToBeModified_ItemIEs_t *)drbSet->list.array[arrIdx]); - if(ret != ROK) - { - DU_LOG("\nERROR --> F1AP : FillDrbToBeModItemList failed"); + ret = FillDrbToBeModItemList(ueId, arrIdx, (DRBs_ToBeModified_ItemIEs_t *)drbSet->list.array[arrIdx]); + if(ret != ROK) + { + DU_LOG("\nERROR --> F1AP : FillDrbToBeModItemList failed"); + } } return ret; diff --git a/src/cu_stub/cu_f1ap_msg_hdl.h b/src/cu_stub/cu_f1ap_msg_hdl.h index 62b771ff3..a2bb39c79 100644 --- a/src/cu_stub/cu_f1ap_msg_hdl.h +++ b/src/cu_stub/cu_f1ap_msg_hdl.h @@ -54,8 +54,13 @@ #define DRB2 2 #define DRB3 3 #define QCI 9 -#define MAX_DRB_SET_UE_CONTEXT_SETUP_REQ 2 -#define MAX_DRB_SET_UE_CONTEXT_MOD_REQ 1 +#define MAX_DRB_SET_UE_CONTEXT_SETUP_REQ 2 /*Number of DRBs to be added using UE CONTEXT SETUP procedure*/ +#define MAX_DRB_SET_UE_CONTEXT_MOD_REQ 1 /*Number of DRBs to be added/setup via UE CONTEXT MODIFICATION procedure*/ +#define MAX_DRB_MODIFIED_UE_MOD_REQ 1 /*Currently CU trigger Modification of 2DRBs*/ +#define DRB_ID_TO_ADD_MOD MAX_DRB_SET_UE_CONTEXT_SETUP_REQ+1 /*The DRB ID: which will be added using Modification Procedure*/ + +/*Total num of DRBs added using UE COntext Setup and Modification procedures*/ +#define MAX_NUM_DRB_ADDED_PER_UE MAX_DRB_SET_UE_CONTEXT_SETUP_REQ + MAX_DRB_SET_UE_CONTEXT_MOD_REQ #define CU_UE_F1AP_ID 0 #define DU_UE_F1AP_ID 1 diff --git a/src/cu_stub/cu_stub.h b/src/cu_stub/cu_stub.h index baff2d675..2bfaabfce 100644 --- a/src/cu_stub/cu_stub.h +++ b/src/cu_stub/cu_stub.h @@ -30,7 +30,7 @@ /*VALID Tunnel ID*/ #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 10 /*[Spec 29.281]: Max limit is not mentioned but as per GTP-U Header Format, TEID occupies 4 octets */ +#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 */ /* allocate and zero out a static buffer */ #define CU_ALLOC(_datPtr, _size) \ diff --git a/src/du_app/du_cell_mgr.c b/src/du_app/du_cell_mgr.c index cb7439d06..b81ddca81 100644 --- a/src/du_app/du_cell_mgr.c +++ b/src/du_app/du_cell_mgr.c @@ -174,7 +174,27 @@ uint8_t duGetCellCb(uint16_t cellId, DuCellCb **cellCb) uint8_t duHandleCellUpInd(Pst *pst, OduCellId *cellId) { DuCellCb *cellCb = NULLP; - + +#ifndef O1_ENABLE + + /*Note: Static Configuration, when O1 is not configuring the RRM policy*/ + RrmPolicy *rrmPolicy; + DU_ALLOC(rrmPolicy, sizeof(RrmPolicy)); + rrmPolicy->rsrcType = RSRC_PRB; + rrmPolicy->numMemberList = 1; + DU_ALLOC(rrmPolicy->memberList, sizeof(PolicyMemberList *)); + DU_ALLOC(rrmPolicy->memberList[0], sizeof(PolicyMemberList)); + + memset(&rrmPolicy->memberList[0]->plmn, 0, sizeof(Plmn)); + rrmPolicy->memberList[0]->snssai.sst = 1; + rrmPolicy->memberList[0]->snssai.sd[0] = 2; + rrmPolicy->memberList[0]->snssai.sd[1] = 3; + rrmPolicy->memberList[0]->snssai.sd[2] = 4; + rrmPolicy->policyMinRatio = 30; + rrmPolicy->policyMaxRatio = 90; + rrmPolicy->policyDedicatedRatio = 10; +#endif + if(cellId->cellId <=0 || cellId->cellId > MAX_NUM_CELL) { DU_LOG("\nERROR --> DU APP : Invalid Cell Id %d in duHandleCellUpInd()", cellId->cellId); @@ -189,14 +209,17 @@ uint8_t duHandleCellUpInd(Pst *pst, OduCellId *cellId) DU_LOG("\nINFO --> DU APP : 5G-NR Cell %d is UP", cellId->cellId); cellCb->cellStatus = ACTIVATED; gCellStatus = CELL_UP; - - if(duCfgParam.tempSliceCfg.rrmPolicy) - BuildAndSendSliceConfigReq(duCfgParam.tempSliceCfg.rrmPolicy, duCfgParam.tempSliceCfg.totalRrmPolicy, duCfgParam.tempSliceCfg.totalSliceCount); + #ifdef O1_ENABLE + if(duCfgParam.tempSliceCfg.rrmPolicy) + BuildAndSendSliceConfigReq(duCfgParam.tempSliceCfg.rrmPolicy, duCfgParam.tempSliceCfg.totalRrmPolicy, duCfgParam.tempSliceCfg.totalSliceCount); DU_LOG("\nINFO --> DU APP : Raise cell UP alarm for cell id=%d", cellId->cellId); raiseCellAlrm(CELL_UP_ALARM_ID, cellId->cellId); setCellOpState(cellId->cellId, ENABLED, ACTIVE); +#else + BuildAndSendSliceConfigReq(&rrmPolicy,1, rrmPolicy->numMemberList); #endif + } if((pst->selector == ODU_SELECTOR_LWLC) || (pst->selector == ODU_SELECTOR_TC)) diff --git a/src/du_app/du_cfg.c b/src/du_app/du_cfg.c index f5ee3b343..3ddf9004d 100644 --- a/src/du_app/du_cfg.c +++ b/src/du_app/du_cfg.c @@ -635,9 +635,10 @@ uint8_t readCfg() Sib1Params sib1; F1TaiSliceSuppLst *taiSliceSuppLst; - /* TODO Added these below variable for local testing, once we will receive the - * configuration from O1 we can remove these variable */ +#ifndef O1_ENABLE + /* Note: Added these below variable for local testing*/ Snssai snssai[NUM_OF_SUPPORTED_SLICE] = {{1,{2,3,4}},{5,{6,7,8}}}; +#endif #ifdef O1_ENABLE if( getStartupConfig(&g_cfg) != ROK ) diff --git a/src/du_app/du_cfg.h b/src/du_app/du_cfg.h index 10644e0d4..80cd078b8 100644 --- a/src/du_app/du_cfg.h +++ b/src/du_app/du_cfg.h @@ -291,13 +291,12 @@ /*VALID Tunnel ID*/ #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 10 /*[Spec 29.281]: Max limit is not mentioned but as per GTP-U Header Format, TEID occupies 4 octets */ +#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 */ /* Slice Ratio */ #define MAX_RATIO 30 #define MIN_RATIO 20 #define DEDICATED_RATIO 10 -#define DEDICATED_SLICE_INDEX 1 #define NUM_OF_SUPPORTED_SLICE 2 typedef enum diff --git a/src/du_app/du_f1ap_msg_hdl.c b/src/du_app/du_f1ap_msg_hdl.c index 37a0aef4f..7e4d52bd6 100644 --- a/src/du_app/du_f1ap_msg_hdl.c +++ b/src/du_app/du_f1ap_msg_hdl.c @@ -10465,7 +10465,7 @@ DRBs_ToBeSetupMod_Item_t *drbSetupModItem, DRBs_ToBeModified_Item_t *drbModItem, uint8_t extractDrbListToSetupMod(DRBs_ToBeSetup_List_t *drbCfg, DRBs_ToBeSetupMod_List_t *drbSetupModCfg,\ DRBs_ToBeModified_List_t *drbModCfg, uint8_t drbCount, DuUeCfg *ueCfgDb, uint32_t *drbBitMap, RlcUeCfg *rlcUeCfg) { - uint8_t ret, drbIdx, lcId = 0; + uint8_t ret, drbIdx = 0, lcId = 0; DRBs_ToBeSetup_Item_t *drbItem = NULLP; DRBs_ToBeSetupMod_ItemIEs_t *drbSetupModItem = NULLP; DRBs_ToBeModified_ItemIEs_t *drbModItem = NULLP; @@ -10540,6 +10540,7 @@ uint8_t extractDrbListToSetupMod(DRBs_ToBeSetup_List_t *drbCfg, DRBs_ToBeSetupMo DU_LOG("\nERROR --> F1AP : Failed at extractDrbListToSetupMod() for DrbSetupMod List"); break; } + ueCfgDb->numDrbSetupMod++; } } ueCfgDb->numRlcLcs++; @@ -12723,7 +12724,7 @@ uint8_t BuildDrbSetupModList(DRBs_SetupMod_List_t *drbSet , DuUeCfg *ueCfg) uint8_t drbCnt =0; struct DRBs_SetupMod_ItemIEs *drbItemIe; - drbCnt = 1; + drbCnt = ueCfg->numDrbSetupMod; drbSet->list.count = drbCnt; drbSet->list.size = drbCnt * sizeof(DRBs_SetupMod_ItemIEs_t *); DU_ALLOC(drbSet->list.array, drbSet->list.size); @@ -13314,7 +13315,7 @@ uint8_t procF1UeContextModificationReq(F1AP_PDU_t *f1apMsg) { drbModifiedCfg = &ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.\ choice.DRBs_ToBeModified_List; - if(extractDrbListToSetupMod(NULL, NULL, drbModifiedCfg, drbSetupModCfg->list.count,\ + if(extractDrbListToSetupMod(NULL, NULL, drbModifiedCfg, drbModifiedCfg->list.count,\ &duUeCb->f1UeDb->duUeCfg, &duUeCb->drbBitMap, &duUeCb->rlcUeCfg)) { DU_LOG("\nERROR --> DU APP : Failed at extractDrbListToSetupMod() for DrbModifiedList"); diff --git a/src/du_app/du_mgr.h b/src/du_app/du_mgr.h index 4fd1f7d53..95d322635 100644 --- a/src/du_app/du_mgr.h +++ b/src/du_app/du_mgr.h @@ -134,6 +134,7 @@ typedef struct duUeCfg AmbrCfg *ambrCfg; uint8_t numDrb; UpTnlCfg upTnlInfo[MAX_NUM_DRB]; /* User plane TNL Info*/ + uint8_t numDrbSetupMod; /*No. of DRB Added during Modification*/ MacUeCfg copyOfmacUeCfg; }DuUeCfg; @@ -220,8 +221,8 @@ typedef struct duCb DuCellCb* actvCellLst[MAX_NUM_CELL]; /* List of cells activated/to be activated of type DuCellCb */ uint32_t numUe; /* current number of UEs */ UeCcchCtxt ueCcchCtxt[MAX_NUM_UE]; /* mapping of gnbDuUeF1apId to CRNTI required for CCCH processing*/ - uint8_t numDrb; /* current number of DRbs*/ - UpTnlCfg* upTnlCfg[MAX_NUM_DRB]; /* tunnel info for every Drb */ + uint8_t numTeId; /* current number of TEIDs configured in the system*/ + UpTnlCfg* upTnlCfg[MAX_TEID]; /* tunnel info for every Drb */ CmLListCp reservedF1apPduList; /*storing F1AP pdu infomation and transId */ SliceCfgState sliceState; }DuCb; diff --git a/src/du_app/du_msg_hdl.c b/src/du_app/du_msg_hdl.c index c70b409fd..4161082c5 100644 --- a/src/du_app/du_msg_hdl.c +++ b/src/du_app/du_msg_hdl.c @@ -1776,7 +1776,7 @@ uint8_t DuProcRlcRrcDeliveryReport(Pst *pst, RrcDeliveryReport *rrcDeliveryRepor * ****************************************************************/ uint8_t DuProcRlcUlUserDataTrans(Pst *pst, RlcUlUserDatInfo *ulUserData) { - uint8_t rbIdx; + uint8_t teIdx = 0; EgtpMsg egtpMsg; Buffer *mBuf; @@ -1790,14 +1790,15 @@ uint8_t DuProcRlcUlUserDataTrans(Pst *pst, RlcUlUserDatInfo *ulUserData) egtpMsg.msgHdr.extHdr.pdcpNmb.pres = FALSE; /* Fetch EGTP tunnel info */ - for(rbIdx = 0; rbIdx < duCb.numDrb; rbIdx++) + for(teIdx = 0; teIdx < duCb.numTeId; teIdx++) { - if((duCb.upTnlCfg[rbIdx] != NULLP) && (duCb.upTnlCfg[rbIdx]->ueIdx == ulUserData->ueIdx) && \ - (duCb.upTnlCfg[rbIdx]->drbId == ulUserData->rbId)) + /*TODO: If multiple Cell Support is enables then CellId also needs to be validated alongwith ueId and DrbId*/ + if((duCb.upTnlCfg[teIdx] != NULLP) && (duCb.upTnlCfg[teIdx]->ueIdx == ulUserData->ueIdx) && \ + (duCb.upTnlCfg[teIdx]->drbId == ulUserData->rbId)) { - if(duCb.upTnlCfg[rbIdx]->tnlCfg1) + if(duCb.upTnlCfg[teIdx]->tnlCfg1) { - egtpMsg.msgHdr.teId = duCb.upTnlCfg[rbIdx]->tnlCfg1->teId; /*As we are supporting only 1 tunnel per DRB*/ + egtpMsg.msgHdr.teId = duCb.upTnlCfg[teIdx]->tnlCfg1->teId; /*As we are supporting only 1 tunnel per DRB*/ break; } } diff --git a/src/du_app/du_ue_mgr.c b/src/du_app/du_ue_mgr.c index f796cb905..aae4869d1 100644 --- a/src/du_app/du_ue_mgr.c +++ b/src/du_app/du_ue_mgr.c @@ -160,17 +160,18 @@ uint8_t getDrbLcId(uint32_t *drbBitMap) uint8_t fillDlUserDataInfo(uint32_t teId, RlcDlUserDataInfo *dlDataMsgInfo) { - uint8_t drbIdx; + uint8_t teIdx = 0; - for(drbIdx = 0; drbIdx < duCb.numDrb; drbIdx++) + /*Traversing the duCb to find the CellId, UeId, LCID corresponding to TEID*/ + for(teIdx = 0; teIdx < duCb.numTeId; teIdx++) { - if(duCb.upTnlCfg[drbIdx] && (duCb.upTnlCfg[drbIdx]->tnlCfg1 != NULLP)) + if(duCb.upTnlCfg[teIdx] && (duCb.upTnlCfg[teIdx]->tnlCfg1 != NULLP)) { - if(duCb.upTnlCfg[drbIdx]->tnlCfg1->teId == teId) + if(duCb.upTnlCfg[teIdx]->tnlCfg1->teId == teId) { - dlDataMsgInfo->cellId = duCb.upTnlCfg[drbIdx]->cellId; - dlDataMsgInfo->ueIdx = duCb.upTnlCfg[drbIdx]->ueIdx; - dlDataMsgInfo->rbId = duCb.upTnlCfg[drbIdx]->drbId; + dlDataMsgInfo->cellId = duCb.upTnlCfg[teIdx]->cellId; + dlDataMsgInfo->ueIdx = duCb.upTnlCfg[teIdx]->ueIdx; + dlDataMsgInfo->rbId = duCb.upTnlCfg[teIdx]->drbId; return ROK; } } @@ -268,7 +269,6 @@ uint8_t duHdlEgtpDlData(EgtpMsg *egtpMsg) if(duBuildAndSendDlUserDataToRlc(msgLen, egtpMsg) != ROK) { DU_LOG("\nERROR --> DU_APP : Failed to build DL USer Data in duHdlEgtpDlData()"); - DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, egtpMsg->msg, msgLen); return RFAILED; } return ROK; @@ -2114,9 +2114,9 @@ uint8_t duProcEgtpTunnelCfg(uint8_t ueCbIdx, UpTnlCfg *duTnlCfg, UpTnlCfg *f1Tnl { if(duSendEgtpTnlMgmtReq(EGTP_TNL_MGMT_ADD, NULLP, f1TnlCfg->tnlCfg1) == ROK) { - if(fillTnlCfgToAddMod(&duCb.upTnlCfg[duCb.numDrb], f1TnlCfg) == ROK) + if(fillTnlCfgToAddMod(&duCb.upTnlCfg[duCb.numTeId], f1TnlCfg) == ROK) { - duCb.numDrb++; + duCb.numTeId++; ret = ROK; } } @@ -2136,8 +2136,8 @@ uint8_t duProcEgtpTunnelCfg(uint8_t ueCbIdx, UpTnlCfg *duTnlCfg, UpTnlCfg *f1Tnl if(duSendEgtpTnlMgmtReq(EGTP_TNL_MGMT_DEL, duTnlCfg->tnlCfg1->teId, f1TnlCfg->tnlCfg1) == ROK) { /* Free memory at drbIdx */ - duCb.numDrb--; - for(delIdx = ueCbIdx; delIdx < duCb.numDrb; delIdx++) + duCb.numTeId--; + for(delIdx = ueCbIdx; delIdx < duCb.numTeId; delIdx++) { /* moving all elements one index ahead */ ret = fillTnlCfgToAddMod(&duCb.upTnlCfg[delIdx], duCb.upTnlCfg[delIdx+1]); @@ -2177,7 +2177,7 @@ uint8_t duProcEgtpTunnelCfg(uint8_t ueCbIdx, UpTnlCfg *duTnlCfg, UpTnlCfg *f1Tnl uint8_t duUpdateTunnelCfgDb(uint8_t ueIdx, uint8_t cellId, DuUeCfg *duUeCfg) { - uint8_t ret = ROK, drbIdx, duCbDrbIdx; + uint8_t ret = ROK, drbIdx, teIdx; bool drbFound = false; /*If Add/Mod tunnels request for that DRB is successful in EGTP */ @@ -2186,13 +2186,13 @@ uint8_t duUpdateTunnelCfgDb(uint8_t ueIdx, uint8_t cellId, DuUeCfg *duUeCfg) { duUeCfg->upTnlInfo[drbIdx].cellId = cellId; duUeCfg->upTnlInfo[drbIdx].ueIdx = ueIdx; - for(duCbDrbIdx = 0; duCbDrbIdx < duCb.numDrb; duCbDrbIdx++) + for(teIdx = 0; teIdx < duCb.numTeId; teIdx++) { - if((duCb.upTnlCfg[duCbDrbIdx]->ueIdx == duUeCfg->upTnlInfo[drbIdx].ueIdx) && \ - (duCb.upTnlCfg[duCbDrbIdx]->drbId == duUeCfg->upTnlInfo[drbIdx].drbId)) + if((duCb.upTnlCfg[teIdx]->ueIdx == duUeCfg->upTnlInfo[drbIdx].ueIdx) && \ + (duCb.upTnlCfg[teIdx]->drbId == duUeCfg->upTnlInfo[drbIdx].drbId)) { drbFound = true; /* existing DRB */ - if(duProcEgtpTunnelCfg(duCbDrbIdx, duCb.upTnlCfg[duCbDrbIdx], &duUeCfg->upTnlInfo[drbIdx]) != ROK) + if(duProcEgtpTunnelCfg(teIdx, duCb.upTnlCfg[teIdx], &duUeCfg->upTnlInfo[drbIdx]) != ROK) { DU_LOG("\nERROR -> DU_APP : duUpdateTunnelCfgDb: Failed to modify tunnel req for Drb id[%d]", duUeCfg->upTnlInfo[drbIdx].drbId); @@ -2889,7 +2889,7 @@ uint8_t deleteUeCfg(uint16_t cellIdx, uint8_t ueIdx) { freeF1UeDb(ueCb->f1UeDb); } - for(tnlIdx = 0; tnlIdx < duCb.numDrb; ) + for(tnlIdx = 0; tnlIdx < duCb.numTeId; ) { if(duCb.upTnlCfg[tnlIdx]->ueIdx == ueIdx) { diff --git a/src/phy_stub/phy_stub_thread_hdl.c b/src/phy_stub/phy_stub_thread_hdl.c index 752c2f112..b26e50454 100644 --- a/src/phy_stub/phy_stub_thread_hdl.c +++ b/src/phy_stub/phy_stub_thread_hdl.c @@ -158,9 +158,9 @@ void *l1ConsoleHandler(void *args) while(counter) { /* Start Pumping data from PHY stub to DU */ - for(drbIdx = 0; drbIdx < NUM_DRB_TO_PUMP_DATA; drbIdx++) //Number of DRB times the loop will run + for(ueIdx=0; ueIdx < MAX_NUM_UE; ueIdx++) { - for(ueIdx=0; ueIdx PHY STUB: Sending UL User Data[DrbId:%d] for UEId %d\n",drbIdx,ueIdx); l1SendUlUserData(drbIdx,ueIdx); -- 2.16.6