Merge branch 'develop' into feature-127-protocol-split
This commit is contained in:
@@ -19,7 +19,6 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
# include "intertask_interface.h"
|
||||
# include "create_tasks.h"
|
||||
# include "common/utils/LOG/log.h"
|
||||
@@ -27,21 +26,11 @@
|
||||
# include "common/ran_context.h"
|
||||
|
||||
#ifdef OPENAIR2
|
||||
#if defined(ENABLE_USE_MME)
|
||||
#include "sctp_eNB_task.h"
|
||||
#include "x2ap_eNB.h"
|
||||
#include "s1ap_eNB.h"
|
||||
#include "nas_ue_task.h"
|
||||
#include "udp_eNB_task.h"
|
||||
#include "gtpv1u_eNB_task.h"
|
||||
/* temporary warning removale while implementing noS1 */
|
||||
/* as config option */
|
||||
#else
|
||||
#ifdef EPC_MODE_ENABLED
|
||||
#undef EPC_MODE_ENABLED
|
||||
#endif
|
||||
#define EPC_MODE_ENABLED 0
|
||||
#endif
|
||||
#if ENABLE_RAL
|
||||
#include "lteRALue.h"
|
||||
#include "lteRALenb.h"
|
||||
@@ -58,32 +47,20 @@ int create_tasks(uint32_t enb_nb) {
|
||||
LOG_D(ENB_APP, "%s(enb_nb:%d\n", __FUNCTION__, enb_nb);
|
||||
ngran_node_t type = RC.rrc[0]->node_type;
|
||||
int rc;
|
||||
itti_wait_ready(1);
|
||||
|
||||
if (enb_nb > 0) {
|
||||
LOG_I(ENB_APP, "Creating ENB_APP eNB Task\n");
|
||||
if (itti_create_task (TASK_ENB_APP, eNB_app_task, NULL) < 0) {
|
||||
LOG_E(ENB_APP, "Create task for eNB APP failed\n");
|
||||
return -1;
|
||||
}
|
||||
LOG_I(RRC,"Creating RRC eNB Task\n");
|
||||
if (itti_create_task (TASK_RRC_ENB, rrc_enb_task, NULL) < 0) {
|
||||
LOG_E(RRC, "Create task for RRC eNB failed\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (enb_nb == 0) return 0;
|
||||
|
||||
if (EPC_MODE_ENABLED && enb_nb > 0) {
|
||||
/* this task needs not be started if:
|
||||
* * there is no CU/DU split
|
||||
* * ENABLE_USE_MME is not defined
|
||||
* Since we cannot express this condition on both configuration and
|
||||
* compilation defines, we always start this task.
|
||||
*/
|
||||
if (itti_create_task(TASK_SCTP, sctp_eNB_task, NULL) < 0) {
|
||||
LOG_E(SCTP, "Create task for SCTP failed\n");
|
||||
return -1;
|
||||
}
|
||||
LOG_I(ENB_APP, "Creating ENB_APP eNB Task\n");
|
||||
rc = itti_create_task (TASK_ENB_APP, eNB_app_task, NULL);
|
||||
AssertFatal(rc >= 0, "Create task for eNB APP failed\n");
|
||||
|
||||
LOG_I(RRC,"Creating RRC eNB Task\n");
|
||||
rc = itti_create_task (TASK_RRC_ENB, rrc_enb_task, NULL);
|
||||
AssertFatal(rc >= 0, "Create task for RRC eNB failed\n");
|
||||
|
||||
if (EPC_MODE_ENABLED) {
|
||||
rc = itti_create_task(TASK_SCTP, sctp_eNB_task, NULL);
|
||||
AssertFatal(rc >= 0, "Create task for SCTP failed\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -91,16 +68,13 @@ int create_tasks(uint32_t enb_nb) {
|
||||
case ngran_eNB_CU:
|
||||
case ngran_ng_eNB_CU:
|
||||
case ngran_gNB_CU:
|
||||
if (enb_nb > 0) {
|
||||
rc = itti_create_task(TASK_CU_F1, F1AP_CU_task, NULL);
|
||||
AssertFatal(rc >= 0, "Create task for CU F1AP failed\n");
|
||||
}
|
||||
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 defined(ENABLE_USE_MME)
|
||||
if (EPC_MODE_ENABLED && enb_nb > 0) {
|
||||
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)){
|
||||
@@ -112,19 +86,16 @@ int create_tasks(uint32_t enb_nb) {
|
||||
rc = itti_create_task(TASK_X2AP, x2ap_task, NULL);
|
||||
AssertFatal(rc >= 0, "Create task for X2AP failed\n");
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
/* intentionally left blank */
|
||||
break;
|
||||
}
|
||||
|
||||
if ((type == ngran_eNB_DU || type == ngran_gNB_DU) && (enb_nb > 0)) {
|
||||
if (type == ngran_eNB_DU || type == ngran_gNB_DU) {
|
||||
rc = itti_create_task(TASK_DU_F1, F1AP_DU_task, NULL);
|
||||
AssertFatal(rc >= 0, "Create task for DU F1AP failed\n");
|
||||
}
|
||||
|
||||
itti_wait_ready(0);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -19,19 +19,16 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
# include "intertask_interface.h"
|
||||
# include "create_tasks.h"
|
||||
# include "common/utils/LOG/log.h"
|
||||
|
||||
#ifdef OPENAIR2
|
||||
#if defined(ENABLE_USE_MME)
|
||||
#include "sctp_eNB_task.h"
|
||||
#include "s1ap_eNB.h"
|
||||
#include "nas_ue_task.h"
|
||||
#include "udp_eNB_task.h"
|
||||
#include "gtpv1u_eNB_task.h"
|
||||
#endif
|
||||
#include "sctp_eNB_task.h"
|
||||
#include "s1ap_eNB.h"
|
||||
#include "openair3/NAS/UE/nas_ue_task.h"
|
||||
#include "udp_eNB_task.h"
|
||||
#include "gtpv1u_eNB_task.h"
|
||||
#if ENABLE_RAL
|
||||
#include "lteRALue.h"
|
||||
#include "lteRALenb.h"
|
||||
@@ -43,24 +40,25 @@
|
||||
int create_tasks_ue(uint32_t ue_nb) {
|
||||
LOG_D(ENB_APP, "%s(ue_nb:%d)\n", __FUNCTION__, ue_nb);
|
||||
itti_wait_ready(1);
|
||||
# if defined(ENABLE_USE_MME)
|
||||
|
||||
if (EPC_MODE_ENABLED) {
|
||||
# if defined(NAS_BUILT_IN_UE)
|
||||
|
||||
if (ue_nb > 0) {
|
||||
nas_user_container_t *users = calloc(1, sizeof(*users));
|
||||
if (ue_nb > 0) {
|
||||
nas_user_container_t *users = calloc(1, sizeof(*users));
|
||||
|
||||
if (users == NULL) abort();
|
||||
if (users == NULL) abort();
|
||||
|
||||
users->count = ue_nb;
|
||||
users->count = ue_nb;
|
||||
|
||||
if (itti_create_task (TASK_NAS_UE, nas_ue_task, users) < 0) {
|
||||
LOG_E(NAS, "Create task for NAS UE failed\n");
|
||||
return -1;
|
||||
if (itti_create_task (TASK_NAS_UE, nas_ue_task, users) < 0) {
|
||||
LOG_E(NAS, "Create task for NAS UE failed\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# endif
|
||||
# endif
|
||||
} /* EPC_MODE_ENABLED */
|
||||
|
||||
if (ue_nb > 0) {
|
||||
if (itti_create_task (TASK_RRC_UE, rrc_ue_task, NULL) < 0) {
|
||||
@@ -72,4 +70,4 @@ int create_tasks_ue(uint32_t ue_nb) {
|
||||
itti_wait_ready(0);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -45,7 +45,6 @@ ifeq ($(OPENSSL_FOUND), 0)
|
||||
@(warning "openssl library is not installed on your system, openssl lib needed, continuing with security disabled")
|
||||
SECU=0
|
||||
else
|
||||
CFLAGS += -DENABLE_SECURITY
|
||||
LIBS += $(OPENSSL_LIBS) $(NETTLE_LIBS)
|
||||
endif
|
||||
endif
|
||||
|
||||
+67
-106
@@ -80,14 +80,8 @@
|
||||
#include "UTIL/OTG/otg_extern.h"
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
#if defined(ENABLE_USE_MME)
|
||||
#include "s1ap_eNB.h"
|
||||
#ifdef PDCP_USE_NETLINK
|
||||
#include "SIMULATION/ETH_TRANSPORT/proto.h"
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#include "s1ap_eNB.h"
|
||||
#include "SIMULATION/ETH_TRANSPORT/proto.h"
|
||||
|
||||
#include "T.h"
|
||||
|
||||
@@ -104,11 +98,6 @@ struct timing_info_t {
|
||||
// Fix per CC openair rf/if device update
|
||||
// extern openair0_device openair0;
|
||||
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
extern volatile int start_eNB;
|
||||
extern volatile int start_UE;
|
||||
#endif
|
||||
extern volatile int oai_exit;
|
||||
|
||||
extern int transmission_mode;
|
||||
@@ -161,16 +150,16 @@ extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset);
|
||||
static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name) {
|
||||
start_meas(&softmodem_stats_rxtx_sf);
|
||||
//L1_rxtx_proc_t *L1_proc_tx = &eNB->proc.L1_proc_tx;
|
||||
|
||||
// *******************************************************************
|
||||
|
||||
#if defined(PRE_SCD_THREAD)
|
||||
RU_t *ru = RC.ru[0];
|
||||
RU_t *ru = RC.ru[0];
|
||||
#endif
|
||||
|
||||
if (eNB ==NULL) {
|
||||
LOG_D(PHY,"%s:%d: rxtx invalid argument, eNB pointer is NULL",__FILE__,__LINE__);
|
||||
return -1;
|
||||
LOG_D(PHY,"%s:%d: rxtx invalid argument, eNB pointer is NULL",__FILE__,__LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (nfapi_mode == 1) {
|
||||
// I am a PNF and I need to let nFAPI know that we have a (sub)frame tick
|
||||
uint16_t frame = proc->frame_rx;
|
||||
@@ -224,42 +213,41 @@ static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER, 1 );
|
||||
|
||||
#if defined(PRE_SCD_THREAD)
|
||||
if (nfapi_mode == 2){
|
||||
new_dlsch_ue_select_tbl_in_use = dlsch_ue_select_tbl_in_use;
|
||||
dlsch_ue_select_tbl_in_use = !dlsch_ue_select_tbl_in_use;
|
||||
|
||||
// L2-emulator can work only one eNB.
|
||||
// memcpy(&pre_scd_eNB_UE_stats,&RC.mac[ru->eNB_list[0]->Mod_id]->UE_list.eNB_UE_stats, sizeof(eNB_UE_STATS)*MAX_NUM_CCs*NUMBER_OF_UE_MAX);
|
||||
// memcpy(&pre_scd_activeUE, &RC.mac[ru->eNB_list[0]->Mod_id]->UE_list.active, sizeof(boolean_t)*NUMBER_OF_UE_MAX);
|
||||
memcpy(&pre_scd_eNB_UE_stats,&RC.mac[0]->UE_list.eNB_UE_stats, sizeof(eNB_UE_STATS)*MAX_NUM_CCs*NUMBER_OF_UE_MAX);
|
||||
memcpy(&pre_scd_activeUE, &RC.mac[0]->UE_list.active, sizeof(boolean_t)*NUMBER_OF_UE_MAX);
|
||||
if (nfapi_mode == 2) {
|
||||
new_dlsch_ue_select_tbl_in_use = dlsch_ue_select_tbl_in_use;
|
||||
dlsch_ue_select_tbl_in_use = !dlsch_ue_select_tbl_in_use;
|
||||
// L2-emulator can work only one eNB.
|
||||
// memcpy(&pre_scd_eNB_UE_stats,&RC.mac[ru->eNB_list[0]->Mod_id]->UE_list.eNB_UE_stats, sizeof(eNB_UE_STATS)*MAX_NUM_CCs*NUMBER_OF_UE_MAX);
|
||||
// memcpy(&pre_scd_activeUE, &RC.mac[ru->eNB_list[0]->Mod_id]->UE_list.active, sizeof(boolean_t)*NUMBER_OF_UE_MAX);
|
||||
memcpy(&pre_scd_eNB_UE_stats,&RC.mac[0]->UE_list.eNB_UE_stats, sizeof(eNB_UE_STATS)*MAX_NUM_CCs*NUMBER_OF_UE_MAX);
|
||||
memcpy(&pre_scd_activeUE, &RC.mac[0]->UE_list.active, sizeof(boolean_t)*NUMBER_OF_UE_MAX);
|
||||
|
||||
if (pthread_mutex_lock(&ru->proc.mutex_pre_scd)!= 0) {
|
||||
LOG_E( PHY, "[eNB] error locking proc mutex for eNB pre scd\n");
|
||||
exit_fun("error locking mutex_time");
|
||||
}
|
||||
|
||||
ru->proc.instance_pre_scd++;
|
||||
|
||||
if (ru->proc.instance_pre_scd == 0) {
|
||||
if (pthread_cond_signal(&ru->proc.cond_pre_scd) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB pre scd\n" );
|
||||
exit_fun( "ERROR pthread_cond_signal cond_pre_scd" );
|
||||
}
|
||||
}else{
|
||||
LOG_E( PHY, "[eNB] frame %d subframe %d rxtx busy instance_pre_scd %d\n",
|
||||
proc->frame_rx,proc->subframe_rx,ru->proc.instance_pre_scd );
|
||||
}
|
||||
|
||||
if (pthread_mutex_unlock(&ru->proc.mutex_pre_scd)!= 0) {
|
||||
LOG_E( PHY, "[eNB] error unlocking mutex_pre_scd mutex for eNB pre scd\n");
|
||||
exit_fun("error unlocking mutex_pre_scd");
|
||||
}
|
||||
if (pthread_mutex_lock(&ru->proc.mutex_pre_scd)!= 0) {
|
||||
LOG_E( PHY, "[eNB] error locking proc mutex for eNB pre scd\n");
|
||||
exit_fun("error locking mutex_time");
|
||||
}
|
||||
#endif
|
||||
|
||||
ru->proc.instance_pre_scd++;
|
||||
|
||||
if (ru->proc.instance_pre_scd == 0) {
|
||||
if (pthread_cond_signal(&ru->proc.cond_pre_scd) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB pre scd\n" );
|
||||
exit_fun( "ERROR pthread_cond_signal cond_pre_scd" );
|
||||
}
|
||||
} else {
|
||||
LOG_E( PHY, "[eNB] frame %d subframe %d rxtx busy instance_pre_scd %d\n",
|
||||
proc->frame_rx,proc->subframe_rx,ru->proc.instance_pre_scd );
|
||||
}
|
||||
|
||||
if (pthread_mutex_unlock(&ru->proc.mutex_pre_scd)!= 0) {
|
||||
LOG_E( PHY, "[eNB] error unlocking mutex_pre_scd mutex for eNB pre scd\n");
|
||||
exit_fun("error unlocking mutex_pre_scd");
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
pthread_mutex_lock(&eNB->UL_INFO_mutex);
|
||||
eNB->UL_INFO.frame = proc->frame_rx;
|
||||
eNB->UL_INFO.subframe = proc->subframe_rx;
|
||||
@@ -324,9 +312,8 @@ static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name
|
||||
}
|
||||
|
||||
|
||||
static void* L1_thread_tx(void* param) {
|
||||
|
||||
L1_proc_t *eNB_proc = (L1_proc_t*)param;
|
||||
static void *L1_thread_tx(void *param) {
|
||||
L1_proc_t *eNB_proc = (L1_proc_t *)param;
|
||||
L1_rxtx_proc_t *proc = &eNB_proc->L1_proc_tx;
|
||||
PHY_VARS_eNB *eNB = RC.eNB[0][proc->CC_id];
|
||||
char thread_name[100];
|
||||
@@ -337,6 +324,7 @@ static void* L1_thread_tx(void* param) {
|
||||
|
||||
while (!oai_exit) {
|
||||
if (wait_on_condition(&proc->mutex,&proc->cond,&proc->instance_cnt,thread_name)<0) break;
|
||||
|
||||
if (oai_exit) break;
|
||||
|
||||
// *****************************************
|
||||
@@ -349,8 +337,6 @@ static void* L1_thread_tx(void* param) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX1_ENB,proc->frame_tx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX1_ENB,proc->frame_rx);
|
||||
phy_procedures_eNB_TX(eNB, proc, 1);
|
||||
|
||||
|
||||
pthread_mutex_lock( &proc->mutex );
|
||||
proc->instance_cnt = -1;
|
||||
|
||||
@@ -359,6 +345,7 @@ static void* L1_thread_tx(void* param) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
}
|
||||
|
||||
pthread_mutex_unlock( &proc->mutex );
|
||||
wakeup_txfh(proc,eNB);
|
||||
}
|
||||
@@ -372,29 +359,25 @@ static void* L1_thread_tx(void* param) {
|
||||
* \returns a pointer to an int. The storage is not on the heap and must not be freed.
|
||||
*/
|
||||
|
||||
static void* L1_thread( void* param ) {
|
||||
|
||||
static void *L1_thread( void *param ) {
|
||||
static int eNB_thread_rxtx_status;
|
||||
//L1_proc_t *eNB_proc = (L1_proc_t*)param;
|
||||
L1_rxtx_proc_t *proc;
|
||||
|
||||
// Working
|
||||
if(nfapi_mode ==2){
|
||||
proc = (L1_rxtx_proc_t*)param;
|
||||
}
|
||||
else{
|
||||
L1_proc_t *eNB_proc = (L1_proc_t*)param;
|
||||
if(nfapi_mode ==2) {
|
||||
proc = (L1_rxtx_proc_t *)param;
|
||||
} else {
|
||||
L1_proc_t *eNB_proc = (L1_proc_t *)param;
|
||||
proc = &eNB_proc->L1_proc;
|
||||
}
|
||||
|
||||
PHY_VARS_eNB *eNB = RC.eNB[0][proc->CC_id];
|
||||
|
||||
char thread_name[100];
|
||||
cpu_set_t cpuset;
|
||||
CPU_ZERO(&cpuset);
|
||||
// set default return value
|
||||
eNB_thread_rxtx_status = 0;
|
||||
|
||||
sprintf(thread_name,"RXn_TXnp4_%d\n",&eNB->proc.L1_proc == proc ? 0 : 1);
|
||||
thread_top_init(thread_name,1,470000,500000,500000);
|
||||
pthread_setname_np( pthread_self(),"rxtx processing");
|
||||
@@ -420,8 +403,10 @@ static void* L1_thread( void* param ) {
|
||||
}
|
||||
|
||||
if(get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT) phy_procedures_eNB_TX(eNB, proc, 1);
|
||||
|
||||
if (release_thread(&proc->mutex,&proc->instance_cnt,thread_name)<0) break;
|
||||
if (nfapi_mode!=2){
|
||||
|
||||
if (nfapi_mode!=2) {
|
||||
if(get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) wakeup_tx(eNB);
|
||||
else if(get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT) wakeup_txfh(proc,eNB);
|
||||
}
|
||||
@@ -433,8 +418,7 @@ static void* L1_thread( void* param ) {
|
||||
return &eNB_thread_rxtx_status;
|
||||
}
|
||||
|
||||
void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t *ru)
|
||||
{
|
||||
void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t *ru) {
|
||||
L1_proc_t *proc = &eNB->proc;
|
||||
L1_rxtx_proc_t *L1_proc = &proc->L1_proc;
|
||||
LTE_DL_FRAME_PARMS *fp = &ru->frame_parms;
|
||||
@@ -444,7 +428,6 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t
|
||||
|
||||
if (!oai_exit) {
|
||||
T(T_ENB_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx), T_INT(proc->subframe_rx));
|
||||
|
||||
L1_proc->timestamp_tx = ru_proc->timestamp_rx + (sf_ahead*fp->samples_per_tti);
|
||||
L1_proc->frame_rx = ru_proc->frame_rx;
|
||||
L1_proc->subframe_rx = ru_proc->subframe_rx;
|
||||
@@ -452,6 +435,7 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t
|
||||
L1_proc->subframe_tx = (L1_proc->subframe_rx + sf_ahead)%10;
|
||||
|
||||
if (rxtx(eNB,L1_proc,string) < 0) LOG_E(PHY,"eNB %d CC_id %d failed during execution\n",eNB->Mod_id,eNB->CC_id);
|
||||
|
||||
ru_proc->timestamp_tx = L1_proc->timestamp_tx;
|
||||
ru_proc->subframe_tx = L1_proc->subframe_tx;
|
||||
ru_proc->frame_tx = L1_proc->frame_tx;
|
||||
@@ -459,11 +443,8 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t
|
||||
}
|
||||
|
||||
int wakeup_txfh(L1_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) {
|
||||
|
||||
RU_t *ru;
|
||||
RU_proc_t *ru_proc;
|
||||
|
||||
|
||||
struct timespec wait;
|
||||
wait.tv_sec=0;
|
||||
wait.tv_nsec=5000000L;
|
||||
@@ -472,19 +453,22 @@ int wakeup_txfh(L1_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) {
|
||||
LOG_E(PHY,"Frame %d, subframe %d: TX FH not ready\n", proc->frame_tx, proc->subframe_tx);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&eNB->proc.mutex_RU_tx);
|
||||
eNB->proc.RU_mask_tx = 0;
|
||||
pthread_mutex_unlock(&eNB->proc.mutex_RU_tx);
|
||||
|
||||
if (release_thread(&proc->mutex_RUs,&proc->instance_cnt_RUs,"wakeup_txfh")<0) return(-1);
|
||||
|
||||
for(int i=0; i<eNB->num_RU; i++)
|
||||
{
|
||||
for(int i=0; i<eNB->num_RU; i++) {
|
||||
ru = eNB->RU_list[i];
|
||||
ru_proc = &ru->proc;
|
||||
|
||||
if (ru_proc->instance_cnt_eNBs == 0) {
|
||||
LOG_E(PHY,"Frame %d, subframe %d: TX FH thread busy, dropping Frame %d, subframe %d\n", ru_proc->frame_tx, ru_proc->subframe_tx, proc->frame_rx, proc->subframe_rx);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (pthread_mutex_timedlock(&ru_proc->mutex_eNBs,&wait) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB TX1 thread %d (IC %d)\n", ru_proc->subframe_rx&1,ru_proc->instance_cnt_eNBs );
|
||||
exit_fun( "error locking mutex_eNB" );
|
||||
@@ -496,14 +480,13 @@ int wakeup_txfh(L1_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) {
|
||||
ru_proc->subframe_tx = proc->subframe_tx;
|
||||
ru_proc->frame_tx = proc->frame_tx;
|
||||
|
||||
|
||||
// the thread can now be woken up
|
||||
if (pthread_cond_signal(&ru_proc->cond_eNBs) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
pthread_mutex_unlock( &ru_proc->mutex_eNBs );
|
||||
}
|
||||
|
||||
@@ -511,30 +494,24 @@ int wakeup_txfh(L1_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) {
|
||||
}
|
||||
|
||||
int wakeup_tx(PHY_VARS_eNB *eNB) {
|
||||
|
||||
L1_proc_t *proc=&eNB->proc;
|
||||
|
||||
L1_rxtx_proc_t *L1_proc_tx = &proc->L1_proc_tx;
|
||||
L1_rxtx_proc_t *L1_proc = &proc->L1_proc;
|
||||
|
||||
|
||||
struct timespec wait;
|
||||
wait.tv_sec=0;
|
||||
wait.tv_nsec=5000000L;
|
||||
|
||||
|
||||
|
||||
if (pthread_mutex_timedlock(&L1_proc_tx->mutex,&wait) != 0) {
|
||||
LOG_E(PHY, "[SCHED][eNB] ERROR locking mutex for eNB L1_thread_tx\n");
|
||||
exit_fun("ERROR pthread_lock");
|
||||
return(-1);
|
||||
}
|
||||
while(L1_proc_tx->instance_cnt == 0){
|
||||
|
||||
while(L1_proc_tx->instance_cnt == 0) {
|
||||
pthread_cond_wait(&L1_proc_tx->cond,&L1_proc_tx->mutex);
|
||||
}
|
||||
|
||||
L1_proc_tx->instance_cnt = 0;
|
||||
|
||||
|
||||
L1_proc_tx->subframe_rx = L1_proc->subframe_rx;
|
||||
L1_proc_tx->frame_rx = L1_proc->frame_rx;
|
||||
L1_proc_tx->subframe_tx = L1_proc->subframe_tx;
|
||||
@@ -547,18 +524,15 @@ int wakeup_tx(PHY_VARS_eNB *eNB) {
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
pthread_mutex_unlock( &L1_proc_tx->mutex);
|
||||
return(0);
|
||||
}
|
||||
|
||||
int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
|
||||
|
||||
L1_proc_t *proc=&eNB->proc;
|
||||
RU_proc_t *ru_proc=&ru->proc;
|
||||
|
||||
L1_rxtx_proc_t *L1_proc=&proc->L1_proc;
|
||||
|
||||
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
|
||||
int i;
|
||||
struct timespec wait;
|
||||
@@ -586,7 +560,6 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
|
||||
wait.tv_sec=0;
|
||||
wait.tv_nsec=5000000L;
|
||||
|
||||
|
||||
if (L1_proc->instance_cnt == 0) {
|
||||
LOG_E(PHY,"Frame %d, subframe %d: RXTX0 thread busy, dropping\n",L1_proc->frame_rx,L1_proc->subframe_rx);
|
||||
return(-1);
|
||||
@@ -601,9 +574,8 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
|
||||
}
|
||||
|
||||
++L1_proc->instance_cnt;
|
||||
|
||||
// We have just received and processed the common part of a subframe, say n.
|
||||
// TS_rx is the last received timestamp (start of 1st slot), TS_tx is the desired
|
||||
// We have just received and processed the common part of a subframe, say n.
|
||||
// TS_rx is the last received timestamp (start of 1st slot), TS_tx is the desired
|
||||
// transmitted timestamp of the next TX slot (first).
|
||||
// The last (TS_rx mod samples_per_frame) was n*samples_per_tti,
|
||||
// we want to generate subframe (n+sf_ahead), so TS_tx = TX_rx+sf_ahead*samples_per_tti,
|
||||
@@ -626,7 +598,6 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
|
||||
}
|
||||
|
||||
void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) {
|
||||
|
||||
L1_proc_t *proc = &eNB->proc;
|
||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||
int i;
|
||||
@@ -689,7 +660,6 @@ void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) {
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
void wakeup_prach_eNB_br(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) {
|
||||
|
||||
L1_proc_t *proc = &eNB->proc;
|
||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||
int i;
|
||||
@@ -761,7 +731,6 @@ static void *eNB_thread_prach( void *param ) {
|
||||
static int eNB_thread_prach_status;
|
||||
PHY_VARS_eNB *eNB= (PHY_VARS_eNB *)param;
|
||||
L1_proc_t *proc = &eNB->proc;
|
||||
|
||||
// set default return value
|
||||
eNB_thread_prach_status = 0;
|
||||
thread_top_init("eNB_thread_prach",1,500000,1000000,20000000);
|
||||
@@ -798,7 +767,6 @@ static void *eNB_thread_prach_br( void *param ) {
|
||||
static int eNB_thread_prach_status;
|
||||
PHY_VARS_eNB *eNB= (PHY_VARS_eNB *)param;
|
||||
L1_proc_t *proc = &eNB->proc;
|
||||
|
||||
// set default return value
|
||||
eNB_thread_prach_status = 0;
|
||||
thread_top_init("eNB_thread_prach_br",1,500000,1000000,20000000);
|
||||
@@ -879,7 +847,6 @@ void init_eNB_proc(int inst) {
|
||||
LOG_I(PHY,"Initializing eNB processes instance:%d CC_id %d \n",inst,CC_id);
|
||||
#endif
|
||||
proc = &eNB->proc;
|
||||
|
||||
L1_proc = &proc->L1_proc;
|
||||
L1_proc_tx = &proc->L1_proc_tx;
|
||||
L1_proc->instance_cnt = -1;
|
||||
@@ -889,14 +856,12 @@ void init_eNB_proc(int inst) {
|
||||
proc->instance_cnt_prach = -1;
|
||||
proc->instance_cnt_asynch_rxtx = -1;
|
||||
proc->instance_cnt_synch = -1;
|
||||
proc->CC_id = CC_id;
|
||||
|
||||
proc->CC_id = CC_id;
|
||||
proc->first_rx =1;
|
||||
proc->first_tx =1;
|
||||
proc->RU_mask_tx = (1<<eNB->num_RU)-1;
|
||||
proc->RU_mask =0;
|
||||
proc->RU_mask_prach =0;
|
||||
|
||||
pthread_mutex_init( &eNB->UL_INFO_mutex, NULL);
|
||||
pthread_mutex_init( &L1_proc->mutex, NULL);
|
||||
pthread_mutex_init( &L1_proc_tx->mutex, NULL);
|
||||
@@ -906,7 +871,6 @@ void init_eNB_proc(int inst) {
|
||||
pthread_mutex_init( &L1_proc_tx->mutex_RUs, NULL);
|
||||
pthread_cond_init( &L1_proc->cond_RUs, NULL);
|
||||
pthread_cond_init( &L1_proc_tx->cond_RUs, NULL);
|
||||
|
||||
pthread_mutex_init( &proc->mutex_prach, NULL);
|
||||
pthread_mutex_init( &proc->mutex_asynch_rxtx, NULL);
|
||||
pthread_mutex_init( &proc->mutex_RU,NULL);
|
||||
@@ -959,7 +923,6 @@ void init_eNB_proc(int inst) {
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
pthread_create( &proc->pthread_prach_br, attr_prach_br, eNB_thread_prach_br, eNB );
|
||||
#endif
|
||||
|
||||
AssertFatal(proc->instance_cnt_prach == -1,"instance_cnt_prach = %d\n",proc->instance_cnt_prach);
|
||||
|
||||
if (opp_enabled == 1) pthread_create(&proc->process_stats_thread,NULL,process_stats_thread,(void *)eNB);
|
||||
@@ -1000,7 +963,6 @@ void kill_eNB_proc(int inst) {
|
||||
|
||||
for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
eNB=RC.eNB[inst][CC_id];
|
||||
|
||||
proc = &eNB->proc;
|
||||
L1_proc = &proc->L1_proc;
|
||||
L1_proc_tx = &proc->L1_proc_tx;
|
||||
@@ -1017,7 +979,6 @@ void kill_eNB_proc(int inst) {
|
||||
L1_proc->instance_cnt = 0;
|
||||
pthread_cond_signal(&L1_proc->cond);
|
||||
pthread_mutex_unlock(&L1_proc->mutex);
|
||||
|
||||
pthread_mutex_lock(&L1_proc_tx->mutex);
|
||||
L1_proc_tx->instance_cnt = 0;
|
||||
pthread_cond_signal(&L1_proc_tx->cond);
|
||||
@@ -1047,10 +1008,11 @@ void kill_eNB_proc(int inst) {
|
||||
|
||||
if ((get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) && nfapi_mode!=2) {
|
||||
LOG_I(PHY, "Joining L1_proc mutex/cond\n");
|
||||
pthread_join( L1_proc->pthread, (void**)&status );
|
||||
pthread_join( L1_proc->pthread, (void **)&status );
|
||||
LOG_I(PHY, "Joining L1_proc_tx mutex/cond\n");
|
||||
pthread_join( L1_proc_tx->pthread, (void**)&status );
|
||||
pthread_join( L1_proc_tx->pthread, (void **)&status );
|
||||
}
|
||||
|
||||
LOG_I(PHY, "Destroying L1_proc mutex/cond\n");
|
||||
pthread_mutex_destroy( &L1_proc->mutex );
|
||||
pthread_cond_destroy( &L1_proc->cond );
|
||||
@@ -1061,7 +1023,6 @@ void kill_eNB_proc(int inst) {
|
||||
pthread_cond_destroy( &L1_proc_tx->cond );
|
||||
pthread_mutex_destroy( &L1_proc_tx->mutex_RUs );
|
||||
pthread_cond_destroy( &L1_proc_tx->cond_RUs );
|
||||
|
||||
pthread_attr_destroy(&proc->attr_prach);
|
||||
pthread_attr_destroy(&proc->attr_asynch_rxtx);
|
||||
pthread_attr_destroy(&L1_proc->attr);
|
||||
|
||||
+1042
-1196
File diff suppressed because it is too large
Load Diff
@@ -94,3 +94,13 @@ void get_common_options(void) {
|
||||
|
||||
if(worker_config != NULL) set_worker_conf(worker_config);
|
||||
}
|
||||
|
||||
unsigned int is_nos1exec(char *exepath) {
|
||||
if ( strcmp( basename(exepath), "lte-softmodem-nos1") == 0)
|
||||
return 1;
|
||||
|
||||
if ( strcmp( basename(exepath), "lte-uesoftmodem-nos1") == 0)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -82,9 +82,9 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
#include "UTIL/OTG/otg_vars.h"
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
#include "create_tasks.h"
|
||||
#endif
|
||||
|
||||
#include "create_tasks.h"
|
||||
|
||||
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
|
||||
@@ -107,9 +107,6 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
static pthread_t forms_thread; //xforms
|
||||
#endif //XFORMS
|
||||
|
||||
#ifndef ENABLE_USE_MME
|
||||
#define EPC_MODE_ENABLED 0
|
||||
#endif
|
||||
|
||||
pthread_cond_t nfapi_sync_cond;
|
||||
pthread_mutex_t nfapi_sync_mutex;
|
||||
@@ -482,7 +479,7 @@ void wait_eNBs(void) {
|
||||
printf("eNB L1 are configured\n");
|
||||
}
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
|
||||
/*
|
||||
* helper function to terminate a certain ITTI task
|
||||
*/
|
||||
@@ -578,7 +575,7 @@ int restart_L1L2(module_id_t enb_id) {
|
||||
pthread_mutex_unlock(&sync_mutex);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static void wait_nfapi_init(char *thread_name) {
|
||||
printf( "waiting for NFAPI PNF connection and population of global structure (%s)\n",thread_name);
|
||||
@@ -612,6 +609,11 @@ int main( int argc, char **argv ) {
|
||||
printf("Reading in command-line options\n");
|
||||
get_options ();
|
||||
|
||||
if (is_nos1exec(argv[0]) )
|
||||
set_softmodem_optmask(SOFTMODEM_NOS1_BIT);
|
||||
|
||||
EPC_MODE_ENABLED = !IS_SOFTMODEM_NOS1;
|
||||
|
||||
if (CONFIG_ISFLAGSET(CONFIG_ABORT) ) {
|
||||
fprintf(stderr,"Getting configuration failed\n");
|
||||
exit(-1);
|
||||
@@ -629,8 +631,7 @@ int main( int argc, char **argv ) {
|
||||
}
|
||||
|
||||
cpuf=get_cpu_freq_GHz();
|
||||
#if defined(ENABLE_ITTI)
|
||||
printf("ITTI init, useMME: %i\n" ,EPC_MODE_ENABLED);
|
||||
printf("ITTI init, useMME: %i\n",EPC_MODE_ENABLED);
|
||||
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info);
|
||||
|
||||
// initialize mscgen log after ITTI
|
||||
@@ -639,15 +640,7 @@ int main( int argc, char **argv ) {
|
||||
}
|
||||
|
||||
MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX);
|
||||
#endif
|
||||
init_opt();
|
||||
#ifdef PDCP_USE_NETLINK
|
||||
printf("PDCP netlink\n");
|
||||
netlink_init();
|
||||
#if defined(PDCP_USE_NETLINK_QUEUES)
|
||||
pdcp_netlink_init();
|
||||
#endif
|
||||
#endif
|
||||
// to make a graceful exit when ctrl-c is pressed
|
||||
signal(SIGSEGV, signal_handler);
|
||||
signal(SIGINT, signal_handler);
|
||||
@@ -660,48 +653,6 @@ int main( int argc, char **argv ) {
|
||||
LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
|
||||
printf("Runtime table\n");
|
||||
fill_modeled_runtime_table(runtime_phy_rx,runtime_phy_tx);
|
||||
#ifndef DEADLINE_SCHEDULER
|
||||
printf("NO deadline scheduler\n");
|
||||
/* Currently we set affinity for UHD to CPU 0 for eNB/UE and only if number of CPUS >2 */
|
||||
cpu_set_t cpuset;
|
||||
int s;
|
||||
char cpu_affinity[1024];
|
||||
CPU_ZERO(&cpuset);
|
||||
#ifdef CPU_AFFINITY
|
||||
|
||||
if (get_nprocs() > 2) {
|
||||
CPU_SET(0, &cpuset);
|
||||
s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
|
||||
|
||||
if (s != 0) {
|
||||
perror( "pthread_setaffinity_np");
|
||||
exit_fun("Error setting processor affinity");
|
||||
}
|
||||
|
||||
LOG_I(HW, "Setting the affinity of main function to CPU 0, for device library to use CPU 0 only!\n");
|
||||
}
|
||||
|
||||
#endif
|
||||
/* Check the actual affinity mask assigned to the thread */
|
||||
s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
|
||||
|
||||
if (s != 0) {
|
||||
perror( "pthread_getaffinity_np");
|
||||
exit_fun("Error getting processor affinity ");
|
||||
}
|
||||
|
||||
memset(cpu_affinity, 0 , sizeof(cpu_affinity));
|
||||
|
||||
for (int j = 0; j < CPU_SETSIZE; j++) {
|
||||
if (CPU_ISSET(j, &cpuset)) {
|
||||
char temp[1024];
|
||||
sprintf(temp, " CPU_%d ", j);
|
||||
strcat(cpu_affinity, temp);
|
||||
}
|
||||
}
|
||||
|
||||
LOG_I(HW, "CPU Affinity of main() function is... %s\n", cpu_affinity);
|
||||
#endif
|
||||
|
||||
/* Read configuration */
|
||||
if (RC.nb_inst > 0)
|
||||
@@ -712,7 +663,9 @@ int main( int argc, char **argv ) {
|
||||
for (i = 0; i < RC.nb_inst; i++) {
|
||||
flexran_agent_start(i);
|
||||
}
|
||||
|
||||
|
||||
pdcp_module_init( ( IS_SOFTMODEM_NOS1 && !(IS_SOFTMODEM_NOKRNMOD))? (PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT);
|
||||
|
||||
if (RC.nb_inst > 0) {
|
||||
|
||||
if (create_tasks(1) < 0) {
|
||||
@@ -722,6 +675,7 @@ int main( int argc, char **argv ) {
|
||||
|
||||
for (int enb_id = 0; enb_id < RC.nb_inst; enb_id++) {
|
||||
MessageDef *msg_p = itti_alloc_new_message (TASK_ENB_APP, RRC_CONFIGURATION_REQ);
|
||||
RRC_CONFIGURATION_REQ(msg_p) = RC.rrc[enb_id]->configuration;
|
||||
itti_send_msg_to_task (TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
|
||||
}
|
||||
}
|
||||
@@ -788,7 +742,7 @@ int main( int argc, char **argv ) {
|
||||
rt_sleep_ns(10*100000000ULL);
|
||||
|
||||
if (nfapi_mode) {
|
||||
printf("NFAPI*** - mutex and cond created - will block shortly for completion of PNF connection\n");
|
||||
LOG_I(ENB_APP,"NFAPI*** - mutex and cond created - will block shortly for completion of PNF connection\n");
|
||||
pthread_cond_init(&sync_cond,NULL);
|
||||
pthread_mutex_init(&sync_mutex, NULL);
|
||||
}
|
||||
@@ -812,8 +766,8 @@ int main( int argc, char **argv ) {
|
||||
nfapi_mode_str = "<UNKNOWN NFAPI MODE>";
|
||||
break;
|
||||
}
|
||||
printf("NFAPI MODE:%s\n", nfapi_mode_str);
|
||||
|
||||
LOG_I(ENB_APP,"NFAPI MODE:%s\n", nfapi_mode_str);
|
||||
|
||||
if (nfapi_mode==2) {// VNF
|
||||
#if defined(PRE_SCD_THREAD)
|
||||
@@ -822,8 +776,7 @@ int main( int argc, char **argv ) {
|
||||
wait_nfapi_init("main?");
|
||||
}
|
||||
|
||||
|
||||
printf("START MAIN THREADS\n");
|
||||
LOG_I(ENB_APP,"START MAIN THREADS\n");
|
||||
// start the main threads
|
||||
number_of_cards = 1;
|
||||
printf("RC.nb_L1_inst:%d\n", RC.nb_L1_inst);
|
||||
@@ -837,7 +790,6 @@ int main( int argc, char **argv ) {
|
||||
|
||||
printf("wait_eNBs()\n");
|
||||
wait_eNBs();
|
||||
|
||||
printf("About to Init RU threads RC.nb_RU:%d\n", RC.nb_RU);
|
||||
|
||||
// RU thread and some L1 procedure aren't necessary in VNF or L2 FAPI simulator.
|
||||
@@ -846,7 +798,8 @@ int main( int argc, char **argv ) {
|
||||
if (RC.nb_RU >0 && nfapi_mode != 2) {
|
||||
printf("Initializing RU threads\n");
|
||||
init_RU(get_softmodem_params()->rf_config_file);
|
||||
for (ru_id=0;ru_id<RC.nb_RU;ru_id++) {
|
||||
|
||||
for (ru_id=0; ru_id<RC.nb_RU; ru_id++) {
|
||||
RC.ru[ru_id]->rf_map.card=0;
|
||||
RC.ru[ru_id]->rf_map.chain=CC_id+(get_softmodem_params()->chain_offset);
|
||||
}
|
||||
@@ -862,22 +815,21 @@ int main( int argc, char **argv ) {
|
||||
fflush(stdout);
|
||||
fflush(stderr);
|
||||
wait_RUs();
|
||||
printf("ALL RUs READY!\n");
|
||||
printf("RC.nb_RU:%d\n", RC.nb_RU);
|
||||
LOG_I(ENB_APP,"RC.nb_RU:%d\n", RC.nb_RU);
|
||||
// once all RUs are ready intiailize the rest of the eNBs ((dependence on final RU parameters after configuration)
|
||||
printf("ALL RUs ready - init eNBs\n");
|
||||
|
||||
if (nfapi_mode != 1 && nfapi_mode != 2) {
|
||||
printf("Not NFAPI mode - call init_eNB_afterRU()\n");
|
||||
LOG_I(ENB_APP,"Not NFAPI mode - call init_eNB_afterRU()\n");
|
||||
init_eNB_afterRU();
|
||||
} else {
|
||||
printf("NFAPI mode - DO NOT call init_eNB_afterRU()\n");
|
||||
LOG_I(ENB_APP,"NFAPI mode - DO NOT call init_eNB_afterRU()\n");
|
||||
}
|
||||
|
||||
printf("ALL RUs ready - ALL eNBs ready\n");
|
||||
LOG_UI(ENB_APP,"ALL RUs ready - ALL eNBs ready\n");
|
||||
// connect the TX/RX buffers
|
||||
sleep(1); /* wait for thread activation */
|
||||
printf("Sending sync to all threads\n");
|
||||
LOG_I(ENB_APP,"Sending sync to all threads\n");
|
||||
pthread_mutex_lock(&sync_mutex);
|
||||
sync_var=0;
|
||||
pthread_cond_broadcast(&sync_cond);
|
||||
@@ -886,21 +838,11 @@ int main( int argc, char **argv ) {
|
||||
}
|
||||
|
||||
// wait for end of program
|
||||
printf("TYPE <CTRL-C> TO TERMINATE\n");
|
||||
LOG_UI(ENB_APP,"TYPE <CTRL-C> TO TERMINATE\n");
|
||||
//getchar();
|
||||
#if defined(ENABLE_ITTI)
|
||||
printf("Entering ITTI signals handler\n");
|
||||
itti_wait_tasks_end();
|
||||
printf("Returned from ITTI signal handler\n");
|
||||
oai_exit=1;
|
||||
printf("oai_exit=%d\n",oai_exit);
|
||||
#else
|
||||
|
||||
while (oai_exit==0)
|
||||
rt_sleep_ns(100000000ULL);
|
||||
|
||||
printf("Terminating application - oai_exit=%d\n",oai_exit);
|
||||
#endif
|
||||
LOG_I(ENB_APP,"oai_exit=%d\n",oai_exit);
|
||||
// stop threads
|
||||
|
||||
|
||||
@@ -926,8 +868,7 @@ int main( int argc, char **argv ) {
|
||||
}
|
||||
#endif
|
||||
|
||||
printf("stopping MODEM threads\n");
|
||||
|
||||
LOG_I(ENB_APP,"stopping MODEM threads\n");
|
||||
stop_eNB(NB_eNB_INST);
|
||||
stop_RU(RC.nb_RU);
|
||||
/* release memory used by the RU/eNB threads (incomplete), after all
|
||||
@@ -961,10 +902,7 @@ int main( int argc, char **argv ) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (opt_enabled == 1)
|
||||
terminate_opt();
|
||||
|
||||
terminate_opt();
|
||||
logClean();
|
||||
printf("Bye.\n");
|
||||
return 0;
|
||||
|
||||
@@ -33,15 +33,8 @@
|
||||
#include "SIMULATION/ETH_TRANSPORT/proto.h"
|
||||
|
||||
#include "flexran_agent.h"
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
#if defined(ENABLE_USE_MME)
|
||||
#include "s1ap_eNB.h"
|
||||
#ifdef PDCP_USE_NETLINK
|
||||
#include "SIMULATION/ETH_TRANSPORT/proto.h"
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#include "s1ap_eNB.h"
|
||||
#include "SIMULATION/ETH_TRANSPORT/proto.h"
|
||||
|
||||
/* help strings definition for command line options, used in CMDLINE_XXX_DESC macros and printed when -h option is used */
|
||||
#define CONFIG_HLP_RFCFGF "Configuration file for front-end (e.g. LMS7002M)\n"
|
||||
@@ -245,6 +238,8 @@
|
||||
#define SOFTMODEM_NOS1_BIT (1<<0)
|
||||
#define SOFTMODEM_NOKRNMOD_BIT (1<<1)
|
||||
#define SOFTMODEM_NONBIOT_BIT (1<<2)
|
||||
#define SOFTMODEM_BASICSIM_BIT (1<<10)
|
||||
|
||||
typedef struct {
|
||||
uint64_t optmask;
|
||||
THREAD_STRUCT thread_struct;
|
||||
@@ -265,11 +260,12 @@ typedef struct {
|
||||
#define IS_SOFTMODEM_NOS1 ( get_softmodem_optmask() & SOFTMODEM_NOS1_BIT)
|
||||
#define IS_SOFTMODEM_NOKRNMOD ( get_softmodem_optmask() & SOFTMODEM_NOKRNMOD_BIT)
|
||||
#define IS_SOFTMODEM_NONBIOT ( get_softmodem_optmask() & SOFTMODEM_NONBIOT_BIT)
|
||||
#define IS_SOFTMODEM_BASICSIM ( get_softmodem_optmask() & SOFTMODEM_BASICSIM_BIT)
|
||||
extern uint64_t get_softmodem_optmask(void);
|
||||
extern uint64_t set_softmodem_optmask(uint64_t bitmask);
|
||||
extern void get_common_options(void);
|
||||
extern softmodem_params_t *get_softmodem_params(void);
|
||||
|
||||
extern unsigned int is_nos1exec(char *exepath) ;
|
||||
uint64_t get_pdcp_optmask(void);
|
||||
extern pthread_cond_t sync_cond;
|
||||
extern pthread_mutex_t sync_mutex;
|
||||
|
||||
@@ -110,10 +110,8 @@ pthread_mutex_t nfapi_sync_mutex;
|
||||
int nfapi_sync_var=-1; //!< protected by mutex \ref nfapi_sync_mutex
|
||||
|
||||
uint8_t nfapi_mode = 0;
|
||||
#ifdef PDCP_USE_NETLINK
|
||||
#ifdef UESIM_EXPANSION
|
||||
uint16_t inst_pdcp_list[NUMBER_OF_UE_MAX];
|
||||
#endif
|
||||
uint16_t inst_pdcp_list[NUMBER_OF_UE_MAX];
|
||||
#endif
|
||||
uint16_t sf_ahead=2;
|
||||
int tddflag;
|
||||
@@ -442,6 +440,10 @@ static void get_options(void) {
|
||||
|
||||
if (dumpframe > 0) mode = rx_dump_frame;
|
||||
|
||||
# if BASIC_SIMULATOR
|
||||
set_softmodem_optmask(SOFTMODEM_BASICSIM_BIT); //this BASIC_SIMULATOR should be a config option
|
||||
# endif
|
||||
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
frame_parms[CC_id]->dl_CarrierFreq = downlink_frequency[0][0];
|
||||
}
|
||||
@@ -680,10 +682,8 @@ int main( int argc, char **argv ) {
|
||||
#endif
|
||||
int CC_id;
|
||||
uint8_t abstraction_flag=0;
|
||||
#ifdef PDCP_USE_NETLINK
|
||||
#ifdef UESIM_EXPANSION
|
||||
memset(inst_pdcp_list, 0, sizeof(inst_pdcp_list));
|
||||
#endif
|
||||
#endif
|
||||
// Default value for the number of UEs. It will hold,
|
||||
// if not changed from the command line option --num-ues
|
||||
@@ -693,9 +693,7 @@ int main( int argc, char **argv ) {
|
||||
int ret;
|
||||
#endif
|
||||
configmodule_interface_t *config_mod;
|
||||
|
||||
start_background_system();
|
||||
|
||||
config_mod = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY);
|
||||
|
||||
if (config_mod == NULL) {
|
||||
@@ -711,6 +709,11 @@ int main( int argc, char **argv ) {
|
||||
for (int i=0; i<MAX_NUM_CCs; i++) tx_max_power[i]=23;
|
||||
|
||||
get_options ();
|
||||
|
||||
if (is_nos1exec(argv[0]) )
|
||||
set_softmodem_optmask(SOFTMODEM_NOS1_BIT);
|
||||
|
||||
EPC_MODE_ENABLED = !IS_SOFTMODEM_NOS1;
|
||||
printf("Running with %d UE instances\n",NB_UE_INST);
|
||||
|
||||
if (NB_UE_INST > 1 && simL1flag != 1 && nfapi_mode != 3) {
|
||||
@@ -721,15 +724,17 @@ int main( int argc, char **argv ) {
|
||||
printf("NFAPI_MODE value: %d \n", nfapi_mode);
|
||||
|
||||
// Checking option of nums_ue_thread.
|
||||
if(NB_THREAD_INST < 1){
|
||||
if(NB_THREAD_INST < 1) {
|
||||
printf("Running with 0 UE rxtx thread, exiting.\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
// Checking option's relation between nums_ue_thread and num-ues
|
||||
if(NB_UE_INST <NB_THREAD_INST ){
|
||||
if(NB_UE_INST <NB_THREAD_INST ) {
|
||||
printf("Number of UEs < number of UE rxtx threads, exiting.\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
// Not sure if the following is needed here
|
||||
/*if (CONFIG_ISFLAGSET(CONFIG_ABORT)) {
|
||||
if (UE_flag == 0) {
|
||||
@@ -741,8 +746,6 @@ int main( int argc, char **argv ) {
|
||||
nfapi_mode = 4;
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
#if T_TRACER
|
||||
T_Config_Init();
|
||||
#endif
|
||||
@@ -763,13 +766,13 @@ int main( int argc, char **argv ) {
|
||||
MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX);
|
||||
#endif
|
||||
init_opt();
|
||||
#ifdef PDCP_USE_NETLINK
|
||||
printf("PDCP netlink\n");
|
||||
netlink_init();
|
||||
#if defined(PDCP_USE_NETLINK_QUEUES)
|
||||
pdcp_netlink_init();
|
||||
#endif
|
||||
#endif
|
||||
uint32_t pdcp_initmask = ((!IS_SOFTMODEM_NOS1) || IS_SOFTMODEM_NOKRNMOD)? LINK_ENB_PDCP_TO_GTPV1U_BIT : (LINK_ENB_PDCP_TO_GTPV1U_BIT | PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT);
|
||||
|
||||
if ( IS_SOFTMODEM_BASICSIM || (nfapi_mode == 3) ) {
|
||||
pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT;
|
||||
}
|
||||
|
||||
pdcp_module_init( pdcp_initmask );
|
||||
//TTN for D2D
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
printf ("RRC control socket\n");
|
||||
@@ -817,38 +820,6 @@ int main( int argc, char **argv ) {
|
||||
RCConfig_sim();
|
||||
}
|
||||
|
||||
// source code written in below moved to later to avoid keeping waiting for nfapi_sync_cond in wait_nfapi_init.
|
||||
/*
|
||||
// start the main UE threads
|
||||
int eMBMS_active = 0;
|
||||
|
||||
if (nfapi_mode==3) { // UE-STUB-PNF
|
||||
config_sync_var=0;
|
||||
wait_nfapi_init("main?");
|
||||
//Panos: Temporarily we will be using single set of threads for multiple UEs.
|
||||
//init_UE_stub(1,eMBMS_active,uecap_xer_in,emul_iface);
|
||||
init_UE_stub_single_thread(NB_UE_INST,eMBMS_active,uecap_xer_in,emul_iface);
|
||||
} else {
|
||||
init_UE(NB_UE_INST,eMBMS_active,uecap_xer_in,0,get_softmodem_params()->phy_test,UE_scan,UE_scan_carrier,mode,(int)rx_gain[0][0],tx_max_power[0],
|
||||
frame_parms[0]);
|
||||
}
|
||||
|
||||
if (get_softmodem_params()->phy_test==0) {
|
||||
printf("Filling UE band info\n");
|
||||
fill_ue_band_info();
|
||||
dl_phy_sync_success (0, 0, 0, 1);
|
||||
}
|
||||
|
||||
if (nfapi_mode!=3) {
|
||||
number_of_cards = 1;
|
||||
|
||||
for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
PHY_vars_UE_g[0][CC_id]->rf_map.card=0;
|
||||
PHY_vars_UE_g[0][CC_id]->rf_map.chain=CC_id+(get_softmodem_params()->chain_offset);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
cpuf=get_cpu_freq_GHz();
|
||||
#ifndef DEADLINE_SCHEDULER
|
||||
printf("NO deadline scheduler\n");
|
||||
@@ -880,7 +851,7 @@ int main( int argc, char **argv ) {
|
||||
exit_fun("Error getting processor affinity ");
|
||||
}
|
||||
|
||||
memset(cpu_affinity, 0 , sizeof(cpu_affinity));
|
||||
memset(cpu_affinity, 0, sizeof(cpu_affinity));
|
||||
|
||||
for (int j = 0; j < CPU_SETSIZE; j++) {
|
||||
if (CPU_ISSET(j, &cpuset)) {
|
||||
@@ -893,6 +864,7 @@ int main( int argc, char **argv ) {
|
||||
LOG_I(HW, "CPU Affinity of main() function is... %s\n", cpu_affinity);
|
||||
#endif
|
||||
#if defined(ENABLE_ITTI)
|
||||
|
||||
if (create_tasks_ue(NB_UE_INST) < 0) {
|
||||
printf("cannot create ITTI tasks\n");
|
||||
exit(-1); // need a softer mode
|
||||
@@ -938,33 +910,32 @@ int main( int argc, char **argv ) {
|
||||
|
||||
printf("NFAPI MODE:%s\n", nfapi_mode_str);
|
||||
|
||||
if (nfapi_mode==3) // UE-STUB-PNF
|
||||
{
|
||||
if (nfapi_mode==3) { // UE-STUB-PNF
|
||||
config_sync_var=0;
|
||||
wait_nfapi_init("main?");
|
||||
//Panos: Temporarily we will be using single set of threads for multiple UEs.
|
||||
//init_UE_stub(1,eMBMS_active,uecap_xer_in,emul_iface);
|
||||
init_UE_stub_single_thread(NB_UE_INST,eMBMS_active,uecap_xer_in,emul_iface);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
init_UE(NB_UE_INST,eMBMS_active,uecap_xer_in,0,get_softmodem_params()->phy_test,UE_scan,UE_scan_carrier,mode,(int)rx_gain[0][0],tx_max_power[0],
|
||||
frame_parms[0]);
|
||||
}
|
||||
|
||||
|
||||
if (get_softmodem_params()->phy_test==0) {
|
||||
printf("Filling UE band info\n");
|
||||
fill_ue_band_info();
|
||||
dl_phy_sync_success (0, 0, 0, 1);
|
||||
}
|
||||
|
||||
if (nfapi_mode!=3){
|
||||
if (nfapi_mode!=3) {
|
||||
number_of_cards = 1;
|
||||
|
||||
for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
PHY_vars_UE_g[0][CC_id]->rf_map.card=0;
|
||||
PHY_vars_UE_g[0][CC_id]->rf_map.chain=CC_id+(get_softmodem_params()->chain_offset);
|
||||
}
|
||||
}
|
||||
|
||||
// connect the TX/RX buffers
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user