[Epic-ID: ODUHIGH-406][Task-ID: ODUHIGH-450] PAGING memory fixes 21/8321/3
authorlal.harshita <Harshita.Lal@radisys.com>
Tue, 17 May 2022 10:30:27 +0000 (16:00 +0530)
committerlal.harshita <Harshita.Lal@radisys.com>
Tue, 17 May 2022 15:09:23 +0000 (20:39 +0530)
Signed-off-by: lal.harshita <Harshita.Lal@radisys.com>
Change-Id: If39cc14cf3d767d58c2bbeaea8283480594f8dc1
Signed-off-by: lal.harshita <Harshita.Lal@radisys.com>
src/5gnrsch/sch_ue_mgr.c
src/du_app/du_cell_mgr.c
src/du_app/du_f1ap_msg_hdl.c
src/du_app/du_ue_mgr.c

index 3595da0..3db4b1c 100644 (file)
@@ -276,6 +276,19 @@ uint8_t fillSchUeCb(Inst inst, SchUeCb *ueCb, SchUeCfg *ueCfg)
 
    if(ueCfg->spCellCfgPres == true)
    {
+      if(ueCfg->spCellCfg.servCellCfg.initDlBwp.pdschCfgPres == true)
+      {
+         if(ueCb->ueCfg.spCellCfgPres && ueCb->ueCfg.spCellCfg.servCellCfg.initDlBwp.pdschCfgPres == true)
+         {
+            for(uint8_t idx = 0; idx < ueCfg->spCellCfg.servCellCfg.initDlBwp.pdschCfg.numTimeDomRsrcAlloc; idx++)
+            {
+               if(ueCb->ueCfg.spCellCfg.servCellCfg.initDlBwp.pdschCfg.timeDomRsrcAllociList[idx].k0 && ueCfg->spCellCfg.servCellCfg.initDlBwp.pdschCfg.timeDomRsrcAllociList[idx].k0)
+               {
+                   SCH_FREE(ueCb->ueCfg.spCellCfg.servCellCfg.initDlBwp.pdschCfg.timeDomRsrcAllociList[idx].k0, sizeof(uint8_t));  
+               }
+            }
+         }
+      }
       memcpy(&ueCb->ueCfg.spCellCfg , &ueCfg->spCellCfg, sizeof(SchSpCellCfg));
 
       covertFreqDomRsrcMapToIAPIFormat(ueCb->ueCfg.spCellCfg.servCellCfg.initDlBwp.pdcchCfg.cRSetToAddModList[0].freqDomainRsrc,\
@@ -1134,6 +1147,7 @@ void deleteSchCellCb(SchCellCb *cellCb)
    uint8_t sliceIdx=0, slotIdx=0;
    CmLListCp *list=NULL;
    CmLList *node=NULL, *next=NULL;
+   SchPageInfo *tempNode = NULLP;
 
    if(cellCb->schDlSlotInfo)
    {
@@ -1179,6 +1193,24 @@ void deleteSchCellCb(SchCellCb *cellCb)
       }
       SCH_FREE(cellCb->cellCfg.plmnInfoList.snssai, cellCb->cellCfg.plmnInfoList.numSliceSupport*sizeof(Snssai*));
    }
+   
+   for(uint16_t idx =0; idx<MAX_SFN; idx++)
+   {
+      list = &cellCb->pageCb.pageIndInfoRecord[idx];
+      node = list->first;
+      while(node)
+      {
+         next = node->next;
+         if(node->node)
+         {
+            tempNode = (SchPageInfo*)(node->node);
+            SCH_FREE(tempNode->pagePdu, tempNode->msgLen);
+            SCH_FREE(node->node,  sizeof(SchPageInfo));
+         }
+         deleteNodeFromLList(list, node);
+         node = next;
+      }
+   }
 
    /* Remove all UE from ueToBeScheduled list and deallocate */
    node = cellCb->ueToBeScheduled.first;
index 926dc7c..4762d65 100644 (file)
@@ -228,6 +228,7 @@ uint8_t checkPagingRecord(DuCellCb *cellCb)
    }while(pagInfo != NULLP);
    
    cmHashListDelete(&(cellCb->pagingInfoMap), (PTR)pagInfoLLFromPF);
+   DU_FREE(pagInfoLLFromPF, sizeof(DuPagInfoList));
    return ROK;
 }
 
@@ -390,8 +391,9 @@ uint8_t duHandleCellUpInd(Pst *pst, OduCellId *cellId)
 uint8_t DuProcMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *deleteRsp)
 {
    uint8_t ret = ROK;
-   uint16_t cellIdx=0;
-   
+   uint16_t cellIdx=0, pfIdx=0;
+   DuPagInfoList *pagInfoLLFromPF=NULLP;
+
    if(deleteRsp)
    {
       if(deleteRsp->result == SUCCESSFUL_RSP)
@@ -400,6 +402,16 @@ uint8_t DuProcMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *deleteRsp)
          DU_LOG("\nINFO   -->  DU APP : MAC CELL Delete Response : SUCCESS [CELL IDX : %d]", deleteRsp->cellId);
          if(duCb.actvCellLst[cellIdx] && (duCb.actvCellLst[cellIdx]->cellId == deleteRsp->cellId))
          {
+            for(pfIdx =0; pfIdx < MAX_SFN; pfIdx++)
+            {
+               pagInfoLLFromPF = findPagingInfoFromMap(pfIdx, &(duCb.actvCellLst[cellIdx]->pagingInfoMap));
+               if(pagInfoLLFromPF)
+               {   
+                  cmHashListDelete(&(duCb.actvCellLst[cellIdx]->pagingInfoMap), (PTR)pagInfoLLFromPF);
+                  DU_FREE(pagInfoLLFromPF, sizeof(DuPagInfoList));
+               }
+            }
+
             memset(duCb.actvCellLst[cellIdx], 0, sizeof(DuCellCb));
             gCellStatus = CELL_DOWN;
 
@@ -563,7 +575,7 @@ void freePcchPdu(PCCH_Message_t *pcchMsg)
          {
             if(pagingMsg->pagingRecordList)
             {
-               if(pagingMsg->pagingRecordList->list.array == NULLP)
+               if(pagingMsg->pagingRecordList->list.array != NULLP)
                {
                   for(recordIdx = 0; recordIdx <  pagingMsg->pagingRecordList->list.count; recordIdx++)
                   {
index dfcbb47..2bdb40a 100644 (file)
@@ -15429,7 +15429,7 @@ uint8_t BuildAndSendUeContextModRsp(DuUeCb *ueCb)
       break;
    }
    FreeUeContextModResp(f1apMsg);
-return ret;
+   return ret;
 }
 /*******************************************************************
  *
index b2c4344..842e6a0 100644 (file)
@@ -2465,13 +2465,12 @@ uint8_t DuProcMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp)
          {
             DU_LOG("\nINFO   -->  DU APP : MAC UE Create Response : SUCCESS [DU UE F1AP ID : %d]", cfgRsp->ueId);
 
-            if(duCb.actvCellLst[cellIdx] && 
-                  (duCb.actvCellLst[cellIdx]->ueCb[cfgRsp->ueId -1].gnbDuUeF1apId == cfgRsp->ueId))
+            if(duCb.actvCellLst[cellIdx] && (duCb.actvCellLst[cellIdx]->ueCb[cfgRsp->ueId -1].gnbDuUeF1apId == cfgRsp->ueId))
             {
                duCb.actvCellLst[cellIdx]->ueCb[cfgRsp->ueId -1].macUeCfg.macUeCfgState = UE_CREATE_COMPLETE;
 
-               if((duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[cfgRsp->ueId -1].ueState == UE_HANDIN_IN_PROGRESS) && 
-                     (duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[cfgRsp->ueId -1].macUeCfg.macUeCfgState == UE_CREATE_COMPLETE) &&
+              if((duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[cfgRsp->ueId -1].ueState == UE_HANDIN_IN_PROGRESS) && 
+                    (duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[cfgRsp->ueId -1].macUeCfg.macUeCfgState == UE_CREATE_COMPLETE) &&
                      (duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[cfgRsp->ueId -1].rlcUeCfg.rlcUeCfgState == UE_CREATE_COMPLETE))
                {
                   if((ret = duUpdateDuUeCbCfg(cfgRsp->ueId, cfgRsp->cellId)) == ROK)