X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdu_app%2Fdu_mgr_main.c;h=6bc11c8ad7beff92588e97313b6072bd1b5d4c6b;hb=efd3fd582205e5c94878e6bcae6d6282dd6f1d25;hp=7f112cb1f260f3506817c17405c52a74581f4b82;hpb=37badc1a711fc7802d2f0b67924f3c15e569a7d5;p=o-du%2Fl2.git diff --git a/src/du_app/du_mgr_main.c b/src/du_app/du_mgr_main.c index 7f112cb1f..6bc11c8ad 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" + +#endif + uint8_t rlcUlActvTsk (Pst *, Buffer *); uint8_t rlcUlActvInit (Ent, Inst, Region, Reason); uint8_t rlcDlActvTsk (Pst *, Buffer *); @@ -61,9 +67,9 @@ DuCfgParams duCfgParam; * ****************************************************************/ uint8_t duAppInit(SSTskId sysTskId) { - /* Register DU APP TAPA Task for DU */ - if(ODU_REG_TTSK((Ent)ENTDUAPP, (Inst)DU_INST, (Ttype)TTNORM, (Prior)PRIOR0, - duActvInit, (ActvTsk)duActvTsk) != ROK) + /* Register DU APP TAPA Task for DU */ + if(ODU_REG_TTSK((Ent)ENTDUAPP, (Inst)DU_INST, (Ttype)TTNORM, (Prior)PRIOR0, + duActvInit, (ActvTsk)duActvTsk) != ROK) { return RFAILED; } @@ -73,7 +79,7 @@ uint8_t duAppInit(SSTskId sysTskId) return RFAILED; } - DU_LOG("\nDU_APP : DU APP created and registered \ + DU_LOG("\nINFO --> DU_APP : DU APP created and registered \ to %d sys task", sysTskId); return ROK; } @@ -109,7 +115,7 @@ uint8_t egtpInit(SSTskId sysTskId) return RFAILED; } - DU_LOG("\nDU_APP : EGTP created and registered \ + DU_LOG("\nINFO --> DU_APP : EGTP created and registered \ to %d sys task", sysTskId); return ROK; } @@ -145,7 +151,7 @@ uint8_t sctpInit(SSTskId sysTskId) return RFAILED; } - DU_LOG("\nDU_APP : SCTP TAPA task created and registered to %d sys task", + DU_LOG("\nINFO --> DU_APP : SCTP TAPA task created and registered to %d sys task", sysTskId); return ROK; } @@ -191,7 +197,7 @@ uint8_t rlcDlInit(SSTskId sysTskId) return RFAILED; } - DU_LOG("\nDU_APP : RLC DL and MAC TAPA task created and registered to \ + DU_LOG("\nINFO --> DU_APP : RLC DL and MAC TAPA task created and registered to \ %d sys task", sysTskId); return ROK; } @@ -225,7 +231,7 @@ uint8_t rlcUlInit(SSTskId sysTskId) { return RFAILED; } - DU_LOG("\nDU_APP : RLC UL TAPA task created and registered to \ + DU_LOG("\nINFO --> DU_APP : RLC UL TAPA task created and registered to \ %d sys task", sysTskId); return ROK; } @@ -260,7 +266,7 @@ uint8_t lwrMacInit(SSTskId sysTskId) return RFAILED; } - DU_LOG("\nDU_APP : LWR MAC TAPA task created and registered to %d sys task", + DU_LOG("\nINFO --> DU_APP : LWR MAC TAPA task created and registered to %d sys task", sysTskId); return ROK; } @@ -284,88 +290,97 @@ uint8_t lwrMacInit(SSTskId sysTskId) uint8_t commonInit() { /* Declare system task Ids */ - SSTskId du_app_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; 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("\nDU_APP : System Task creation for DU APP failed"); + 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, 16, 0); + + /* system task for EGTP */ + if(ODU_CREATE_TASK(PRIOR0, &egtp_stsk) != ROK) + { + DU_LOG("\nERROR --> DU_APP : System Task creation for EGTP failed"); return RFAILED; } - ODU_SET_THREAD_AFFINITY(&du_app_stsk, SS_AFFINITY_MODE_EXCL, 15, 0); + ODU_SET_THREAD_AFFINITY(&egtp_stsk, SS_AFFINITY_MODE_EXCL, 17, 0); /* system task for RLC_DL and MAC */ if(ODU_CREATE_TASK(PRIOR0, &rlc_mac_cl_stsk) != ROK) { - DU_LOG("\nDU_APP : System Task creation for RLC DL/MAC failed"); + DU_LOG("\nERROR --> DU_APP : System Task creation for RLC DL/MAC failed"); return RFAILED; } pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - ODU_SET_THREAD_AFFINITY(&rlc_mac_cl_stsk, SS_AFFINITY_MODE_EXCL, 16, 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) { - DU_LOG("\nDU_APP : System Task creation for RLC UL failed"); + 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, 17, 0); + ODU_SET_THREAD_AFFINITY(&rlc_ul_stsk, SS_AFFINITY_MODE_EXCL, 19, 0); /* system task for SCTP receiver thread */ if(ODU_CREATE_TASK(PRIOR0, &sctp_stsk) != ROK) { - DU_LOG("\nDU_APP : System Task creation for SCTP failed"); + DU_LOG("\nERROR --> DU_APP : System Task creation for SCTP failed"); return RFAILED; } - ODU_SET_THREAD_AFFINITY(&sctp_stsk, SS_AFFINITY_MODE_EXCL, 18, 0); + ODU_SET_THREAD_AFFINITY(&sctp_stsk, SS_AFFINITY_MODE_EXCL, 20, 0); /* system task for lower-mac receiver thread */ if(ODU_CREATE_TASK(PRIOR0, &lwr_mac_stsk) != ROK) { - DU_LOG("\nDU_APP : System Task creation for Lower MAC failed"); + 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, 19, 0); + ODU_SET_THREAD_AFFINITY(&lwr_mac_stsk, SS_AFFINITY_MODE_EXCL, 21, 0); /* Create TAPA tasks */ if(duAppInit(du_app_stsk) != ROK) { - DU_LOG("\nDU_APP : DU APP TAPA Task initialization failed"); + DU_LOG("\nERROR --> DU_APP : DU APP TAPA Task initialization failed"); return RFAILED; } - if(egtpInit(du_app_stsk) != ROK) + if(egtpInit(egtp_stsk) != ROK) { - DU_LOG("\nDU_APP : EGTP TAPA Task initialization failed"); + DU_LOG("\nERROR --> DU_APP : EGTP TAPA Task initialization failed"); return RFAILED; } if(sctpInit(sctp_stsk) != ROK) { - DU_LOG("\nDU_APP : SCTP TAPA Task initialization failed"); + DU_LOG("\nERROR --> DU_APP : SCTP TAPA Task initialization failed"); return RFAILED; } if(rlcDlInit(rlc_mac_cl_stsk) != ROK) { - DU_LOG("\nDU_APP : RLC DL Tapa Task initialization failed"); + DU_LOG("\nERROR --> DU_APP : RLC DL Tapa Task initialization failed"); return RFAILED; } if(rlcUlInit(rlc_ul_stsk) != ROK) { - DU_LOG("\nDU_APP : RLC UL Tapa Task initialization failed"); + DU_LOG("\nERROR --> DU_APP : RLC UL Tapa Task initialization failed"); return RFAILED; } if(lwrMacInit(lwr_mac_stsk) != ROK) { - DU_LOG("\nDU_APP : Lower MAC Tapa Task initialization failed"); + DU_LOG("\nERROR --> DU_APP : Lower MAC Tapa Task initialization failed"); return RFAILED; } @@ -396,7 +411,6 @@ uint8_t duInit() { ret = RFAILED; } - return ret; } @@ -404,6 +418,7 @@ void init_log() { openlog("ODU",LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1); } + /******************************************************************* * * @brief Entry point for the DU APP @@ -423,14 +438,18 @@ void init_log() * ****************************************************************/ uint8_t tst(void) { - init_log(); + init_log(); - //Initialize TAPA layers - if(duInit() != ROK) - { +#ifdef O1_ENABLE + if(start_O1_module() != ROK) return RFAILED; - } +#endif + //Initialize TAPA layers + if(duInit() != ROK) + { + return RFAILED; + } //Read all the configs from du_utils.c into duCfgParams duReadCfg();