lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [lwip-users] sys_timeout firing too often.


From: Nick Thomas
Subject: RE: [lwip-users] sys_timeout firing too often.
Date: Mon, 8 Sep 2008 18:32:56 +0100


> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden Behalf
> Of address@hidden
> Sent: 08 September 2008 17:05
> To: Mailing list for lwIP users
> Subject: Re: [lwip-users] sys_timeout firing too often.
>
>
> Nick, could you tell us which version of lwIP you are using? I think I
> remember the calls to sys_mbox_fetch in api_lib.c being changed to
> sys_arch_mbox_fetch in 1.3.0, so you might be using an old, pre-1.3.0
> version?
>
Hi, this is a version for OS20, for ST chips. I don't know what version it
is - I just inheritted it.

> As to the actual problem: your port must have something seriously messed
> up: I could imagine either sys_arch_timeouts() returning the same struct
> sys_timeouts* for all tasks (which is an error!) or your system time
> (used in sys_arch_mbox_fetch) is somehow calculated wrong... (the return
> value of sys_arch_mbox_fetch should indicate how long you have been
> waiting). I suspect the first, though.

I think the first, I found this sys_arch.c:
-- SNIP --
/* As long as we do not use PPP, SLIP, or any other part of LWIP that
creates
 * additional threads, we can get away with one global timeouts value.
Otherwise
 * we have to make this per-thread */
static struct sys_timeouts arch_global_timeouts = {0};

-- END --
And further down:

-- SNIP --

struct sys_timeouts *sys_arch_timeouts(void)
{
        return &arch_global_timeouts;
}
-- END --

This looks like the smoking gun.

Looks like I have quite a lot of work to do :(

>
> However, the 'fix' you suggested is NOT a good solution since this could
> lead to a deadlock: image one thread is waiting on the receive-mbox of a
> netconn (which waits forever): tcpip_thread would block forever and
> couldn't process new packets! You really should check the two things
> described above!

I didn't sugggest a 'fix' fix at all. I merely detailed something I used to
try to prove that something doesn't work.

>
> Simon
>
>
> Kieran Mansley wrote:
> > On Mon, 2008-09-08 at 15:47 +0100, Nick Thomas wrote:
> >
> >> sys_timeout firing too often - again.
> >>
> >> I think this is because sys_mbox_fetch() is being called by
> two tasks, which
> >> are tripping over each other.
> >> There is a tcpip_thread (in tcpip.c) which keeps calling
> sys_mbox_thread()
> >> in a while(1) loop, and there are lots of calls to sys_mbox_fetch() in
> >> api_lib.c .
> >>
> >
> > I don't see any calls to sys_mbox_fetch() in api_lib.c
> >
> > Kieran
> >
> >
> >
> > _______________________________________________
> > lwip-users mailing list
> > address@hidden
> > http://lists.nongnu.org/mailman/listinfo/lwip-users
> >
> >
>
>
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users





reply via email to

[Prev in Thread] Current Thread [Next in Thread]