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
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users