X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdu_app%2Fdu_mgr_main.c;h=ba89f0be06b84cc714f3094515518251040942df;hb=refs%2Fchanges%2F15%2F9315%2F5;hp=13ef272372fa7a960b1de0cc1a3f93569a383e53;hpb=082b269b31990bb7ddc3b387e921bf7c68bf4292;p=o-du%2Fl2.git diff --git a/src/du_app/du_mgr_main.c b/src/du_app/du_mgr_main.c index 13ef27237..ba89f0be0 100644 --- a/src/du_app/du_mgr_main.c +++ b/src/du_app/du_mgr_main.c @@ -30,6 +30,12 @@ #include "du_sctp.h" #include "du_egtp.h" +#ifdef O1_ENABLE + +#include "O1Interface.h" +#include "CmInterface.h" +#endif + uint8_t rlcUlActvTsk (Pst *, Buffer *); uint8_t rlcUlActvInit (Ent, Inst, Region, Reason); uint8_t rlcDlActvTsk (Pst *, Buffer *); @@ -38,10 +44,18 @@ uint8_t rgActvTsk (Pst *, Buffer *); uint8_t rgActvInit (Ent, Inst, Region, Reason); uint8_t lwrMacActvTsk(Pst *, Buffer *); uint8_t lwrMacActvInit(Ent, Inst, Region, Reason); +#ifndef INTEL_WLS_MEM +uint8_t phyStubActvTsk(Pst *, Buffer *); +uint8_t phyStubActvInit(Ent, Inst, Region, Reason); +#endif /* Global variable */ DuCfgParams duCfgParam; +#ifdef O1_ENABLE +extern NRCellDU cellParams; +#endif + /******************************************************************* * * @brief Initializes DU APP @@ -78,6 +92,205 @@ uint8_t duAppInit(SSTskId sysTskId) return ROK; } +#ifdef O1_ENABLE + +/******************************************************************* + * + * @brief update Rrm Policy at DU and process the slice cfg request + * + * @details + * + * Function : setRrmPolicy + * + * Functionality: + * - update Rrm Policy at DU and process the slice cfg request + * + * @params[in] RrmPolicy rrmPolicy[], uint8_t policyNum, uint8_t memberList + * @return true - success + * false - failure + * + * ****************************************************************/ + +uint8_t setRrmPolicy(RrmPolicyList rrmPolicy[], uint8_t policyNum) +{ + DU_LOG("\nINFO --> DU_APP : DU APP RRM number of policy %d,", \ + policyNum); + for(uint8_t i=0; i DU_APP : DU APP id = %s",rrmPolicy[i].id); + DU_LOG("\nINFO --> DU_APP : DU APP resourceType = %d", \ + rrmPolicy[i].resourceType); + DU_LOG("\nINFO --> DU_APP : DU APP rRMPolicyMaxRatio = %d", \ + rrmPolicy[i].rRMPolicyMaxRatio); + DU_LOG("\nINFO --> DU_APP : DU APP rRMPolicyMinRatio = %d", \ + rrmPolicy[i].rRMPolicyMinRatio); + DU_LOG("\nINFO --> DU_APP : DU APP rRMPolicyDedicatedRatio = %d", \ + rrmPolicy[i].rRMPolicyDedicatedRatio); + DU_LOG("\nINFO --> DU_APP : DU APP rRMMemberNum = %d", \ + rrmPolicy[i].rRMMemberNum); + for(uint8_t j=0; j DU_APP : DU APP mcc = %d%d%d", \ + rrmPolicy[i].rRMPolicyMemberList[j].mcc[0], \ + rrmPolicy[i].rRMPolicyMemberList[j].mcc[1], \ + rrmPolicy[i].rRMPolicyMemberList[j].mcc[2]); + DU_LOG("\nINFO --> DU_APP : DU APP mnc = %d%d%d", \ + rrmPolicy[i].rRMPolicyMemberList[j].mnc[0], \ + rrmPolicy[i].rRMPolicyMemberList[j].mnc[1], \ + rrmPolicy[i].rRMPolicyMemberList[j].mnc[2]); + + DU_LOG("\nINFO --> DU_APP : DU APP sd = %d%d%d", \ + rrmPolicy[i].rRMPolicyMemberList[j].sd[0], \ + rrmPolicy[i].rRMPolicyMemberList[j].sd[1], \ + rrmPolicy[i].rRMPolicyMemberList[j].sd[2]); + + DU_LOG("\nINFO --> DU_APP : DU APP sst = %d\n", \ + rrmPolicy[i].rRMPolicyMemberList[j].sst); + } + + } + DuCellCb *cellCb = NULLP; + + cpyRrmPolicyInDuCfgParams(rrmPolicy, policyNum, &duCfgParam.tempSliceCfg); + cellCb = duCb.actvCellLst[0]; + + if(cellCb) + { + if(cellCb->cellStatus == ACTIVATED) + { + if(duCb.sliceState == SLICE_INFO_NOT_AVAILABLE) + { + BuildAndSendSliceConfigReq(duCfgParam.tempSliceCfg.rrmPolicy, duCfgParam.tempSliceCfg.totalRrmPolicy,\ + duCfgParam.tempSliceCfg.totalSliceCount); + } + else + { + BuildAndSendSliceReCfgReq(duCfgParam.tempSliceCfg.rrmPolicy, duCfgParam.tempSliceCfg.totalRrmPolicy,\ + duCfgParam.tempSliceCfg.totalSliceCount); + } + } + } + return ROK; +} + +/******************************************************************* + * + * @brief Bring the cell Up + * + * @details + * + * Function : bringCellUp + * + * Functionality: + * - Bring the cell Up when requested from OAM + * + * @params[in] Cell Id + * @return true - success + * false - failure + * + * ****************************************************************/ + +bool bringCellUp(uint16_t cellId) +{ + duProcCfgComplete(); + BuildAndSendF1SetupReq(); + return true; +} + +/******************************************************************* + * + * @brief configure cell parameters + * + * @details + * + * Function : configurecell + * + * Functionality: + * - configure cell parameters + * + * @params[in] Cell Id + * @return true - success + * false - failure + * + * ****************************************************************/ + +uint8_t setCellParam() +{ + //Read all the configs from smo edit-config into cellParams + DU_LOG("\nO1 configurecell du_app enterd"); + DU_LOG("\nDU_APP configurecell cellLocalId value:%d",cellParams.cellLocalId); + DU_LOG("\nDU_APP configurecell operationalState value:%d", \ + cellParams.operationalState); + DU_LOG("\nDU_APP configurecell administrativeState value:%d", \ + cellParams.administrativeState); + DU_LOG("\nDU_APP configurecell cellState value:%d",cellParams.cellState); + DU_LOG("\nDU_APP configurecell nRPCI value:%d",cellParams.nRPCI); + DU_LOG("\nDU_APP configurecell nRTAC value:%d",cellParams.nRTAC); + DU_LOG("\nDU_APP configurecell arfcnDL value:%d",cellParams.arfcnDL); + DU_LOG("\nDU_APP configurecell arfcnUL value:%d",cellParams.arfcnUL); + DU_LOG("\nDU_APP configurecell arfcnSUL value:%d",cellParams.arfcnSUL); + DU_LOG("\nDU_APP configurecell ssbFrequency value:%d",cellParams.ssbFrequency); + DU_LOG("\nDU_APP configurecell ssbPeriodicity value:%d", \ + cellParams.ssbPeriodicity); + DU_LOG("\nDU_APP configurecell ssbSubCarrierSpacing value:%d", \ + cellParams.ssbSubCarrierSpacing); + DU_LOG("\nDU_APP configurecell ssbOffset value:%d",cellParams.ssbOffset); + DU_LOG("\nDU_APP configurecell ssbDuration value:%d",cellParams.ssbDuration); + DU_LOG("\nDU_APP configurecell bSChannelBwUL value:%d", \ + cellParams.bSChannelBwUL); + DU_LOG("\nDU_APP configurecell bSChannelBwDL value:%d", \ + cellParams.bSChannelBwDL); + DU_LOG("\nDU_APP configurecell bSChannelBwSUL value:%d", \ + cellParams.bSChannelBwSUL); + for (int i=0 ; i DU_APP : DU APP mcellParams.plmnList[%d].mcc = %d%d%d", i,\ + cellParams.plmnList[i].mcc[0], \ + cellParams.plmnList[i].mcc[1], \ + cellParams.plmnList[i].mcc[2]); + DU_LOG("\nINFO --> DU_APP : DU APP cellParams.plmnList[%d].mnc = %d%d%d", i,\ + cellParams.plmnList[i].mnc[0], \ + cellParams.plmnList[i].mnc[1], \ + cellParams.plmnList[i].mnc[2]); + + DU_LOG("\nINFO --> DU_APP : DU APP cellParams.plmnList[%d].sd = %d%d%d", i,\ + cellParams.plmnList[i].sd[0], \ + cellParams.plmnList[i].sd[1], \ + cellParams.plmnList[i].sd[2]); + + DU_LOG("\nINFO --> DU_APP : DU APP cellParams.plmnList[%d].sst = %d\n", i,\ + cellParams.plmnList[i].sst); + + } + + duReadCfg(); + return ROK; +} +/******************************************************************* + * + * @brief Bring the cell Down + * + * @details + * + * Function : bringCellDown + * + * Functionality: + * - Bring the cell Down when requested from OAM + * + * @params[in] Cell Id + * @return true - success + * false - failure + * + * ****************************************************************/ + +bool bringCellDown(uint16_t cellId) +{ + BuildAndSendDUConfigUpdate(SERV_CELL_TO_DELETE); + return true; +} +#endif + /******************************************************************* * * @brief Initializes EGTP @@ -265,6 +478,44 @@ uint8_t lwrMacInit(SSTskId sysTskId) return ROK; } +#ifndef INTEL_WLS_MEM +/******************************************************************* + * + * @brief Initializes Phy stub slot indication generator task + * + * @details + * + * Function : phyStubInit + * + * Functionality: + * - Registers and attaches TAPA tasks for Phy stub's slot + * indication generator + * + * @params[in] system task ID + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t phyStubInit(SSTskId sysTskId) +{ + /* Register PHY stub slot indication TAPA Task */ + if(ODU_REG_TTSK((Ent)ENTPHYSTUB, (Inst)0, (Ttype)TTNORM, (Prior)PRIOR0, + phyStubActvInit, (ActvTsk)phyStubActvTsk) != ROK) + { + return RFAILED; + } + /* Attach Phy stub slot indication TAPA Task */ + if (ODU_ATTACH_TTSK((Ent)ENTPHYSTUB, (Inst)0, sysTskId)!= ROK) + { + return RFAILED; + } + + DU_LOG("\nINFO --> DU_APP : PHY stub slot indication TAPA task created and registered to %d sys task", + sysTskId); + return ROK; +} +#endif + /******************************************************************* * * @brief Initializes system and TAPA tasks @@ -284,19 +535,20 @@ uint8_t lwrMacInit(SSTskId sysTskId) uint8_t commonInit() { /* Declare system task Ids */ - SSTskId du_app_stsk, egtp_stsk, sctp_stsk, rlc_ul_stsk, rlc_mac_cl_stsk, lwr_mac_stsk; + SSTskId du_app_stsk, egtp_stsk, sctp_stsk, rlc_ul_stsk, rlc_mac_cl_stsk, lwr_mac_stsk, phy_stub_slot_ind_stsk; pthread_attr_t attr; ODU_SET_PROC_ID(DU_PROC); + /* Intel L1 using core 0-15. ODU-High using 16-21 */ /* system task for DU APP */ if(ODU_CREATE_TASK(PRIOR0, &du_app_stsk) != ROK) { DU_LOG("\nERROR --> DU_APP : System Task creation for DU APP failed"); return RFAILED; } - ODU_SET_THREAD_AFFINITY(&du_app_stsk, SS_AFFINITY_MODE_EXCL, 15, 0); + ODU_SET_THREAD_AFFINITY(&du_app_stsk, SS_AFFINITY_MODE_EXCL, 16, 0); /* system task for EGTP */ if(ODU_CREATE_TASK(PRIOR0, &egtp_stsk) != ROK) @@ -304,7 +556,7 @@ uint8_t commonInit() DU_LOG("\nERROR --> DU_APP : System Task creation for EGTP failed"); return RFAILED; } - ODU_SET_THREAD_AFFINITY(&egtp_stsk, SS_AFFINITY_MODE_EXCL, 16, 0); + ODU_SET_THREAD_AFFINITY(&egtp_stsk, SS_AFFINITY_MODE_EXCL, 27, 0); /* system task for RLC_DL and MAC */ if(ODU_CREATE_TASK(PRIOR0, &rlc_mac_cl_stsk) != ROK) @@ -314,7 +566,7 @@ uint8_t commonInit() } pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - ODU_SET_THREAD_AFFINITY(&rlc_mac_cl_stsk, SS_AFFINITY_MODE_EXCL, 17, 0); + ODU_SET_THREAD_AFFINITY(&rlc_mac_cl_stsk, SS_AFFINITY_MODE_EXCL, 18, 0); /* system task for RLC UL */ if(ODU_CREATE_TASK(PRIOR1, &rlc_ul_stsk) != ROK) @@ -322,7 +574,7 @@ uint8_t commonInit() DU_LOG("\nERROR --> DU_APP : System Task creation for RLC UL failed"); return RFAILED; } - ODU_SET_THREAD_AFFINITY(&rlc_ul_stsk, SS_AFFINITY_MODE_EXCL, 18, 0); + ODU_SET_THREAD_AFFINITY(&rlc_ul_stsk, SS_AFFINITY_MODE_EXCL, 22, 0); /* system task for SCTP receiver thread */ if(ODU_CREATE_TASK(PRIOR0, &sctp_stsk) != ROK) @@ -330,7 +582,7 @@ uint8_t commonInit() DU_LOG("\nERROR --> DU_APP : System Task creation for SCTP failed"); return RFAILED; } - ODU_SET_THREAD_AFFINITY(&sctp_stsk, SS_AFFINITY_MODE_EXCL, 19, 0); + ODU_SET_THREAD_AFFINITY(&sctp_stsk, SS_AFFINITY_MODE_EXCL, 25, 0); /* system task for lower-mac receiver thread */ if(ODU_CREATE_TASK(PRIOR0, &lwr_mac_stsk) != ROK) @@ -338,7 +590,17 @@ uint8_t commonInit() DU_LOG("\nERROR --> DU_APP : System Task creation for Lower MAC failed"); return RFAILED; } - ODU_SET_THREAD_AFFINITY(&lwr_mac_stsk, SS_AFFINITY_MODE_EXCL, 20, 0); + ODU_SET_THREAD_AFFINITY(&lwr_mac_stsk, SS_AFFINITY_MODE_EXCL, 21, 0); + +#ifndef INTEL_WLS_MEM + /* system task for phy stub's slot indication generator thread */ + if(ODU_CREATE_TASK(PRIOR0, &phy_stub_slot_ind_stsk) != ROK) + { + DU_LOG("\nERROR --> DU_APP : System Task creation for Phy stub slot indication generator failed. MAX STSK [%d]", SS_MAX_STSKS); + return RFAILED; + } + +#endif /* Create TAPA tasks */ if(duAppInit(du_app_stsk) != ROK) @@ -377,6 +639,15 @@ uint8_t commonInit() return RFAILED; } +#ifndef INTEL_WLS_MEM + if(phyStubInit(phy_stub_slot_ind_stsk) != ROK) + { + DU_LOG("\nERROR --> DU_APP : PHY stub slot indication Tapa Task initialization failed"); + return RFAILED; + } +#endif + + return ROK; } @@ -432,7 +703,10 @@ void init_log() uint8_t tst(void) { init_log(); - +#ifdef O1_ENABLE + if(start_O1_module() != ROK) + return RFAILED; +#endif //Initialize TAPA layers if(duInit() != ROK) { @@ -440,9 +714,17 @@ uint8_t tst(void) } //Read all the configs from du_utils.c into duCfgParams +#ifndef O1_ENABLE duReadCfg(); +#endif + +#ifdef O1_ENABLE + //Send VES PNF registration message to SMO + sendPnfRegistration(); +#endif return ROK; + }/* end of main()*/ /**********************************************************************