diff --git a/exec/ipc.c b/exec/ipc.c index 495e4305..977f60c0 100644 --- a/exec/ipc.c +++ b/exec/ipc.c @@ -99,7 +99,9 @@ LOGSYS_DECLARE_SUBSYS ("IPC", LOG_INFO); /* * When there are this many entries left in a queue, turn on flow control */ +#ifndef FLOW_CONTROL_ENTRIES_ENABLE #define FLOW_CONTROL_ENTRIES_ENABLE 400 +#endif /* FLOW_CONTROL_ENTRIES_ENABLE */ /* * When there are this many entries in a queue, turn off flow control diff --git a/exec/main.h b/exec/main.h index e9b11d2b..73f964a0 100644 --- a/exec/main.h +++ b/exec/main.h @@ -48,7 +48,9 @@ * Size of the queue (entries) for I/O's to the API over socket IPC. */ +#ifndef SIZEQUEUE #define SIZEQUEUE 800 +#endif /* SIZEQUEUE */ #define SOCKET_SERVICE_INIT 254 diff --git a/exec/totemconfig.c b/exec/totemconfig.c index 146d1e46..a7a59323 100644 --- a/exec/totemconfig.c +++ b/exec/totemconfig.c @@ -528,9 +528,9 @@ int totem_config_validate ( totem_config->net_mtu = 1500; } - if ((MESSAGE_SIZE_MAX / totem_config->net_mtu) < totem_config->max_messages) { + if ((MESSAGE_QUEUE_MAX) < totem_config->max_messages) { sprintf (local_error_reason, "The max_messages parameter (%d messages) may not be greater then (%d messages).", - totem_config->max_messages, MESSAGE_SIZE_MAX / totem_config->net_mtu); + totem_config->max_messages, MESSAGE_QUEUE_MAX); goto parse_error; } diff --git a/exec/totemsrp.c b/exec/totemsrp.c index e42dbfa8..4810bb9b 100644 --- a/exec/totemsrp.c +++ b/exec/totemsrp.c @@ -822,7 +822,7 @@ int totemsrp_initialize ( * Must have net_mtu adjusted by totemrrp_initialize first */ queue_init (&instance->new_message_queue, - (MESSAGE_SIZE_MAX / (totem_config->net_mtu - 25) /* for totempg_mcat header */), + MESSAGE_QUEUE_MAX, sizeof (struct message_item)); return (0); diff --git a/include/corosync/engine/coroapi.h b/include/corosync/engine/coroapi.h index 2d095c98..dc96fdf5 100644 --- a/include/corosync/engine/coroapi.h +++ b/include/corosync/engine/coroapi.h @@ -52,7 +52,14 @@ struct corosync_tpg_group { #define PROCESSOR_COUNT_MAX 384 #define INTERFACE_MAX 2 -#define MESSAGE_SIZE_MAX 1024*1024 /* (1MB) */ + +#ifndef MESSAGE_SIZE_MAX +#define MESSAGE_SIZE_MAX 1024*1024 /* (1MB) */ +#endif /* MESSAGE_SIZE_MAX */ + +#ifndef MESSAGE_QUEUE_MAX +#define MESSAGE_QUEUE_MAX MESSAGE_SIZE_MAX / totem_config->net_mtu +#endif /* MESSAGE_QUEUE_MAX */ #define TOTEM_AGREED 0 #define TOTEM_SAFE 1 diff --git a/include/corosync/totem/totem.h b/include/corosync/totem/totem.h index a5a5511f..4a0715a7 100644 --- a/include/corosync/totem/totem.h +++ b/include/corosync/totem/totem.h @@ -36,7 +36,14 @@ #define TOTEM_H_DEFINED #include "totemip.h" +#ifndef MESSAGE_SIZE_MAX #define MESSAGE_SIZE_MAX 1024*1024 /* (1MB) */ +#endif /* MESSAGE_SIZE_MAX */ + +#ifndef MESSAGE_QUEUE_MAX +#define MESSAGE_QUEUE_MAX MESSAGE_SIZE_MAX / totem_config->net_mtu +#endif /* MESSAGE_QUEUE_MAX */ + #define PROCESSOR_COUNT_MAX 384 #define FRAME_SIZE_MAX 9000 #define TRANSMITS_ALLOWED 16