}
return ROK;
}
+#endif
+
+#ifdef THREAD_AFFINITY
+/*******************************************************************
+ *
+ * @brief Set thread affinity to the core configured via XML file
+ *
+ * @details
+ *
+ * Function : parseThreadAffinity
+ *
+ * Functionality: Set thread affinity to the core configured
+ * via XML file
+ *
+ * @params[in] XML document pointer
+ * XML namespace
+ * Current node in XML
+ * Thread information
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t parseThreadAffinity(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, ThreadInfo *threads)
+{
+ cur = cur -> xmlChildrenNode;
+ while(cur != NULL)
+ {
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"DU_APP_CORE")) && (cur->ns == ns))
+ {
+ threads->duAppCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ ODU_SET_THREAD_AFFINITY(&threads->duAppSTskId, SS_AFFINITY_MODE_EXCL, threads->duAppCoreId, 0);
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"EGTP_CORE")) && (cur->ns == ns))
+ {
+ threads->egtpCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ ODU_SET_THREAD_AFFINITY(&threads->egtpSTskId, SS_AFFINITY_MODE_EXCL, threads->egtpCoreId, 0);
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"RLC_MAC_CORE")) && (cur->ns == ns))
+ {
+ threads->rlcMacCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ ODU_SET_THREAD_AFFINITY(&threads->rlcMacSTskId, SS_AFFINITY_MODE_EXCL, threads->rlcMacCoreId, 0);
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"RLC_UL_CORE")) && (cur->ns == ns))
+ {
+ threads->rlcUlCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ ODU_SET_THREAD_AFFINITY(&threads->rlcUlSTskId, SS_AFFINITY_MODE_EXCL, threads->rlcUlCoreId, 0);
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCH_CORE")) && (cur->ns == ns))
+ {
+ threads->schCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ ODU_SET_THREAD_AFFINITY(&threads->schSTskId, SS_AFFINITY_MODE_EXCL, threads->schCoreId, 0);
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCTP_CORE")) && (cur->ns == ns))
+ {
+ threads->sctpCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ ODU_SET_THREAD_AFFINITY(&threads->sctpSTskId, SS_AFFINITY_MODE_EXCL, threads->sctpCoreId, 0);
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"LOWER_MAC_CORE")) && (cur->ns == ns))
+ {
+ threads->lwrMacCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ ODU_SET_THREAD_AFFINITY(&threads->lwrMacSTskId, SS_AFFINITY_MODE_EXCL, threads->lwrMacCoreId, 0);
+ }
+
+ cur = cur -> next;
+ }
+ return ROK;
+}
+#endif
/*******************************************************************
*
CmInetIpAddr cuIp;
CmInetIpAddr ricIp;
- memset(&duCfgParam, 0, sizeof(struct duCfgParams));
cur = cur->xmlChildrenNode;
while(cur != NULL)
{
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"THREAD_AFFINITY")) && (cur->ns == ns))
+ {
+#ifdef THREAD_AFFINITY
+ if(parseThreadAffinity(doc, ns, cur, &duCfgParam.threadInfo) != ROK)
+ {
+ return RFAILED;
+ }
+#endif
+ }
+
+#ifdef XML_BASED_CONFIG
if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_NUM_DRB")) && (cur->ns == ns))
{
duCfgParam.maxNumDrb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
return RFAILED;
}
}
+#endif
cur = cur -> next;
}
return ROK;
}
-#endif
/*******************************************************************
*
return RFAILED;
}
-#ifdef XML_BASED_CONFIG
parseDuCfgParams(doc, ns, cur);
-#endif
xmlFreeDoc(doc);
xmlCleanupParser();
DU_LOG("\n ** DU CONFIGURATION ** \n");
DU_LOG("DU ID %d\n", duCfgParam.duId);
DU_LOG("DU Name %s\n", duCfgParam.duName);
+
+ DU_LOG("\n ** Thread Affinity ** \n");
+ DU_LOG("DU APP CORE ID %d\n", duCfgParam.threadInfo.duAppCoreId);
+ DU_LOG("EGTP CORE ID %d\n", duCfgParam.threadInfo.egtpCoreId);
+ DU_LOG("SCTP CORE ID %d\n", duCfgParam.threadInfo.sctpCoreId);
+ DU_LOG("RLC-UL CORE ID %d\n", duCfgParam.threadInfo.rlcUlCoreId);
+ DU_LOG("RLC-DL and MAC CORE ID %d\n", duCfgParam.threadInfo.rlcMacCoreId);
+ DU_LOG("SCH CORE ID %d\n", duCfgParam.threadInfo.schCoreId);
+ DU_LOG("Lower MAC CORE ID %d\n", duCfgParam.threadInfo.lwrMacCoreId);
+
DU_LOG("MAX NUM DRB %d\n", duCfgParam.maxNumDrb);
DU_LOG("MAX SUPPORTED UE %d\n", duCfgParam.maxSupportedUes);
DU_LOG("MAX UE %d\n",duCfgParam.maxUe);
uint8_t commonInit()
{
/* Declare system task Ids */
- SSTskId du_app_stsk, egtp_stsk, sctp_stsk, rlc_ul_stsk, rlc_mac_cl_stsk, sch_stsk, lwr_mac_stsk, phy_stub_slot_ind_stsk;
+ SSTskId phyStubSlotIndSTskId;
pthread_attr_t attr;
return RFAILED;
}
-#ifdef INTEL_THREAD_AFFINITY
- ODU_SET_THREAD_AFFINITY(&du_app_stsk, SS_AFFINITY_MODE_EXCL, 16, 0);
-#endif
-
/* system task for EGTP */
if(ODU_CREATE_TASK(PRIOR0, &duCfgParam.threadInfo.egtpSTskId) != ROK)
{
return RFAILED;
}
-#ifdef INTEL_THREAD_AFFINITY
- ODU_SET_THREAD_AFFINITY(&egtp_stsk, SS_AFFINITY_MODE_EXCL, 27, 0);
-#endif
-
/* system task for RLC_DL and MAC */
if(ODU_CREATE_TASK(PRIOR0, &duCfgParam.threadInfo.rlcMacSTskId) != ROK)
{
}
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-#ifdef INTEL_THREAD_AFFINITY
- ODU_SET_THREAD_AFFINITY(&rlc_mac_cl_stsk, SS_AFFINITY_MODE_EXCL, 18, 0);
-#endif
/* system task for RLC UL */
if(ODU_CREATE_TASK(PRIOR1, &duCfgParam.threadInfo.rlcUlSTskId) != ROK)
DU_LOG("\nERROR --> DU_APP : System Task creation for RLC UL failed");
return RFAILED;
}
-#ifdef INTEL_THREAD_AFFINITY
- ODU_SET_THREAD_AFFINITY(&rlc_ul_stsk, SS_AFFINITY_MODE_EXCL, 22, 0);
-#endif
/* system task for SCH */
if(ODU_CREATE_TASK(PRIOR1, &duCfgParam.threadInfo.schSTskId) != ROK)
DU_LOG("\nERROR --> DU_APP : System Task creation for SCH failed");
return RFAILED;
}
-#ifdef INTEL_THREAD_AFFINITY
- ODU_SET_THREAD_AFFINITY(&sch_stsk, SS_AFFINITY_MODE_EXCL, 22, 0);
-#endif
/* system task for SCTP receiver thread */
if(ODU_CREATE_TASK(PRIOR0, &duCfgParam.threadInfo.sctpSTskId) != ROK)
DU_LOG("\nERROR --> DU_APP : System Task creation for SCTP failed");
return RFAILED;
}
-#ifdef INTEL_THREAD_AFFINITY
- ODU_SET_THREAD_AFFINITY(&sctp_stsk, SS_AFFINITY_MODE_EXCL, 25, 0);
-#endif
/* system task for lower-mac receiver thread */
if(ODU_CREATE_TASK(PRIOR0, &duCfgParam.threadInfo.lwrMacSTskId) != ROK)
DU_LOG("\nERROR --> DU_APP : System Task creation for Lower MAC failed");
return RFAILED;
}
-#ifdef INTEL_THREAD_AFFINITY
- ODU_SET_THREAD_AFFINITY(&lwr_mac_stsk, SS_AFFINITY_MODE_EXCL, 21, 0);
-#endif
#ifndef INTEL_WLS_MEM
/* system task for phy stub's slot indication generator thread */
- if(ODU_CREATE_TASK(PRIOR0, &duCfgParam.threadInfo.phyStubSlotIndSTskId) != ROK)
+ if(ODU_CREATE_TASK(PRIOR0, &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;
}
#ifndef INTEL_WLS_MEM
- if(phyStubInit(duCfgParam.threadInfo.phyStubSlotIndSTskId) != ROK)
+ if(phyStubInit(phyStubSlotIndSTskId) != ROK)
{
DU_LOG("\nERROR --> DU_APP : PHY stub slot indication Tapa Task initialization failed");
return RFAILED;