From: lal.harshita Date: Thu, 26 Aug 2021 15:39:32 +0000 (+0530) Subject: Fixes for memory optimization [JIRA ID - ODUHIGH-354] X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=0f864d401fa6a384c15b983828afcff96a8b0c8a;p=o-du%2Fl2.git Fixes for memory optimization [JIRA ID - ODUHIGH-354] Change-Id: I5672ee85b085b693938d47240b642404b02093be Signed-off-by: lal.harshita Signed-off-by: barveankit Signed-off-by: lal.harshita --- diff --git a/src/5gnrsch/sch_common.c b/src/5gnrsch/sch_common.c index fea12b3f6..b36d0546f 100644 --- a/src/5gnrsch/sch_common.c +++ b/src/5gnrsch/sch_common.c @@ -863,10 +863,15 @@ uint8_t schDlRsrcAllocDlMsg(DlMsgAlloc *dlMsgAlloc, SchCellCb *cell, uint16_t cr void BuildK0K1TableForFdd(SchCellCb *cell, SchK0K1TimingInfoTbl *k0K1InfoTbl, bool pdschCfgCmnPres,SchPdschCfgCmn pdschCmnCfg,\ SchPdschConfig pdschDedCfg, uint8_t ulAckListCount, uint8_t *UlAckTbl) { - uint8_t k0TmpVal = 0, k1TmpVal =0, cfgIdx=0; + + uint8_t k1TmpVal =0, cfgIdx=0; uint8_t slotIdx=0, k0Index=0, k1Index=0, numK0=0, numK1=0, numTimeDomAlloc=0; - SchPdschCfgCmnTimeDomRsrcAlloc cmnTimeDomRsrcAllocList[MAX_NUM_DL_ALLOC]; - SchPdschTimeDomRsrcAlloc dedTimeDomRsrcAllocList[MAX_NUM_DL_ALLOC]; + + /* TODO Commented these below lines for resolving warnings. Presently these variable are not + * required but this will require for harq processing */ + // uint8_t k0TmpVal = 0; + // SchPdschCfgCmnTimeDomRsrcAlloc cmnTimeDomRsrcAllocList[MAX_NUM_DL_ALLOC]; + // SchPdschTimeDomRsrcAlloc dedTimeDomRsrcAllocList[MAX_NUM_DL_ALLOC]; /* Initialization the structure and storing the total slot values. */ memset(k0K1InfoTbl, 0, sizeof(SchK0K1TimingInfoTbl)); @@ -878,7 +883,8 @@ SchPdschConfig pdschDedCfg, uint8_t ulAckListCount, uint8_t *UlAckTbl) numTimeDomAlloc = pdschCmnCfg.numTimeDomAlloc; for(cfgIdx = 0; cfgIdxnumLc) { - DU_LOG("\nDEBUG --> SCH : No bo for any lcid\n"); + DU_LOG("\nDEBUG --> SCH : No pending BO for any LC id\n"); + /* Free the dl ded msg info allocated in macSchDlRlcBoInfo */ + SCH_FREE(cell->schDlSlotInfo[dlSchedInfo->schSlotValue.dlMsgTime.slot]->dlMsgInfo, \ + sizeof(DlMsgInfo)); return ROK; } diff --git a/src/du_app/du_f1ap_msg_hdl.c b/src/du_app/du_f1ap_msg_hdl.c index d72a92dea..2ef720114 100644 --- a/src/du_app/du_f1ap_msg_hdl.c +++ b/src/du_app/du_f1ap_msg_hdl.c @@ -5240,8 +5240,7 @@ void FreePdschTimeDomAllocList( struct PDSCH_Config__pdsch_TimeDomainAllocationL * ****************************************************************/ void FreePuschTimeDomAllocList(PUSCH_Config_t *puschCfg) { - uint8_t idx1=0; - uint8_t idx2=0; + uint8_t rsrcListIdx=0; struct PUSCH_Config__pusch_TimeDomainAllocationList *timeDomAllocList_t=NULLP; if(puschCfg->pusch_TimeDomainAllocationList) @@ -5249,23 +5248,23 @@ void FreePuschTimeDomAllocList(PUSCH_Config_t *puschCfg) timeDomAllocList_t=puschCfg->pusch_TimeDomainAllocationList; if(timeDomAllocList_t->choice.setup) { - if(timeDomAllocList_t->choice.setup->list.array) - { - DU_FREE(timeDomAllocList_t->choice.setup->list.array[idx2]->k2, sizeof(long)); - for(idx1 = 0; idx1choice.setup->list.count; idx1++) - { - DU_FREE(timeDomAllocList_t->choice.setup->list.array[idx1],\ - sizeof(PUSCH_TimeDomainResourceAllocation_t)); - } - DU_FREE(timeDomAllocList_t->choice.setup->list.array, \ - timeDomAllocList_t->choice.setup->list.size); - } - DU_FREE(timeDomAllocList_t->choice.setup, \ - sizeof(struct PUSCH_TimeDomainResourceAllocationList)); + if(timeDomAllocList_t->choice.setup->list.array) + { + for(rsrcListIdx = 0; rsrcListIdxchoice.setup->list.count; rsrcListIdx++) + { + DU_FREE(timeDomAllocList_t->choice.setup->list.array[rsrcListIdx]->k2, sizeof(long)); + DU_FREE(timeDomAllocList_t->choice.setup->list.array[rsrcListIdx],\ + sizeof(PUSCH_TimeDomainResourceAllocation_t)); + } + DU_FREE(timeDomAllocList_t->choice.setup->list.array, \ + timeDomAllocList_t->choice.setup->list.size); + } + DU_FREE(timeDomAllocList_t->choice.setup, \ + sizeof(struct PUSCH_TimeDomainResourceAllocationList)); } DU_FREE(puschCfg->transformPrecoder, sizeof(long)); DU_FREE(puschCfg->pusch_TimeDomainAllocationList, \ - sizeof(struct PUSCH_Config__pusch_TimeDomainAllocationList)); + sizeof(struct PUSCH_Config__pusch_TimeDomainAllocationList)); } } @@ -8125,13 +8124,19 @@ void extractPdcchCfg(PDCCH_Config_t *cuPdcchCfg, PdcchConfig *macPdcchCfg) * * Functionality: Fills PdschCfg received by CU * - * @params[in] PDSCH_Config_t *cuPdschCfg, - * PdschConfig *macPdschCfg + * @params[in] PDSCH_Config_t *cuPdschCfg = Information which is send by CU, + * which we have stored in F1UeContextSetupDb, + * PdschConfig *macPdschCfg = Used to Store the information which + * needs to send in other layer, as well as this can be the variable + * which stores the information in DuCb, + * PdschConfig *storedPdschCfg = Null in case of sending the + * information to other layer else it will have stored pdsch + * configuration in copyOfmacUeCfg. * @return void * * ****************************************************************/ -void extractPdschCfg(PDSCH_Config_t *cuPdschCfg, PdschConfig *macPdschCfg) +void extractPdschCfg(PDSCH_Config_t *cuPdschCfg, PdschConfig *macPdschCfg, PdschConfig *storedPdschCfg) { uint8_t timeDomIdx; struct PDSCH_Config__pdsch_TimeDomainAllocationList *timeDomAlloc = NULLP; @@ -8165,7 +8170,22 @@ void extractPdschCfg(PDSCH_Config_t *cuPdschCfg, PdschConfig *macPdschCfg) { if(macPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0 == NULL) { - DU_ALLOC_SHRABL_BUF(macPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0, sizeof(uint8_t)); + if(storedPdschCfg) + { + if(storedPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0) + { + macPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0 =\ + storedPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0; + } + else + { + DU_ALLOC_SHRABL_BUF(macPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0, sizeof(uint8_t)); + } + } + else + { + DU_ALLOC_SHRABL_BUF(macPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0, sizeof(uint8_t)); + } if(!macPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0) { DU_LOG("\nERROR --> DU APP : Memory allocation failed for k0 at extractPdschCfg()"); @@ -8173,7 +8193,7 @@ void extractPdschCfg(PDSCH_Config_t *cuPdschCfg, PdschConfig *macPdschCfg) } } *(macPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0) = \ - *(timeDomAlloc->choice.setup->list.array[timeDomIdx]->k0); + *(timeDomAlloc->choice.setup->list.array[timeDomIdx]->k0); } macPdschCfg->timeDomRsrcAllociList[timeDomIdx].mappingType = \ timeDomAlloc->choice.setup->list.array[timeDomIdx]->mappingType; @@ -8819,13 +8839,20 @@ void extractSchedReqCfgToAddMod(PucchSchedReqCfg *macSchedReqCfg, struct PUCCH_C * * Functionality: Fills PucchCfg received by CU * - * @params[in] BWP_UplinkDedicated__pucch_Config *cuPucchCfg, - * PucchCfg *macPucchCfg + * @params[in] BWP_UplinkDedicated__pucch_Config *cuPucchCfg = Information which + * is send by CU, which we have stored in F1UeContextSetupDb, + * PucchCfg *macPucchCfg = Used to Store the information which + * needs to send in other layer, as well as this can be the variable + * which stores the information in DuCb, + * PucchCfg *storedPucchCfg = Null in case of sending the + * information to other layer else it will have Pucch Cfg which + * we have stored in copyOfmacUeCfg. * @return ROK/RFAILED * * ****************************************************************/ -uint8_t extractPucchCfg(struct BWP_UplinkDedicated__pucch_Config *cuPucchCfg, PucchCfg *macPucchCfg) +uint8_t extractPucchCfg(struct BWP_UplinkDedicated__pucch_Config *cuPucchCfg, PucchCfg *macPucchCfg,\ +PucchCfg *storedPucchCfg) { uint8_t arrIdx; @@ -8951,20 +8978,34 @@ uint8_t extractPucchCfg(struct BWP_UplinkDedicated__pucch_Config *cuPucchCfg, Pu /* Dl_DataToUL_ACK */ if(cuPucchCfg->choice.setup->dl_DataToUL_ACK) - { + { + if(storedPucchCfg) + { + if(storedPucchCfg->dlDataToUlAck) + { + macPucchCfg->dlDataToUlAck = storedPucchCfg->dlDataToUlAck; + } + else + { DU_ALLOC_SHRABL_BUF(macPucchCfg->dlDataToUlAck, sizeof(PucchDlDataToUlAck)); - if(macPucchCfg->dlDataToUlAck == NULLP) - { - DU_LOG("\nERROR --> F1AP : Failed to extract Dl_DataToUL_ACK in extractPucchCfg()"); - return RFAILED; - } - memset(macPucchCfg->dlDataToUlAck, 0, sizeof(PucchDlDataToUlAck)); - macPucchCfg->dlDataToUlAck->dlDataToUlAckListCount = cuPucchCfg->choice.setup->dl_DataToUL_ACK->list.count; - for(arrIdx = 0; arrIdx < macPucchCfg->dlDataToUlAck->dlDataToUlAckListCount; arrIdx++) - { - macPucchCfg->dlDataToUlAck->dlDataToUlAckList[arrIdx] =\ - *cuPucchCfg->choice.setup->dl_DataToUL_ACK->list.array[arrIdx]; - } + } + } + else + { + DU_ALLOC_SHRABL_BUF(macPucchCfg->dlDataToUlAck, sizeof(PucchDlDataToUlAck)); + } + if(macPucchCfg->dlDataToUlAck == NULLP) + { + DU_LOG("\nERROR --> F1AP : Failed to extract Dl_DataToUL_ACK in extractPucchCfg()"); + return RFAILED; + } + memset(macPucchCfg->dlDataToUlAck, 0, sizeof(PucchDlDataToUlAck)); + macPucchCfg->dlDataToUlAck->dlDataToUlAckListCount = cuPucchCfg->choice.setup->dl_DataToUL_ACK->list.count; + for(arrIdx = 0; arrIdx < macPucchCfg->dlDataToUlAck->dlDataToUlAckListCount; arrIdx++) + { + macPucchCfg->dlDataToUlAck->dlDataToUlAckList[arrIdx] =\ + *cuPucchCfg->choice.setup->dl_DataToUL_ACK->list.array[arrIdx]; + } } /* Power Control */ @@ -8994,12 +9035,19 @@ uint8_t extractPucchCfg(struct BWP_UplinkDedicated__pucch_Config *cuPucchCfg, Pu * * Functionality: Fills ServingCellReconfig received by CU * - * @params[in] ServingCellConfig_t *cuSrvCellCfg - * ServCellCfgInfo *macSrvCellCfg + * @params[in] ServingCellConfig_t *cuSrvCellCfg = Information which is send by + * CU, which we have stored in F1UeContextSetupDb, + * ServCellCfgInfo *macSrvCellCfg = Used to Store the information + * which needs to send in other layer, as well as this can be the + * variable which stores the information in DuCb, + * ServCellCfgInfo *storedSrvCellCfg = Null in case of sending the + * information to other layer else it will have ServCellCfgInfo which + * we have stored in copyOfmacUeCfg. * @return ROK/RFAILD * * ****************************************************************/ -uint8_t extractSpCellDedicatedCfg(ServingCellConfig_t *cuSrvCellCfg, ServCellCfgInfo *macSrvCellCfg) +uint8_t extractSpCellDedicatedCfg(ServingCellConfig_t *cuSrvCellCfg, ServCellCfgInfo *macSrvCellCfg,\ +ServCellCfgInfo *storedSrvCellCfg) { uint8_t ret = ROK; BWP_DownlinkDedicated_t *dlBwp = NULLP; @@ -9011,18 +9059,34 @@ uint8_t extractSpCellDedicatedCfg(ServingCellConfig_t *cuSrvCellCfg, ServCellCfg if(dlBwp->pdcch_Config) { if(dlBwp->pdcch_Config->choice.setup) - { - macSrvCellCfg->initDlBwp.pdcchPresent = true; - extractPdcchCfg(dlBwp->pdcch_Config->choice.setup, &macSrvCellCfg->initDlBwp.pdcchCfg); - } + { + macSrvCellCfg->initDlBwp.pdcchPresent = true; + extractPdcchCfg(dlBwp->pdcch_Config->choice.setup, &macSrvCellCfg->initDlBwp.pdcchCfg); + } } if(dlBwp->pdsch_Config) { if(dlBwp->pdsch_Config->choice.setup) - { - macSrvCellCfg->initDlBwp.pdschPresent = true; - extractPdschCfg(dlBwp->pdsch_Config->choice.setup, &macSrvCellCfg->initDlBwp.pdschCfg); - } + { + macSrvCellCfg->initDlBwp.pdschPresent = true; + + if(storedSrvCellCfg) + { + if(!storedSrvCellCfg->initDlBwp.pdschPresent) + { + extractPdschCfg(dlBwp->pdsch_Config->choice.setup, &macSrvCellCfg->initDlBwp.pdschCfg, NULL); + } + else + { + extractPdschCfg(dlBwp->pdsch_Config->choice.setup, &macSrvCellCfg->initDlBwp.pdschCfg,\ + &storedSrvCellCfg->initDlBwp.pdschCfg); + } + } + else + { + extractPdschCfg(dlBwp->pdsch_Config->choice.setup, &macSrvCellCfg->initDlBwp.pdschCfg, NULL); + } + } } } if(cuSrvCellCfg->firstActiveDownlinkBWP_Id) @@ -9039,15 +9103,15 @@ uint8_t extractSpCellDedicatedCfg(ServingCellConfig_t *cuSrvCellCfg, ServCellCfg { macSrvCellCfg->bwpInactivityTmr = NULLP; DU_ALLOC_SHRABL_BUF(macSrvCellCfg->bwpInactivityTmr, sizeof(uint8_t)); - if(macSrvCellCfg->bwpInactivityTmr) - { + if(macSrvCellCfg->bwpInactivityTmr) + { memcpy(macSrvCellCfg->bwpInactivityTmr, cuSrvCellCfg->bwp_InactivityTimer, sizeof(uint8_t)); - } - else - { - DU_LOG("\nERROR --> F1AP : Memory Alloc failed for bwpInactivityTmr at extractSpCellDedicatedCfg()"); - return RFAILED; - } + } + else + { + DU_LOG("\nERROR --> F1AP : Memory Alloc failed for bwpInactivityTmr at extractSpCellDedicatedCfg()"); + return RFAILED; + } } } if(cuSrvCellCfg->pdsch_ServingCellConfig) @@ -9056,31 +9120,42 @@ uint8_t extractSpCellDedicatedCfg(ServingCellConfig_t *cuSrvCellCfg, ServCellCfg { ret = extractPdschServingCellCfg(cuSrvCellCfg->pdsch_ServingCellConfig->choice.setup, &macSrvCellCfg->pdschServCellCfg); if(ret == RFAILED) - { - DU_LOG("\nERROR --> F1AP : Failed at extractPdschServingCellCfg()"); - return RFAILED; - } + { + DU_LOG("\nERROR --> F1AP : Failed at extractPdschServingCellCfg()"); + return RFAILED; + } } } if(cuSrvCellCfg->uplinkConfig) { - if(cuSrvCellCfg->uplinkConfig->initialUplinkBWP) - { - ulBwp = ((BWP_UplinkDedicated_t *)(cuSrvCellCfg->uplinkConfig->initialUplinkBWP)); - if(ulBwp->pusch_Config) - { - macSrvCellCfg->initUlBwp.puschPresent = true; - extractPuschCfg(ulBwp->pusch_Config, &macSrvCellCfg->initUlBwp.puschCfg); - } - if(ulBwp->pucch_Config) - { - macSrvCellCfg->initUlBwp.pucchPresent = true; - memset(&macSrvCellCfg->initUlBwp.pucchCfg, 0, sizeof(PucchCfg)); - extractPucchCfg(ulBwp->pucch_Config, &macSrvCellCfg->initUlBwp.pucchCfg); - } - } - if(cuSrvCellCfg->uplinkConfig->firstActiveUplinkBWP_Id) - macSrvCellCfg->firstActvUlBwpId = *(cuSrvCellCfg->uplinkConfig->firstActiveUplinkBWP_Id); + if(cuSrvCellCfg->uplinkConfig->initialUplinkBWP) + { + ulBwp = ((BWP_UplinkDedicated_t *)(cuSrvCellCfg->uplinkConfig->initialUplinkBWP)); + if(ulBwp->pusch_Config) + { + macSrvCellCfg->initUlBwp.puschPresent = true; + extractPuschCfg(ulBwp->pusch_Config, &macSrvCellCfg->initUlBwp.puschCfg); + } + if(ulBwp->pucch_Config) + { + macSrvCellCfg->initUlBwp.pucchPresent = true; + memset(&macSrvCellCfg->initUlBwp.pucchCfg, 0, sizeof(PucchCfg)); + if(storedSrvCellCfg) + { + if(!storedSrvCellCfg->initUlBwp.pucchPresent) + extractPucchCfg(ulBwp->pucch_Config, &macSrvCellCfg->initUlBwp.pucchCfg, NULL); + else + extractPucchCfg(ulBwp->pucch_Config, &macSrvCellCfg->initUlBwp.pucchCfg,\ + &storedSrvCellCfg->initUlBwp.pucchCfg); + } + else + { + extractPucchCfg(ulBwp->pucch_Config, &macSrvCellCfg->initUlBwp.pucchCfg, NULL); + } + } + } + if(cuSrvCellCfg->uplinkConfig->firstActiveUplinkBWP_Id) + macSrvCellCfg->firstActvUlBwpId = *(cuSrvCellCfg->uplinkConfig->firstActiveUplinkBWP_Id); } return ret; } @@ -9093,13 +9168,20 @@ uint8_t extractSpCellDedicatedCfg(ServingCellConfig_t *cuSrvCellCfg, ServCellCfg * Function : extractUeReCfgCellInfo * * Functionality: Fills Reconfig Cell group Info received by CU + * + * @params[in] CellGroupConfigRrc_t *cellGrp = CellGroupConfigRrc_t information which + * is send by CU, which we have stored in F1UeContextSetupDb + * MacUeCfg *MacUeCfg = Used to Store the information, + * which needs to send in other layer, as well as this can be + * the variable which stores the information in DuCb, + * MacUeCfg *storedMacUeCfg = Null in case of sending the + * information to other layer else it will have copyOfmacUeCfg + * which we have stored in F1UeContextSetupDb. * - * @params[in] CellGroupConfigRrc_t *macCellGrpCfg - * MacUeCfg* macUeCfg * @return ROK/RFAILED * * ****************************************************************/ -uint8_t extractUeReCfgCellInfo(CellGroupConfigRrc_t *cellGrp, MacUeCfg *macUeCfg) +uint8_t extractUeReCfgCellInfo(CellGroupConfigRrc_t *cellGrp, MacUeCfg *macUeCfg, MacUeCfg *storedMacUeCfg) { uint8_t ret = ROK; MAC_CellGroupConfig_t *macCellGroup = NULLP; @@ -9182,7 +9264,18 @@ uint8_t extractUeReCfgCellInfo(CellGroupConfigRrc_t *cellGrp, MacUeCfg *macUeCfg if(cellGrp->spCellConfig->spCellConfigDedicated) { servCellCfg = ((ServingCellConfig_t *)(cellGrp->spCellConfig->spCellConfigDedicated)); - ret = extractSpCellDedicatedCfg(servCellCfg, &macUeCfg->spCellCfg.servCellCfg); + if(storedMacUeCfg) + { + if(!storedMacUeCfg->spCellCfgPres) + ret = extractSpCellDedicatedCfg(servCellCfg, &macUeCfg->spCellCfg.servCellCfg, NULL); + else + ret = extractSpCellDedicatedCfg(servCellCfg, &macUeCfg->spCellCfg.servCellCfg,\ + &storedMacUeCfg->spCellCfg.servCellCfg); + } + else + { + ret = extractSpCellDedicatedCfg(servCellCfg, &macUeCfg->spCellCfg.servCellCfg, NULL); + } if(ret == RFAILED) { DU_LOG("\nERROR --> F1AP : Failed at extractSpCellDedicatedCfg()"); @@ -9561,13 +9654,19 @@ void freeAperDecodeDRBSetup(DRBs_ToBeSetup_List_t *drbSet) * * Functionality: builds Mac Cell Cfg * - * @params[in] MacUeCfg pointer - * void pointer + * @params[in] MacUeCfg *macUeCfgToSend = Used to Store the information which + * needs to send in other layer, as well as this can be + * the variable which stores the information in DuCb. + * MacUeCfg *storedMacUeCfg = Null in case of sending the + * information to other layer else it will have copyOfmacUeCfg + * which we have stored in F1UeContextSetupDb + * void *cellInfo = CellGroupConfigRrc_t information which is send + * by CU, which we have stored in F1UeContextSetupDb * * @return void * * ****************************************************************/ -uint8_t procUeReCfgCellInfo(MacUeCfg *macUeCfgToSend, void *cellInfo) +uint8_t procUeReCfgCellInfo(MacUeCfg *macUeCfgToSend,MacUeCfg *storedMacUeCfg, void *cellInfo) { uint8_t ret = ROK; CellGroupConfigRrc_t *cellGrp = NULLP; @@ -9575,7 +9674,7 @@ uint8_t procUeReCfgCellInfo(MacUeCfg *macUeCfgToSend, void *cellInfo) if(cellInfo) { cellGrp = (CellGroupConfigRrc_t *)cellInfo; - ret = extractUeReCfgCellInfo(cellGrp, macUeCfgToSend); + ret = extractUeReCfgCellInfo(cellGrp, macUeCfgToSend, storedMacUeCfg); if(ret == RFAILED) DU_LOG("\nERROR --> F1AP : Failed at procUeReCfgCellInfo()"); } diff --git a/src/du_app/du_f1ap_msg_hdl.h b/src/du_app/du_f1ap_msg_hdl.h index c956fe069..4182abba9 100644 --- a/src/du_app/du_f1ap_msg_hdl.h +++ b/src/du_app/du_f1ap_msg_hdl.h @@ -34,7 +34,7 @@ uint8_t BuildAndSendDUConfigUpdate(); uint8_t BuildAndSendInitialRrcMsgTransfer(uint32_t gnbDuUeF1apId, uint16_t crnti, uint16_t rrcContSize, uint8_t *rrcContainer); uint8_t BuildAndSendULRRCMessageTransfer(DuUeCb ueCb, uint8_t lcId, uint16_t msgLen, uint8_t *rrcMsg); -uint8_t procUeReCfgCellInfo(MacUeCfg *macUeCfg, void *cellGrp); +uint8_t procUeReCfgCellInfo(MacUeCfg *macUeCfg, MacUeCfg *storedMacUeCfg, void *cellGrp); void freeUeReCfgCellGrpInfo(MacUeCfg *macUeCfg); uint8_t BuildAndSendUeCtxtRsp(uint8_t cellId, uint8_t ueIdx); uint8_t getDrbLcId(uint32_t *drbBitMap); diff --git a/src/du_app/du_mgr.h b/src/du_app/du_mgr.h index 0cd9f86ad..5cd1c60e3 100644 --- a/src/du_app/du_mgr.h +++ b/src/du_app/du_mgr.h @@ -127,6 +127,7 @@ typedef struct duUeCfg AmbrCfg *ambrCfg; uint8_t numDrb; UpTnlCfg upTnlInfo[MAX_NUM_DRB]; /* User plane TNL Info*/ + MacUeCfg copyOfmacUeCfg; }DuUeCfg; typedef struct f1UeContextSetup diff --git a/src/du_app/du_ue_mgr.c b/src/du_app/du_ue_mgr.c index 39569c923..d4d7ca058 100644 --- a/src/du_app/du_ue_mgr.c +++ b/src/du_app/du_ue_mgr.c @@ -1203,7 +1203,7 @@ uint8_t fillMacUeCfg(uint16_t cellId, uint8_t ueIdx, uint16_t crnti, \ macUeCfg->cellId = cellId; macUeCfg->ueIdx = ueIdx; macUeCfg->crnti = crnti; - ret = procUeReCfgCellInfo(macUeCfg, ueCfgDb->cellGrpCfg); + ret = procUeReCfgCellInfo(macUeCfg, duMacDb, ueCfgDb->cellGrpCfg); if(ret == ROK) { if(macUeCfg->spCellCfgPres == true) @@ -1262,6 +1262,7 @@ uint8_t fillMacUeCfg(uint16_t cellId, uint8_t ueIdx, uint16_t crnti, \ break; } }/*End of Outer FOR loop */ + memcpy(&ueCfgDb->copyOfmacUeCfg, macUeCfg, sizeof(MacUeCfg)); } return ret; } @@ -1740,12 +1741,12 @@ uint8_t duUpdateMacCfg(MacUeCfg *macUeCfg, F1UeContextSetupDb *f1UeDb) uint8_t ret, lcIdx, dbIdx, numLcs, lcDelIdx, cellIdx; MacUeCfg *oldMacUeCfg; ret = ROK; - + GET_CELL_IDX(macUeCfg->cellId, cellIdx); oldMacUeCfg = &duCb.actvCellLst[cellIdx]->ueCb[macUeCfg->ueIdx-1].macUeCfg; /*Filling Cell Group Cfg*/ - ret = procUeReCfgCellInfo(macUeCfg, f1UeDb->duUeCfg.cellGrpCfg); + ret = procUeReCfgCellInfo(macUeCfg, &f1UeDb->duUeCfg.copyOfmacUeCfg, f1UeDb->duUeCfg.cellGrpCfg); if(ret == ROK) { if(macUeCfg->spCellCfg.servCellCfg.initDlBwp.pdschPresent)