Commit b5afe14d authored by winckel's avatar winckel

Replaced global ITTI queue size limit with a by task size limit.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4352 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent b025af70
......@@ -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);
......
......@@ -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;
......
......@@ -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
......
......@@ -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
......
// 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.
......@@ -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 */
......
// 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)
......@@ -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 */
......
// 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)
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