From 9bfd39713f94e019675b4a255855177462b39bbd Mon Sep 17 00:00:00 2001 From: "lal.harshita" Date: Wed, 14 Feb 2024 14:55:53 +0530 Subject: [PATCH] [Epic-ID: ODUHIGH-538] Compilation fix Change-Id: I5549082bdf1d6a06df203bf326c7bb08cf8c3a44 Signed-off-by: lal.harshita --- Dockerfile | 2 +- Dockerfile-cu-stub | 2 +- build/common/du_app.mak | 4 +--- build/config/odu_config.xml | 11 ++++++++++- build/odu/makefile | 7 ++----- src/du_app/du_cfg.c | 10 +++------- src/du_app/du_cfg.h | 13 +++++++++++++ src/du_app/du_mgr_main.c | 35 +++++++++++++++++++---------------- 8 files changed, 50 insertions(+), 34 deletions(-) diff --git a/Dockerfile b/Dockerfile index 84b83831c..76b6fc59d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ FROM nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-ubuntu18-c-go:1.9.0 ADD . /opt/o-du-l2 WORKDIR /opt/o-du-l2 -RUN apt-get update && apt-get install -y libpcap-dev +RUN apt-get update && apt-get install -y libpcap-dev && apt-get install -y libxml2-dev RUN cd build/odu && make clean_odu odu MACHINE=BIT64 MODE=FDD diff --git a/Dockerfile-cu-stub b/Dockerfile-cu-stub index e1efcd59d..1512680cb 100644 --- a/Dockerfile-cu-stub +++ b/Dockerfile-cu-stub @@ -3,7 +3,7 @@ FROM nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-ubuntu18-c-go:1.9.0 ADD . /opt/o-du-l2 WORKDIR /opt/o-du-l2 -RUN apt-get update && apt-get install -y libpcap-dev +RUN apt-get update && apt-get install -y libpcap-dev && apt-get install -y libxml2-dev RUN cd build/odu && make clean_cu cu_stub NODE=TEST_STUB MACHINE=BIT64 MODE=FDD diff --git a/build/common/du_app.mak b/build/common/du_app.mak index ad1541712..2be0cc6da 100644 --- a/build/common/du_app.mak +++ b/build/common/du_app.mak @@ -35,15 +35,13 @@ HDR_FILES+=$(wildcard $(CM_DIR)/lrg*.[hx]) lib: $(LIB_DIR)/libduapp.a include $(COM_BUILD_DIR)/compile.mak -ifdef XML_BASED_CONFIG -I_OPTS+=-I/usr/include/libxml2 -endif I_OPTS+=-I$(ROOT_DIR)/src/mt I_OPTS+=-I$(ROOT_DIR)/src/codec_utils/common I_OPTS+=-I$(ROOT_DIR)/src/codec_utils/F1AP I_OPTS+=-I$(ROOT_DIR)/src/codec_utils/RRC I_OPTS+=-I$(ROOT_DIR)/src/codec_utils/E2AP I_OPTS+=-I$(ROOT_DIR)/src/codec_utils/E2SM_KPM +I_OPTS+=-I/usr/include/libxml2 ifeq ($(O1_ENABLE),YES) I_OPTS+=-I$(ROOT_DIR)/src/o1 diff --git a/build/config/odu_config.xml b/build/config/odu_config.xml index 97f7b9d38..255fb64a7 100644 --- a/build/config/odu_config.xml +++ b/build/config/odu_config.xml @@ -1,6 +1,15 @@ - + + + 16 + 27 + 18 + 22 + 22 + 25 + 21 + 1 ORAN OAM DU 29 diff --git a/build/odu/makefile b/build/odu/makefile index 39fcf83bb..a1f4ffd30 100644 --- a/build/odu/makefile +++ b/build/odu/makefile @@ -74,7 +74,7 @@ endif # macro for output file name and makefile name # -PLTFRM_FLAGS= -UMSPD -DODU -DINTEL_FAPI -UODU_MEMORY_DEBUG_LOG -DDEBUG_ASN_PRINT -UDEBUG_PRINT -DERROR_PRINT -USTART_DL_UL_DATA -UNR_DRX -UCALL_FLOW_DEBUG_LOG -UODU_SLOT_IND_DEBUG_LOG +PLTFRM_FLAGS=-UMSPD -DODU -DINTEL_FAPI -UODU_MEMORY_DEBUG_LOG -DDEBUG_ASN_PRINT -UDEBUG_PRINT -DERROR_PRINT -USTART_DL_UL_DATA -UNR_DRX -UCALL_FLOW_DEBUG_LOG -UODU_SLOT_IND_DEBUG_LOG ifeq ($(MODE),TDD) PLTFRM_FLAGS += -DNR_TDD @@ -109,10 +109,7 @@ export BUILD export I_OPTS # Add to the linker options the platform specific components -L_OPTS+=-lnsl -lrt -lm -lpthread -lsctp -ifdef XML_BASED_CONFIG -L_OPTS+=-lxml2 -endif +L_OPTS+=-lnsl -lrt -lm -lpthread -lsctp -lxml2 ifeq ($(PHY), INTEL_L1) L_OPTS+=-L/root/Intel-L1-20.11.1/phy/wls_lib/ -lwls \ diff --git a/src/du_app/du_cfg.c b/src/du_app/du_cfg.c index eccec228b..e808132dd 100644 --- a/src/du_app/du_cfg.c +++ b/src/du_app/du_cfg.c @@ -19,12 +19,10 @@ /* This file contains all utility functions */ #include "common_def.h" -#ifdef XML_BASED_CONFIG #include #include #include #include -#endif #include "du_tmr.h" #include "legtp.h" @@ -5475,7 +5473,6 @@ uint8_t parseDuCfgParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) * ****************************************************************/ uint8_t duReadCfg() { -#ifdef XML_BASED_CONFIG const char *filename = "../build/config/odu_config.xml"; xmlDocPtr doc = NULLP; xmlNodePtr cur = NULLP; @@ -5489,7 +5486,7 @@ uint8_t duReadCfg() } cur = xmlDocGetRootElement(doc); - ns = xmlSearchNsByHref(doc, cur, (const xmlChar *)"odu_config.xml"); + ns = xmlSearchNsByHref(doc, cur, (const xmlChar *)"urn:o-ran:odu:configuration"); if(ns == NULL) { DU_LOG("\nERROR --> DU_APP: XML Namespace not found.\n"); @@ -5498,17 +5495,16 @@ uint8_t duReadCfg() return RFAILED; } +#ifdef XML_BASED_CONFIG parseDuCfgParams(doc, ns, cur); +#endif xmlFreeDoc(doc); xmlCleanupParser(); -#endif Pst pst; Buffer *mBuf; - memset(&duCfgParam, 0, sizeof(DuCfgParams)); - /* Read configs into duCfgParams */ if(readCfg() != ROK) { diff --git a/src/du_app/du_cfg.h b/src/du_app/du_cfg.h index aacb3e834..14007fdfb 100644 --- a/src/du_app/du_cfg.h +++ b/src/du_app/du_cfg.h @@ -1247,6 +1247,18 @@ typedef struct sib1Params SrvCellCfgCommSib srvCellCfgCommSib; }Sib1Params; +typedef struct threadInfo +{ + SSTskId duAppSTskId; + SSTskId egtpSTskId; + SSTskId sctpSTskId; + SSTskId rlcUlSTskId; + SSTskId rlcMacSTskId; + SSTskId schSTskId; + SSTskId lwrMacSTskId; + SSTskId phyStubSlotIndSTskId; +}ThreadInfo; + typedef struct duCfgParams { uint32_t duId; @@ -1254,6 +1266,7 @@ typedef struct duCfgParams uint16_t maxNumDrb; uint16_t maxSupportedUes; uint32_t maxUe; + ThreadInfo threadInfo; SctpParams sctpParams; /* SCTP Params */ F1EgtpParams egtpParams; /* EGTP Params */ SchedulerCfg schedCfg; diff --git a/src/du_app/du_mgr_main.c b/src/du_app/du_mgr_main.c index d17d93d3d..724d21b36 100644 --- a/src/du_app/du_mgr_main.c +++ b/src/du_app/du_mgr_main.c @@ -581,7 +581,7 @@ uint8_t commonInit() /* 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) + if(ODU_CREATE_TASK(PRIOR0, &duCfgParam.threadInfo.duAppSTskId) != ROK) { DU_LOG("\nERROR --> DU_APP : System Task creation for DU APP failed"); return RFAILED; @@ -592,7 +592,7 @@ uint8_t commonInit() #endif /* system task for EGTP */ - if(ODU_CREATE_TASK(PRIOR0, &egtp_stsk) != ROK) + if(ODU_CREATE_TASK(PRIOR0, &duCfgParam.threadInfo.egtpSTskId) != ROK) { DU_LOG("\nERROR --> DU_APP : System Task creation for EGTP failed"); return RFAILED; @@ -603,7 +603,7 @@ uint8_t commonInit() #endif /* system task for RLC_DL and MAC */ - if(ODU_CREATE_TASK(PRIOR0, &rlc_mac_cl_stsk) != ROK) + if(ODU_CREATE_TASK(PRIOR0, &duCfgParam.threadInfo.rlcMacSTskId) != ROK) { DU_LOG("\nERROR --> DU_APP : System Task creation for RLC DL/MAC failed"); return RFAILED; @@ -615,7 +615,7 @@ uint8_t commonInit() #endif /* system task for RLC UL */ - if(ODU_CREATE_TASK(PRIOR1, &rlc_ul_stsk) != ROK) + if(ODU_CREATE_TASK(PRIOR1, &duCfgParam.threadInfo.rlcUlSTskId) != ROK) { DU_LOG("\nERROR --> DU_APP : System Task creation for RLC UL failed"); return RFAILED; @@ -625,7 +625,7 @@ uint8_t commonInit() #endif /* system task for SCH */ - if(ODU_CREATE_TASK(PRIOR1, &sch_stsk) != ROK) + if(ODU_CREATE_TASK(PRIOR1, &duCfgParam.threadInfo.schSTskId) != ROK) { DU_LOG("\nERROR --> DU_APP : System Task creation for SCH failed"); return RFAILED; @@ -635,7 +635,7 @@ uint8_t commonInit() #endif /* system task for SCTP receiver thread */ - if(ODU_CREATE_TASK(PRIOR0, &sctp_stsk) != ROK) + if(ODU_CREATE_TASK(PRIOR0, &duCfgParam.threadInfo.sctpSTskId) != ROK) { DU_LOG("\nERROR --> DU_APP : System Task creation for SCTP failed"); return RFAILED; @@ -645,7 +645,7 @@ uint8_t commonInit() #endif /* system task for lower-mac receiver thread */ - if(ODU_CREATE_TASK(PRIOR0, &lwr_mac_stsk) != ROK) + if(ODU_CREATE_TASK(PRIOR0, &duCfgParam.threadInfo.lwrMacSTskId) != ROK) { DU_LOG("\nERROR --> DU_APP : System Task creation for Lower MAC failed"); return RFAILED; @@ -656,7 +656,7 @@ uint8_t commonInit() #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) + if(ODU_CREATE_TASK(PRIOR0, &duCfgParam.threadInfo.phyStubSlotIndSTskId) != ROK) { DU_LOG("\nERROR --> DU_APP : System Task creation for Phy stub slot indication generator failed. MAX STSK [%d]", SS_MAX_STSKS); return RFAILED; @@ -665,50 +665,50 @@ uint8_t commonInit() #endif /* Create TAPA tasks */ - if(duAppInit(du_app_stsk) != ROK) + if(duAppInit(duCfgParam.threadInfo.duAppSTskId) != ROK) { DU_LOG("\nERROR --> DU_APP : DU APP TAPA Task initialization failed"); return RFAILED; } - if(egtpInit(egtp_stsk) != ROK) + if(egtpInit(duCfgParam.threadInfo.egtpSTskId) != ROK) { DU_LOG("\nERROR --> DU_APP : EGTP TAPA Task initialization failed"); return RFAILED; } - if(sctpInit(sctp_stsk) != ROK) + if(sctpInit(duCfgParam.threadInfo.sctpSTskId) != ROK) { DU_LOG("\nERROR --> DU_APP : SCTP TAPA Task initialization failed"); return RFAILED; } - if(rlcDlInit(rlc_mac_cl_stsk) != ROK) + if(rlcDlInit(duCfgParam.threadInfo.rlcMacSTskId) != ROK) { DU_LOG("\nERROR --> DU_APP : RLC DL Tapa Task initialization failed"); return RFAILED; } - if(rlcUlInit(rlc_ul_stsk) != ROK) + if(rlcUlInit(duCfgParam.threadInfo.rlcUlSTskId) != ROK) { DU_LOG("\nERROR --> DU_APP : RLC UL Tapa Task initialization failed"); return RFAILED; } - if(schInit(sch_stsk) != ROK) + if(schInit(duCfgParam.threadInfo.schSTskId) != ROK) { DU_LOG("\nERROR --> DU_APP : SCH Tapa Task initialization failed"); return RFAILED; } - if(lwrMacInit(lwr_mac_stsk) != ROK) + if(lwrMacInit(duCfgParam.threadInfo.lwrMacSTskId) != ROK) { DU_LOG("\nERROR --> DU_APP : Lower MAC Tapa Task initialization failed"); return RFAILED; } #ifndef INTEL_WLS_MEM - if(phyStubInit(phy_stub_slot_ind_stsk) != ROK) + if(phyStubInit(duCfgParam.threadInfo.phyStubSlotIndSTskId) != ROK) { DU_LOG("\nERROR --> DU_APP : PHY stub slot indication Tapa Task initialization failed"); return RFAILED; @@ -775,6 +775,9 @@ uint8_t tst(void) if(start_O1_module() != ROK) return RFAILED; #endif + + memset(&duCfgParam, 0, sizeof(DuCfgParams)); + //Initialize TAPA layers if(duInit() != ROK) { -- 2.16.6