From b864875ccd95278bcfcc40187def1ed7a6fb8aa4 Mon Sep 17 00:00:00 2001 From: "lal.harshita" Date: Wed, 22 Feb 2023 16:21:15 +0530 Subject: [PATCH] [Epic-ID: ODUHIGH-488][Task-ID: ODUHIGH-489] Fix in CellConfg(TDD) and Mem Leak fixes Signed-off-by: lal.harshita Change-Id: If4274b8f66a40f84e159fc2dda84b145f4cb8b14 --- src/5gnrsch/sch.c | 45 +++++++++++++++++++++++++++++++++++++++++++- src/5gnrsch/sch.h | 9 ++++++++- src/5gnrsch/sch_common.c | 8 ++------ src/du_app/du_f1ap_msg_hdl.c | 2 +- 4 files changed, 55 insertions(+), 9 deletions(-) diff --git a/src/5gnrsch/sch.c b/src/5gnrsch/sch.c index 8aa6d0aef..85f6d76d8 100644 --- a/src/5gnrsch/sch.c +++ b/src/5gnrsch/sch.c @@ -319,6 +319,48 @@ uint16_t schGetPeriodicityInMsec(DlUlTxPeriodicity tddPeriod) return periodicityInMsec; } +/** + *@brief Fills the slotCfg from CellCfg + * + * @details + * + * Function : schFillSlotConfig + * + * This API Fills the slotCfg from CellCfg + * + * @param[in] SchCellCb *cell, TDDCfg tddCfg + * @return void + * **/ +void schFillSlotConfig(SchCellCb *cell, TDDCfg tddCfg) +{ + uint8_t slotIdx = 0, symbolIdx = 0; + + for(slotIdx =0 ;slotIdx < MAX_TDD_PERIODICITY_SLOTS; slotIdx++) + { + for(symbolIdx = 0; symbolIdx < MAX_SYMB_PER_SLOT; symbolIdx++) + { + /*Fill Full-DL Slots as well as DL symbols ini 1st Flexi Slo*/ + if(slotIdx < tddCfg.nrOfDlSlots || \ + (slotIdx == tddCfg.nrOfDlSlots && symbolIdx < tddCfg.nrOfDlSymbols)) + { + cell->slotCfg[slotIdx][symbolIdx] = DL_SYMBOL; + } + + /*Fill Full-FLEXI SLOT and as well as Flexi Symbols in 1 slot preceding FULL-UL slot*/ + else if(slotIdx < (MAX_TDD_PERIODICITY_SLOTS - tddCfg.nrOfUlSlots -1) || \ + (slotIdx == (MAX_TDD_PERIODICITY_SLOTS - tddCfg.nrOfUlSlots -1) && \ + symbolIdx < (MAX_SYMB_PER_SLOT - tddCfg.nrOfUlSymbols))) + { + cell->slotCfg[slotIdx][symbolIdx] = FLEXI_SYMBOL; + } + /*Fill Partial UL symbols and Full-UL slot*/ + else + { + cell->slotCfg[slotIdx][symbolIdx] = UL_SYMBOL; + } + } + } +} /** * @brief init TDD slot config @@ -341,12 +383,13 @@ void schInitTddSlotCfg(SchCellCb *cell, SchCellCfg *schCellCfg) periodicityInMicroSec = schGetPeriodicityInMsec(schCellCfg->tddCfg.tddPeriod); cell->numSlotsInPeriodicity = (periodicityInMicroSec * pow(2, schCellCfg->numerology))/1000; cell->slotFrmtBitMap = 0; + schFillSlotConfig(cell, schCellCfg->tddCfg); for(slotIdx = cell->numSlotsInPeriodicity-1; slotIdx >= 0; slotIdx--) { symbIdx = 0; /* If the first and last symbol are the same, the entire slot is the same type */ if((cell->slotCfg[slotIdx][symbIdx] == cell->slotCfg[slotIdx][MAX_SYMB_PER_SLOT-1]) && - cell->slotCfg[slotIdx][symbIdx] != FLEXI_SLOT) + cell->slotCfg[slotIdx][symbIdx] != FLEXI_SYMBOL) { switch(cell->slotCfg[slotIdx][symbIdx]) { diff --git a/src/5gnrsch/sch.h b/src/5gnrsch/sch.h index 353c89c9f..169ef8c13 100644 --- a/src/5gnrsch/sch.h +++ b/src/5gnrsch/sch.h @@ -144,6 +144,13 @@ typedef enum UL_SLOT, FLEXI_SLOT }SlotConfig; + +typedef enum +{ + DL_SYMBOL, + UL_SYMBOL, + FLEXI_SYMBOL +}SchSymbolConfig; #endif /*Following structures to keep record and estimations of PRB allocated for each @@ -618,7 +625,7 @@ typedef struct schCellCb #ifdef NR_TDD uint8_t numSlotsInPeriodicity; /*!< number of slots in configured periodicity and SCS */ uint32_t slotFrmtBitMap; /*!< 2 bits must be read together to determine D/U/S slots. 00-D, 01-U, 10-S */ - uint8_t slotCfg[MAX_TDD_PERIODICITY_SLOTS][MAX_SYMB_PER_SLOT]; + SchSymbolConfig slotCfg[MAX_TDD_PERIODICITY_SLOTS][MAX_SYMB_PER_SLOT]; #endif #ifdef NR_DRX SchDrxCb drxCb[MAX_DRX_SIZE]; /*!< Drx cb*/ diff --git a/src/5gnrsch/sch_common.c b/src/5gnrsch/sch_common.c index 6e37417d0..6b01730c0 100644 --- a/src/5gnrsch/sch_common.c +++ b/src/5gnrsch/sch_common.c @@ -1179,7 +1179,7 @@ SchPdschConfig pdschDedCfg, uint8_t ulAckListCount, uint8_t *UlAckTbl) { for(checkSymbol = 0; checkSymbol< MAX_SYMB_PER_SLOT;checkSymbol++) { - if(cell->slotCfg[tmpSlot][checkSymbol] == UL_SLOT) + if(cell->slotCfg[tmpSlot][checkSymbol] == UL_SYMBOL) { ulSlotPresent = true; break; @@ -1647,11 +1647,7 @@ void updateGrantSizeForBoRpt(CmLListCp *lcLL, DlMsgAlloc *dlMsgAlloc,\ lcNode->lcId,lcNode->reqBO, dlMsgSchInfo->numLc, *accumalatedBOSize); dlMsgSchInfo->numLc++; - /* The LC has been fully allocated, clean it */ - if(lcNode->reqBO == 0) - { - handleLcLList(lcLL, lcNode->lcId, DELETE); - } + handleLcLList(lcLL, lcNode->lcId, DELETE); } else if(bsrInfo != NULLP) { diff --git a/src/du_app/du_f1ap_msg_hdl.c b/src/du_app/du_f1ap_msg_hdl.c index 4e4372af2..b17e2ccee 100644 --- a/src/du_app/du_f1ap_msg_hdl.c +++ b/src/du_app/du_f1ap_msg_hdl.c @@ -1214,7 +1214,7 @@ void freeFddNrFreqInfo(FDD_Info_t *fDD) * ****************************************************************/ void FreeServedCellList( GNB_DU_Served_Cells_List_t *duServedCell) { - uint8_t plmnCnt=MAX_PLMN; + uint8_t plmnCnt= 1; uint8_t extensionCnt=IE_EXTENSION_LIST_COUNT; uint8_t plmnIdx=0, sliceIdx=0; GNB_DU_Served_Cells_Item_t *srvCellItem; -- 2.16.6