[Top][All Lists]

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

Re: [lwip-users] MEMP_NUM_TCP_SEG setting

From: Kieran Mansley
Subject: Re: [lwip-users] MEMP_NUM_TCP_SEG setting
Date: Mon, 03 Sep 2007 08:46:43 +0100

On Fri, 2007-08-31 at 17:52 -0700, Siva Velusamy wrote:
> 1. After some random interval, a timer interrupt happens -> calls
> tcp_output -> goes to this loop:
>   /* useg should point to last segment on unacked queue */
>   useg = pcb->unacked;
>   if (useg != NULL) { 
>     for (; useg->next != NULL; useg = useg->next);
>   }
> This loop happens to be circular! Should I assume that I'm calling
> some lwip tcp function from a context that has not been properly
> guarded with mutexes? 

Yes.  Almost certainly you have a race between two threads, or perhaps
between your application thread and the timers, that you haven't
protected sufficiently.  As a result, they will both occasionally try
and modify a queue at the same time, and it will become corrupt,
containing a circular reference for example as you point out.

> 2. The second issue that I see (if I don't run into issue 1), is that
> the TX performance keeps dropping slowly. Over 10 minutes it drops
> about 10 Mbps or so..starting from lets say 55 Mbps to 45 Mbps, and
> continuing to drop. Any suggestions on what to look for here? Could it
> be that my timer interval is not quite right? 

Firstly I would make sure you've solved issue 1.  I wouldn't have
thought the timer interval was to blame for dropping performance.  I
think someone else has reported something similar recently but couldn't
get to the bottom of it and I can't remember the details now.
Personally I think it is most likely to be a memory leak or something
like that leading to a shortage of packet buffers or something like
that.  A corrupt queue could be to blame though (if it just kept getting
longer and longer, and we have to iterate it each time a packet is
received for example).


reply via email to

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