diff --git a/common/utils/itti/intertask_interface.c b/common/utils/itti/intertask_interface.c index d09110d442877599085f7a919543a2ff94ef83aa..5b042baf12916fd7817db6950b9021c5d9ba2423 100644 --- a/common/utils/itti/intertask_interface.c +++ b/common/utils/itti/intertask_interface.c @@ -250,9 +250,8 @@ int itti_send_msg_to_task(task_id_t task_id, instance_t instance, MessageDef *me pthread_mutex_lock (&itti_desc.tasks[task_id].message_queue_mutex); /* Check the number of messages in the queue */ - DevCheck((itti_desc.tasks[task_id].message_in_queue * sizeof(MessageDef)) < ITTI_QUEUE_SIZE_PER_TASK, - (itti_desc.tasks[task_id].message_in_queue * sizeof(MessageDef)), ITTI_QUEUE_SIZE_PER_TASK, - itti_desc.tasks[task_id].message_in_queue); + DevCheck(itti_desc.tasks[task_id].message_in_queue < itti_desc.tasks_info[task_id].queue_size, + task_id, itti_desc.tasks[task_id].message_in_queue, itti_desc.tasks_info[task_id].queue_size); #endif /* Allocate new list element */ @@ -604,10 +603,8 @@ int itti_init(task_id_t task_max, thread_id_t thread_max, MessagesIds messages_i for (i = TASK_FIRST; i < itti_desc.task_max; i++) { #if defined(ENABLE_EVENT_FD) - ITTI_DEBUG("Creating queue of message of size %u\n", - ITTI_QUEUE_SIZE_PER_TASK / (sizeof(MessageDef) + sizeof(struct message_list_s))); - if (lfds611_queue_new(&itti_desc.tasks[i].message_queue, - ITTI_QUEUE_SIZE_PER_TASK / (sizeof(MessageDef) + sizeof(struct message_list_s))) < 0) + ITTI_DEBUG("Creating queue of message of size %u\n", itti_desc.tasks_info[i].queue_size); + if (lfds611_queue_new(&itti_desc.tasks[i].message_queue, itti_desc.tasks_info[i].queue_size) < 0) { ITTI_ERROR("lfds611_queue_new failed for task %u\n", i); DevAssert(0 == 1); diff --git a/common/utils/itti/intertask_interface.h b/common/utils/itti/intertask_interface.h index f046fc106049f597a255ba52408e13439d9b4db6..1a217556e8806da6a27291a60888d3edb6a50564 100644 --- a/common/utils/itti/intertask_interface.h +++ b/common/utils/itti/intertask_interface.h @@ -57,7 +57,7 @@ typedef unsigned long message_number_t; #define MESSAGE_NUMBER_SIZE (sizeof(unsigned long)) -enum message_priorities { +typedef enum message_priorities_e { MESSAGE_PRIORITY_MAX = 100, MESSAGE_PRIORITY_MAX_LEAST = 85, MESSAGE_PRIORITY_MED_PLUS = 70, @@ -65,18 +65,18 @@ enum message_priorities { MESSAGE_PRIORITY_MED_LEAST = 40, MESSAGE_PRIORITY_MIN_PLUS = 25, MESSAGE_PRIORITY_MIN = 10, -}; +} message_priorities_t; typedef struct message_info_s { task_id_t id; - uint32_t priority; + message_priorities_t priority; /* Message payload size */ MessageHeaderSize size; /* Printable name */ const char * const name; } message_info_t; -enum task_priorities { +typedef enum task_priorities_e { TASK_PRIORITY_MAX = 100, TASK_PRIORITY_MAX_LEAST = 85, TASK_PRIORITY_MED_PLUS = 70, @@ -84,10 +84,12 @@ enum task_priorities { TASK_PRIORITY_MED_LEAST = 40, TASK_PRIORITY_MIN_PLUS = 25, TASK_PRIORITY_MIN = 10, -}; +} task_priorities_t; typedef struct task_info_s { thread_id_t thread; + task_priorities_t priority; + unsigned int queue_size; /* Printable name */ const char * const name; } task_info_t; diff --git a/common/utils/itti/intertask_interface_init.h b/common/utils/itti/intertask_interface_init.h index 70a88ad3e2a7386723fc2c1dc6210ca325cc54b8..9fd6bb385827a7c2810d70e06f470171494e33df 100644 --- a/common/utils/itti/intertask_interface_init.h +++ b/common/utils/itti/intertask_interface_init.h @@ -56,9 +56,9 @@ const char * const messages_definition_xml = { /* Map task id to printable name. */ const task_info_t tasks_info[] = { - {0, "TASK_UNKNOWN"}, -#define TASK_DEF(tHREADiD, pRIO) {tHREADiD##_THREAD, #tHREADiD}, -#define SUB_TASK_DEF(tHREADiD, sUBtASKiD) {sUBtASKiD##_THREAD, #sUBtASKiD}, + {0, 0, 0, "TASK_UNKNOWN"}, +#define TASK_DEF(tHREADiD, pRIO, qUEUEsIZE) { tHREADiD##_THREAD, pRIO, qUEUEsIZE, #tHREADiD }, +#define SUB_TASK_DEF(tHREADiD, sUBtASKiD, qUEUEsIZE) { sUBtASKiD##_THREAD, 0, qUEUEsIZE, #sUBtASKiD }, #include <tasks_def.h> #undef SUB_TASK_DEF #undef TASK_DEF diff --git a/common/utils/itti/intertask_interface_types.h b/common/utils/itti/intertask_interface_types.h index 7a22dfd4c4fa6f242e405867772fc9e12f2e6cde..f7c8d4e5822f8d46edb41ac11d43bb1fee914a28 100644 --- a/common/utils/itti/intertask_interface_types.h +++ b/common/utils/itti/intertask_interface_types.h @@ -75,8 +75,8 @@ typedef enum { THREAD_FIRST = 1, THREAD_NULL = 0, -#define TASK_DEF(tHREADiD, pRIO) THREAD_##tHREADiD, -#define SUB_TASK_DEF(tHREADiD, sUBtASKiD) +#define TASK_DEF(tHREADiD, pRIO, qUEUEsIZE) THREAD_##tHREADiD, +#define SUB_TASK_DEF(tHREADiD, sUBtASKiD, qUEUEsIZE) #include <tasks_def.h> #undef SUB_TASK_DEF #undef TASK_DEF @@ -87,8 +87,8 @@ typedef enum //! Sub-tasks id, to defined offset form thread id typedef enum { -#define TASK_DEF(tHREADiD, pRIO) tHREADiD##_THREAD = THREAD_##tHREADiD, -#define SUB_TASK_DEF(tHREADiD, sUBtASKiD) sUBtASKiD##_THREAD = THREAD_##tHREADiD, +#define TASK_DEF(tHREADiD, pRIO, qUEUEsIZE) tHREADiD##_THREAD = THREAD_##tHREADiD, +#define SUB_TASK_DEF(tHREADiD, sUBtASKiD, qUEUEsIZE) sUBtASKiD##_THREAD = THREAD_##tHREADiD, #include <tasks_def.h> #undef SUB_TASK_DEF #undef TASK_DEF @@ -99,8 +99,8 @@ typedef enum { TASK_FIRST = 1, TASK_UNKNOWN = 0, -#define TASK_DEF(tHREADiD, pRIO) tHREADiD, -#define SUB_TASK_DEF(tHREADiD, sUBtASKiD) sUBtASKiD, +#define TASK_DEF(tHREADiD, pRIO, qUEUEsIZE) tHREADiD, +#define SUB_TASK_DEF(tHREADiD, sUBtASKiD, qUEUEsIZE) sUBtASKiD, #include <tasks_def.h> #undef SUB_TASK_DEF #undef TASK_DEF diff --git a/common/utils/itti/tasks_def.h b/common/utils/itti/tasks_def.h index 09de9ca4703f7e57dd18a47e43c4345b9dcfb6f2..e762a77b9df15a2b56596e539c479c41e38c88f4 100644 --- a/common/utils/itti/tasks_def.h +++ b/common/utils/itti/tasks_def.h @@ -1,4 +1,4 @@ // This task is mandatory and must always be placed in first position -TASK_DEF(TASK_TIMER, TASK_PRIORITY_MED) +TASK_DEF(TASK_TIMER, TASK_PRIORITY_MED, 10) // Dummy file for the generic intertask interface definition. Actual definition should be in top level build directory. diff --git a/openair-cn/COMMON/intertask_interface_conf.h b/openair-cn/COMMON/intertask_interface_conf.h index 0b906a1c44a716f7ac7de38298bb89b6c0d4c1e9..b58cc716a5b2d2d509d8cfaf53cb0682eceb8b73 100644 --- a/openair-cn/COMMON/intertask_interface_conf.h +++ b/openair-cn/COMMON/intertask_interface_conf.h @@ -42,8 +42,8 @@ * Intertask Interface Constants ******************************************************************************/ -#define ITTI_QUEUE_SIZE_PER_TASK (5 * 1024 * 1024) /* Limit the queue size to 5M */ #define ITTI_PORT (10007) + /* This is the queue size for signal dumper */ #define ITTI_QUEUE_SIZE_MAX (1 * 1024 * 1024) /* 1 MBytes */ #define ITTI_DUMP_MAX_CON (5) /* Max connections in parallel */ diff --git a/openair-cn/COMMON/tasks_def.h b/openair-cn/COMMON/tasks_def.h index 40461db8ce44daa8808396a056dbbb2a18ce9787..d3c626d6add1c367f7f89b26f71711973b180510 100644 --- a/openair-cn/COMMON/tasks_def.h +++ b/openair-cn/COMMON/tasks_def.h @@ -1,25 +1,25 @@ // This task is mandatory and must always be placed in first position -TASK_DEF(TASK_TIMER, TASK_PRIORITY_MED) +TASK_DEF(TASK_TIMER, TASK_PRIORITY_MED, 10) // Other possible tasks in the process /// GTPV1-U task -TASK_DEF(TASK_GTPV1_U, TASK_PRIORITY_MED) +TASK_DEF(TASK_GTPV1_U, TASK_PRIORITY_MED, 200) /// FW_IP task -TASK_DEF(TASK_FW_IP, TASK_PRIORITY_MED) +TASK_DEF(TASK_FW_IP, TASK_PRIORITY_MED, 200) /// MME Applicative task -TASK_DEF(TASK_MME_APP, TASK_PRIORITY_MED) +TASK_DEF(TASK_MME_APP, TASK_PRIORITY_MED, 200) /// NAS task -TASK_DEF(TASK_NAS, TASK_PRIORITY_MED) +TASK_DEF(TASK_NAS, TASK_PRIORITY_MED, 200) /// S1AP task -TASK_DEF(TASK_S11, TASK_PRIORITY_MED) +TASK_DEF(TASK_S11, TASK_PRIORITY_MED, 200) /// S1AP task -TASK_DEF(TASK_S1AP, TASK_PRIORITY_MED) +TASK_DEF(TASK_S1AP, TASK_PRIORITY_MED, 200) /// S6a task -TASK_DEF(TASK_S6A, TASK_PRIORITY_MED) +TASK_DEF(TASK_S6A, TASK_PRIORITY_MED, 200) /// SCTP task -TASK_DEF(TASK_SCTP, TASK_PRIORITY_MED) +TASK_DEF(TASK_SCTP, TASK_PRIORITY_MED, 200) /// Serving and Proxy Gateway Application task -TASK_DEF(TASK_SPGW_APP, TASK_PRIORITY_MED) +TASK_DEF(TASK_SPGW_APP, TASK_PRIORITY_MED, 200) /// UDP task -TASK_DEF(TASK_UDP, TASK_PRIORITY_MED) +TASK_DEF(TASK_UDP, TASK_PRIORITY_MED, 200) diff --git a/openair2/COMMON/intertask_interface_conf.h b/openair2/COMMON/intertask_interface_conf.h index bdf0d51f7e958a1f42992c663e1c8241ed1a227f..230e8c90c96cbb0c221c07f505e12c1e89711a2f 100644 --- a/openair2/COMMON/intertask_interface_conf.h +++ b/openair2/COMMON/intertask_interface_conf.h @@ -42,8 +42,8 @@ * Intertask Interface Constants ******************************************************************************/ -#define ITTI_QUEUE_SIZE_PER_TASK (5 * 1024 * 1024) /* Limit the queue size to 5M */ #define ITTI_PORT (10006) + /* This is the queue size for signal dumper */ #define ITTI_QUEUE_SIZE_MAX (1 * 1024 * 1024) /* 1 MBytes */ #define ITTI_DUMP_MAX_CON (5) /* Max connections in parallel */ diff --git a/openair2/COMMON/tasks_def.h b/openair2/COMMON/tasks_def.h index 8d964726536be5ac95c6f9f1363bbdd6670d2c31..0240673682303ef96a54ac67555a85e841c2f943 100644 --- a/openair2/COMMON/tasks_def.h +++ b/openair2/COMMON/tasks_def.h @@ -1,36 +1,36 @@ // This task is mandatory and must always be placed in first position -TASK_DEF(TASK_TIMER, TASK_PRIORITY_MAX) +TASK_DEF(TASK_TIMER, TASK_PRIORITY_MAX, 10) // Other possible tasks in the process /// Layer 2 and Layer 1 task supporting all the synchronous processing -TASK_DEF(TASK_L2L1, TASK_PRIORITY_MAX_LEAST) +TASK_DEF(TASK_L2L1, TASK_PRIORITY_MAX_LEAST, 10) //// Layer 2 and Layer 1 sub-tasks -SUB_TASK_DEF(TASK_L2L1, TASK_PDCP_UE) -SUB_TASK_DEF(TASK_L2L1, TASK_PDCP_ENB) +SUB_TASK_DEF(TASK_L2L1, TASK_PDCP_UE, 200) +SUB_TASK_DEF(TASK_L2L1, TASK_PDCP_ENB, 200) -SUB_TASK_DEF(TASK_L2L1, TASK_RLC_UE) -SUB_TASK_DEF(TASK_L2L1, TASK_RLC_ENB) +SUB_TASK_DEF(TASK_L2L1, TASK_RLC_UE, 200) +SUB_TASK_DEF(TASK_L2L1, TASK_RLC_ENB, 200) -SUB_TASK_DEF(TASK_L2L1, TASK_MAC_UE) -SUB_TASK_DEF(TASK_L2L1, TASK_MAC_ENB) +SUB_TASK_DEF(TASK_L2L1, TASK_MAC_UE, 200) +SUB_TASK_DEF(TASK_L2L1, TASK_MAC_ENB, 200) -SUB_TASK_DEF(TASK_L2L1, TASK_PHY_UE) -SUB_TASK_DEF(TASK_L2L1, TASK_PHY_ENB) +SUB_TASK_DEF(TASK_L2L1, TASK_PHY_UE, 200) +SUB_TASK_DEF(TASK_L2L1, TASK_PHY_ENB, 200) /// Radio Resource Control task for UE -TASK_DEF(TASK_RRC_UE, TASK_PRIORITY_MED) +TASK_DEF(TASK_RRC_UE, TASK_PRIORITY_MED, 200) /// Radio Resource Control task for eNodeB -TASK_DEF(TASK_RRC_ENB, TASK_PRIORITY_MED) +TASK_DEF(TASK_RRC_ENB, TASK_PRIORITY_MED, 200) /// Bearers Manager task -TASK_DEF(TASK_BM, TASK_PRIORITY_MED) +TASK_DEF(TASK_BM, TASK_PRIORITY_MED, 200) /// Non Access Stratum task for UE -TASK_DEF(TASK_NAS_UE, TASK_PRIORITY_MED) +TASK_DEF(TASK_NAS_UE, TASK_PRIORITY_MED, 200) /// S1ap task for eNodeB -TASK_DEF(TASK_S1AP, TASK_PRIORITY_MED) +TASK_DEF(TASK_S1AP, TASK_PRIORITY_MED, 200) /// Sctp task for eNodeB (Used by both S1AP and X2AP) -TASK_DEF(TASK_SCTP, TASK_PRIORITY_MED) +TASK_DEF(TASK_SCTP, TASK_PRIORITY_MED, 200)