Check type of node using NODE_IS_CU/DU/MONOLITHIC macros

This commit is contained in:
Robert Schmidt
2019-03-26 13:15:02 +01:00
parent f0fced85f2
commit 024007716a
11 changed files with 73 additions and 118 deletions
+20 -30
View File
@@ -64,39 +64,29 @@ int create_tasks(uint32_t enb_nb) {
}
switch (type) {
case ngran_eNB_CU:
case ngran_ng_eNB_CU:
case ngran_gNB_CU:
rc = itti_create_task(TASK_CU_F1, F1AP_CU_task, NULL);
AssertFatal(rc >= 0, "Create task for CU F1AP failed\n");
/* fall through */
case ngran_eNB:
case ngran_ng_eNB:
case ngran_gNB:
if (EPC_MODE_ENABLED) {
rc = itti_create_task(TASK_S1AP, s1ap_eNB_task, NULL);
AssertFatal(rc >= 0, "Create task for S1AP failed\n");
if (!(get_softmodem_params()->emulate_rf)){
rc = itti_create_task(TASK_UDP, udp_eNB_task, NULL);
AssertFatal(rc >= 0, "Create task for UDP failed\n");
}
rc = itti_create_task(TASK_GTPV1_U, gtpv1u_eNB_task, NULL);
AssertFatal(rc >= 0, "Create task for GTPV1U failed\n");
if (is_x2ap_enabled()) {
rc = itti_create_task(TASK_X2AP, x2ap_task, NULL);
AssertFatal(rc >= 0, "Create task for X2AP failed\n");
} else {
LOG_I(X2AP, "X2AP is disabled.\n");
}
if (EPC_MODE_ENABLED && !NODE_IS_DU(type)) {
rc = itti_create_task(TASK_S1AP, s1ap_eNB_task, NULL);
AssertFatal(rc >= 0, "Create task for S1AP failed\n");
if (!(get_softmodem_params()->emulate_rf)){
rc = itti_create_task(TASK_UDP, udp_eNB_task, NULL);
AssertFatal(rc >= 0, "Create task for UDP failed\n");
}
rc = itti_create_task(TASK_GTPV1_U, gtpv1u_eNB_task, NULL);
AssertFatal(rc >= 0, "Create task for GTPV1U failed\n");
if (is_x2ap_enabled()) {
rc = itti_create_task(TASK_X2AP, x2ap_task, NULL);
AssertFatal(rc >= 0, "Create task for X2AP failed\n");
} else {
LOG_I(X2AP, "X2AP is disabled.\n");
}
break;
default:
/* intentionally left blank */
break;
}
if (type == ngran_eNB_DU || type == ngran_gNB_DU) {
if (NODE_IS_CU(type)) {
rc = itti_create_task(TASK_CU_F1, F1AP_CU_task, NULL);
AssertFatal(rc >= 0, "Create task for CU F1AP failed\n");
}
if (NODE_IS_DU(type)) {
rc = itti_create_task(TASK_DU_F1, F1AP_DU_task, NULL);
AssertFatal(rc >= 0, "Create task for DU F1AP failed\n");
}
+3 -6
View File
@@ -688,8 +688,7 @@ int main( int argc, char **argv ) {
RCconfig_L1();
}
if (RC.nb_inst > 0
&& (RC.rrc[0]->node_type == ngran_eNB_CU || RC.rrc[0]->node_type == ngran_ng_eNB_CU)) {
if (RC.nb_inst > 0 && NODE_IS_CU(RC.rrc[0]->node_type)) {
protocol_ctxt_t ctxt;
ctxt.module_id = 0 ;
ctxt.instance = 0;
@@ -699,8 +698,7 @@ int main( int argc, char **argv ) {
}
/* start threads if only L1 or not a CU */
if (RC.nb_inst == 0 ||
!(RC.rrc[0]->node_type == ngran_eNB_CU || RC.rrc[0]->node_type == ngran_ng_eNB_CU)) {
if (RC.nb_inst == 0 || !NODE_IS_CU(RC.rrc[0]->node_type)) {
// init UE_PF_PO and mutex lock
pthread_mutex_init(&ue_pf_po_mutex, NULL);
memset (&UE_PF_PO[0][0], 0, sizeof(UE_PF_PO_t)*MAX_MOBILES_PER_ENB*MAX_NUM_CCs);
@@ -851,8 +849,7 @@ int main( int argc, char **argv ) {
// stop threads
if (RC.nb_inst == 0 ||
!(RC.rrc[0]->node_type == ngran_eNB_CU || RC.rrc[0]->node_type == ngran_ng_eNB_CU)) {
if (RC.nb_inst == 0 || !NODE_IS_CU(RC.rrc[0]->node_type)) {
int UE_id;
#ifdef XFORMS
printf("waiting for XFORMS thread\n");