From: lal.harshita Date: Wed, 30 Mar 2022 12:43:40 +0000 (+0530) Subject: [Epic-ID: ODUHIGH-406][Task-ID: ODUHIGH-423]Cleanup of hoUeCb[] X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;ds=sidebyside;h=9c4801c94d7798cc638a6b112d514e68c695f20a;p=o-du%2Fl2.git [Epic-ID: ODUHIGH-406][Task-ID: ODUHIGH-423]Cleanup of hoUeCb[] Signed-off-by: lal.harshita Change-Id: Id9acede67ae3b9c968c2e42e469725b54462d922 Signed-off-by: lal.harshita --- diff --git a/src/5gnrmac/mac.h b/src/5gnrmac/mac.h index 9ee975f8d..3d9ace09d 100644 --- a/src/5gnrmac/mac.h +++ b/src/5gnrmac/mac.h @@ -205,8 +205,7 @@ typedef struct ueDlCb /* UE Cb */ typedef struct macUeCb { - uint16_t ueId; /* UE Id calculated from CRNTI */ - uint8_t duUeF1apId; /* UE ID assigned by DU APP */ + uint16_t ueId; /* UE Id from DU APP */ uint16_t crnti; /* UE CRNTI */ MacCellCb *cellCb; /* Pointer to cellCb to whihc this UE belongs */ UeState state; /* Is UE active ? */ @@ -227,7 +226,6 @@ struct macCellCb MacUlSlot ulSlot[MAX_SLOTS]; uint16_t numActvUe; MacUeCfg *ueCfgTmpData[MAX_NUM_UE]; - MacUeCb hoUeCb[MAX_NUM_UE]; MacUeCb ueCb[MAX_NUM_UE]; MacCellCfg macCellCfg; SlotTimingInfo currTime; diff --git a/src/5gnrmac/mac_msg_hdl.c b/src/5gnrmac/mac_msg_hdl.c index a3045336c..16ade7180 100644 --- a/src/5gnrmac/mac_msg_hdl.c +++ b/src/5gnrmac/mac_msg_hdl.c @@ -200,7 +200,7 @@ uint8_t fapiMacRxDataInd(Pst *pst, RxDataInd *rxDataInd) if(macCb.macCell[cellIdx] && macCb.macCell[cellIdx]->ueCb[ueId -1].transmissionAction == STOP_TRANSMISSION) { - DU_LOG("\nINFO --> MAC : UL data transmission not allowed for UE %d", macCb.macCell[cellIdx]->ueCb[ueId -1].duUeF1apId); + DU_LOG("\nINFO --> MAC : UL data transmission not allowed for UE %d", macCb.macCell[cellIdx]->ueCb[ueId -1].ueId); } else { diff --git a/src/5gnrmac/mac_ue_mgr.c b/src/5gnrmac/mac_ue_mgr.c index a201e52c5..c1289e7ac 100644 --- a/src/5gnrmac/mac_ue_mgr.c +++ b/src/5gnrmac/mac_ue_mgr.c @@ -1616,7 +1616,7 @@ uint8_t fillSchUeCfg(Pst *pst, SchUeCfg *schUeCfg, MacUeCfg *ueCfg) uint8_t ret = ROK; schUeCfg->cellId = ueCfg->cellId; - schUeCfg->duUeF1apId = ueCfg->duUeF1apId; + schUeCfg->ueId = ueCfg->ueId; schUeCfg->crnti = ueCfg->crnti; schUeCfg->dataTransmissionInfo = ueCfg->transmissionAction; /* Copy MAC cell group config */ @@ -2214,10 +2214,7 @@ uint8_t procMacUeCfgData(Pst *pst, MacUeCfg *ueCfg) } /* Check if UE already configured */ - if(ueCfg->crnti) - ueCb = &macCb.macCell[cellIdx]->ueCb[ueCfg->ueId -1]; - else - ueCb = &macCb.macCell[cellIdx]->hoUeCb[ueCfg->duUeF1apId -1]; + ueCb = &macCb.macCell[cellIdx]->ueCb[ueCfg->ueId -1]; switch(pst->event) { @@ -2273,7 +2270,7 @@ uint8_t copyToTmpData(MacUeCfg *ueCfg) } memcpy(tmpData, ueCfg, sizeof(MacUeCfg)); GET_CELL_IDX(ueCfg->cellId, cellIdx); - macCb.macCell[cellIdx]->ueCfgTmpData[ueCfg->duUeF1apId-1] = tmpData; + macCb.macCell[cellIdx]->ueCfgTmpData[ueCfg->ueId-1] = tmpData; return ROK; } @@ -2365,7 +2362,7 @@ uint8_t MacSendUeCreateRsp(MacRsp result, SchUeCfgRsp *schCfgRsp) /* Filling UE Config response */ memset(cfgRsp, 0, sizeof(MacUeCfgRsp)); cfgRsp->cellId = schCfgRsp->cellId; - cfgRsp->duUeF1apId = schCfgRsp->duUeF1apId; + cfgRsp->ueId = schCfgRsp->ueId; cfgRsp->result = result; /* Fill Post structure and send UE Create response*/ @@ -2405,7 +2402,7 @@ uint8_t MacSendUeReconfigRsp(MacRsp result, SchUeCfgRsp *schCfgRsp) /* Filling UE Config response */ memset(cfgRsp, 0, sizeof(MacUeCfgRsp)); cfgRsp->cellId = schCfgRsp->cellId; - cfgRsp->duUeF1apId = schCfgRsp->duUeF1apId; + cfgRsp->ueId = schCfgRsp->ueId; cfgRsp->result = result; /* Fill Post structure and send UE Create response*/ @@ -2432,12 +2429,12 @@ uint8_t MacSendUeReconfigRsp(MacRsp result, SchUeCfgRsp *schCfgRsp) * * ****************************************************************/ -MacUeCfg *getMacUeCfg(uint16_t cellIdx, uint8_t duUeF1apId) +MacUeCfg *getMacUeCfg(uint16_t cellIdx, uint8_t ueId) { MacUeCfg *ueCfg = NULLP; if(macCb.macCell[cellIdx]) { - ueCfg = macCb.macCell[cellIdx]->ueCfgTmpData[duUeF1apId-1]; + ueCfg = macCb.macCell[cellIdx]->ueCfgTmpData[ueId-1]; } else { @@ -2487,7 +2484,7 @@ uint8_t MacProcSchUeCfgRsp(Pst *pst, SchUeCfgRsp *schCfgRsp) #endif GET_CELL_IDX(schCfgRsp->cellId, cellIdx); - ueCfg = getMacUeCfg(cellIdx, schCfgRsp->duUeF1apId); + ueCfg = getMacUeCfg(cellIdx, schCfgRsp->ueId); if(ueCfg == NULLP) { DU_LOG("\nERROR --> MAC : Failed to find the Mac Ue Cfg for event [%d] in MacProcSchUeCfgRsp()", pst->event); diff --git a/src/5gnrsch/sch.c b/src/5gnrsch/sch.c index ac474c715..992485b4e 100644 --- a/src/5gnrsch/sch.c +++ b/src/5gnrsch/sch.c @@ -964,7 +964,7 @@ uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo) ueCb = &cell->ueCb[ueId-1]; if(ueCb->ueCfg.dataTransmissionAction == STOP_DATA_TRANSMISSION) { - DU_LOG("INFO --> SCH : DL Data transmission not allowed for UE %d", ueCb->ueCfg.duUeF1apId); + DU_LOG("INFO --> SCH : DL Data transmission not allowed for UE %d", ueCb->ueCfg.ueId); return ROK; } @@ -1070,7 +1070,7 @@ uint8_t MacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd) if(ueCb->ueCfg.dataTransmissionAction == STOP_DATA_TRANSMISSION) { - DU_LOG("\nINFO --> SCH: UL Data transmission not allowed for UE %d", ueCb->ueCfg.duUeF1apId); + DU_LOG("\nINFO --> SCH: UL Data transmission not allowed for UE %d", ueCb->ueCfg.ueId); return ROK; } @@ -1126,7 +1126,7 @@ uint8_t MacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd) } if(ueCb->ueCfg.dataTransmissionAction == STOP_DATA_TRANSMISSION) { - DU_LOG("\nINFO --> SCH: UL Data transmission not allowed for UE %d", ueCb->ueCfg.duUeF1apId); + DU_LOG("\nINFO --> SCH: UL Data transmission not allowed for UE %d", ueCb->ueCfg.ueId); return ROK; } if(uciInd->numSrBits) diff --git a/src/5gnrsch/sch.h b/src/5gnrsch/sch.h index e1d8ad8f9..043ca9546 100644 --- a/src/5gnrsch/sch.h +++ b/src/5gnrsch/sch.h @@ -220,7 +220,7 @@ typedef struct schUlCb typedef struct schUeCfgCb { uint16_t cellId; - uint8_t duUeF1apId; + uint8_t ueId; uint16_t crnti; bool macCellGrpCfgPres; SchMacCellGrpCfg macCellGrpCfg; @@ -340,7 +340,6 @@ typedef struct schCellCb uint8_t ssbStartSymbArr[SCH_MAX_SSB_BEAM]; /*!cellId = ueCfg->cellId; - cfgRsp->duUeF1apId = ueCfg->duUeF1apId; + cfgRsp->ueId = ueCfg->ueId; cfgRsp->crnti = ueCfg->crnti; cfgRsp->rsp = result; @@ -259,7 +259,7 @@ uint8_t fillSchUeCb(Inst inst, SchUeCb *ueCb, SchUeCfg *ueCfg) bool isLcIdValid = FALSE; ueCb->ueCfg.cellId = ueCfg->cellId; - ueCb->ueCfg.duUeF1apId = ueCfg->duUeF1apId; + ueCb->ueCfg.ueId = ueCfg->ueId; ueCb->ueCfg.crnti = ueCfg->crnti; ueCb->ueCfg.dataTransmissionAction = ueCfg->dataTransmissionInfo; if(ueCfg->macCellGrpCfgPres == true) @@ -506,7 +506,7 @@ SchCellCb *getSchCellCb(uint16_t srcEvent, Inst inst, SchUeCfg *ueCfg) * ****************************************************************/ uint8_t MacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfg) { - uint8_t ueId, lcIdx, ret = ROK; + uint8_t lcIdx = 0, ret = ROK; SchCellCb *cellCb = NULLP; SchUeCb *ueCb = NULLP; SchUeCfgRsp cfgRsp; @@ -526,13 +526,7 @@ uint8_t MacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfg) cellCb = getSchCellCb(pst->event, inst, ueCfg); /* Search if UE already configured */ - if(ueCfg->crnti) - { - GET_UE_ID(ueCfg->crnti, ueId); - ueCb = &cellCb->ueCb[ueId -1]; - } - else - ueCb = &cellCb->hoUeCb[ueCfg->duUeF1apId - 1]; + ueCb = &cellCb->ueCb[ueCfg->ueId - 1]; if((ueCb->crnti == ueCfg->crnti) && (ueCb->state == SCH_UE_STATE_ACTIVE)) { @@ -543,7 +537,7 @@ uint8_t MacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfg) /* Fill received Ue Configuration in UeCb */ memset(ueCb, 0, sizeof(SchUeCb)); - ueCb->ueId = ueId; + ueCb->ueId = ueCfg->ueId; ueCb->crnti = ueCfg->crnti; if(ueCb->crnti) ueCb->state = SCH_UE_STATE_ACTIVE; diff --git a/src/cm/du_app_mac_inf.h b/src/cm/du_app_mac_inf.h index d4671f418..afd6ca672 100644 --- a/src/cm/du_app_mac_inf.h +++ b/src/cm/du_app_mac_inf.h @@ -1253,7 +1253,6 @@ typedef struct macUeCfg { uint16_t cellId; uint8_t ueId; - uint8_t duUeF1apId; uint16_t crnti; bool macCellGrpCfgPres; MacCellGrpCfg macCellGrpCfg; @@ -1297,7 +1296,7 @@ typedef struct sCellFailInfo typedef struct ueCfgRsp { uint16_t cellId; - uint16_t duUeF1apId; + uint16_t ueId; MacRsp result; uint8_t numSRBFailed; /* valid values : 0 to MAX_NUM_SRB */ SRBFailInfo *failedSRBlisti; diff --git a/src/cm/mac_sch_interface.h b/src/cm/mac_sch_interface.h index 0bb6dace4..67d64edc7 100644 --- a/src/cm/mac_sch_interface.h +++ b/src/cm/mac_sch_interface.h @@ -1572,7 +1572,7 @@ typedef struct schModulationInfo typedef struct schUeCfg { uint16_t cellId; - uint8_t duUeF1apId; + uint8_t ueId; uint16_t crnti; bool macCellGrpCfgPres; SchMacCellGrpCfg macCellGrpCfg; @@ -1591,7 +1591,7 @@ typedef struct schUeCfg typedef struct schUeCfgRsp { uint16_t cellId; - uint16_t duUeF1apId; + uint16_t ueId; uint16_t crnti; SchMacRsp rsp; SchFailureCause cause; diff --git a/src/du_app/du_f1ap_msg_hdl.c b/src/du_app/du_f1ap_msg_hdl.c index fcff8e897..079b234cc 100644 --- a/src/du_app/du_f1ap_msg_hdl.c +++ b/src/du_app/du_f1ap_msg_hdl.c @@ -12012,7 +12012,7 @@ uint8_t procF1UeContextSetupReq(F1AP_PDU_t *f1apMsg) ret = RFAILED; break; } - duUeCb = &duCb.actvCellLst[cellIdx]->hoUeCb[ueIdx]; + duUeCb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx]; duUeCb->f1UeDb = NULL; duUeCb->gnbCuUeF1apId = gnbCuUeF1apId; duUeCb->gnbDuUeF1apId = gnbDuUeF1apId; diff --git a/src/du_app/du_mgr.h b/src/du_app/du_mgr.h index 5f02a2ceb..7dad91b15 100644 --- a/src/du_app/du_mgr.h +++ b/src/du_app/du_mgr.h @@ -186,9 +186,7 @@ typedef struct duCellCb MacCellCfg *duMacCellCfg; CellStatus cellStatus; /* Cell status */ uint32_t numActvUes; /* Total Active UEs */ - DuUeCb ueCb[MAX_NUM_UE]; /* UE context created after RRC setup */ - uint32_t numHoUes; /* Number of UE handover in progress */ - DuUeCb hoUeCb[MAX_NUM_UE]; /* UE context created before RACH for UE being handover to this DU */ + DuUeCb ueCb[MAX_NUM_UE]; /* Stores UE context */ SlotInfo currSlotInfo; }DuCellCb; diff --git a/src/du_app/du_ue_mgr.c b/src/du_app/du_ue_mgr.c index 9c660efe0..f63e47d8d 100644 --- a/src/du_app/du_ue_mgr.c +++ b/src/du_app/du_ue_mgr.c @@ -1169,13 +1169,9 @@ uint8_t fillMacUeCfg(uint16_t cellId, uint8_t gnbDuUef1apId, uint16_t crnti, DuU bool lcIdFound = false; MacUeCfg *duMacDb = NULLP; - macUeCfg->cellId = cellId; - if(crnti) - { - GET_UE_ID(crnti, macUeCfg->ueId); - macUeCfg->crnti = crnti; - } - macUeCfg->duUeF1apId = gnbDuUef1apId; + macUeCfg->cellId = cellId; + macUeCfg->ueId = gnbDuUef1apId; + macUeCfg->crnti = crnti; if(!ueCfgDb) { @@ -2340,64 +2336,43 @@ uint8_t duUpdateDuUeCbCfg(uint8_t ueId, uint8_t cellId) * ****************************************************************/ uint8_t DuProcMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp) { - uint8_t ret = ROK, ueIdx = 0, ueId = 0; - DuUeCb *ueCb = NULLP; + uint8_t ret = ROK; + uint16_t cellIdx; if(cfgRsp) { + GET_CELL_IDX(cfgRsp->cellId, cellIdx); if(cfgRsp->result == MAC_DU_APP_RSP_OK) { if(pst->event == EVENT_MAC_UE_CREATE_RSP) { - DU_LOG("\nINFO --> DU APP : MAC UE Create Response : SUCCESS [DU UE F1AP ID : %d]", cfgRsp->duUeF1apId); - - for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++) - { - if(duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[ueIdx].gnbDuUeF1apId == cfgRsp->duUeF1apId) - { - ueCb = &duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[ueIdx]; - ueCb->macUeCfg.macUeCfgState = UE_CREATE_COMPLETE; - break; - } - } - if(!ueCb) + 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[cfgRsp->cellId -1]->hoUeCb[cfgRsp->duUeF1apId-1].gnbDuUeF1apId == cfgRsp->duUeF1apId) - { - ueCb = &duCb.actvCellLst[cfgRsp->cellId -1]->hoUeCb[cfgRsp->duUeF1apId-1]; - ueCb->macUeCfg.macUeCfgState = UE_CREATE_COMPLETE; - //TODO : in next gerrit - //BuildAndSendUeCtxtRsp(cfgRsp->cellId, cfgRsp->ueId); - } - } + duCb.actvCellLst[cellIdx]->ueCb[cfgRsp->ueId -1].macUeCfg.macUeCfgState = UE_CREATE_COMPLETE; + /* TODO : IF UE state is HANDIN_IN_PROGRESS, then send UE Context Setup Response */ + } } else if(pst->event == EVENT_MAC_UE_RECONFIG_RSP) { - DU_LOG("\nINFO --> DU APP : MAC UE Reconfig Response : SUCCESS [DU UE F1AP ID : %d]", cfgRsp->duUeF1apId); - for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++) - { - if(duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[ueIdx].gnbDuUeF1apId == cfgRsp->duUeF1apId) - { - ueCb = &duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[ueIdx]; - ueCb->macUeCfg.macUeCfgState = UE_RECFG_COMPLETE; - break; - } - } - - if(ueCb) + DU_LOG("\nINFO --> DU APP : MAC UE Reconfig Response : SUCCESS [DU UE F1AP ID : %d]", cfgRsp->ueId); + if(duCb.actvCellLst[cellIdx] && + (duCb.actvCellLst[cellIdx]->ueCb[cfgRsp->ueId -1].gnbDuUeF1apId == cfgRsp->ueId)) { - GET_UE_ID(ueCb->crnti, ueId); - if((ret = duUpdateDuUeCbCfg(ueId, cfgRsp->cellId)) == ROK) - { - BuildAndSendUeCtxtRsp(cfgRsp->cellId, ueId); + duCb.actvCellLst[cellIdx]->ueCb[cfgRsp->ueId -1].macUeCfg.macUeCfgState = UE_RECFG_COMPLETE; + if((ret = duUpdateDuUeCbCfg(cfgRsp->ueId, cfgRsp->cellId)) == ROK) + { + BuildAndSendUeCtxtRsp(cfgRsp->cellId, cfgRsp->ueId); } } } } else { - DU_LOG("\nERROR --> DU APP : MAC UE CFG Response for EVENT[%d]: FAILURE [DU UE F1AP ID : %d]", pst->event, cfgRsp->duUeF1apId); + DU_LOG("\nERROR --> DU APP : MAC UE CFG Response for EVENT[%d]: FAILURE [DU UE F1AP ID : %d]", pst->event, cfgRsp->ueId); if(pst->event == EVENT_MAC_UE_RECONFIG_RSP) { //TODO: Send the failure case in Ue Context Setup Response