lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] tcp_enqueue fails at more than two tcp_enqueue's


From: Jimi Simpson
Subject: Re: [lwip-users] tcp_enqueue fails at more than two tcp_enqueue's
Date: Tue, 4 May 2010 22:20:56 +0100

Hi Kieran,

It's getting a little late and after a full day off debugging with this it has taken its toll :-( I did however find the problem - finally, and it's in tcp_receive. I initially hard coded the following line (immediate below), then debugged a little to establish that the following is necessary (one but next) - it's all preprocessor stuff:

} else if (((ackno - pcb->lastack+1) >= 0) && ((ackno - pcb->snd_nxt) <= 0)) {
//    } else if (TCP_SEQ_BETWEEN(ackno, pcb->lastack+1, pcb->snd_nxt)){

inside tcp.h I amended as follows:

#define TCP_SEQ_LT(a,b)     ((s32_t)((a)-(b)) < 0) -- no change
#define TCP_SEQ_LEQ(a,b)    ((s32_t)((a)-(b)) <= 0) -- no change
#define TCP_SEQ_GT(a,b)     ((s32_t)((a)-(b)) > 0) -- no change
#define TCP_SEQ_GEQ(a,b) (((s32_t)(a)-(b)) >= 0) -- this line, I have shifted the cast and this works now

I will endeavor to check a little further tomorrow, but this is now working well :-) - not sure if this is a core bug but at least I hope this lwip-user thread may be informative to others...

Best regards, Jimi

----- Original Message ----- From: "Kieran Mansley" <address@hidden>
To: "Mailing list for lwIP users" <address@hidden>
Sent: Tuesday, May 04, 2010 2:51 PM
Subject: Re: [lwip-users] tcp_enqueue fails at more than two tcp_enqueue's


On Tue, 2010-05-04 at 14:15 +0100, Jimi Simpson wrote:
Hi Kieran,

Thank you for the response.

I have 4 threads running:

That sounds fine, and your lwipopts settings look OK too.

Sorry for the lengthy email and lots of information, but your help is
greatly appreciated.

It looks from the debug output and packet capture as though lwIP is
sending some data, the other side is sending an ACK, but the stack is
not receiving or processing the ACK.  It therefore retransmits the old
packet, which the other side again ACKs, but again lwIP doesn't receive
or process the ACK and so it gets stuck in this cycle.

It would be worth turning on the LWIP_STATS code to see if there is some
resource that is running dry that would account for the dropped ACKs.
The debug log does suggest that tcp_input() is being called, but the
received packets aren't (after the first couple) recognised as
acknowledging data we have outstanding.  I would look through the code
and add more debugging to work out why these packets get ignored.

Kieran



_______________________________________________
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]