Commit eddebae1 authored by Laurent Thomas's avatar Laurent Thomas

fix after code review

parent 3b0c43c0
...@@ -336,15 +336,15 @@ extern "C" { ...@@ -336,15 +336,15 @@ extern "C" {
usleep(100*1000); // Allow the tasks to receive the message before going returning to main thread usleep(100*1000); // Allow the tasks to receive the message before going returning to main thread
} }
int itti_create_queue(const task_info_t *task_info) { int itti_create_queue(const task_info_t *taskInfo) {
pthread_mutex_lock (&lock_nb_queues); pthread_mutex_lock (&lock_nb_queues);
int newQueue=nb_queues++; int newQueue=nb_queues++;
AssertFatal(tasks=(task_list_t **) realloc(tasks, nb_queues * sizeof(*tasks)),""); AssertFatal(tasks=(task_list_t **) realloc(tasks, nb_queues * sizeof(*tasks)),"");
tasks[newQueue]= new task_list_t; tasks[newQueue]= new task_list_t;
pthread_mutex_unlock (&lock_nb_queues); pthread_mutex_unlock (&lock_nb_queues);
LOG_I(TMR,"Starting itti queue: %s as task %d\n", tasks_info->name, newQueue); LOG_I(TMR,"Starting itti queue: %s as task %d\n", taskInfo->name, newQueue);
pthread_mutex_init(&tasks[newQueue]->queue_cond_lock, NULL); pthread_mutex_init(&tasks[newQueue]->queue_cond_lock, NULL);
memcpy(&tasks[newQueue]->admin, tasks_info, sizeof(task_info_t)); memcpy(&tasks[newQueue]->admin, taskInfo, sizeof(task_info_t));
AssertFatal( ( tasks[newQueue]->epoll_fd = epoll_create1(0) ) >=0, ""); AssertFatal( ( tasks[newQueue]->epoll_fd = epoll_create1(0) ) >=0, "");
AssertFatal( ( tasks[newQueue]->sem_fd = eventfd(0, EFD_SEMAPHORE) ) >=0, ""); AssertFatal( ( tasks[newQueue]->sem_fd = eventfd(0, EFD_SEMAPHORE) ) >=0, "");
itti_subscribe_event_fd((task_id_t)newQueue, tasks[newQueue]->sem_fd); itti_subscribe_event_fd((task_id_t)newQueue, tasks[newQueue]->sem_fd);
...@@ -356,14 +356,13 @@ extern "C" { ...@@ -356,14 +356,13 @@ extern "C" {
} }
int itti_init(task_id_t task_max, int itti_init(task_id_t task_max,
MessagesIds messages_id_max, const task_info_t *tasks
const task_info_t *tasks_info, ) {
const message_info_t *messages_info) {
pthread_mutex_init(&lock_nb_queues, NULL); pthread_mutex_init(&lock_nb_queues, NULL);
nb_queues=0; nb_queues=0;
for(int i=0; i<task_max; ++i) { for(int i=0; i<task_max; ++i) {
itti_create_queue(&tasks_info[i]); itti_create_queue(&tasks[i]);
} }
return 0; return 0;
......
...@@ -264,7 +264,7 @@ void *rrc_enb_process_itti_msg(void *); ...@@ -264,7 +264,7 @@ void *rrc_enb_process_itti_msg(void *);
#include <openair3/NGAP/ngap_gNB.h> #include <openair3/NGAP/ngap_gNB.h>
#ifdef ITTI_SIM #ifdef ITTI_SIM
#include <openair2/COMMON/itti_sim_messages_types.h> #include <openair2/COMMON/itti_sim_messages_types.h>
#endif #endif
/* /*
...@@ -301,7 +301,7 @@ typedef struct { ...@@ -301,7 +301,7 @@ typedef struct {
//TASK_DEF(TASK_RRC_ENB, TASK_PRIORITY_MED, 200, NULL, NULL) //TASK_DEF(TASK_RRC_ENB, TASK_PRIORITY_MED, 200, NULL, NULL)
//TASK_DEF(TASK_GTPV1_U, TASK_PRIORITY_MED, 1000,NULL, NULL) //TASK_DEF(TASK_GTPV1_U, TASK_PRIORITY_MED, 1000,NULL, NULL)
//TASK_DEF(TASK_UDP, TASK_PRIORITY_MED, 1000, NULL, NULL) //TASK_DEF(TASK_UDP, TASK_PRIORITY_MED, 1000, NULL, NULL)
void * rrc_enb_process_msg(void*); void *rrc_enb_process_msg(void *);
#define FOREACH_TASK(TASK_DEF) \ #define FOREACH_TASK(TASK_DEF) \
TASK_DEF(TASK_UNKNOWN, TASK_PRIORITY_MED, 50, NULL, NULL) \ TASK_DEF(TASK_UNKNOWN, TASK_PRIORITY_MED, 50, NULL, NULL) \
TASK_DEF(TASK_TIMER, TASK_PRIORITY_MED, 10, NULL, NULL) \ TASK_DEF(TASK_TIMER, TASK_PRIORITY_MED, 10, NULL, NULL) \
...@@ -566,8 +566,7 @@ void *malloc_or_fail(size_t size); ...@@ -566,8 +566,7 @@ void *malloc_or_fail(size_t size);
int memory_read(const char *datafile, void *data, size_t size); int memory_read(const char *datafile, void *data, size_t size);
int itti_free(task_id_t task_id, void *ptr); int itti_free(task_id_t task_id, void *ptr);
int itti_init(task_id_t task_max, MessagesIds messages_id_max, const task_info_t *tasks_info, int itti_init(task_id_t task_max, const task_info_t *tasks_info);
const message_info_t *messages_info);
int timer_setup( int timer_setup(
uint32_t interval_sec, uint32_t interval_sec,
uint32_t interval_us, uint32_t interval_us,
......
...@@ -1141,7 +1141,7 @@ int main ( int argc, char **argv ) { ...@@ -1141,7 +1141,7 @@ int main ( int argc, char **argv ) {
if (opp_enabled ==1) if (opp_enabled ==1)
reset_opp_meas(); reset_opp_meas();
itti_init(TASK_MAX, MESSAGES_ID_MAX, tasks_info, messages_info); itti_init(TASK_MAX, tasks_info);
init_opt(); init_opt();
#ifndef PACKAGE_VERSION #ifndef PACKAGE_VERSION
# define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL" # define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL"
......
...@@ -863,7 +863,7 @@ int main( int argc, char **argv ) ...@@ -863,7 +863,7 @@ int main( int argc, char **argv )
} }
cpuf=get_cpu_freq_GHz(); cpuf=get_cpu_freq_GHz();
itti_init(TASK_MAX, MESSAGES_ID_MAX, tasks_info, messages_info); itti_init(TASK_MAX, tasks_info);
// initialize mscgen log after ITTI // initialize mscgen log after ITTI
MSC_INIT(MSC_E_UTRAN, ADDED_QUEUES_MAX+TASK_MAX); MSC_INIT(MSC_E_UTRAN, ADDED_QUEUES_MAX+TASK_MAX);
......
...@@ -514,7 +514,7 @@ int main( int argc, char **argv ) { ...@@ -514,7 +514,7 @@ int main( int argc, char **argv ) {
initTpool(params_dl, Tpool_dl, false); initTpool(params_dl, Tpool_dl, false);
#endif #endif
cpuf=get_cpu_freq_GHz(); cpuf=get_cpu_freq_GHz();
itti_init(TASK_MAX, MESSAGES_ID_MAX, tasks_info, messages_info); itti_init(TASK_MAX, tasks_info);
init_opt() ; init_opt() ;
load_nrLDPClib(); load_nrLDPClib();
......
...@@ -928,7 +928,7 @@ int main( int argc, char **argv ) { ...@@ -928,7 +928,7 @@ int main( int argc, char **argv ) {
get_common_options(SOFTMODEM_GNB_BIT ); get_common_options(SOFTMODEM_GNB_BIT );
AssertFatal(!CONFIG_ISFLAGSET(CONFIG_ABORT),"Getting configuration failed\n"); AssertFatal(!CONFIG_ISFLAGSET(CONFIG_ABORT),"Getting configuration failed\n");
cpuf=get_cpu_freq_GHz(); cpuf=get_cpu_freq_GHz();
itti_init(TASK_MAX, MESSAGES_ID_MAX, tasks_info, messages_info); itti_init(TASK_MAX, tasks_info);
set_taus_seed (0); set_taus_seed (0);
init_opt(); init_opt();
init_pdcp(); init_pdcp();
......
...@@ -905,7 +905,6 @@ int main(int argc, char **argv) { ...@@ -905,7 +905,6 @@ int main(int argc, char **argv) {
// moreover you need to init itti with the following line // moreover you need to init itti with the following line
// however itti will catch all signals, so ctrl-c won't work anymore // however itti will catch all signals, so ctrl-c won't work anymore
// alternatively you can disable ITTI completely in CMakeLists.txt // alternatively you can disable ITTI completely in CMakeLists.txt
//itti_init(TASK_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, NULL);
T_stdout = 1; T_stdout = 1;
if (common_flag == 0) { if (common_flag == 0) {
......
...@@ -689,7 +689,6 @@ int main(int argc, char **argv) ...@@ -689,7 +689,6 @@ int main(int argc, char **argv)
// moreover you need to init itti with the following line // moreover you need to init itti with the following line
// however itti will catch all signals, so ctrl-c won't work anymore // however itti will catch all signals, so ctrl-c won't work anymore
// alternatively you can disable ITTI completely in CMakeLists.txt // alternatively you can disable ITTI completely in CMakeLists.txt
//itti_init(TASK_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, NULL);
if (common_flag == 0) { if (common_flag == 0) {
switch (N_RB_DL) { switch (N_RB_DL) {
......
...@@ -997,7 +997,6 @@ int main(int argc, char **argv) { ...@@ -997,7 +997,6 @@ int main(int argc, char **argv) {
// moreover you need to init itti with the following line // moreover you need to init itti with the following line
// however itti will catch all signals, so ctrl-c won't work anymore // however itti will catch all signals, so ctrl-c won't work anymore
// alternatively you can disable ITTI completely in CMakeLists.txt // alternatively you can disable ITTI completely in CMakeLists.txt
//itti_init(TASK_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, NULL);
if (common_flag == 0) { if (common_flag == 0) {
switch (N_RB_DL) { switch (N_RB_DL) {
......
...@@ -283,7 +283,6 @@ int main(int argc, char **argv) { ...@@ -283,7 +283,6 @@ int main(int argc, char **argv) {
} }
logInit(); logInit();
//itti_init(TASK_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, NULL);
g_log->log_component[PHY].level = LOG_DEBUG; g_log->log_component[PHY].level = LOG_DEBUG;
g_log->log_component[PHY].flag = LOG_HIGH; g_log->log_component[PHY].flag = LOG_HIGH;
......
...@@ -409,7 +409,6 @@ int main(int argc, char **argv) { ...@@ -409,7 +409,6 @@ int main(int argc, char **argv) {
// enable these lines if you need debug info // enable these lines if you need debug info
// however itti will catch all signals, so ctrl-c won't work anymore // however itti will catch all signals, so ctrl-c won't work anymore
// alternatively you can disable ITTI completely in CMakeLists.txt // alternatively you can disable ITTI completely in CMakeLists.txt
// itti_init(TASK_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, NULL);
// set_comp_log(PHY,LOG_DEBUG,LOG_HIGH,1); // set_comp_log(PHY,LOG_DEBUG,LOG_HIGH,1);
// set_glog(LOG_DEBUG,LOG_HIGH); // set_glog(LOG_DEBUG,LOG_HIGH);
//hapZEbm:n:Y:X:x:s:w:e:q:d:D:O:c:r:i:f:y:c:oA:C:R:g:N:l:S:T:QB:PI:LF //hapZEbm:n:Y:X:x:s:w:e:q:d:D:O:c:r:i:f:y:c:oA:C:R:g:N:l:S:T:QB:PI:LF
......
...@@ -557,7 +557,7 @@ int main( int argc, char **argv ) ...@@ -557,7 +557,7 @@ int main( int argc, char **argv )
} }
cpuf=get_cpu_freq_GHz(); cpuf=get_cpu_freq_GHz();
itti_init(TASK_MAX, MESSAGES_ID_MAX, tasks_info, messages_info); itti_init(TASK_MAX, tasks_info);
// initialize mscgen log after ITTI // initialize mscgen log after ITTI
MSC_INIT(MSC_E_UTRAN, ADDED_QUEUES_MAX+TASK_MAX); MSC_INIT(MSC_E_UTRAN, ADDED_QUEUES_MAX+TASK_MAX);
......
...@@ -1204,7 +1204,7 @@ int main( int argc, char **argv ) ...@@ -1204,7 +1204,7 @@ int main( int argc, char **argv )
logInit(); logInit();
set_glog(LOG_TRACE, LOG_MED); set_glog(LOG_TRACE, LOG_MED);
itti_init(TASK_MAX, MESSAGES_ID_MAX, tasks_info, messages_info); itti_init(TASK_MAX, tasks_info);
set_comp_log(ENB_APP, LOG_TRACE, LOG_MED, 1); set_comp_log(ENB_APP, LOG_TRACE, LOG_MED, 1);
set_comp_log(S1AP, LOG_TRACE, LOG_MED, 1); set_comp_log(S1AP, LOG_TRACE, LOG_MED, 1);
......
...@@ -68,7 +68,7 @@ int main(int argc, char *argv[]) ...@@ -68,7 +68,7 @@ int main(int argc, char *argv[])
/* Calling each layer init function */ /* Calling each layer init function */
log_init(&mme_config); log_init(&mme_config);
itti_init(TASK_MAX, MESSAGES_ID_MAX, tasks_info, messages_info); itti_init(TASK_MAX, tasks_info);
sctp_init(&mme_config); sctp_init(&mme_config);
udp_init(&mme_config); udp_init(&mme_config);
s1ap_mme_init(&mme_config); s1ap_mme_init(&mme_config);
......
...@@ -309,7 +309,7 @@ int main( int argc, char **argv ) ...@@ -309,7 +309,7 @@ int main( int argc, char **argv )
/* Read eNB configuration file */ /* Read eNB configuration file */
enb_properties = enb_config_init(conf_config_file_name); enb_properties = enb_config_init(conf_config_file_name);
itti_init(TASK_MAX, MESSAGES_ID_MAX, tasks_info, messages_info); itti_init(TASK_MAX, tasks_info);
itti_wait_ready(1); itti_wait_ready(1);
......
...@@ -544,7 +544,7 @@ int main ( int argc, char **argv ) ...@@ -544,7 +544,7 @@ int main ( int argc, char **argv )
cpuf=get_cpu_freq_GHz(); cpuf=get_cpu_freq_GHz();
printf("ITTI init, useMME: %i\n",EPC_MODE_ENABLED); printf("ITTI init, useMME: %i\n",EPC_MODE_ENABLED);
itti_init(TASK_MAX, MESSAGES_ID_MAX, tasks_info, messages_info); itti_init(TASK_MAX, tasks_info);
// allows to forward in wireshark L2 protocol for decoding // allows to forward in wireshark L2 protocol for decoding
// initialize mscgen log after ITTI // initialize mscgen log after ITTI
if (get_softmodem_params()->start_msc) { if (get_softmodem_params()->start_msc) {
......
...@@ -601,7 +601,7 @@ int main( int argc, char **argv ) { ...@@ -601,7 +601,7 @@ int main( int argc, char **argv ) {
pthread_mutex_init(&sync_mutex, NULL); pthread_mutex_init(&sync_mutex, NULL);
printf("ITTI init\n"); printf("ITTI init\n");
itti_init(TASK_MAX, MESSAGES_ID_MAX, tasks_info, messages_info); itti_init(TASK_MAX, tasks_info);
// initialize mscgen log after ITTI // initialize mscgen log after ITTI
if (get_softmodem_params()->start_msc) { if (get_softmodem_params()->start_msc) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment