<JIRA ID: ODUHIGH-396 : scaling of DRBs to MAX> 42/7442/6
authorbarveankit <anbarve@radisys.com>
Thu, 23 Dec 2021 15:18:36 +0000 (20:48 +0530)
committerbarveankit <anbarve@radisys.com>
Fri, 24 Dec 2021 08:22:54 +0000 (13:52 +0530)
Change-Id: I58133c2fa8ab2d90cc15f36232a5b56698d2ca93
Signed-off-by: barveankit <anbarve@radisys.com>
13 files changed:
src/cm/ckw.h
src/codec_utils/common/odu_common_codec.h
src/cu_stub/cu_f1ap_msg_hdl.c
src/cu_stub/cu_f1ap_msg_hdl.h
src/cu_stub/cu_stub.h
src/du_app/du_cell_mgr.c
src/du_app/du_cfg.c
src/du_app/du_cfg.h
src/du_app/du_f1ap_msg_hdl.c
src/du_app/du_mgr.h
src/du_app/du_msg_hdl.c
src/du_app/du_ue_mgr.c
src/phy_stub/phy_stub_thread_hdl.c

index 2073ee0..52854d3 100755 (executable)
@@ -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
index c670f09..6edd2c2 100644 (file)
@@ -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
 
index 4cfdd5a..2174601 100644 (file)
@@ -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;
index 62b771f..a2bb39c 100644 (file)
 #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
index baff2d6..2bfaabf 100644 (file)
@@ -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)                             \
index cb7439d..b81ddca 100644 (file)
@@ -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))
index f5ee3b3..3ddf900 100644 (file)
@@ -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 )
index 10644e0..80cd078 100644 (file)
 
 /*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
index 37a0aef..7e4d52b 100644 (file)
@@ -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");
index 4fd1f7d..95d3226 100644 (file)
@@ -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;
index c70b409..4161082 100644 (file)
@@ -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;
          }
       }
index f796cb9..aae4869 100644 (file)
@@ -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)
             {
index 752c2f1..b26e504 100644 (file)
@@ -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<MAX_NUM_UE; ueIdx++)
+               for(drbIdx = 0; drbIdx < NUM_DRB_TO_PUMP_DATA; drbIdx++) //Number of DRB times the loop will run
                {
                   DU_LOG("\nDEBUG  --> PHY STUB: Sending UL User Data[DrbId:%d] for UEId %d\n",drbIdx,ueIdx);
                   l1SendUlUserData(drbIdx,ueIdx);