This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Re: timeout.c in bsd_tcpip
Hi Andrew;
On Thu, May 08, 2003 at 06:11:54PM +0200, Andrew Lunn wrote:
> On Thu, May 08, 2003 at 11:42:15AM +0900, Motoya Kurotsu wrote:
> > Hi all;
> >
> > The attachment is the patch to fix the problem that some timers
> > such as pffasttimo, pfslowtimo, arptimer, etc. don't work
> > in freebsd net stack. This problem can be observed by enabling
> > TIMEOUT_DEBUG in timeout.c.
>
> Could you explain this a bit more. I've read the code and don't see
> what the problem is. Please explain how its wrong, what it does as
> opposed to what is should do.
>
Sure.
The attachment the two logs of an application run on my machine.
Headed by BEFORE is the one without my patch, and headed by AFTER
is the one with my patch. You can see some timers such as pffasttimo,
pfslowtimo, in_rtqtimo and arptimer, which is expected to be kicked off
at init routine such as domaininit(), in_inithead() or arp_ifinit()
by calling the timeout(), are missing at BEFORE. This is because
timeout() fails to allocate time entry when it is called second time
or later. You can see if_slowtimo which is kicked off by first call of
timeout() in both cases. This is because the trace is done
not on the alley but on the list by following e->next in timeout(),
failing to allocate new empty entry. The trace should be done
on the alley(_timeout) by not following e->next, I think.
So should be done in untimeout(), either.
On the other hand, in do_timeout(), the trace should be done on the
list headed by timeout from the top, not _timeout.
Motoya Kurotsu
Allied Telesis K.K.
BEFORE :
.......................
[cyg_net_init] Init: loopattach(0x00000000)
[cyg_net_init] Init: ifinit(0x00000000)
IFP: 0x80581a9c, next: 0x80a26d10
IFP: 0x80a26d10, next: 0x00000000
cyg_callout_reset(0x80a23398, 100, 0x8052d250, 0x00000000) <== if_slowtimo
0x80a23398: delta: 100, fun: 0x8052d250, param: 0x00000000
delta: 100, time: 0, last_delta: 0
[cyg_net_init] Init: domaininit(0x00000000)
[cyg_net_init] Init: cyg_net_add_domain(0x80583020)
New domain internet at 0x00000000
[cyg_net_init] Init: cyg_net_add_domain(0x80582b24)
New domain route at 0x00000000
[cyg_net_init] Init: cyg_route_init(0x00000000)
[cyg_net_init] Done
.......................
cyg_callout_reset(0x80a23398, 100, 0x8052d250, 0x00000000)
0x80a23398: delta: 100, fun: 0x8052d250, param: 0x00000000
Timeout list after do_timeout
0x80a23398: delta: 100, fun: 0x8052d250, param: 0x00000000
cyg_callout_reset(0x80a23398, 100, 0x8052d250, 0x00000000)
0x80a23398: delta: 100, fun: 0x8052d250, param: 0x00000000
Timeout list after do_timeout
0x80a23398: delta: 100, fun: 0x8052d250, param: 0x00000000
.......................
AFTER:
.......................
[cyg_net_init] Init: loopattach(0x00000000)
[cyg_net_init] Init: ifinit(0x00000000)
IFP: 0x80581aac, next: 0x80a26d10
IFP: 0x80a26d10, next: 0x00000000
cyg_callout_reset(0x80a23398, 100, 0x8052d25c, 0x00000000) <== if_slowtimo
0x80a23398: delta: 100, fun: 0x8052d25c, param: 0x00000000
delta: 100, time: 0, last_delta: 0
[cyg_net_init] Init: domaininit(0x00000000)
delta changed from 1 to 1, now: 0, then: 0, last_delta: 100
0x80a23398: delta: 100, fun: 0x8052d25c, param: 0x00000000
cyg_callout_reset(0x80a233b0, 1, 0x8053bea8, 0x00000000) <== pffasttimo
0x80a233b0: delta: 1, fun: 0x8053bea8, param: 0x00000000
0x80a23398: delta: 100, fun: 0x8052d25c, param: 0x00000000
delta: 1, time: 0, last_delta: 0
delta changed from 1 to 1, now: 0, then: 0, last_delta: 1
0x80a233b0: delta: 1, fun: 0x8053bea8, param: 0x00000000
0x80a23398: delta: 100, fun: 0x8052d25c, param: 0x00000000
cyg_callout_reset(0x80a233c8, 1, 0x8053be14, 0x00000000) <== pfslowtimo
0x80a233c8: delta: 1, fun: 0x8053be14, param: 0x00000000
0x80a233b0: delta: 1, fun: 0x8053bea8, param: 0x00000000
0x80a23398: delta: 100, fun: 0x8052d25c, param: 0x00000000
[cyg_net_init] Init: cyg_net_add_domain(0x80583030)
New domain internet at 0x00000000
[cyg_net_init] Init: cyg_net_add_domain(0x80582b34)
New domain route at 0x00000000
[cyg_net_init] Init: cyg_route_init(0x00000000)
delta changed from 60001 to 60001, now: 0, then: 0, last_delta: 1
0x80a233c8: delta: 1, fun: 0x8053be14, param: 0x00000000
0x80a233b0: delta: 1, fun: 0x8053bea8, param: 0x00000000
0x80a23398: delta: 100, fun: 0x8052d25c, param: 0x00000000
cyg_callout_reset(0x80a233e0, 60001, 0x805362d8, 0x809ec710) <== in_rtqtimo
0x80a233e0: delta: 60001, fun: 0x805362d8, param: 0x809ec710
0x80a233c8: delta: 1, fun: 0x8053be14, param: 0x00000000
0x80a233b0: delta: 1, fun: 0x8053bea8, param: 0x00000000
0x80a23398: delta: 100, fun: 0x8052d25c, param: 0x00000000
[cyg_net_init] Done
.......................
cyg_callout_reset(0x80a233f8, 103, 0x8054cb8c, 0x00000000) <== arptimer
0x80a233f8: delta: 103, fun: 0x8054cb8c, param: 0x00000000
0x80a233b0: delta: 20, fun: 0x8053bea8, param: 0x00000000
0x80a233c8: delta: 50, fun: 0x8053be14, param: 0x00000000
0x80a233e0: delta: 60000, fun: 0x805362d8, param: 0x809ec710
0x80a23398: delta: 99, fun: 0x8052d25c, param: 0x00000000
.......................
cyg_callout_reset(0x80a233b0, 20, 0x8053bea8, 0x00000000)
0x80a233b0: delta: 20, fun: 0x8053bea8, param: 0x00000000
0x80a233f8: delta: 83, fun: 0x8054cb8c, param: 0x00000000
0x80a233c8: delta: 30, fun: 0x8053be14, param: 0x00000000
0x80a233e0: delta: 59980, fun: 0x805362d8, param: 0x809ec710
0x80a23398: delta: 79, fun: 0x8052d25c, param: 0x00000000
Timeout list after do_timeout
0x80a233b0: delta: 20, fun: 0x8053bea8, param: 0x00000000
0x80a233f8: delta: 63, fun: 0x8054cb8c, param: 0x00000000
0x80a233c8: delta: 10, fun: 0x8053be14, param: 0x00000000
0x80a233e0: delta: 59960, fun: 0x805362d8, param: 0x809ec710
0x80a23398: delta: 59, fun: 0x8052d25c, param: 0x00000000
cyg_callout_reset(0x80a233c8, 50, 0x8053be14, 0x00000000)
0x80a233c8: delta: 50, fun: 0x8053be14, param: 0x00000000
0x80a233b0: delta: 10, fun: 0x8053bea8, param: 0x00000000
0x80a233f8: delta: 53, fun: 0x8054cb8c, param: 0x00000000
0x80a233e0: delta: 59960, fun: 0x805362d8, param: 0x809ec710
0x80a23398: delta: 59, fun: 0x8052d25c, param: 0x00000000
Timeout list after do_timeout
0x80a233c8: delta: 50, fun: 0x8053be14, param: 0x00000000
0x80a233b0: delta: 10, fun: 0x8053bea8, param: 0x00000000
0x80a233f8: delta: 53, fun: 0x8054cb8c, param: 0x00000000
0x80a233e0: delta: 59950, fun: 0x805362d8, param: 0x809ec710
0x80a23398: delta: 49, fun: 0x8052d25c, param: 0x00000000