This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: FreeBSD Stack/ KeepAlive not working


we found in timeout.c, that the value of tcp_maxidle is always 0.
therefore the if clause in funtion tcp_timers()

 if (tp->t_idle >= tcp_keepidle + tcp_maxidle)
	goto dropit;

is always true and the connection is closed after tcp_keepidle time.
when we are changing the declaration of tcp_maxidle to following code:
	int	tcp_maxidle = tcp_keepcnt * tcp_keepintvl;
then KeepAlive is working correct.

But the question is now, why tcp_slowtimo() is never called (herein
tcp_maxidle would be set!)
Who knows?

Richard


-----Original Message-----
From: ecos-discuss-owner@ecos.sourceware.org
[mailto:ecos-discuss-owner@ecos.sourceware.org]On Behalf Of Andrew Lunn
Sent: Mittwoch, 13. Oktober 2004 10:17
To: Richard Rauch
Cc: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] FreeBSD Stack/ KeepAlive not working


On Tue, Oct 12, 2004 at 06:53:48PM +0200, Richard Rauch wrote:
> Hi All,
>
> first we find out, that the stack is not using the configured values for
the
> ticker from ecos ( e.g. CYGNUM_HAL_RTC_PERIOD ). The stack has fix values
> for it in support.c:
> int hz = 100;
> int tick = 10000;  // usec per "tick"

FreeBSD is pritty much hardcoded for 100 ticks per second. When this
code was ported from FreeBSD into eCos, the same limitation came with
it.

>
> We are working with a ticker of 250 us. So we have changed the values to
> int hz = 4000;
> int tick = 250;  // usec per "tick"
>
>
> But now the KeepAlive-Time is over one hour. This is too much for our
> application.
> We found fix settings in tcp_timer.h for the values and changed it to:
>
> #define	TCPTV_KEEP_INIT	( 10*hz)		/* initial connect keepalive */
> #define	TCPTV_KEEP_IDLE	(15*hz)		/* dflt time before probing */
> #define	TCPTV_KEEPINTVL	( 5*hz)		/* default probe interval */
> #define	TCPTV_KEEPCNT	3			/* max probes before drop */
>
> But now, when communication is idle on an established connection, the
stack
> is closing the connection after 20 seconds. We do not see a Keep Alive
> Telegram on Ethernet.

Have you checked to see if the timer is being added? How long it is
set for? This is probably your problem. Take a look at the code in
timeout.c

        Andrew

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss




-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]