From 6360f319362fd13c86c3387a4bac57665d5ecd73 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Wed, 23 Sep 2009 18:12:37 +0200 Subject: conntrackd: add retention queue for TCP errors Under stress, the TCP stack may return EAGAIN if there is not space left in the sender buffer. We also enqueue any other error. Signed-off-by: Pablo Neira Ayuso --- src/read_config_yy.y | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/read_config_yy.y') diff --git a/src/read_config_yy.y b/src/read_config_yy.y index 0804689..5075cf0 100644 --- a/src/read_config_yy.y +++ b/src/read_config_yy.y @@ -72,7 +72,7 @@ static void __max_dedicated_links_reached(void); %token T_FROM T_USERSPACE T_KERNELSPACE T_EVENT_ITER_LIMIT T_DEFAULT %token T_NETLINK_OVERRUN_RESYNC T_NICE T_IPV4_DEST_ADDR T_IPV6_DEST_ADDR %token T_SCHEDULER T_TYPE T_PRIO T_NETLINK_EVENTS_RELIABLE -%token T_DISABLE_EXTERNAL_CACHE +%token T_DISABLE_EXTERNAL_CACHE T_ERROR_QUEUE_LENGTH %token T_IP T_PATH_VAL %token T_NUMBER @@ -584,7 +584,8 @@ tcp_line : T_TCP '{' tcp_options '}' conf.channel_type_global = CHANNEL_TCP; conf.channel[conf.channel_num].channel_type = CHANNEL_TCP; conf.channel[conf.channel_num].channel_flags = CHANNEL_F_BUFFERED | - CHANNEL_F_STREAM; + CHANNEL_F_STREAM | + CHANNEL_F_ERRORS; conf.channel_num++; }; @@ -600,7 +601,8 @@ tcp_line : T_TCP T_DEFAULT '{' tcp_options '}' conf.channel[conf.channel_num].channel_type = CHANNEL_TCP; conf.channel[conf.channel_num].channel_flags = CHANNEL_F_DEFAULT | CHANNEL_F_BUFFERED | - CHANNEL_F_STREAM; + CHANNEL_F_STREAM | + CHANNEL_F_ERRORS; conf.channel_default = conf.channel_num; conf.channel_num++; }; @@ -709,6 +711,12 @@ tcp_option: T_CHECKSUM T_OFF conf.channel[conf.channel_num].u.tcp.checksum = 1; }; +tcp_option: T_ERROR_QUEUE_LENGTH T_NUMBER +{ + __max_dedicated_links_reached(); + CONFIG(channelc).error_queue_length = $2; +}; + hashsize : T_HASHSIZE T_NUMBER { conf.hashsize = $2; @@ -1583,5 +1591,9 @@ init_config(char *filename) if (CONFIG(nl_overrun_resync) == 0) CONFIG(nl_overrun_resync) = 30; + /* default to 128 elements in the channel error queue */ + if (CONFIG(channelc).error_queue_length == 0) + CONFIG(channelc).error_queue_length = 128; + return 0; } -- cgit v1.2.3