merge with latest develop

This commit is contained in:
Bruno Mongazon-Cazavet
2023-02-20 10:36:36 +01:00
120 changed files with 2398 additions and 3165 deletions
+2 -11
View File
@@ -53,11 +53,8 @@ int create_tasks(uint32_t enb_nb) {
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");
rrc_enb_init();
itti_mark_task_ready(TASK_RRC_ENB);
if (get_softmodem_params()->emulate_l1 || (EPC_MODE_ENABLED && split73 != SPLIT73_DU)) {
rc = itti_create_task(TASK_SCTP, sctp_eNB_task, NULL);
AssertFatal(rc >= 0, "Create task for SCTP failed\n");
@@ -89,11 +86,5 @@ int create_tasks(uint32_t enb_nb) {
AssertFatal(rc >= 0, "Create task for GTPV1U failed\n");
}
if (!NODE_IS_CU(type)) {
LOG_I(MAC,"Creating MAC eNB Task\n");
rc = itti_create_task(TASK_MAC_ENB, mac_enb_task, NULL);
AssertFatal(rc >= 0, "Create task for MAC eNB failed\n");
}
return 0;
}
+39 -52
View File
@@ -313,7 +313,6 @@ static inline int rxtx(PHY_VARS_eNB *eNB,
return(0);
}
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;
@@ -811,35 +810,19 @@ static void *eNB_thread_prach_br( void *param ) {
return &eNB_thread_prach_status;
}
extern void init_td_thread(PHY_VARS_eNB *);
extern void init_te_thread(PHY_VARS_eNB *);
extern void kill_td_thread(PHY_VARS_eNB *);
extern void kill_te_thread(PHY_VARS_eNB *);
static void print_opp_meas(PHY_VARS_eNB *eNB);
static void reset_opp_meas(PHY_VARS_eNB *eNB);
static void *process_stats_thread(void *param) {
PHY_VARS_eNB *eNB = (PHY_VARS_eNB *)param;
wait_sync("process_stats_thread");
reset_opp_meas(eNB);
while (!oai_exit) {
sleep(1);
if (opp_enabled == 1) {
if ( eNB->ulsch_decoding_stats.trials>0)
print_meas(&eNB->ulsch_decoding_stats,"ulsch_decoding",NULL,NULL);
if (eNB->dlsch_encoding_stats.trials >0) {
print_meas(&eNB->dlsch_turbo_encoding_preperation_stats,"dlsch_coding_crc",NULL,NULL);
print_meas(&eNB->dlsch_turbo_encoding_segmentation_stats,"dlsch_segmentation",NULL,NULL);
print_meas(&eNB->dlsch_encoding_stats,"dlsch_encoding",NULL,NULL);
print_meas(&eNB->dlsch_turbo_encoding_stats,"turbo_encoding",NULL,NULL);
print_meas(&eNB->dlsch_interleaving_stats,"turbo_interleaving",NULL,NULL);
print_meas(&eNB->dlsch_rate_matching_stats,"turbo_rate_matching",NULL,NULL);
}
print_meas(&eNB->dlsch_modulation_stats,"dlsch_modulation",NULL,NULL);
}
print_opp_meas(eNB);
if (RC.mac)
lte_dump_mac_stats(RC.mac[0], stdout);
if (time(NULL) % 10)
reset_opp_meas(eNB);
}
return(NULL);
@@ -918,11 +901,6 @@ void init_eNB_proc(int inst) {
pthread_cond_init( &proc->cond_prach_br, NULL);
pthread_attr_init( &proc->attr_prach_br);
if(get_thread_worker_conf() == WORKER_ENABLE) {
init_te_thread(eNB);
init_td_thread(eNB);
}
LOG_I(PHY,"eNB->single_thread_flag:%d\n", eNB->single_thread_flag);
if ((get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT) && NFAPI_MODE!=NFAPI_MODE_VNF) {
@@ -954,8 +932,10 @@ void init_eNB_proc(int inst) {
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);
pthread_create(&proc->L1_stats_thread,NULL,L1_stats_thread,(void*)eNB);
if (opp_enabled == 1)
threadCreate(&proc->process_stats_thread, process_stats_thread, (void *)eNB, "opp stats", -1, sched_get_priority_min(SCHED_OAI));
if (!IS_SOFTMODEM_NOSTATS_BIT)
threadCreate(&proc->L1_stats_thread, L1_stats_thread, (void *)eNB, "L1 stats", -1, sched_get_priority_min(SCHED_OAI));
}
//for multiple CCs: setup master and slaves
@@ -997,11 +977,6 @@ void kill_eNB_proc(int inst) {
L1_proc = &proc->L1_proc;
L1_proc_tx = &proc->L1_proc_tx;
if(get_thread_worker_conf() == WORKER_ENABLE) {
kill_td_thread(eNB);
kill_te_thread(eNB);
}
LOG_I(PHY, "Killing TX CC_id %d inst %d\n", CC_id, inst );
if ((get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) && NFAPI_MODE!=NFAPI_MODE_VNF) {
@@ -1060,30 +1035,43 @@ void kill_eNB_proc(int inst) {
}
}
void reset_opp_meas(void) {
int sfn;
static void reset_opp_meas(PHY_VARS_eNB *eNB)
{
reset_meas(&softmodem_stats_mt);
reset_meas(&softmodem_stats_hw);
for (sfn=0; sfn < 10; sfn++) {
reset_meas(&softmodem_stats_rxtx_sf);
reset_meas(&softmodem_stats_rx_sf);
}
reset_meas(&softmodem_stats_rxtx_sf);
reset_meas(&softmodem_stats_rx_sf);
reset_meas(&eNB->ulsch_decoding_stats);
reset_meas(&eNB->dlsch_turbo_encoding_preperation_stats);
reset_meas(&eNB->dlsch_turbo_encoding_segmentation_stats);
reset_meas(&eNB->dlsch_encoding_stats);
reset_meas(&eNB->dlsch_turbo_encoding_stats);
reset_meas(&eNB->dlsch_interleaving_stats);
reset_meas(&eNB->dlsch_rate_matching_stats);
reset_meas(&eNB->dlsch_modulation_stats);
}
void print_opp_meas(void) {
int sfn=0;
static void print_opp_meas(PHY_VARS_eNB *eNB)
{
print_meas(&softmodem_stats_mt, "Main ENB Thread", NULL, NULL);
print_meas(&softmodem_stats_hw, "HW Acquisation", NULL, NULL);
for (sfn=0; sfn < 10; sfn++) {
print_meas(&softmodem_stats_rxtx_sf,"[eNB][total_phy_proc_rxtx]",NULL, NULL);
print_meas(&softmodem_stats_rx_sf,"[eNB][total_phy_proc_rx]",NULL,NULL);
}
}
if (eNB->ulsch_decoding_stats.trials > 0)
print_meas(&eNB->ulsch_decoding_stats, "ulsch_decoding", NULL, NULL);
if (eNB->dlsch_encoding_stats.trials > 0) {
print_meas(&eNB->dlsch_turbo_encoding_preperation_stats, "dlsch_coding_crc", NULL, NULL);
print_meas(&eNB->dlsch_turbo_encoding_segmentation_stats, "dlsch_segmentation", NULL, NULL);
print_meas(&eNB->dlsch_encoding_stats, "dlsch_encoding", NULL, NULL);
print_meas(&eNB->dlsch_turbo_encoding_stats, "turbo_encoding", NULL, NULL);
print_meas(&eNB->dlsch_interleaving_stats, "turbo_interleaving", NULL, NULL);
print_meas(&eNB->dlsch_rate_matching_stats, "turbo_rate_matching", NULL, NULL);
}
print_meas(&eNB->dlsch_modulation_stats, "dlsch_modulation", NULL, NULL);
}
void free_transport(PHY_VARS_eNB *eNB) {
for (int i=0; i<NUMBER_OF_DLSCH_MAX; i++) {
@@ -1279,7 +1267,6 @@ void init_eNB(int single_thread_flag,
eNB->prach_energy_counter = 0;
}
}
LOG_I(PHY,"[lte-softmodem.c] eNB structure allocated\n");
}
+5 -14
View File
@@ -1472,11 +1472,11 @@ static void *ru_stats_thread(void *param) {
sleep(1);
if (opp_enabled) {
if (ru->feprx) print_meas(&ru->ofdm_demod_stats,"feprx",NULL,NULL);
if (ru->feprx) print_meas(&ru->ofdm_demod_stats,"feprx_ru",NULL,NULL);
if (ru->feptx_ofdm) print_meas(&ru->ofdm_mod_stats,"feptx_ofdm",NULL,NULL);
if (ru->feptx_ofdm) print_meas(&ru->ofdm_mod_stats,"feptx_ofdm_ru",NULL,NULL);
if (ru->fh_north_asynch_in) print_meas(&ru->rx_fhaul,"rx_fhaul",NULL,NULL);
if (ru->fh_north_asynch_in) print_meas(&ru->rx_fhaul,"rx_fhaul_ru",NULL,NULL);
if (ru->fh_north_out) {
print_meas(&ru->tx_fhaul,"tx_fhaul",NULL,NULL);
@@ -2335,17 +2335,8 @@ void init_RU_proc(RU_t *ru) {
init_feptx_thread(ru, NULL);
}
if (opp_enabled == 1) pthread_create(&ru->ru_stats_thread,NULL,ru_stats_thread,(void *)ru);
/*
if (ru->function == eNodeB_3GPP) {
usleep(10000);
LOG_I(PHY, "Signaling main thread that RU %d (is_slave %d,send_dmrs %d) is ready in state %s\n",ru->idx,ru->is_slave,ru->generate_dmrs_sync,ru_states[ru->state]);
AssertFatal((ret=pthread_mutex_lock(ru->ru_mutex))==0,"mutex_lock returns %d\n",ret);
*ru->ru_mask &= ~(1<<ru->idx);
pthread_cond_signal(ru->ru_cond);
AssertFatal((ret=pthread_mutex_unlock(ru->ru_mutex))==0,"mutex_unlock returns %d\n",ret);
}
*/
if (opp_enabled == 1)
pthread_create(&ru->ru_stats_thread, NULL, ru_stats_thread, (void *)ru);
}
+3 -9
View File
@@ -156,10 +156,6 @@ void sendFs6Ulharq(enum pckType type, int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *
RU_t **RCconfig_RU(int nb_RU,int nb_L1_inst,PHY_VARS_eNB ***eNB,uint64_t *ru_mask,pthread_mutex_t *ru_mutex,pthread_cond_t *ru_cond);
extern void reset_opp_meas(void);
extern void print_opp_meas(void);
RU_t **RCconfig_RU(int nb_RU,int nb_L1_inst,PHY_VARS_eNB ***eNB,uint64_t *ru_mask,pthread_mutex_t *ru_mutex,pthread_cond_t *ru_cond);
int transmission_mode=1;
@@ -456,10 +452,6 @@ int main ( int argc, char **argv )
set_taus_seed (0);
printf("configuring for RAU/RRU\n");
if (opp_enabled ==1) {
reset_opp_meas();
}
cpuf=get_cpu_freq_GHz();
printf("ITTI init, useMME: %i\n",EPC_MODE_ENABLED);
itti_init(TASK_MAX, tasks_info);
@@ -494,6 +486,7 @@ int main ( int argc, char **argv )
MessageDef *msg_p = itti_alloc_new_message (TASK_ENB_APP, 0, 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);
rrc_enb_process_itti_msg(NULL);
}
node_type = RC.rrc[0]->node_type;
}
@@ -609,10 +602,11 @@ int main ( int argc, char **argv )
sync_var=0;
pthread_cond_broadcast(&sync_cond);
pthread_mutex_unlock(&sync_mutex);
config_check_unknown_cmdlineopt(CONFIG_CHECKALLSECTIONS);
}
create_tasks_mbms(1);
sleep(1);
config_check_unknown_cmdlineopt(CONFIG_CHECKALLSECTIONS);
// wait for end of program
LOG_UI(ENB_APP,"TYPE <CTRL-C> TO TERMINATE\n");
-8
View File
@@ -179,14 +179,6 @@ extern void init_UE(int nb_inst,
extern void init_thread(int sched_runtime, int sched_deadline, int sched_fifo, cpu_set_t *cpuset, char *name);
extern void reset_opp_meas(void);
extern void print_opp_meas(void);
extern void init_td_thread(PHY_VARS_eNB *);
extern void init_te_thread(PHY_VARS_eNB *);
extern void kill_td_thread(PHY_VARS_eNB *);
extern void kill_te_thread(PHY_VARS_eNB *);
extern void init_ocm(void);
extern void init_ue_devices(PHY_VARS_UE *);
+8 -169
View File
@@ -790,9 +790,7 @@ static void *UE_thread_rxn_txnp4(void *arg) {
#endif
}
#if UE_TIMING_TRACE
start_meas(&UE->generic_stat);
#endif
start_UE_TIMING(UE->generic_stat);
if (UE->mac_enabled==1) {
int ret = ue_scheduler(UE->Mod_id,
@@ -810,9 +808,7 @@ static void *UE_thread_rxn_txnp4(void *arg) {
}
}
#if UE_TIMING_TRACE
stop_meas(&UE->generic_stat);
#endif
stop_UE_TIMING(UE->generic_stat);
// Prepare the future Tx data
@@ -1082,9 +1078,7 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg) {
for (ue_index = 0; ue_index < ue_num; ue_index++) {
ue_Mod_id = ue_thread_id + NB_THREAD_INST * ue_index; // Always 0 in standalone pnf mode
UE = PHY_vars_UE_g[ue_Mod_id][0];
#if UE_TIMING_TRACE
start_meas(&UE->generic_stat);
#endif
start_UE_TIMING(UE->generic_stat);
int rx_frame = NFAPI_SFNSF2SF(sfn_sf) < 4 ? (NFAPI_SFNSF2SFN(sfn_sf) + 1023) % 1024 : NFAPI_SFNSF2SFN(sfn_sf); // subtracting 4 from subframe_tx
int rx_subframe = NFAPI_SFNSF2SF(sfn_sf) < 4 ? NFAPI_SFNSF2SF(sfn_sf) + 6 : NFAPI_SFNSF2SF(sfn_sf) - 4;
LOG_D(MAC, "rx_frame %d rx_subframe %d\n", rx_frame, rx_subframe);
@@ -1105,10 +1099,7 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg) {
}
}
#if UE_TIMING_TRACE
stop_meas(&UE->generic_stat);
#endif
stop_UE_TIMING(UE->generic_stat);
// Prepare the future Tx data
if ((subframe_select(&UE->frame_parms, NFAPI_SFNSF2SF(sfn_sf)) == SF_UL) ||
(UE->frame_parms.frame_type == FDD)) {
@@ -1499,9 +1490,7 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
phy_procedures_UE_SL_TX(UE,proc);
}
#if UE_TIMING_TRACE
start_meas(&UE->generic_stat);
#endif
start_UE_TIMING(UE->generic_stat);
if (UE->mac_enabled==1) {
ret = ue_scheduler(ue_Mod_id,
@@ -1519,10 +1508,7 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
}
}
#if UE_TIMING_TRACE
stop_meas(&UE->generic_stat);
#endif
stop_UE_TIMING(UE->generic_stat);
// Prepare the future Tx data
if ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_UL) ||
@@ -1699,160 +1685,13 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
* \returns a pointer to an int. The storage is not on the heap and must not be freed.
*/
static void *UE_phy_stub_thread_rxn_txnp4(void *arg) {
#if 0
thread_top_init("UE_phy_stub_thread_rxn_txnp4",1,870000L,1000000L,1000000L);
module_id_t Mod_id = 0;
static __thread int UE_thread_rxtx_retval;
struct rx_tx_thread_data *rtd = arg;
UE_rxtx_proc_t *proc = rtd->proc;
PHY_VARS_UE *UE = rtd->UE;
phy_stub_ticking->ticking_var = -1;
proc->subframe_rx=proc->sub_frame_start;
// CAREFUL HERE!
wait_sync("UE_phy_stub_thread_rxn_txnp4");
while (!oai_exit) {
if (pthread_mutex_lock(&phy_stub_ticking->mutex_ticking) != 0) {
LOG_E( MAC, "[SCHED][UE] error locking mutex for UE RXTX\n" );
exit_fun("nothing to add");
}
while (phy_stub_ticking->ticking_var < 0) {
// most of the time, the thread is waiting here
//pthread_cond_wait( &proc->cond_rxtx, &proc->mutex_rxtx )
LOG_D(MAC,"Waiting for ticking_var\n");
pthread_cond_wait( &phy_stub_ticking->cond_ticking, &phy_stub_ticking->mutex_ticking);
}
phy_stub_ticking->ticking_var--;
if (pthread_mutex_unlock(&phy_stub_ticking->mutex_ticking) != 0) {
LOG_E( MAC, "[SCHED][UE] error unlocking mutex for UE RXn_TXnp4\n" );
exit_fun("nothing to add");
}
proc->subframe_rx=timer_subframe;
proc->frame_rx = timer_frame;
proc->subframe_tx=(timer_subframe+4)%10;
proc->frame_tx = proc->frame_rx + (proc->subframe_rx>5?1:0);
// Process Rx data for one sub-frame
lte_subframe_t sf_type = subframe_select( &UE->frame_parms, proc->subframe_rx);
if ((sf_type == SF_DL) ||
(UE->frame_parms.frame_type == FDD) ||
(sf_type == SF_S)) {
if (UE->frame_parms.frame_type == TDD) {
LOG_D(PHY, "TDD%d,%s: calling UE_RX\n",
UE->frame_parms.tdd_config,
(sf_type==SF_DL? "SF_DL" :
(sf_type==SF_UL? "SF_UL" :
(sf_type==SF_S ? "SF_S" : "UNKNOWN_SF_TYPE"))));
} else {
LOG_D(PHY, "%s,%s: calling UE_RX\n",
(UE->frame_parms.frame_type==FDD? "FDD":
(UE->frame_parms.frame_type==TDD? "TDD":"UNKNOWN_DUPLEX_MODE")),
(sf_type==SF_DL? "SF_DL" :
(sf_type==SF_UL? "SF_UL" :
(sf_type==SF_S ? "SF_S" : "UNKNOWN_SF_TYPE"))));
}
phy_procedures_UE_SL_RX(UE,proc);
oai_subframe_ind(timer_frame, timer_subframe);
if(dl_config_req!= NULL) {
AssertFatal(0, "dl_config_req_UE_MAC() not handled\n");
//dl_config_req_UE_MAC(dl_config_req, Mod_id);
}
//if(UE_mac_inst[Mod_id].hi_dci0_req!= NULL){
if (hi_dci0_req!=NULL && hi_dci0_req->hi_dci0_request_body.hi_dci0_pdu_list!=NULL) {
AssertFatal(0, "hi_dci0_req_UE_MAC() not handled\n");
//hi_dci0_req_UE_MAC(hi_dci0_req, Mod_id);
//if(UE_mac_inst[Mod_id].hi_dci0_req->hi_dci0_request_body.hi_dci0_pdu_list!=NULL){
free(hi_dci0_req->hi_dci0_request_body.hi_dci0_pdu_list);
hi_dci0_req->hi_dci0_request_body.hi_dci0_pdu_list = NULL;
//}
free(hi_dci0_req);
hi_dci0_req = NULL;
} else if(hi_dci0_req!=NULL) {
free(hi_dci0_req);
hi_dci0_req = NULL;
}
if (NFAPI_MODE!=NFAPI_UE_STUB_PNF)
phy_procedures_UE_SL_TX(UE,proc);
}
#if UE_TIMING_TRACE
start_meas(&UE->generic_stat);
#endif
if (UE->mac_enabled==1) {
int ret = ue_scheduler(UE->Mod_id,
proc->frame_rx,
proc->subframe_rx,
proc->frame_tx,
proc->subframe_tx,
subframe_select(&UE->frame_parms,proc->subframe_tx),
0,
0);
if (ret != CONNECTION_OK)
LOG_E( PHY, "[UE %"PRIu8"] Frame %"PRIu32", subframe %u %s\n",
UE->Mod_id, proc->frame_rx, proc->subframe_tx,get_connectionloss_errstr(ret) );
}
#if UE_TIMING_TRACE
stop_meas(&UE->generic_stat);
#endif
// Prepare the future Tx data
if ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_UL) ||
(UE->frame_parms.frame_type == FDD) )
if ((UE_mac_inst[Mod_id].UE_mode[0] == PRACH) ) {
// check if we have PRACH opportunity
if (is_prach_subframe(&UE->frame_parms,proc->frame_tx, proc->subframe_tx)) {
PRACH_RESOURCES_t *prach_resources = ue_get_rach(Mod_id, 0, proc->frame_tx, 0, proc->subframe_tx);
if(prach_resources!=NULL) {
fill_rach_indication_UE_MAC(Mod_id, proc->frame_tx,proc->subframe_tx, UL_INFO, prach_resources->ra_PreambleIndex, prach_resources->ra_RNTI);
Msg1_transmitted(Mod_id, 0, proc->frame_tx, 0);
UE_mac_inst[Mod_id].UE_mode[0] = RA_RESPONSE;
}
//ue_prach_procedures(ue,proc,eNB_id,abstraction_flag,mode);
}
} // mode is PRACH
// Substitute call to phy_procedures Tx with call to phy_stub functions in order to trigger
// UE Tx procedures directly at the MAC layer, based on the received ul_config requests from the vnf (eNB).
// Generate UL_indications which correspond to UL traffic.
if(ul_config_req!= NULL && ul_config_req->ul_config_request_body.ul_config_pdu_list != NULL) {
//LOG_I(MAC, "UE_phy_stub_thread_rxn_txnp4 ul_config_req is not NULL \n");
ul_config_req_UE_MAC(ul_config_req, timer_frame, timer_subframe, Mod_id);
if(ul_config_req->ul_config_request_body.ul_config_pdu_list != NULL) {
free(ul_config_req->ul_config_request_body.ul_config_pdu_list);
ul_config_req->ul_config_request_body.ul_config_pdu_list = NULL;
}
free(ul_config_req);
ul_config_req = NULL;
} else if(ul_config_req!=NULL) {
free(ul_config_req);
ul_config_req = NULL;
}
}
#endif // disabled
static void *UE_phy_stub_thread_rxn_txnp4(void *arg)
{
// thread finished
free(arg);
return NULL; //return &UE_thread_rxtx_retval;
}
/*!
* \brief This is the main UE thread.
* This thread controls the other three UE threads: