lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Race condition with lwIP-1.3.2 in PXELINUX-4.10-pre16+


From: address@hidden
Subject: Re: [lwip-users] Race condition with lwIP-1.3.2 in PXELINUX-4.10-pre16+ on VMware/KVM platforms
Date: Thu, 13 Oct 2011 06:15:11 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1

Gene Cumm wrote:

For the past several months, Syslinux has been trying to integrate lwIP into PXELINUX. At the moment, there appears to be a bug of some sort when using VMware platforms or some KVM platforms. Over the last few weeks, I've been working with hpa and trying to add additional debug checks to trace the program flow. I've noticed that it is able to send a TCP segment but then switches to receive the incoming segment before being added to unacked by the output thread. RTT from SYN to SYN/ACK is 0.023 ms per Wireshark on the host. The output thread does eventually return but doesn't do so in time before the socket is reset.

Examining top-of-git, I don't see anything that would change this behavior and I have attempted to integrate this version in my copy for now to hopefully make it easier to work with lwIP. I see at least three possible solutions:
1) Don't allow the interface driver to switch threads.
2) tcp_process() should handle the condition of the packet being in unsent. 3) Allow the output thread to wrap up a packet, queuing it into unacked, before tcp_process() searches unacked.

Any suggestions?

That all sounds like you allow multiple threads to use lwIP at the same time, which is not supported. Could it be that you call the input function from one thread while calling the write (or output) function from another thread? If so, you have to change your setup to pass RX packets into the tcpip_thread (using tcpip_input() as input function passed to netif_add()).

In general, lwIP does not include threading protection when modifying internal state variables. It relies on the API layer (and/or the lwIP port to your "hardware" or OS) to either process everything in one thread or take care of a global lock before using lwIP resources.

Simon



reply via email to

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